Clingo答案集编程新手

时间:2016-11-19 05:10:19

标签: answer-set-programming clingo

我得到了以下答案集编程问题,但不确定我的答案是否正确:

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

clingo 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

不确定我的代码是否正确且完整?

0 个答案:

没有答案