I have read a few books on Prolog:
"Prolog : a logical approach / Tony Dodd.",
"The Art of Prolog : advanced programming techniques / Leon Sterling,
Ehud Shapiro. 2nd ed.",
"Programming in Prolog / W.F. Clocksin, C.S. Mellish. 3rd rev.
ed.".
As far as I know, a Prolog program consists of rules that describe the
relations between some objects. When a goal is passed to the Prolog
system, it tries to satisfy the goal using an execution model (a
general algorithm). These books use some example Prolog programs to
explain how Prolog executes the programs. The books did not seem to
show the execution model for executing the programs. Which book
explains the execution model?
Thanks
David
Great books.
> As far as I know, a Prolog program consists of rules that describe the
> relations between some objects. When a goal is passed to the Prolog
> system, it tries to satisfy the goal using an execution model (a
> general algorithm). These books use some example Prolog programs to
> explain how Prolog executes the programs. The books did not seem to
> show the execution model for executing the programs. Which book
> explains the execution model?
>
> Thanks
> David
If the execution model of C is flow chart, one of Prolog may be trees:
a goal branches subgoals, and subsoals branch their subgoals. Then,
when a goal is passed by query to the program, Prolog top-level finds
all solutions satisfying the goal. The logical execution model is the
same as first-order predicate logic systems.
And if what you mentioned is about some actual (low level) execution
model of computers executing Prolog, you can read documents of the
Warren's Abstract Machine.
Above Art of Prolog does contain chapter 4 "The computation model
of logic programs".
The ISO standard had also some definitions of execution
model for Prolog. I am refering to the following version
which you should find on the internet:
Covington, M.A. et al. Second Committee
Draft of Part 1 of an International, Standard
for Prolog, ISO/IEC CD 13211-1, 1993
It uses some notions such as choicepoint and cutparent,
but ultimately maybe it also leaves some details open.
Best Regards
Please note that the various commitee drafts (CD) and draft
international standards (DIS) differ quite substantially
from the final standard. You get the official standard
from your national member body. At ansi.org you get 13211-1-1995
for USD 30.
http://webstore.ansi.org/RecordDetail.aspx?sku=INCITS%2fISO%2fIEC+13211-1-1995+(R2007)
For the OP reading chapter 4 of Art of Prolog should suffice.
Thanks a lot. I will read chapter 4 again.
David