我有一个表示谓词逻辑公式的标准数据类型。表示析取的自然演绎消除规则的函数可能如下所示:
d_el p q =
if p =: (Dis r s) && q =: (Neg r) then Just s else
if q =: (Dis r s) && p =: (Neg r) then Just s else
Nothing where r,s free
x =: y = (x =:= y) == success
当统一失败时,该函数不会评估为 Nothing,而是在 中不返回任何解决方案PACKS
:
logic> d_el (Dis Bot Top) (Not Bot)
Result: Just Top
More Solutions? [Y(es)/n(o)/a(ll)] n
logic> d_el (Dis Bot Top) (Not Top)
No more solutions.
我错过了什么,为什么在统一失败时不el
评估?Nothing