我得到了以下答案集编程问题,但不确定我的答案是否正确:
- A(X) 通常是 E(X)
- U(X) 通常不是 E(X)
- G(X) 通常是 E(X)
- 每个 G(X) 都是 U(X)
- U(X) 通常是 A(X)
- G(t1)
- G(t2) 而不是 E(t2)
- U(t3)
以下是我的 Clingo 代码:
g(t1).
g(t2).
-e(t2).
u(t3).
e(X) :- a(X), not -e(X).
-e(X) :- u(X), not e(X).
e(X) :- g(X), not -e(X).
u(X) :- g(X).
a(X) :- u(X), not -a(X).
坚持 0 pm.lp 是:
Reading from pm.lp
pm.lp:9:15-24: info: atom does not occur in any rule head:
not (-a(X))
Solving...
Answer: 1
g(t1) g(t2) u(t3) -e(t2) u(t1) u(t2) a(t3) a(t1) a(t2) e(t3) e(t1)
Answer: 2
g(t1) g(t2) u(t3) -e(t2) u(t1) u(t2) a(t3) a(t1) a(t2) e(t3) -e(t1)
Answer: 3
g(t1) g(t2) u(t3) -e(t2) u(t1) u(t2) a(t3) a(t1) a(t2) -e(t3) e(t1)
Answer: 4
g(t1) g(t2) u(t3) -e(t2) u(t1) u(t2) a(t3) a(t1) a(t2) -e(t3) -e(t1)
SATISFIABLE
不确定我的代码是否正确和完整?