Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Add logs for Heapster IDE support #1359

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
3a9c13b
add basic IDE logging, start error cleanup
Jun 28, 2021
bfd0566
clean up additional implication errors
Jun 28, 2021
49f72e4
add structure to stmt fail in line with impl fail
Jun 29, 2021
716a2e1
redesign error message types, pipe through to log
Jul 7, 2021
9283f0e
fix default heapster environments missing ioref
Jul 8, 2021
1e427a4
carry more information through on most common implication error
Jul 9, 2021
059ab7b
Merge branch 'heapster-ide-info' of github.com:GaloisInc/saw-script i…
Jul 9, 2021
6fef67a
remove Some from error constructor
Jul 9, 2021
f3b76bb
Merge branch 'master' into heapster-ide-info
glguy Jul 26, 2021
e2c9cd6
Export valueperms in full json detail
glguy Jul 28, 2021
b59adb9
Avoid generating orphan ToJSON instances and using Given
glguy Jul 28, 2021
65ae7dd
refine jsonexport instances
glguy Jul 28, 2021
931d802
Document JSONExport
glguy Jul 28, 2021
2ad2225
Remove need for passing undefined
glguy Jul 30, 2021
ce3313b
JSONExport support for PermImpls
glguy Jul 30, 2021
df114c1
export entrypoint and caller ID information
Aug 12, 2021
8875708
cleanup imports, 80 char columns
Aug 12, 2021
5f12cc4
heapster: export function name for IDE
Aug 12, 2021
cb7c57c
heapster-saw: LogEntry with names and structure
glguy Aug 19, 2021
e768f1f
Incorporate names from bindings in JsonExport
glguy Aug 20, 2021
f60affd
Merge remote-tracking branch 'origin/master' into heapster-ide-info
glguy Aug 20, 2021
51665d7
Update PPInfo while exporting
glguy Aug 23, 2021
dc70b93
checkpoint
glguy Aug 27, 2021
f0c7747
Use types to generate names for pretty permissions where possible
glguy Aug 27, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions heapster-saw/heapster-saw.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,22 @@ library
filepath,
language-rust,
hobbits ^>= 1.4,
aeson ^>= 1.5,
th-abstraction,
template-haskell
hs-source-dirs: src
build-tool-depends:
alex:alex,
happy:happy,
exposed-modules:
Verifier.SAW.Heapster.CruUtil
Verifier.SAW.Heapster.GenMonad
Verifier.SAW.Heapster.IDESupport
Verifier.SAW.Heapster.Implication
Verifier.SAW.Heapster.IRTTranslation
Verifier.SAW.Heapster.Lexer
Verifier.SAW.Heapster.Located
Verifier.SAW.Heapster.JSONExport
Verifier.SAW.Heapster.ParsedCtx
Verifier.SAW.Heapster.Parser
Verifier.SAW.Heapster.Permissions
Expand Down
10 changes: 10 additions & 0 deletions heapster-saw/src/Verifier/SAW/Heapster/CruUtil.hs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import Data.Text (Text)
import qualified Data.Text as Text
import Data.Reflection
import Data.List.NonEmpty (NonEmpty(..))
import Data.Functor.Constant
import Data.ByteString
import Numeric
import Numeric.Natural
Expand Down Expand Up @@ -564,6 +565,15 @@ instance Liftable (KnownReprObj f a) where
instance LiftableAny1 (KnownReprObj f) where
mbLiftAny1 = mbLift

instance Liftable a => LiftableAny1 (Constant a) where
mbLiftAny1 = mbLift

instance Liftable a => Liftable (Constant a b) where
mbLift (mbMatch -> [nuMP| Data.Functor.Constant.Constant x |]) = Data.Functor.Constant.Constant (mbLift x)

instance (Liftable a, Liftable b, Liftable c) => Liftable (a,b,c) where
mbLift (mbMatch -> [nuMP| (x,y,z) |]) = (mbLift x, mbLift y, mbLift z)

-- FIXME: this change for issue #28 requires ClosableAny1 to be exported from
-- Hobbits
{-
Expand Down
30 changes: 28 additions & 2 deletions heapster-saw/src/Verifier/SAW/Heapster/GenMonad.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,19 @@ module Verifier.SAW.Heapster.GenMonad (
-- * Core definitions
GenStateContT(..), (>>>=), (>>>),
-- * Continuation operations
gcaptureCC, gmapRet, gabortM, gparallel, gopenBinding,
gcaptureCC, gmapRet, gabortM, gparallel, startBinding, startBinding', gopenBinding, gopenBinding',
-- * State operations
gmodify,
-- * Transformations
addReader,
) where

import Data.Binding.Hobbits ( nuMultiWithElim1, Mb, Name, RAssign )
import Data.Binding.Hobbits ( nuMulti, nuMultiWithElim1, Mb, Name, RAssign )
import Control.Monad.State ( ap, MonadState(get, put) )
import Control.Monad.Trans.Class ( MonadTrans(lift) )
import Control.Monad.Trans.Reader
import Data.Proxy
import Verifier.SAW.Heapster.NamedMb

-- | The generalized state-continuation monad
newtype GenStateContT s1 r1 s2 r2 m a = GenStateContT {
Expand Down Expand Up @@ -107,6 +109,30 @@ gopenBinding f_ret mb_a =
f_ret $ flip nuMultiWithElim1 mb_a $ \names a ->
k (names, a)

-- | Name-binding in the generalized continuation monad (FIXME: explain)
gopenBinding' ::
(Mb' ctx (m b1) -> m r2) ->
Mb' ctx b2 ->
GenStateContT s b1 s r2 m (RAssign Name ctx, b2)
gopenBinding' f_ret mb_a =
gcaptureCC \k ->
f_ret $ flip nuMultiWithElim1' mb_a $ \names a ->
k (names, a)

-- | Name-binding in the generalized continuation monad (FIXME: explain)
startBinding ::
RAssign Proxy ctx ->
(Mb ctx (m r1) -> m r2) ->
GenStateContT s r1 s r2 m (RAssign Name ctx)
startBinding tps f_ret = gcaptureCC (f_ret . nuMulti tps)

-- | Name-binding in the generalized continuation monad (FIXME: explain)
startBinding' ::
RAssign StringF ctx ->
(Mb' ctx (m r1) -> m r2) ->
GenStateContT s r1 s r2 m (RAssign Name ctx)
startBinding' tps f_ret = gcaptureCC (f_ret . nuMulti' tps)

addReader :: GenStateContT s1 r1 s2 r2 m a -> GenStateContT s1 r1 s2 r2 (ReaderT e m) a
addReader (GenStateContT m) =
GenStateContT \s2 k ->
Expand Down
Loading