这是我第一次使用Z3
并且我试图找到给定表单的所有坐标真值分配,它一直在抛出:
Z3(5, 10): ERROR: invalid function application, arguments missing
(echo "((p => q) v (q => p)) ^ ~((p => q) ^ (q => p)))")
(declare-const p Bool)
(declare-const q Bool)
(assert (and(or(=> p q)(=> q p)) (not(and(=> p q) (=> q p)))
(check-sat)
(get-model)
(assert (or (=> p q)(=> qp)))
(assert (not(and(=> p q) (=> q p)))
(check-sat)
(get-model)
答案 0 :(得分:1)
你需要更多正确的括号。
(echo "((p => q) v (q => p)) ^ ~((p => q) ^ (q => p)))")
(declare-const p Bool)
(declare-const q Bool)
(assert (and(or(=> p q)(=> q p)) (not(and(=> p q) (=> q p)))))
(check-sat)
(get-model)
(assert (or (=> p q)(=> q p)))
(assert (not(and(=> p q) (=> q p))))
(check-sat)
(get-model)