Draft
Conversation
this commit adds a print mode to output Isar syntax
fold is defined as foldl which is left associative but I need the right associative version for printing function types in ML
Contributor
|
I converted your PR into a draft one. Feel free to un-draft it once you're planning on merging it soon. |
superaxander
requested changes
Jan 8, 2026
Member
superaxander
left a comment
There was a problem hiding this comment.
I have two small comments
| Group(Text("tuple<") <> Doc.args(ts) <> ">{" <> Doc.args(values) <> "}") | ||
| override def layout(implicit ctx: Ctx): Doc = { | ||
| ctx.syntax match { | ||
| case Ctx.Isar => Group(Text("(") <> Doc.args(ts) <> "," <> Doc.args(values) <>Text(")")) |
Member
There was a problem hiding this comment.
I think this might not be the right syntax in Isabelle, ts is the sequence of types in the tuple
| assoc(xs) <> "[" <> from <> ".." <> to <> "]" | ||
| override def layout(implicit ctx: Ctx): Doc = { | ||
| ctx.syntax match { | ||
| case Ctx.Isar => Text("nths") <+> assoc(xs) <+> "{" <> from <> ".." <> to <> "}" |
Member
There was a problem hiding this comment.
I believe in Isabelle this is an inclusive range whereas in VerCors this is exclusive.
In PVL
seq<int> s = [1,2,3];
s[1..2] == [2]
In Isabelle
nths [1::int,2,3] {1 .. 2} = [2, 3]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist:
PR description
This PR introduces a syntactic transformation from PVL to Isabelle. This allows for translating PVL's ADTs to a locale to prove they are consistent. The transformation is available as a command from vct, see example.
This creates a new file
foo.thypre-filled with a locale for each ADT. The user can then provide a witness for each locale to prove the corresponding ADT consistent.