aboutsummaryrefslogtreecommitdiff
path: root/src/lux/optimizer.clj
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lux/optimizer.clj14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/lux/optimizer.clj b/src/lux/optimizer.clj
index c03515370..fd859d90d 100644
--- a/src/lux/optimizer.clj
+++ b/src/lux/optimizer.clj
@@ -10,6 +10,7 @@
;; [Tags]
(defvariant
("bool" 1)
+ ("nat" 1)
("int" 1)
("real" 1)
("char" 1)
@@ -34,6 +35,7 @@
("PopPM" 0)
("BindPM" 1)
("BoolPM" 1)
+ ("NatPM" 1)
("IntPM" 1)
("RealPM" 1)
("CharPM" 1)
@@ -58,6 +60,10 @@
(&/|list ($BoolPM _value)
$PopPM)
+ (&a-case/$NatTestAC _value)
+ (&/|list ($NatPM _value)
+ $PopPM)
+
(&a-case/$IntTestAC _value)
(&/|list ($IntPM _value)
$PopPM)
@@ -129,6 +135,11 @@
($BoolPM _pre-value)
($AltPM pre post))
+ [($NatPM _pre-value) ($NatPM _post-value)]
+ (if (= _pre-value _post-value)
+ ($NatPM _pre-value)
+ ($AltPM pre post))
+
[($IntPM _pre-value) ($IntPM _post-value)]
(if (= _pre-value _post-value)
($IntPM _pre-value)
@@ -342,6 +353,9 @@
(&a/$bool value)
(&/T [meta ($bool value)])
+ (&a/$nat value)
+ (&/T [meta ($nat value)])
+
(&a/$int value)
(&/T [meta ($int value)])