Re: multiset ordering



Dear Pierpaolo,

Thankyou for your quick reply.

What should the goal gt_ms_onestep([3],X) bind X to? What does happen instead?

How many and what kind of solutions has the goal permutation(X,Y) ?

Do you think that the goal 3 > T will generate good values for T?
(it doesn't, it generates the error you get, instead).

I see that my code behaves quite different from what I expected.
I thought that every predicate I wrote was invertible in
every parameter, but as you pointed out this is not the case.

Is there a way to write predicates such that every variable
can be uninstantiated when you submit a query to Prolog?
I don't know, some design-rule to follow...

Anyway, I'm reading the book "Programming in Prolog" by
Clocksin and Mellish,
http://www.amazon.co.uk/exec/obidos/ASIN/3540583505/bindingtimeli-21
and I hope that at the end of my reading I will have more clear ideas.

Ciao,
GG

.



Relevant Pages

  • Newbie, *really* basic question
    ... Prolog, and got a copy of Programming in Prolog by Clocksin & Mellish. ... I realize it's telling me that there is no predicate "likes" that takes ...
    (comp.lang.prolog)
  • Re: Sublists question
    ... I do not really get what the predicate means or does. ... >>helps just to write the predicate out clearly in natural language, ... >>then translate into Prolog. ... more as a functional programming language than as a logic ...
    (comp.lang.prolog)
  • Re: Prolog module system
    ... I think prolog offers so much freedom that one can build its own ... Both modules define a member/2 predicate, ... this leads to a name conflict. ... shaky ground as current module systems (look at the issues with e.g. ...
    (comp.lang.prolog)
  • Re: Prolog, memory management and memory leaks
    ... predicate is executed that solves constraint problem. ... In some circumstances, this server leaks memory. ... "Understanding Memory Management in Prolog ... There is not just one garbage collector in Prolog. ...
    (comp.lang.prolog)
  • Re: Prolog module system
    ... my experiment with oop and modules has almost reach a point ... On the other hand, when I came to Prolog as a logic programming language, I ... Consider the length/2 predicate. ... OO systems have much more complex built-in lookup rules. ...
    (comp.lang.prolog)