Skip to content

Commit

Permalink
add assertion location to json output
Browse files Browse the repository at this point in the history
  • Loading branch information
danmatichuk committed Nov 9, 2023
1 parent 08d250d commit 0bc0125
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/Pate/Verification/Widening.hs
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,16 @@ data PickManyChoice sym arch =

instance forall sym arch. (PSo.ValidSym sym, PA.ValidArch arch) => JSON.ToJSON (PickManyChoice sym arch) where
-- FIXME: Needs more structure
toJSON e = JSON.object ["pickManyChoice" JSON..= (show (prettyNode @_ @'(sym,arch) @"pickManyChoice" () e))]
toJSON = \case
PickRegister r -> JSON.object
[ "register" JSON..= case PA.fromRegisterDisplay (PA.displayRegister r) of
Just s -> s
Nothing -> MapF.showF r]
PickStack s -> JSON.object [ "stack_cell" JSON..= show (pretty s)]
PickGlobal s -> JSON.object [ "mem_cell" JSON..= show (pretty s)]
PickIncludeAllRegisters -> JSON.String "all_registers"
PickIncludeAll -> JSON.String "all"
PickFinish -> JSON.String "finish"

data PickChoices sym arch = PickChoices
{ pickRegs :: [Some (MM.ArchReg arch)]
Expand All @@ -612,7 +621,8 @@ instance (PSo.ValidSym sym, PA.ValidArch arch) => IsTraceNode '(sym,arch) "pickM
PickIncludeAllRegisters -> "Include All Registers"
PickIncludeAll -> "Include All Locations"
PickFinish -> "Finish"
nodeTags = mkTags @'(sym,arch) @"pickManyChoice" [Summary, Simplified]
nodeTags = mkTags @'(sym,arch) @"pickManyChoice" [Summary, Simplified, JSONTrace]
jsonNode = nodeToJSON @'(sym,arch) @"pickManyChoice"

pickMany ::
PickChoices sym arch ->
Expand Down

0 comments on commit 0bc0125

Please sign in to comment.