Skip to content

Commit

Permalink
fixup for previous commit: use JSON boolean instead of "true" string
Browse files Browse the repository at this point in the history
  • Loading branch information
danmatichuk committed Jan 9, 2024
1 parent d358bb7 commit 324b91b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Pate/AssumptionSet.hs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ instance OrdF (W4.SymExpr sym) => PEM.ExprMappable sym (AssumptionSet sym) where
return $ mkAssumptionSet sym ps' (foldr (mergeExprSetFMap (Proxy @sym)) MapF.empty bs')

instance forall sym. W4S.SerializableExprs sym => W4S.W4Serializable sym (AssumptionSet sym) where
w4Serialize (AssumptionSet ps bs) | SetF.null ps, MapF.null bs = W4S.w4SerializeString ("true" :: String)
w4Serialize (AssumptionSet ps bs) | SetF.null ps, MapF.null bs = W4S.w4Serialize True
w4Serialize (AssumptionSet ps bs) | [p] <- SetF.toList ps, MapF.null bs = W4S.w4SerializeF p
w4Serialize (AssumptionSet ps bs) =
W4S.withSerializable (Proxy @sym) (Proxy @(W4.SymExpr sym)) (Proxy @W4.BaseBoolType) $ do
Expand Down
3 changes: 3 additions & 0 deletions src/What4/JSON.hs
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ instance W4Serializable sym Integer where
instance W4Serializable sym Text where
w4Serialize i = return $ JSON.toJSON i

instance W4Serializable sym Bool where
w4Serialize i = return $ JSON.toJSON i

instance W4Serializable sym a => W4Serializable sym (Maybe a) where
w4Serialize = \case
Just a -> w4Serialize a
Expand Down

0 comments on commit 324b91b

Please sign in to comment.