Next: assert
Up: No Title
Previous: Removing duplicate items with
- Common practise in procedural programming to use global variables - i.e.
variables accessible from the entire program
- In Prolog usually use local variables - which are restricted to the clause
being used
- Therefore the need to be able to modify program (by adding variables or clauses
to it)
- This is very similar to functions performed in a database
- Operations performed usually involve changing the data already present within the
database - hence the need to modify the existing information
- A program in Prolog can be viewed as a database made of facts (knowledge) and
operations (relations) on this knowledge
- There are predicates in Prolog which help us achieve exactly this - i.e.
a program being added to or deleted from by the use of special queries
Achieved by the use of retract and assert and their variations.
Omer F Rana
Thu Feb 20 20:05:17 GMT 1997