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

Introduce Prop newtype wrapper for Terms representing propositions as types #614

Merged
merged 6 commits into from
Dec 26, 2019

Conversation

brianhuffman
Copy link
Contributor

This branch attempts to clean up some of the unclear conventions about how various functions expect Term arguments to encode logical propositions. Now we can use type Prop to unambiguously indicate that we will encode universal quantification with Pi types, and EqTrue to lift booleans to type sort 0.

This branch also includes a fix for #613, which is one of those bugs caused by disagreement between conventions for variable quantification and logical negation for prove vs sat.

Brian Huffman added 4 commits December 12, 2019 13:18
Other functions are renamed according to their saw-script names.
A "proposition" is defined as a `Term` whose saw-core type is `sort n`
for some `n`.

Also fix `split_goal` tactic, which expected a goal in the wrong
representation.
Copy link
Contributor

@andreistefanescu andreistefanescu left a comment

Choose a reason for hiding this comment

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

looks good!

printOutLnTop Warn $ "WARNING: assuming goal " ++ goalName goal ++ " is valid"
let stats = solverStats "ADMITTED" (scSharedSize (goalTerm goal))
return (SV.Valid stats, stats, Nothing)
assumeValid =
Copy link
Contributor

Choose a reason for hiding this comment

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

mixing code formatting changes with functional changes makes the functional changes harder to review. In general, avoid formatting changes of code you are not changing in other ways, or at least move all code formatting changes in separate commits, so they can be skipped during code review

-- satisfiability using ABC.
satABC :: ProofScript SV.SatResult
satABC = do
-- | Bit-blast a proposition and check its validity using ABC.
Copy link
Contributor

Choose a reason for hiding this comment

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

nice that these renames are in a separate commit

do let (args, concl) = asPiList goal
p <- asEqTrue concl
p' <- scNot sc p
p' <- scNot sc p -- is this right?
Copy link
Contributor

Choose a reason for hiding this comment

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

this looks right

@brianhuffman brianhuffman merged commit 2c2df99 into master Dec 26, 2019
@brianhuffman brianhuffman deleted the bh-prop branch December 26, 2019 15:51
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.

2 participants