Re: problem: how to translate predicate logic sentences to Prolog?
- From: Markus Triska <triska@xxxxxx>
- Date: Tue, 31 Jan 2006 15:15:45 +0100
Hi!
j.vanloon-ab@xxxxxxxxx wrote:
How can I make a corresponding Prolog program ( translating 1. and 2.
in Prolog) to derive fact 3.?
You can use constraint handling rules:
:- use_module(library(chr)).
:- chr_constraint color/2, not_owner/2.
color(Car, blue) ==> not_owner(tim, Car).
Now, you can query:
?- color(auto4, blue).
color(auto4, blue)
not_owner(tim, auto4)
Yes
All the best,
Markus.
.