How to Model the following constraints in Prolog

49 views Asked by At

For simplicity let's assume that f is a binary relation over the domain {1,2,3}x{1,2,3,4}. I want to model the following constraints.

f(1,2) ∨ f(1,3)
¬f(1,4) ∧ ¬f(4,1)
∀x.∃y.f(x,y)
∀x.(f(1,x) => f(x,1))

Then I want to answer the following queries: f(1,1)?, f(1,2)?, ...

Each query should result in 1 if f(x,y) is true in all possible worlds, 0 if f(x,y) is false in all possible worlds, and unknown if f(x,y) can sometimes be true and sometimes false.

0

There are 0 answers