Skip to content

Add Isar output mode#1391

Draft
edoput wants to merge 36 commits intoutwente-fmt:devfrom
edoput:dev
Draft

Add Isar output mode#1391
edoput wants to merge 36 commits intoutwente-fmt:devfrom
edoput:dev

Conversation

@edoput
Copy link
Copy Markdown

@edoput edoput commented Dec 19, 2025

Checklist:

  • The wiki is updated in accordance with the changes in this PR. For example: syntax changes, semantics changes, VerCors flags changes, etc.

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.

bin/vct --isar --isar-output=foo.thy res/universal/res/adt/*.pvl 

This creates a new file foo.thy pre-filled with a locale for each ADT. The user can then provide a witness for each locale to prove the corresponding ADT consistent.

@bobismijnnaam bobismijnnaam marked this pull request as draft January 8, 2026 12:08
@bobismijnnaam bobismijnnaam changed the title [wip] add Isar output mode Add Isar output mode Jan 8, 2026
@bobismijnnaam
Copy link
Copy Markdown
Contributor

I converted your PR into a draft one. Feel free to un-draft it once you're planning on merging it soon.

Copy link
Copy Markdown
Member

@superaxander superaxander left a comment

Choose a reason for hiding this comment

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

I have two small comments

Comment thread src/col/vct/col/ast/expr/literal/build/LiteralTupleImpl.scala Outdated
Comment thread src/col/vct/col/ast/expr/op/collection/SliceImpl.scala Outdated
Edoardo Putti and others added 26 commits April 16, 2026 14:05
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
@edoput edoput force-pushed the dev branch 2 times, most recently from 24b7200 to 0cbe14d Compare April 16, 2026 12:21
Edoardo Putti added 2 commits April 16, 2026 14:29
also use the correct symbol for the cardinality
Copy link
Copy Markdown
Member

@superaxander superaxander 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, please look at the comments I made and mark the PR as ready to review when you want it merged

Comment thread src/col/vct/col/ast/lang/Isar/IsarDefinitionCommandImpl.scala Outdated
Comment thread src/col/vct/col/ast/lang/Isar/IsarLocaleCommandImpl.scala Outdated
Comment thread src/col/vct/col/ast/Node.scala Outdated
import vct.col.ast.family.pvlcommunicate._
import vct.col.ast.family.seqrun._
import vct.col.ast.family.signals._
import vct.col.ast.lang.Isar.{
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Replace with _ import please

Comment thread src/main/vct/main/modes/Isar.scala Outdated
val result = Parsing.ofOptions(options, blameProvider)
.thenRun(Resolution.ofOptions(options, blameProvider))
.thenRun(Transformation.isarOfOptions(options)).thenRun(Output(
options.isarOutput.orElse(Some(Paths.get("a.java"))),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I guess this should be different default file name

Comment thread src/rewrite/vct/rewrite/ColToIsar.scala Outdated
Comment thread src/rewrite/vct/rewrite/ColToIsar.scala Outdated
Edoardo Putti added 4 commits April 22, 2026 14:11
ADTs are translated to locales so we need to bind the lexical scope
of locales to the lexical scope of ADTs. Moreover in the interpretation
command we require the full list of parameters to the locales hierarchy.
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