Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into heapster-memblock-p…
Browse files Browse the repository at this point in the history
…rover-improvements
  • Loading branch information
Eddy Westbrook committed Aug 5, 2021
2 parents 413ff46 + 75525f4 commit d03220b
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ A new `enable_lax_pointer_ordering` function exists, which relaxes the
restrictions that Crucible imposes on comparisons between pointers from
different allocation blocks.

A SAW value of type `Bool` can now be brought into scope in Cryptol expressions
as a value of type `Bit`.

## Changes

* The linked-in version of ABC (based on the Haskell `abcBridge`
Expand Down
1 change: 0 additions & 1 deletion heapster-saw/src/Verifier/SAW/Heapster/Implication.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4101,7 +4101,6 @@ implIntroOrShapeMultiM x bp (sh1 : shs) i =
implIntroOrShapeMultiM _ _ _ _ = error "implIntroOrShapeMultiM"



----------------------------------------------------------------------
-- * Support for Proving Lifetimes Are Current
----------------------------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions intTests/test1404/test.saw
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
let b = true;
print {{ b }};
3 changes: 3 additions & 0 deletions intTests/test1404/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
set -e

$SAW test.saw
11 changes: 10 additions & 1 deletion src/SAWScript/Value.hs
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,9 @@ extendEnv sc x mt md v rw =
VString s ->
do tt <- typedTermOfString sc (unpack s)
pure $ CEnv.bindTypedTerm (ident, tt) ce
VBool b ->
do tt <- typedTermOfBool sc b
pure $ CEnv.bindTypedTerm (ident, tt) ce
_ ->
pure ce
pure $
Expand All @@ -590,7 +593,7 @@ extendEnv sc x mt md v rw =

typedTermOfString :: SharedContext -> String -> IO TypedTerm
typedTermOfString sc str =
do let schema = Cryptol.Forall [] [] (Cryptol.tString (length str))
do let schema = Cryptol.tMono (Cryptol.tString (length str))
bvNat <- scGlobalDef sc "Prelude.bvNat"
bvNat8 <- scApply sc bvNat =<< scNat sc 8
byteT <- scBitvector sc 8
Expand All @@ -599,6 +602,12 @@ typedTermOfString sc str =
trm <- scVector sc byteT ts
pure (TypedTerm (TypedTermSchema schema) trm)

typedTermOfBool :: SharedContext -> Bool -> IO TypedTerm
typedTermOfBool sc b =
do let schema = Cryptol.tMono Cryptol.tBit
trm <- scBool sc b
pure (TypedTerm (TypedTermSchema schema) trm)


-- Other SAWScript Monads ------------------------------------------------------

Expand Down

0 comments on commit d03220b

Please sign in to comment.