Solve this with Prolog or something else?

From: tmp123 (tmp123_at_menta.net)
Date: 03/19/05


Date: 19 Mar 2005 07:51:01 -0800

Hello,

I like to solve the following logic problem. I do not know if prolog
with some enhancement could be used, or there are any other work
environment better.

The problem is very small: 3 initial facts and one query. Using
"prolog" like syntax, with the addition of the operators -> (if), <->
(iff), it is:

| s0 <-> e.
| s1 -> v.
| p(r,I,O) :-
| I->(T,e),
| O->(T,v).

and the query should be something like:

| ?- p(X,s0,s1).
| X=r
| yes

The above rules can written, in FOL(HOL?), like:

| s0<->e.
| s1 ->v.
| p(r,I,O) <- exist ( T, (I->(T/\e)) /\ (O->(T/\v)) ).

and the query is:
| ?- exist ( X, p(X,s0,s1) ).
| X=r
| yes

Thanks a lot for your help.

Kind regards.



Relevant Pages

  • Re: Solve this with Prolog or something else?
    ... > I like to solve the following logic problem. ... I do not know if prolog ... > with some enhancement could be used, or there are any other work ... > The problem is very small: 3 initial facts and one query. ...
    (comp.lang.prolog)
  • Re: Solve this with Prolog or something else?
    ... >> I like to solve the following logic problem. ... I do not know if prolog ... >> with some enhancement could be used, or there are any other work ... Here is some pseudo-prolog for your problem that could be fixed ...
    (comp.lang.prolog)