Jump to content

Declarative programming

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Maxomai (talk | contribs) at 23:15, 14 April 2003 (First draft). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

Declarative programming is an approach to computer programming that takes a different approach from traditional imperative programming in C++ or Java. Whereas imperative programming gives the computer a list of instructions to execute in a particular order, declarative programming describes to the computer a set of conditions and lets the computer figure out how to satisfy them.

Declarative languages describe relationships between variables in terms of functions or inference rules. The language executor (an interpreter or compiler) applies some fixed algorithm to these relations to produce a result.

Examples of declarative programming languages include Haskell and Prolog.

Declarative programming languages are extensively used in solving Artificial Intelligence problems.