@@ -27,7 +27,7 @@ Stability : provisional
27
27
module SAWScript.Crucible.LLVM.X86
28
28
( llvm_verify_x86
29
29
, llvm_verify_fixpoint_x86
30
- , llvm_verify_fixpoint_x86_ex
30
+ , llvm_verify_x86_with_invariant
31
31
, defaultStackBaseAlign
32
32
) where
33
33
@@ -126,7 +126,7 @@ import qualified Lang.Crucible.LLVM.Intrinsics as C.LLVM
126
126
import qualified Lang.Crucible.LLVM.MemModel as C.LLVM
127
127
import qualified Lang.Crucible.LLVM.MemType as C.LLVM
128
128
import qualified Lang.Crucible.LLVM.SimpleLoopFixpoint as Crucible.LLVM.Fixpoint
129
- import qualified Lang.Crucible.LLVM.SimpleLoopFixpoint2 as Crucible.LLVM.Fixpoint2
129
+ import qualified Lang.Crucible.LLVM.SimpleLoopInvariant as SimpleInvariant
130
130
import qualified Lang.Crucible.LLVM.Translation as C.LLVM
131
131
import qualified Lang.Crucible.LLVM.TypeContext as C.LLVM
132
132
@@ -333,7 +333,7 @@ llvm_verify_fixpoint_x86 llvmModule path nm globsyms checkSat f =
333
333
-- | Verify that an x86_64 function (following the System V AMD64 ABI) conforms
334
334
-- to an LLVM specification. This allows for compositional verification of LLVM
335
335
-- functions that call x86_64 functions (but not the other way around).
336
- llvm_verify_fixpoint_x86_ex ::
336
+ llvm_verify_x86_with_invariant ::
337
337
Some LLVMModule {- ^ Module to associate with method spec -} ->
338
338
FilePath {- ^ Path to ELF file -} ->
339
339
String {- ^ Function's symbol in ELF file -} ->
@@ -343,14 +343,14 @@ llvm_verify_fixpoint_x86_ex ::
343
343
LLVMCrucibleSetupM () {- ^ Specification to verify against -} ->
344
344
ProofScript () {- ^ Tactic used to use when discharging goals -} ->
345
345
TopLevel (SomeLLVM MS. ProvedSpec )
346
- llvm_verify_fixpoint_x86_ex llvmModule path nm globsyms checkSat (loopName,loopNum,f) =
346
+ llvm_verify_x86_with_invariant llvmModule path nm globsyms checkSat (loopName,loopNum,f) =
347
347
llvm_verify_x86_common llvmModule path nm globsyms checkSat
348
- (SimpleFixpoint2 loopName loopNum f)
348
+ (SimpleInvariant loopName loopNum f)
349
349
350
350
data FixpointSelect
351
351
= NoFixpoint
352
352
| SimpleFixpoint TypedTerm
353
- | SimpleFixpoint2 String Integer TypedTerm
353
+ | SimpleInvariant String Integer TypedTerm
354
354
355
355
llvm_verify_x86_common ::
356
356
Some LLVMModule {- ^ Module to associate with method spec -} ->
@@ -547,15 +547,15 @@ llvm_verify_x86_common (Some (llvmModule :: LLVMModule x)) path nm globsyms chec
547
547
SimpleFixpoint func ->
548
548
do f <- liftIO (setupSimpleLoopFixpointFeature sym sc sawst cfg mvar func)
549
549
return [f]
550
- SimpleFixpoint2 loopFixpointSymbol loopNum func ->
550
+ SimpleInvariant loopFixpointSymbol loopNum func ->
551
551
do (loopaddr :: Macaw. MemSegmentOff 64 ) <-
552
552
case findSymbols (symMap relf) . encodeUtf8 $ Text. pack loopFixpointSymbol of
553
553
(loopaddr: _) -> pure loopaddr
554
554
_ -> fail $ mconcat [" Could not find symbol \" " , nm, " \" " ]
555
555
case Map. lookup loopaddr cfgs of
556
556
Nothing -> throwX86 $ " Unable to discover looping CFG from address " <> show loopaddr
557
557
Just (C. SomeCFG loopcfg) ->
558
- do f <- liftIO (setupSimpleLoopFixpointFeature2 sym loopNum sc sawst mdMap loopcfg mvar func)
558
+ do f <- liftIO (setupSimpleLoopInvariantFeature sym loopNum sc sawst mdMap loopcfg mvar func)
559
559
return [f]
560
560
561
561
let execFeatures = simpleLoopFixpointFeature ++ psatf
@@ -656,7 +656,7 @@ setupSimpleLoopFixpointFeature sym sc sawst cfg mvar func =
656
656
return (result_substitution, result_condition)
657
657
658
658
659
- setupSimpleLoopFixpointFeature2 ::
659
+ setupSimpleLoopInvariantFeature ::
660
660
( sym ~ W4.B. ExprBuilder n st fs
661
661
, C. IsSymInterface sym
662
662
, n ~ GlobalNonceGenerator
@@ -674,8 +674,8 @@ setupSimpleLoopFixpointFeature2 ::
674
674
TypedTerm ->
675
675
IO (C. ExecutionFeature p sym ext rtp )
676
676
677
- setupSimpleLoopFixpointFeature2 sym loopNum sc sawst mdMap cfg mvar func =
678
- Crucible.LLVM.Fixpoint2. simpleLoopFixpoint sym loopNum cfg mvar invariant_func
677
+ setupSimpleLoopInvariantFeature sym loopNum sc sawst mdMap cfg mvar func =
678
+ SimpleInvariant. simpleLoopInvariant sym loopNum cfg mvar invariant_func
679
679
680
680
where
681
681
invariant_func phase implicit_params invariant_substitution =
@@ -693,11 +693,11 @@ setupSimpleLoopFixpointFeature2 sym loopNum sc sawst mdMap cfg mvar func =
693
693
implicit_params' <- mapM (scExtCns sc) $ Set. toList $ foldMap getAllExtSet body_tms
694
694
initial_exprs <-
695
695
forM subst_pairs $
696
- \ (MapF. Pair _var (Crucible.LLVM.Fixpoint2. FixpointEntry initVal _current)) ->
696
+ \ (MapF. Pair _var (SimpleInvariant. InvariantEntry initVal _current)) ->
697
697
toSC sym sawst initVal
698
698
current_exprs <-
699
699
forM subst_pairs $
700
- \ (MapF. Pair _var (Crucible.LLVM.Fixpoint2. FixpointEntry _init current)) ->
700
+ \ (MapF. Pair _var (SimpleInvariant. InvariantEntry _init current)) ->
701
701
toSC sym sawst current
702
702
703
703
initial_tuple <- scTuple sc initial_exprs
@@ -730,8 +730,8 @@ setupSimpleLoopFixpointFeature2 sym loopNum sc sawst mdMap cfg mvar func =
730
730
731
731
-- Add goal metadata for the initial and inductive invariants
732
732
case phase of
733
- Crucible.LLVM.Fixpoint2 . HypotheticalInvariant -> return b
734
- Crucible.LLVM.Fixpoint2 . InitialInvariant ->
733
+ SimpleInvariant . HypotheticalInvariant -> return b
734
+ SimpleInvariant . InitialInvariant ->
735
735
do (ann,b') <- W4. annotateTerm sym b
736
736
loc <- W4. getCurrentProgramLoc sym
737
737
let md = MS. ConditionMetadata
@@ -742,7 +742,7 @@ setupSimpleLoopFixpointFeature2 sym loopNum sc sawst mdMap cfg mvar func =
742
742
}
743
743
modifyIORef mdMap (Map. insert ann md)
744
744
return b'
745
- Crucible.LLVM.Fixpoint2 . InductiveInvariant ->
745
+ SimpleInvariant . InductiveInvariant ->
746
746
do (ann,b') <- W4. annotateTerm sym b
747
747
loc <- W4. getCurrentProgramLoc sym
748
748
let md = MS. ConditionMetadata
0 commit comments