diff --git a/haskell/src/Graph.hs b/haskell/src/Graph.hs index f71dac0..a3f490d 100644 --- a/haskell/src/Graph.hs +++ b/haskell/src/Graph.hs @@ -22,6 +22,8 @@ data Graph = Graph data UnoOp = Neg -- ^ @= 0@ | Id -- ^ @= 1@ + | Lnot -- ^ @= 2@ + | Bnot -- ^ @= 3@ deriving (Eq,Enum,Bounded,Show) data DuoOp diff --git a/haskell/src/Semantics.hs b/haskell/src/Semantics.hs index ddc1f36..5ac6367 100644 --- a/haskell/src/Semantics.hs +++ b/haskell/src/Semantics.hs @@ -18,6 +18,8 @@ data PrimOp a -- unary = Neg a | Id a + | Lnot a + | Bnot a -- binary | Mul a a | Div a a @@ -49,6 +51,8 @@ evalPrimOp :: PrimOp F -> F evalPrimOp prim = case prim of Neg x -> neg x Id x -> x + Lnot x -> fromBool (not (toBool x)) + Bnot x -> toF (fieldMask .&. (negate (fromF x) - 1)) Mul x y -> mul x y Div x y -> BN254.div x y Add x y -> add x y