Remove unnecessary coercions between bool/prop/Type#4279
Draft
gebner wants to merge 6 commits into
Draft
Conversation
The compiler now automatically inserts b2t (bool→prop) and t2b (prop→bool) coercions when there is a type mismatch. Remove explicit uses from: Library: - FStar.Int.fsti: requires clauses in incr/decr - FStar.UInt.fsti: requires clauses in incr/decr/incr_underspec/decr_underspec - FStar.RefinementExtensionality.fst: refinement type Tests: - TestGhost.fst, SimplifyProp.fst, Unit1.WPsAndTriples.fst: requires clauses - Bug026, Bug155, Bug292: refinement types - Bug237, Bug281: t2b removal in if-conditions - Lib.LoopCombinators.fst: requires/ensures clauses - NegativeTests.Neg.fst, TestErrorLocations.fst: error message tests - Caller.fst: comment update Remaining b2t uses are either: - Definitions (Prims.fst) - Local variables (Parametricity.fst aliases binder_to_term as b2t) - Quoted terms in metaprogramming (TReflGuards, TestImmutableArray) - normalize_term interactions where auto-coercion doesn't fire squash uses are all semantic (parameter types, return types) not coercions. strong_excluded_middle only appears in its definition module. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…more Continue removing manual coercions now handled by automatic insertion: b2t removal (examples/): - SfLists, Problem01, GC, LambdaOmega, Unification, Huffman, RBTree, BinarySearchTreeBasic t2b removal (examples/ and pulse/): - LambdaOmega, StlcStrongDbParSubst - Pulse.Lib.ForEvery: removed local t2b definition and all uses b2t removal (pulse/): - PulseTutorial.MonotonicCounter*, Pulse.Lib.Task, Pulse.Lib.ForEvery squash removal (function arg/return types, ulib/ and tests/): - FStar.UInt128, FStar.Math.Euclid, FStar.Seq.Properties, FStar.FunctionalExtensionality - CalcInference, ClassicalSugar, StrictUnfolding, TwoPhaseTC, UnifierArith, HoleBy, CoreCheckMatch, Bug3353, BugBoxInjectivity Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The compiler now auto-inserts squash coercions, making explicit squash
in function parameter and return type positions redundant.
Key changes:
- FStar.Classical.Sugar.fst/fsti: all squash wrappers removed
- FStar.Tactics.{MApply0,V2.Derived,Simplifier,CanonMonoid,Canon.Lemmas,
BV.Lemmas,PatternMatching,PrettifyType,Parametricity}: squash removed
- FStar.{Classical,Pervasives,ReflexiveTransitiveClosure,WellFounded,
Seq.Permutation,Seq.Sorted,Sequence.Base,Bijection,BV,FiniteSet.Ambient,
Reflection.TermEq}: squash removed
- ~80 test files: squash removed from parameters and return types
- pulse/: squash removed where applicable
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The Pulse language extension now supports auto-coercion of squash in returns clauses and function parameter types. Remove explicit squash from these positions across pulse lib, core, examples, and checker. Preserves 'let x : squash p = ()' proof patterns which still require explicit squash in Pulse. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
46636ee to
dd7fad1
Compare
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.
No description provided.