述語ロジックの式を表す標準データ型があります。論理和の自然演繹消去規則を表す関数は、次のようになります。
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