From a0bb67072248ac68530b12257104308ca0421557 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Sat, 6 Apr 2024 10:59:44 -0700 Subject: [PATCH] Fixed mistake in arithmetic --- examples/arithmetic.modal | 8 ++------ examples/test.modal | 11 +++++++---- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/examples/arithmetic.modal b/examples/arithmetic.modal index c73796b..193bd39 100644 --- a/examples/arithmetic.modal +++ b/examples/arithmetic.modal @@ -2,22 +2,18 @@ <> (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) (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))))) diff --git a/examples/test.modal b/examples/test.modal index 9f87333..b9a0457 100644 --- a/examples/test.modal +++ b/examples/test.modal @@ -1,5 +1,8 @@ -<> (a) (apple) -<> (b) (banana) -<> (apple banana) (fruit salad) +<> (eq ?x ?x) (#t) +<> (eq ?x ?y) (#f) +<> (q ?x) (q ?x) +<> (if ?c ?t ?f) (if/q ?c q ?t q ?f) +<> (if/q (#t) q ?t q ?f) (?t) +<> (if/q (#f) q ?t q ?f) (?f) -a b \ No newline at end of file +if (eq foo bar) (if (eq foo baz) a b) (if (eq foo foo) b c) \ No newline at end of file