Skip to content

Commit

Permalink
Merge pull request #866 from GaloisInc/rework-semantics
Browse files Browse the repository at this point in the history
Reformulate evaluation semantics
  • Loading branch information
robdockins authored Sep 2, 2020
2 parents 4729596 + 04bd633 commit 8bfad53
Show file tree
Hide file tree
Showing 15 changed files with 830 additions and 797 deletions.
Binary file modified docs/Semantics.pdf
Binary file not shown.
10 changes: 6 additions & 4 deletions src/Cryptol/Eval.hs
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,10 @@ evalExpr sym env expr = case expr of
e' <- eval e
evalSel sym e' sel

ESet e sel v -> {-# SCC "evalExpr->ESet" #-}
ESet ty e sel v -> {-# SCC "evalExpr->ESet" #-}
do e' <- eval e
evalSetSel sym e' sel (eval v)
let tyv = evalValType (envTypes env) ty
evalSetSel sym tyv e' sel (eval v)

EIf c t f -> {-# SCC "evalExpr->EIf" #-} do
b <- fromVBit <$> eval c
Expand Down Expand Up @@ -584,14 +585,15 @@ evalSel sym val sel = case sel of
, show vdoc ]
{-# SPECIALIZE evalSetSel ::
ConcPrims =>
Concrete ->
Concrete -> TValue ->
GenValue Concrete -> Selector -> SEval Concrete (GenValue Concrete) -> SEval Concrete (GenValue Concrete)
#-}
evalSetSel :: forall sym.
EvalPrims sym =>
sym ->
TValue ->
GenValue sym -> Selector -> SEval sym (GenValue sym) -> SEval sym (GenValue sym)
evalSetSel sym e sel v =
evalSetSel sym _tyv e sel v =
case sel of
TupleSel n _ -> setTuple n
RecordSel n _ -> setRecord n
Expand Down
Loading

0 comments on commit 8bfad53

Please sign in to comment.