Repository navigation
v2 infer: application-argument inhabitance before admission - #11296
Conversation
Every reached Transform is visited on the existing gather fold; the argument's derived type must inhabit the parameter's declared type (v2.std.inhabitance), and a missing derivation or a distinct constructor refuses before admission. Co-authored-by: Cursor <cursoragent@cursor.com>
…rontier. declared_type_inhabitance is the singleton-candidate find_witness already used by coercion, not a second atom-equality fold. Missing formals and generic/optional pairs stay Accepted with a typed undecidable diagnostic; only a decidable distinct constructor refuses, and an underived argument type still rejects. Co-authored-by: Cursor <cursoragent@cursor.com>
Rejected stays only for both sides derived and find_witness refusing; underived arguments, missing operator Arrow, generic/optional formals, and unmodeled arity stay on the Accepted path with typed frontier diagnostics. Co-authored-by: Cursor <cursoragent@cursor.com>
…eable applications. Native emission stays a declared frontier until inhabitance is in the native 04_infer closure and the Bool-at-Int RED refuses on the emitted binary. Co-authored-by: Cursor <cursoragent@cursor.com>
A one-arm `type T = Name` is a type alias, so PositionDirectCallArgument never existed as a constructor; brace interpolation in the frontier note and Present-vs-Optional if joins were the same class of resolve refusal on the floor. Co-authored-by: Cursor <cursoragent@cursor.com>
Commentary String rows become leading // on InhabitanceVerdict; connective is_* helpers fold into the pair judgment; unused refinement/kernel arms and the unused find_witness-reason projector are gone until a consumer mints them. Co-authored-by: Cursor <cursoragent@cursor.com>
|
review 65602 (REQUEST_CHANGES): verified on the then-head and applied on
— sent from fierce-swift-182 |
The skip-first fold rebuilt the suffix on every formal; v2.std.algebra.list_tail is the O(1) accessor, and the operator-drop for Transform arguments uses the same tail instead of a copied accumulator. Co-authored-by: Cursor <cursoragent@cursor.com>
|
review 65625: verified. — sent from fierce-swift-182 |
The optional-carrier control was refusing via find_witness because TypeNode { connective: Cardinality } did not eliminate; nested Connective match is the same authority. The Bool-at-Int RED now searches the diagnostic list, since pending grounding diagnostics precede the inhabitance cause.
Co-authored-by: Cursor <cursoragent@cursor.com>
review 65646: the RED helper now imports Symbol; the inhabitance diagnostic reads position, parameter identity, application, declared, and produced from the obligation instead of a parallel argument list. Co-authored-by: Cursor <cursoragent@cursor.com>
|
review 65646: both findings were live on
— sent from fierce-swift-182 |
review 65672: infer_judge_application_argument eliminates the three-arm verdict directly. Find-witness no-candidate stays application_argument_does_not_inhabit; other find_witness reasons keep their own symbols and are named on the correction node. Co-authored-by: Cursor <cursoragent@cursor.com>
|
review 65672: both findings were live; addressed on
— sent from fierce-swift-182 |
review 65687: infer_arrow_declaration_for_binding was a recursive children walk beside the stage catamorphism. It is now one NodeFold; first Named binding whose target is Arrow still wins. Dissolve-on remains ResolvedTree.bindings. Co-authored-by: Cursor <cursoragent@cursor.com>
|
review 65687: the recursive — sent from fierce-swift-182 |
Heal refused inhabitance.dag: the no-candidate branch was a bare interned atom (String) against a Symbol else-arm. Both arms now return Symbol so the application-site reason still distinguishes find_witness no-candidate. Co-authored-by: Cursor <cursoragent@cursor.com>
review 65723: operator-declaration lookup is not the domain-parameter walker. Colliding names are FormalUnresolved instead of a first-match refusal. Formal/argument pairing consumes zip_map; the dead arity arm is gone. Both heuristic walks share the SymbolIndex dissolve-on. Co-authored-by: Cursor <cursoragent@cursor.com>
|
review 65723: the zip finding is applied on Not merged with What did change, because it was the real §5 hole: operator-arrow lookup is unique-or-absent. Zero or colliding names → Zip: — sent from fierce-swift-182 |
review 65736: a zero-child Transform never reached step, so it dropped out of the facts map. Init now runs the transform row when children_remaining is already 0. The add-shape annotation matches the new dispatch. PositionDeclaredReturn is a declared return-obligation frontier, not a silent extra arm. Co-authored-by: Cursor <cursoragent@cursor.com>
|
review 65736: all three findings applied on
— sent from fierce-swift-182 |
Heal and floor refused 04_infer: fold is not in scope inside the lookup algebra. Concatenation is a module-level helper the step calls. Co-authored-by: Cursor <cursoragent@cursor.com>
review 65768: once formals and positional args are both counted, inequality is surplus or deficit, not an unjudgeable shape. The enrolled control now expects application_positional_surplus. Named-arg gaps remain FormalUnresolved when no unique Arrow is found. Co-authored-by: Cursor <cursoragent@cursor.com>
|
review 65768: applied on When a unique Arrow is found, formal count and positional-arg count are both known. Inequality is now — sent from fierce-swift-182 |
review 65783: a whole-tree Named Arrow lookup and a non-Conj domain folded to empty formals both fabricated arity refusals. Atom operators and undecomposed domains stay FormalUnresolved until ResolvedTree.bindings. Co-authored-by: Cursor <cursoragent@cursor.com>
|
review 65783: applied on
— sent from fierce-swift-182 |
review 65801: declared_type_inhabitance keeps find_witness over the declared singleton rather than CoercionCandidateSet selection; the unused not-derived gather copy is the frontier helper with empty entries. Co-authored-by: Cursor <cursoragent@cursor.com>
|
review 65801: applied in part on this head; the coercion-home arm is refused.
— sent from fierce-swift-182 |
Heal and floor refused inhabitance.dag: leading // above a type names no subject, and a Diagnostic.reason field cannot be a newline-then-if. Co-authored-by: Cursor <cursoragent@cursor.com>
review 65818: refinement_widening is a realized find_witness rule over a value-set algebra, not a pair of application type nodes; refuse to call it with the produced type as algebra. Rung text matches the Bool-at-Int RED. Co-authored-by: Cursor <cursoragent@cursor.com>
|
review 65818: applied as the stated-divergence arm on this head (not a fake consume of widening).
This landing therefore decides exact structural equality of derived types. The Bool-at-Int RED is that predicate. Rung text now says so. Trigger: a producer supplies integer value-set evidence on produced and declared; then this fold consumes Not routing structurally-unequal-but-not-atoms to Undecidable: that would drop the Bool-at-Int refusal unless we mint a second "distinct constructor" predicate, which PHASE 1 forbade beside — sent from fierce-swift-182 |
Floor still red on infer_optional_carrier: Int at a Cardinality formal was find_witness-refused instead of counted OptionalCarrier. The same TypeNode Cardinality match already used by gather_fold_init now gates the obligation before declared_type_inhabitance. Co-authored-by: Cursor <cursoragent@cursor.com>
review 65869: infer_formal_declared_undecidable copied the NodeKind map. One table remains: inhabitance_node_undecidable_reason. Co-authored-by: Cursor <cursoragent@cursor.com>
|
review 65869: applied on this head.
— sent from fierce-swift-182 |
Floor stayed red on Int-at-Cardinality after the infer pre-check, so the test module's Cardinality constructor was not the classifier's subject. The specimen is now minted beside the match. Co-authored-by: Cursor <cursoragent@cursor.com>
review 65917: annotations cannot carry rung/retirement claims; the diagnostics-has-reason predicate lives once in v2.std.diagnostic. Co-authored-by: Cursor <cursoragent@cursor.com>
|
review 65917: applied on this head.
|
Heal and the floor both load the roster join; an unescaped brace in the new row refused the parse of generated_artifact_gate heal_repair_declaration. Co-authored-by: Cursor <cursoragent@cursor.com>
The floor red was infer_optional_carrier_is_counted_frontier_holds: RequiresTerminationProof on the type constructor refused descent before inhabitance could count OptionalCarrier on the application. Co-authored-by: Cursor <cursoragent@cursor.com>
review 65981: flipping connective_multiplicity to Bounded removed cardinality_descent_not_proven corpus-wide. Infer now admits a TypeNode Cardinality as GroundingNotDerived with descent Violates instead of aborting the tree before application inhabitance. Co-authored-by: Cursor <cursoragent@cursor.com>
|
review 65981: applied on this head. The What was wrong in infer was the grain: |
review 65998: Accepted-over-Violates widened the set without a rung drop. OptionalCarrier stays enrolled on inhabitance_node_undecidable_reason; infer of a Cardinality formal remains cardinality_descent_not_proven. Co-authored-by: Cursor <cursoragent@cursor.com>
|
review 65998: applied on this head. No rung drop.
|
review 66017: infer_descent_witness_for_node remaps cardinality_descent_not_proven to infer_descent_not_derived; the witness and RFM now cite that executed reason. Co-authored-by: Cursor <cursoragent@cursor.com>
|
review 66017: applied on this head. The remap is pre-existing ( |
Summary
v2.std.inhabitanceis the inhabitance authority.declared_type_inhabitanceconsumesfind_witnessover the singleton{declared}withpreservation_rule_exact_structural_equality_zip_fold.v2.compiler.inferconstructsDeclaredTypeObligationon every reachedTransformvia the existinginfer_gather_fold; it does not mint a second compatibility predicate and does not touch v1.InhabitscarriesHomomorphismWitness.InhabitanceRefusedwraps thefind_witnessreason. Unjudgeable applications areInhabitanceUndecidableon the Accepted path (counted frontier, same dissolve-on asinfer_grounding_not_derived): ArgumentTypeNotDerived, FormalUnresolved, GenericFormal, OptionalCarrier. Rejected is both-sides-derived andfind_witnessrefusing, or a unique Arrow whose formal count and positional-arg count differ (application_positional_surplus/application_positional_deficit).application_argument_does_not_inhabit; Int at Int admits; each remaining undecidable reason has an Accepted+counted-frontier control; surplus arity refuses.UndecidableGenericFormalon the same module.Rung (honest)
v2.std.inhabitanceis in the native04_inferclosure and the same Bool-at-Int RED refuses on the emitted binary.InhabitanceUndecidablefrontier count over reached applications is zero on both routes. First corpus count belongs on this landing head oncerequired-witnesses-floorprints it (instrument line to be pasted from that run).Test plan
infer_application_argument_inhabitance_witness_testRED/POS, frontier reason controls, positional surplus REDrequired-witnesses-floorgreen onecb2a40c243including those witnesses