In some languages (e.g. Prolog) there are also ASSERTIONS, which can be used to give the computer information, e.g. the information
tom is the father of dick or, in Prolog: father(tom,dick)In some languages it is possible to store generalisations, or inference rules, like
a father is a male parent, or x is the father of y if x is a parent of y and x is male,or, in Prolog:
father(X,Y):-parent(X,Y),male(X).Such languages also allow the construction of QUESTIONS, such as
who is the father of joe?or, in Prolog:
?- father(X,joe).These are examples of the `declarative' style of programming.
Pop-11 is not based primarily on declarative programming, but there is a subset, called the `database package' which provides something like assertions and questions, and uses procedures like `add' mentioned above and others called remove, lookup, present, allpresent, foreach and forevery, all described below. (In the Birmingham Poprulebase package the database is re-implemented in a way that provides more efficient indexing.)
This Pop-11 database package is built on more primitive facilities, described in the next few chapters. A Prolog-like extension to the database was implemented by Steve Hardy in the library described in the online HELP SUPER file. A more sophisticated system, designed for building expert systems or problem solving programs based on "condition-action" rules can be found in the "newpsys" library (pronounced "newpeesys"), described in the online file HELP NEWPSYS.
Note: NEWPSYS has been made obsolete by the POPRULEBASE library available from the Birmingham Poplog FTP directory.
Finally, the Prolog subsystem of Poplog is available to Pop-11 programmers when needed for a richer style of declarative programming.