Skip to content

Commit

Permalink
add final result to json output
Browse files Browse the repository at this point in the history
  • Loading branch information
danmatichuk committed Nov 9, 2023
1 parent 7ab3bfa commit 4508ebe
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Pate/Equivalence.hs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ instance IsTraceNode k "equivalence_result" where
Inequivalent -> "Binaries are not observably equivalent"
ConditionallyEquivalent -> "Binaries are conditionally, observably equivalent"
Errored{} -> "Analysis failure due to error"
nodeTags = mkTags @k @"equivalence_result" [Summary, Simplified]
nodeTags = mkTags @k @"equivalence_result" [Summary, Simplified, JSONTrace]

---------------------------------------

Expand Down
6 changes: 6 additions & 0 deletions src/Pate/Equivalence/Condition.hs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,13 @@ instance forall sym arch. IsTraceNode '(sym :: DK.Type,arch :: DK.Type) "eqcond"
EquivalenceCondition{} -> PP.pretty someExpr
nodeTags = [(Summary, \someExpr _ -> printSomeExprTruncated someExpr )
,(Simplified, \someExpr _ -> printSomeExprTruncated someExpr)
,(JSONTrace, \someExpr _ -> printSomeExprTruncated someExpr)
]
jsonNode someExpr _ =
JSON.object
[ "trace_node_kind" JSON..= "eqcond"
, "trace_node" JSON..= show (PP.pretty someExpr)
]

-- | A mapping from registers to a predicate representing an equality condition for
-- that specific register.
Expand Down
2 changes: 1 addition & 1 deletion src/Pate/TraceTree.hs
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ instance IsTraceNode k "bool" where
instance IsTraceNode k "final_result" where
type TraceNodeType k "final_result" = ()
prettyNode _lbl _msg = "Final Result"
nodeTags = mkTags @k @"final_result" [Summary, Simplified]
nodeTags = mkTags @k @"final_result" [Summary, Simplified, JSONTrace]

data ChoiceHeader k (nm_choice :: Symbol) a =
(IsTraceNode k nm_choice) =>
Expand Down

0 comments on commit 4508ebe

Please sign in to comment.