{"id":"c8a4bbb3-99d1-45cb-9040-227b3b8ec792","arxiv_id":"2607.16061","paper_version":1,"verdict":"CONDITIONAL","confidence":"MODERATE","novelty_score":7.0,"correctness_risk":"medium","formal_verification":"none","parameter_count":0,"one_line_summary":"Fresco typechecks first-class polymorphism by first reading each argument's 'skeleton' to guide the function's polymorphic instantiation, then sending the function's type back to the arguments, with soundness and completeness proved against a declarative specification.","lead":"This paper presents Fresco, a type-inference method that lets type information flow in both directions between a function and its arguments — so programs using first-class polymorphism, like mapping a polymorphic function over a Church-encoded list, get precise types. It comes with a mathematical specification, a matching algorithm proved sound and complete, and a working prototype that also infers modal effect types.","discovery_kind":"new_method","skeptic_critique":{"model":"deepseek-v4-flash","headline":"Optimality of type inference rests on missing tag-discharge lemmas (F.1–F.6); the rule SE-ForallInh may discharge a guessed quantifier from a bare inherited quantifier without constraining its body, undermining the no-best-choice guarantee.","rationale":"I agree with the reader's weakest-assumption identification: the tag-based determination principle is the most load-bearing element, and its correctness is not currently established because (a) the key consistency lemmas (F.1–F.6) are cited but missing, and (b) the algorithmic metatheory is not machine-checked. My stress-test sharpens this into a specific, testable risk: rule SE-ForallInh (Fig. 22) and its declarative counterpart C-ForallInh discharge a tag based solely on the RHS quantifier being inherited, without requiring the RHS body to constrain the guessed body. In skeleton subtyping, where RHS bodies may be ghosts, this could allow a guessed polytype to be justified by a bare quantifier, leading to multiple incomparable instantiations and breaking the optimality claims (Theorems 4.5–4.6), which in turn are used to prove Theorem 4.3. The paper's own limitations (§2.9) show the system is delicate in edge cases (e.g., the invalid Γ⊢ F C ∀a.1→a ≤ 1→∀b.b→b), so the absence of the F-lemmas is more than cosmetic. I give credit for the real independent support: the Rocq encoding of the declarative syntax-directed equivalence, the public prototype, and the parameter-free derivations. But the algorithmic soundness/completeness/optimality claims remain conditional on the missing or corrected lemmas. Therefore the reader's CONDITIONAL verdict should stand unchanged.","tokens_in":84518,"tokens_out":16465,"duration_ms":157387,"concrete_test":"Formalize (in Rocq or by hand) the soundness invariant for the tag-solving judgement C;ψ⇝Ψ of Fig. 22: every tag in Ψ is justified by a unique most-general instantiation. Test rule SE-ForallInh on the skeleton-side case eq(∀β. → ) with candidate ψ = ∀εα.α→α: does ε get discharged while both α→α and Int→Int (or α→Int) satisfy the same constraints? If yes, the one-occurrence relaxation admits incomparable solutions. If the proof requires an extra side condition (RHS body non-ghost, or containing the bound variable), the current rules are too permissive and Theorems 4.5–4.6 need revision.","verdict_should_be":"UNCHANGED","load_bearing_attack":"The central claim is Theorem 4.3: algorithmic type inference yields the optimal solution whenever one exists. Its proof relies on Theorems 4.5–4.6 for algorithmic subtyping, which in Appendix E are built on decorated algorithmic subtyping (Figs. 20–21) and tag-solving (Fig. 22). That argument repeatedly invokes Lemmas F.1–F.6 of a decorated-consistency metatheory, but Appendix F is absent from the reviewed text (Section 4.5 states the proofs are in Appendices C.6 and F). These lemmas are also not machine-checked: the Rocq artifact in Section 5 covers only the declarative versus syntax-directed equivalence (Lemmas B.1–B.2), not the algorithmic subtyping correspondence. The load-bearing rule is C-ForallInh / SE-ForallInh, which discharges a guessed quantifier's tag whenever the RHS quantifier is inherited, even if the RHS body is a ghost (skeleton subtyping, Fig. 4/22) or does not mention the bound variable. If such a discharge succeeds while the LHS body is unconstrained, then a guessed polytype can be justified by a bare quantifier, and the 'never guess polymorphism out of thin air' principle — which is what prevents no-best-choice ambiguity such as single id — fails. The missing F-lemmas are exactly what would prove, or refute, that every discharged tag corresponds to a unique most-general instantiation; without them the optimality guarantee is unsubstantiated.","agreement_with_reader":"agree"},"referee_report":{"model":"deepseek-v4-flash","summary":"The paper proposes Fresco, a bidirectional type inference system for first-class polymorphism. The key ideas are skeletons with ordinary and universal ghosts, a freezing operator, coloured quantifiers, and a tag-based provenance mechanism that is meant to ensure that polymorphic instantiations are only guessed when they are determined by inherited information. The authors give a declarative type system, a syntax-directed variant equivalent to it (mechanized in Rocq), and an algorithmic type system with a look/constraint-solving judgement. They claim soundness, completeness, and optimality of algorithmic type inference relative to the declarative system, and they report a prototype extended with algebraic data types and modal effect types. The motivating example churchMap (λf.(f 42, f true)) churchIds is claimed to be accepted while QuickLook, HMF, MLF, ATIA, and FCIF reject it.","tokens_in":84835,"tokens_out":7281,"duration_ms":77494,"significance":"If the technical claims hold, Fresco would be a substantial contribution to first-class polymorphism inference: it types a nontrivial motivating example that several established systems cannot, does so with a local algorithm that avoids global impredicative unification, and provides a rule-based specification with optimality theorems. The decorated-skeleton/tag-solving proof infrastructure is novel, and the paper ships two concrete strengths: a Rocq mechanization of the declarative-to-syntax-directed equivalence and a prototype with extensions to modal effect types. However, the central algorithmic theorems are not yet verifiable from the submitted text: the key consistency lemmas are in an appendix that is absent, and the completeness proof in Appendix E is truncated. The significance is therefore conditional on completing that material.","major_comments":[{"comment":"The proof of soundness and optimality of algorithmic subtyping — and through it Theorem 4.3 — rests on decorative consistency lemmas F.1–F.6 that are cited but not present. For instance, Lemma E.2 (soundness of decorated subtyping) invokes Lemma F.1, Lemma E.10 invokes Lemmas F.3/F.4, and Lemma E.15 invokes Lemma F.6. These are not machine-checked either. Without them, the decorated consistency/tag-solving correspondence is unsubstantiated. In particular, the reader's concern about C-ForallInh/SE-ForallInh (Figs. 2 and 22) discharging a guessed quantifier via a bare inherited quantifier is not refuted: no lemma establishes that every discharged tag corresponds to a unique most-general instantiation. This is load-bearing for the 'never guess polymorphism out of thin air' guarantee and for the optimality theorems.","section":"§4.5, Appendix E, Appendix F"},{"comment":"The completeness proof of algorithmic subtyping (Theorem 4.6) is incomplete in the submitted text. The proof of Lemma E.16 breaks off in the S-Arrow case, and the final induction and the statement's conclusion never appear. Since Theorem 4.6 is in turn used to prove Theorem 4.3 (completeness and optimality of type inference), the central claim of the paper is not fully established. The paper should either include the complete proof or clearly mark it as deferred to a supplementary document.","section":"Appendix E.3"},{"comment":"The claimed 'declarative specification' is arguably a rule-based presentation of the same tag-solving machinery that the algorithm implements: S-ForallL guesses a decorated polytype and requires its tags to be solved by C-ForallInh, while the algorithmic look/constraint-solving judgement (§4.6) computes exactly those solvable tags. The soundness/completeness theorems are thus partly a coherence result between two presentations of one design. This does not make the paper incorrect, but the authors should clarify what is declarative about the specification beyond being typographically non-algorithmic, and should temper the abstract's phrasing if the specification is not independent of the algorithm.","section":"§3.4, §4.6, Abstract"}],"minor_comments":[{"comment":"The Rocq encoding is described as 'a faithful encoding of the declarative type system' and proves Lemmas B.1–B.2. It does not machine-check Theorems 4.2–4.6. This should be stated explicitly early, so that readers do not infer that the algorithmic completeness theorems are mechanized.","section":"§5"},{"comment":"The 'precision' order on skeletons is defined as refinement in the other direction from what the word 'precision' might suggest. A short example or a note explaining why a skeleton with more ghosts is considered more precise would reduce confusion.","section":"§3.5"},{"comment":"The distinction between constraint collection and constraint solving is clear in the text, but the rule names (LS-, LE-, SolS-, SolE-) are easy to confuse. Please consider adding a one-line index or a name table in the appendix.","section":"§4.6, Fig. 7"}],"recommendation":"major_revision","confidential_remarks":"The manuscript is promising and the core idea is interesting, but the absence of Appendix F and the truncation of the completeness proof in Appendix E prevent verification of the main claims. This is fixable by supplying the missing material. I would also encourage the authors to make the scope of the Rocq artifact explicit: currently it covers only the declarative side, not the algorithmic optimality theorems. If the missing lemmas reveal a counterexample to the one-occurrence tag-discharge rule, the paper would need to be re-evaluated."},"author_rebuttal":null,"desk_editor":{"model":"deepseek-v4-flash","letter":"Quick take: this is the strongest recent attempt I've seen at a declarative specification for mixed-direction information flow in FCP. The skeleton/ghost machinery is genuinely new, and the tag-based 'determined instantiation' principle (one occurrence suffices, unlike CLTI/Boxy) is a real idea. The churchMap example is a nice stress test, and the paper is honest about limitations.\n\nWhat's good: the declarative system is clean, the algorithm is locally decidable (monotype unification only, look judgement), and the theorems — soundness/completeness/optimality of typing and skeleton inference — are stated with proofs in appendices. The Rocq encoding of the declarative/syntax-directed equivalence (Lemmas B.1–B.2) is real machine-checked evidence. The prototype with modal effect types shows scalability. The comparison tables are useful.\n\nWhere I'd press: the paper's load-bearing optimality results (Theorem 4.6 and hence Theorem 4.3) are built on decorated algorithmic subtyping (Appendix E), and the proof repeatedly invokes Lemmas F.1–F.6 from an Appendix F that is absent from the reviewed text. That is not a cosmetic gap: those lemmas are exactly what would show that every discharged tag corresponds to a unique most-general instantiation. The stress-test worry about SE-ForallInh discharging a guessed quantifier from a bare inherited quantifier without constraining the body is a concrete way this could break the 'no best choice' guarantee (single id). I can't confirm it fails — the missing lemmas might rule it out — but as written, the proof is unverifiable. Also, the algorithmic metatheory is not machine-checked; only the declarative side is. That's fine, but it raises the stakes for hand-rolled consistency lemmas.\n\nMinor: the abstract says 'expressive and predictable'; §2.9 is more measured, so I'd tone down the abstract. The co-design of spec and algorithm is real but not disqualifying — that's how most of these systems work.\n\nVerdict: this deserves a serious referee. The central idea is novel and the structure is sound; the missing F-lemmas and the SE-ForallInh corner need to be addressed. I'd accept a revision with those supplied.","headline":"A serious, well-structured FCP inference paper whose central optimality proof rests on missing appendix lemmas — worth a careful referee, not a desk reject.","tokens_in":85433,"tokens_out":2886,"would_cite":true,"duration_ms":28162,"reading_group":"yes","serious_thinker":"yes","would_accept_peer_review":true},"rs_alignment":null,"lean_confirmation":null,"pith_extraction":{"msc":[],"pacs":[],"model":"deepseek-v4-flash","headline":"Fresco claims that mixed-direction information flow can be made declarative: skeletons with ghosts collect information from arguments, tagged subtyping forbids guessing polymorphism, and a simple algorithm is sound and complete.","keywords":["first-class polymorphism","bidirectional type inference","skeleton inference","ghost types","freezing","higher-rank polymorphism","polymorphic instantiation","modal effect types"],"falsifier":"Run the implementation on the two anchor examples from the paper: churchMap $(\\lambda f. (f 42, f true))$ churchIds should be accepted, and single id should be rejected. The sharper structural test is to exhibit a program whose only successful derivation instantiates a polytype with no occurrence matched to inherited information—then the 'never guess' principle is violated and the no-best-choice argument collapses.","tokens_in":84311,"feed_emoji":"🔀","tokens_out":6521,"duration_ms":63093,"temperature":0.7,"texified_at":"2026-08-05T21:27:01.150936+00:00","pith_summary":"Fresco is a bidirectional type inference system for first-class polymorphism—programs where functions can be instantiated with polymorphic types, not just monomorphic ones. The paper tries to establish that such inference can be made both expressive and predictable: type information should be allowed to flow from arguments to functions and then back, but a polymorphic instantiation should never be guessed 'out of thin air.' Its main claim is a declarative type system plus a simple algorithm that is sound and complete with respect to that declarative system. On the paper's central example, the algorithm types churchMap applied to a Church-encoded list of polymorphic identities, while single id is rejected as ambiguous, showing that mixed information flow can be principled rather than ad hoc.","texify_model":"deepseek-v4-flash","texify_usage":{"total_tokens":5482,"prompt_tokens":714,"completion_tokens":4768,"prompt_tokens_details":{"cached_tokens":0},"prompt_cache_hit_tokens":0,"prompt_cache_miss_tokens":714,"completion_tokens_details":{"reasoning_tokens":4154}},"feed_headline":"Fresco types first-class polymorphism with two-way information flow","feed_subtitle":"A declarative spec plus a sound, complete algorithm types the Church-list example that stymies conventional systems.","key_machinery":"The key machinery is skeleton inference, which mirrors the syntax-directed typing rules and produces a skeleton with ordinary ghosts for unknown types and universal ghosts for unknown quantifier sequences; freezing forces a term's skeleton to be exactly its own type, so programmers can decide what information an argument exposes. Skeleton refinement and colouring turn the argument's skeleton into a bidirectional type with inherited and synthesised quantifiers. The second load-bearing piece is tagged subtyping: each guessed instantiation quantifier carries a tag, and a tag is solvable only when a consistency rule like C-ForallInh matches it against an inherited quantifier; at least one occurr","core_discovery":"Fresco's central claim is that skeletons and ghosts give a declarative account of how local type information flows between functions and arguments. A skeleton is an argument's type with 'ghost' holes for unknown monotypes and unknown quantifier sequences; skeleton inference collects the known polymorphic shape of an argument, and skeleton refinement fills the holes with information supplied by the function. Colours mark whether a quantifier was inherited from the argument or synthesised by the function. In subtyping, every guessed quantifier is tagged, and the guess is accepted only if at least one occurrence of the tag is determined by an inherited quantifier—this is the formal meaning of '","pith_inferences":["The tag-based 'determined by inheritance' test is a candidate general principle for any local inference system that wants to mix directions of information flow without global constraint solving; it could be reused outside this specific system.","Named ghosts are the natural next step: connecting occurrences inside a skeleton would let the argument's own shape guide more instantiations, at the cost of more complex skeleton refinement.","The single-pass flow restriction is a design trade-off; relaxing it to allow information to flow back and forth repeatedly would increase expressiveness but complicate the optimality story, since the order of solving could start to matter.","The extension to modal effect types hints that the mechanism is not tied to System F: any setting where types carry implicit introduction and elimination operations has the same 'don't guess' structure."],"forward_implications":["If the central claim holds, first-class polymorphism becomes inferable in a bidirectional style: the motivating churchMap program is typable, with the polymorphic identity type flowing from the Church-encoded argument into the function and back into the lambda.","The 'determined tag' rule gives a predictable answer to the no-best-choice problem: single id is rejected rather than silently assigned one of several incomparable polymorphic types.","Because polytypes are never guessed, unification can remain first-order; only monotypes are solved by global unification, so the algorithm stays simple and local.","The same infrastructure—skeleton inference plus ghosts—extends beyond plain polymorphism, as the implementation shows by inferring modal effect types.","The syntax-directed declarative system is equivalent to the coloured declarative system, so the specification has a clean algorithmic reading."],"fun_headline_variants":["Fresco infers first-class polymorphism via two-way type flow","Skeletons and ghosts enable two-way type inference in Fresco","Freezing, skeletons, ghosts: new technique for polymorphic typing","Fresco: sound and complete inference for first-class polymorphism","Two-way flow with skeletons and ghosts upgrades bidirectional typing"],"cache_read_input_tokens":2304,"weakest_assumption_plain":"The load-bearing premise is that a guessed polymorphic instantiation is legitimate exactly when at least one occurrence of its quantifier is anchored to an inherited quantifier, and that the algorithm's look judgement captures precisely this relation; if that correspondence fails, Fresco would either guess polymorphism with no best choice or reject programs it should accept.","fun_headline_variants_meta":{"raw":{"variants":["Fresco infers first-class polymorphism via two-way type flow","Skeletons and ghosts enable two-way type inference in Fresco","Freezing, skeletons, ghosts: new technique for polymorphic typing","Fresco: sound and complete inference for first-class polymorphism","Two-way flow with skeletons and ghosts upgrades bidirectional typing"]},"model":"deepseek-v4-flash","effort":"low","cost_usd":0.000236,"raw_usage":{"total_tokens":1306,"prompt_tokens":672,"completion_tokens":634,"prompt_tokens_details":{"cached_tokens":256},"prompt_cache_hit_tokens":256,"prompt_cache_miss_tokens":416,"completion_tokens_details":{"reasoning_tokens":547}},"tokens_in":416,"tokens_out":634,"duration_ms":5884,"temperature":1.0,"reasoning_tokens":547,"cache_read_input_tokens":256,"cache_creation_input_tokens":0},"cache_creation_input_tokens":0},"created_at":"2026-08-01T21:28:49.834537+00:00","model_set":{"reader":"deepseek-v4-flash"},"falsifier":"Run the implementation on the two anchor examples from the paper: churchMap $(\\lambda f. (f 42, f true))$ churchIds should be accepted, and single id should be rejected. The sharper structural test is to exhibit a program whose only successful derivation instantiates a polytype with no occurrence matched to inherited information—then the 'never guess' principle is violated and the no-best-choice argument collapses.","supporting_citations":[],"review_version":1}