|
A declarative language is unlike a more traditional programming language - it does not necessarily follow instructions in sequence.
More typically, it specifies a group of facts about something in the real world, and facts about the rules. These can then be questioned to provide answers.
For example, a system may include people, and say that person A is male, person B is female. It may then describe person C as being a parent to both persons A and B. These would be facts.
A rule could be written which states that a person X is a sister of person Y if the parent of person X matches the parent of person Y, and that person X is female.
This approach is taken with expert systems.
The most commonly known declarative language is Prolog.
|