Skip to content

Commit

Permalink
remove deprecated Pate.Proof modules
Browse files Browse the repository at this point in the history
  • Loading branch information
danmatichuk committed Feb 11, 2025
1 parent 16026e7 commit 62a53cc
Show file tree
Hide file tree
Showing 16 changed files with 23 additions and 629 deletions.
4 changes: 0 additions & 4 deletions pate.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,6 @@ library
Pate.Panic,
Pate.Parallel,
Pate.Pointer,
Pate.Proof,
Pate.Proof.Instances,
Pate.Proof.Operations,
Pate.Proof.CounterExample,
Pate.Register,
Pate.Register.Traversal,
Pate.Solver,
Expand Down
10 changes: 10 additions & 0 deletions src/Data/Macaw/CFGSlice.hs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ module Data.Macaw.CFGSlice
, termStmtToBlockEnd
, blockEndSliceFns
, copyBlockEnd
, ppExitCase
) where

import qualified GHC.Generics as G
Expand Down Expand Up @@ -83,6 +84,15 @@ data MacawBlockEndCase =
| MacawBlockEndArch
deriving (Eq, Enum, Bounded, Ord, Show, G.Generic)

ppExitCase :: MacawBlockEndCase -> String
ppExitCase ec = case ec of
MacawBlockEndJump -> "arbitrary jump"
MacawBlockEndCall -> "function call"
MacawBlockEndReturn -> "function return"
MacawBlockEndBranch -> "branch"
MacawBlockEndArch -> "arch-specific"
MacawBlockEndFail -> "analysis failure"

instance JSON.ToJSON MacawBlockEndCase

class HasArchTermEndCase (f :: (M.Type -> Kind.Type) -> Kind.Type) where
Expand Down
10 changes: 6 additions & 4 deletions src/Pate/CLI.hs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import qualified System.IO as IO
import qualified What4.Interface as WI

import qualified Data.Macaw.CFG as MC
import qualified Data.Macaw.CFGSlice as MCS

import qualified Pate.Arch as PA
import qualified Pate.Block as PB
Expand All @@ -36,7 +37,6 @@ import qualified Pate.Loader as PL
import qualified Pate.Loader.ELF as PLE
import qualified Pate.Memory.MemTrace as PMT
import qualified Pate.PatchPair as PPa
import qualified Pate.Proof.Instances as PPI
import qualified Pate.Solver as PS
import qualified Pate.Script as PSc
import qualified Pate.Timeout as PTi
Expand Down Expand Up @@ -64,7 +64,9 @@ mkRunConfig archLoader opts rcfg mtt = let
}

mklogger :: forall arch. PA.SomeValidArch arch -> IO (PL.Logger arch)
mklogger proxy = error "replace this function"
mklogger proxy = do
(logger, consumers) <- startLogger proxy (verbosity opts) (logFile opts)
return $ PL.Logger logger consumers

verificationCfg =
PC.defaultVerificationCfg
Expand Down Expand Up @@ -264,8 +266,8 @@ terminalFormatEvent evt =
) <> PP.line)
PE.StrongestPostDesync pPair (PVSC.TotalityCounterexample (oIP, oEnd, oInstr) (pIP, pEnd, pInstr)) ->
layout ( PP.vcat [ PP.pretty pPair PP.<+> "program control flow desynchronized"
, " Original: 0x" <> PP.pretty (showHex oIP "") PP.<+> PP.pretty (PPI.ppExitCase oEnd) PP.<+> PP.viaShow oInstr
, " Patched : 0x" <> PP.pretty (showHex pIP "") PP.<+> PP.pretty (PPI.ppExitCase pEnd) PP.<+> PP.viaShow pInstr
, " Original: 0x" <> PP.pretty (showHex oIP "") PP.<+> PP.pretty (MCS.ppExitCase oEnd) PP.<+> PP.viaShow oInstr
, " Patched : 0x" <> PP.pretty (showHex pIP "") PP.<+> PP.pretty (MCS.ppExitCase pEnd) PP.<+> PP.viaShow pInstr
] <> PP.line)
-- FIXME: handle other events
_ -> layout ""
Expand Down
1 change: 0 additions & 1 deletion src/Pate/Event.hs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import qualified Pate.Hints.CSV as PHC
import qualified Pate.Hints.DWARF as PHD
import qualified Pate.Hints.JSON as PHJ
import qualified Pate.Hints.BSI as PHB
import qualified Pate.Proof.Instances as PFI
import qualified Pate.SimState as PS
import qualified Pate.PatchPair as PPa
import qualified Pate.Equivalence as PE
Expand Down
1 change: 0 additions & 1 deletion src/Pate/Metrics.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import qualified Data.Time as TM

import qualified Pate.Event as PE
import qualified Pate.Loader.ELF as PLE
import qualified Pate.Proof.Instances as PFI

data BinaryMetrics =
BinaryMetrics { executableBytes :: !Int
Expand Down
13 changes: 0 additions & 13 deletions src/Pate/Monad.hs
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@ module Pate.Monad
, applyCurrentAsms
, applyCurrentAsmsExpr
, currentAsm
-- nonces
, freshNonce
, withProofNonce
-- caching
, lookupBlockCache
, modifyBlockCache
Expand Down Expand Up @@ -195,7 +192,6 @@ import Pate.Monad.Environment as PME
import Pate.Panic
import qualified Pate.Parallel as Par
import qualified Pate.PatchPair as PPa
import qualified Pate.Proof as PF
import Pate.SimState
import qualified Pate.SimulatorRegisters as PSR
import qualified Pate.Solver as PSo
Expand Down Expand Up @@ -274,15 +270,6 @@ ifConfig checkCfg ifT ifF = (CMR.asks $ checkCfg . envConfig) >>= \case
True -> ifT
False -> ifF

freshNonce :: EquivM sym arch (N.Nonce (PF.SymScope sym) tp)
freshNonce = error "replace this function"

withProofNonce ::
forall tp sym arch a.
(PF.ProofNonce sym tp -> EquivM sym arch a) ->
EquivM sym arch a
withProofNonce f = error "replace this function"

-- | Start the timer to be used as the initial time when computing
-- the duration in a nested 'emitEvent'
startTimer :: EquivM sym arch a -> EquivM sym arch a
Expand Down
4 changes: 0 additions & 4 deletions src/Pate/Monad/Environment.hs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ import qualified Pate.Memory.MemTrace as MT
import qualified Pate.Monad.Context as PMC
import qualified Pate.PatchPair as PPa
import qualified Pate.Location as PL
import qualified Pate.Proof as PF
import qualified Pate.Solver as PSo
import qualified Pate.SymbolTable as PSym
import qualified Pate.Verification.Override as PVO
Expand Down Expand Up @@ -99,9 +98,6 @@ data EquivEnv sym arch where
-- ^ the current assumption frame, accumulated as assumptions are added
, envPathCondition :: PAS.AssumptionSet sym
-- ^ assumptions specific to a particular path (subsumed by envCurrentFrame)
, envNonceGenerator :: N.NonceGenerator IO (PF.SymScope sym)
, envParentNonce :: Some (PF.ProofNonce sym)
-- ^ nonce of the parent proof node currently in scope
, envUndefPointerOps :: MT.UndefinedPtrOps sym
, envParentBlocks :: [PB.BlockPair arch]
-- ^ all block pairs on this path from the toplevel
Expand Down
Loading

0 comments on commit 62a53cc

Please sign in to comment.