Skip to content

Commit

Permalink
what4: Don't annotate {Nonce,}AppExprs
Browse files Browse the repository at this point in the history
  • Loading branch information
langston-barrett committed Dec 6, 2023
1 parent e46dff4 commit a3199cb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions what4/src/What4/Expr/Builder.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1630,18 +1630,20 @@ instance IsExprBuilder (ExprBuilder t st fs) where

annotateTerm sym e =
case e of
AppExpr (appExprId -> n) -> return (n, e)
BoundVarExpr (bvarId -> n) -> return (n, e)
NonceAppExpr (nonceExprApp -> Annotation _ n _) -> return (n, e)
_ -> do
NonceAppExpr (nonceExprId -> n) -> return (n, e)
_ -> do -- literals
let tpr = exprType e
n <- sbFreshIndex sym
e' <- sbNonceExpr sym (Annotation tpr n e)
return (n, e')

getAnnotation _sym e =
case e of
AppExpr (appExprId -> n) -> Just n
BoundVarExpr (bvarId -> n) -> Just n
NonceAppExpr (nonceExprApp -> Annotation _ n _) -> Just n
NonceAppExpr (nonceExprId -> n) -> Just n
_ -> Nothing

getUnannotatedTerm _sym e =
Expand Down

0 comments on commit a3199cb

Please sign in to comment.