Repository navigation
feat: parametric cast function + cast insertion in taclet application - #21
Merged
Merged
Conversation
Add cast.key (cast<[E]>(any) -> E + simplification taclets), TermBuilder.cast, and restore the cast insertion in RewriteTacletExecutor (getMaxSort port) so a replacewith result that doesn't fit its position is wrapped in a cast.
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.
Casts in the logic + cast insertion during taclet application
What
Adds the cast machinery legacy KeY uses to keep terms well-sorted, ported to the
parametric-function style (no sort-depending functions):
cast.key— a parametriccast<[E]>(any) -> Efunction (first-order;counterpart of
ghost<[E]>/read<[E]>) with its simplification taclets(
castDel, nested-cast collapse), included afterfirstOrderRules;cast_deletionruleset registered.TermBuilder.cast(Sort, Term)— buildscast<[sort]>(t)by instantiatingthe parametric
castat the target sort.RewriteTacletExecutor— computes the per-position required sort(
getMaxSort, aTermHelperport) and, when a replacewith result doesn't fit,wraps it in a cast — restoring the previously stubbed/commented-out logic.
Open question for maintainers⚠️
Six
RunAllProofscases fail to replay (e.g.man-loop-mul.proof):The cast insertion changes the term representation (loose terms now appear as
cast<[…]>(…)), so proofs saved under the old representation no longer match.cast.keyandTermBuilder.castare inert; only the executor insertion changesterms — which is its purpose.
Please decide:
(
man-loop-mul.proofand siblings undertestcase/examples/). (expected)only
cast.key+TermBuilder.castfor explicit use by taclets.Stacked on #19 (de Bruijn); base
rusty-debruijn. The open question above is for your decision.