为什么 Z3 不能提出没有元素的排序?

Why can't Z3 propose a sort with no elements?

我尝试使用 Z3Py 构建一个程序,Z3 会决定该程序意味着排序 Human 为空。

from z3 import *
from z3_helper import Z3Helper

Human = DeclareSort("Human")
is_mortal = Function("is_mortal", Human, BoolSort())
h = Const('h', Human)

s = Solver()
s.add([
    ForAll([h], And(is_mortal(h), Not(is_mortal(h))))
])

print s.check()
s.model()

但是它没有返回 Human 为空的模型,而是 returns unsat。这是为什么?

如果我删除 "all men are mortal" 公理,它 returns 一个空集作为模型。

问题是consth的存在就意味着至少需要Human的存在吗?

SMT-LIB 和 Z3 认为简单类型的一阶逻辑假设所有类别都是非空的。另见 http://smtlib.cs.uiowa.edu/papers/smt-lib-reference-v2.6-draft-3.pdf,从第 5.1 节开始。