For Programmers: Free Programming Magazines  


Home > Archive > Prolog > April 2004 > Cycle Check









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Cycle Check
Sebastian Weber

2004-03-27, 12:11 am

Hi,

imagine the following simple knowledge base:
a:-b.
b:-a.

Is their a build-in cycle-check in ECLiPSe Prolog,
to prevent the situation that the pc ends in a loop
when asking "a" or "b"?

Thank You for your answers!
CU SW!
Warwick Harvey

2004-03-27, 12:11 am

Hi Sebastian,

Sebastian Weber wrote:
> Hi,
>
> imagine the following simple knowledge base:
> a:-b.
> b:-a.
>
> Is their a build-in cycle-check in ECLiPSe Prolog,
> to prevent the situation that the pc ends in a loop
> when asking "a" or "b"?


No, there is no built-in support for this in ECLiPSe. Some Prologs have
it: it's called tabling. (Or rather, I believe that tabling allows one
to solve this problem, among others.)

If you really need this kind of feature, then let us know what other
features you want from the system, and perhaps somebody can suggest a
suitable Prolog for you.

Cheers,
Warwick
(ECLiPSe developer)

Pento

2004-03-27, 12:11 am

Sebastian Weber <spam_eimer2000@yahoo.de> wrote in
news:opr5ftr9ol9q2b5h@News.Individual.DE:

> Is their a build-in cycle-check in ECLiPSe Prolog,
> to prevent the situation that the pc ends in a loop
> when asking "a" or "b"?
>


That would mean that ECLiPSe Prolog contained an algorithm to decide the
Stop-criterion for any logic program. I would think that's a bit hard to
believe :-)

--
Pento

De wereld was soep, en het denken meestal een vork,
tot smakelijk eten leidde dat zelden. - H. Mulisch
Paul Singleton

2004-03-27, 12:11 am

Pento wrote:

> Sebastian Weber <spam_eimer2000@yahoo.de> wrote in
> news:opr5ftr9ol9q2b5h@News.Individual.DE:


[color=darkred]
> That would mean that ECLiPSe Prolog contained an algorithm to decide the
> Stop-criterion for any logic program.


I don't think it means that. It is feasible to
check whether a new goal is identical (but for
renaming of variables) to one of its ancestor
goals. This catches only a subset of nonterminating
programs. You may or may not consider this of
any value. I think it has some. Maybe I'm
taking the original question too literally?

Paul Singleton

Pento

2004-03-27, 12:11 am

Paul Singleton <paul.singleton@bcs.org.uk> wrote in
news:c41esb$3jh$1$8302bc10@news.demon.co.uk:

> I don't think it means that. It is feasible to
> check whether a new goal is identical (but for
> renaming of variables) to one of its ancestor
> goals. This catches only a subset of nonterminating
> programs. You may or may not consider this of
> any value. I think it has some. Maybe I'm
> taking the original question too literally?


Yes, I was indeed wrong. I'm seeing things too broadly :-)

--
Pento

De wereld was soep, en het denken meestal een vork,
tot smakelijk eten leidde dat zelden. - H. Mulisch
Sebastian Weber

2004-04-09, 9:34 am

Warwick Harvey wrote:
> No, there is no built-in support for this in ECLiPSe. Some Prologs have
> it: it's called tabling. (Or rather, I believe that tabling allows one
> to solve this problem, among others.)
>
> If you really need this kind of feature, then let us know what other
> features you want from the system, and perhaps somebody can suggest a
> suitable Prolog for you.


thanks to all who have answered me.

adding the following has solvd our problem:
:- set_flag(dfid_compile,on).

Info:
http://www.cs.ncl.ac.uk/modules/199...000000000000000


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com