DECLARATIVE PROGRAMMING Ivan Bratko Faculty of Computer and Info. Sc. University of Ljubljana PROGRAMMING PARADIGMS, COMPUTATION MODELS п‚§ Programming paradigms ~ computation models п‚§ Computation model = precise notion of вЂњprogramming paradigmвЂќ п‚§ A computation model is a formal system that defines how computations are done SOME COMPUTATION MODELS, PROGRAMMING PARADIGMS п‚§ п‚§ п‚§ п‚§ п‚§ п‚§ п‚§ п‚§ п‚§ п‚§ п‚§ Imperative programming Declarative programming Object-oriented programming Functional programming Logic programming Relational programming Constraint programming Concurrent programming Declarative concurrency Message-passing concurrency Shared-state concurrency TWO DEFINITIONS From Wikipedia п‚§ According to one definition, a program is "declarative" if it describes what something is like, rather than how to create it. п‚§ This is a different approach from traditional imperative programming languages such as Fortran, C, and Java, which require the programmer to specify an algorithm to be run. In short, imperative programs make the algorithm explicit and leave the goal implicit, while declarative programs make the goal explicit and leave the algorithm implicit. SECOND DEFINITION From Wikipedia п‚§ According to a different definition, a program is "declarative" if it is written in a functional programming language, logic programming language, or constraint programming language. п‚§ The phrase "declarative language" is sometimes used to describe all such programming languages as a group, and to contrast them against imperative languages.