modal/examples/arithmetic.modal

20 lines
614 B
Plaintext

<> (add (s ?x) (s ?y)) (s (add ?x (s ?y)))
<> (add (s ?x) (0)) (s ?x)
<> (add (0) (s ?y)) (s ?y)
<> (add (0) (0)) (0)
<> (sub (s ?x) (s ?y)) (sub ?x ?y)
<> (sub (s ?x) (0)) (s ?x)
<> (sub (0) (s ?y)) (s ?y)
<> (sub (0) (0)) (0)
<> (mul (s ?x) (s ?y)) (add (s ?x) (mul (s ?x) (sub (s ?y) (s (0)))))
<> (mul (s ?x) (s (0))) (s ?x)
<> (mul (s (0)) (s ?y)) (s ?y)
<> (mul (s ?x) (0)) (0)
<> (mul (0) (s ?x)) (0)
<> (?x + ?y) (add ?x ?y)
<> (?x - ?y) (sub ?x ?y)
<> (?x * ?y) (mul ?x ?y)
<> (factorial (s (0))) ((s (0)))
<> (factorial (s ?x)) (((s ?x) * factorial ((s ?x) - (s (0)))))
factorial (s (s (s (s (s (0))))))