Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

What is the execution model of Prolog?

34 views
Skip to first unread message

David

unread,
Nov 24, 2009, 9:15:33 AM11/24/09
to
hi,

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

YauHsienHuang

unread,
Nov 24, 2009, 11:03:35 AM11/24/09
to
On Nov 24, 10:15 pm, David <dtian.ty...@googlemail.com> wrote:
> hi,
>
> 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.".

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.

Ulrich Neumerkel

unread,
Nov 24, 2009, 11:55:14 AM11/24/09
to

Above Art of Prolog does contain chapter 4 "The computation model
of logic programs".

Jan Burse

unread,
Nov 24, 2009, 6:11:31 PM11/24/09
to
David schrieb:

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


Ulrich Neumerkel

unread,
Nov 25, 2009, 5:14:15 AM11/25/09
to
Jan Burse <janb...@fastmail.fm> writes:
>David schrieb:
>> hi,
>>
>> 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?
...

>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:

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.

David

unread,
Nov 27, 2009, 9:25:43 AM11/27/09
to
> Above Art of Prolog does contain chapter 4 "The computation model
> of logic programs".

Thanks a lot. I will read chapter 4 again.

David

0 new messages