![]() Have a look at Learn Prolog Now! if you are unsure about what this code means. The following Prolog code ensures that these connectives have their usual precedences: Will be used to represent the connectives, ,, and respectively. Next for Boolean combinations of simple formulas. ![]() For example, would be represented by the Prolog term love(john,mary), and would be represented by hate(peter,x). Given these conventions, it is obvious how atomic formulas should be represented. So it's our own responsibility to choose the atoms for constants distinct from those for variables when we write down formulas in Prolog. Note that this choice of representation won't allow our programs to distinguish constants from variables. Variables will also be represented by Prolog atoms. We do so in the easiest way possible: a first-order constant will be represented by the Prolog atom c, and a first-order predicate symbol will be represented by the Prolog atom p. This is what we deal with in this section.įirst, we must decide how to represent constant symbols, predicate symbols, and variables. ![]() In short, we will simply use Prolog terms for this purpose that resemble the formulas they stand for as closely as possible. So the next thing we need is a way of writing down formulas of first-order logic in Prolog. We would like to use first order logic as a semantic representation formalism, and we want to deal with it in Prolog.
0 Comments
Leave a Reply. |