Solve this with Prolog or something else?
From: tmp123 (tmp123_at_menta.net)
Date: 03/19/05
- Next message: Chema: "CLP(FD) Prolog: help needed with a simple problem"
- Previous message: Markus Triska: "Re: League or tournament examples"
- Next in thread: tmp123: "Re: Solve this with Prolog or something else?"
- Reply: tmp123: "Re: Solve this with Prolog or something else?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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.
- Next message: Chema: "CLP(FD) Prolog: help needed with a simple problem"
- Previous message: Markus Triska: "Re: League or tournament examples"
- Next in thread: tmp123: "Re: Solve this with Prolog or something else?"
- Reply: tmp123: "Re: Solve this with Prolog or something else?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|