Skip to content

Commit 2087df4

Browse files
committed
Move inNewAssertionStack to toplevel
1 parent d3a6994 commit 2087df4

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

‎src/Pact/Analyze/Check.hs‎

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,20 @@ resultQuery goal model0 = do
406406
-- SBV.Unsat -> throwError VacuousConstraints
407407
-- SBV.Unk -> throwError . Unknown =<< lift SBV.getUnknownReason
408408

409+
-- SBV also provides 'inNewAssertionStack', but in 'Query'
410+
inNewAssertionStack
411+
:: ExceptT a SBV.Query CheckSuccess
412+
-> ExceptT a SBV.Query CheckSuccess
413+
inNewAssertionStack act = do
414+
push
415+
result <- act `catchError` \e -> pop *> throwError e
416+
pop
417+
pure result
418+
419+
where
420+
push = lift $ SBV.push 1
421+
pop = lift $ SBV.pop 1
422+
409423
verifyFunctionInvariants'
410424
:: Info
411425
-> [Table]
@@ -444,21 +458,6 @@ verifyFunctionInvariants' funInfo tables pactArgs body = runExceptT $ do
444458
config :: SBV.SMTConfig
445459
config = SBV.z3
446460

447-
-- SBV also provides 'inNewAssertionStack', but in 'Query'
448-
inNewAssertionStack
449-
:: ExceptT a SBV.Query CheckSuccess
450-
-> ExceptT a SBV.Query CheckSuccess
451-
inNewAssertionStack act = do
452-
push
453-
result <- act `catchError` \e -> pop *> throwError e
454-
pop
455-
pure result
456-
457-
where
458-
push = lift $ SBV.push 1
459-
pop = lift $ SBV.pop 1
460-
461-
462461
-- Discharges impure 'SMTException's from sbv.
463462
catchingExceptions
464463
:: IO (Either CheckFailure b)

0 commit comments

Comments
 (0)