[comp.lang.prolog] SICStus Prolog expert, HELP!

sutanto@boas.cogsci.uiuc.edu (Herry Sutanto) (05/24/91)

I have a question for SICStus Prolog expert.

It is related to freeze predicate.  The question is how to get *all*
blocked goals so far? 

What I need is similar to call_residue/2 but return all blocked goals
from top level to current point.  call_residue(+Goal, ?Vars) only
returns blocked subgoal(s) of the execution of Goal, not *all* of the
blocked goals to that point.

I tried to use setof/2 with frozen/2 but they always return TRUE instead.

Herry Sutanto 
sutanto@cs.uiuc.edu



--

-hs-

sutanto@boas.cogsci.uiuc.edu (Herry Sutanto) (05/25/91)

I wrotes:


>I have a question for SICStus Prolog expert.

>It is related to freeze predicate.  The question is how to get *all*
>blocked goals so far? 

>What I need is similar to call_residue/2 but return all blocked goals
>from top level to current point.  call_residue(+Goal, ?Vars) only
>returns blocked subgoal(s) of the execution of Goal, not *all* of the
>blocked goals to that point.

>I tried to use setof/2 with frozen/2 but they always return TRUE instead.

>Herry Sutanto 
>sutanto@cs.uiuc.edu

Thank to all who replies my previous posting, to make the problem clear, 
here is an example where I need this kind of predicate:
 
  Suppose I want to have a predicate called less_than( X, Y )
  which return true if X is less than Y. 
  If at least one of the arguments is uninstantiated, this goal 
  will be blocked. But I also want to check whether there are any
  frozen goals which related to these variables, if there are
  I want to check right away whether the new frozen goal is consistent
  with all the previous frozen goal. 

  So, if there are previously frozen goal less_than( Y, Z ) and 
  less_than( Z, X ), I can tell  that less_than(X, Y) is false 
  (even none of the variables are instantiated).


Herry Sutanto
sutanto@cs.uiuc.edu

--

-hs-