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

Add optional file path for verify to write SMTLib2 output #1100

Closed
wants to merge 2 commits into from

Conversation

rsoeldner
Copy link
Member

Add optional parameter to verify allowing to inspect generated SMTLib2 file (by SBV).

@rsoeldner rsoeldner requested a review from emilypi December 20, 2022 15:22
Copy link
Member

@emilypi emilypi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea! Suggesting a small change in scope here to reduce complexity: the convention for debugging output in natives is a Boolean flag overload. In keeping with that, it may be good to just choose a dedicated dotfile into which we can just dump smt output if the flag is set to true. We already have a notion of .pact-history. I'm proposing .pact-verify-{module name} or some variation of that instead of having the user supply an absolute or relative path.

@@ -452,23 +451,26 @@ verifyFunctionInvariants tf (CheckEnv tables _consts _pDefs moduleData caps gov
catchingExceptions act = act `E.catch` \(e :: SBV.SBVException) ->
pure $ Left $ CheckFailure funInfo $ SmtFailure $ UnexpectedFailure e

modName = moduleDefName $ _mdModule moduleData

debugFile = if debug then Just $ ".pact-verify-"<> asString' modName else Nothing
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a note, asString uses the namespace prefixed module name.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmcardon , I need to write to several temporary files for this feature. Is there any policy/library/functions in-place within pact?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe so, but I think this should be doable with System.FilePath+ io bracket.

@rsoeldner rsoeldner marked this pull request as draft December 22, 2022 19:43
@rsoeldner
Copy link
Member Author

closed in favour of #1122

@rsoeldner rsoeldner closed this Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants