Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
67f1f49
docs/plans: arrow elimination model for v2 infer (for ruling)
Sep 26, 2026
d5135cb
v2 infer: arrow elimination and the body/declared-return check; one I…
Sep 26, 2026
f06dce7
infer_product_introduction: evidence control pins the Int type atom's…
Sep 27, 2026
2e3012b
Merge remote-tracking branch 'origin/main' into session/quick-owl-368
Sep 27, 2026
ac1df96
Take infer's ObligatedInferredTree through discharge; flip refinement…
Sep 27, 2026
03342a3
v2 resolve: ResolvedTree carries the SymbolIndex resolution consulted…
Sep 27, 2026
179c7f1
Merge origin/main; migrate the remaining resolved-tree helpers (typec…
Sep 27, 2026
95856ef
pick_ingested: the arrow extractor returns the arrow Node (my retype …
Sep 27, 2026
84d4768
Merge origin/main; retype main's new resolved-tree helpers (declared_…
Sep 27, 2026
274d51d
Merge origin/main into session/quick-owl-368 (resolve 04_infer import…
Sep 27, 2026
3609145
compose #12432 (pinned reference-evidence base)
Sep 28, 2026
80e9a04
compose #12379 (pinned reference-evidence base)
Sep 28, 2026
3c43400
A reference to a corpus declaration is typed by that declaration
Sep 28, 2026
1b73daa
The reference's guard becomes the one an application will ask
Sep 28, 2026
707cc49
The same-leaf discriminator is not qualified, and the file says so
Sep 28, 2026
7fa6d60
The application path can now see a reference's callable evidence; it …
Sep 28, 2026
32ea98e
A named call grounds: the use carries the facts, the arrow carries th…
Sep 28, 2026
53022c2
A return that is already a type is consumed, not denoted again
Sep 28, 2026
5359640
The body/return check becomes reachable, so a return mismatch refuses…
Sep 28, 2026
117a716
The qualification set: identity discriminated, unavailable evidence r…
Sep 28, 2026
2702923
Native execution of a named call: measured, still refused at eval
Sep 28, 2026
b65297c
Attribute the eval refusal: the anchor is inside the callee's declari…
Sep 28, 2026
6bf3b29
A named call executes: eval consumes the declaration reference it was…
Sep 28, 2026
e168404
The remaining refusal is a facts-key collision, not a fact about the …
Sep 28, 2026
c187a8f
Both remaining reds refuse at the same runtime-built node, measured
Sep 28, 2026
3769c83
Withdraw the provenance inference; establish the key conflict by enum…
Sep 28, 2026
3065331
Enroll the acceptance targets: argument-dependent execution and the B…
Sep 28, 2026
6f0dff1
Field projection through resolve, infer and eval, with the field chec…
Sep 29, 2026
b38e6e2
The seven's receiver is a match binder, and its blocker is the match …
Sep 29, 2026
0eddf9f
Merge main into the field-projection lane: both carrier threads, not one
Sep 29, 2026
27f1427
Restore the application-path repair the merge pass silently dropped
Sep 29, 2026
0cb200c
Merge main (#12433, #12510 and four more) into the field-projection lane
Sep 29, 2026
81e7c77
The seven's downstream continuation, qualified past the match boundary
Sep 29, 2026
22800fa
The chain wins: a bound head resolves local-first, and the interim gu…
Sep 29, 2026
5ca3b0a
v2 infer: type a match over a declared (generic) coproduct and its ar…
gunbai-bot[bot] Sep 30, 2026
83d27a7
Take the landed match-binder typing (#12641) into the lane
Sep 30, 2026
f37bc61
Compose #12506, #12641 and current main by hand, preserving all three…
Sep 30, 2026
fcce3d8
Two readers disagreed about a callee's arrow, so no named call's argu…
Sep 30, 2026
d933035
Route an unadmissible callable grounding to the frontier; retire the …
Sep 30, 2026
2627d30
Compile the consumers the widened signature broke, and undo two merge…
Sep 30, 2026
8e9fc28
Enrol two rows that nothing was running, and correct the measurement …
Sep 30, 2026
89420be
Merge main: #12566's one-relation declared-return judge beside this l…
Sep 30, 2026
76c9ed5
A declared position that already carries its value type is decidable;…
Sep 30, 2026
a13d507
An ill-typed fixture the skipped check was hiding; the facts-key conf…
Sep 30, 2026
e95381c
Merge main (#12407): six conflicts resolved on their merits, plus fou…
Sep 30, 2026
66cd619
Merge main (#12714): import union in resolve
Sep 30, 2026
0f9d715
The arm-pattern reader asked the construct encoding instead of re-der…
Sep 30, 2026
ee18cd4
Merge remote-tracking branch 'origin/main' into lane/reference-eviden…
Sep 30, 2026
797a608
A loop carrier is a binder: one value-binder admission, and the Loop …
Sep 30, 2026
978cf66
Value binders are admitted at one gate: Arrow parameters, lets, match…
Sep 30, 2026
85ad321
One callable Arrow constructor; value shadowing refuses, with its inc…
Sep 30, 2026
8b83c4a
Eight claims moved to the interface they discriminate; 44 stay end-to…
Oct 1, 2026
9b55c96
Merge main (#12550 fold encoding, #12582 facts-key, #12740/#12763 rec…
Oct 1, 2026
78c2444
Delete the duplicate Loop dispatch arm the merge left behind
Oct 1, 2026
2bd1f0d
The fold slot is a generated binder, not the authored step formal; th…
Oct 1, 2026
bd9d3d3
A root binding resolves a name but may not be projected through
Oct 1, 2026
6df74f8
A root-bound data value's projection: control added, and it is not ye…
Oct 1, 2026
8ea7415
The cref locator asks the production application reader and selects b…
Oct 1, 2026
6b3490b
Derive the DAG canonical symbol set from the grammar instead of its s…
Oct 1, 2026
82b5f15
Qualified-name resolution retains the binding kind rather than collap…
Oct 1, 2026
a509caa
Field-projection inference distinguishes an unretrievable declaration…
Oct 1, 2026
54725fe
File the diagnosed root: infer cannot derive a child's context from a…
Oct 2, 2026
db5b9d5
Merge remote-tracking branch 'origin/main' into lane/reference-eviden…
Oct 2, 2026
14a8710
Revert the canonical-symbol derivation: main narrowed the set it repr…
Oct 2, 2026
f498eb6
Re-point the parameter reader at main's route; record the match-binde…
Oct 2, 2026
bb1e03c
Merge remote-tracking branch 'origin/main' into lane/reference-eviden…
Oct 2, 2026
e60150d
The consolidated callable arrow closes its own lowered image
Oct 2, 2026
f92c961
Compile every consumer of the widened constructor, not the five files…
Oct 2, 2026
7f3a0e6
The native door passes the resolution, not the whole NativeTestContext
Oct 2, 2026
8c23004
Update the two citations of the renamed fold-carrier row
Oct 2, 2026
edd9788
Facts-key collision controls assert the separation #12582 achieved, n…
Oct 2, 2026
72e10bb
WIP, NOT YET EFFECTIVE: one full-path key for named-parameter bind an…
Oct 2, 2026
2eb0676
Close #12766's eval frontier: a parameter-reference body is admitted …
Oct 2, 2026
ea11297
Merge origin/main into lane/reference-evidence-consumer
Oct 2, 2026
3bf1880
Repair the merge's cross-side seams: projection base, two fixtures
Oct 2, 2026
c84f55b
Where-predicate calls walk unjudged under the where_clause frontier, …
Oct 2, 2026
a4b2b10
Hoist three in-body annotations in 05_eval to module-item grain (floo…
Oct 2, 2026
4dda083
fold_lowering: a block-bodied arrow lambda has a block body
Oct 2, 2026
adb3d63
Resolve the closure once per context, not once per subject (review 74…
Oct 2, 2026
f09191e
Total the merge's sixteen unrostered wildcard arms; roster the one th…
Oct 2, 2026
b0e566a
Merge remote-tracking branch 'origin/lane/reference-evidence-consumer…
Oct 2, 2026
2ec3636
N7-1 WIP: lambda-binder projection base is a lexical reference; depen…
Oct 2, 2026
6425323
N7-1: control for the lambda-binder projection base (r)
Oct 2, 2026
d09ec4f
N7-1: climb receipt on infer_child_context_cannot_depend_on_a_sibling…
Oct 2, 2026
422a28c
N7-1: rename the keyword-spelled loop parameters (native parse refusa…
Oct 2, 2026
2a7bf55
N7-1: nested payload binder re-boxed in emitted Rust -- receipt with …
Oct 2, 2026
73e5a89
N7-1 (a): a collection fold iterates its step's BODY; the carrier for…
Oct 3, 2026
c2ccddc
N7-1 (a): frontier row for a lambda value with no derived type in v2 …
Oct 3, 2026
4e1009e
N7-1: receipt -- the operand reader's second authority for a binder's…
Oct 3, 2026
fe498dc
N7-1 (x)(1): a closure root whose own resolve refused is recorded, an…
Oct 3, 2026
7eb44d9
N7-1 (x)(2): v2 std modules that spelled List without importing it im…
Oct 3, 2026
5585a39
N7-1 (x)(2): a projection off a value resolves its base and not its f…
Oct 3, 2026
83a31c8
arrow_lambda_block_body: one warm producer for the five claims
Oct 3, 2026
2dae714
N7-1: value-projection arm reads the field edge through field_project…
Oct 3, 2026
744946f
N7-1b: std.algebra collection callback operations (map, all) realized…
Oct 3, 2026
29a8088
v2 std: one List binding per module -- drop the v2.std.collection Lis…
Oct 3, 2026
126a658
v2 std: import Optional/Present/Absent where four modules used them u…
Oct 3, 2026
3e2a256
N7-1b: regenerate the std.algebra stage0 mirror (named collection cal…
Oct 3, 2026
4467f51
collection_callback_realization: each fixture program assembled once …
Oct 3, 2026
acc2a93
floor_pure_producer_share: warm rows for collection_callback_realizat…
Oct 3, 2026
f7e61a7
Merge origin/main into session/tidy-raven-393 (#12506 landed; retarge…
Oct 3, 2026
3e08ecc
Merge remote-tracking branch 'origin/main' into session/silent-crab-3…
Oct 3, 2026
218eedb
N7-1: exhaustive arms in the dependent-child driver and fold decoders…
Oct 3, 2026
07a66bb
infer_fold_member_instance: one nullary producer per fixture program;…
Oct 3, 2026
d070e7b
floor_pure_producer_share: warm rows for infer_fold_member_instance p…
Oct 3, 2026
c2aa58a
Merge remote-tracking branch 'origin/session/tidy-raven-393' into ses…
Oct 3, 2026
5be64e2
Merge remote-tracking branch 'origin/session/silent-crab-339-n7' into…
Oct 3, 2026
8419a00
Merge remote-tracking branch 'origin/main' into session/silent-crab-3…
Oct 3, 2026
c4cd777
N7-1: cite the renamed match-binder control (declarations finding); k…
Oct 3, 2026
a5bf10b
Merge remote-tracking branch 'origin/main' into session/silent-crab-3…
Oct 3, 2026
eb4bdf6
Merge remote-tracking branch 'origin/session/silent-crab-339-n7' into…
Oct 3, 2026
449bd0e
Merge origin/main into session/snappy-eagle-803
Oct 3, 2026
2aa847c
floor_pure_producer_share: drop the collection_callback_realization w…
Oct 3, 2026
40ded9c
floor_pure_producer_share: restore the warm rows (amended freeze: lan…
Oct 3, 2026
98b34fb
Merge remote-tracking branch 'origin/main' into HEAD
Oct 3, 2026
66c125e
floor_pure_producer_share: main's file plus only this PR's warm rows
Oct 3, 2026
f3f4fef
Remove the n7probe scratch module (debugging probe, no consumer)
Oct 3, 2026
e59f8a3
fold_lowering: a fold-realized Loop's iteration direction is a declar…
Oct 3, 2026
231e01c
Merge remote-tracking branch 'origin/main' into HEAD
Oct 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
module gunbc.recurring_failure_mode.collection_callback_operation_unrealized_in_v2_lowering

import std.types { NonEmptyStr }
import std.decl_ref { DeclarationRef, WholeDeclaration }
import gunbc.recurring_failure_mode { RecurringFailureMode }

data collection_callback_operation_unrealized_in_v2_lowering: RecurringFailureMode = RecurringFailureMode {
identity: "collection_callback_operation_unrealized_in_v2_lowering" as NonEmptyStr,
receipts: [
"INVALID STATE: std.algebra models collection callback operations as template rows with callback_element_position Present (map, filter, flat_map, any, all, sort_by), but v2 body lowering realized only the fold family. A call of an unrealized row reaches v2.compiler.resolve as a bare name and refuses resolve_reason_unbound_symbol. HARM: v2.std.node calls `map(node.children, e => Edge { .. })`, so on the native route it refused its own resolve and dropped out of the closure index; about twenty other v2 modules call bare `map(`. The refusal is typed and located, so this is a capability gap on the loud side of the ladder, never a silent wrong answer.",
"DISTINGUISHING FACTS: the earliest unjustified boundary was the MODEL, not lowering. A realized roster call binds its head to the row's declaration (v2.compiler.resolve resolve_realized_declaration), and map / flat_map / any / all / sort_by were inline list elements in std.algebra free_monoid_collection_templates and finite_power_set_templates, copied once per list, with no declaration to bind to. They are now named shapes (collection_map_shape and siblings) referenced from both lists, as fold and filter already were.",
"CLIMB (N7-1b): map and all are realized through the one fold encoding, keyed on their rows in v2.compiler.fold_lowering collection_roster_rows. Each step is synthesized around the callback's own binder (CallbackRealization), and is O(1) per member: map conses one cell onto the carrier, and all joins one Bool. Controls: v2.test.claim.compiler.collection_callback_realization. all's body types through &&, which infer does not yet join (a separate frontier), so its control asserts the head binding and lowering, not infer acceptance.",
"COUNTED FRONTIER, 4 rows, by name. filter and any: v2.std.algebra DECLARES ordinary fns `filter` and `any`, and 41 modules each import and call them positionally or piped (measured at N7-1b's base, 2dae714bf4). Lowering classifies a head by its spelling without a binding, so a realized row would lower those calls to a Loop that v2.compiler.resolve resolve_realized_declaration refuses as realized_declaration_shadowed. That is a section 3 fork, the roster row and the corpus fn being one operation under two authorities. TRIGGER: the fork is consolidated (v2.std.algebra any/filter retired onto the roster operation, or a binding-aware realization under which a head bound to a corpus declaration stays an ordinary call), SUFFICIENT FOR an unbound `filter(xs, e => ..)` / `any(xs, e => ..)` to lower and bind its row while every imported call keeps binding. Its guard is ccr_declared_any_stays_an_ordinary_call. flat_map: its step is itself a fold over the callback's result (v2.std.algebra list_flat_map's nested fold_list_right), which the synthesized-step table cannot express as one cell. TRIGGER: a nested-fold step, i.e. a CallbackRealization arm whose step body is a fold encoding over the callback body with the outer accumulator as its init, SUFFICIENT FOR `flat_map(xs, e => f(e))` to lower and its head to bind collection_flat_map_shape. sort_by: cost_shape ShapeSortBody, which is not an iterate body, so it has no fold realization at all. TRIGGER: a sort realization the template's ShapeSortBody names, SUFFICIENT FOR `sort_by(xs, e => k(e))` to lower and its head to bind collection_sort_by_shape. RUNG: mitigatable (typed refusal at resolve). CEILING: structurally guaranteed: every fact is decidable from the row.",
],
evidence: [
DeclarationRef { module_path: "std.algebra", decl_name: "collection_map_shape", field: WholeDeclaration },
DeclarationRef { module_path: "std.algebra", decl_name: "collection_flat_map_shape", field: WholeDeclaration },
DeclarationRef { module_path: "std.algebra", decl_name: "collection_sort_by_shape", field: WholeDeclaration },
DeclarationRef { module_path: "v2.compiler.fold_lowering", decl_name: "collection_roster_rows", field: WholeDeclaration },
DeclarationRef { module_path: "v2.compiler.fold_lowering", decl_name: "CallbackRealization", field: WholeDeclaration },
DeclarationRef { module_path: "v2.compiler.body_lowering_fold", decl_name: "body_lower_callback_encoding", field: WholeDeclaration },
DeclarationRef { module_path: "v2.test.claim.compiler.collection_callback_realization", decl_name: "ccr_map_over_records_reads_a_field", field: WholeDeclaration },
],
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
module gunbc.recurring_failure_mode.fold_realized_loop_carries_no_iteration_direction

import std.types { NonEmptyStr }
import std.decl_ref { DeclarationRef, WholeDeclaration }
import gunbc.recurring_failure_mode { RecurringFailureMode }

data fold_realized_loop_carries_no_iteration_direction: RecurringFailureMode = RecurringFailureMode {
identity: "fold_realized_loop_carries_no_iteration_direction" as NonEmptyStr,
receipts: [
"INVALID STATE: a fold-realized Loop's encoding does not show its iteration direction. v2.compiler.fold_lowering fold_recurrence_encoding builds the identical Loop for the collection fold, fold_list (left), fold_list_right (right) and, since N7-1b, map, whose synthesized step conses onto the carrier and is order-preserving ONLY under right-to-left iteration (all joins with &&, which is order-insensitive). An executor that ran a map encoding left to right would return its results reversed: silent wrongness. CLIMBED IN gunbc#13069 (review 74982 asked that the PR introducing map not ship the reversible encoding with only this row): the direction is now a DECLARED FACT OF THE REALIZATION, v2.compiler.fold_lowering FoldIterationDirection, owned by the step synthesis that needs it (callback_realization_iteration_direction: map right to left) and by the authored forms (an authored fold and fold_list left, fold_list_right right), and derived for any Loop from the realized declaration it already carries (^loop_realized_declaration_edge) by fold_realized_iteration_direction. fold_list and fold_list_right are therefore no longer indistinguishable, and a path that names no collection fold derives no direction rather than a default.",
"WHAT REMAINS: no executor of a fold-realized Loop exists to consume the fact. Both installed Loop handlers REFUSE: v2.extdeps.runtimes.v2_evaluator v2_eval_step_loop and v2.program program_step_loop each return a rejected outcome, so v2.compiler.eval's eval_loop_node reaches a typed refusal, never a value, and the native route executes the seed's emission of the .dag source, not this encoding. So the residual is fail-closed, not latent silent wrongness. The obligation it leaves is on the executor that replaces those refusals: it must read fold_realized_iteration_direction, not assume an order.",
"DISTINGUISHING FACTS: this is not a cost defect. Each synthesized step is O(1) per member (one Cons onto the carrier, never snoc or append), held structurally by v2.test.claim.compiler.collection_callback_realization ccr_map_step_conses_onto_its_accumulator; a snoc step would make map left to right at quadratic cost, which is why the order is declared rather than designed away.",
"RUNG: the fact is structurally carried and its derivation is enforced by discriminating controls (ccr_map_loop_iterates_right_to_left on the real map route; ccr_fold_list_and_fold_list_right_are_told_apart; both red when map or fold_list_right is declared left to right, measured). CEILING: structurally impossible once execution exists. NEXT-RUNG TRIGGER, stated as the capability: an executor of fold-realized Loops replacing the refusing step_loop handlers that consumes fold_realized_iteration_direction, SUFFICIENT FOR map, fold_list and fold_list_right encodings to evaluate in their declared order, with an executing control that reverses the declared direction and goes red.",
],
evidence: [
DeclarationRef { module_path: "v2.compiler.fold_lowering", decl_name: "fold_recurrence_encoding", field: WholeDeclaration },
DeclarationRef { module_path: "v2.compiler.fold_lowering", decl_name: "CallbackRealization", field: WholeDeclaration },
DeclarationRef { module_path: "v2.compiler.fold_lowering", decl_name: "FoldIterationDirection", field: WholeDeclaration },
DeclarationRef { module_path: "v2.compiler.fold_lowering", decl_name: "fold_realized_iteration_direction", field: WholeDeclaration },
DeclarationRef { module_path: "v2.extdeps.runtimes.v2_evaluator", decl_name: "v2_eval_step_loop", field: WholeDeclaration },
DeclarationRef { module_path: "v2.program", decl_name: "program_step_loop", field: WholeDeclaration },
DeclarationRef { module_path: "v2.test.claim.compiler.collection_callback_realization", decl_name: "ccr_map_loop_iterates_right_to_left", field: WholeDeclaration },
DeclarationRef { module_path: "v2.test.claim.compiler.collection_callback_realization", decl_name: "ccr_fold_list_and_fold_list_right_are_told_apart", field: WholeDeclaration },
DeclarationRef { module_path: "v2.test.claim.compiler.collection_callback_realization", decl_name: "ccr_map_step_conses_onto_its_accumulator", field: WholeDeclaration },
],
}
43 changes: 34 additions & 9 deletions dag/std/algebra.dag
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,31 @@ fn collection_fold_shape() -> AlgebraFieldTemplate {
{ name: "fold", param_types: [ReceiverSelf, AlgebraTypeVariable { id: "FoldAccumulator" }, CallableOf { params: [AlgebraTypeVariable { id: "FoldAccumulator" }, ReceiverElement], return_type: AlgebraTypeVariable { id: "FoldAccumulator" } }], return_type: AlgebraTypeVariable { id: "FoldAccumulator" }, size_effect: none, cost_shape: Present { value: ShapeIterateBody }, callback_element_position: Present { value: 1 } }
}

// The collection callback operations, each ONE template declared once and referenced from every profile
// list that carries it, as filter and fold are. A named row is what a realized call head binds to
// (v2.compiler.fold_lowering fold_family_realization), and one row per operation removes the copy each
// list used to hold.

fn collection_map_shape() -> AlgebraFieldTemplate {
{ name: "map", param_types: [ReceiverSelf, CallableOf { params: [ReceiverElement], return_type: AlgebraTypeVariable { id: "MappedElement" } }], return_type: ContainerOf { source: SameAsReceiver, element: AlgebraTypeVariable { id: "MappedElement" } }, size_effect: none, cost_shape: Present { value: ShapeIterateBody }, callback_element_position: Present { value: 0 } }
}

fn collection_flat_map_shape() -> AlgebraFieldTemplate {
{ name: "flat_map", param_types: [ReceiverSelf, CallableOf { params: [ReceiverElement], return_type: ContainerOf { source: SameAsReceiver, element: AlgebraTypeVariable { id: "MappedElement" } } }], return_type: ContainerOf { source: SameAsReceiver, element: AlgebraTypeVariable { id: "MappedElement" } }, size_effect: none, cost_shape: Present { value: ShapeIterateBody }, callback_element_position: Present { value: 0 } }
}

fn collection_any_shape() -> AlgebraFieldTemplate {
{ name: "any", param_types: [ReceiverSelf, CallableOf { params: [ReceiverElement], return_type: NamedTemplate { name: "Bool" } }], return_type: NamedTemplate { name: "Bool" }, size_effect: none, cost_shape: Present { value: ShapeIterateBody }, callback_element_position: Present { value: 0 } }
}

fn collection_all_shape() -> AlgebraFieldTemplate {
{ name: "all", param_types: [ReceiverSelf, CallableOf { params: [ReceiverElement], return_type: NamedTemplate { name: "Bool" } }], return_type: NamedTemplate { name: "Bool" }, size_effect: none, cost_shape: Present { value: ShapeIterateBody }, callback_element_position: Present { value: 0 } }
}

fn collection_sort_by_shape() -> AlgebraFieldTemplate {
{ name: "sort_by", param_types: [ReceiverSelf, CallableOf { params: [ReceiverElement], return_type: AlgebraTypeVariable { id: "SortKey" } }], return_type: ReceiverSelf, size_effect: Present { value: IdentityEffect }, cost_shape: Present { value: ShapeSortBody }, callback_element_position: Present { value: 0 } }
}

type StepPositionScan {
next: Int
found: Int?
Expand Down Expand Up @@ -958,11 +983,11 @@ fn finite_power_set_templates() -> List<AlgebraFieldTemplate> {
{ name: "member", param_types: [ReceiverSelf, ReceiverElement], return_type: NamedTemplate { name: "Bool" }, size_effect: none, cost_shape: none, callback_element_position: none },
{ name: "contains", param_types: [ReceiverSelf, ReceiverElement], return_type: NamedTemplate { name: "Bool" }, size_effect: none, cost_shape: none, callback_element_position: none },
collection_filter_shape(),
{ name: "map", param_types: [ReceiverSelf, CallableOf { params: [ReceiverElement], return_type: AlgebraTypeVariable { id: "MappedElement" } }], return_type: ContainerOf { source: SameAsReceiver, element: AlgebraTypeVariable { id: "MappedElement" } }, size_effect: none, cost_shape: Present { value: ShapeIterateBody }, callback_element_position: Present { value: 0 } },
{ name: "flat_map", param_types: [ReceiverSelf, CallableOf { params: [ReceiverElement], return_type: ContainerOf { source: SameAsReceiver, element: AlgebraTypeVariable { id: "MappedElement" } } }], return_type: ContainerOf { source: SameAsReceiver, element: AlgebraTypeVariable { id: "MappedElement" } }, size_effect: none, cost_shape: Present { value: ShapeIterateBody }, callback_element_position: Present { value: 0 } },
collection_map_shape(),
collection_flat_map_shape(),
collection_fold_shape(),
{ name: "any", param_types: [ReceiverSelf, CallableOf { params: [ReceiverElement], return_type: NamedTemplate { name: "Bool" } }], return_type: NamedTemplate { name: "Bool" }, size_effect: none, cost_shape: Present { value: ShapeIterateBody }, callback_element_position: Present { value: 0 } },
{ name: "all", param_types: [ReceiverSelf, CallableOf { params: [ReceiverElement], return_type: NamedTemplate { name: "Bool" } }], return_type: NamedTemplate { name: "Bool" }, size_effect: none, cost_shape: Present { value: ShapeIterateBody }, callback_element_position: Present { value: 0 } },
collection_any_shape(),
collection_all_shape(),
{ name: "count", param_types: [ReceiverSelf], return_type: NamedTemplate { name: "std.nat.Nat" }, size_effect: none, cost_shape: Present { value: ShapeLinearScan }, callback_element_position: none },
{ name: "length", param_types: [ReceiverSelf], return_type: NamedTemplate { name: "std.nat.Nat" }, size_effect: none, cost_shape: Present { value: ShapeLinearScan }, callback_element_position: none }
]
Expand Down Expand Up @@ -1002,19 +1027,19 @@ fn free_monoid_scalar_templates() -> List<AlgebraFieldTemplate> {

fn free_monoid_collection_templates() -> List<AlgebraFieldTemplate> {
[
{ name: "map", param_types: [ReceiverSelf, CallableOf { params: [ReceiverElement], return_type: AlgebraTypeVariable { id: "MappedElement" } }], return_type: ContainerOf { source: SameAsReceiver, element: AlgebraTypeVariable { id: "MappedElement" } }, size_effect: none, cost_shape: Present { value: ShapeIterateBody }, callback_element_position: Present { value: 0 } },
collection_map_shape(),
collection_filter_shape(),
{ name: "flat_map", param_types: [ReceiverSelf, CallableOf { params: [ReceiverElement], return_type: ContainerOf { source: SameAsReceiver, element: AlgebraTypeVariable { id: "MappedElement" } } }], return_type: ContainerOf { source: SameAsReceiver, element: AlgebraTypeVariable { id: "MappedElement" } }, size_effect: none, cost_shape: Present { value: ShapeIterateBody }, callback_element_position: Present { value: 0 } },
collection_flat_map_shape(),
collection_fold_shape(),
{ name: "any", param_types: [ReceiverSelf, CallableOf { params: [ReceiverElement], return_type: NamedTemplate { name: "Bool" } }], return_type: NamedTemplate { name: "Bool" }, size_effect: none, cost_shape: Present { value: ShapeIterateBody }, callback_element_position: Present { value: 0 } },
{ name: "all", param_types: [ReceiverSelf, CallableOf { params: [ReceiverElement], return_type: NamedTemplate { name: "Bool" } }], return_type: NamedTemplate { name: "Bool" }, size_effect: none, cost_shape: Present { value: ShapeIterateBody }, callback_element_position: Present { value: 0 } },
collection_any_shape(),
collection_all_shape(),
{ name: "count", param_types: [ReceiverSelf], return_type: NamedTemplate { name: "std.nat.Nat" }, size_effect: none, cost_shape: Present { value: ShapeLinearScan }, callback_element_position: none },
{ name: "first", param_types: [ReceiverSelf], return_type: OptionalOf { inner: ReceiverElement }, size_effect: Present { value: ProjectionEffect }, cost_shape: Present { value: ShapeLinearScan }, callback_element_position: none },
{ name: "last", param_types: [ReceiverSelf], return_type: OptionalOf { inner: ReceiverElement }, size_effect: Present { value: ProjectionEffect }, cost_shape: Present { value: ShapeLinearScan }, callback_element_position: none },
{ name: "get", param_types: [ReceiverSelf, NamedTemplate { name: "Int" }], return_type: OptionalOf { inner: ReceiverElement }, size_effect: Present { value: ProjectionEffect }, cost_shape: Present { value: ShapeLinearScan }, callback_element_position: none },
{ name: "skip", param_types: [ReceiverSelf, NamedTemplate { name: "Int" }], return_type: ReceiverSelf, size_effect: Present { value: ShrinkEffect }, cost_shape: Present { value: ShapeIterateBody }, callback_element_position: none },
{ name: "take", param_types: [ReceiverSelf, NamedTemplate { name: "Int" }], return_type: ReceiverSelf, size_effect: none, cost_shape: Present { value: ShapeIterateBody }, callback_element_position: none },
{ name: "sort_by", param_types: [ReceiverSelf, CallableOf { params: [ReceiverElement], return_type: AlgebraTypeVariable { id: "SortKey" } }], return_type: ReceiverSelf, size_effect: Present { value: IdentityEffect }, cost_shape: Present { value: ShapeSortBody }, callback_element_position: Present { value: 0 } },
collection_sort_by_shape(),
{ name: "append", param_types: [ReceiverSelf, ReceiverElement], return_type: ReceiverSelf, size_effect: none, cost_shape: Present { value: ShapeConstant }, callback_element_position: none },
{ name: "contains", param_types: [ReceiverSelf, ReceiverElement], return_type: NamedTemplate { name: "Bool" }, size_effect: none, cost_shape: none, callback_element_position: none },
{ name: "enumerate", param_types: [ReceiverSelf], return_type: ContainerOf { source: SameAsReceiver, element: TupleOf { first: NamedTemplate { name: "Int" }, second: ReceiverElement } }, size_effect: Present { value: IdentityEffect }, cost_shape: Present { value: ShapeIterateBody }, callback_element_position: none },
Expand Down
Loading