summaryrefslogtreecommitdiff
path: root/app/Interpreter.hs
diff options
context:
space:
mode:
Diffstat (limited to 'app/Interpreter.hs')
-rw-r--r--app/Interpreter.hs9
1 files changed, 8 insertions, 1 deletions
diff --git a/app/Interpreter.hs b/app/Interpreter.hs
index d82793b..bb47144 100644
--- a/app/Interpreter.hs
+++ b/app/Interpreter.hs
@@ -94,6 +94,10 @@ proveStep = St.get >>= go
| a == b = uok
unify VoidRef (Atom _) = uok
unify (Atom _) VoidRef = uok
+ unify (Number a) (Number b)
+ | a == b = uok
+ unify VoidRef (Number _) = uok
+ unify (Number _) VoidRef = uok
unify (Struct a) (Struct b)
| a == b = uok
{- unifying a struct with void must cause us to skip the void -}
@@ -130,6 +134,7 @@ proveStep = St.get >>= go
FreeRef hr ->
case g of
atom@(Atom _) -> setHeap hr atom
+ number@(Number _) -> setHeap hr number
s@(Struct _) ->
withNewHeapStruct
hr
@@ -147,7 +152,8 @@ proveStep = St.get >>= go
FreeRef gr -> setHeap hr (HeapRef gr)
BoundRef addr _ -> setHeap hr (HeapRef addr)
_ -> ifail "dangling goal ref (from head ref)"
- BoundRef _ atom@(Atom a) -> unify atom g
+ BoundRef _ atom@(Atom _) -> unify atom g
+ BoundRef _ number@(Number _) -> unify number g
BoundRef addr struct@(Struct Id {arity = arity}) ->
c
i
@@ -165,6 +171,7 @@ proveStep = St.get >>= go
FreeRef gr ->
case h of
atom@(Atom _) -> setHeap gr atom
+ number@(Number _) -> setHeap gr number
s@(Struct _) ->
withNewHeapStruct
gr