Re: problem: how to translate predicate logic sentences to Prolog?



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.
.