Showing posts with label Meaning. Show all posts
Showing posts with label Meaning. Show all posts

Sunday, 18 January 2009

Procedural Meaning

The procedural meaning specifies how Prolog answers questions.
Input: a program and a goal list.
Output: a success/failure indicator and an instantiation of variables.
The meaning of the two output results is as follows:
The success/failure indicator is ‘yes’ if the goals are satisfiable and ‘no’ otherwise.
An instantiation of variables is only produced in the case of a successful termination; in the case of failure there is no instantiation.

Declerative Meaning

Declarative reading of the clause “P:-Q,R” are:
P is true if Q and R are true.
From Q and R follows P.
Procedural readings of this clause are:
To solve the problem P, first solve the subproblem Q and then R.
To satisfy P, satisfy Q and then R.


Note that ‘,’ character indicates AND operator.
Note that ‘;’ character indicates OR operator.
AND operator has a higher priority then the OR operator.
“P :- Q, R; S, T, U.” and “P :- (Q, R); (S, T, U).” clauses gives the same results.
Same clauses can be written as:
P :- Q, R.
P :- S, T, U.