diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 1a510d93a76..6650c9cc8a9 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,142 +1,12 @@ - -## Evaluator freeze — `src/v3/compiler/src/test_runner.rs` (R3 Bundle 4b) - - ## Summary (What changed and why.) -## Per-PR dissolution gate (required for new/expanded hand-Rust under `v3/`) - - - -- **Exactly one disposition** (delete path **or** census shrink with N→M **or** lane + cited `_internal/ROADMAP_OPS.md` row/link): ___ - -## SG-0 net-shrink discipline (required when `sg0_census_test.rs` changes) - - - -**CI reads raw PR description text.** The lines the gate matches must start at column 0 with `SG-0 hand-path delta:` and (when required) `SG-0 pairing:` — a leading markdown list marker (`- …`) or bold wrapper on the same line will **not** satisfy the checker. Paste the two lines below the checklist into the description body as plain text (you can keep the bullets as a personal reminder). - -- **Paste into PR description — `SG-0 hand-path delta:`** ___ - -- **Paste into PR description — `SG-0 pairing:`** ___ (`n/a` unless delta is strict `+N`, `N>0`) - -## Per-PR debt-paydown receipt (required for all PRs) - - - -- **Exactly one disposition** (Debt paid **or** Debt found + routed **or** No debt touched): ___ - ## Test plan - [ ] (Bulleted checklist of TODOs for verifying the PR.) diff --git a/CLAUDE.md b/CLAUDE.md index bda07279e3f..aae6e99b5d1 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -13,7 +13,6 @@ Read these docs before working: ```bash cargo test --workspace # all workspace crates (hand-written + integration) -cargo test -p v3-compiler # v3 compiler — NOTE: most tests here are dormant in CI; the one exception is get_off_v3_compile_to_dag_caller_count_is_at_or_below_ceiling (wired into ci_floor_parity via PR #4659). New tests added to this crate are NOT automatically CI-gated cargo clippy --all-targets -- -D warnings # lint cargo fmt --all --check # format check (also runs via pre-push hook) ``` diff --git a/Cargo.lock b/Cargo.lock index a2d649dc403..b56ee2e31d7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,12 +17,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "anes" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" - [[package]] name = "anstream" version = "1.0.0" @@ -88,12 +82,6 @@ dependencies = [ "object", ] -[[package]] -name = "autocfg" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" - [[package]] name = "base64" version = "0.22.1" @@ -115,27 +103,6 @@ dependencies = [ "typenum", ] -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] - -[[package]] -name = "bumpalo" -version = "3.20.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" - -[[package]] -name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" - [[package]] name = "cc" version = "1.2.62" @@ -176,33 +143,6 @@ dependencies = [ "v2-compiler", ] -[[package]] -name = "ciborium" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" - -[[package]] -name = "ciborium-ll" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" -dependencies = [ - "ciborium-io", - "half", -] - [[package]] name = "clap" version = "4.6.1" @@ -253,15 +193,6 @@ checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" name = "compile_host_runner" version = "0.1.0" -[[package]] -name = "cpufeatures" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" -dependencies = [ - "libc", -] - [[package]] name = "crc32fast" version = "1.5.0" @@ -271,93 +202,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "criterion" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2b12d017a929603d80db1831cd3a24082f8137ce19c69e6447f54f5fc8d692f" -dependencies = [ - "anes", - "cast", - "ciborium", - "clap", - "criterion-plot", - "is-terminal", - "itertools", - "num-traits", - "once_cell", - "oorandom", - "plotters", - "rayon", - "regex", - "serde", - "serde_derive", - "serde_json", - "tinytemplate", - "walkdir", -] - -[[package]] -name = "criterion-plot" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" -dependencies = [ - "cast", - "itertools", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" - -[[package]] -name = "crunchy" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" - -[[package]] -name = "crypto-common" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer", - "crypto-common", -] - [[package]] name = "displaydoc" version = "0.2.5" @@ -369,12 +213,6 @@ dependencies = [ "syn", ] -[[package]] -name = "either" -version = "1.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" - [[package]] name = "emit_host_runner" version = "0.1.0" @@ -395,13 +233,6 @@ dependencies = [ "windows-sys 0.61.2", ] -[[package]] -name = "execute-command-bootstrap" -version = "0.1.0" -dependencies = [ - "libc", -] - [[package]] name = "fastrand" version = "2.4.1" @@ -439,40 +270,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "futures-core" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" - -[[package]] -name = "futures-task" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" - -[[package]] -name = "futures-util" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" -dependencies = [ - "futures-core", - "futures-task", - "pin-project-lite", - "slab", -] - -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", -] - [[package]] name = "getrandom" version = "0.2.17" @@ -497,17 +294,6 @@ dependencies = [ "wasip3", ] -[[package]] -name = "half" -version = "2.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea2d84b969582b4b1864a92dc5d27cd2b77b622a8d79306834f1be5ba20d84b" -dependencies = [ - "cfg-if", - "crunchy", - "zerocopy", -] - [[package]] name = "hashbrown" version = "0.15.5" @@ -529,12 +315,6 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" -[[package]] -name = "hermit-abi" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" - [[package]] name = "icu_collections" version = "2.2.0" @@ -670,50 +450,18 @@ dependencies = [ "serde_core", ] -[[package]] -name = "is-terminal" -version = "0.4.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46" -dependencies = [ - "hermit-abi", - "libc", - "windows-sys 0.61.2", -] - [[package]] name = "is_terminal_polyfill" version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - [[package]] name = "itoa" version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" -[[package]] -name = "js-sys" -version = "0.3.98" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67df7112613f8bfd9150013a0314e196f4800d3201ae742489d999db2f979f08" -dependencies = [ - "cfg-if", - "futures-util", - "once_cell", - "wasm-bindgen", -] - [[package]] name = "layering_imports_scan" version = "0.1.0" @@ -774,34 +522,6 @@ dependencies = [ "simd-adler32", ] -[[package]] -name = "num-bigint" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" -dependencies = [ - "num-integer", - "num-traits", -] - -[[package]] -name = "num-integer" -version = "0.1.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - [[package]] name = "object" version = "0.37.3" @@ -823,52 +543,12 @@ version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" -[[package]] -name = "oorandom" -version = "11.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e" - [[package]] name = "percent-encoding" version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" -[[package]] -name = "pin-project-lite" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" - -[[package]] -name = "plotters" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aeb6f403d7a4911efb1e33402027fc44f29b5bf6def3effcc22d7bb75f2b747" -dependencies = [ - "num-traits", - "plotters-backend", - "plotters-svg", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "plotters-backend" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df42e13c12958a16b3f7f4386b9ab1f3e7933914ecea48da7139435263a4172a" - -[[package]] -name = "plotters-svg" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51bae2ac328883f7acdfea3d66a7c35751187f870bc81f94563733a154d7a670" -dependencies = [ - "plotters-backend", -] - [[package]] name = "potential_utf" version = "0.1.5" @@ -937,26 +617,6 @@ dependencies = [ "rand_core", ] -[[package]] -name = "rayon" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - [[package]] name = "regex" version = "1.12.3" @@ -1048,27 +708,6 @@ dependencies = [ "untrusted", ] -[[package]] -name = "rustversion" -version = "1.0.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" - -[[package]] -name = "ryu" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - [[package]] name = "semver" version = "1.0.28" @@ -1118,39 +757,6 @@ dependencies = [ "zmij", ] -[[package]] -name = "serde_spanned" -version = "0.6.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" -dependencies = [ - "serde", -] - -[[package]] -name = "serde_yaml" -version = "0.9.34+deprecated" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" -dependencies = [ - "indexmap", - "itoa", - "ryu", - "serde", - "unsafe-libyaml", -] - -[[package]] -name = "sha2" -version = "0.10.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - [[package]] name = "shlex" version = "1.3.0" @@ -1173,12 +779,6 @@ dependencies = [ "typenum", ] -[[package]] -name = "slab" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" - [[package]] name = "smallvec" version = "1.15.1" @@ -1261,57 +861,6 @@ dependencies = [ "zerovec", ] -[[package]] -name = "tinytemplate" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" -dependencies = [ - "serde", - "serde_json", -] - -[[package]] -name = "toml" -version = "0.8.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" -dependencies = [ - "serde", - "serde_spanned", - "toml_datetime", - "toml_edit", -] - -[[package]] -name = "toml_datetime" -version = "0.6.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" -dependencies = [ - "serde", -] - -[[package]] -name = "toml_edit" -version = "0.22.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" -dependencies = [ - "indexmap", - "serde", - "serde_spanned", - "toml_datetime", - "toml_write", - "winnow", -] - -[[package]] -name = "toml_write" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" - [[package]] name = "typenum" version = "1.20.1" @@ -1330,12 +879,6 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" -[[package]] -name = "unsafe-libyaml" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" - [[package]] name = "untrusted" version = "0.9.0" @@ -1424,81 +967,12 @@ dependencies = [ "v2-stage0-core", ] -[[package]] -name = "v3-compiler" -version = "0.1.0" -dependencies = [ - "ci_affected_components", - "criterion", - "emit_host_runner", - "libc", - "num-bigint", - "serde", - "serde_json", - "serde_yaml", - "sha2", - "toml", -] - -[[package]] -name = "v3-grounding-coercion-fold" -version = "0.1.0" -dependencies = [ - "v3-compiler", - "v3-grounding-lifetime", -] - -[[package]] -name = "v3-grounding-cross-target-meta" -version = "0.1.0" -dependencies = [ - "v3-compiler", -] - -[[package]] -name = "v3-grounding-engine" -version = "0.1.0" -dependencies = [ - "v3-compiler", - "v3-grounding-inhabitance-mirror", -] - -[[package]] -name = "v3-grounding-inhabitance-mirror" -version = "0.1.0" - -[[package]] -name = "v3-grounding-lifetime" -version = "0.1.0" -dependencies = [ - "v3-compiler", -] - -[[package]] -name = "v3-grounding-tests" -version = "0.1.0" -dependencies = [ - "v3-compiler", - "v3-grounding-coercion-fold", - "v3-grounding-lifetime", -] - [[package]] name = "version_check" version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - [[package]] name = "wasi" version = "0.11.1+wasi-snapshot-preview1" @@ -1523,51 +997,6 @@ dependencies = [ "wit-bindgen 0.51.0", ] -[[package]] -name = "wasm-bindgen" -version = "0.2.121" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49ace1d07c165b0864824eee619580c4689389afa9dc9ed3a4c75040d82e6790" -dependencies = [ - "cfg-if", - "once_cell", - "rustversion", - "wasm-bindgen-macro", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.121" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e68e6f4afd367a562002c05637acb8578ff2dea1943df76afb9e83d177c8578" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.121" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d95a9ec35c64b2a7cb35d3fead40c4238d0940c86d107136999567a4703259f2" -dependencies = [ - "bumpalo", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.121" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4e0100b01e9f0d03189a92b96772a1fb998639d981193d7dbab487302513441" -dependencies = [ - "unicode-ident", -] - [[package]] name = "wasm-encoder" version = "0.244.0" @@ -1602,16 +1031,6 @@ dependencies = [ "semver", ] -[[package]] -name = "web-sys" -version = "0.3.98" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b572dff8bcf38bad0fa19729c89bb5748b2b9b1d8be70cf90df697e3a8f32aa" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - [[package]] name = "webpki-roots" version = "0.26.11" @@ -1630,15 +1049,6 @@ dependencies = [ "rustls-pki-types", ] -[[package]] -name = "winapi-util" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" -dependencies = [ - "windows-sys 0.61.2", -] - [[package]] name = "windows-link" version = "0.2.1" @@ -1727,15 +1137,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" -[[package]] -name = "winnow" -version = "0.7.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df79d97927682d2fd8adb29682d1140b343be4ac0f08fd68b7765d9c059d3945" -dependencies = [ - "memchr", -] - [[package]] name = "wit-bindgen" version = "0.51.0" @@ -1859,26 +1260,6 @@ dependencies = [ "synstructure", ] -[[package]] -name = "zerocopy" -version = "0.8.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eed437bf9d6692032087e337407a86f04cd8d6a16a37199ed57949d415bd68e9" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.8.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70e3cd084b1788766f53af483dd21f93881ff30d7320490ec3ef7526d203bad4" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "zerofrom" version = "0.1.8" diff --git a/Cargo.toml b/Cargo.toml index 6119fc4d332..d0d3d5e3c35 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,20 +8,12 @@ members = [ "src/v2/stage0_emit_core", # END generated stage0 crate members "src/v2/tests", - "src/v3/compiler", "tools/ci_affected_components", "tools/ci_timings_collector", "tools/ci_claim_gate", "tools/layering_imports_scan", "tools/compile_host_runner", "tools/emit_host_runner", - "src/v3/grounding_inhabitance_mirror", - "src/v3/grounding_engine", - "src/v3/grounding_lifetime", - "src/v3/grounding_coercion_fold", - "src/v3/grounding_cross_target_meta", - "src/v3/grounding_tests", - "src/v3/execute_command_bootstrap", ] [workspace.metadata] diff --git a/ROADMAP.md b/ROADMAP.md index f50f2e7ccbf..61d467d5e92 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -2,7 +2,7 @@ Where the project stands and where it is headed. For the intellectual goal, read [THESIS.md](THESIS.md). For rules that protect that goal, read [INVARIANTS.md](INVARIANTS.md). For how to extend the language safely, read [MODELING.md](MODELING.md). -> **v4 is the active development phase.** New substrate modeling and compiler pipeline work live in [`src/v4/`](src/v4/). v3 is frozen. v2 remains the production self-hosted compiler today. +> **v4 is the active development phase.** New substrate modeling and compiler pipeline work live in [`src/v4/`](src/v4/). v3 has been **removed** — its one load-bearing role (the method-template projection producer) was migrated into v2 (`src/v2/stage0/src/method_template_projection_source.rs`); v2 self-compile is verified green without it. v2 remains the production self-hosted compiler and v4's seed. ## Active wave — the stage-fold program @@ -33,7 +33,7 @@ Keystone §1.1 landed (#4699): **4,912 → 3,973 lines** on main, `_go` accumula > **Priority fork (operator's call, after §2 lands):** §3 + self-host (compiler/breadth lane) vs §4 (a demo-able running program). Both unblock once §2 lands; the pick sets the deepest staffing. -**§5 — self-hosting** (get-off-v3 caller-census ratchet → zero hand-maintained Rust). Depends on §3. +**§5 — self-hosting** (census ratchet → zero hand-maintained Rust; the v2 seed is the last residual). Depends on §3. ### Cross-cutting requirements (portfolio scale — threaded here) @@ -75,7 +75,7 @@ v4 combines substrate depth (typed Node + Behavior kernel, algebra-grounded std | Lane | Interim bridge | Dissolve-on | |------|----------------|-------------| -| T-22 eval host transport dispatch | `run_emit_host_go` eval calls use the existing `emit_host_runner` host boundary while projecting the modeled `v4.std.host_run.EmitHostRunReceipt` / `Outcome` carriers. | Generated `.dag` eval dispatches `v4.compiler.emit_host.run_emit_host_go` host transports directly; delete the evaluator shim with the surrounding `src/v3/compiler/src/emit_host_bridge.rs` host-transport bridge. | +| T-22 eval host transport dispatch | `run_emit_host_go` eval calls use the existing `emit_host_runner` host boundary while projecting the modeled `v4.std.host_run.EmitHostRunReceipt` / `Outcome` carriers. | Generated `.dag` eval dispatches `v4.compiler.emit_host.run_emit_host_go` host transports directly. (The v3-resident evaluator shim / `emit_host_bridge.rs` host-transport bridge was removed with the v3 tree.) | ### Public Operational Lanes @@ -112,7 +112,7 @@ Work is organized around closing the bootstrap loop, not a calendar: | Lane | Gate / row | Tracked obligation | |------|------------|--------------------| -| **T-PB-B** | `pb_rust_tests_outside_residual_zero` | Pure Bootstrap test floor: hand-maintained Rust tests under `src/v3/compiler/tests/` shrink toward zero as receipts migrate to `.dag` `TestClaim` declarations or generated harness coverage. Each temporary Rust test scaffold must be listed in the SG-0 hand-authored-test census with a dissolution trigger, and the same PR removes that census entry when the modeled or generated replacement lands. | +| **T-PB-B** | `pb_rust_tests_outside_residual_zero` | Pure Bootstrap test floor: hand-maintained Rust tests shrink toward zero as receipts migrate to `.dag` `TestClaim` declarations or generated harness coverage. (The v3 test tree — the original SG-0 census scope, including `sg0_census_test.rs` — was removed with v3; the remaining residual is the v2/tools hand-Rust test surface.) | Earlier release-program lanes (complexity parity, testgen, multi-target emit, pure-bootstrap floors) informed v4 scope; that era's detailed operational tracking is not carried in this repo. diff --git a/docs/thesis/doc-authority.md b/docs/thesis/doc-authority.md index 5b7b4ed5901..ee3a10ae55a 100644 --- a/docs/thesis/doc-authority.md +++ b/docs/thesis/doc-authority.md @@ -74,8 +74,8 @@ its sole load-bearing design root was promoted to `.dag`/`.rs` headers must not cite planning docs (they are ephemeral); any such citation is a stale comment cleaned on the next touch of that file `[live]`. -**Frozen:** `src/v2/*.md`, `src/v3/*.md` carry a historical banner and read as frozen, -not live (v3 is frozen and out of the v4 loop; v2 is the reference compiler / v4 seed). +**Frozen:** `src/v2/*.md` carry a historical banner and read as frozen, not live +(v2 is the reference compiler / v4 seed). The v3 tree has been removed. Marked in place — not moved, because moving manufactures the dangling-reference rot this contract exists to prevent. diff --git a/src/v2/stage0/src/bin/regen_stage0.rs b/src/v2/stage0/src/bin/regen_stage0.rs index c91fb366b67..b3859f40c68 100644 --- a/src/v2/stage0/src/bin/regen_stage0.rs +++ b/src/v2/stage0/src/bin/regen_stage0.rs @@ -146,54 +146,7 @@ const DELEGATED_DAG_COLLECT_SUPPORT_SYMBOLS: &[&str] = &[ "json_quote", ]; -const GENERATED_METHOD_TEMPLATE_PROJECTION_DAG: &str = r#"module generated.method_template_projection - -data rust_method_template_emit: Map = { - "chars": "\{recv\}.chars().map(|c| c as i64).collect::>()", - "count": "(\{recv\}.len() as i64)", - "enumerate": "\{recv\}.iter().cloned().enumerate().map(|(i, v)| (i as i64, v)).collect::>()", - "first": "\{recv\}.first().cloned()", - "join": "\{recv\}.join(&\{arg\})", - "last": "\{recv\}.last().cloned()", - "skip": "\{recv\}.iter().cloned().skip(\{arg\} as usize).collect::>()", - "split": "\{recv\}.split(&\{arg\}).map(|s| s.to_string()).collect::>()", - "take": "\{recv\}.iter().cloned().take(\{arg\} as usize).collect::>()", -} - -data python_method_template_emit: Map = { - "all": "all(\{arg\}(x) for x in \{recv\})", - "any": "any(\{arg\}(x) for x in \{recv\})", - "append": "\{recv\} + [\{arg\}]", - "chars": "[ord(c) for c in \{recv\}]", - "count": "len(\{recv\})", - "enumerate": "list(enumerate(\{recv\}))", - "filter": "[x for x in \{recv\} if \{arg\}(x)]", - "first": "\{recv\}[0] if \{recv\} else None", - "flat_map": "[y for x in \{recv\} for y in \{arg\}(x)]", - "join": "\{arg\}.join(\{recv\})", - "last": "\{recv\}[-1] if \{recv\} else None", - "skip": "\{recv\}[\{arg\}:]", - "sort_by": "sorted(\{recv\}, key=\{arg\})", - "split": "\{recv\}.split(\{arg\})", - "string_contains": "\{arg\} in \{recv\}", - "take": "\{recv\}[:\{arg\}]", -} - -data go_method_template_emit: Map = { - "all": "v2rt.All(\{recv\}, \{arg\})", - "any": "v2rt.Any(\{recv\}, \{arg\})", - "append": "append(\{recv\}, \{arg\})", - "count": "len(\{recv\})", - "filter": "v2rt.Filter(\{recv\}, \{arg\})", - "flat_map": "v2rt.FlatMap(\{recv\}, \{arg\})", - "join": "strings.Join(\{recv\}, \{arg\})", - "skip": "\{recv\}[\{arg\}:]", - "sort_by": "v2rt.SortBy(\{recv\}, \{arg\})", - "split": "strings.Split(\{recv\}, \{arg\})", - "string_contains": "strings.Contains(\{recv\}, \{arg\})", - "take": "\{recv\}[:\{arg\}]", -} -"#; +use v2_compiler::method_template_projection_source::GENERATED_METHOD_TEMPLATE_PROJECTION_DAG; fn main() -> ExitCode { match run() { diff --git a/src/v2/stage0/src/lib.rs b/src/v2/stage0/src/lib.rs index 1978870d030..fb963a7b410 100644 --- a/src/v2/stage0/src/lib.rs +++ b/src/v2/stage0/src/lib.rs @@ -28,6 +28,7 @@ pub mod extdeps_languages_rust_emit; pub mod extdeps_languages_rust_syntax; pub mod extdeps_languages_rust_types; pub mod generated_method_template_projection; +pub mod method_template_projection_source; pub mod resolved_graph_cache; pub mod rest_transport_facts; pub mod std_algebra; diff --git a/src/v2/stage0/src/method_template_projection_source.rs b/src/v2/stage0/src/method_template_projection_source.rs new file mode 100644 index 00000000000..d0eaa8e0758 --- /dev/null +++ b/src/v2/stage0/src/method_template_projection_source.rs @@ -0,0 +1,70 @@ +//! Single authority for the `generated.method_template_projection` `.dag` source. +//! +//! v2 self-compile imports `generated.method_template_projection` (see +//! `src/v2/05_emit*.dag`); this const is the v2-resident source for it, produced +//! ephemerally into a source root (never committed — the bootstrap ratchet forbids a +//! committed `src/generated/method_template_projection.dag`). Consumed by `regen_stage0` +//! and the self-compile test helper, so neither depends on an external producer. + +use std::path::{Path, PathBuf}; + +pub const GENERATED_METHOD_TEMPLATE_PROJECTION_DAG: &str = r#"module generated.method_template_projection + +data rust_method_template_emit: Map = { + "chars": "\{recv\}.chars().map(|c| c as i64).collect::>()", + "count": "(\{recv\}.len() as i64)", + "enumerate": "\{recv\}.iter().cloned().enumerate().map(|(i, v)| (i as i64, v)).collect::>()", + "first": "\{recv\}.first().cloned()", + "join": "\{recv\}.join(&\{arg\})", + "last": "\{recv\}.last().cloned()", + "skip": "\{recv\}.iter().cloned().skip(\{arg\} as usize).collect::>()", + "split": "\{recv\}.split(&\{arg\}).map(|s| s.to_string()).collect::>()", + "take": "\{recv\}.iter().cloned().take(\{arg\} as usize).collect::>()", +} + +data python_method_template_emit: Map = { + "all": "all(\{arg\}(x) for x in \{recv\})", + "any": "any(\{arg\}(x) for x in \{recv\})", + "append": "\{recv\} + [\{arg\}]", + "chars": "[ord(c) for c in \{recv\}]", + "count": "len(\{recv\})", + "enumerate": "list(enumerate(\{recv\}))", + "filter": "[x for x in \{recv\} if \{arg\}(x)]", + "first": "\{recv\}[0] if \{recv\} else None", + "flat_map": "[y for x in \{recv\} for y in \{arg\}(x)]", + "join": "\{arg\}.join(\{recv\})", + "last": "\{recv\}[-1] if \{recv\} else None", + "skip": "\{recv\}[\{arg\}:]", + "sort_by": "sorted(\{recv\}, key=\{arg\})", + "split": "\{recv\}.split(\{arg\})", + "string_contains": "\{arg\} in \{recv\}", + "take": "\{recv\}[:\{arg\}]", +} + +data go_method_template_emit: Map = { + "all": "v2rt.All(\{recv\}, \{arg\})", + "any": "v2rt.Any(\{recv\}, \{arg\})", + "append": "append(\{recv\}, \{arg\})", + "count": "len(\{recv\})", + "filter": "v2rt.Filter(\{recv\}, \{arg\})", + "flat_map": "v2rt.FlatMap(\{recv\}, \{arg\})", + "join": "strings.Join(\{recv\}, \{arg\})", + "skip": "\{recv\}[\{arg\}:]", + "sort_by": "v2rt.SortBy(\{recv\}, \{arg\})", + "split": "strings.Split(\{recv\}, \{arg\})", + "string_contains": "strings.Contains(\{recv\}, \{arg\})", + "take": "\{recv\}[:\{arg\}]", +} +"#; + +/// Write the projection source into `/generated/method_template_projection.dag`, +/// creating the `generated/` dir. Returns the generated-source-root path (pass as `--source-root`). +pub fn write_method_template_projection_dag(generated_root: &Path) -> std::io::Result { + let generated_dir = generated_root.join("generated"); + std::fs::create_dir_all(&generated_dir)?; + std::fs::write( + generated_dir.join("method_template_projection.dag"), + GENERATED_METHOD_TEMPLATE_PROJECTION_DAG, + )?; + Ok(generated_root.to_path_buf()) +} diff --git a/src/v2/tests/src/bootstrap.rs b/src/v2/tests/src/bootstrap.rs index d9266d2c493..e38467a1d3a 100644 --- a/src/v2/tests/src/bootstrap.rs +++ b/src/v2/tests/src/bootstrap.rs @@ -55,22 +55,10 @@ fn run_self_compile( fn write_method_template_projection_generated_root(name: &str) -> std::path::PathBuf { let root = temp_dir(name); let _ = std::fs::remove_dir_all(&root); - let output = std::process::Command::new("cargo") - .arg("run") - .arg("-p") - .arg("v3-compiler") - .arg("--bin") - .arg("emit_method_template_projection") - .arg("--") - .arg(&root) - .output() - .expect("failed to run method-template projection producer"); - assert!( - output.status.success(), - "method-template projection producer failed:\nstdout:\n{}\nstderr:\n{}", - String::from_utf8_lossy(&output.stdout), - String::from_utf8_lossy(&output.stderr) - ); + // v2-resident projection source (single authority shared with regen_stage0); no + // external producer. Written ephemerally — never committed (bootstrap ratchet). + v2_compiler::method_template_projection_source::write_method_template_projection_dag(&root) + .expect("write method-template projection generated root"); root } diff --git a/src/v2/tests/src/lib.rs b/src/v2/tests/src/lib.rs index 5a7b09548f9..b7650adfdc0 100644 --- a/src/v2/tests/src/lib.rs +++ b/src/v2/tests/src/lib.rs @@ -58,7 +58,6 @@ mod nodefold_generic_instantiation_test; #[cfg(test)] mod parse; #[cfg(test)] -mod pb_method_template_projection_consumability; #[cfg(test)] mod pd3_adversarial; #[cfg(test)] diff --git a/src/v2/tests/src/pb_method_template_projection_consumability.rs b/src/v2/tests/src/pb_method_template_projection_consumability.rs deleted file mode 100644 index cf831582587..00000000000 --- a/src/v2/tests/src/pb_method_template_projection_consumability.rs +++ /dev/null @@ -1,139 +0,0 @@ -//! V2 consumability ratchet for the **R3 row 85 / PB #1560 Gap 4 build-step -//! producer** (`v3_compiler::pb_method_template_projection_dag_emit`). -//! -//! The v2-tests crate cannot depend on v3-compiler (the boundary forbids -//! it), so this test fabricates a `.dag` matching the producer's output -//! **structural shape** — module declaration, per-target `Map` declaration names, and one spot-check entry per target — and -//! proves v2's import / compile pipeline consumes it via the ephemeral -//! source-root mechanism from PR #1575. The fixture is **not byte- -//! identical** to `render_dag`'s output: the header comment wording is -//! intentionally distinct so reviewers do not mistake this fixture for -//! the producer's authoritative emission. Byte-equivalent end-to-end -//! coverage lives in PR #1575's `stage0_compile_imports_ephemeral_generated_source_root` -//! (`#[ignore]`d, slow path). -//! -//! Together with the v3-side producer integration tests -//! (`pb_method_template_projection_dag_emit_test`, which assert the -//! producer writes this exact shape) and PR #1575's existing -//! `resolver_imports_ephemeral_generated_source_root` ratchet (which -//! covers ephemeral source-root resolution for arbitrary `.dag`), this -//! closes the loop: v3 producer ↔ v2 consumer agree on the -//! `generated.method_template_projection` shape without committing the -//! generated file or importing `v3.std.*` into v2. -//! -//! What this exercises: -//! -//! 1. A `.dag` carrying `data rust_method_template_emit: Map` -//! at the canonical relative path (`generated/method_template_projection.dag`) -//! inside an ephemeral source-root resolves cleanly through v2's -//! `compile_dag_named_with_source_roots`. -//! 2. The generated module is loaded **only** from the ephemeral root — -//! not from any `src/` or `dsl/` path. Asserts the no-committed-source -//! invariant via the resolver's loaded-paths receipt. - -use crate::helpers::{assert_no_diagnostics, compile_dag_named_with_source_roots}; -use v2_compiler::v2_compiler_artifact::RenderTarget; - -fn temp_dir(label: &str) -> std::path::PathBuf { - let unique = format!( - "v2-pb-method-template-consumability-{label}-{ns}", - ns = std::time::SystemTime::now() - .duration_since(std::time::UNIX_EPOCH) - .expect("clock before unix epoch") - .as_nanos() - ); - std::env::temp_dir().join(unique) -} - -#[test] -fn v2_consumes_generated_method_template_projection_shape() { - let generated_root = temp_dir("generated-root"); - let generated_dir = generated_root.join("generated"); - std::fs::create_dir_all(&generated_dir).expect("create generated dir"); - - // Structural shape parity (not byte identity) with - // `write_method_template_projection_dag`'s output: module - // declaration, three `data _method_template_emit: - // Map` declarations, and one `count` spot-check - // entry per target. The header text intentionally differs so this - // fixture cannot be confused with producer-authoritative bytes; the - // v3-side producer tests own header-and-content invariants over the - // real emission, this v2-side ratchet owns "v2 imports this shape." - let generated_dag = "\ -// AUTO-GENERATED — do not commit. Produced by v3-compiler's -// `pb_method_template_projection_dag_emit`. Single row authority: -// `src/v3/std/{rust,python,go}_method_template_contracts.dag`. - -module generated.method_template_projection - -data rust_method_template_emit: Map = { - \"count\": \"(\\{recv\\}.len() as i64)\", -} - -data python_method_template_emit: Map = { - \"count\": \"len(\\{recv\\})\", -} - -data go_method_template_emit: Map = { - \"count\": \"len(\\{recv\\})\", -} -"; - std::fs::write( - generated_dir.join("method_template_projection.dag"), - generated_dag, - ) - .expect("write generated module"); - - // Entry imports one of the per-target maps. v2's import resolution - // walks the ephemeral source-root and finds the generated module. - let entry_source = "\ -module ephemeral.entry - -import generated.method_template_projection { rust_method_template_emit } - -fn rust_count_template() -> Map { rust_method_template_emit } -"; - let result = compile_dag_named_with_source_roots( - "ephemeral/entry.dag", - entry_source, - RenderTarget::Dag, - std::slice::from_ref(&generated_root), - ); - - assert_no_diagnostics(&result); - - let loaded_paths: Vec<_> = result - .newline_indices - .iter() - .map(|index| index.file.as_str()) - .collect(); - - // Build the absolute path the resolver should report for the - // generated module. v2's `display_source_path` strips the workspace - // root prefix; for files outside the workspace (i.e., a temp dir) - // it falls through to `to_string_lossy()` of the absolute path. - // Asserting equality against this exact path closes the suffix- - // aliasing gap an unanchored `contains()` check would leave open - // (an absolute committed path containing the same relative segment - // would otherwise slip through). - let expected_generated_path = generated_root - .join("generated/method_template_projection.dag") - .to_string_lossy() - .to_string(); - assert!( - loaded_paths.contains(&expected_generated_path.as_str()), - "expected the ephemeral generated module to load at exactly \ - {expected_generated_path}; got: {loaded_paths:?}" - ); - // The "do not commit" invariant: the generated file must be loaded - // from the temp source-root, not from anywhere under `src/` or `dsl/`. - assert!( - !loaded_paths - .iter() - .any(|path| path.starts_with("src/") || path.starts_with("dsl/")), - "ephemeral generated dependency must not be tracked under src/ or dsl/: {loaded_paths:?}" - ); - - let _ = std::fs::remove_dir_all(&generated_root); -} diff --git a/src/v2/tests/src/source_audit.rs b/src/v2/tests/src/source_audit.rs index 56e13234bbf..d615b580ce1 100644 --- a/src/v2/tests/src/source_audit.rs +++ b/src/v2/tests/src/source_audit.rs @@ -5,35 +5,7 @@ use std::path::{Path, PathBuf}; -use crate::helpers::{read_v2_file, workspace_root}; - -const LEGACY_METHOD_TEMPLATE_AUTHORITIES: &[&str] = &[ - "rust_simple_method_specs", - "rust_method_templates", - "rust_method_wraps_result", - "python_method_templates", - "go_method_templates", -]; - -const ALLOWED_LEGACY_READER_PREFIXES: &[(&str, &str)] = &[( - "src/v2/", - "v2-side stage0 emit surface is PB-Zero-walled and cannot read v3 substrate rows today", -)]; - -const ALLOWED_LEGACY_READER_PATHS: &[(&str, &str)] = &[ - ( - "dsl/extdeps/languages/rust/emit.dag", - "canonical Rust extdeps emit authority consumed by the v2 generator until PB-Zero unblocks migration", - ), - ( - "dsl/extdeps/languages/python/emit.dag", - "canonical Python extdeps emit authority consumed by the v2 generator until PB-Zero unblocks migration", - ), - ( - "dsl/extdeps/languages/go/emit.dag", - "canonical Go extdeps emit authority consumed by the v2 generator until PB-Zero unblocks migration", - ), -]; +use crate::helpers::read_v2_file; fn live_source(source: &str) -> String { source @@ -75,26 +47,6 @@ fn relative_display(path: &Path, root: &Path) -> String { .replace('\\', "/") } -fn allowed_legacy_reader_reason(rel: &str) -> Option<&'static str> { - ALLOWED_LEGACY_READER_PREFIXES - .iter() - .find_map(|(prefix, reason)| rel.starts_with(prefix).then_some(*reason)) - .or_else(|| { - ALLOWED_LEGACY_READER_PATHS - .iter() - .find_map(|(path, reason)| (*path == rel).then_some(*reason)) - }) -} - -fn legacy_method_template_violations(rel: &str, source: &str) -> Vec { - let live = live_source(source); - LEGACY_METHOD_TEMPLATE_AUTHORITIES - .iter() - .filter(|authority| live.contains(**authority)) - .map(|authority| format!("{rel}: live reference to `{authority}`")) - .collect() -} - #[test] fn pipe_arrow_token_exists() { let source = read_v2_file("src/v2/00_core.dag"); @@ -291,62 +243,6 @@ fn parse_supports_response_blocks() { ); } -#[test] -fn no_new_non_v2_consumers_of_legacy_method_template_authorities() { - // Textual deferral ratchet, not structural enforcement. The structural - // replacement is a typed row consumer for - // `src/v3/std/*_method_template_contracts.dag`, but v2 cannot use that - // path until PB-Zero unblocks bootstrap-Dag consumers. As each v2 - // consumer migrates, shrink the allow-list; delete this ratchet when it - // empties. - let root = workspace_root(); - let mut files = Vec::new(); - collect_source_files(&root.join("src"), &mut files); - collect_source_files(&root.join("dsl"), &mut files); - - let mut violations = Vec::new(); - for path in files { - let rel = relative_display(&path, &root); - if allowed_legacy_reader_reason(&rel).is_some() { - continue; - } - - let source = std::fs::read_to_string(&path) - .unwrap_or_else(|e| panic!("failed to read {}: {}", path.display(), e)); - violations.extend(legacy_method_template_violations(&rel, &source)); - } - - assert!( - violations.is_empty(), - "legacy method-template authorities are PB-Zero-blocked v2-only deferrals; \ - new consumers must read src/v3/std/*_method_template_contracts.dag rows:\n{}", - violations.join("\n") - ); -} - -#[test] -fn legacy_method_template_ratchet_detects_live_non_v2_reader() { - let source = r#" -module v3.std.synthetic_method_template_reader - -// rust_method_templates in comments should not trip the ratchet. -data synthetic_old_reader: String = rust_method_templates -"#; - - let violations = legacy_method_template_violations( - "src/v3/std/synthetic_method_template_reader.dag", - source, - ); - - assert_eq!( - violations, - vec![ - "src/v3/std/synthetic_method_template_reader.dag: live reference to `rust_method_templates`" - .to_string() - ] - ); -} - #[test] fn typecheck_has_cycle_detection() { let source = read_v2_file("src/v2/04_infer.dag"); @@ -1032,21 +928,6 @@ fn parse_item_keyword_arm_count() { ); } -/// Read a `data foo: String = "..."` literal from `dsl/gunbc/tools/ratchet.dag`. -/// Patterns must not be duplicated in Rust — ratchet.dag is the sole authority. -fn l1_ratchet_pattern_from_dag(data_name: &str) -> String { - let ratchet = workspace_root().join("dsl/gunbc/tools/ratchet.dag"); - let content = std::fs::read_to_string(&ratchet) - .unwrap_or_else(|e| panic!("read {}: {e}", ratchet.display())); - let marker = format!("data {data_name}: String = \""); - let line = content - .lines() - .find(|l| l.contains(&marker)) - .unwrap_or_else(|| panic!("missing `{marker}` in {}", ratchet.display())); - let rest = line.split_once(&marker).expect("marker on line").1; - unescape_dag_string_literal(rest) -} - fn unescape_dag_string_literal(mut rest: &str) -> String { let mut out = String::new(); while let Some(ch) = rest.chars().next() { @@ -1075,57 +956,6 @@ fn unescape_dag_string_literal(mut rest: &str) -> String { out } -/// Tri-state grep: Ok(true) = match, Ok(false) = no match, Err = tool failure. -fn l1_grep_has_match(dir: &Path, pattern: &str) -> Result { - let output = std::process::Command::new("grep") - .args(["-rqE", "--include=*.dag", pattern, &dir.to_string_lossy()]) - .output() - .expect("grep must be on PATH for L1 ratchet"); - match output.status.code() { - Some(0) => Ok(true), - Some(1) => Ok(false), - code => Err(format!( - "grep error (exit {code:?}): {}", - String::from_utf8_lossy(&output.stderr) - )), - } -} - -fn l1_grep_violation_report(dir: &Path, pattern: &str) -> String { - let output = std::process::Command::new("grep") - .args(["-rnE", "--include=*.dag", pattern, &dir.to_string_lossy()]) - .output() - .expect("grep detail for L1 ratchet"); - String::from_utf8_lossy(&output.stdout).into_owned() -} - -#[test] -fn l1_type_knowledge_ratchet() { - // Hermetic source audit: patterns from ratchet.dag, corpus src/v3 only (see deleted - // scripts/l1-ratchet.sh). CI still runs gunbc `run_l1_ratchet`; this test mirrors it - // without requiring a release binary or parsing the full dsl/ tree. - let ws = workspace_root(); - let corpus = ws.join("src/v3"); - assert!(corpus.is_dir(), "L1 corpus {} must exist", corpus.display()); - - let ctor_pat = l1_ratchet_pattern_from_dag("l1_constructor_pattern"); - let type_pat = l1_ratchet_pattern_from_dag("l1_typename_pattern"); - - let ctor = l1_grep_has_match(&corpus, &ctor_pat).expect("constructor pattern grep"); - let typ = l1_grep_has_match(&corpus, &type_pat).expect("typename pattern grep"); - - if ctor || typ { - let mut report = String::new(); - if ctor { - report.push_str(&l1_grep_violation_report(&corpus, &ctor_pat)); - } - if typ { - report.push_str(&l1_grep_violation_report(&corpus, &type_pat)); - } - panic!("L1 ratchet failed (patterns from dsl/gunbc/tools/ratchet.dag):\n{report}"); - } -} - #[test] fn second_syntax_spec_exists() { // Stream 0 exit criterion: SyntaxSpec abstraction is real. diff --git a/src/v3/DOWNSTREAM_REQUIREMENTS.md b/src/v3/DOWNSTREAM_REQUIREMENTS.md deleted file mode 100644 index 6015c7ef349..00000000000 --- a/src/v3/DOWNSTREAM_REQUIREMENTS.md +++ /dev/null @@ -1,441 +0,0 @@ -# DOWNSTREAM_REQUIREMENTS — v3 substrate consumer enumeration - -**Status:** active substrate-consumer gap tracker. All 14 original gaps resolved at M1(2.7); R9 and M1(2.8) addendums landed. **Remaining classes below are still live** — Class 5 (structural gaps after R9 + M1(2.8)), class-6 tokenizer escapes, class-7 realization narrowing. - -This document catalogues structural questions that v3 consumers (lenses, inference, emission) ask about `Node`/`Declaration`/`Port`. When a consumer must reconstruct a fact the substrate doesn't expose, that reconstruction is a **substrate-consumer gap** — fix the substrate, don't bridge in the consumer. - -Historical enumeration (M1(2.7) → M1(2.8) — landed work, methodology, R16 audit, Consumer 1–4 walkthroughs) was pruned from this file on 2026-04-17. - -Several Class 5 entries now have dedicated DB docs or ROADMAP deferrals — cross-referenced inline where applicable. Where a gap is fully tracked elsewhere, the entry here is a one-line pointer; where it's genuinely still open and uncaptured, the full description remains. - -## PR-B validation summary (M1(3)) - -PR-B was the first real downstream consumer to read structurally -through the M1(2.8) substrate. Each open class-5 gap was checked -against its pipeline; the verdicts: - -| Gap | PR-B verdict | -|-----|--------------| -| #1 Bool operator grounding | Did not block PR-B. Operator dispatch in PR-B's success program (`let x: Int = 1 + 2`) reads OrderedRing's `add` field directly via the existing §8.9 walk; Bool operator emission is exercised by the `if 1 > 0 then ...` test and works through the same path with `Classical` as the scrutinee. | -| #2 Collection-level algebra receivers | Did not block PR-B. PR-B's emit scope is scalar Int/Bool/String — no FreeMonoid/Set/Map operations. | -| #3 Data body parsing | **Partially closed by PR-B.** The literal-only slice landed via `ValueBody::Structural { fields: Vec<(String, LiteralBits)> }`, `SurfaceExpr::Record`, and `lower_record_to_structural`. The remaining gap is port-carried field values (nested records, list literals, declaration references, Var references). See the gap entry below. | -| #4 Variant constructor expressions | Did not block PR-B. PR-B's emitter doesn't construct sum-type values; the `if/else` branch test uses ordinary if-expression lowering. | -| #5 `where` clause refinement facts | Did not block PR-B. PR-B's Realization meta-type uses no refinement clauses. | -| #6 Declaration references as values | Did not block PR-B. The Realization meta-type was deliberately designed to use scalar field values instead of declaration references; M2+ would let `target: Declaration` replace `target_name: String`. | - -Net: **PR-B validated that the M1(2.8) substrate is sufficient for -the first downstream consumer, with one substrate addition -(`ValueBody::Structural`) and zero new behavior variants.** The -remaining class-5 gaps are correctly characterized as M2+ extension -work, not missing substrate facts that PR-B revealed. - -### M1(3) PR-B class-6 gap: tokenizer escape sequences - -Surfaced during Phase 4 of PR-B when `rust_main_wrap`'s carrier -needed to emit `println!("{}", x)` and a literal `"` couldn't go -inside a string literal. The v3 tokenizer at M1(3) explicitly has -**no escape sequences** — `\"` inside a string is impossible -because the closing `"` terminates the literal at the backslash. -The PR-B workaround uses `%Q` as a literal-quote placeholder that -the emitter substitutes at render time, alongside `%N`, `%T`, etc. - -This is a tokenizer extension, not a substrate gap. Dissolves -when the v3 tokenizer learns standard escape sequences (`\"`, -`\\`, `\n`, etc.). The `%Q` placeholder in `rust.dag` is the -visible scaffold; remove the placeholder and rewrite the carrier -when the tokenizer extension lands. - -### M1(3) PR-B-unwind R1 class-7 gaps: substrate-level realization narrowing - -The PR-B-unwind R1 review on PR #445 raised three substrate-side -issues that are partially addressed and partially deferred. Each -is tracked here so the next round picks them up cleanly. - -**Class-7 gap #1: substrate-level type narrowing for realization -fields.** The current shape uses `Declaration` (the universal -sentinel) as the field type for `target` and `op` in rust.dag's -realization meta-types. The substrate accepts any declaration in -those positions, including bad wirings like -`BehaviorRealization { target: Int }` (a primitive type targeted -at a behavior template) or `OperatorRealization { op: Bind }` -(a substrate marker used as an algebra field). - -PR-B-unwind R1 added a **lower-time fail-closed narrowing check** -in `lower_record_to_structural` (see -`validate_realization_field_target` in `src/v3/compiler/src/lower.rs`). -The check fires at lower time, not at consumer time, so bad -wirings surface as fail-closed diagnostics anchored to the -offending data-body span. Two regression tests pin the behavior: -`m1_3_prb_unwind_r1_behavior_realization_with_primitive_target_is_rejected` -and `m1_3_prb_unwind_r1_type_realization_with_behavior_target_is_rejected`. - -What the lower-time check does NOT do: encode the constraint at -the **type system level** (i.e. make bad states unrepresentable). -The fully structural fix needs one of: - -- **`inhabits` syntax on `type` declarations**: e.g. - `type Bind inhabits BehaviorMarker {}` so the substrate carries - a typed edge from each behavior marker to a parent kind. Then - rust.dag's `BehaviorRealization.target: BehaviorMarker` would - type-check directly against the inhabits edge. Requires parser - + lower work to support `inhabits` on type declarations. -- **`where` clause refinement** on field types: e.g. - `target: Declaration where inhabits(BehaviorMarker)`. Class-5 - gap #5 already tracks `where` clauses; this gap is a specific - consumer of that work. - -**Dissolution trigger**: when v3's parser grows either `inhabits` -syntax or `where` clauses, the lower-time check in -`validate_realization_field_target` dissolves into the parser- -level constraint and is removed. - -**Class-7 gap #2: field-as-declaration in `ValueBody::Structural`.** -The current payload shape is -`Vec<(String, FieldValue)>` where the `String` is the field label -("target", "carrier", etc.). PR #445's R1 review noted that this -keeps a per-field-label string in the data body. The proposed -fix reshapes Field substrate so each Conj field is its own -declaration with a stable id, and `ValueBody::Structural` -carries `Vec<(DeclarationId, FieldValue)>` — typed field -identity instead of a label string. - -The blocker is that v3's `Field` struct (in `dag.rs`) is currently -`{ label: String, ty: DeclarationId }` — fields are NOT their own -declarations. Changing this touches `dsl/std/*` consumed by both -v2 and v3, so it requires v2 coordination. - -**Dissolution trigger**: when v2 either deprecates or coordinates -with v3 on the field-as-declaration substrate change, the -`(String, FieldValue)` payload moves to `(DeclarationId, FieldValue)` -and consumer-side label lookups (e.g. -`field_decl_ref(fields, "target")`) become typed-id lookups. The -PR-B-unwind R1 round delivered the **fail-closed reading** of -the current shape: `require_field_decl_ref` / -`require_field_string` in `emit_rust.rs` panic on missing fields -or duplicate keys, so the label-string lookup fails loudly when -the spec is malformed. - -**Class-7 gap #3: bootstrap fixture enumeration.** The pre-unwind -shape had `const RUST_DAG: &str = include_str!("../../spec/rust.dag");` -constants in `bootstrap.rs` plus a hardcoded fixture array. -PR-B-unwind R1 closed this gap via `build.rs` + the generated -`V3_SPECS` static array. Adding a new per-target spec file -(e.g. `python.dag`) is now a pure file-system change — drop the -file in `src/v3/spec/`, run `cargo build`, and the loader picks -it up. **Status**: closed at PR-B-unwind R1. - -**Scope.** Covers both the read side (`infer.rs`, -`lens_provenance.rs`) and the write side (`parse.rs` → -`lower.rs` boundary). The write side was added in a second pass -after a reviewer surfaced five write-pipeline gaps; the lesson is -that enumeration applies symmetrically to readers and writers. -Gap count at time of enumeration: **14 entries** across 4 -fact-placement classes. **All 14 now resolved.** - -## Class 5 — remaining structural gaps after R9 and M1(2.8) - -These are substrate-level gaps that the R9 + M1(2.8) passes -surfaced but did not close. Tracked as the next substrate -milestone. - -### Class 5 gap 1: Bool operator grounding - -**What's missing.** `Bool` is `Classical = True | False` (a -`Disj`), with no structural link from `Classical` to -`BooleanAlgebra`. The R9 operator walk terminates at a `Disj` -with no field lookup path — the walker falls back to the -Rust-side `(T, T) -> T` / `(T, T) -> Bool` scaffold bridge for -any type whose chain doesn't land on an algebra `Conj`. - -**Why it's hard.** The link "Bool inhabits BooleanAlgebra" is -commented in `algebra.dag` and encoded in the -`kernel_algebra_profile` data table, but the substrate doesn't -have an `inhabits` edge you can walk. Options: -- Add `inhabits TypeExpr` syntax to `type_item` parsing, then - edit `logic.dag` to say - `type Classical inhabits BooleanAlgebra = True | False`. - The walker consults `inhabits` as a second-chance edge when - the Instantiation chain terminates without an algebra. This - is a parser extension but structurally clean. -- Consume `kernel_algebra_profile`'s body at bootstrap, build - an in-memory `name → algebra` map, and have the walker check - that map when the chain doesn't find an algebra. This avoids - parser work but requires record-literal body parsing (another - deferred class). -- Treat Bool specially in the walker with a hardcoded - `classical_algebra_id` cached at bootstrap. A bridge, not a - structural fix. - -**Current status.** Bool operators still dispatch through the -Rust scaffold fallback inside `resolve_operator_arrow`. The -fallback is explicitly documented and returns -`(Bool, Bool) -> Bool` / `(Bool, Bool) -> Bool` (arithmetic on -Bool is nonsensical but the path exists for safety). Tests -that exercise Bool operators still work because the -fallback signature is shape-compatible. - -### Class 5 gap 2: Collection-level algebra receivers - -**What's missing.** `FreeMonoid`, -`BooleanAlgebra` (for `Set`), and `PartialFunction` -(for `Map`) have operator fields whose receiver is the -*parameterized algebra itself*, not the type parameter: -`concat: fn(FreeMonoid, FreeMonoid) -> FreeMonoid`. - -The R9 walk's substitution rule ("algebra's first type -parameter is the receiver, substitute T → source") doesn't -cover this shape — for `FreeMonoid`, the receiver is -`FreeMonoid`, not `T`. The walker would need to identify -the receiver position differently (e.g., "the first input -parameter's declaration *is* the receiver, replace all of its -occurrences in the Arrow with source"). - -**Why it's deferred.** At M1(2.7), `type_to_declaration_id` -allocates a fresh declaration for each syntactic occurrence -of `FreeMonoid` in the algebra field, so they don't share -a DeclarationId and can't be matched structurally. Hash-consing -or a "first input IS the receiver" convention would work but -requires more thought. - -**Current status.** String operators (`"a" + "b"`) fall back -to the Rust scaffold bridge. No existing user-facing tests -exercise String operators, so the bridge is latent. - -### Class 5 gap 4: Variant constructor expressions - -**What's missing.** Bare variant names in expression position -(e.g. the `False` in `match a { True => False, False => True }`'s -arm bodies) don't resolve. R7's anonymization set -`decl.name = None` on sum variant children, so -`declaration_by_name("False")` returns None even when -`False` is a declared constructor of `Classical`. The -name-resolution path in `lower.rs` falls through to an -identifier stub, which the strict sweep flags as unresolved. - -**Why it's hard.** Match patterns resolve scoped against the -scrutinee's Disj children, which sidesteps the anonymization — -but variant RHS expressions have no scrutinee context. Options: -- **Variant-constructor surface syntax** (`Classical.False` or - similar) so the resolution is explicit. Parser extension, - user-visible. -- **Targeted anonymization rollback**: make sum variants - findable by name (reverting that part of R7) while keeping - TypeParams anonymous. Adds namespace ambiguity - (`Classical.True` vs `Bool.True` share the name `True`; - first-match-wins or fail-closed on duplicates). -- **Infer-time re-resolution**: for `Var` expressions that - didn't resolve at lower time, infer could re-try resolution - against a contextual type (the Branch output type, a - surrounding let annotation, etc.). Biggest substrate lift - but most general. - -**Current status.** Match parses, type-checks, resolves -patterns. Arm bodies can use literals, primitives, user function -calls, operators — anything that doesn't require bare variant -expressions. `logic.dag`'s `classical_not` / `classical_and` / -`classical_or` still load as `FnExternalBody` scaffolds because -their RHS uses `True` / `False` as expressions. - -### Class 5 gap 3: Data body parsing - -**What's missing.** `ValueBody::Unparsed` preserves the body -source span but doesn't make the body structurally consumable. -`kernel_algebra_profile` / `kernel_type_set` / etc. — the -load-bearing data tables — still aren't readable by the -compiler at M1(2.7). - -**Why it's deferred.** Parsing record/map/list literal -`SurfaceExpr`s is a full M2 parser extension: new `SurfaceExpr` -variants, new `lower_expr` paths, new `Value`-shaped behavior -nodes for composite values, infer support for structurally -typing record values against their annotation. Substantial. - -**M1(3) PR-B partial close.** PR-B added the **literal-only** -slice of this gap: `SurfaceExpr::Record { fields }`, -`ValueBody::Structural { fields: Vec<(String, LiteralBits)> }`, -`lower_record_to_structural` inhabitance checking, and the -`src/v3/spec/rust.dag` consumer that reads -`(target_name, op_name, carrier, cost)` literal fields off -realization records. The substrate now structurally consumes -data bodies whose field values are scalar literals (Int / Bool -/ String). PR-B's Realization meta-type was deliberately -designed to fit inside that scope. The remaining gap is **port- -carried field values** (a record field whose value is another -declaration reference, a nested record, a list literal, or a -`Var` of an outer binding). When the next consumer needs one of -those, `ValueBody::Structural { fields }` upgrades from -`Vec<(String, LiteralBits)>` to `Vec<(String, PortId)>` (or -similar), and the literal-bits inline form becomes a special -case — not a separate variant. - -**Current status.** Literal-field bodies: ✅ closed at M1(3). Scalar `data x: T = v` bodies: ✅ closed at PR #496 (3a.2 via `ValueBody::Scalar`; DB-10). -Port-carried field bodies: ⏸ deferred to the M2+ consumer that -forces the upgrade. - -### Class 5 gap 5: `where` clause refinement facts - -**Status (as of 2026-04-17):** partial — parser foundation + `Declaration.refinement: Option` substrate edge landed via PR #496. Full semantics (predicate lowering, call-site structural-DAG check, Branch-arm narrowing extension) deferred; now tracked as **DB-11** and as **Deferral: 3a.3-full** in [`ROADMAP.md` §Active deferrals](../../ROADMAP.md). - -The active tracker for remaining work is the DB/ROADMAP pair. This is the canonical pattern: once a class-5 entry lands a dedicated DB doc, its live description lives there — not duplicated here. - -## Historical enumeration — preserved verbatim - -The original substrate-consumer gap enumeration (Consumer 1 through Consumer 4, Methodology, M1(2.7) Resolution summary, Round 9 / M1(2.8) / R16 audit sections, Write-pipeline gap summary, Substrate cross-reference) was pruned from this file in the docs-pruning pass on 2026-04-17. All 14 original gaps closed structurally at M1(2.7); R9 and M1(2.8) addendums landed; the R16 scaffold-boundary audit completed. - -Active substrate-consumer gaps (Class 5 items above, class-6 tokenizer escapes, class-7 realization narrowing, PR-B validation summary) remain in this file. When a new lens or surface form joins the pipeline, run the enumeration discipline against it. - -## The meta-pattern - -Every review round on PR #445 has flagged a variant of the same -shape: **one substrate field carrying multiple downstream jobs, with -the discriminator living in a sibling field (usually a string) — or -the dual: two fields carrying parallel authorities for one fact, with -the discriminator being which call site you happen to be in.** - -- Round 3: `Identifier { name, resolved: Option<_> }` — one variant - held both the unresolved-phase and resolved-phase state, with - `Option` as the discriminator. Fix: split into - `UnresolvedIdentifier` / `ResolvedIdentifier`. -- Round 5: `TypeShape::Primitive(Prim)` — an M0-inherited coarse tag - parallel to the full `DeclarationId`-based type identity. Fix: - replace with the newtype. -- Round 6: `ArrowBody::Pending` (partial) — a mixed-lifecycle slot - held both "user body not yet lowered" and "external realization - lag." Fix: delete the `lower_fn_item_pending` path; body-less fns - have no declaration at all. -- Round 7: flat namespace via `declaration_by_name` — a single - HashMap held both user and bootstrap declarations with no module - layer. Fix: deferred to M2. - -The *next* occurrences, visible in the combined enumeration above: - -- **`AtomPayload::UnresolvedIdentifier(String)` holds both the - forward-reference job (Q3 intake) and the operator-dispatch job - (Q3 + Q4 consumption).** -- **`SurfaceItem::Fn.body: Option` holds both "has - expression body" and "had block body which was skipped" (QW1). - The consumer uses the Option discriminator to decide whether to - lower into a declaration or silently drop the item.** -- **`TemplateArgument.parameter: DeclarationId` holds both - "references a real TypeParam atom" and "self-reference stub - tolerance" (QW4). The consumer distinguishes by checking - whether the template was a stub at construction time.** -- **Port type resolution authority is split between - `type_to_declaration_id` (structural, used inside declarations) - and `lower_type_for_port` (whitelist, used for port annotations), - discriminated by the call site rather than by type (QW5).** - -Both the Round 3 split (Identifier → Unresolved/Resolved) and the -Round 5 dissolution (TypeShape::Primitive → newtype around -DeclarationId) were *localized* fixes. They resolved the specific -field they targeted. They didn't prevent the same pattern from -re-appearing in an adjacent field a round later. - -Zooming out, the full gap list partitions into four fact-placement -classes: - -1. **Primitive type identity** — Q1, Q2, Q4, QW5 all ask "given - that something is of a primitive kind, what is its - `TypeShape`?" Each site answers via a string name lookup or a - hardcoded whitelist. Root cause: there is no substrate-level - edge from primitive-kind to DeclarationId. - -2. **Operator dispatch classification** — Q3, Q4 ask "is this - Transform target an operator, and if so which family?" Root - cause: operators share a variant shape - (`AtomPayload::UnresolvedIdentifier`) with user-code forward - references, so the consumer must re-parse the string at - dispatch time. - -3. **Scaffold honesty** — QW1, QW2, QW4 all involve substrate - positions that *should* carry a scaffold form but instead - silently discard the underlying fact. `ArrowBody::Pending` is - the prototype of a scaffold done right (named variant, - tracked ratchet, dissolution trigger). The substrate needs - analogous scaffold-with-trigger forms for block-bodied fns, - data decls, and stub template arguments. - -4. **Parallel authorities** — Q8, QW5 both involve two code - paths answering the same question ("what exists in the type - system?") with different levels of structural sophistication. - Q8's is local (a safety net on ExternalRealization); QW5's - is systemic (every port annotation sees a different type - system than every declaration annotation). - -Each class has a different structural fix. The next substrate PR -addresses them as classes, not as individual symptoms. - -**This document does not propose a fix shape.** There are several -plausible directions for each gap, and the value of enumerating now -is to hold all the gaps in one place so the fix can address the -class rather than the symptom. Candidates to consider when the -substrate PR is drafted: - -**Class 1 — primitive type identity** (Q1/Q2/Q4/QW5) -- A `Dag` primitive cache with `dag.int_shape()` / `dag.bool_shape()` - / `dag.string_shape()` populated at bootstrap (cheap, partial). -- A `LiteralBits → DeclarationId` structural edge on - `Dag` or on `LiteralBits` itself. -- Dissolve `lower_type_for_port` into a call to - `type_to_declaration_id` wrapped as `TypeShape` — ports inherit - the declaration authority. - -**Class 2 — operator dispatch** (Q3/Q4) -- Promote operator calls to a distinct `TransformTarget` or - `Behavior` shape at lowering time (commits to a parser change). -- Desugar operators to fully-qualified algebra field calls at - parse time (`1 + 2` → `std::algebra::add(1, 2)`), dissolving the - operator concept entirely. -- Split `AtomPayload::UnresolvedIdentifier` into - `UnresolvedUserIdentifier(String)` + - `OperatorSymbol(&'static str)` so the phase distinction is in - the type. - -**Class 3 — scaffold honesty** (QW1/QW2/QW4) -- Split `SurfaceItem::Fn` into two variants (expression-body vs - external-body-scaffold) so the type system distinguishes them. -- Promote `absorb_data_item` to a real `SurfaceItem::Data` variant; - lower either to a full declaration or to a scaffold declaration - with tracked dissolution. -- Delete the `TemplateArgument` stub branch: `template_is_stub` - means the template already has a diagnostic attached, so - emitting nothing is correct. Or: wrap `parameter` in a - `TypeParamId` newtype constructable only from a TypeParam atom. -- Extend §8.11-style ratchet tracking to every scaffold form. - -**Class 4 — parallel authorities** (Q8/QW5) -- Declare meta-type roles as substrate edges rather than named - declarations (addresses Q8, may dovetail with unused `inhabits` - field). -- Delete the port-type whitelist; route through the declaration - authority (addresses QW5, also resolves Class 1 for compound - types). - -Each has tradeoffs the reviewers have not yet had a chance to weigh -in on, and the right answer is probably a combination rather than a -single move. The next substrate PR picks from this menu with the -full gap list visible. - -## Scope note - -This enumeration covers both halves of the pipeline: - -- **Read side** (Consumers 1–3): `infer.rs`, - `lens_provenance.rs` — readers of the substrate. -- **Write side** (Consumer 4): `lower.rs` viewed as a consumer of - `parse.rs` output, with its `SurfaceItem` → declaration / - behavior / port lowering treated as a question-and-answer - boundary. - -The write side was added after the initial pass because a reviewer -surfaced five gaps there; the lesson is that the enumeration -discipline applies symmetrically to readers and writers, and the -next enumeration pass (new lens or new surface form) should cover -both halves from the start. - -Not yet covered: `bootstrap.rs` (another producer), the test files, -and the §8.11 `Pending` ratchet consumer (doc-only today). When the -cost lens (M1(3)) and ownership lens land, re-run the enumeration -end-to-end: each new consumer tests whether the substrate's answers -to its questions are structural or bridged. A lens that needs a -bridge is the substrate's signal to extend. diff --git a/src/v3/M0_RETROSPECTIVE.md b/src/v3/M0_RETROSPECTIVE.md deleted file mode 100644 index 9839df49e59..00000000000 --- a/src/v3/M0_RETROSPECTIVE.md +++ /dev/null @@ -1,480 +0,0 @@ -# M0 Retrospective - -**Status:** Complete. 35 acceptance tests passing on `quick-ant-526`. PR #441 -ready for final review. The M0 substrate proves the v3 thesis primitives -work under adversarial review. - -## Substrate decisions and whether they held - -The five L1 behaviors — Value, Transform, Branch, Loop, Bind — held through -10 milestones and three reviewer rounds without modification. The C1 STOP -signal ("wanting a 6th variant") never fired. The thesis claim that these -are the terminal decomposition survived contact with building against it. - -**Decisions that held without changes:** - -- Five L1 behaviors as terminal (C1) -- `FunctionRef` on Transform (C2 dissolved to nothing at M0.3 — no - TransformRule variants, operators resolve to `std::int::add` etc. - at parse time) -- Define as a Bind with non-empty `params`, not a Transform variant -- Fail-closed compile boundary via `Err(CompileError::Semantic(dag))` -- `mark_unresolved` as the single authority for port state transitions -- Direct Vec indexing on `Dag::node` with topological invariant -- The provenance lens at 50 lines — under the 60-line physics-gap - threshold - -**Decisions that bent under review:** - -- `Port.value_type: Option` started as a two-valued type - maintaining a runtime invariant. ChatGPT's state-space audit at M0.1 - caught it as structurally wrong: `None` conflated three meanings - (Uninferred, Unresolved, and failed). M0.6 refactored to - `PortState::{Uninferred, Resolved(T), Unresolved}`. The illegal mixed - state became unrepresentable by type. One commit, no cascading - changes. The invariant is now structural, not behavioral. -- Spans were originally tracked in a `node_spans` side table. Codex's - "facts flow forward" audit pointed out this was the same pattern as - v2's provenance reconstruction bug. M0.6 moved the span to a field on - every `Behavior` variant. Side table deleted. - -## Substrate constraints exercised - -| Constraint | Exercised? | Notes | -|---|---|---| -| G1 target-agnostic types | Yes | `Prim::Int` stayed symbolic; no `as i64` outside the tokenizer | -| G2 cross-artifact spans | Partially | `SourceSpan.file` always populated; M0 only has one source file per compile | -| G3 parser-agnostic IR | Yes | `parse.rs` has zero `Dag` code references | -| G4 per-target cost characteristics | No | Cost lens deferred to M1 — first exercise will be emission | -| G5 no `TypeError` in `Err` | Yes | Semantic errors stay on the Dag; `CompileError::Semantic(Dag)` is a handoff, not a classification | - -G4 is the one unexercised guardrail. It becomes load-bearing the moment -M1 starts emission, since the cost lens has to read per-target costs from -`LanguageSpec` declarations. - -## Coproduct dissolution status - -- **C1** (`Behavior`) — **kept at 5 variants**. Terminal by the 4-pattern - check. All four dissolution patterns attempted; all failed. Pressure - never materialized. -- **C2** (`TransformRule`) — **dissolved to nothing at M0.3**. Transform - is `Apply(FunctionRef)`. The dissolution was triggered by Test 3 - needing `Call` and `Define` variants, and the answer was to delete - TransformRule entirely rather than extend. -- **C3** (`TypeShape`) — **kept at 1 variant scaffold** (`Primitive(Prim)`). - Pressure never materialized because M0 doesn't need Record/Sum/List/ - Function. Dissolution target `{connective, children}` requires std/ - Product/Coproduct declarations — deferred to M1+. -- **`Diagnostic`** — **extended from 3 to 5 variants** at M0.5/M0.8 - (added `ArityMismatch`, `ResolveError`). This is deferred dissolution: - the 5-field target shape `{span, category, subject, detail, - producing_node}` requires typed references (`TypeRef`, `FieldRef`) - that don't exist yet. Extension is documented with justification at - the top of `diagnostics.rs`. - -## Reviewer feedback loops - -Three review rounds, all producing correct fixes. - -**Round 1 (M0.1 reviews by ChatGPT and Codex):** caught state-space -ambiguity, silent failures in inference, panic on forward references, -span drops, and linear node lookup. Triggered M0.5 (fail-closed -discipline) and M0.6 (PortState + spans + compile boundary). - -**Round 2 (M0.5 review by ChatGPT):** caught unknown-type-name silent -default, branch Bool check missing, call-site signature trust when body -conflicts, recursion/Loop fabrication, test audit too narrow. Triggered -M0.8 (reviewer blockers + 7 regression tests). - -**Round 3 (M0.6 review by ChatGPT):** near-identical to the M0.5 review -(likely re-read stale snapshot). The 4 items the M0.6 snapshot actually -contained were fixed in M0.8; the 3 items the review claimed were already -fixed in M0.6. - -The pattern the three rounds collectively revealed: external reviewers -excel at "missing checks" — places where the compiler should reject a -program but doesn't. Internal review (my own triage) excels at "missing -tests" — coverage gaps on already-correct code. Both feedback paths are -necessary; neither catches the other's bug class. - -## Late-M0 review round (blockers 1–4) - -A final external review after M0.9 caught four substantive issues. -Three were real correctness bugs and the fourth was a discipline gap. -All landed in M0.10–M0.12 before M0 close: - -**Blocker 1 (recursion annotated not rewritten):** the Loop wrapper -for recursive functions is structural decoration — its body still -contains literal self-referential Transform nodes (e.g., `count_down(n - 1)` -as a Transform with target "count_down"). The thesis claim that -recursion reduces to bounded iteration is half-true: the Loop exists, -but the recursive call nodes inside it are still function calls that -the substrate doesn't interpret specially. **Partial fix in M0.10** -(Loop/body reconciliation catches the fact that the body's actual type -must match the declared return type). **Residual deferred to M1**: the -self-referential Transforms inside Loop bodies are not yet rewritten to -a substrate primitive like `Recur`. A full fix connects to M1's -declaration-table restructuring — once function references are -DeclarationIds rather than strings, the self-call can become a -recognized "this is the enclosing Loop's function" rather than a -generic Transform. Flagged as a known M0 limitation in this -retrospective rather than hidden. - -**Blocker 2 (pre-seeded Loop.output never reconnected):** `lower_fn_item` -pre-seeded `loop_output` with the declared return type — load-bearing -for the fixpoint, since recursive calls inside the body need the -function's Bind.value port Resolved to infer their own types. But -nothing reconciled the pre-seeded type with the body's actual return -type, so `fn bad(n: Int) -> Bool = if n == 0 then 0 else bad(n - 1)` -(where the then-branch is Int and the declaration says Bool) silently -typed as Bool at every call site. The producer-fact-reaches-consumer -property failed for recursive functions — the v2 disease recurring in -a new costume. **Fixed in M0.10**: infer's `decide()` for `LoopNode` -no longer returns Retry unconditionally. It reads the body's output -port and returns `Decision::Set(l.output, body_type)`, letting the -apply loop's existing conflict detection catch pre-seed/actual -mismatches. Regression test: `test_recursive_function_with_wrong_body_type_is_rejected`. - -**Blocker 3 (mutual recursion silently accepted):** `is_recursive` -only catches direct self-calls, so `fn even(n) = odd(n - 1)` paired -with `fn odd(n) = even(n - 1)` evaded both the Loop wrap path AND -any rejection. Body inference stalled on Retry forever, leaving the -body_return_port pre-seeded value as a fake Resolved answer. The -thesis claim "termination by construction" failed silently. -**Fixed in M0.11**: a pre-lowering pass (`compute_mutually_recursive`) -builds the call graph over fn items, computes transitive reachability, -and identifies cycles of size > 1. Functions in those cycles are -rejected at lowering with a specific "mutual recursion is not yet -supported" diagnostic before any body lowering happens. Regression -test: `test_mutual_recursion_is_rejected`. - -**Blocker 4 (missing dissolution ledger):** discipline gap. Four -enums — `PortState`, `LiteralValue`, `Origin`, `CompileError` — -lacked the dissolution receipts the modeling doc requires (every -kept enum names either a terminal argument or a deferred-dissolution -trigger). **Fixed in M0.12**: added receipts to each. PortState and -CompileError are terminal. LiteralValue is deferred (dissolves with -the primitive substrate refactor at M1). Origin is a judgment call — -it's a Pattern 1 candidate (redundant with Behavior kind) kept as an -enum for readability, with an explicit revisit trigger if consumer -patterns change. - -**Also in M0.12: no-annotations invariant.** The user's direction -during this review round was to rule out annotation mechanisms at -every layer of the stack through M3. `INVARIANTS.md` §"Modeling -Faithfulness" now extends "Annotations are not facts" (which already -covered `.dag` source level) to compiler data model level and lens -level. Lenses are pure functions from `&Dag` to derived values, not -annotation mechanisms that write back to nodes. Concrete implication: -the Dag carries only Port/Behavior/Declaration/diagnostics, with no -annotation tables, no attribute maps, no lens-result side storage. -The success bar for new lenses is "pure function, zero substrate -modifications, its own file." This rule is ruled out now because the -core language is still being discovered — allowing annotations as an -escape hatch would fill real gaps with a decorative layer and make -the gaps invisible. - -## The primitive substrate gap (parallel-representation debt) - -M0 built the control-flow substrate (L1 behaviors, Ports, diagnostics) -to completion, with dissolution discipline applied at every checkpoint. -The **data substrate** — specifically, how types and primitive -operations are represented — was scaffolded rather than completed, and -the scaffold is in the wrong shape. - -**The scaffold:** - -- `TypeShape::Primitive(Prim)` where `Prim = Int | Bool | String` — a - flat enum in `types.rs` -- `FunctionRef { name: String }` — a string wrapper in `dag.rs` -- `primitive_signature(name: &str) -> Option` — a hardcoded - Rust function in `infer.rs` mapping operator names to type signatures - -**Why this is the wrong shape**, even though each scaffold is honestly -marked as a scaffold: it is a **parallel representation** of facts that -already live canonically in v2's `dsl/std/`. v2 declares Int, Bool, -String and their operations in `.dag` source. v3's scaffold re-asserts -the same facts in Rust code, creating a single-authority violation -the modeling discipline forbids. Every primitive in v3's table is an -unnecessary second source of truth. - -Additionally, `FunctionRef { name: String }` is name-based dispatch — -the M8 pattern the modeling discipline explicitly rejects. The -substrate's notion of "primitive" is an opaque label, not a reference -to a structurally-rich declaration. `primitive_signature()` is literal -string-dispatch inside the compiler — exactly the pattern v3 is -supposed to cure. - -**What the correct shape looks like:** a single declaration table -owned by the Dag, where every named thing (types, functions, -operations, eventually algebras and effects) is a `Declaration`. -References are `DeclarationId`s, not strings. Primitives are -Declarations pre-populated at `Dag::new()` (bootstrap); user code -declarations join the same table via the same mechanism; the -substrate doesn't distinguish "primitive" from "user function" — -both are Declarations, only their source differs (hardcoded bootstrap -at M0, parsed from `std/` at M1, parsed from user source at M2+). - -**Debt classification:** this is **parallel-representation debt**, -not **dissolution debt**. It's not a coproduct that needs to collapse -into a better shape with fewer variants — it's a scaffold whose -authority should live elsewhere. The fix is "delete the parallel copy -and consume the canonical source," not "collapse variants." The -control-flow substrate (five behaviors, ports, diagnostics) does not -have this debt; the data substrate has it in three localized places. - -**Why this happened:** M0's scoping decision focused on the -control-flow substrate (L1 behaviors, Port state, fail-closed -discipline) and deferred the data substrate to M1 under the framing -"we have to start somewhere." That framing was too narrow. The data -substrate is an equally important part of the thesis (single source -of truth, no parallel representations, name-based dispatch forbidden), -and building parallel scaffolds — even honest scaffolds — created -migration debt. The scaffold discipline ("mark it as a scaffold, name -the dissolution target") is not a substitute for the single-authority -principle when a canonical source already exists. - -**Resolution path:** M1's **first** task before any other M1 work -(cost lens, emission, LanguageSpec) is the primitive substrate -restructuring — replace `Prim`/`FunctionRef`/`primitive_signature` -with a `Declaration` table on the Dag, consumed via `DeclarationId` -references. The primitives stay hardcoded at first (at `Dag::new()` -via a `bootstrap_primitives` pass), then M1 replaces the bootstrap -with std/ parsing. The substrate doesn't change during the std/ -wiring — only the source of the Declarations changes. This sequencing -puts the restructuring under pressure from real consumer requirements -(the cost lens needs to read per-declaration algebra, emission needs -to read per-declaration cost characteristics), which is the right -place for it. See `ROADMAP.md` §M1 for the explicit ordering. - -**Lesson for future substrate work:** when there's an existing -canonical source for a class of facts, the substrate should consume -the canonical source from the start, not build a parallel -representation as a scaffold. Parallel representations create -migration debt, and migration debt compounds. The "honest scaffold" -discipline is not a substitute for the single-authority principle — -a scaffold that captures the wrong abstractions creates the same -debt as a non-scaffolded parallel representation would. - -## Deferred limitations - -| Item | Reason | Target | -|---|---|---| -| Full descent analysis (lexicographic, non-subtraction, structural) | M0 partial analysis rejects the obvious cases; full analysis is 2–3 hours of substantive work | M1+ | -| Diagnostic 5-field target shape | Requires typed references (TypeRef, FieldRef) not yet in substrate | M1+ | -| `TypeShape` dissolution to `{connective, children}` | Requires std/ Product/Coproduct/Function declarations | M1+ | -| Mutual recursion detection | Current `is_recursive` finds only direct self-calls | M1+ | -| Imperative fixpoint loop with `changed: bool` | Sketch-mode OK; the recursive form fights Rust's lack of TCO | M3 port attempt | -| Counter-based `NodeId` allocation | Sketch-mode OK; dissolves in .dag via fold-accumulator | M3 port attempt | -| Property-based invariant testing | Needs proptest wiring; valuable but not urgent | M1+ | -| Full structural pre-infer/post-infer phase split on Dag | M0.6 refactor made the biconditional structural enough; full phase split is a larger change | M1+ | - -## What M1 inherits - -- A working `tokenize → parse → lower → infer` pipeline, 35 acceptance - tests -- Five L1 behaviors with structural spans, central Port table, PortState - enum -- Fail-closed compile boundary (`Err(CompileError::Semantic(Dag))`) -- `mark_unresolved` as the single authority for port state transitions -- Provenance lens at 50 lines (the v3-vs-v2 proof point for "lenses read - physics") -- Partial descent analysis (zero-arg rejected, syntactic `param - const` - required) -- Producer-fact-reaches-consumer path: call sites read the function's - `Bind.value` state, so body/signature mismatches propagate to every - call site -- User function signature registry (`dag.signatures`) that breaks - inference fixpoint cycles for recursion -- Sketch-mode framing in ROADMAP so the functional-vs-imperative question - stays answered -- 10+ feedback memories encoding the review discipline, checkpoint - patterns, and dissolution rules -- v2's test suite available as an oracle for equivalence checks when M1 - emission starts - -## What M1 has to build fresh - -**M1 ordering matters.** The primitive substrate restructuring comes -FIRST, before cost lens or emission, because it's substrate work that -everything else builds on. See the "primitive substrate gap" section -above for the rationale. - -1. **Primitive substrate restructuring (first M1 task).** Replace the - parallel-representation scaffolds (`Prim` enum, `FunctionRef`-as- - string, hardcoded `primitive_signature` match table) with a - `Declaration` table on the Dag, consumed via `DeclarationId` - references. Primitives remain hardcoded at `bootstrap_primitives` - time. No std/ parsing yet — that comes after. -2. **std/ parsing.** Replace the bootstrap with a std/ parse pass. - Declarations now come from `.dag` source rather than Rust code. - The substrate doesn't change during this swap — only the source - of the Declarations changes. -3. **Cost lens (first reader lens that returns computed values).** - Originally framed as "writer lens #1" — that framing is historical; - see the postscript at the top of the Success bar section. The - cost lens is a pure function over substrate + `rust.dag`, not a - persistent writer. Must land with zero substrate modifications - beyond whatever the Declaration table needs for algebra/cost - metadata. -4. **Emission to a target language (Rust first).** Only after the - cost lens proves the substrate is extensible. `LanguageSpec` with - per-target cost characteristics (G4 guardrail exercised). -5. **Ownership/effect lenses** if the M1 test corpus forces them. -6. **More sophisticated descent analysis** if any M1 test program - needs it (current partial descent rejects the obvious bad cases; - lexicographic orderings and non-subtraction measures are M1+). - -## Success bar: trivial to add new analyses - -The v3 thesis claims that adding a new analysis (a new lens over the DAG) -should be trivial — proportional to the analysis's conceptual complexity, -not proportional to substrate modifications required. v2 failed this bar -catastrophically: `complexity.dag` was 5000 lines of provenance -reconstruction because v2 had thrown away origin information during -inference. v3's equivalent is 50 lines because the facts are carried -forward. - -**Status at end of M0: validated for observational lenses (read-only).** -Two independent data points: - -- **Provenance lens** (M0.4) — 50 lines, one method - (`Origin::origin_of(port)`), reads `produced_by` and dispatches on - the producer's behavior kind. Zero substrate modifications. -- **Depth lens** (post-M0.9 follow-up) — 66 lines including 20 of doc - comment, one method (`DepthLens::depth_of(port)`), walks ports - backward through input chains and returns the longest path to any - leaf. Zero substrate modifications. Three tests pass, including - Branch-path-max composition. - -Two lenses both landed in tens of lines each with zero substrate -edits. The bar holds for observational lenses by demonstration, not -just by design claim. - -**Question resolved post-M1(2.7): there are no writer lenses.** - -> **Postscript (2026-04-15).** The question below — "how does a lens -> store its results?" — is now closed. The answer is that the question -> itself was the wrong framing. Per the minimality invariant that -> landed in the M1(2.7) review cycle, **lenses are pure readers over -> substrate + language spec; they do not persist state and do not -> need a storage mechanism.** The four options enumerated below (Port field, per-lens -> side table, Port annotations, generalized diagnostic table) are all -> rescinded — none of them land. Cost, ownership, effects, purity, and -> any future lens are all pure functions of `(substrate, lang_spec)`, -> recomputed on demand. Memoization, if ever needed for performance, -> is a transparent local cache added later based on profiling — not -> part of the lens contract and not a substrate-level decision. The -> M0 retrospective's framing ("M1 will force the decision") was -> correct that M1 would force the question; it turned out the forcing -> resolved the question by dissolving it, not by picking an option. -> -> This section is retained as **historical context** showing what M0 -> thought the open question looked like. Future readers should treat -> the option list below as a snapshot of M0-era thinking that does -> NOT reflect current doctrine. - -**M0-era framing (historical, superseded by §12.6).** M0 has no -writer lenses. The mechanism for "how does a lens store its results" -was not yet committed at M0 time — there were three or four plausible -options, each with different cost profiles: - -- **Option A:** add a `cost: Option` (or similar) field to Port. - Works, but privileges the cost lens and doesn't generalize. Port - grows unbounded. -- **Option B:** each lens owns a side table `HashMap`. - Works, cheap, doesn't privilege any lens. Cross-lens queries require - threading multiple tables. -- **Option C:** general-purpose annotations on Port — - `annotations: HashMap`. Unified place, cross-lens - reads uniform, but introduces questions about invariants across - annotations. -- **Option D:** generalize the diagnostic table pattern. Rename - `DiagnosticTable` to something like `PortAnnotations`, with - `Diagnostic` as one annotation kind among many. Most ambitious and - most thesis-aligned — everything is an annotation, diagnostics are - just the annotations that cause compile failure. - -**Resolution (M1(2.7)+):** Option **E** — none of the above. Lenses -are readers. The storage question is moot because there is nothing -to store. The minimality invariant (pure-reader lenses, no -persistent state, memoization is a transparent local concern if -ever needed) is now doctrine. - -**M1 forcing function (historical context).** The M0 retrospective -originally expected the cost lens to force the storage decision -during M1. What actually happened: the minimality invariant arrived -first (M1(2.7) review cycle), and the storage question dissolved -rather than resolving in favor of a specific option. The forcing -function worked — it just forced a re-framing of the question rather -than an answer within the original frame. - -**Explicit acceptance criterion for M1:** by the end of M1, the following -question must have a confident answer — *"If we came up with a new lens -tomorrow, what's the minimum line count of substrate modifications -needed?"* The target answer is **zero**. Any other answer is a -substrate gap that must be closed before M2. - -The agent should attempt to build the cost lens as a new file -(`lens_cost.rs`) that imports from `dag.rs` and reads the DAG, with no -modifications to Port, Behavior, Dag, or any substrate type. If the -agent hits a wall where it needs to write results and no existing -place works, that's the signal to pause and design the lens-storage -mechanism explicitly, once, as a substrate-level commitment. - -## One meta-observation - -M0 is compressed relative to typical project milestones — 10 commits, -38 tests, 3 review rounds, 1 structural refactor, 2 observational -lenses. The shape is the right shape for a mature project (substrate -validation → hardening → feature work → parallelized extension), just -faster. The review-and-respond loop is now a working feedback mechanism: -external reviewers catch missing checks, the agent produces correct -fixes, and the cycle produces code that tightens under pressure rather -than loosening. - -The theory work for M0 is done. The closure work (the retrospective, -this document) closes the milestone. M1 should feel like -implementation, not design — except for the one design question M0 -explicitly defers to M1: how lenses store results. **(Post-M1(2.7) -update: this deferred question resolved by dissolution — lenses -don't store anything. See the postscript at the top of the "Success -bar" section above.)** - -## M1(2.5) addendum — substrate rework (historical snapshot) - -> **Historical note.** This section captures the substrate rework -> at the M1(2.5) handoff. Several concrete details here (the embedded -> fixture strings, `inject_primitive_operators`, the initial 42-green -> test count) were explicitly transitional and were removed during -> M1(2.6). For current v3 status and test counts, read -> [`ROADMAP.md`](../../ROADMAP.md) — the retrospective is closed -> history. - -M1(2.5) supersedes the scaffolded primitive substrate from M0.1/M1(1). -`LiteralValue`, `FunctionRef { name: String }`, `Signature`, -`primitive_signature`, `register_signature`, and `lookup_function` are -all deleted. Their replacement is the six-variant `TypeConnective` enum -(`Atom`, `Conj`, `Disj`, `Arrow`, `Cardinality`, `Instantiation`) carried -by `Declaration`s in a new `Dag.declarations` table, plus `ArrowBody` -with `UserDefined(NodeId) | ExternalRealization(DeclarationId) | Pending` -(M1_DESIGN.md §3, §Q7). - -**At the M1(2.5) handoff** (superseded by M1(2.6), see ROADMAP): -bootstrap (`src/v3/compiler/src/bootstrap.rs`) parsed four minimal -fixture modules (`logic`, `bit`, `algebra`, `types`) from embedded -strings at `Dag::new()` time, and injected primitive operator Arrow -declarations so user-code dispatch (`1 + 2`) worked without a §8.9 -inhabitance walk. Both mechanisms were explicitly scaffolded and both -were removed in M1(2.6) — bootstrap now consumes the real -`dsl/std/*.dag` files via `include_str!`, and operator dispatch goes -through `infer::resolve_operator_arrow`. See ROADMAP §"M1(2.6)" for -the current shape. - -**Handoff test count** (M1(2.5) only, superseded): -M0 test count grew from 38 to 40; the M1(2.5) PR kept all 40 green -and added two new substrate tests (`parse_std_algebra_and_walk_int_add` -and `parse_synthetic_service_all_layers`) for a total of 42 green -tests. Every subsequent push to PR #445 (the M1(2.5)/M1(2.6) PR) -added more tests — see ROADMAP §"Status at a glance" for the current -count. diff --git a/src/v3/M1_DESIGN.md b/src/v3/M1_DESIGN.md deleted file mode 100644 index 2f00b12bc6f..00000000000 --- a/src/v3/M1_DESIGN.md +++ /dev/null @@ -1,1564 +0,0 @@ -# M1 Design Note: Substrate Rework - -> **⚠️ HISTORICAL.** This is the design oracle for M1(2.5), M1(2.6), and -> M1(2.7) substrate work that shipped in PR #445. The authoritative -> substrate documentation now lives in the code itself — -> `src/v3/compiler/src/dag.rs` for the type layer, `src/v3/compiler/src/ -> infer.rs` / `lower.rs` for the inference and lowering stages. This -> document is preserved as a historical record of the design rationale -> (especially §Q7 ArrowBody variants, §8.10 substrate-extension audit, -> §8.11 Pending-elimination ratchet) because those sections are still -> cross-referenced by code comments. New design work does NOT go here — -> see the live design docs under `docs/` and the top-level `THESIS.md` / -> `INVARIANTS.md` / `ROADMAP.md`. - -**Status:** design-first spec for M1(2.5). Answers load-bearing representation -choices before any code changes. Paired with `THESIS.md` §"The substrate: two -coordinated shapes" and §"Epistemic stacking." - -**Supersedes:** PR #442's `DeclKind::{Type, Function}` flat shape. That work -(M1(1) + M1(2)) is wiped in full — no rescue plan. It was ~30 minutes of -implementation and the infrastructure scaffolds are useful for reference but -not for salvage. Convergence note from 2026-04-15 classifies "flat `DeclKind` -is too narrow" as settled. - -## 0. Purpose - -This document is the oracle M1 rework executes against. It: - -1. Names what infrastructure survives the wipe vs. what is replaced. -2. Commits the concrete Rust data model for the two-substrate shape committed - in THESIS.md. -3. Answers six load-bearing representation questions that determine whether - M1 rework is one PR or three. -4. Walks `dsl/std/algebra.dag` and a minimal `dsl/extdeps/shell.dag` subset - onto the data model to verify the substrate test passes. -5. Gives a focused file-by-file implementation plan. -6. Declares the M1(2.5) scope boundary — what is explicitly not in scope. - -If any decision in this note is wrong, it's fixed HERE before code changes. -Design-first is the working discipline. - -## 1. Convergence reference - -The project converged at 2026-04-15 on: - -- **Settled:** epistemic stacking is load-bearing; flat `DeclKind::{Type, - Function}` is too narrow; substrate test is "host `dsl/std/algebra.dag` - + a synthetic nested-domain model analogous to `shell.Exec.Run` - with no new DeclKind variants"; - design-first before implementation; omni-emission is the long-term goal. -- **Open (this doc pins them down):** two-substrate concrete shape, - Declaration struct, PR #442 infrastructure inventory. -- **Deferred:** five L1 behaviors as patterns over the type substrate - (unification); further reduction to three primitives (Atom/Conj/Disj only); - `std/meta.dag` as a first-class mechanism; cost lens + single emitter. - -This design note executes on the Open items only. - -## 2. PR #442 wipe: what goes, what stays - -**Deleted entirely:** - -- `DeclKind::{Type, Function}` enum in `src/v3/compiler/src/dag.rs`. -- `primitive_signature` / `Signature` hardcoded lookup table in `src/v3/compiler/src/infer.rs`. -- `FunctionRef { name: String }` (name-based function dispatch) — replaced - by `DeclarationId`-based references in the new connective shape. -- `LiteralValue` enum with flat Int/Bool/String variants — replaced by - `AtomPayload::Literal`. -- Per-primitive function declarations in `dsl/std/core.dag` (e.g., `fn - std::int::add(a: Int, b: Int) -> Int`). These are exactly the - parallel-representation pattern the thesis rejects. Replaced by - inhabitance-derived signatures walking `std/algebra.dag`. -- The `bootstrap_primitives` function body that hand-registers Int/Bool/ - String and operators in Rust. Replaced by parsing `std/algebra.dag` at - `Dag::new()`. - -**Survives the wipe (keep and extend):** - -- `DeclarationId` newtype — stable integer IDs over the declaration table. -- `Dag::new()` bootstrap entry point and declaration table mechanism. - Contents change; shape stays. -- Parser extensions for nested declarations, keyword paths, optional `fn` - bodies. Needed for the new shape's richer syntax. -- Name resolution hooks (identifier → DeclarationId). -- **Five L1 behaviors** (`Value`, `Transform`, `Branch`, `Loop`, `Bind`) - in the computation substrate — unchanged from M0. Validated by M0 under - three reviewer rounds; not revisited. -- `PortState` enum (`Uninferred | Resolved(TypeShape) | Unresolved`). -- `DiagnosticTable` and the fail-closed compile boundary (`Err(CompileError:: - Semantic(Dag))`). -- `SourceSpan` tracking structurally on every Node. - -**Unaffected:** - -- Tokenizer (`src/v3/compiler/src/tokenize.rs`) — minor updates only. -- Lens architecture (`lens_provenance.rs`, `lens_cost`, etc.) — read - interfaces will need light updates to walk connectives instead of - `DeclKind` variants, but the lens-as-read-only-observer pattern stands. - -## 3. Declaration data model - -```rust -// src/v3/compiler/src/dag.rs - -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -pub struct DeclarationId(u32); - -#[derive(Debug, Clone)] -pub struct Declaration { - pub id: DeclarationId, - pub name: Option, - pub connective: TypeConnective, - /// Meta-type tag for value-construction Conjs. Points at the - /// declared meta-type whose shape this Conj is expected to - /// satisfy. Example: `transport shell { argv: [...] }` is a - /// Conj whose `meta_tag` points at the `transport` meta-type - /// declaration; the compiler structurally type-checks the - /// Conj's children against the meta-type's field shape. - /// None for declarations that are their own primary - /// meaning (algebras, primitive types, function types). - pub meta_tag: Option, - /// Algebra inhabitance edge. Separate from `meta_tag`. Used - /// when a declaration has its own primary structure AND - /// additionally inhabits an algebra beyond its structural - /// shape. Example: a hypothetical `Money` record - /// (`Conj { value: Float, currency: Currency }`) could - /// additionally inhabit a `CurrencyLattice` algebra; that - /// edge goes here, not in `meta_tag`. For pure aliases like - /// `Int = OrderedRing`, the Instantiation connective - /// IS the inhabitance and `inhabits` stays None. - pub inhabits: Option, - pub span: SourceSpan, -} - -#[derive(Debug, Clone)] -pub enum TypeConnective { - /// Irreducible leaf. See AtomPayload. - Atom(AtomPayload), - - /// Labeled product — logical AND. All children present together. - Conj { children: Vec }, - - /// Labeled coproduct — logical OR. Exactly one variant active. - Disj { variants: Vec }, - - /// Function type — directional flow from inputs to an output. - /// Function type — directional flow from inputs to an output. - /// `body` is an ArrowBody enum covering user-defined sub-DAGs, - /// extdeps-declared realizations, and the Pending bootstrap - /// state. See Q7 for the full semantics. - Arrow { - inputs: Vec, - output: DeclarationId, - body: ArrowBody, - }, - - /// Repetition over an element type with a bound. Unifies v2's - /// Required/Optional with list cardinality. - Cardinality { - element: DeclarationId, - bound: CardinalityBound, - }, - - /// Specialization of a parameterized template declaration with - /// concrete template arguments. Matches C++ template instantiation: - /// `template` is the parameterized declaration (analogous to - /// `template class X { ... }`), `arguments` is the - /// list of concrete bindings (analogous to the `X` site). - /// For pure aliases like `Int = OrderedRing`, Int's - /// connective IS Instantiation directly — inhabitance collapses - /// into this form. See also Declaration.inhabits for the rare - /// secondary case. - Instantiation { - template: DeclarationId, - arguments: Vec, - }, -} - -#[derive(Debug, Clone)] -pub struct Field { - pub label: String, - pub ty: DeclarationId, -} - -#[derive(Debug, Clone)] -pub enum ArrowBody { - /// User function. NodeId is the root of a sub-DAG of L1 - /// behavior nodes in Dag::nodes. - UserDefined(NodeId), - /// Primitive / intrinsic whose realization is declared in - /// an extdeps language spec. DeclarationId points at the - /// realization declaration, reached by a typed edge — not - /// by name lookup. See Q7. - ExternalRealization(DeclarationId), - /// Bootstrap state at M1(2.5): static grounding is complete - /// via inhabitance, but no realization declaration is - /// loaded yet. Scaffolded state — CI ratchet (§8.11, - /// distinct from §8.10's substrate-extension audit) - /// enforces that Pending resolves to UserDefined or - /// ExternalRealization before M3 completes. - Pending, -} - -#[derive(Debug, Clone)] -pub enum AtomPayload { - /// A literal bit pattern carried at the type level. - /// Terminal: comes from source text literals (numbers, - /// strings, booleans). User-input boundary. - Literal(LiteralBits), - /// An identifier reference. String pre-resolution, DeclarationId - /// post-resolution. Stored as a string so pre/post is a bit flag, - /// not a variant split. - /// Terminal: comes from user-chosen names in source text. - /// User-input boundary. - Identifier { name: String, resolved: Option }, - /// A type parameter declaration slot. Appears as a child of a - /// parameterized declaration; referenced from inside the body by - /// other Identifier atoms that resolve to this slot. - /// Terminal: the declaration site of a type parameter in - /// `type Foo { ... }`. User-chosen name; the value is - /// bound at Instantiation time. - TypeParam(String), - /// A source span reference for metadata-only atoms. - /// Terminal: byte offsets in source files. Metadata, not - /// data flowing through the graph; span atoms appear as - /// children of declarations for diagnostic purposes. - Span(SourceSpanId), -} - -// AtomPayload dissolution ledger (4-pattern check per -// §"Structural decompression"): -// -// AtomPayload is a 4-variant coproduct at M1(2.5). Each variant -// represents a distinct KIND OF USER-INPUT BOUNDARY — a -// terminal fact the compiler receives from outside the closed -// world and does not decompose further. -// -// Pattern 1 (fact placement): fails. Literal/Identifier/ -// TypeParam/Span serve different downstream consumers -// (inference reads types via Identifier, error reporting -// reads Span, literal constant folding reads Literal, -// template substitution reads TypeParam). Scattering each -// into its own substrate slot would create four parallel -// atom carriers and multiply the substrate surface without -// simplifying anything. -// -// Pattern 2 (variant-is-data): fails. The variants are not -// "different data in the same shape" — they have structurally -// different payload types (bit pattern vs string vs type- -// parameter-name vs byte offset). A unified payload type -// would require a tagged union, which is what we already -// have. -// -// Pattern 3 (algebraic form): fails. The four variants do not -// trace to introduction/elimination forms of any algebra in -// std/; they are terminal facts from distinct user-input -// boundaries. -// -// Pattern 4 (dimensional): fails. There is no shared coordinate -// space underlying the four variants. "Literal" and "Span" -// don't share structural dimensions. -// -// Dissolution verdict: AtomPayload is genuinely terminal. -// Each variant corresponds to a distinct user-input boundary -// (per §"Structural decompression": "terminal at the user-input -// boundary"). The 4-variant shape is load-bearing and should -// not dissolve. No further action needed. Any future extension -// (e.g., adding a `Char` literal kind) would be a variant -// extension subject to §8.10's substrate-extension audit. - -#[derive(Debug, Clone)] -pub enum LiteralBits { - Int(i64), - Bool(bool), - String(String), -} - -#[derive(Debug, Clone)] -pub enum CardinalityBound { - /// Exact count. Required fields use Exact(1); fixed-size - /// arrays use Exact(n); argv literals use Exact(3). - Exact(u32), - /// Zero or one. The distinct shape for optional fields - /// (`T?` in surface syntax). Keeps 0..1 structurally - /// distinguishable from 0..n. - AtMostOne, - /// Zero or more. The shape for `List`, used anywhere - /// the count is unbounded. - Unbounded, - // Range / AtLeast(n) / AtMost(n) deferred to M1+; neither - // algebra.dag nor minimal shell.dag needs them. AtMostOne - // is included from the start because Optional is a - // distinct shape from List and conflating them would let - // illegal states (a "List-typed optional") be representable. -} - -#[derive(Debug, Clone)] -pub struct TemplateArgument { - /// The template parameter being bound. References a TypeParam - /// Atom declared as a child of the template. In C++ terms: - /// the `T` in `template`. - pub parameter: DeclarationId, - /// The concrete type the parameter is bound to. In C++ terms: - /// the `int` in `X`. - pub value: DeclarationId, -} -``` - -Estimated line count: ~120 lines of Rust for the data model + helper impls. -Concrete implementation may grow this slightly for accessor ergonomics. - -## 4. Load-bearing design questions — answered - -### Q0: What counts as an Instantiation (vs a Conj, vs inhabitance)? - -**Answer: Instantiation is ONLY for type parameterization. Value -construction and inhabitance witness use different mechanisms.** - -Earlier drafts of the thesis used "Instance" as a catch-all for -three different structural relationships. The reviewer flagged -this as a coproduct hiding in prose — the Rust struct layout -can't accommodate all three without becoming a three-variant -coproduct itself. The resolution is to commit each to a specific -mechanism: - -**Case 1: Type parameterization** (e.g., `Int64 = OrderedRing`, -`Monoid`) uses the `Instantiation` connective. Binds type -parameters (Atoms with `TypeParam` payload) to concrete type -declarations. Substitution is lazy at walk time via a substitution -stack. Matches C++ `template class X { ... }` → -`X` exactly. - -**Case 2: Value construction** (e.g., `transport shell { argv: -["sh", "-lc", "{script}"] }`, `Order { customer_id: "x", items: -[...] }`) is **NOT** Instantiation. It is a plain `Conj` whose -children are bound to specific values, with an optional -`meta_tag` edge on the Declaration pointing at the meta-type -the Conj is expected to satisfy: - -``` -Node: Run_transport - connective: Conj - children: [ - Field { label: "argv", ty: argv_literal_node } - ] - meta_tag: Some(transport_shell_meta_ref) // meta-type tag - inhabits: None // no algebra inhabitance -``` - -The compiler type-checks this Conj against `transport_shell_meta`'s -declared field shape via a structural check on the `meta_tag` -edge — no Instantiation machinery involved. The `meta_tag` -answers "what shape should this Conj satisfy?"; the Conj's -children answer "what values do the fields hold?" - -**`meta_tag` vs `inhabits`: two different edges.** The -Declaration struct (§3) has both. They serve different -relations: - -- **`meta_tag`** — "this Conj's shape is constrained by the - linked meta-type declaration." Used for value construction - (services, records, transports). The linked declaration is - typically itself a Conj whose fields describe the expected - shape. -- **`inhabits`** — "this declaration additionally satisfies - the linked algebra's laws." Used for secondary algebra - inhabitance on declarations that have their own primary - structure. Typically unused at M1(2.5); held open for - future Money-inhabits-CurrencyLattice-type cases. - -Earlier drafts of this section used `inhabits` for both -relations, which overloaded one field with two distinct -meanings. The split into `meta_tag` + `inhabits` is the -dissolution fix. - -**Case 3: Inhabitance witness** (e.g., `Int inhabits OrderedRing`) -for pure aliases like `Int = OrderedRing` is **the -Instantiation itself** — Int's declaration has connective -`Instantiation { template: OrderedRing, bindings: [T := Word64] }` -directly. There is NO separate witness edge. Inhabitance for -pure aliases COLLAPSES into the Instantiation. - -The optional `Declaration.inhabits` slot (see Q2 below) is -reserved for the rare case of a declaration with primary -structure AND additional inhabitance — e.g., a hypothetical -`Money` record that also inhabits a `CurrencyLattice` algebra. -At M1(2.5) this slot stays empty for every declaration we'll -encounter in algebra.dag and shell.dag. It exists as forward -compatibility without substrate complexity. - -**Result: one Instantiation connective with unambiguous -semantics (type parameterization only).** Value construction -stays in the Conj family, inhabitance-for-aliases collapses into -Instantiation naturally, and the optional `inhabits` edge covers -the rare secondary case. No three-variant coproduct, no hidden -overload. - -### Q1: What does Instantiation actually hold structurally? - -**Answer: lazy substitution with shared templates.** - -`Instantiation { template: DeclarationId, arguments: Vec }`. -Using C++ vocabulary: `template` is the parameterized declaration -being instantiated (the `template class X { ... }` -side); `arguments` is the list of template arguments (the -`X` side). Each `TemplateArgument` pairs a template -parameter (a TypeParam Atom in the template declaration) with a -concrete type reference. - -The template is shared; substitution happens at walk time, not at -declaration time. Int and UInt both reference the same OrderedRing -template, with different arguments. Each walker carries a -substitution stack and resolves parameter references on demand. - -**Why lazy over eager.** Eager substitution (copying the template and -replacing parameter atoms with their values) is simpler for a first pass -but: - -1. Memory waste — each instantiation allocates a full copy of the template. -2. Sharing loss — the structural fact "Int and UInt both inhabit the same - algebra" is not visible in the Node graph. -3. Diagnostic degradation — when inference fails on `Int.add`, the error - context points at an anonymous substituted copy instead of "OrderedRing's - `add` specialized with T := Word64." - -Lazy substitution preserves all three properties at the cost of a small -substitution-stack overhead during walks. That overhead is O(declaration -depth), not O(user program size). - -**Memoization is a lens concern, not substrate.** If walking the same -Instantiation repeatedly becomes hot, lenses can cache — but that's a -lens-level optimization, not a substrate decision. - -### Q2: How is `inhabits` realized? - -**Answer: Instantiation is the primary realization; the secondary `inhabits` -edge is a slot held open for forward compatibility.** - -For pure aliases like `Int = OrderedRing`, Int's Node has -`connective: Instantiation { template: OrderedRing, bindings: [T := Word64] }`. -There is NO separate "Int declaration with an inhabits edge pointing at -an Instantiation Node." The collapse is honest because Int has no structure -of its own beyond the inhabitance — it's a pure alias. - -`Declaration.inhabits: Option` is reserved for the rarer -case where a declaration has its own primary structure AND inhabits -something additional. Example (not in scope for M1(2.5)): - -```dag -type Money { - value: Float - currency: Currency -} -// Money primarily is a Conj, AND additionally inhabits CurrencyLattice -``` - -In that case Money's primary connective is Conj, and `inhabits` holds an -optional reference to the additional semantic layer. At M1(2.5) this slot -stays empty for every declaration in `algebra.dag` and `shell.dag`; it -exists for forward compatibility without adding substrate complexity. - -**No separate "kind" field beyond the connective enum.** The connective -variant IS the kind. - -### Q3: How are type parameters (``) represented at the substrate level? - -**Answer: Type parameters are Atom declarations with a TypeParam payload. -No new connective.** - -A parameterized declaration lists its parameters as children of its Conj. -The children whose target's connective is `Atom(TypeParam(_))` are the -parameters; the rest are the declaration's "real" content. Example: - -``` -Declaration: Magma - connective: Conj { - children: [ - Field { label: "T", ty: DeclarationId(T_param) }, - Field { label: "op", ty: DeclarationId(op_arrow) }, - ] - } - -Declaration: T_param - connective: Atom(TypeParam("T")) - -Declaration: op_arrow - connective: Arrow { - inputs: [DeclarationId(T_ref), DeclarationId(T_ref)], - output: DeclarationId(T_ref), - body: None, // algebra field, no body - } - -Declaration: T_ref - connective: Atom(Identifier { name: "T", resolved: Some(T_param) }) -``` - -`T_param` is the parameter's declaration site; `T_ref` is a reference -to it from inside the body. The parser produces both; name resolution -links identifier atoms to their target declarations. - -The distinction between "parameter child" and "field child" is -determined by walking to the target and checking its connective — no -metadata on the `Field` edge, no separate parameter list. A walker that -wants to enumerate parameters filters `children` to those whose target -is `Atom(TypeParam(_))`. - -**No seventh connective.** Type parameters reuse the Atom primitive with -a specialized payload. - -### Q4: Where does parameter-to-value substitution actually happen? - -**Answer: Lazy at walk time via a substitution stack.** - -```rust -struct SubstStack { - frames: Vec>, -} - -impl SubstStack { - fn lookup(&self, param: DeclarationId) -> Option { - // Walk frames top-down, return first matching binding. - for frame in self.frames.iter().rev() { - for binding in frame { - if binding.parameter == param { - return Some(binding.value); - } - } - } - None - } - - fn push(&mut self, bindings: Vec) { - self.frames.push(bindings); - } - - fn pop(&mut self) { - self.frames.pop(); - } -} - -fn walk(dag: &Dag, id: DeclarationId, subst: &mut SubstStack) -> /* result */ { - let decl = dag.declaration(id); - match &decl.connective { - TypeConnective::Atom(AtomPayload::Identifier { resolved: Some(tgt), .. }) => { - // If the target is a TypeParam and we have a binding for it, - // follow the binding instead of the param. - if let Some(bound) = subst.lookup(*tgt) { - walk(dag, bound, subst) - } else { - walk(dag, *tgt, subst) - } - } - TypeConnective::Instantiation { template, bindings } => { - subst.push(bindings.clone()); - let result = walk(dag, *template, subst); - subst.pop(); - result - } - TypeConnective::Conj { children } => { - for field in children { - walk(dag, field.ty, subst); - } - // ... - } - // ... similar for Disj, Arrow, Cardinality, Atom - } -} -``` - -Inference and emission both carry their own `SubstStack` during walks. -The substrate stores no substitution state; every walker pushes/pops as -it enters/exits Instantiation nodes. - -**Why not lowering-time substitution?** Lowering-time would produce a -fully-specialized tree for each Instantiation, losing sharing and diagnostic -provenance. See Q1 rationale. - -### Q5: Cardinality's scope — does it subsume v2's Required/Optional? - -**Answer: Yes, with three distinct bound variants at M1(2.5).** - -v2's `constructors.dag` has `Required | Optional` as a flat enum -on binding sites. In v3's substrate, all presence/repetition -shapes become variants of `CardinalityBound`: - -- `Required` = `Cardinality { element: T, bound: Exact(1) }`. -- `Optional` (`T?`) = `Cardinality { element: T, bound: AtMostOne }`. -- `List` = `Cardinality { element: T, bound: Unbounded }`. -- `[T; n]` fixed array = `Cardinality { element: T, bound: Exact(n) }`. -- `argv: ["sh", "-lc", "{script}"]` = `Cardinality { element: String, bound: Exact(3) }` - with children inlined (implementation detail). - -**M1(2.5) commits to three bound variants: `Exact(u32)`, -`AtMostOne`, and `Unbounded`.** Range / AtLeast(n) / AtMost(n) -are deferred until a real oracle needs them (neither -`algebra.dag` nor minimal `shell.dag` does). - -**Why AtMostOne is in scope from the start.** Collapsing -Optional into Unbounded (as earlier drafts proposed) lets -"0..1" and "0..n" be represented by the same shape — which -means a `T?` value and a `List` value would be -structurally indistinguishable. That's an illegal-states- -unrepresentable violation: the substrate would admit shapes -("a List where we forgot the upper bound was 1") that should -not exist. `AtMostOne` as a dedicated variant keeps the -distinction structural. - -**Optional syntax IS in scope for M1(2.5)** — `T?` parses to -`AtMostOne`. No deferral. - -### Q6: How do Arrow bodies cross into the computation substrate? - -**Answer: Separate tables with separate ID types, referenced by -typed edges. `DeclarationId` and `NodeId` are distinct newtypes; -`declarations` and `nodes` are distinct tables on `Dag`.** - -The two substrates live in separate tables of the same Dag -struct. Each has its own stable ID type. Crossings between them -are **typed edges** (DeclarationId from one side, NodeId from -the other), not shared ID spaces. - -```rust -pub struct Dag { - // Type substrate — declarations (Conj/Disj/Arrow/etc. shapes). - declarations: Vec, - // Computation substrate — L1 behavior nodes, unchanged from M0. - nodes: Vec, - // Ports carry typed values through the computation graph. - ports: Vec, - - // Name resolution, diagnostics, etc. - named: HashMap, - diagnostics: DiagnosticTable, -} - -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -pub struct DeclarationId(u32); // index into Dag::declarations - -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -pub struct NodeId(u32); // index into Dag::nodes -``` - -**Two typed crossings connect the substrates:** - -1. **`Transform::target: FunctionRef(DeclarationId)`** — a - Transform node in the computation substrate holds a - `FunctionRef` wrapping a `DeclarationId`. The DeclarationId - points at an Arrow declaration in the type substrate, which - has the function's signature. Inference uses this crossing - to type-check the Transform. - -2. **`Arrow::body: ArrowBody`** — an Arrow declaration in the - type substrate holds an `ArrowBody` tag (see §3's data model - and Q7). For user functions the variant is - `UserDefined(NodeId)` pointing at the root of the function's - computation sub-DAG. For primitives whose realization lives - in an extdeps language spec the variant is - `ExternalRealization(DeclarationId)` pointing at the realization - declaration. For algebras at M1(2.5) bootstrap (before extdeps - language specs are loaded) the variant is `Pending`, a - scaffolded state with a CI ratchet enforcing resolution to - one of the other two variants before M3 completes. All three - variants are typed edges; no name-based lookup. See Q7. - -**Keeping `DeclarationId` and `NodeId` as separate newtypes -prevents cross-substrate ID mixing bugs.** A function that -expects a `NodeId` can't be passed a `DeclarationId`; the type -system catches the error at compile time. The "two substrates, -two meeting points" framing is preserved both conceptually AND -in the type system — the two ID types are the structural -evidence that the substrates are distinct. - -### Q7: How do primitive Arrows express their realization? - -**Answer: via a typed `realization` edge on Arrow, not by name -lookup. `body` and `realization` are two separate fields on -Arrow. Exactly one of them must be present post-bootstrap.** - -Earlier drafts of this section said "primitive Arrows have -`body: None`, and the emitter recovers the realization by name -from extdeps." That resurrected exactly the kind of name-based -special-case lookup the thesis forbids: a concept whose -realization is reached via a hardcoded path outside the substrate -is an ungrounded concept (the escape from the epistemic chain). -Fix: primitive Arrows point at a **realization declaration** -via a typed edge in the same way user functions point at a body. - -Revised Arrow shape: - -```rust -TypeConnective::Arrow { - inputs: Vec, - output: DeclarationId, - /// Either the realization is defined in user source (as a - /// sub-DAG of computation nodes) OR it's declared in an - /// extdeps/ language spec (as a Declaration that the - /// language spec references). Exactly one variant is - /// present post-bootstrap; both None at M1(2.5) for - /// algebras whose extdeps realization hasn't been - /// declared yet. - body: ArrowBody, -} - -#[derive(Debug, Clone)] -pub enum ArrowBody { - /// User function. The referenced NodeId is the root of a - /// computation sub-DAG (Value/Transform/Branch/Loop/Bind). - UserDefined(NodeId), - /// Realization declared in a language spec. The - /// DeclarationId points at a Realization declaration in - /// dsl/extdeps/languages/.dag. The language spec - /// declaration is an ordinary Declaration in the type - /// substrate, reached by a typed edge like any other - /// declaration. Inference can follow the edge to the - /// realization and check that the declared signature - /// matches. - ExternalRealization(DeclarationId), - /// Bootstrap state: neither user body nor extdeps - /// realization declared yet. Legal ONLY during M1(2.5) - /// bootstrap while std/algebra.dag is loaded without - /// extdeps/languages/*.dag yet. Inference must accept - /// body: Pending for primitive Arrows whose signatures - /// resolve via inhabitance. A post-bootstrap sweep - /// ratchets "no Pending remains once extdeps are wired." - Pending, - /// Surface-grammar scaffold: the arrow's signature is - /// resolved and callers can type-check against it, but - /// the body source is not yet parseable under the - /// M1(2.7) surface grammar. Used by block-bodied fn - /// declarations in std/ files whose bodies contain - /// match/pipe/lambda/etc. The SourceSpan points at the - /// unparsed body range so M2+ can complete the lowering. - /// Dissolves when the surface grammar adopts those forms. - /// - /// **NOTE (post-M1(2.7) cleanup):** this variant was added - /// in M1(2.7) as a structural honesty measure — it surfaces - /// the fact "parser can't parse this body" into the - /// substrate instead of silently dropping declarations. - /// It is NOT yet sanctioned by `INVARIANTS.md` §"No short- - /// term solutions" (which currently sanctions only - /// `Pending` for primitive realization lag). Resolution - /// requires either extending INVARIANTS.md with a parallel - /// exception + numeric ratchet, extending the grammar so - /// match/pipe/lambda parse, or rewriting affected std/ - /// functions. - Unparsed(SourceSpan), -} -``` - -**Why `Pending` is a scaffolded state, not a forever-legal one.** -At M1(2.5), std/algebra.dag declares `Magma.op`, `Ring.add`, -etc., as Arrows. Their *signatures* are well-defined (they -resolve through inhabitance via the substitution stack). Their -*realizations* — what these operations map onto in Rust / Python -/ Go — need `src/v3/spec/rust.dag` and friends to -declare the target mapping, and those files don't exist yet. -`Pending` names the state "this Arrow has a valid static -grounding via inhabitance, but no realization declaration has -been loaded." It is explicitly scaffolded: a CI-enforced -monotonic-decrease ratchet (see §8.11 for the specification; -distinct from §8.10's substrate-extension audit) requires that -every commit after M1(2.5) either preserves or reduces the -count of Pending Arrows in the loaded declaration table, until -the count reaches zero by M3. - -**Dissolution ledger entry (updated post-M1(2.7)).** ArrowBody is -a **4-variant** coproduct that MIXES two terminal semantic cases -(`UserDefined`, `ExternalRealization`) with **two scaffolded-state -cases** (`Pending`, `Unparsed`). This is a mixed-lifecycle -coproduct: both scaffold variants are expected to dissolve out -of the variant set, leaving only the two terminal cases. The -§"Structural decompression" four-pattern check classifies -ArrowBody as follows: - -- **Pattern 1 (fact placement)**: fails — UserDefined and - ExternalRealization are Arrow-level facts with different - structural targets (NodeId vs DeclarationId); scattering is - not simplification. -- **Pattern 2 (variant-is-data)**: fails — the two terminal - cases point at structurally different substrates. -- **Pattern 3 (algebraic form)**: partial — both terminal cases - are forms of "Arrow realization reference," but the reference - types are different enough that collapsing would require - introducing a sum of NodeId/DeclarationId (which would be a - worse coproduct, not a better one). -- **Pattern 4 (dimensional)**: fails — there is no shared - coordinate space underlying the two terminal cases. - -ArrowBody's **terminal form is 2 variants** (UserDefined, -ExternalRealization). `Pending` and `Unparsed` are transient -variants tracked separately by dissolution trigger: - -- **`Pending`** — primitive realization lag. Sanctioned by - `INVARIANTS.md#p5-progress-is-dissolution` as a named scaffold with a - dissolution trigger. - Dissolution trigger: §8.11 monotonic-decrease ratchet; - reaches zero when every primitive Arrow has an - `ExternalRealization(decl_id)` pointing at a realization - declaration in `dsl/extdeps/languages/.dag`. -- **`Unparsed(SourceSpan)`** — surface-grammar scaffold, added - in M1(2.7). **Not currently sanctioned by INVARIANTS.md.** - The invariant file lists only two sanctioned exceptions - (emission via language spec, `Pending` for primitive - realization lag) — `Unparsed` is a third category that - surfaced in M1(2.7) and needs explicit resolution: either - (a) extend `INVARIANTS.md` with a parallel exception + numeric - ratchet whose dissolution trigger is "M2 grammar extension - parses match/pipe/lambda," or (b) extend the grammar, or (c) - rewrite affected std/ functions to fit the current grammar. - -Once both ratchets reach zero, the enum becomes 2 variants -(terminal form) via a substrate-extension PR (reverse of §8.10's -check). - -**This matches `body` for user functions.** A `UserDefined` -body is a `NodeId` into the computation substrate — a typed -edge, not a name lookup. An `ExternalRealization` is a -`DeclarationId` into another declaration in the type substrate -(in `dsl/extdeps/languages/.dag`) — also a typed edge, -also not a name lookup. Both are structural; both are walkable -by any consumer without name resolution. - -**Inference handling (post-M1(2.7), 4-variant match):** - -- `UserDefined(node_id)`: type-check the sub-DAG body against - the declared input/output types. -- `ExternalRealization(decl_id)`: walk the realization - declaration, verify its declared signature is compatible - with this Arrow's signature. -- `Pending`: accept as realization-pending; the signature - type-checks via inhabitance. Emission of this Arrow - requires the `Pending` to resolve before the emitter runs. -- `Unparsed(span)`: accept at signature-check time; the - signature type-checks against the declared inputs/output. - Body-walking is skipped. Emission MUST fail closed — - an `Unparsed` body cannot be lowered to target source - because its body is literally unparsed. The failure is - enforced at `emit.rs` in PR-B by exhaustive match on - `ArrowBody` with both `Pending` and `Unparsed` as - fail-closed arms. - -**For M1(2.5):** primitive Arrows in algebra.dag land with -`body: Pending`. Inference treats them as ok-for-signature- -checking but not-yet-emittable. The substrate test -`parse_std_algebra_and_walk_int_add` validates that inhabitance -walk produces the correct Arrow type even with Pending bodies. - -**The "no concept is opaque" stop signal applies fully.** An -Arrow whose realization is reached via a hardcoded path outside -the substrate (e.g., a Rust function inside the compiler that -the emitter calls by name when it sees this Arrow) IS ungrounded -and is a thesis violation. The `ArrowBody` enum forces -realization to be either a sub-DAG or a typed reference to -another Declaration — both walkable, both structural, neither -an escape hatch. - -## 5. `dsl/std/algebra.dag` mapping (substrate test oracle #1) - -Walk the first five algebras onto the data model. The remaining -structures (CommutativeMonoid, Group, AbelianGroup, Semiring, Ring, -OrderedRing, Field, Lattice, BoundedLattice, BooleanAlgebra, FreeMonoid, -PartialFunction) follow the same pattern. - -### Magma - -``` -Magma: - connective: Conj { - children: [ - Field { label: "T", ty: Magma_T_param }, - Field { label: "op", ty: Magma_op_arrow }, - ] - } - -Magma_T_param: - connective: Atom(TypeParam("T")) - -Magma_op_arrow: - connective: Arrow { - inputs: [Magma_T_ref1, Magma_T_ref2], - output: Magma_T_ref3, - body: None, - } - -Magma_T_ref1, Magma_T_ref2, Magma_T_ref3: - connective: Atom(Identifier { name: "T", resolved: Some(Magma_T_param) }) -``` - -Six declarations: one Conj, one TypeParam Atom, one Arrow, three -Identifier Atoms. No new primitives. The identifier atoms could be -collapsed into shared references during interning; that's an -implementation-side optimization, not a substrate decision. - -### Semigroup - -Semigroup adds associativity as a law — a property of the algebra, not -a declared field. In the substrate, associativity is NOT a child. -Semigroup's declaration is structurally identical to Magma's Conj -shape; the associativity property is asserted by inference rules that -inspect `inhabits` chains and apply rewrite rules. - -**M1(2.5) does not implement law checking.** Semigroup's declaration -lands as a Conj with the same `op` child. Associativity becomes -relevant when algebraic-simplification lenses are built — deferred. - -### Monoid - -``` -Monoid: - connective: Conj { - children: [ - Field { label: "T", ty: Monoid_T_param }, - Field { label: "op", ty: Monoid_op_arrow }, - Field { label: "identity", ty: Monoid_identity_ref }, - ] - } - -Monoid_T_param: Atom(TypeParam("T")) -Monoid_op_arrow: Arrow { inputs: [T, T], output: T, body: Pending } -Monoid_identity_ref: Atom(Identifier { name: "T", resolved: Some(Monoid_T_param) }) -``` - -**Level note (Field vs value).** The Monoid declaration's -`identity` child is a `Field`, not a value itself. The `Field`'s -`ty` edge points at the T parameter declaration — i.e., "this -field's TYPE is T." At runtime, a specific Monoid inhabitant -(e.g., "additive monoid on Int") provides a concrete T value -(e.g., `0`) that fills the identity slot. This matches the C++ -analogue exactly: `template struct Monoid { T op; -T identity; };` declares `identity` as a member of type T; the -T in that position is a type, not a value, and the member slot -holds a T-value at runtime. The Monoid declaration is the -shape-level statement ("every Monoid has an identity field of -type T"); concrete identity values come from witnesses at -instantiation time (a design concern deferred to realization -work, not M1(2.5) substrate shape). - -`identity` resolves at inference time to a field whose type is -whatever T is bound to in the current Instantiation (e.g., Int -for `Monoid`). - -### Ring - -``` -Ring: - connective: Conj { - children: [ - Field { "T", Ring_T_param }, - Field { "add", Ring_add_arrow }, // Arrow(T, T, T) - Field { "zero", Ring_T_ref_zero }, - Field { "negate", Ring_negate_arrow }, // Arrow(T, T) - Field { "mul", Ring_mul_arrow }, // Arrow(T, T, T) - Field { "one", Ring_T_ref_one }, - ] - } -``` - -Six children — one parameter, four Arrow-valued fields (add, negate, -mul), and two Atom-valued fields (zero, one). Same pattern as Monoid, -just more fields. - -### OrderedRing - -Extends Ring with `compare` (an Arrow returning an `Ordering` Disj), -`quotient`, `remainder`. Same shape pattern. - -### Int — the inhabiting instance - -``` -Int: - connective: Instantiation { - template: OrderedRing, - bindings: [ - TemplateArgument { - parameter: OrderedRing_T_param, - value: Word64, - } - ] - } -``` - -Walking `Int.add`: - -1. Start at `Int` — `Instantiation` connective. -2. Push `[T := Word64]` onto substitution stack. -3. Walk to template `OrderedRing` — `Conj` connective. -4. Find child `"add"` — points at `OrderedRing.add` which is an Arrow - declaration. -5. Walk the Arrow's inputs: each is an Atom(Identifier) resolving to - `OrderedRing_T_param`. -6. Look up `OrderedRing_T_param` in substitution stack → find `Word64`. -7. Substitute each input/output with `Word64`. -8. Yield `Arrow { inputs: [Word64, Word64], output: Word64, body: Pending }`. -9. Pop substitution frame on exit. - -**Pure structural walk. No hardcoded knowledge of Int, Ring, add, or -Word64.** The compiler doesn't know what "add" means — it just finds -the child labeled "add" and returns its Arrow type with parameters -substituted. - -**Substrate test `parse_std_algebra_and_walk_int_add` passes** when -this walk produces `Arrow(Word64, Word64, Word64)` as the type of -`Int.add` from an empty compiler state parsing only `std/algebra.dag` -+ the `Int = OrderedRing` declaration. - -## 6. Nested-domain-model oracle #2 (synthetic) - -**Scope note:** M1(2.5) does NOT aim for full fidelity against -`dsl/extdeps/shell.dag` as-is. That file has structure we are -not ready to host yet: a `transport_shell_template` with its own -declaration (which lives in `dsl/extdeps/transports/shell.dag` — -not currently declared in the project), `exit` branches (which -use Disj with payloads and need the sum-type parser extensions), -and `mock_response` tables (which need literal-record construction). - -**Instead:** oracle #2 is a **synthetic nested-domain model** -that exercises the same substrate shapes `shell.Exec.Run` would -exercise, without inheriting v2's specific extdeps declarations -we haven't staged yet. The synthetic model is defined inline in -the M1(2.5) test source: - -```dag -// Test-only declaration. Exercises the nested-domain shape -// (Conj-of-Conj-of-field-values-with-inhabits-tags) that shell.dag -// uses, without importing shell.dag itself. - -type SyntheticService { - operations: Conj // labeled-operation container -} - -type SyntheticOperation { - input: Conj // labeled-field record - output: Conj - arguments: List -} - -// An instance of the synthetic service — what the test parses. -service CmdExec: SyntheticService { - operation Run: SyntheticOperation { - input { script: String } - output { stdout: String; stderr: String; exit_code: Int } - arguments: ["sh", "-lc", "{script}"] - } -} -``` - -All nested Conj compositions, no new connectives, no references -to un-declared v2 files. This subset exercises: - -- Nested Conj (service → operations → operation → input/output). -- `inhabits` tags on the service/operation Conjs pointing at the - meta-type declarations (`SyntheticService`, `SyntheticOperation`). -- Cardinality with `Exact(3)` for the argument list literal. -- String literal Atoms as leaves. -- Value-construction via Conj-with-field-values (NOT Instantiation — - see Q0 and BI-1). - -Parsed into the substrate: - -``` -CmdExec: - connective: Conj - inhabits: Some(SyntheticService_decl) - children: [ - Field { label: "operations", ty: CmdExec_operations } - ] - -CmdExec_operations: - connective: Conj - children: [ - Field { label: "Run", ty: CmdExec_Run } - ] - -CmdExec_Run: - connective: Conj - inhabits: Some(SyntheticOperation_decl) - children: [ - Field { label: "input", ty: Run_input }, - Field { label: "output", ty: Run_output }, - Field { label: "arguments", ty: Run_args }, - ] - -Run_input: - connective: Conj - children: [ - Field { label: "script", ty: String_decl } - ] - -Run_output: - connective: Conj - children: [ - Field { label: "stdout", ty: String_decl }, - Field { label: "stderr", ty: String_decl }, - Field { label: "exit_code", ty: Int_decl }, - ] - -Run_args: - connective: Cardinality { - element: String_decl, - bound: Exact(3), - } -``` - -Five levels of nesting: -1. service (Conj with inhabits) -2. operations container (Conj) -3. operation Run (Conj with inhabits) -4. input / output / arguments members (Conj or Cardinality) -5. scalar fields and literal atoms (Atom) - -Every level maps onto the six-connective shape. **No new -connective variants needed.** The `inhabits` tag provides the -"this Conj satisfies this meta-type" semantics without any -special Service/Operation connective. - -**Substrate test `parse_synthetic_service_all_layers` passes** when -parsing this subset produces the above Declaration tree with no -extension to the connective enum. - -**Scope of the synthetic oracle.** The synthetic oracle is a -**static substrate shape test**, not an end-to-end execution -test. It validates that: - -- The parser can produce a nested-Conj Declaration tree at this - shape. -- Name resolution correctly links identifier atoms to their - target declarations (`SyntheticService`, `SyntheticOperation`, - `String`, `Int`, `Bool`). -- Inference walks the tree without panicking and type-checks the - Conj-with-meta-tag shape against the meta-type's declared - field layout. - -It does NOT validate: - -- That the declared structure corresponds to real external - behavior (there is no real `CmdExec` service to run). -- That emission produces working target code (emission is M1(4)+). -- That a language-spec realization exists for the operation - (realization is M1(3)+). -- That runtime primitives invoke it correctly. - -Those validations are end-to-end consumer concerns that arrive -later. The synthetic oracle is deliberately scoped to the -substrate-shape layer only. See §6.5 below for the one smoke -test that does exercise a minimal end-to-end realization path. - -**Why synthetic rather than the real shell.dag:** full shell.dag -fidelity requires the extdeps/transports layer, sum-type payloads -(for `exit`), and literal record construction (for `mock_response`) -— all of which are genuine substrate exercises but add scope -beyond what's needed to prove the substrate shape is right. The -synthetic oracle tests the shapes that shell.dag uses without -inheriting its specific external dependencies. Full shell.dag -adoption is a follow-up milestone (M1(2.6) or M2) that lands -after extdeps/transports exists as a declared .dag subtree. - -## 6.5 Realization smoke test (end-to-end spot check) - -The static oracles in §5 and §6 prove the substrate shape hosts -the required compositions. They do NOT prove that the -`ExternalRealization` path in `ArrowBody` actually wires through -inference and connects a primitive Arrow to a realization -declaration. That path is the one piece of M1(2.5)'s realization -story that has to exist in Rust for the M3 `.dag` rewrite to be -mechanical translation; leaving it entirely unvalidated would -let realization-entanglement issues surface late. - -**The smoke test** is a small, self-contained validation of the -ExternalRealization path: - -1. Bootstrap parses `dsl/std/logic.dag`, `dsl/std/bit.dag`, - `dsl/std/algebra.dag`, `dsl/std/types.dag` as normal - (producing primitive Arrows with `body: Pending`). -2. **Additionally**, bootstrap parses a one-file stub - `src/v3/spec/rust.dag` that declares exactly ONE - realization: `Int64.add` maps to the Rust `i64::wrapping_add` - intrinsic. The stub is a Conj declaration: - - ```dag - module extdeps.languages.rust - - import std.integer { Int64 } - - realization Int64_add { - for: Int64.add // the .dag concept being realized - target: rust // language target - body: "i64::wrapping_add" // target-specific identifier - } - ``` - -3. After bootstrap, the `Int64.add` Arrow's `body` field is - **`ExternalRealization(Int64_add_decl_id)`** instead of - `Pending`. The inference pass must treat this as a valid - realization and walk the declaration to verify signature - compatibility. -4. A new test `smoke_int_add_external_realization` asserts: - - Int64.add's Arrow body is `ExternalRealization(_)` after - bootstrap, not `Pending`. - - The referenced Declaration is reachable by walking the - DeclarationId. - - The referenced Declaration's `target` field is the - `rust` Atom (validates the typed edge, not a name lookup). - - Inference accepts the Arrow as ready-for-emission. - -**Scope:** one language-spec stub declaration, one realization -entry, one test. The `realization` meta-type declaration itself -must land as a Conj declaration in std/ or extdeps/ as part of -this work — expect ~30 lines of declarative `.dag` plus a -~20-line Rust test. Total: ~1-2 hours beyond the main M1(2.5) -scope. - -**Why this is in scope for M1(2.5) despite being deferred -elsewhere.** M1(2.5)'s job is to pin down the substrate shape -so that M3 (the `.dag` rewrite) is mechanical translation. The -`ArrowBody::ExternalRealization` variant is part of the substrate -shape commitment; having zero tests for it at M1(2.5) means the -first code path that exercises it lands at M1(3)+ and might -discover shape problems that force substrate changes — exactly -the retrofit debt this milestone is meant to prevent. One smoke -test closes this risk without pulling in a full rust.dag. - -**What this smoke test does NOT do.** It does not emit actual -Rust code, does not execute anything, does not provide a real -runtime. It just proves that the `ExternalRealization` path -walks cleanly through inference. Emission of the walked result -is M1(4) work. - -## 7. Implementation plan - -Focused, small, one PR. No scope creep. - -### File-by-file - -| File | Action | Est. time | -|---|---|---| -| `src/v3/compiler/src/dag.rs` | Replace `DeclKind::{Type, Function}` with the `TypeConnective` enum + `Declaration` / `Field` / `AtomPayload` / `CardinalityBound` / `TemplateArgument` data model from §3. Keep `DeclarationId`, `Dag`, bootstrap entry. | ~1.5h | -| `src/v3/compiler/src/tokenize.rs` | Minor — add `<` and `>` as type-parameter delimiters, `|` as top-level sum-type separator, `fn(...)` arrow-type prefix if needed. | ~30m | -| `src/v3/compiler/src/parse.rs` | Extensions per §8: `type Foo { ... }` into Conj with TypeParam children (§8.2/8.3); `type Foo = Bar` into Instantiation (§Q0); `type Name = A \| B(payload)` into Disj with payload variants (§8.7); `fn(A, B) -> C` as type-position expression (§8.8); infix operators as Conj-with-function-label (§8.9). Drop the flat `fn std::int::add(...)` primitive-signature shortcut. | ~4h | -| `src/v3/compiler/src/lower.rs` | Two-pass lowering: (1) collect declaration names into symbol table; (2) resolve Identifier atoms and build the connective tree (§8.1). Handle substitution scopes for parameterized declarations. | ~2h | -| `src/v3/compiler/src/infer.rs` | Replace old `DeclKind` dispatch with connective-pattern walks. Implement `SubstStack` per §8.4 (`Vec>`). Lazy substitution at walk time. Handle `ArrowBody::Pending` as realization-pending (signature type-checks via inhabitance, body-checking skipped) per §Q7. Handle `ArrowBody::ExternalRealization(decl_id)` by walking the realization declaration and verifying signature compatibility. Inference resolves `Int.add` by walking the inhabits chain through OrderedRing and substituting. | ~3h | -| `src/v3/compiler/tests/m0_acceptance.rs` | Update test helpers to build connective nodes. Semantics unchanged; all 40 M0 tests should pass against the new shape. | ~1h | -| `dsl/std/core.dag` | DELETE per-primitive function declarations (`fn std::int::add` etc.). They become inhabitance-derived via OrderedRing. | ~5m | -| `dsl/std/logic.dag` | VERIFY or CREATE. Parse Bit = Disj{On, Off} and True/False Atoms per §8.6. Stub file if v2 doesn't have one. | ~15m | -| `dsl/std/bit.dag` | VERIFY Word8/16/32/64 declarations work against the new parser. | ~15m | -| `dsl/std/algebra.dag` | VERIFY it parses into the new substrate. No file content changes — the file's shape is already right; just bring it into the bootstrap path. | ~15m | -| `dsl/std/types.dag` | VERIFY Int = OrderedRing, Bool = Classical, String = FreeMonoid all parse as Instantiation declarations. | ~15m | -| `src/v3/compiler/src/bootstrap.rs` | NEW or UPDATE. Parse logic.dag → bit.dag → algebra.dag → types.dag in order at `Dag::new()` time (§8.6). | ~1h | -| `src/v3/compiler/tests/m1_substrate_test.rs` | NEW. Three test cases: `parse_std_algebra_and_walk_int_add`, `parse_synthetic_service_all_layers`, and `smoke_int_add_external_realization` (§6.5). | ~2h | -| `src/v3/spec/rust.dag` | NEW stub. One-file declaration containing the `realization` meta-type declaration and one concrete `realization Int64_add { for: Int64.add; target: rust; body: "i64::wrapping_add" }` entry. Parsed during bootstrap as part of §8.6's file order. | ~30m | - -**Total estimate: 14–16 hours.** Scope expanded from original -10–12h estimate after the review pass identified additional -parser work (operator dispatch, Arrow-in-type-position, sum types -with payloads) and bootstrap reordering. Still a single focused -PR — the work is tightly coupled and splitting it would leave the -tree in an incoherent state between PRs. - -### Acceptance gates (CI must show all green) - -1. **`cargo test -p v3-compiler`** — all 40 M0 tests pass unchanged. -2. **`parse_std_algebra_and_walk_int_add`** — parse `std/algebra.dag`, - declare `Int = OrderedRing`, walk `Int.add`, assert the - result is `Arrow { inputs: [Word64, Word64], output: Word64, - body: Pending }`. -3. **`parse_synthetic_service_all_layers`** — parse the synthetic - nested-domain model from §6, assert the Declaration tree - structure matches. Static substrate shape test — see §6 "Scope - of the synthetic oracle" for what this does and doesn't validate. -4. **`smoke_int_add_external_realization`** (§6.5) — parse the - one-entry `src/v3/spec/rust.dag` stub, assert that - `Int64.add`'s Arrow body resolves to - `ExternalRealization(_)` (not `Pending`), walk the referenced - declaration, and confirm inference accepts the Arrow as - ready-for-emission. The only end-to-end validation in - M1(2.5); closes the realization-entanglement risk. -5. **`cargo clippy -p v3-compiler --all-targets -- -D warnings`** — - clean. -6. **Substrate audit:** grep `TypeConnective::` variants in the M1 - code; confirm only the six variants from §3 exist. No - `DeclKind::Service`, `DeclKind::Operation`, etc. variants were - added. Extension stop signal holds. - -### Explicit non-goals for M1(2.5) - -- **Cost lens.** Deferred to M1(3). The substrate is ready for it - after M1(2.5) lands; the lens is a separate PR. -- **Single Rust emitter.** Deferred to M1(4). -- **Unification (five behaviors → patterns over type substrate).** - Deferred per convergence note. Revisit after M1(2.5) ships. -- **Three-primitive reduction (Atom/Conj/Disj only).** Deferred per - convergence note. -- **`dsl/std/meta.dag` first-class named patterns.** Deferred until a - second consumer appears. -- **`exit` and `mock_response` in shell.dag.** Follow-up — adds Disj - complexity that's not needed to verify the substrate test. -- **Law verification (associativity, commutativity, etc.).** Deferred - to the algebraic-simplification lens work. -- **Omni-emission projection rules.** Deferred until emitter. -- **Interpreter.** Deferred. -- **Sum types beyond minimal Disj parsing.** M1(2.5) needs to parse - `type Result = Ok(T) | Err(E)` but does not need to check - exhaustiveness against Branch cases at inference time (M0's current - exhaustiveness check still works against the new shape). - -## 8. Sub-decisions committed - -Small-but-real decisions that affect implementation mechanics. -These were open questions in earlier drafts; post-review they are -committed answers. If any is wrong, fix it here before code. - -### 8.1: Identifier resolution timing — **lowering-time** - -Resolve all `Atom(Identifier { resolved: None, .. })` to -`Some(DeclarationId)` during `lower.rs`. Post-lowering, every -Identifier Atom carries its target reference. Simpler; matches -M0's single-pass approach. Forward references are handled by a -two-pass lowering (first pass collects declaration names; second -pass resolves identifiers against the name table). - -### 8.2: Parameter child enumeration — **filter by target connective** - -A walker enumerates parameters by filtering `Conj::children` to -those whose target Declaration has connective -`Atom(TypeParam(_))`. No metadata on the `Field` edge. The walk -cost is negligible compared to inference, and not adding metadata -keeps the substrate minimal. - -### 8.3: Shared parameter Atom identity — **one Atom per parameter, referenced multiply** - -In `type Monoid { op: fn(T, T) -> T; identity: T }`, there are -four structural references to `T`. They all resolve to **one** -Atom Node — the `T` parameter declaration. References are via -`DeclarationId`, not owned subtrees. This means the substrate is -technically a **DAG of declarations**, not a tree — one Atom can -be pointed at by many edges. - -**Why**: substitution touches one site. Diagnostic provenance -points back to the same parameter declaration regardless of -which reference triggered the error. Matches the "single source -of truth" principle — T is one thing, referenced four times, not -four independent T-looking atoms. - -**Implementation**: `Field::ty: DeclarationId` is a pointer, not -an owned subtree. The Declaration table owns each declaration -once; edges are pointers. - -### 8.4: `SubstStack` data structure — **Vec>** - -Simple linear-scan stack. Typical stack depth is 1–3, typical -arguments per frame is 1–2, so linear scan is ~6 comparisons max -— cheaper than hashing. Revisit to HashMap-per-frame only if -profiling shows it's hot. - -### 8.5: `Cardinality` parse syntax — **both forms** - -`List` parses to `Cardinality { element: T, bound: Unbounded }`. -`[T; 3]` (or similar fixed-size syntax) parses to `Cardinality { -element: T, bound: Exact(3) }`. Surface syntax covers both. -`argv: ["sh", "-lc", "{script}"]` in shell.dag produces a -Cardinality literal with `Exact(3)` and inline String-Atom -children. - -### 8.6: Bootstrap file order — **logic → bit → algebra → types → realization stub → user** - -`Dag::new()` parses in this order, synchronously, before any -user source: - -1. **`dsl/std/logic.dag`** — Classical, Bit, True/False. If v2 - doesn't have this file yet, declare Bit inline in the - compiler's bootstrap and parse a stub logic.dag containing - only the Bit declaration. (Small open question: does v2's - current logic.dag exist? If so, parse it. If not, create it.) -2. **`dsl/std/bit.dag`** — Word8/Word16/Word32/Word64 as finite - Bit sequences. Built on top of Bit. -3. **`dsl/std/algebra.dag`** — Magma through OrderedRing, Field, - Lattice, BoundedLattice, BooleanAlgebra, FreeMonoid, - PartialFunction. The algebra hierarchy parsed in one pass. -4. **`dsl/std/integer.dag`** + **`dsl/std/types.dag`** — - Int64 = OrderedRing lives in `integer.dag` (per - v2's actual layout: `module std.integer` declares `type Int64`). - `types.dag` declares Bool = Classical (Bit), String = - FreeMonoid, List = FreeMonoid, and re-exports - `Int = Int64` as the short alias. Inhabitance declarations. -5. **`src/v3/spec/rust.dag`** (§6.5 realization via - ordinary declarations). Parses the `realization` meta-type - declaration plus one concrete realization entry for the - smoke test. The realization item lowers to an **ordinary - `Conj` declaration** with typed fields: `for: DeclarationId`, - `target: DeclarationId`, `body: String`, `cost: Int`. The - declaration's `meta_tag` edge points at the - `Realization` meta-type declaration, distinguishing realization - declarations from ordinary records via the typed-edge - discipline. **No compiler-native `Realization` struct in - `dag.rs`.** This step MUST come after types/integer.dag so - that the `Int64.add` reference resolves correctly. - - **Post-M1(2.7) note:** earlier drafts of this spec mentioned - a `bootstrap::inject_realization_stub` fallback that would - inject the declaration chain directly in Rust if the parser - couldn't handle the realization record-literal shape. That - helper is **deleted in M1(2.7)** and the fallback path is - no longer sanctioned — the thesis's "spec IS the - implementation" claim and `INVARIANTS.md#p5-progress-is-dissolution` - forbid Rust-side declaration - manufacturing on production paths. The test-only realization - smoke in `bootstrap.rs`'s `#[cfg(test)] mod tests` is the - only remaining in-Rust realization construction and stays - test-scoped (never touches production bootstrap). - - If the parser cannot yet handle the `realization` - record-literal shape at PR-B ship time, the correct response - is to extend the parser, NOT to reintroduce the stub. - See `M1_FOLLOWUPS.md` for parser-gap tracking. - -Post-bootstrap, additional std/ files (iteration, containers, -graph, etc.) get parsed lazily when user code imports them. - -This order matches MODELING.md's root-to-leaves layering: roots -(logic) → carriers (bit) → algebras → concrete types → smoke -realization stub → user code. - -### 8.7: Sum-type parser syntax — **`type Name = A | B(payload)`** - -Matches v2. Unit variants (`Sunny`) and variants with payloads -(`Rainy { mm_per_hour: Float }` or `Ok(T)`). Payloads are either -named records (`{ label: type; ... }`) or positional tuples -(`(T)`). Parser extension: new surface syntax for top-level -disjunctions. `|` becomes a recognized top-level separator in -`type` items. - -### 8.8: Arrow type expressions in type position — **`fn(T, T) -> T`** - -Parser extension. Current v3 parser has `fn name(args) -> ret = -body` as an item-level function declaration. M1(2.5) adds -`fn(T1, T2, ..., Tn) -> Tr` as a type-position expression usable -inside field declarations and parameter lists. `type Monoid -{ op: fn(T, T) -> T; identity: T }` needs this. - -### 8.9: Operator dispatch path — **infix ops resolve via inhabitance** - -Currently v3 M0 parses `1 + 2` as `Call { target: "std::int::add" }` -or similar — a hardcoded path to a primitive function declaration. -M1(2.5) removes `std::int::add` as a standalone declaration -(algebra.dag drives it via OrderedRing inhabitance). The parser -needs to produce a structure that the lowerer can resolve through -inhabitance: - -- Parser option A: emit `Conj { function: "+", args: [lhs, rhs] }` - with "+" as an identifier that resolves at inference time by - walking the inferred type's inhabits chain to find an `add` - field. -- Parser option B: emit a symbolic `InfixOp(Add, lhs, rhs)` - variant and have the lowerer rewrite it to a function call - against `inferred_type.inhabits.add`. - -**Recommendation: option A**, as it unifies operator dispatch with -ordinary function-call dispatch. The operator "+" is just an -identifier; its resolution walks type inhabitance. The lowerer -handles this uniformly with other Transform nodes. Adds ~2h of -parser/lowerer work to M1(2.5) scope. - -### 8.10: Substrate-extension enforcement — **deferred to M1(3)** - -The "no seventh connective / no sixth behavior" stop signal is -currently prose-enforced. A mechanical enforcement mechanism (a -`SUBSTRATE_EXTENSION_AUDIT.md` file that any extension PR must -append to, checked in CI) is valuable but orthogonal to M1(2.5)'s -substrate rework. **Deferred to M1(3)** — implement alongside the -cost lens as a CI check that audits the `TypeConnective` and -`Behavior` enum variants against the audit file. ~1-2h of CI -scaffolding work. - -### 8.11: Pending-elimination ratchet — **tracked separately, resolves by M3** - -Distinct from §8.10's substrate-extension audit. `ArrowBody:: -Pending` is a scaffolded state introduced in §Q7 for primitive -Arrows whose realization declarations haven't landed yet. Pending -is not intended as a forever-legal substrate variant — it must -dissolve as M1(3) / M3 realization work proceeds. - -**The ratchet mechanism.** A CI check audits every reachable -Arrow in the loaded declaration table and counts occurrences of -`ArrowBody::Pending`. The count must **monotonically decrease** -across commits after M1(2.5) ships: each M1(3)+ commit either -preserves the count or reduces it, never increases it. The -count is stored in a tracked ratchet file (analogous to v2's -CX diagnostic ratchet) and a CI gate blocks PRs that regress -the count. - -**Starting count at M1(2.5):** approximately one Pending per -primitive Arrow field in `dsl/std/algebra.dag` (Magma.op, -Semigroup.op, Monoid.op, Monoid.identity, Ring.add, Ring.zero, -Ring.negate, Ring.mul, Ring.one, OrderedRing additional fields, -etc.). Order-of-magnitude ~30-50 Pending arrows post-bootstrap. - -**Ending count:** zero. Every primitive Arrow must resolve to -`ExternalRealization(DeclarationId)` pointing at a declaration -in `dsl/extdeps/languages/.dag`, or `UserDefined(NodeId)` -for algebras whose operations are expressed as `.dag` sub-DAGs -rather than target primitives. - -**Ratchet scope vs. §8.10 scope.** §8.10 enforces "no new -substrate variants" (structural stability of the substrate -itself). §8.11 enforces "Pending dissolves over time" -(scaffolding cleanup). Different targets, different enforcement -cadences, different files. Both deferred to M1(3) to implement; -both documented here so the implementer knows what scaffolding -commitments M1(2.5) creates. - -**Scoping note (updated post-M1(2.7)).** `INVARIANTS.md` §"No -short-term solutions" sanctions `ArrowBody::Pending` **only -under an active numeric CI ratchet that strictly decreases** -(exception 2, lines 830-838). The earlier draft of this section -said the ratchet file "does not have to exist at M1(2.5) ship -time" — that language is rescinded. The invariant requires -present enforcement, not future enforcement. A `Pending` that -is not covered by an active ratchet is not a sanctioned scaffold -— it is a bridge. - -**Action required before PR-B merge:** the ratchet file must -exist, the CI gate must block any PR that regresses the -Pending count, and the starting count must be captured from -the current post-bootstrap state. Scoping this to PR-B (the -same PR that introduces the dissolution mechanism via -`rust.dag` realizations) is natural — PR-B both creates the -mechanism that drives the count toward zero and locks in the -ratchet enforcement. - -If PR-B cannot ship with the ratchet (e.g., because M1(2.5) → -M1(2.7) already accumulated `Pending` without enforcement), the -correct response is to ship the ratchet in its own prerequisite -PR before PR-B starts, freezing the current count as the -starting baseline. Either way the ratchet exists at or before -PR-B merge, not after. - -## 9. What "done" looks like for M1(2.5) - -- The five files in §7 are updated; the two test files are new. -- `cargo test -p v3-compiler` shows 40 M0 tests + 2 new substrate - tests = 42 green. -- `cargo clippy` is clean. -- `src/v3/compiler/src/dag.rs` contains no `DeclKind::{Type, Function}` - references. `TypeConnective` has exactly the six variants in §3. -- `Int.add` resolves through inhabitance (no hardcoded signature). -- Synthetic nested-domain model (§6) parses and type-checks. - Exercises the same substrate shapes as `shell.Exec.Run` without - requiring v2's extdeps/transports subtree to exist yet. -- PR description cites this design note; reviewers can verify - against §3–§6 and the acceptance gates in §7. - -No emitter, no cost lens, no unification, no three-primitive -reduction, no full shell.dag. Those come later. - -## 10. Reference - -- `THESIS.md` §"Epistemic stacking" -- `THESIS.md` §"The substrate: two coordinated shapes" -- `THESIS.md` §"Omni-emission" (for context on why the substrate test - matters beyond algebra.dag) -- `MODELING.md` §"Composition layer" (four-layer architecture) -- `src/v3/M0_RETROSPECTIVE.md` (what M0 validated, carried forward - unchanged) -- `docs/design-lineage.md` §"Stage 3" (v2's Node-tree type substrate) -- `feedback_compiler_is_dag_processor.md` (core-invariant memory) diff --git a/src/v3/M1_FOLLOWUPS.md b/src/v3/M1_FOLLOWUPS.md deleted file mode 100644 index d3166d5ff63..00000000000 --- a/src/v3/M1_FOLLOWUPS.md +++ /dev/null @@ -1,20 +0,0 @@ -# M1(2.5) Follow-ups — moved to ROADMAP - -This document's contents have been consolidated into -[`ROADMAP.md`](../../ROADMAP.md) as the single source of truth for -v3 status, active work, and deferred items. - -- **M1(2.6) work in progress** (parser extensions, real `dsl/std/*.dag` - bootstrap, SubstStack + §8.9 inhabitance walks, delete - `inject_primitive_operators`) → ROADMAP §"M1(2.6) — FACTS FLOW - FORWARD + SINGLE AUTHORITY" -- **Deferred M1(3)+** (cost lens, ownership lens, emitter, §8.11 - ratchet, `ArrowBody::Pending` removal) → ROADMAP §"M1(3)+ — deferred - work" -- **M2+ deferred** (generics in user code, match/pipe/lambda, `data` - semantics, `where` refinement, `TypeShape` → `DeclarationId`) → - ROADMAP §"M2 — Feature parity with v2 subset" - -See also: -- `src/v3/M1_DESIGN.md` — historical M1(2.5)–M1(3) design oracle -- `src/v3/M0_RETROSPECTIVE.md` — M0 retrospective + M1(2.5) addendum diff --git a/src/v3/SELF_HOSTING.md b/src/v3/SELF_HOSTING.md deleted file mode 100644 index 078725b4a00..00000000000 --- a/src/v3/SELF_HOSTING.md +++ /dev/null @@ -1,1990 +0,0 @@ -# v3 Self-Hosting — Design Note - -> **Parent docs:** `THESIS.md`, `docs/substrate-reflection-design.md` -> (§12.6 for the brief), `ROADMAP.md` (M3 milestone). -> -> **Purpose:** specify how v3's compiler pipeline migrates from -> Rust into `.dag`, how the stages interact with the reflection -> framework and consumer migrations, and what "self-hosting" -> means concretely for this project. - ---- - -## §1. What self-hosting means for v3 - -**Self-hosting** means v3's entire compiler pipeline — parse, -lower, infer, emit — is written in `.dag`, compiled by v3's -own compile loop, and produces the same byte-for-byte output as -the current Rust stage0. The Rust code at `src/v3/compiler/src/` -becomes a **bootstrap seed**: kept for fresh-checkout -bootstrapping and for the initial compilation of the `.dag` -pipeline files, but no longer the authoritative compiler. The -"real" compiler is the `.dag` one; Rust stage0 exists to get it -off the ground. - -**Historical note.** The legacy self-hosted compiler tree (retired under T-V2-Retirement) established the same -pattern v3 follows: `.dag` pipeline plus a small Rust bootstrap. v3 proceeds under PB-Runtime / Pure-Bootstrap-Zero. - -**v4 operational workflow authorities.** Load-bearing v4 models live at `src/v4/workflow/bootstrap.dag`, `src/v4/workflow/lens_ci_gate.dag`, and `src/v4/workflow/affected_set_selection.dag` (the prior `src/v4/workflow/ci.dag` mirror was descriptive-only with no runtime consumer and was deleted; `.github/workflows/ci.yml` is the direct CI-config authority — see INVARIANTS P2 "Task-scope drift" and THESIS facet 4); the governing program + rails (Pure Bootstrap / N=0, **C4**) are named in `docs/design-pure-bootstrap-zero.md` — top-down registry, not duplicated as upward pointers in the `.dag` headers (`docs/modeling-discipline.md`). - -**What changes with self-hosting:** - -- **The compiler becomes a substrate fact.** The pipeline stages - are ordinary Declarations in the Dag the compiler consumes. - A lens can analyze the compiler's own behavior the same way - it analyzes any other `.dag` program. `lens_complexity` - running on `parse.dag` reports the parser's cost. This is - the thesis's "substrate describes everything including - itself" claim made empirical. -- **New target languages are declarations.** Once - `emit.dag` reads the realization spec and produces target - source, adding a new target (Python, Go, TypeScript, Swift) - is a new realization spec file, not a compiler rewrite. The - thesis's "one file edit per new feature" metric applies to - targets, not just to types. -- **Ingestion languages become declarations too.** Once - `parse.dag` reads a grammar declaration and produces - `SurfaceItem` trees, ingesting Python (or C++, or any other - source language) is a new grammar spec file. The omni-ingestion - mechanism the user named earlier falls out of grammar-as-data. -- **The bootstrap loop compresses.** Every round of compiler - development becomes "edit the `.dag` source, run the existing - compiled pipeline against the edits, verify the result matches - the previous pipeline." When the compiler compiles itself and - the output matches the pre-edit compiler, the edit is sound. - ---- - -## §2. Dependency order - -``` -L0 — Substrate stable [SHIPPED at M1(3)] - │ -L1 — Reflection framework [COMPLETE — PR #466 merged 2026-04-16] - │ • All prereqs merged: #458, #460, #462, #463, #466 - │ • substrate.dag reflects Dag/Behavior/Declaration types - │ • First lens (unused_parameters.dag) migrated with - │ independent parity proof + self-analysis to zero - │ • Optional-handle support (T? with Some/None) landed - │ • Module-mode emission + crate-linked roundtrip proven - │ -L1.5 — Clean bootstrap (IMMEDIATE post-L1) [the process is the first feature] - │ 1. Pipeline composition declaration (§2.1) - │ — typed stage functions, ExternalRealization bodies - │ — small PR, no implementation, just the declaration - │ 2. Per-stage fixed-point in regen (§11) - │ — regen captures per-stage output, diffs at boundaries - │ — uses the pipeline declaration from step 1 - │ — the dark-emu fix, available from day one - │ 3. Test authority types in std/verification.dag (§14) - │ — extend std/verification.dag with compiler-verifiable AssertKind variants - │ — first consumer: structural testgen from existing std/ types - │ — every type declared in std/ gets inhabitant + coercion tests - │ - ├── L2 — v2 consumer migrations [parallel with L2.5/L2.6/L2.7] - │ │ M1: dsl/lenses/complexity.dag (5490 lines from v2) - │ │ M2: dsl/lenses/effects.dag (66 lines) - │ │ M3: dsl/lenses/trace.dag (223 lines) - │ │ - ├── L2.5 — Per-stage domain modeling [parallel with L2] - │ │ Emit domain: extdeps/languages/ completeness, - │ │ std/formatting.dag - │ │ Lower domain: std/surface.dag (surface AST types) - │ │ Parse domain: std/token.dag, std/encoding.dag, - │ │ extdeps/platform/filesystem.dag, - │ │ grammar productions as data - │ │ Infer domain: std/inference.dag, std/scope.dag, - │ │ std/substitution.dag - │ │ (blocked on I3 write-surface experiment) - │ │ - ├── L2.6 — Testgen + dry-run infrastructure (§14) [parallel with L2/L2.5] - │ │ 1. Behavioral testgen: lens walks transforms, enumerates - │ │ structurally valid inputs, verifies output types (§14.2) - │ │ 2. MockRealization: type-correct stubs for ExternalRealization - │ │ bodies, generated from the arrow signature (§14.3) - │ │ 3. Dry-run mode: execute pipeline stages against mocks, - │ │ verify typed boundaries hold at runtime (§14.3) - │ │ 4. Pattern realization in extdeps/languages/ — declares how - │ │ structural Disj patterns map to target container ops - │ │ - └── L2.7 — Rendering from root facts (§14.7) [parallel with all L2] - │ Phase 1 (L1.5): declare ComputationModel in std/ - │ declare TargetExecutionModel in realization specs - │ emitter gates ownership stage on target.memory - │ conservative default (all params Stays) - │ is_copy on leaf types, clone-count ratchet - │ Phase 2 (L2): ParameterCrossing analysis - │ body-walk derivation for .dag callables - │ declared for ExternalRealization - │ is_copy composition for compound types - │ last-crossing-use tracking, clone count → 1 - │ Phase 3 (L2+): parallelism Rc/Arc refinement - │ complexity reads crossing facts - │ Phase 4 (L3): self-analysis, multi-target validation - │ -L3 — Pipeline stages in .dag [blocked on L2.5 model for each stage] - │ Stage 1: emit.dag — Dag → target source strings - │ Stage 2: lower.dag — SurfaceItems → Declarations + Behaviors - │ Stage 3: infer.dag — Dag → Dag with port state - │ Stage 4: parse.dag — tokens → SurfaceItems - │ - Schema migration (§10) [after L3 Stage 1] - │ ChangeClassification → patch → bridge → fixed-point - │ Zero manual stage0 edits - │ -L4 — Full self-hosting (M3) [long-term] - v3's compiler is .dag code - Rust stage0 is vestigial (bootstrap seed) -``` - -**Gating rules:** - -1. **L1.5 is the FIRST thing after L1.** Before lens migrations, - before domain modeling, before any pipeline stage work — land - the pipeline composition declaration and per-stage fixed-point - verification. The process is the first feature. Every - subsequent piece of work (lens migrations, stage ports, new - substrate features) goes through a bootstrap process that's - already structurally sound. This prevents the v2 pattern where - the bootstrap process was never instrumented and every - regression was hours of archaeology. -2. **L2 cannot start until L1 ships.** Consumer migrations read - substrate facts through the reflection framework; no - reflection, no lens migrations. -3. **L2.5 cannot start until L1 ships.** Domain modeling declares - types in `std/` and `extdeps/` using the same reflection - infrastructure. Does NOT need L2 lens migrations to be done - first — L2 and L2.5 are independent parallel work streams - (L2 writes lenses in `dsl/lenses/`, L2.5 declares types in - `std/` and `extdeps/`). - **Distinction from the decorative-modeling pattern.** ROADMAP - Track 17 warns that types with zero consumers are decorative. - L2.5 is NOT that pattern. Each L2.5 type has a **named - consumer**: the L3 stage implementation that reads it. The - four-step sequencing in §2.2 ties modeling to implementation - atomically — Step 1 (model review) exists BECAUSE Step 3 - (implementation) will consume the types. If an L2.5 type has - no Stage N implementation that reads it, it doesn't belong in - L2.5; it's decorative. The test is: "which function body in - L3 reads this type?" If you can't name one, don't declare it. -4. **L3 stage N cannot start until L2.5's model for stage N is - reviewed.** Implementation fills in function bodies over - already-declared types. The model IS the prerequisite (§2.2). - L2 should have at least M1 underway to prove the reflection - framework works on real analysis code before pipeline stages - start. -5. **L2.5 stages proceed in L3's implementation order.** Emit - domain first (partially exists, smallest gap), lower domain - second, parse domain third, infer domain last (blocked on I3 - write-surface experiment). Each domain model runs ahead of - its stage's implementation by at least one step. -6. **L2.6 starts as soon as L1.5 lands.** Behavioral testgen - and mock generation consume the test authority types from - L1.5 and the lens infrastructure from L2. L2.6 is parallel - with L2/L2.5 — it doesn't block them, and they don't block - it (beyond the L1.5 dependency for the authority types). -7. **L2.7 Phase 1 starts at L1.5.** Declare `ComputationModel` - in `std/` and `TargetExecutionModel` in realization specs. - Emitter gates ownership stage on target's memory model. - Every generated artifact after L1.5 benefits. Phase 2 - (ParameterCrossing analysis) proceeds in parallel with L2 - lens migrations. **The v2 lesson is non-negotiable:** if - correct rendering doesn't land before generated lenses - accumulate, every subsequent artifact compounds clone debt. -8. **L3 stages proceed bottom-up.** Emit first (easiest, already - half-structured), then lower, then infer, then parse. Each - later stage's migration benefits from the earlier stages - being in `.dag` form (e.g., `lower.dag` can call `emit.dag` - for debug-dump purposes once both are in `.dag`). -9. **L4 is the state after all L3 stages ship.** There is no - separate "make self-hosting work" milestone; it's the - emergent consequence of completing L3. - -**L2.5 within each stage — the four-step sequencing from §2.2:** - -| Step | What | When | Output | -|---|---|---|---| -| 1. Model review | Declare input/output types in `std/` and `extdeps/`. Apply invariants. Scrutinize structural decomposition. | L2.5 | `.dag` type files, reviewed | -| 2. Pipeline slot | Add the stage's typed function signature to the pipeline composition. `ExternalRealization` body. | L2.5 → L3 boundary | Pipeline `.dag` updated | -| 3. Implementation | Fill in the function body. Types are already declared; implementation is bounded by the model. | L3 | Stage `.dag` file | -| 4. Parity test | The `.dag` version produces byte-identical output to the Rust version. Delete the Rust version. | L3 completion | Rust file deleted | - -### §2.1 The pipeline is a `.dag` composition with structural consumers - -v2 is already self-hosting via `.dag` composition. `compile.dag` -calls stage functions through `let` bindings — it IS a dependency -graph in the same sense any `.dag` program is. The gap is not -that v2 "lacks a pipeline graph." The gap is: - -1. **`bootstrap.dag`'s stage metadata has no consumers.** - `CompilerStage`, `TransformContract`, `ChangeClassification`, - `BootstrapStrategy` — 195 lines of type vocabulary declared, - zero code reads any of it. The stage contracts are decorative. -2. **No structural self-analysis.** No lens runs on the pipeline - itself. The compiler cannot analyze its own compilation steps - the way it analyzes user programs. -3. **Stage boundaries are convention, not enforced.** Each stage's - output type is `Dag` — which is also its input type. Nothing - structurally distinguishes "Dag with all ports inferred" from - "Dag with ports still Uninferred." The convention holds because - the stages are called in the right order, not because the type - system prevents calling them in the wrong order. - -v3's pipeline keeps the `.dag` composition shape v2 already has -and adds **structural consumers** that make the stage metadata -load-bearing: - -``` -fn compile(source: String, file: String, spec: LanguageSpec) -> EmitResult { - let parsed = parse(source, file) - let lowered = lower(parsed.module) - let inferred = infer(lowered.dag) - emit(inferred.dag, spec) -} -``` - -Ordinary `.dag` — four `let` bindings with explicit dependencies. -The compiler sees this as a dependency graph. What's new is what -READS that graph: - -1. **Stage contracts consumed by lenses.** A lens verifies "does - `infer` produce a Dag where all ports have Resolved state?" - This is a **lens-checked property**, not a type-level guarantee - — the output type is still `Dag`, not a hypothetical - `InferredDag` wrapper. The enforcement mechanism is the same - as for any other `.dag` invariant: a lens reads the output and - reports violations. If a future substrate version introduces a - wrapper type that makes unresolved ports unrepresentable at the - type level, that's a stronger guarantee — but the starting - point is lens enforcement, same as `lens_layer_opacity` and - `lens_unused_parameters`. -2. **Per-stage fixed-point consumed by regen.** The pipeline's - typed stage boundaries give the fixed-point test structural - comparison points. Instead of a file-level diff, regen compares - pass1 and pass2 at each stage boundary — structural diffs, not - textual diffs. -3. **Independent stages parallelize automatically.** Two - post-inference analyses with no data dependency run - concurrently by default. The thesis's "parallelism is not a - feature, it is the default" applied to the compiler. -4. **The compiler is analyzable by its own lenses.** - `lens_complexity` on `parse` reports the parser's cost. - `lens_unused_parameters` on `infer` reports dead parameters. - Self-analysis extends from "a lens analyzes a lens" to "the - compiler analyzes itself." -5. **Schema migration patches read the pipeline.** When a stage's - input/output type changes, the pipeline's typed composition - shows which downstream stages are affected. - -**Interaction with the L3 migration order.** Stages still -implement bottom-up (emit → lower → infer → parse). During -migration, each stage starts as `ArrowBody::ExternalRealization` -(backed by the Rust implementation) and transitions to -`ArrowBody::UserDefined` when the `.dag` body lands. The pipeline -composition doesn't change during this transition — it calls each -stage function regardless of whether the body is Rust-backed or -`.dag`-backed. Same pattern as `Int.add` being -`ExternalRealization` pointing at Rust `i64 + i64` today. - -**The pipeline declaration ships FIRST (model before implement).** -Each stage implementation fills a slot in the declaration. -`ExternalRealization` is the honest scaffold for "this stage -exists but is still Rust." The pipeline is structurally valid at -every intermediate state. - -### §2.2 Model every stage's domain to spec before implementation - -v2 achieved self-hosting incrementally — types grew fields as -needed, coproducts grew variants as needed, contracts were added -after the fact. The result: `complexity.dag` is 5490 lines of -reconstruction heuristics compensating for facts that weren't -modeled upstream. The pipeline works, but the modeling was -done in parallel with implementation, and the implementation -kept outrunning the model. - -v3 inverts this: **every pipeline stage models its inputs and -outputs to spec BEFORE the stage body is implemented.** Stage -implementation is filling in function bodies over already-declared -types — the same model-before-implement discipline the thesis -demands of user programs, applied to the compiler itself. - -Concretely, each stage's domain model is reviewed and scrutinized -before any implementation starts: - -- **Parse domain.** What IS a source file? Model files, encodings - (ASCII/UTF-8), line endings, BOM handling as structural types in - `std/`. Model the platform's filesystem interface as an extdep. - Model the token types structurally — not a flat `TokenKind` enum - that grows arms, but dimensional types where the thesis's - structural decompression invariant applies (e.g., delimiters as - `{ shape: BracketShape, side: Side }`, keywords as data in a - table). Model the grammar productions as data, not as hand-coded - recursive-descent functions. Every input the parser touches is - declared, not assumed. - -- **Lower domain.** What ARE the surface forms? Model - `SurfaceItem`, `SurfaceExpr`, `SurfacePattern` as proper `.dag` - Disj declarations with the normal invariants applied — structural - decompression, no flat coproducts where dimensional records - belong, every variant grounded in the thesis's four dissolution - patterns. The surface AST becomes `std/surface.dag` — sibling to - `std/substrate.dag`, analyzed by the same lenses. - -- **Infer domain.** What ARE the inference rules? Model type - resolution, template substitution, operator dispatch as data - operations over the substrate. The cross-stage facts — input - port state, output port state, diagnostic types, type shapes — - are declared types in `std/`. The walker-local state — - substitution stacks, scope structures, intermediate unification - state — stays as implementation details inside `infer.dag`'s - function bodies, NOT in `std/` (see substrate-vs-implementation - split below). - -- **Emit domain.** What IS a target language? Model the language - spec structurally — not just "what types exist" but the full - emission surface: indentation conventions, line-length limits, - import ordering rules, formatting conventions, comment syntax. - Model the target's type system as data in `extdeps/languages/`. - The emitter reads ALL rendering decisions from declared data; - the emitter code itself is a generic walk that never contains - target-specific knowledge. - -- **Between stages.** Model the stage boundaries as typed - contracts. What's preserved across each boundary, what's - recomputed, what diagnostics flow forward. The contracts are the - pipeline's function signatures — first-class, not decorative. - A lens verifies each contract holds. - -**Substrate vs implementation — what goes in `std/` and what -doesn't.** Not every type the compiler uses belongs in `std/`. -The rule: **if a type crosses a stage boundary or is consumed by -a lens, it goes in `std/`. If it's internal to one stage's walk, -it's implementation.** - -| Category | Goes in `std/` | Stays in stage `.dag` body | -|---|---|---| -| Input/output types | `SurfaceModule`, `Dag`, `EmitResult` | — | -| Diagnostic types | `Diagnostic`, `SourceSpan` | — | -| Substrate types | `Declaration`, `Behavior`, `TypeConnective` | — | -| Target language types | `LanguageSpec`, `Realization` (in `extdeps/`) | — | -| Token types | `Token`, `TokenKind` | — | -| Surface AST types | `SurfaceItem`, `SurfaceExpr` | — | -| Walker-local state | — | `SubstStack`, `Scope`, `UnificationState` | -| Intermediate inference state | — | Per-port resolution tracking | -| Helper accumulators | — | `fold` locals, working sets | - -Walker-local state may graduate to `std/` IF a downstream consumer -needs it — for example, if a lens needs to inspect substitution -state mid-inference. But the default is implementation-local until -a cross-boundary consumer surfaces. "Model to spec" means the -BOUNDARIES are modeled, not the internals. - -**The v2 lesson this prevents.** v2's pipeline stages accreted -types reactively: a stage needed a fact, so a field was added to -the IR, and downstream stages adapted. The adaptation was often -reconstruction — re-deriving the fact from incomplete data instead -of receiving it as a typed edge from the stage that computed it. -Modeling to spec upfront means the typed edges exist BEFORE any -stage runs, so reconstruction has no reason to form. The -`annotate_descent_evidence` pattern (33 heuristics in v2's -complexity pass) is the canonical failure mode this prevents. - -**The principle:** the `.dag` compiler gets the `.dag` treatment -at its boundaries. Every type that crosses a stage boundary or is -consumed by a lens — files, tokens, surface trees, substrate -declarations, target language constructs, platform capabilities — -is modeled with the same rigor as any user-facing `.dag` -declaration. Structural decompression applies. Layer opacity -applies. Facts flow forward applies. No special exemption for -"this is compiler-internal." The invariants are universal at -boundaries; walker-local implementation details are free to use -whatever internal representation the stage author finds most -natural. - -**Practical sequencing.** For each stage (emit → lower → infer → -parse), the work is: - -1. **Model review.** Declare the stage's input/output types in - `std/` and `extdeps/`. Apply the normal invariants. Review and - scrutinize the model — structural decompression, no smuggled - coproducts, no decorative fields. Draw on v2's pipeline files - as empirical reference for "what does this stage actually need." -2. **Pipeline slot.** Add the stage's typed function signature to - the pipeline composition. `ExternalRealization` body. -3. **Implementation.** Fill in the function body. The types are - already declared; the implementation is bounded by the model. -4. **Parity test.** The `.dag` version produces byte-identical - output to the Rust version for every test fixture. Delete the - Rust version. - -Step 1 is where the hard thinking happens. Steps 2-4 are -engineering bounded by Step 1's model. - -### §2.3 Language-agnostic compiler core (Shape A only) - -The compiler knows only substrate primitives: the six type -connectives (Atom, Conj, Disj, Arrow, Cardinality, Instantiation) -and the five L1 behaviors (Value, Transform, Branch, Loop, Bind). -It does NOT know what language it is parsing or emitting. `.dag` -is a grammar spec the parser engine reads. Rust is a language spec -the emission engine reads. Both are data. The compiler is the -engine, not the specs. - -**Scope: Shape A targets only.** The thesis (§"Omni-emission") -makes a load-bearing distinction between Shape A (compiler-owned -programming-language emission: Rust, Python, Go, TypeScript) and -Shape B (user-program artifact generation: YAML, Terraform, SQL, -English docs, SPICE netlists). Treating Shape B artifacts as -compiler render targets is explicitly called a category error in -the thesis. This section's `compile(...)` parametrization ranges -over **Shape A targets only**. Shape B artifacts are outputs of -`.dag` user programs that walk typed values and produce strings — -the compiler emits the `.dag` PROGRAM (Shape A), and the program's -OUTPUT is the Shape B artifact. English, YAML, and SPICE are -never `EmissionTarget` values. - -**The pipeline, with elaboration separated from parsing.** -MODELING.md's four-layer stack separates surface sugar from the -composition layer from the semantic kernel. `GrammarSpec` owns -syntax (tokens → surface tree). A separate `ElaborationSpec` maps -source-language surface forms to substrate declarations — the -lowering semantics. Collapsing both into `GrammarSpec` would -leave elaboration as implicit compiler behavior rather than -declared authority. - -``` -fn compile( - source: String, - grammar: GrammarSpec, // syntax: tokens → surface tree - elaboration: ElaborationSpec, // semantics: surface → substrate - target: EmissionTarget, // Shape A language + rendering -) -> EmitResult { - let parsed = parse(source, grammar) - let lowered = lower(parsed, elaboration) - let inferred = infer(lowered.dag) - emit(inferred.dag, target) -} -``` - -Four parameters. `grammar` owns what surface forms exist. -`elaboration` owns how those forms become substrate declarations. -`target` owns how substrate projects onto a programming language. -The compiler core reads all three as data; it contains zero -language-specific knowledge. - -**Compositional opacity at the I/O boundary.** The thesis says -"HTTP does not know or care what transport it is running over." -This constraint says: the compiler does not know or care what -language it is parsing or emitting. Below-boundary details -(syntax, keywords, operators, formatting, memory model, import -system) are unnameable to the compiler core. The compiler reads -structural edges from the specs; it never asks "am I compiling -Rust right now?" - -The rename test from THESIS.md §"Compositional layering" extends: -rename every `.dag` keyword in the grammar spec, rebuild, verify -the compiler still works. If it does, the compiler is language- -agnostic. If it doesn't, there's a hardcoded language assumption -in the core. - -#### §2.3.1 Emission/ingestion cost model - -Any Shape A programming language that can represent the -substrate's primitives can be a compiler target. The question -isn't "can we emit to X?" — it's "at what cost?" - -For each substrate primitive (Conj, Disj, Arrow, etc.) and each -L1 behavior, the `LanguageSpec` declares: how the target -represents it, and what the representation costs in space and -time. - -The cost is structural and measurable. A well-matched target -(Rust) has expansion factor k ≈ 1 per nesting level — nested -structs are just nested structs, depth doesn't matter, total cost -is O(|substrate|). A poorly-matched Shape A target might have -k > 1, growing with nesting depth. The cost of emission increases -exponentially with structural depth for targets whose native -constructs don't match the substrate's compositional primitives. - -This IS CX applied to emission itself. The `LanguageSpec` carries -a cost model alongside its representation declarations. The -compiler computes emission cost statically from the spec. - -**Shape B cost model is analogous but separate.** A Shape B -`.dag` program (e.g., one that walks substrate declarations and -produces English documentation) has its own cost model: the -expansion factor per nesting level in the output format. English -has k >> 1 (subordinate clauses for each nesting level). YAML has -k ≈ 1 (indentation scales linearly). But these costs live in the -Shape B user program's own type spec, not in the compiler's -`LanguageSpec` — because the compiler doesn't own Shape B -emission. - -**Ingestion has an additional dimension: information deficit.** -For emission, the compiler has full substrate and projects it — -the cost is expansion. For ingestion, the compiler has external -source and lifts it in — the cost is expansion PLUS deficit: how -much structural information does the source NOT carry that the -substrate needs? - -- `.dag` ingestion: zero deficit. All structure explicit. -- Python ingestion: high deficit. Types, ownership, effects, - complexity bounds are implicit or absent. -- REST API spec ingestion: medium deficit. Types present (JSON - Schema), effects partially present (HTTP methods imply - idempotency), but complexity bounds absent. - -The deficit is a measurable property of the `GrammarSpec` + -`ElaborationSpec` pair. Ingestion cost = parsing cost (from -grammar) + reconstruction cost (from elaboration, proportional -to the deficit). - -#### §2.3.2 Emission layering: spec vs rendering conventions - -The emission pipeline has compositional layers with opacity -between them: - -``` -Layer 3: RenderingSpec (format, naming, idioms) — declared conventions - │ composes on -Layer 2: RepresentationMapping — substrate ↔ target - │ reads -Layer 1: LanguageSpec (facts from spec doc) — hard constraints - │ applied to -Layer 0: Substrate (Bit, Conj, Disj, ...) — what the compiler knows -``` - -**Layer 1: Language specification (facts).** What IS valid Rust? -Comes from the actual language's specification document. Modeled -in `extdeps/languages/rust/spec.dag`. Hard constraint — violating -Layer 1 produces invalid target code. - -**Layer 2: Representation mapping.** How do substrate primitives -map to Layer 1's constructs? Conj → `struct`, Disj → `enum`, -Arrow → `fn`. The bridge between substrate and target. - -**Layer 3: Rendering conventions.** Declared rendering rules -ON TOP of the spec, strictly limited to **lexical/visual -concerns**: `rustfmt`-compatible formatting, `snake_case` naming, -line-length limits, import ordering, comment style, indentation -width. These are **declared structural facts** with the same -authority as any other `.dag` declaration — not "preferences" or -"annotations." When present, they are hard constraints on the -emitter's output formatting. "Optional" means the emitter CAN -run without them (producing valid-but-unstyled output), NOT that -they are soft suggestions. Different projects compose different -rendering specs on the same language spec. - -**RenderingSpec MUST NOT change observable semantics.** Choices -like `Result` vs `panic!` or error-handling strategy are -SEMANTIC — they change the emitted program's behavior. Those -belong in `LanguageSpec` (Layer 1), not `RenderingSpec` (Layer 3). -The test: if two `RenderingSpec` values produce programs with -different runtime behavior, one of them contains a semantic choice -that should be in `LanguageSpec`. RenderingSpec is purely visual; -two rendering specs on the same language spec produce programs -that behave identically and differ only in formatting/naming. -**Opacity between layers is load-bearing.** Layer 1 doesn't know -about Layer 3. Layer 3 doesn't know about Layer 0. When you -change a rendering convention, Layers 0-2 are untouched. When you -change a substrate type, Layer 3 is untouched. - -```dag -// Layer 1 — facts from the target language's specification -type LanguageSpec { - constructs: Map - syntax: SyntaxRules - type_system: TypeSystemSpec - module_system: ModuleSpec -} - -// Layer 3 — declared rendering conventions (visual only) -type RenderingSpec { - naming: NamingConventions // snake_case, camelCase, etc. - formatting: FormatRules // line length, indentation, etc. - lint: List // visual lint only (not semantic) -} -// Note: "idioms" (Result vs panic, error-handling patterns) are -// SEMANTIC and belong in LanguageSpec, not here. - -// The composition — the emitter reads this -type EmissionTarget { - language: LanguageSpec // what's valid (required) - rendering: RenderingSpec? // how to format (optional) -} -``` - -When `rendering` is None: valid-but-unstyled output. When present: -fully-styled output per the declared conventions. - -The same layering applies to ingestion: Layer 1 is the source -grammar (facts), Layer 3 is declared parsing conventions (error -recovery strategy, diagnostic phrasing). Ambiguity resolution is -SEMANTIC — it changes which parse tree the parser produces — so -it belongs in `GrammarSpec` (Layer 1) or `ElaborationSpec`, not -in the conventions layer. Opacity holds: the diagnostic phrasing -doesn't know about the grammar rules. - -#### §2.3.3 Design challenges - -1. **GrammarSpec expressiveness.** What grammar formalism? Pure - CFG can't handle operator precedence or layout sensitivity. PEG - has ordering sensitivity. EBNF + precedence declarations covers - most practical languages. The formalism choice IS the L2.5 - parse domain decision. -2. **ElaborationSpec design.** How are source-language surface - forms mapped to substrate declarations? This is the semantic - bridge between "what the grammar produces" and "what the - substrate carries." For `.dag` the mapping is mostly 1:1 - (surface items lower to declarations directly). For other - languages the mapping is richer (Python class → Conj with - method Arrows, C++ template → Instantiation). The elaboration - spec must be expressive enough for arbitrary source languages - without growing the compiler core. -3. **LanguageSpec completeness.** The spec must cover the full - emission surface: type decoration, import systems, module - organization, async models, memory management, concurrency, - build system integration. If the emitter ever needs per-target - code, the spec is incomplete. -4. **The bootstrap seed.** The compiler reads grammar specs to - parse. Grammar specs are `.dag` files. To parse a grammar spec, - the compiler needs a parser that reads a grammar spec. - Chicken-and-egg. The seed parser parses at least the - grammar-spec format without reading a spec — that's the - irreducible kernel. How small can the seed parser be? -5. **Per-language spec authoring cost.** Writing a `LanguageSpec` - + `ElaborationSpec` + `RenderingSpec` for a complex language - (Rust, C++, Python) is weeks of work. One-time cost per - language, not per project — but worth naming honestly. The - thesis promise is "adding a new target costs one spec file." - True; writing that spec set is the investment. - -### §2.4 Mutual recursion lowering — prereq for complexity and general execution - -The thesis's lowering table (`INVARIANTS.md#p4-decidability`, recursive syntax as bounded lowering) commits to handling EVERY call pattern, including n-way -mutual recursion. The lowering for mutual recursion is: - -> Mutual recursion (SCC) on children → `descend` over SCC-ordered -> nodes, bounded by |SCC|. - -v3's `lower.rs` already detects mutual recursion at lowering time -(`compute_mutually_recursive` walks the call graph and returns a -`HashSet` of cycle members). **But it currently REJECTS -mutual recursion** — the diagnostic says "mutual recursion is not -yet supported in v3." - -The missing piece is the LOWERING step: transform the cycle into -bounded Loop nodes with descend semantics. - -1. Lowering detects the cycle via `compute_mutually_recursive` - (already done) -2. Lowering preserves the **real call topology** of the SCC — - each function's actual call targets remain as structural - edges in the lowered form. The SCC is wrapped in a bounded - descend whose bound is the structural descent evidence - (children get strictly smaller at each level), but the body - of the descend preserves which functions call which. No - ring-walk encoding that drops real edges. -3. The bounded Loop node carries: SCC membership (which - declarations participate), the shared descent measure, and - the original call graph edges within the SCC. Later consumers - (complexity, equivalence, lenses that care about branch shape) - can read the real topology, not a lossy encoding. - -**The exact substrate fact that must survive lowering:** for each -function in the SCC, the `Transform.target` edges in its body -point at the REAL callee declarations, not at a synthetic -"next in ring" target. The SCC boundary is a Loop whose bound is -the shared descent measure; the Loop body is the SCC members' -bodies composed with their real call edges intact. This -preserves execution semantics AND the facts downstream consumers -need. - -Once lowering does this, the substrate carries the SCC structure -as bounded Loop nodes with real call topology. Complexity reads -`Loop.bound` and applies the standard cost rule: -`bound × cost(body)`. No SCC analysis in complexity. No Tarjan's -in complexity. The cycle detection is in LOWERING (where it -belongs), and the general SCC algorithm is a library function in -`std/graph.dag` (reusable by anything that needs cycle detection). - -**Prereq for:** -- The complexity port (complexity reads SCC cost from the - substrate; if lowering doesn't produce the bounded descend, - complexity has to reconstruct the SCC itself — which is the - v2 pattern we're dissolving) -- General language completeness — any `.dag` program with mutual - recursion should compile, not fail at lowering -- Self-hosting — mutually-recursive HELPER FUNCTIONS within a - pipeline stage (e.g., a parser's recursive-descent helpers) - should compile and run. Note: pipeline stages calling each - other across stage boundaries is a COMPOSITION concern, not - mutual recursion — that's handled by the pipeline declaration - in §2.1, not by the recursion lowering here. - -**Scope:** n-way mutual recursion (not just 2-way). The thesis's -lowering table says "mutual recursion (SCC) on children" without -a bound on the SCC size. A 3-function cycle, a 10-function cycle, -and a 2-function cycle all lower to the same bounded-descend -shape. - -**Testing:** every SCC size from 2 to at least 5 should have a -test fixture. Positive fixtures: -- Compiles without diagnostics -- Produces a bounded Loop with the correct bound -- The bound is provably structural (|SCC| × |children|) -- The lowered form preserves real call-graph edges (not a ring) -- A complexity lens walking the result reads the cost without - reconstruction - -Negative fixtures (fail-closed): -- An SCC where no shared descent measure exists (all arguments - preserved or grow) should fail with a diagnostic naming the - cycle and the missing measure — not compile silently with an - unbounded loop ---- - -## §3. Stage 1 — `emit.dag` - -**Current:** `src/v3/compiler/src/emit_rust.rs` (~340 lines -today; will grow as FieldBinding lookup lands in the reflection -PR). - -**What it does:** walks a compiled `Dag`, looks up realization -entries in `rust.dag`, and produces Rust source code as a -string. Pure walk + template substitution + realization lookup. -No inference, no mutation, no cross-module resolution. - -**Why emit first:** it's the easiest stage to port because it's -already structured as a walk over the substrate. Most of its -"logic" is table-driven (the `rust.dag` realization index), and -the table is already in `.dag` form. The `.dag` version of -`emit_rust` reads the same realization entries, walks the same -Dag, and concatenates the same template output — just expressed -in `.dag` instead of Rust. - -**Blocker dependencies:** - -- L1 (reflection) — needs substrate types in `.dag` to walk -- `std/string.dag` — string concatenation, formatting, - placeholder substitution (the `%N/%T/%V/...` template language) -- L2 M3 (effects) is recommended but not strictly required — - having the effects lens running validates the lens - infrastructure independently before pipeline stages start - -**Expected port size:** ~300-500 lines of `.dag` (roughly -comparable to the Rust version, possibly slightly longer due -to `.dag`'s more verbose function definitions). The algorithm -is the same. - -**Substrate extensions surfaced by the port:** - -- **`std/string.dag`** — doesn't exist at M1(3) scope. Adding - it means declaring `String` as more than an opaque primitive: - concat, length, replace, substring, split, format. Likely a - `Monoid` inhabitance plus per-operation declarations. - This is its own follow-up, but it's cheap if done right. -- **Template substitution as a data operation.** The existing - emit_rust has `render_template` in Rust that walks `%N/%T/%V` - placeholders and substitutes. The `.dag` version needs this - as a `.dag` function. Options: (a) inline the substitution - logic in `emit.dag`, (b) model templates as a substrate - concept with typed placeholder slots and let the renderer be - generic. (b) is more thesis-aligned but bigger. - -**Acceptance criteria:** - -- [ ] `src/v3/spec/emit.dag` (bootstrap staging location) exists -- [ ] Compiles under the grammar + library available after L1 ships -- [ ] For every v3 test that currently invokes `emit_rust.rs`, - the `.dag` version produces byte-identical Rust output -- [ ] The Rust `emit_rust.rs` is deleted once parity holds - -**Open questions:** - -- How does `.dag`'s IO boundary work? `emit.dag` needs to - produce a `String` and return it. The caller (test, CLI) - receives the string. That's a normal function return value; - no new machinery needed. But **writing** to a file is an - effect, and effect modeling in v3 is unresolved. Solution: - `emit.dag` returns the string, the caller writes it. Effects - stay at the boundary. -- How does the `.dag` version bootstrap? Rust stage0 compiles - `emit.dag` to a Rust function, and the Rust test suite calls - that function. That's the standard "compile .dag to Rust and - run" pattern. No meta-circularity at this stage. - ---- - -## §4. Stage 2 — `lower.dag` - -**Current:** `src/v3/compiler/src/lower.rs` (~2000 lines). - -**What it does:** takes parsed `SurfaceItem` / `SurfaceExpr` -trees from `parse.rs` and produces `Declaration`s (type -declarations, function declarations, data declarations) plus -sub-DAG `Behavior`s (function bodies, nested expressions). -Walks the surface tree, allocates DeclarationIds, resolves -name references, runs the `resolve_pending_identifiers` sweep -for cross-file forward references. - -**Why second:** lower is the second cleanest stage after emit -because it's a walk + construction. The algorithm is "for each -SurfaceItem, build the corresponding Declaration(s) and -Behavior(s)." Pattern matching on SurfaceItem variants is -available post-L1. The tricky parts (forward reference -resolution, scope management) have well-defined shapes. - -**Blocker dependencies:** - -- L1 (reflection) -- Stage 1 (`emit.dag`) — not strictly a blocker but recommended, - because a `.dag` lower that wants to debug-dump an intermediate - Dag benefits from a `.dag` emitter -- `SurfaceItem` and `SurfaceExpr` must be declared in the - substrate. Today they're Rust enums in `parse.rs`. For - `lower.dag` to pattern-match on them, they need to become - `.dag` Disj declarations. This is a prerequisite substrate - addition (probably `src/v3/std/surface.dag` declaring the - surface AST). - -**Expected port size:** ~1500-2500 lines of `.dag`. Comparable -to the Rust version. The algorithm is a walk + construction, -so size tracks the number of surface-form variants. - -**Substrate extensions surfaced by the port:** - -- **Surface AST as substrate declarations.** `SurfaceItem`, - `SurfaceExpr`, `SurfacePattern`, `SurfaceType`, etc. become - Disj declarations in `std/surface.dag`. This parallels - what reflection does for `Dag`/`Behavior` — it declares the - parser's output in the substrate so downstream stages can - pattern-match on it. -- **Symbol table / scope machinery.** Today `lower.rs` uses a - `HashMap` for per-scope symbol lookup. - The `.dag` version needs either a substrate construct for - scopes (e.g., `type Scope { parent: Scope?, bindings: Map - }`) or a functional approach (pass - the scope as a value through recursive calls). -- **Cross-file forward reference resolution.** The - `resolve_pending_identifiers` sweep walks unresolved stubs and - fills them in. In `.dag` form, this is a traversal function - that takes a Dag-with-stubs and returns a Dag-without-stubs. - Straightforward but needs the substrate to expose the stub - state as a field. - -**Acceptance criteria:** - -- [ ] `src/v3/spec/lower.dag` exists, depends on `surface.dag` -- [ ] Compiles under the grammar + library after L1 -- [ ] For every input the Rust lower handles, the `.dag` version - produces byte-identical output (same declarations, same - NodeIds, same DeclarationIds — modulo deterministic - allocation order) -- [ ] The Rust `lower.rs` is deleted once parity holds - -**Open questions:** - -- **Allocation order determinism.** Rust `lower.rs` allocates - DeclarationIds as it walks. The `.dag` version needs the same - allocation order for byte-identical output. Either (a) the - `.dag` version is written to allocate in the same order, or - (b) the allocation order is a substrate fact (each declaration - has a canonical-order field), or (c) byte-identity is relaxed - to "semantically equivalent" which is harder to test. - ---- - -## §5. Stage 3 — `infer.dag` - -**Current:** `src/v3/compiler/src/infer.rs` (~1100 lines). - -**What it does:** walks a Dag whose ports have -`PortState::Uninferred` state, runs type inference via the -substitution stack, populates each port with -`PortState::Resolved(TypeShape)` or `PortState::Unresolved`. -Handles template instantiation, inhabitance walks, operator -dispatch, etc. - -**Why third:** infer is the trickiest stage because it's -mutation-shaped in Rust. The Rust version walks the Dag and -updates port state in place. A `.dag` version has to express -this functionally: `fn infer(d: Dag) -> Dag` that returns a new -Dag with the inferred state. - -**This is a research problem, not an engineering problem.** Every -other pipeline stage migration (emit, lower, parse) is engineering -with known patterns. Inference-as-data — "type inference rules -expressed as `.dag` data read by a generic walker" — has no -production precedent. Theorem provers (Coq/Lean/Agda) get partway -there with tactic languages but all have hand-coded cores. v3's -bounded substrate (six connectives, five behaviors, decidable -iteration) gives more leverage than a general HM setting, but the -approach is still unproven. Budget this stage as open-ended R&D, -not scoped work, and front-load the experiment sequence -(`docs/inference-as-data-experiments.md`) to surface blockers -before committing to the full port. - -**I0 result (2026-04-15):** the decidability paper exercise -passed. Two representative inference rules (literal type filling, -bounded Disj walk) are decidability-compatible under `.dag`'s -bounded-iteration invariant. No blocker found. This narrows the -open risk from "is this even possible?" to "which write-surface -option?" See `docs/inference-as-data-i0-result.md` for the full -check. The next experiments (I1-I8) run sequentially after -reflection lands. - -**Blocker dependencies:** - -- L1 (reflection) -- Stages 1 and 2 (`emit.dag`, `lower.dag`) — highly recommended, - because `infer.dag` needs to be debuggable end-to-end -- **Substrate decision: how is inferred state represented?** - Option A: ports carry mutable state fields that the `.dag` - infer function sets. Option B: the inferred state lives in a - separate "inference result" Dag that the caller merges with - the input Dag. Option C: infer returns a Dag-diff (a list of - (PortId, TypeShape) tuples) that the caller applies. **This - is the deepest substrate question for L3** and blocks - `infer.dag` until it's answered. I0's pass confirms the rules - themselves are decidable; what remains is the Dag → Dag write - surface. - -**Expected port size:** ~1000-1500 lines of `.dag`. The -algorithm is the same as Rust's, but the functional expression -may be slightly longer due to avoiding mutation. - -**Substrate extensions surfaced by the port:** - -- **Inferred state representation** — the core open question. -- **Substitution stack as a substrate type.** Today `SubstStack` - is a Rust data structure threaded through inference calls. - The `.dag` version needs it as a declared type, probably a - `List` or similar. -- **Port-state Disj.** `PortState` is currently a Rust enum with - three variants. Declaring it as a `.dag` Disj and letting - `.dag` code pattern-match on the states is a L1 prerequisite - (it's a substrate type that reflection wants anyway). - -**Acceptance criteria:** - -- [ ] `src/v3/spec/infer.dag` exists -- [ ] Compiles under the grammar + library after L1 -- [ ] For every input the Rust infer handles, the `.dag` version - produces byte-identical port state output -- [ ] The Rust `infer.rs` is deleted once parity holds - -**Open questions:** - -- **Mutation vs return-new-Dag.** Substantive design decision. - Suggestion: go functional. Infer takes a Dag, walks it, - returns a Dag with the additional facts populated. - Implementation detail: the "return a new Dag" is a copy at the - top level but most substrate data (declarations, behaviors) - stays shared via structural sharing. Only the port state - changes, and port state is a per-port field, so the copy cost - is bounded by the port count. -- **Fixpoint iteration.** Inference sometimes requires multiple - passes (e.g., cross-referencing forward declarations). The - functional form of fixpoint is `iterate(initial, step_fn) - until step_fn(x) == x`. This needs the `==` equality check - on Dag values, which needs the substrate to support structural - equality. Probably a `std/eq.dag` prerequisite. - ---- - -## §6. Stage 4 — v3 parser (`runtime_mirrors.dag` + staging) - -**Current (SG-2 parser staging — not SG-2b):** `src/v3/compiler/runtime_mirrors.dag` declares the -`Surface*` carrier schema (substrate mirror authority, shared with `parse_surface_generated.rs`); -`src/v3/compiler/parse_parser_body.txt` holds the recursive-descent **algorithm** as checked-in -**temporary semantic** authority; `regen_parse` splices it into producer-owned -`src/v3/compiler/src/parse_generated.rs`. **PR posture:** ship this as **parser staging** (option 1 in -the #589 wrap-up): name the scaffold, keep the dissolution trigger on `parse_parser_body.txt`, and -treat SG-2b — **.dag**-owned parse **logic** — as a **follow-on** lane; do not claim SG-2b closure here. - -**What the shipped parser does:** after tokenization, produces `SurfaceItem` / -`SurfaceExpr` trees via the generated module (same external behavior as the -former handwritten `parse.rs`, now retired from hand-maintained authority). - -**Why last:** parse is hardest AND most transformative. The -intermediate step (port `parse.rs` as-is to `.dag` functions -operating on `List`) is substantial but tractable. The -end state is much bigger: **grammar-as-data.** Parser rules -become `.dag` declarations, the parser itself is a generic -rule-interpreter. At that point, "ingest Python" becomes a new -grammar spec file — the parser is no longer v3-specific. - -**Blocker dependencies:** - -- L1 (reflection) -- Stages 1, 2, 3 (`emit.dag`, `lower.dag`, `infer.dag`) — all - required for the meta-circular bootstrap (see §7) -- `std/string.dag` for source-text operations -- Token type as a substrate declaration (parallels Surface AST - declarations from Stage 2) - -**Expected port size — two phases:** - -**Phase 4a — direct port (still open).** Literal port of the recursive-descent parser into `.dag` -functions on tokens (historically `parse.rs`; today the algorithm scaffold is `parse_parser_body.txt` -until it dissolves). ~1500-2000 lines of `.dag`. Produces identical Surface tree output. - -**Corpus snapshot harness (staging ratchet).** `src/v3/compiler/tests/integration.rs` -(`parse_stage4_prep`) and `parse_corpus_manifest.txt` record the generated parser’s -`SurfaceModule` output over the parseable fixture corpus. **Framing:** useful -parity ratchet for **parser staging**; it does **not** assert that parse **logic** -lives in `.dag` (that is the separate SG-2b bar — retire `parse_parser_body.txt`). -The corpus pins the seven bootstrap `dsl/std` fixtures plus the parseable -`src/v3/std`, `src/v3/spec`, `src/v3/compiler`, and four-fixture-pressure sources; -it does not claim every file under `dsl/std/`. - -**Phase 4b — grammar-as-data.** Parser rules become `.dag` -declarations in a grammar spec file (`dsl/grammar/v3.dag` or -similar). The parser is a generic rule-interpreter that reads -the grammar spec and walks tokens accordingly. Phase 4b replaces -Phase 4a's hand-written rules with a data-driven form. Separate -project, own design note. - -**Substrate extensions surfaced by the port:** - -- **Token type as substrate declaration.** Parallels Surface - AST from Stage 2. `std/token.dag` declares the token Disj. -- **Grammar production as substrate declaration** (Phase 4b). - A new concept: a grammar rule is a declaration describing - "when you see these tokens in this order, produce this - SurfaceItem variant." Probably a `type Rule { name: String, - pattern: List, construct: SurfaceConstruct }` - or similar. This is a design-heavy addition. -- **Error recovery.** Parser error recovery (how to continue - parsing after a malformed token sequence) is currently hand- - coded in the staged recursive-descent fragment (`parse_parser_body.txt`). - The `.dag` version needs a structural - form. Probably out of scope for Phase 4a, in scope for 4b. - -**Acceptance criteria (Phase 4a):** - -- [ ] `src/v3/spec/parse.dag` exists -- [ ] Compiles under the grammar + library after L1 and earlier - pipeline stages -- [ ] For every input file the Rust parser handles, the `.dag` - version produces identical Surface tree output -- [ ] The Rust `parse.rs` is deleted once parity holds (but - `tokenize.rs` stays as the stage0 tokenizer for now) - -**Acceptance criteria (Phase 4b — separate project):** - -- [ ] Grammar declaration in `dsl/grammar/v3.dag` -- [ ] Generic rule-interpreter replaces hand-written rules -- [ ] Adding a Python grammar spec (experimental) parses a - subset of Python source - ---- - -## §7. The meta-circular bootstrap - -Once all four pipeline stages are in `.dag` form, the bootstrap -loop becomes self-referential. Here's the mechanics: - -**Current state (pre-self-hosting):** - -``` -Rust stage0 (parse.rs + lower.rs + infer.rs + emit_rust.rs) - │ - │ compiles - ▼ -User .dag source → Rust target source → rustc → executable -``` - -**Pre-self-hosting but post-L3 (pipeline in .dag):** - -``` -Rust stage0 (kept as bootstrap seed) - │ - │ compiles - ▼ -src/v3/spec/{parse,lower,infer,emit}.dag → compiled pipeline - │ - │ compiles - ▼ -User .dag source → compiled pipeline → Rust target → rustc → executable -``` - -The compiled pipeline stages REPLACE the Rust stage0 at the -compile step. Rust stage0 only runs during the initial -bootstrap of the pipeline stages themselves. - -**Self-consistency check (the meta-circular test):** - -``` -Step 1: Rust stage0 compiles {parse,lower,infer,emit}.dag - → produces compiled-pipeline-v1 (Rust code) -Step 2: compiled-pipeline-v1 compiles its own source files - ({parse,lower,infer,emit}.dag) - → produces compiled-pipeline-v2 (Rust code) -Step 3: Assert compiled-pipeline-v1 == compiled-pipeline-v2 - (byte-identical) -``` - -If Step 3 holds, the pipeline is self-consistent: compiling -the pipeline with itself produces the same output as compiling -it with stage0. That's the self-hosting fixed point. v2 has -this test; v3 will too. - -**When Rust stage0 is vestigial.** After self-consistency is -proven, the Rust stage0 can be maintained as a bootstrap seed -(needed for a fresh checkout with no pre-compiled binary), but -it is NOT the source of truth. Any bug fix or improvement goes -to the `.dag` pipeline first; stage0 is updated to match only -when necessary (e.g., if the `.dag` pipeline grows a new -substrate feature that the stage0 needs to be able to parse). - -The long-term story is: **stage0 is a minimal seed capable of -compiling the .dag pipeline, nothing more.** It stops growing -once it can produce a working `parse.dag` output. Every feature -after that lives in the `.dag` pipeline and is compiled by the -pipeline compiling itself. - ---- - -## §8. Open questions - -1. **Which pipeline stage goes first — `emit.dag` or something - smaller?** §3 recommends emit because it's already walk-shaped - and touches the realization index the reflection PR is - already modifying. But emit is ~340 lines; a smaller stage - might give a faster first data point. Counter-argument: - there isn't a smaller stage — parse/lower/infer are all - larger. Decision: emit first, as the doc currently says. -2. **Inferred state representation (Stage 3's core question).** - Option A (mutable field), B (separate inference-result Dag), - or C (Dag-diff). Each has different substrate implications. - Worth a design note of its own before Stage 3 starts. -3. **Grammar-as-data (Stage 4b) scope.** Phase 4a is a direct - port, cheap. Phase 4b is a separate project that changes - the parser's fundamental shape. Decision: plan them - separately, land 4a first, let 4b be its own design note. -4. **Stage0 minimum feature set.** What does the Rust stage0 - need to be able to parse in order to compile the first - version of `parse.dag`? Probably a subset of v3's current - grammar. Worth enumerating before Stage 4 starts so stage0 - doesn't drift larger than necessary. -5. **Meta-circular test infrastructure.** The self-consistency - test in §7 needs tooling: run pipeline-v1 on its own source, - diff the output against pipeline-v2. Historical compiler-integration - suites ran `ci_freshness` / `ci_fixed_point`-style gates; v3 will need the same. -6. **Interaction with L2 consumer migrations.** If `lens_complexity` - is running on v3's pipeline stages during their migration, - the lens's output should reveal whether the ported stage is - "simpler" than the Rust version (fewer cost-algebra - reconstructions, more substrate-derived facts). This is a - measurable thesis claim — the migration should shrink - complexity's reported cost in measurable ways. Needs - explicit tracking during the migration. - ---- - -## §9. Relationship to the retired legacy compiler - -Prior art for v3 migrations lived in the historical `.dag` pipeline files (parse, -resolve, infer, emit families). Every v3 pipeline stage migration should still: - -1. Read archived `Complexity` / `ownership` / emit DAG lineages as prior art (`docs/substrate-reflection-design.md`, - `docs/v2-retrospective.md`, git history). -2. Identify reconstruction heuristics to dissolve versus genuine structural work to port. -3. Track any behavior the v3 substrate does not yet support as a prerequisite extension. - -**Historical pipeline arcs** (architectural reference, not live paths) included large parse / infer / emit -`.dag` modules documented pre-retirement in design notes and retrospectives. Direct line-for-line ports are not -expected; the reference is for patterns, not verbatim source. - ---- - -## §10. Schema migration as a structural operation - -v2's bootstrap pain reveals three failure modes that v3 must -NOT repeat: - -1. **Fixed-point failures report at the wrong layer.** When - `regenerate-stage0.sh`'s pass1 output differs from pass2, - the error is "fixed-point failed" with a file-level diff. - Localizing which pipeline stage diverged requires hours of - hand-bisection. ROADMAP's M5 Phase 4 Level 1 names the fix - (per-stage structural diffs during regen); it was never - shipped. -2. **Manual stage0 edits come from TwoPhase schema changes, - not drift.** A schema change that isn't backward-compatible - (new required field, removed field, rename) forces a manual - Rust patch to bridge one bootstrap cycle. v2 has a model - for this (`dsl/gunbc/bootstrap.dag`'s `BootstrapStrategy`, - `ChangeClassification`, `TransformContract`) but **the model - has zero consumers**. 195 lines of decorative modeling; the - regen flow doesn't read any of it. -3. **`dsl/gunbc/bootstrap.dag` is decorative.** The types - `CompilerStage`, `TransformContract`, `ChangeClassification`, - `BootstrapStrategy`, `FixedPointCheck`, `FieldPropagation` - exist but no code consumes them. v2 shipped with the - blueprint for fixing its own self-hosting pain, not wired. - This is the Track 17 "decorative types" failure mode - `ROADMAP.md` keeps naming. - -**v3's structural answer: make schema migration a compile-time -operation over the substrate's own declarations.** The schema -diff is a lens. The patch is a data structure. The bridge build -is a mechanical application of the patch. Zero manual edits. - -**Why this is possible in gunbc specifically.** gunbc emits -Rust **text**, not binary blobs. In GCC-style bootstrap, each -stage's output is an executable; you can compare bit-for-bit -and run it, but you can't structurally transform it. In gunbc, -every stage's output is source code — which means a schema -migration becomes a **patch over that source code**. The old -compiler doesn't need to understand the new schema; it emits -its own Rust, and a separate transformation applies the delta -the new schema implies. The patch applier operates on source -text, not on binaries. - -### §10.1 The five-step schema migration pipeline - -A schema change migrates without manual edits via this sequence: - -1. **Structural diff.** A `.dag` lens walks old and new - `substrate.dag` declarations, compares them, and produces a - `ChangeClassification` — a list of `ChangeKind` entries each - describing one delta. Built over reflection (§3 of the - reflection design doc); the diff reads declarations as data - because reflection makes them data. -2. **Patch generation.** A second `.dag` lens reads the - `ChangeClassification` and emits a structural patch over - the compiler's Rust source. Each `ChangeKind` has a patch - template; the generator composes templates. -3. **Bridge build.** The committed stage0 compiles the OLD - `.dag` source → reproduces the committed Rust state. The - patch from step 2 applies to that Rust → patched Rust → - rebuild → **bridge binary that understands the new schema**. -4. **Bridge compile.** The bridge binary compiles the NEW - `.dag` source → stage1 Rust. (This is where the new schema - is first seen by a compiler that knows about it.) -5. **Fixed-point verification.** Stage1 compiles the NEW `.dag` - source → stage2 Rust. Assert `stage1 == stage2` by - construction. If the patch was correct, convergence holds - in one step. - -Every step is either structural (walks substrate as data) or -mechanical (applies a patch). Zero manual intervention. Every -decision is either "what does the diff lens report" or "what -does the patch template expand to" — both are data. - -### §10.2 `ChangeKind` enumeration - -The schema-diff lens produces one of these per delta. Phase 1 -targets the first five (~80% of real changes in v2 history); -Phase 2 subsumes the rest as L3 completes. - -| ChangeKind | Example | Patch shape | Phase | -|---|---|---|---| -| **`AddField { decl, name, type, default }`** | Adding `result_port: PortId` to `BindNode` | Walk every `BindNode { … }` literal in Rust source, insert `result_port: ` in the initializer. Add field to the struct def. | 1 | -| **`AddVariant { enum, name, payload_type }`** | Adding a new `Behavior::NewThing(NewThingNode)` variant | Add variant to the enum def. For every `match behavior` in Rust source that's not `#[non_exhaustive]`, add a `Behavior::NewThing(_) => unimplemented!("scaffolded")` arm with a ratchet comment. New emitter/infer paths for the variant land via `rust.dag` and `infer.dag` declarations — NOT as hand-written Rust. | 1 | -| **`RenameField { decl, old, new }`** | `BindNode.value` → `BindNode.result_port` | Mechanical find-and-replace on the field name, scoped to the containing struct. Handles field-access sites and struct-literal sites. | 1 | -| **`RenameType { old, new }`** | `Declaration` → `DeclarationRef` (the v3_l1 sentinel rename warm-elk just landed) | Find-and-replace on the type name. Needs to handle both `type Declaration` in `.dag` and all Rust-side consumers. Scoped to not touch unrelated identifiers with the same string. | 1 | -| **`RemoveField { decl, name }`** | Deleting a deprecated field | Audit every reader of the field. If the field has become derivable from other fields, route readers through the derivation. If not, fail-closed — manual review required. Phase 1 tolerates "fail with diagnostic listing every reader" as acceptable output. | 1 | -| **`ChangeFieldType { decl, name, old_type, new_type }`** | `String` → `DeclarationId` (exactly what happened in PR #445's name-to-id migration) | Requires a **value converter** — a `.dag` function that takes `old_type` and returns `new_type`. For simple cases (string → structured ID via lookup) the converter is declarable. For complex cases the converter is a follow-up PR. | 1 for simple converters, 2 for complex | -| **`NewInferenceRule`** | Adding a new inference rule for a new substrate variant | Not a patch — it's additive `.dag` source the old compiler doesn't understand semantically but CAN parse. Falls out of Prereq 0 (template instantiation) + L3 Stage 3 (infer as `.dag`). | 2 | -| **`NewEmitterPath`** | Adding emit support for a new variant | Not a patch — it's a new `rust.dag` declaration. The emitter reads `rust.dag` as data. Falls out of L3 Stage 1 (emit as `.dag`). | 2 | -| **`Arbitrary`** | Anything not classifiable above | Fail-closed, escape-hatch "manual stage0 edit required." Tracked by a numeric ratchet; each use reduces the ratchet budget. | 1 escape hatch | - -**Phase 1 covers the common cases.** AddField, AddVariant, -RenameField, RenameType, RemoveField, and simple -ChangeFieldType. In v2's history, these account for the vast -majority of schema changes. The escape hatch (`Arbitrary`) -handles the remaining edge cases with an explicit manual-edit -receipt — not silently, visibly. - -**Phase 2 is not a separate design project.** When L3 (pipeline -stages in `.dag`) completes, the compiler's own behavior is -expressed as declarations — new inference rules, new emitter -paths, new lowering paths are all data edits. At that point, -every schema change classifies as one of the Phase 1 patches -over the substrate declarations, and the "new semantics" -cases become declaration additions in the companion files -(`rust.dag`, `infer.dag`, etc.). The Phase 2 patch language -is the declaration language; no separate Phase 2 effort. - -### §10.3 Patch language technology — Option C upfront - -Three ways to build the patch layer in Phase 1: - -- **Option A — syn-based Rust transformer.** Build the patch - generator in Rust using `syn`/`quote` to parse old Rust, - structurally transform, emit new Rust. Rust-native, leverages - existing tooling. Fastest path to a working Phase 1. **But** - creates a Rust-side scaffold that has to retire when L3 - completes — and retirement friction tends to delay retirement. -- **Option B — string-level search-and-replace.** Simpler but - brittle, silent failures on edge cases. **Rejected.** -- **Option C — native `.dag` patch language, compiled into - Rust-source transformations at emit time.** The patch - generator is a `.dag` lens that reads `ChangeClassification` - declarations and produces patch declarations. The patch - applier is another `.dag` program that walks those - declarations and emits transformed Rust source via the same - `emit_rust` pipeline everything else uses. No Rust-side - scaffold; the patch language is `.dag` from the start. - -**Decision: Option C upfront.** Rationale: - -1. **Front-loads the decisions.** Going C upfront means the - schema-migration work directly exercises reflection's second - consumer (the schema-diff lens) and forces any substrate - extensions the lens surfaces to land as prerequisites. - Option A would defer those decisions behind a Rust scaffold - that later has to retire. -2. **Phase 2 falls out of Phase 1 without a redesign.** In - Option C, the patch language IS `.dag`. As L3 stages - migrate, the emitter-side components of the patch language - come into `.dag` alongside the rest of the emitter. The - patch language doesn't shrink or dissolve; it grows through - the same migrations everything else does. -3. **The patch language is the first real user of reflection - beyond lenses.** Building it validates that reflection works - for consumers that aren't toy analyses. That's the - strongest possible test of the framework. -4. **Same discipline as lenses-as-`.dag`-native.** If the - project's commitment is "lenses are `.dag` programs, not - Rust modules," then patches should be `.dag` programs too. - Different abstraction, same rule. - -**The cost of Option C is that Phase 1 takes longer to ship -than Option A would.** That cost is absorbed by the explicit -commitment: schema migration is a follow-up PR AFTER reflection -lands, not bundled with it. We're already paying for the wait -by staging the work; we might as well pay it for the purer -design. - -### §10.4 Phase 1 as follow-up PR - -Phase 1 schema migration is its own PR, NOT part of the -reflection PR. Reasons: - -- The reflection PR is already carrying substantial scope - (substrate declarations, prereq slate, `lens_unused_parameters` - migration). Bundling schema migration doubles that scope. -- Phase 1 needs reflection + `std/string.dag` + potentially - `std/ast/rust.dag` (declaring Rust's AST as a substrate type - for the patch emitter to walk). These are substantial - prerequisites that aren't needed for the reflection PR's - core. -- Separating the PRs gives clean review focus. Reflection's - reviewers don't have to reason about schema migration; schema - migration's reviewers don't have to re-litigate reflection. - -**Acceptance criteria for the Phase 1 PR:** - -- [ ] `dsl/lenses/schema_diff.dag` exists, walks two Dag values - from two substrate versions, and produces a - `ChangeClassification` -- [ ] `dsl/lenses/schema_patch.dag` exists, reads a - `ChangeClassification` and produces a structural patch - declaration -- [ ] Patch applier emits transformed Rust source for AddField, - AddVariant, RenameField, RenameType, RemoveField, and - simple ChangeFieldType -- [ ] `Arbitrary` escape hatch exists with a numeric ratchet - (starts at some count representing "manual edits allowed," - monotonically decreasing toward zero) -- [ ] At least one real v2 → v3 schema migration history - incident is reproduced via the pipeline, with byte-identical - output to whatever v2 produced historically -- [ ] `dsl/gunbc/bootstrap.dag`'s decorative types (`CompilerStage`, - `TransformContract`, etc.) are either wired to real - consumers or deleted as dead code. The decorative-modeling - debt from v2 is retired. - -**Dependency on reflection:** Phase 1 cannot start until -reflection ships (it needs the substrate-as-data for the -schema-diff lens). Phase 1 CAN proceed in parallel with L2 -consumer migrations once reflection lands — they're independent -work streams. - ---- - -## §11. Per-stage fixed-point from day one - -**Problem.** v2's regen fixed-point check fires at a file-level -diff. When pass1 != pass2, the output is "some file differs" -with no indication of which compiler stage produced the -divergence. The 2024 dark-emu-36-pr3 incident spent hours -localizing the divergence to the Resolve stage by hand. - -**Fix (v3 should build from day one).** The regen loop captures -per-stage output and compares pass1 and pass2 at every stage -boundary. When divergence is detected, the error names the -first stage that diverged, emits a per-stage structural diff, -and points at the specific declaration or behavior that -differs. - -**Implementation shape.** A `.dag` lens walks two Dag values -(pass1 and pass2 outputs) and produces a structural diff. This -is **the same lens** used by the schema-migration work in §10 -— `dsl/lenses/dag_diff.dag` or similar. The fixed-point check -in regen reuses it with different inputs: compare pass1 pre- -and-post each pipeline stage. - -**Why from day one.** v3's regen flow is simpler than v2's -right now because there's less accreted tooling. Adding per- -stage diffing at first regen is cheap; retrofitting it after -pain is expensive (exactly what v2 is discovering). - -**Acceptance criteria:** - -- [ ] `regen.sh` (or equivalent) captures per-stage Dag snapshots - during pass1 and pass2 -- [ ] Fixed-point check runs `dag_diff.dag` at each stage - boundary -- [ ] Divergence reports the first stage that diverged and - the structural delta -- [ ] Tested against a synthetic divergence (intentionally break - one stage, verify the error correctly identifies it) - -**This section graduates to L1 (part of the reflection PR or -immediate follow-up) because it uses the same schema-diff lens -that §10 builds.** The lens has two consumers: schema migration -(comparing substrate versions) and per-stage fixed-point -(comparing compile passes). Building it once for both is -cheaper than building it twice. - ---- - -## §12. Hand-maintained file inventory at M3 start - -**Problem.** v2 has two hand-maintained Rust files in stage0 -(`cli_run.rs` for the Run handler, `v2_interpreter.rs` for the -interpreter) that are excluded from the fixed-point diff. -Those two files aren't documented as "permanently hand- -maintained" anywhere authoritative; they're discovered by -people hitting the exclusion list. Neither has a named plan -for eventual dissolution. - -**Fix.** v3's M3 plan declares **explicitly** which files are -permanently hand-maintained, with the chicken-and-egg for each. -Declaration not discovery. - -**The invariant:** a file in the hand-maintained set MUST have -a receipt that names (a) the specific chicken-and-egg dependency -that makes it hand-maintained, (b) the dissolution trigger that -would retire it, and (c) whether retirement is realistic -(examples: "needs the interpreter in `.dag`" — likely retirable; -"needs a Rust runtime binding for stdin/stdout" — probably -permanent). - -**v3's hand-maintained set at M3 start — TO BE FILLED IN during -M3 planning.** Placeholder entries, each with a planned -receipt: - -- **`src/v3/compiler/src/bootstrap.rs`** — the file that - registers the V3_SPECS list and composes the bootstrap Dag. - Hand-maintained because it's the seed that compiles the - `.dag` pipeline; it has to exist in Rust before any `.dag` - can run. **Dissolution:** when the `.dag` pipeline is fully - self-hosting, `bootstrap.rs` shrinks to "read the files, call - parse.dag's compiled function" — ~20 lines of glue. Probably - never zero, but bounded. -- **A minimal Rust tokenizer** — probably needed to bootstrap - `parse.dag`. The tokenizer is the innermost layer and is - likely the last thing to migrate. **Dissolution:** when - `tokenize.dag` (if it lands) can produce the same token - sequence. Maybe never; tokenizers are string-heavy and the - cost of a `.dag` version vs a tiny Rust version may not be - worth it. -- **TBD** as M3 scope crystallizes. Each entry follows the - receipt template above. - -**The rule: the set is declared, not accreted.** Every PR that -adds a file to the hand-maintained set MUST update this section -with the receipt. No silent additions. If the set is larger -than 3 files by M3 start, that's a signal the bootstrap is too -ambitious and scope needs revisiting. - -**This section updates as M3 planning begins.** Today it's a -placeholder; it becomes load-bearing when the M3 milestone is -active. - ---- - -## §13. Perf audit pattern - -**Lesson from v2.** v2's self-compile perf cliff was never -clones. The actual cost was **fact re-derivation** — functions -named `merge_envs`, `combine_*`, `build_*_from_*` that walked -upstream data and reconstructed facts the upstream already had. -The 2024 dark-emu fix was 6 lines: stop rebuilding the -`InternTable` in merge_envs, thread the existing one through. -68× speedup on reconcile. - -**The audit pattern.** A grep for `merge_*`, `combine_*`, -`build_*_from_*` (and similar "take things apart and put them -back together" verbs) finds the candidate sites. For each hit, -ask: **is this function computing a fact that an upstream -stage already had?** If yes, it's a re-derivation. The fix is -to thread the upstream fact through instead of recomputing. - -**This is `feedback_perf_is_dependency_modeling` applied -concretely.** The memory entry already says "re-derivation = -poor dependency modeling." §13 gives the audit tool: grep for -verbs of reconstruction, inspect each, thread the upstream -fact where found. - -**v3 perf work should start with this audit.** Every -performance concern on v3's self-compile loop goes through the -re-derivation filter first. Clone-counting comes second, if -ever. The thesis-aligned claim is: **if v3 has perf problems, -they'll be in the places where the compiler is recomputing -substrate facts that should be carried forward as typed edges.** - -**Cross-reference with consumer migrations.** Every v2 `annotate_*` -helper that becomes a substrate field read in the complexity -lens migration (see `docs/substrate-reflection-design.md` §12.5 -M1) is also a perf win by the same mechanism: the facts stop -being reconstructed and start being read. - ---- - -## §14. Test generation as a structural lens - -**Problem.** v2 forgot testgen. Tests were hand-written, -coverage was ad-hoc, and the thesis's KF-3 claim ("add a type -→ verification appears") was never delivered empirically. When -structural bugs were possible, they were caught by reviewer -diligence, not by generated coverage. This is exactly the kind -of commitment that needs to land early — before the surface area -grows to where manual coverage can't keep up. - -**Principle.** The compiler knows the complete shape of every -type and every function signature. It can enumerate all -structurally valid inputs, all variant combinations, all -boundary cases. The only thing it CANNOT determine is whether -the behavior the developer intended is the behavior the program -produces. That question — "is this what I want?" — is the -developer's job. Everything else is mechanically derivable. - -**The three testgen layers:** - -### §14.1 Structural testgen (from types) — lands at L1.5 - -A type declaration is a complete specification of what values -are valid. From that specification, the compiler generates: - -- **Inhabitant witnesses.** For every Conj, generate at least - one structurally valid instance (all-zero, all-boundary, - mixed). For every Disj, generate one instance per variant. - For nested types, generate compositionally — `List>` - generates `Empty`, `Cons(Some(0), Empty)`, - `Cons(None, Empty)`, etc. -- **Coercion tests.** For every pair of types that should NOT - be coercible, assert the compiler rejects the coercion. These - are the negative space — proving the type system doesn't - accept what it shouldn't. -- **Exhaustiveness witnesses.** For every Disj consumed by a - match, generate a test per variant that exercises each arm. - -**Authority types: extend existing `dsl/std/verification.dag`.** - -v2 already declares the test authority types: - -```dag -// dsl/std/verification.dag (EXISTING — single authority) -type AssertKind = AssertEqual | AssertTrue | AssertSome | AssertNone -type TestClaim { kind: AssertKind, label: String } -type TestCase { name: String, claims: List, ignored: Bool } -``` - -L1.5 EXTENDS this schema (same file, same authority) with -the structural predicates testgen needs. The extension adds -`AssertKind` variants for compiler-verifiable properties: - -```dag -// Added to dsl/std/verification.dag at L1.5: -// AssertCompiles — program compiles with zero diagnostics -// AssertFailsWith — program fails with named diagnostic kind -// AssertPortResolved — named bind's output is Resolved -// AssertPortUnresolved — named bind's output is Unresolved -// AssertCostBelow — structural cost at or below bound -// AssertCostAbove — structural cost above floor -``` - -Each new `AssertKind` variant is a standard verification -predicate grounded in existing substrate facts (`PortState`, -`Diagnostic`, `CostLens` output). No new opaque carriers — -`subject` is a `TestClaim.label` string (the .dag source text), -and `kind` is an `AssertKind` variant that names the substrate -property being checked. - -Every backend renders TestCase to its test framework — -`#[test]` in Rust, `func Test...` in Go, `def test_...` in -Python. Same pattern as type emission through RealizationIndex. - -**Why at L1.5.** The types in `std/` already exist. Structural -testgen reads them and emits test cases. This requires no lens -infrastructure beyond what L1 provides — it's a walk over -declarations, same as `emit_rust` but targeting test programs -instead of production code. Landing this at L1.5 means every -subsequent type added to `std/` gets test coverage -automatically. The clean bootstrap process is itself tested by -generated tests from day one. - -### §14.2 Behavioral testgen (from transforms) — lands at L2.6 - -A function signature declares its input and output types. From -those types, the compiler generates test cases that exercise -every structurally valid input and verify the output satisfies -the declared return type. - -- **Input enumeration.** The function's parameter types define - the space of valid inputs. For bounded types (Disj with finite - variants, Conj with known field types), enumerate all - combinations up to a configurable depth. For unbounded types - (List, recursive structures), generate small witnesses - (empty, singleton, two-element). -- **Output verification.** Each generated input is passed to - the function. The output must inhabit the declared return - type. This catches: wrong return type (already caught by type - checking, but verified at runtime too), partial functions - that crash on valid inputs, and unexpected divergence between - the type-checked program and the emitted code. -- **Boundary cases from effects.** When a function carries - effect annotations (L2 M3), generate tests at effect - boundaries — the inputs that trigger each effect branch. - -**Why at L2.6 (not earlier).** Behavioral testgen needs to -execute the generated test programs, which requires the emit -pipeline + a working target compiler. L1.5's structural testgen -validates types statically. L2.6's behavioral testgen validates -behavior dynamically. - -### §14.3 Mock generation + dry-run mode — lands at L2.6 - -**The environmental boundary problem.** `ExternalRealization` -bodies have type signatures but no executable bodies. The -compiler can't test composition chains that pass through -external dependencies without a mock. - -**MockRealization.** A type-correct stub generated from the -arrow signature of an `ExternalRealization`. For a function -`fn read_file(path: String) -> Result`, the mock -returns a structurally valid `Result` — the identity value for -the return type's algebra, or a generated inhabitant witness if -no algebra exists. - -The mock type must make invalid states unrepresentable. A mock -that returns a value not inhabiting the source arrow's return -type should be structurally impossible to construct. The mock's -return value is not a raw `Value` — it's a typed reference to -an inhabitant witness of the source declaration's return type: - -```dag -type MockRealization { - source: DeclarationId // which ExternalRealization - strategy: MockStrategy // how to generate return values -} - -type MockStrategy - = DefaultInhabitant - // Compiler generates the return type's default witness. - // Always valid — the witness is computed from the type. - | InhabitantOf { witness: DeclarationId } - // Return a specific declared witness of the return type. - // The DeclarationId must inhabit the source's return type - // (checked at construction by the same inhabitance walk - // used for record literals). Invalid witnesses are a - // compile error, not a runtime surprise. -``` - -`FixedValue { value: Value }` and `FailWith { error: Value }` -from the earlier sketch are removed — raw `Value` payloads -admit invalid states. `InhabitantOf` replaces both by -requiring the mock value to be a declared inhabitant of the -correct type. The compiler verifies inhabitance at mock -construction time, not at dry-run time. - -**Dry-run mode.** Execute the pipeline (or any composed -function chain) with MockRealizations substituted for all -`ExternalRealization` bodies. This verifies: - -1. Typed boundaries hold at runtime (not just at compile time). -2. The composition chain doesn't crash on structurally valid - inputs. -3. Effects compose as declared — no unexpected ordering - dependencies or state mutations. - -Dry-run is the direct answer to the "environmental boundary" -bug class. The compiler eliminates structural bugs by -construction; testgen eliminates behavioral bugs by exhaustive -enumeration; dry-run eliminates environmental bugs by -simulation. - -### §14.4 Composition testgen (from pipelines) — lands at L3 - -Once pipeline stages are in `.dag`, the pipeline itself is a -composition chain that testgen can analyze: - -- **Inter-stage contract tests.** For each stage boundary, - generate tests that verify the output of stage N is a valid - input to stage N+1. These are the typed pipeline contracts - from §2.1, verified at runtime. -- **Provenance tests.** For each field produced at stage N and - consumed at stage K, generate a test that traces the field - through the intermediate stages. If a stage drops the field, - the test catches it. -- **Regression tests from diffs.** When a `.dag` source file - changes, testgen compares the before/after type signatures - and generates tests for every affected boundary. These are - targeted regression tests, not full re-enumeration. - -**The thesis's KF-3 claim becomes empirical at L1.5 (structural) -and progressively stronger through L2.6 (behavioral + mock) and -L3 (compositional). By L4, every thesis claim that CAN be -tested IS tested — automatically, by generated tests that the -developer never writes.** - -### §14.5 Invariant lenses — self-enforcement from code - -Every invariant in `INVARIANTS.md` that has a structural test -should become a lens that runs against the compiler's own code. -This serves three purposes: (a) catches invariant violations -during development, (b) validates the lens mechanism itself on -real programs, and (c) creates a regression gate that prevents -reintroduction. - -**Category A — invariants that are directly lensable:** - -| Invariant | Lens name | What it reads | Ships at | -|---|---|---|---| -| Layer opacity | `lens_layer_opacity` | Hardcoded below-boundary strings in consumer code | L1.5 | -| Decidability | `lens_termination` | Every call pattern lowers to bounded primitive | Current | -| Unused parameters | `lens_unused_parameters` | Parameters not read by function body | L1 | -| Tight bounds | `lens_complexity` | Every function has `Proven`, not `Conservative` | L2 M1 | -| No duplicate representations | `lens_single_authority` | For each fact, one declaration is authority | L2 | -| No case enumeration | `lens_structural_dispatch` | String-keyed match where structural walk exists | L2 | -| Cost algebra upstream | `lens_cost_coverage` | Every primitive has a `CostExpr` in algebra | L2 M1 | - -**Category B — invariants lensable after modeling work:** - -| Invariant | What's missing | Ships at | -|---|---|---| -| Facts flow forward | Per-field provenance across stages (SubValueRelation) | L2+ | -| No fabrication fallbacks | Effect typing — catch-and-default has different effect | L2 M3 | -| Heuristics = lost structure | Proxy: string comparison on a value that has DeclarationId | L2.6 | -| Root-cause depth | Compiler's own dependency graph as data | L3+ | - -**Category C — process rules with structural proxies:** - -| Invariant | Can't detect | Structural proxy | -|---|---|---| -| Progress Is Dissolution (`INVARIANTS.md#p5-progress-is-dissolution`) | Intent (is this adapter temp?) | Two-representation detection: `fn(A) -> B` where A ≅ B; bridge vs legitimate transform | -| Modeling faithfulness | External grounding | No proxy — requires domain knowledge | - -**The self-analysis loop.** Once L3 pipeline stages are in `.dag`, -every Category A lens runs against the compiler's own pipeline -code. `lens_layer_opacity` on `emit.dag` catches hardcoded type -names. `lens_complexity` on `parse.dag` reports the parser's -cost. `lens_unused_parameters` on `infer.dag` finds dead -parameters. This is the thesis's "compiler analyzes itself" claim -(§7), applied incrementally — each lens validates both the -invariant and itself when run against real compiler code. - -**Before L3 (while compiler is still Rust).** Category A lenses -can run against the `.dag` portions of the codebase (std/, -extdeps/, user programs, lenses themselves) from L1.5 onward. -The Rust compiler code is NOT lensable until it migrates to -`.dag` at L3. But every `.dag` lens file IS lensable by other -lenses — so `lens_unused_parameters` running on -`complexity.dag` validates both the invariant enforcement and the -lens mechanism. Lens-on-lens is the earliest self-analysis -available. - -**Acceptance criteria for each Category A lens:** - -1. The lens runs against at least one `.dag` fixture and - correctly identifies a planted violation. -2. The lens runs against the compiler's own `.dag` files (std/, - extdeps/, lenses/) and reports the current violation count. -3. A CI ratchet gates the violation count at zero (or at the - current count, monotonically decreasing). -4. When the underlying invariant's structural prevention is - complete, the lens reports zero violations — the invariant - is self-enforcing and the lens becomes a regression gate. - -### §14.6 Diagnostics as corrections — show the fixed code - -**Thesis ref:** THESIS.md §"Error handling: show the correct -code." - -**The claim:** when the compiler finds a broken causal link, it -doesn't just report the error — it shows the fix. Because the -system is closed and the compiler has full structural knowledge, -it knows the finite set of ways to make the code correct. A -diagnostic is not "error on line 42." It is: what's wrong (the -broken causal link), why it's wrong (the structural -contradiction), and how to fix it (the literal corrected code). - -**Current state.** R3 Gap 9 row #106 has moved the v3 -`Diagnostic` surface to a mandatory `correction: Correction` -carrier in `src/v3/std/diagnostics.dag`. The remaining gap is not -field presence; it is retiring every `DeferredCorrection` by adding -class-by-class live witnesses and roundtrip coverage. - -**Target shape.** Every diagnostic carries a `Correction`: - -```dag -type Correction - = LiveCorrection { witness: CorrectionWitness } - | DeferredCorrection { reason: String, retirement_plan: RetirementPlan } - -type CorrectionWitness { - description: String - span: SourceSpan - new_source: String -} -``` - -`Correction` is computable because the compiler has full -structural knowledge of what's valid: - -| Diagnostic | Correction shape | Why computable | -|---|---|---| -| NonExhaustiveMatch | LiveCorrection: add all missing arms in one edit | Compiler knows the Disj's full variant set | -| TypeMismatch | LiveCorrection when one source-level rewrite is known; otherwise DeferredCorrection | Compiler knows both types and the valid coercions, but not every semantic choice has one canonical edit yet | -| FieldNotFound | LiveCorrection when one field repair is canonical; otherwise DeferredCorrection | Compiler knows the Conj's field set | -| ArityMismatch | LiveCorrection when arity repair is canonical; otherwise DeferredCorrection | Compiler knows the Arrow's parameter count | -| UnboundedRecursion | LiveCorrection when descent evidence is derivable; otherwise DeferredCorrection | Compiler knows the input type's sub-structure | -| ComplexityUnknown | LiveCorrection when the sub-value argument is derivable; otherwise DeferredCorrection | Compiler knows the cost algebra | -| LayerOpacityViolation | LiveCorrection when the typed replacement is known; otherwise DeferredCorrection | Lens knows the typed alternative | - -**The test pattern (three assertions per diagnostic):** - -``` -broken_source → compile → diagnostic with correction - ↓ - apply correction to broken_source → corrected_source - ↓ - compile corrected_source → succeeds (zero diagnostics) -``` - -This is a roundtrip test: break it, get the fix, apply the fix, -verify the fix works. Three properties tested: -1. **Detection** — the diagnostic fires on the broken program -2. **Fix correctness** — the suggested correction compiles -3. **Fix completeness** — the corrected program has zero - diagnostics (the fix didn't introduce new problems) - -For lens diagnostics specifically, the roundtrip is even -stronger: the lens should report zero violations after the -correction is applied. This validates that the lens and the -correction agree on what "correct" means. - -**When to build.** This is NOT M4. The correction field should -land on the Diagnostic type at **L1.5** (alongside the test -authority types) and the first roundtrip tests should cover the -five current diagnostic variants immediately. Every lens that -ships after L1.5 must include correction computation from day -one — not as a polish step after the lens works, but as part of -the lens's acceptance criteria. The test pattern above is a -gating requirement for every new diagnostic and every new lens. - -The gate #58 timing-lens enforcement scaffold is the only legacy -pre-L1.5 exception in this section. It predates the mandatory -`Correction` carrier and currently emits `DeferredCorrection` with a -row-#106 retirement plan because the host-side enforcement diagnostic -does not yet retain a source span for the offending timing -measurement/budget literal. That test must ratchet the explicit -retirement plan, not treat deferral as acceptable steady state; closing -row #106 requires replacing it with a `LiveCorrection` roundtrip. - -**Why ASAP matters.** If corrections are deferred until M4: -1. Every lens ships without fix suggestions, and adding them - later means re-understanding each lens's error semantics -2. Users of the system (including the self-hosting pipeline) - get error-only diagnostics for the entire L2-L3 period -3. The thesis claim is untested until the very end - -If corrections ship at L1.5: -1. Every subsequent lens inherits the correction pattern -2. The self-hosting pipeline gets fix suggestions from day one -3. The roundtrip test validates both detection and correction - for every diagnostic that exists - -**Acceptance criteria:** - -- [x] Diagnostic type carries mandatory `correction: Correction` -- [ ] All five current variants (TokenizerError, ParseError, - TypeMismatch, ArityMismatch, ResolveError) compute a - correction where structurally possible -- [ ] At least one roundtrip test per current variant: break → - diagnose → apply correction → recompile → zero diagnostics -- [ ] Every new lens's acceptance criteria includes: "the lens - produces a correction for each violation it reports" and - "applying the correction eliminates the violation" - -### §14.7 Rendering from root facts — dedicated parallel track - -**Full design:** [`docs/dependency-and-rendering-design.md`]( -../../docs/dependency-and-rendering-design.md). - -**The core insight.** Ownership, scope, parallelism, and -complexity are not separate analyses — they emerge from the -composition of .dag's computation model (`Immutable`, `Pure`, -`ExplicitDAG`, `Bounded`) and the target's execution model -(`ValueOnly`, `GarbageCollected`, `RefCounted`, -`OwnershipBased`). Three of four target classes dissolve the -ownership question entirely. The rendering for any .dag -program on any target is: -`ComputationModel × TargetExecutionModel × DAG structure`. - -**Why this dissolves v2's 719 lines.** v2's emitter started -with "clone everything" (20-minute self-compile, FF-1). The -fix was 719 lines of fact reconstruction in `ownership.dag`. -v3 declares the root facts in `std/computation_model.dag` and -the target model in the realization spec. The rendering falls -out of the composition — no reconstruction. - -**Phasing (design doc §9):** - -| Phase | When | What | -|---|---|---| -| Phase 1 | L1.5 | `std/computation_model.dag`. `TargetExecutionModel` in specs. Emitter gates ownership on target memory. Conservative callable defaults. `is_copy` on leaf types. Clone count ~6. | -| Phase 2 | L2 | `ParameterCrossing` analysis (body-walk for .dag, declared for external). `is_copy` composition. Last-crossing-use. Clone count → 1. | -| Phase 3 | L2+ | Parallelism Rc/Arc. Complexity reads crossing facts. Multi-target validation. | -| Phase 4 | L3 | Self-analysis. Clone count zero. Same DAG → Rust + Go → both correct. | - -**Acceptance criteria:** - -- [ ] `std/computation_model.dag` declares root facts -- [ ] Target execution models in realization specs -- [ ] Emitter gates ownership stage on target memory model -- [ ] Clone count: ~6 (Phase 1), 1 (Phase 2), 0 (Phase 4) -- [ ] Multi-target: same .dag → Rust + Go → both correct - ---- - -## §15. When this doc updates - -`SELF_HOSTING.md` is a living design note. It evolves as: - -- Each pipeline stage migration starts — the relevant section - graduates from "plan" to "in-flight," with real - implementation details replacing the current speculation. -- Substrate extensions surface during migration — each becomes - a tracked item, either moved into a follow-up prereq PR or - absorbed into the stage's own scope. -- Open questions resolve — the list in §8 shrinks as decisions - land. -- The meta-circular bootstrap test lands — §7 moves from - design to documentation of the real test. -- Testgen layers ship — §14 sections graduate from "plan" to - "tested" as each layer's fixture suite lands. - -**When this doc is complete.** The v3 compiler is fully -self-hosting and Rust stage0 is vestigial. At that point this -doc is archived as a historical record of the migration path, -and ongoing compiler work happens in the `.dag` pipeline files -directly. diff --git a/src/v3/compiler/Cargo.toml b/src/v3/compiler/Cargo.toml deleted file mode 100644 index 0575563f956..00000000000 --- a/src/v3/compiler/Cargo.toml +++ /dev/null @@ -1,99 +0,0 @@ -[package] -name = "v3-compiler" -version.workspace = true -edition.workspace = true -license.workspace = true -# PB-1-e / Zero-Floor: `regen_bootstrap` is the only bin that enables -# `bootstrap-regen-fresh`; listing bins explicitly keeps that boundary -# without Cargo silently promoting a new `src/bin/*.rs` driver. -autobins = false - -[features] -# Fresh tokenize/parse/lower bootstrap for `regen_bootstrap` only — not part of -# the default `v3-compiler` library build graph (production uses snapshots). -bootstrap-regen-fresh = [] - -# Cross-crate **tests** that need a declaration graph without bootstrap rows -# (e.g. E-6 empty-`dag` witnesses). Off by default so production dependency graphs -# cannot construct this substrate-invalid state without opting in. -empty-substrate-for-tests = [] - -# Opt-in DeclarationId witness constructor (`declaration_id_raw_for_testing`) -# for dependent crate tests that bail before dereferencing substrate ids (see `declaration_id_raw_for_testing`). -declaration-id-raw-test-witness = [] - -# M0: the smallest v3 pipeline that exercises the full substrate. -# parse -> lower to L1 behaviors -> infer types through Ports -> -# emit diagnostics via the enforced mark_unresolved API -> one lens. -# -# No code emission (that is M1). No self-hosting (M3). No generics, -# no Optional, no service calls (M2). Five L1 behaviors hardcoded -# in Rust; std/-backed dispatch lands in M1. -# -# `libc` is Unix-only: process-group + kill for `ExecuteCommand` (PB-Runtime). -[dependencies] -# R3 Substrate Rust-primitive-full-coverage (Director Path A RATIFIED at -# gunbc#1739 #issuecomment-4392731264): `IntervalInt::ExactInterval` host -# repr widens to `BigInt` to admit `u128::MAX`. -num-bigint = { workspace = true } -# W3 / T-38 + T-22: `emit_host_bridge.rs` + `emit_host_eval.rs` → `tools/emit_host_runner`. -emit_host_runner = { path = "../../../tools/emit_host_runner" } - -[target.'cfg(unix)'.dependencies] -libc = { version = "0.2", default-features = false } - -[dev-dependencies] -# R3 C1 — Tier-3 mirror dissolution perf budget (Phase 1 baseline capture); see -# `docs/briefs/r3-pb-tier3-perf-budget-worker.md` deliverable 0a/0b. -criterion = "0.5" -ci_affected_components = { path = "../../../tools/ci_affected_components" } -serde = { workspace = true } -serde_json = { workspace = true } -serde_yaml = { workspace = true } -sha2 = { workspace = true } -# T-V2 G-1 manifest ratchet: structured Cargo.toml walk (`toml` value parse). -toml = { workspace = true } - -[[bench]] -name = "tier3_mirror_perf" -harness = false - -[[bin]] -name = "regen_bootstrap" -path = "src/bin/regen_bootstrap.rs" -required-features = ["bootstrap-regen-fresh"] - -[[bin]] -name = "regen_lens" -path = "src/regen_lens_entry.rs" - -[[bin]] -name = "regen_parse" -path = "src/bin/regen_parse.rs" - -[[bin]] -name = "regen_parse_tables" -path = "src/bin/regen_parse_tables.rs" - -[[bin]] -name = "regen_tokenize" -path = "src/bin/regen_tokenize.rs" - -[[bin]] -name = "regen_v3" -path = "src/bin/regen_v3.rs" - -[[bin]] -name = "self_host_fixed_point" -path = "src/bin/self_host_fixed_point.rs" - -# R1C-E — `ExecuteCommand` logical child for T-Emit `.dag` `TestClaim` wrappers. -# Subcommands wrap `v3_compiler::r1c_e_gates::check_*` so the host `#[test]` -# harness and the `.dag`-driven gate share one implementation. -[[bin]] -name = "boundary_emit_gates" -path = "src/bin/boundary_emit_gates.rs" - -[[bin]] -name = "r1c_e_emit_gates" -path = "src/bin/r1c_e_emit_gates.rs" diff --git a/src/v3/compiler/benches/tier3_baseline.json b/src/v3/compiler/benches/tier3_baseline.json deleted file mode 100644 index 51314de2e96..00000000000 --- a/src/v3/compiler/benches/tier3_baseline.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "$schema": "C1 Phase 1 baseline format v1", - "captured_on": { - "host_id": "local-pr2702-phase1-38e365a05571", - "git_sha": "fbafcc8d38b55dbf9343a5946bc7085705bad401", - "criterion_version": "0.5", - "rustc_version": "rustc 1.93.0 (254b59607 2026-01-19)", - "captured_at": "2026-05-11T20:33:04Z" - }, - "mirror_groups": { - "computation": { - "claim": "tier3_computation_mirror_perf_within_budget", - "benches": [ - { - "name": "tier3_computation_positive_descent_count", - "median_ns": 14, - "p99_ns": 22 - }, - { - "name": "tier3_computation_lower_same_argument_call", - "median_ns": 4, - "p99_ns": 8 - } - ] - }, - "effect_carrier": { - "claim": "tier3_effect_carrier_mirror_perf_within_budget", - "benches": [ - { - "name": "tier3_effects_lane2_linear_read_chain", - "median_ns": 6, - "p99_ns": 12 - } - ] - } - } -} diff --git a/src/v3/compiler/benches/tier3_fixtures/README.md b/src/v3/compiler/benches/tier3_fixtures/README.md deleted file mode 100644 index 63545501d2b..00000000000 --- a/src/v3/compiler/benches/tier3_fixtures/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# Tier-3 mirror perf fixtures (C1) - -Phase 1 benchmarks in `../tier3_mirror_perf.rs` currently use **inline** -deterministic inputs (Peano depth 32, fixed `DescentEvidence` variants, a small -linear idempotent workflow). Shared corpus files for stricter like-for-like -Phase 1 vs Phase 2 comparison land when the Evaluator-backed bench harness -(`tier3_eval_perf.rs`, worker brief deliverable 2) is authored. diff --git a/src/v3/compiler/benches/tier3_mirror_perf.rs b/src/v3/compiler/benches/tier3_mirror_perf.rs deleted file mode 100644 index 80a21cb93f0..00000000000 --- a/src/v3/compiler/benches/tier3_mirror_perf.rs +++ /dev/null @@ -1,76 +0,0 @@ -//! Phase 1 — hand-Rust Tier-3 mirror timing (C1 perf-budget worker toward -//! `tier3_mirror_dissolution_perf_within_budget`). -//! -//! Tracks the historical four-slice mirror dissolution program in -//! `docs/briefs/r3-pb-tier3-perf-budget-worker.md`; active Phase-1 benches cover -//! the remaining computation / effect-carrier mirrors after termination and -//! induction retirement. See that brief for thresholds (≤2× median, ≤5× p99) -//! and Phase 1 / Phase 2 split. -//! -//! **Frozen baseline** (`tier3_baseline.json` alongside this bench): Phase-1 -//! committed median + p99 (ns) per budgeted `bench_function` (regen via -//! ``scripts/aggregate_tier3_baseline.py`` + procedure at -//! `docs/audit/c1-tier3-baseline-capture-procedure.md`). Ubicloud canonical -//! recapture uses `.github/workflows/tier3-baseline-capture.yml` (diff against -//! the committed JSON; baseline updates land only through PR). - -use criterion::{black_box, criterion_group, criterion_main, Criterion}; -use v3_compiler::dag::WorkflowEffect; -use v3_compiler::dag::{ - lower_call_pattern, positive_amount_from_i64, positive_descent_count, CallPattern, CallableRef, - HttpMethodScalar, InputField, Operation, PathTemplate, RestEndpointBinding, -}; -use v3_compiler::lane2_workflow_idempotency_report; -use v3_compiler::Dag; - -fn bench_computation_mirror(c: &mut Criterion) { - let steps = positive_amount_from_i64(32).expect("fixture Peano depth"); - c.bench_function("tier3_computation_positive_descent_count", |bencher| { - bencher.iter(|| black_box(positive_descent_count(black_box(&steps)))); - }); - - c.bench_function("tier3_computation_lower_same_argument_call", |bencher| { - bencher.iter(|| { - black_box(lower_call_pattern(black_box(CallPattern::SameArgumentCall))); - }); - }); -} - -fn bench_effect_carrier_mirror(c: &mut Criterion) { - let dag = Dag::new(); - let callable = dag - .declaration_by_name("get_method") - .expect("bootstrap should provide get_method declaration") - .id; - let read_op = Operation { - callable: CallableRef { decl: callable }, - inputs: std::collections::BTreeMap::::new(), - endpoint: RestEndpointBinding { - method: HttpMethodScalar::Get, - path: PathTemplate { tokens: vec![] }, - }, - }; - let workflow = WorkflowEffect::LinearEffect { - ops: vec![ - read_op.clone(), - read_op.clone(), - read_op.clone(), - read_op.clone(), - ], - }; - c.bench_function("tier3_effects_lane2_linear_read_chain", |bencher| { - bencher.iter(|| { - black_box(lane2_workflow_idempotency_report( - black_box(&dag), - black_box(&workflow), - )) - }); - }); -} - -criterion_group!( - tier3_mirror_phase1, - bench_computation_mirror, - bench_effect_carrier_mirror -); -criterion_main!(tier3_mirror_phase1); diff --git a/src/v3/compiler/build.rs b/src/v3/compiler/build.rs deleted file mode 100644 index 2575b641cd1..00000000000 --- a/src/v3/compiler/build.rs +++ /dev/null @@ -1,716 +0,0 @@ -// Build script: enumerate every `*.dag` file in the v3-only staged -// directories and generate Rust arrays of `(path, content)` pairs -// the bootstrap loader consumes. -// -// Generated arrays: -// - `STAGED_FILES` for `src/v3/std/*.dag` -// - `V3_SPECS` for `src/v3/spec/*.dag` -// - `COMPILER_FILES` for `src/v3/compiler/*.dag` (except `tokenize.dag`; see below) -// -// Adding a new staged std/spec/compiler file becomes a pure file-system change -// — no Rust edits to `bootstrap.rs`, no fixture-array maintenance, no skip-list drift. -// -// **Why a build script.** The pre-unwind shape used hardcoded -// `const RUST_DAG: &str = include_str!("../../spec/rust.dag");` -// constants in `bootstrap.rs`. PR #445 review flagged this as a -// duplicate-authority bug: the on-disk spec files and the Rust -// fixture array are two parallel representations of the same set, -// and adding a new target requires editing both. This script -// removes the parallel representation by deriving the arrays from -// the staged directories. -// -// **Load order.** The v3 lowerer doesn't strictly enforce import -// resolution at M1(3), but later spec files that reference -// declarations from earlier ones (e.g. rust.dag importing v3_l1's -// `Bind` marker) must follow them in load order. The script -// hardcodes one rule: `v3_l1.dag` (the substrate marker file) -// loads first; everything else follows in alphabetical order. The -// rule is the only special case because v3_l1 is the file every -// per-target spec depends on. If a future spec file introduces a -// dependency that needs sorting, this script grows a topological -// pass; until then, the simple rule is sufficient. -// -// Staged `src/v3/std/*.dag` additionally uses a small rank list -// (`list.dag`, `substrate*.dag`, …). Among files sharing the default rank, load order -// breaks ties using **`import v3.std.*` edges** parsed from each staged `.dag` plus a tiny -// [`V3_STD_BOOTSTRAP_STAGING_PRECEDES`] table for bootstrap-only holes (see -// `collect_std_staging_dependency_edges`). Dissolution: host-side full import-graph topo when the -// staged slice can consume the real `std` module graph without SCCs. -// -// **Output**: writes three Rust files: -// -// pub static STAGED_FILES: &[(&str, &str)] = &[ -// ("src/v3/std/list.dag", include_str!("...")), -// ]; -// -// pub static V3_SPECS: &[(&str, &str)] = &[ -// ("src/v3/spec/v3_l1.dag", include_str!("...")), -// ("src/v3/spec/rust.dag", include_str!("...")), -// ]; -// -// pub static COMPILER_FILES: &[(&str, &str)] = &[ -// ("src/v3/compiler/pipeline.dag", include_str!("...")), -// ]; -// `tokenize.dag` is intentionally omitted: tokenizer authority for `regen_tokenize` -// must not be folded into the bootstrap Dag (duplicate declarations when -// `compile_to_dag` parses that authority standalone on top of `Dag::new()`'s -// bootstrapped clone). `src/v3/std/parse_surface.dag` stays in the bundle so the -// production substrate matches the staged std surface; `regen_parse` and staging -// tests compile it via `compile_parse_surface_std_authority_dag` in -// `src/v3/compiler/src/lib.rs`, which boots from a clone that omits that staged -// fixture to avoid the duplicate-name path. -// -// `bootstrap.rs` uses `include!(concat!(env!("OUT_DIR"), ...))` to -// pull the arrays in. The `include_str!` calls inside the generated -// files resolve at compile time against absolute paths, so the -// runtime is still hermetic — no filesystem access at `Dag::new()` -// time. - -use std::cmp::Ordering; -use std::collections::{BTreeSet, HashMap, HashSet}; -use std::env; -use std::fs; -use std::path::{Path, PathBuf}; - -/// Bootstrap-only `(must_precede, importer)` edges among `src/v3/std/*.dag` that are **not** -/// expressed as `import v3.std.*` lines but are still load-order facts for PB-1: -/// -/// - `induction.dag` imports `std.algebra` / `std.computation` / `std.termination` without a -/// `v3.std.*` surface — without these edges, Kahn can emit `induction.dag` before `algebra.dag` -/// while `algebra.dag` still waits on `lookup.dag` (`UnknownCost` / `ConstantCost` in the -/// bootstrap snapshot). -/// - `t_ci_workflow_as_data_demo.dag` imports `v3.std.timing_lens` — `timing_lens.dag` must lower -/// first so gate #58 witness rows type-check. -/// -/// **Why not scan every `import std.*` line:** mirroring the full `std` module graph inside this -/// slice creates SCCs that strand `timing_lens.dag` / `t_ci_workflow_as_data_demo.dag` in the -/// lexical Kahn leftover bucket (`t_ci` `<` `timing_lens` breaks gate #58). Dissolution: host-side -/// full import-graph topo once the staged slice can consume the real graph without SCCs. -const V3_STD_BOOTSTRAP_STAGING_PRECEDES: &[(&str, &str)] = &[ - ("algebra.dag", "induction.dag"), - ("computation.dag", "induction.dag"), - ("termination.dag", "induction.dag"), - ("timing_lens.dag", "t_ci_workflow_as_data_demo.dag"), -]; - -/// For `src/v3/std` only: scan each staged `.dag` for `import v3.std.` lines and merge -/// [`V3_STD_BOOTSTRAP_STAGING_PRECEDES`] when both endpoints exist. -fn collect_std_staging_dependency_edges(entries: &[PathBuf]) -> Vec<(String, String)> { - let names: HashSet = entries - .iter() - .filter_map(|p| p.file_name().and_then(|s| s.to_str()).map(String::from)) - .collect(); - let mut out = Vec::new(); - for path in entries { - let Some(name) = path.file_name().and_then(|s| s.to_str()) else { - continue; - }; - let Ok(src) = fs::read_to_string(path) else { - continue; - }; - for line in src.lines() { - let t = line.trim_start(); - let Some(rest) = t.strip_prefix("import v3.std.") else { - continue; - }; - let mod_suffix = rest.split([' ', '{']).next().unwrap_or(""); - if mod_suffix.is_empty() { - continue; - } - let dep_file = format!("{mod_suffix}.dag"); - if dep_file == name || !names.contains(&dep_file) { - continue; - } - out.push((dep_file, name.to_string())); - } - } - for &(dep, importer) in V3_STD_BOOTSTRAP_STAGING_PRECEDES { - if names.contains(dep) && names.contains(importer) { - out.push((dep.to_string(), importer.to_string())); - } - } - out -} - -/// `edges` are `(must_precede, dependent)` file names: `must_precede` must sort before `dependent`. -/// -/// Returns a total rank per staged file name so `sort_by` can compare by integer index (Kahn -/// topological order with lexical tie-break among ready nodes). Reachability-only `cmp` is not a -/// strict weak order and can panic Rust's sort — see PR #2827 review. -fn std_v3_import_topo_ranks( - names: &[String], - edges: &[(String, String)], -) -> HashMap { - let name_set: HashSet<&str> = names.iter().map(String::as_str).collect(); - let unique_edges: HashSet<(String, String)> = edges.iter().cloned().collect(); - let mut adj: HashMap> = HashMap::new(); - let mut in_degree: HashMap = HashMap::new(); - for n in names { - in_degree.insert(n.clone(), 0); - } - for (d, u) in unique_edges { - if d == u { - continue; - } - if name_set.contains(d.as_str()) && name_set.contains(u.as_str()) { - adj.entry(d.clone()).or_default().push(u.clone()); - *in_degree.get_mut(&u).expect("u is a staged name") += 1; - } - } - let mut ready = BTreeSet::::new(); - for n in names { - if *in_degree.get(n).unwrap_or(&0) == 0 { - ready.insert(n.clone()); - } - } - let mut order = Vec::::new(); - let mut placed = HashSet::::new(); - while let Some(n) = ready.iter().next().cloned() { - ready.remove(&n); - if !placed.insert(n.clone()) { - continue; - } - order.push(n.clone()); - if let Some(succs) = adj.get(&n) { - for succ in succs { - let deg = in_degree - .get_mut(succ) - .expect("edge target is a staged name"); - *deg -= 1; - if *deg == 0 { - ready.insert(succ.clone()); - } - } - } - } - let mut leftover: Vec = names - .iter() - .filter(|n| !placed.contains(*n)) - .cloned() - .collect(); - leftover.sort(); - order.extend(leftover); - order.into_iter().enumerate().map(|(i, n)| (n, i)).collect() -} - -fn collect_dag_entries( - dir: &Path, - prioritized: &[&str], - scan_std_v3_import_edges: bool, -) -> Vec { - collect_dag_entries_impl(dir, prioritized, false, scan_std_v3_import_edges) -} - -fn collect_dag_entries_recursive(dir: &Path, prioritized: &[&str]) -> Vec { - collect_dag_entries_impl(dir, prioritized, true, false) -} - -fn collect_dag_entries_impl( - dir: &Path, - prioritized: &[&str], - recursive: bool, - scan_std_v3_import_edges: bool, -) -> Vec { - let mut entries = Vec::new(); - let mut dirs = vec![dir.to_path_buf()]; - - while let Some(current_dir) = dirs.pop() { - let mut child_dirs = Vec::new(); - for entry in fs::read_dir(¤t_dir) - .unwrap_or_else(|e| panic!("failed to read {}: {}", current_dir.display(), e)) - { - let entry = entry.unwrap_or_else(|e| { - panic!( - "failed to read dir entry in {}: {}", - current_dir.display(), - e - ) - }); - let path = entry.path(); - if path.is_dir() { - if recursive { - child_dirs.push(path); - } - continue; - } - if path.extension().and_then(|s| s.to_str()) == Some("dag") { - entries.push(path); - } - } - child_dirs.sort(); - for child_dir in child_dirs.into_iter().rev() { - dirs.push(child_dir); - } - } - - let import_edges_storage: Vec<(String, String)> = - if scan_std_v3_import_edges && !recursive && !entries.is_empty() { - collect_std_staging_dependency_edges(&entries) - } else { - Vec::new() - }; - - let import_topo_ranks: HashMap = - if scan_std_v3_import_edges && !import_edges_storage.is_empty() { - let names: Vec = entries - .iter() - .filter_map(|p| p.file_name().and_then(|s| s.to_str()).map(String::from)) - .collect(); - std_v3_import_topo_ranks(&names, &import_edges_storage) - } else { - HashMap::new() - }; - - entries.sort_by(|a, b| { - let staged_file_rank = |path: &Path| -> usize { - let name = path.file_name().and_then(|s| s.to_str()).unwrap_or(""); - prioritized - .iter() - .position(|candidate| *candidate == name) - .unwrap_or(prioritized.len()) - }; - let ra = staged_file_rank(a); - let rb = staged_file_rank(b); - match ra.cmp(&rb) { - Ordering::Equal => { - let name_a = a.file_name().and_then(|s| s.to_str()).unwrap_or(""); - let name_b = b.file_name().and_then(|s| s.to_str()).unwrap_or(""); - let import_cmp = if import_topo_ranks.is_empty() { - Ordering::Equal - } else { - let ra = import_topo_ranks.get(name_a).copied().unwrap_or(usize::MAX); - let rb = import_topo_ranks.get(name_b).copied().unwrap_or(usize::MAX); - ra.cmp(&rb) - }; - match import_cmp { - Ordering::Equal => name_a.cmp(name_b).then_with(|| { - a.strip_prefix(dir) - .unwrap_or(a) - .display() - .to_string() - .cmp(&b.strip_prefix(dir).unwrap_or(b).display().to_string()) - }), - ord => ord, - } - } - ord => ord, - } - }); - - entries -} - -/// Escape `body` so it can replace a `*_SPLICE_V1` placeholder inside a `.dag` double-quoted -/// `TestClaim.source` literal (R1 gate fixture hygiene; see `emit_r1_gates_fixture`). -fn escape_dag_double_quoted_body(body: &str) -> String { - let mut out = String::with_capacity(body.len() + 8); - for ch in body.chars() { - match ch { - '\\' => out.push_str("\\\\"), - '"' => out.push_str("\\\""), - '\n' => out.push_str("\\n"), - '\r' => out.push_str("\\r"), - '\t' => out.push_str("\\t"), - c => out.push(c), - } - } - out -} - -/// Emit `tests/fixtures/r1_gates.dag` from `r1_gates.template.dag` + canonical lens and `.v3` -/// program text. -/// -/// **Hygiene:** `r1_gates.dag` is tracked in git but produced here so the spliced lens stays -/// byte-identical to `src/v3/lenses/named_function_count.dag`, and Lane E `TestClaim.source` -/// strings are spliced from canonical `.v3` fixtures (single authority; INVARIANTS P2). -/// Hand-edit **`r1_gates.template.dag`** only — direct edits to `r1_gates.dag` are overwritten -/// on the next `cargo build`. We skip `fs::write` when the generated bytes are unchanged to -/// avoid spurious working-tree noise. -fn emit_r1_gates_fixture(manifest_path: &Path, v3_dir: &Path) { - /// Must appear exactly once in `r1_gates.template.dag` (inside the `user_authored_lens_compiles` `source:` line). - const LENS_SPLICE_SENTINEL: &str = "R1_NAMED_FUNCTION_COUNT_LENS_SPLICE_V1"; - /// May appear multiple times (each `TestClaim.source` that embeds merge-sort gets the same bytes). - const MERGE_SORT_PAIR_V3_SPLICE: &str = "R1_MERGE_SORT_PAIR_V3_SPLICE_V1"; - const LANE_E_DIFF_WITNESS_V3_SPLICE: &str = "R1_LANE_E_DIFFERENTIAL_WITNESS_V3_SPLICE_V1"; - - let fixtures_dir = manifest_path.join("tests/fixtures"); - let template_path = fixtures_dir.join("r1_gates.template.dag"); - let lens_path = v3_dir.join("lenses/named_function_count.dag"); - let merge_sort_pair_v3 = fixtures_dir.join("r1_merge_sort_pair.v3"); - let lane_e_diff_witness_v3 = fixtures_dir.join("r1_lane_e_differential_witness.v3"); - let out_path = fixtures_dir.join("r1_gates.dag"); - - println!("cargo:rerun-if-changed={}", template_path.display()); - for p0_script in [ - manifest_path.join("tests/fixtures/host/r1_p0_no_fabrication_sentinel.sh"), - manifest_path.join("tests/fixtures/host/r1_p0_rest_ops_aligned.py"), - ] { - println!("cargo:rerun-if-changed={}", p0_script.display()); - } - println!("cargo:rerun-if-changed={}", lens_path.display()); - println!("cargo:rerun-if-changed={}", merge_sort_pair_v3.display()); - println!( - "cargo:rerun-if-changed={}", - lane_e_diff_witness_v3.display() - ); - - let template = fs::read_to_string(&template_path).unwrap_or_else(|e| { - panic!( - "failed to read R1 gate template {}: {}", - template_path.display(), - e - ) - }); - let lens = fs::read_to_string(&lens_path).unwrap_or_else(|e| { - panic!( - "failed to read canonical lens {}: {}", - lens_path.display(), - e - ) - }); - let merge_sort_pair_src = fs::read_to_string(&merge_sort_pair_v3).unwrap_or_else(|e| { - panic!( - "failed to read R1 merge-sort pair fixture {}: {}", - merge_sort_pair_v3.display(), - e - ) - }); - let lane_e_diff_src = fs::read_to_string(&lane_e_diff_witness_v3).unwrap_or_else(|e| { - panic!( - "failed to read R1 Lane E differential witness fixture {}: {}", - lane_e_diff_witness_v3.display(), - e - ) - }); - - let lens_count = template.matches(LENS_SPLICE_SENTINEL).count(); - if lens_count != 1 { - panic!( - "{} must contain exactly one `{LENS_SPLICE_SENTINEL}` for named_function_count lens (found {lens_count})", - template_path.display() - ); - } - let merge_count = template.matches(MERGE_SORT_PAIR_V3_SPLICE).count(); - if merge_count < 1 { - panic!( - "{} must contain at least one `{MERGE_SORT_PAIR_V3_SPLICE}` (spliced into every Lane E claim that embeds merge-sort; found {merge_count})", - template_path.display() - ); - } - let diff_count = template.matches(LANE_E_DIFF_WITNESS_V3_SPLICE).count(); - if diff_count != 1 { - panic!( - "{} must contain exactly one `{LANE_E_DIFF_WITNESS_V3_SPLICE}` for r1_lane_e_differential_witness.v3 (found {diff_count})", - template_path.display() - ); - } - - let mut generated = - template.replace(LENS_SPLICE_SENTINEL, &escape_dag_double_quoted_body(&lens)); - generated = generated.replace( - MERGE_SORT_PAIR_V3_SPLICE, - &escape_dag_double_quoted_body(&merge_sort_pair_src), - ); - generated = generated.replace( - LANE_E_DIFF_WITNESS_V3_SPLICE, - &escape_dag_double_quoted_body(&lane_e_diff_src), - ); - let needs_write = match fs::read_to_string(&out_path) { - Ok(existing) => existing != generated, - Err(_) => true, - }; - if needs_write { - fs::write(&out_path, generated).unwrap_or_else(|e| { - panic!( - "failed to write generated R1 gate fixture {}: {}", - out_path.display(), - e - ) - }); - } -} - -/// Emit `dsl/std/render_repeat_string_bootstrap.dag` from the excerpt between -/// `GUNBC_BOOTSTRAP_EMIT_BEGIN` / `GUNBC_BOOTSTRAP_EMIT_END` in `dsl/std/render.dag`. -/// -/// **Hygiene:** `repeat_string` exists in the bootstrap bundle only via this excerpt — no -/// hand-maintained duplicate of `render.dag` (INVARIANTS P2). Edit the marked region in -/// `render.dag` only; this output is overwritten on `cargo build -p v3-compiler`. -fn emit_render_repeat_string_bootstrap(repo_root: &Path) { - const BEGIN: &str = "// GUNBC_BOOTSTRAP_EMIT_BEGIN\n"; - const END: &str = "// GUNBC_BOOTSTRAP_EMIT_END"; - let render_path = repo_root.join("dsl/std/render.dag"); - let out_path = repo_root.join("dsl/std/render_repeat_string_bootstrap.dag"); - println!("cargo:rerun-if-changed={}", render_path.display()); - let render_src = fs::read_to_string(&render_path).unwrap_or_else(|e| { - panic!( - "emit_render_repeat_string_bootstrap: read {}: {e}", - render_path.display() - ) - }); - let start = render_src.find(BEGIN).unwrap_or_else(|| { - panic!( - "{}: missing `{}` marker line", - render_path.display(), - BEGIN.trim_end() - ) - }); - let inner_start = start + BEGIN.len(); - let end_rel = render_src[inner_start..].find(END).unwrap_or_else(|| { - panic!( - "{}: missing `{END}` after begin marker", - render_path.display() - ) - }); - let excerpt = render_src[inner_start..inner_start + end_rel].trim_end(); - let generated = format!( - "// AUTO-GENERATED by src/v3/compiler/build.rs. Do not hand-edit.\n\ - //\n\ - // Source: excerpt between GUNBC_BOOTSTRAP_EMIT_BEGIN/END in dsl/std/render.dag.\n\ - // Single substrate slice for repeat_string in the bootstrap bundle (INVARIANTS P2).\n\ - // Regenerated when render.dag changes. Dissolution: full render.dag in bootstrap.\n\ - \n\ - module std.render_repeat_string_bootstrap\n\ - \n\ - {excerpt}\n" - ); - match fs::read_to_string(&out_path) { - Ok(existing) if existing == generated => {} - _ => fs::write(&out_path, generated).unwrap_or_else(|e| { - panic!( - "emit_render_repeat_string_bootstrap: write {}: {e}", - out_path.display() - ) - }), - } -} - -fn generate_static( - static_name: &str, - dir_label: &str, - display_prefix: &str, - base_dir: &Path, - entries: &[PathBuf], -) -> String { - let mut generated = format!( - "// AUTO-GENERATED by build.rs. Do not edit.\n\ - //\n\ - // Files enumerated from {dir_label}/*.dag. Adding a new\n\ - // staged file is a pure file-system change.\n\ - pub static {static_name}: &[(&str, &str)] = &[\n" - ); - for path in entries { - let relative_path = path - .strip_prefix(base_dir) - .unwrap_or_else(|_| panic!("{} is not under {}", path.display(), base_dir.display())); - let display_path = format!("{display_prefix}/{}", relative_path.display()); - let abs_path = path - .canonicalize() - .unwrap_or_else(|e| panic!("failed to canonicalize {}: {}", path.display(), e)); - generated.push_str(&format!( - " (\"{}\", include_str!(\"{}\")),\n", - display_path, - abs_path.display() - )); - } - generated.push_str("];\n"); - generated -} - -fn main() { - // Resolve the staged directories relative to CARGO_MANIFEST_DIR - // (which points at src/v3/compiler/). std/ and spec/ live one - // level up; compiler-staged files live in the manifest dir itself. - let manifest_dir = - env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR must be set by Cargo"); - let manifest_path = PathBuf::from(&manifest_dir); - let v3_dir = manifest_path.parent().expect("compiler dir has parent"); - emit_r1_gates_fixture(&manifest_path, v3_dir); - let src_dir = v3_dir.parent().expect("v3 dir has parent"); - let repo_root = src_dir.parent().expect("src dir has parent"); - emit_render_repeat_string_bootstrap(repo_root); - let std_dir = v3_dir.join("std"); - let spec_dir = v3_dir.join("spec"); - let compiler_dir = manifest_path.clone(); - let extdeps_dir = repo_root.join("dsl").join("extdeps"); - let gunbc_dir = repo_root.join("dsl").join("gunbc"); - let dsl_std_dir = repo_root.join("dsl").join("std"); - - // Tell Cargo to re-run the script if any staged std/spec/compiler file - // changes. Without this, adding a new file wouldn't trigger a - // rebuild and bootstrap would silently miss it. - println!("cargo:rerun-if-changed={}", spec_dir.display()); - println!("cargo:rerun-if-changed={}", std_dir.display()); - println!("cargo:rerun-if-changed={}", compiler_dir.display()); - println!("cargo:rerun-if-changed={}", extdeps_dir.display()); - println!("cargo:rerun-if-changed={}", gunbc_dir.display()); - println!("cargo:rerun-if-changed={}", dsl_std_dir.display()); - - // Structural-recursion termination analysis walks a recursing - // argument back to its declared Disj connective (see - // `structural_binding_info_for_variant` in `lower.rs`). The walk - // only succeeds after the declaring file has been phase-2 lowered, - // so `std/list.dag` (declares `List = Empty | Cons {...}`) - // and `std/substrate.dag` (declares `Behavior = Value | Transform - // | Branch | Loop | Bind`) must land before any sibling std file - // that recursively descends over those variants. Without this - // priority list, alphabetical order puts `algebra.dag` and - // `dimensions.dag` ahead of `list.dag`/`substrate.dag`, and their - // recursive helpers fail termination against placeholder - // connectives. - // `substrate_minimal` + `effects` before full `substrate` so `substrate.dag` - // can import `WorkflowEffect` for reflected `lane2_workflow` without a - // module cycle (`effects` still needs `PortId` / list primitives first). - let staged_entries = collect_dag_entries( - &std_dir, - &[ - "list.dag", - "substrate_minimal.dag", - "effects.dag", - "substrate.dag", - // `emit_model.dag` / per-target `*_method_template_contracts.dag` rows - // reference `MethodRef` from `methods.dag`. Alphabetical staging would - // process `go_method_template_contracts.dag` before `methods.dag` (g < m), - // leaving `MethodRef` as an identifier stub during structural lowering of - // `dag_method: { decl: … }` — `walk_to_conj_decl` then fails closed. Rust and - // Python fixtures happen to load after `methods.dag` and were unaffected. - "methods.dag", - ], - true, - ); - let spec_entries = collect_dag_entries(&spec_dir, &["v3_l1.dag"], false); - let mut compiler_entries = collect_dag_entries(&compiler_dir, &["pipeline.dag"], false); - // `tokenize.dag` is SG-1 tokenizer authority consumed by `regen_tokenize`; it is - // stripped from the runtime bootstrap bundle — see COMPILER_FILES header. - // `parse_tables.dag` is SG-2c-1 grammar-tables authority consumed by - // `regen_parse_tables`; same exclusion rationale — `compile_to_dag` parses it - // standalone at regen time, so bundling it into the bootstrap Dag would create - // duplicate-declaration diagnostics. - compiler_entries.retain(|p| { - p.file_name() - .and_then(|s| s.to_str()) - .map(|n| n != "tokenize.dag" && n != "parse_tables.dag") - .unwrap_or(true) - }); - let extdeps_entries = collect_dag_entries_recursive(&extdeps_dir, &[]); - let gunbc_entries = collect_dag_entries_recursive(&gunbc_dir, &[]); - let staged_generated = generate_static( - "STAGED_FILES", - "src/v3/std", - "src/v3/std", - &std_dir, - &staged_entries, - ); - let specs_generated = generate_static( - "V3_SPECS", - "src/v3/spec", - "src/v3/spec", - &spec_dir, - &spec_entries, - ); - let compiler_generated = generate_static( - "COMPILER_FILES", - "src/v3/compiler", - "src/v3/compiler", - &compiler_dir, - &compiler_entries, - ); - let extdeps_generated = generate_static( - "EXTDEPS_FILES", - "dsl/extdeps", - "dsl/extdeps", - &extdeps_dir, - &extdeps_entries, - ); - let gunbc_generated = generate_static( - "GUNBC_FILES", - "dsl/gunbc", - "dsl/gunbc", - &gunbc_dir, - &gunbc_entries, - ); - let out_dir = env::var("OUT_DIR").expect("OUT_DIR must be set by Cargo"); - let out_dir = Path::new(&out_dir); - let staged_out = out_dir.join("v3_staged_files.rs"); - fs::write(&staged_out, staged_generated) - .unwrap_or_else(|e| panic!("failed to write {}: {}", staged_out.display(), e)); - let specs_out = out_dir.join("v3_specs.rs"); - fs::write(&specs_out, specs_generated) - .unwrap_or_else(|e| panic!("failed to write {}: {}", specs_out.display(), e)); - let compiler_out = out_dir.join("v3_compiler_files.rs"); - fs::write(&compiler_out, compiler_generated) - .unwrap_or_else(|e| panic!("failed to write {}: {}", compiler_out.display(), e)); - // SG-0 producer-owned generated manifest. The census at - // `tests/integration/sg0_census_test.rs` reads this list as the - // sole authority for "which .rs files under src/v3/compiler are - // generated." Every codegen driver or checked-in generator output - // must be represented here so generated Rust never drifts back into - // the hand-authored census. - // - // The manifest lives only in OUT_DIR — it is ephemeral, - // reconstructed every build from this list. A hand-edited - // manifest file is clobbered on the next `cargo build`; the - // spoof surface collapses to this `REGEN_OUTPUTS` literal, - // reviewed alongside any real producer change. - // - // Paths are workspace-relative and sorted for determinism. - const REGEN_OUTPUTS: &[&str] = &[ - "src/v3/compiler/src/bootstrap_generated.rs", - "src/v3/compiler/src/bootstrap_generated_without_parse_surface.rs", - "src/v3/compiler/src/bootstrap_std_generated.rs", - // SG-5 substrate / runtime-mirror projections, generated from - // `src/v3/std/substrate.dag` + `src/v3/std/parse_surface.dag` - // and consumed by hand-authored Rust via `include!(...)`. - // Registering them here keeps SG-0's census honest: they carry - // `// AUTO-GENERATED` headers AND are listed as producer-owned - // outputs, so the content header alone never masquerades as - // generated (SG-0's `sg0_generated_partition_is_producer_owned` - // invariant). - "src/v3/compiler/src/dag_branch_generated.rs", - "src/v3/compiler/src/dag_cluster_generated.rs", - "src/v3/compiler/src/dag_lookup_generated.rs", - "src/v3/compiler/src/dag_cost_generated.rs", - "src/v3/compiler/src/dag_scalar_generated.rs", - "src/v3/compiler/src/dag_value_body_generated.rs", - "src/v3/compiler/src/diagnostics_generated.rs", - "src/v3/compiler/src/infer_helpers_generated.rs", - "src/v3/compiler/src/complexity_lens_generated.rs", - "src/v3/compiler/src/cost_symbolic_lens_generated.rs", - "src/v3/compiler/src/lens_cost_target_realization_generated.rs", - "src/v3/compiler/src/lens_effect_enumeration_generated.rs", - "src/v3/compiler/src/lens_idempotency_generated.rs", - "src/v3/compiler/src/lens_parallelism_generated.rs", - "src/v3/compiler/src/lens_provenance_generated.rs", - "src/v3/compiler/src/lens_structural_resolution_generated.rs", - "src/v3/compiler/src/lens_unused_parameters_generated.rs", - "src/v3/compiler/src/lower_helpers_generated.rs", - "src/v3/compiler/src/operators_generated.rs", - "src/v3/compiler/src/parse_generated.rs", - "src/v3/compiler/src/parse_surface_generated.rs", - "src/v3/compiler/src/parse_tables_generated.rs", - "src/v3/compiler/src/serialize_generated.rs", - "src/v3/compiler/src/tokenize_generated.rs", - "src/v3/compiler/src/types_generated.rs", - "src/v3/compiler/src/variant_payload_generated.rs", - ]; - let mut manifest = String::from( - "// AUTO-GENERATED by build.rs. Do not edit.\n\ - //\n\ - // Paths (workspace-relative) of every .rs file under\n\ - // src/v3/compiler that is produced by a codegen authority.\n\ - pub static GENERATED_FILES: &[&str] = &[\n", - ); - for path in REGEN_OUTPUTS { - manifest.push_str(&format!(" \"{path}\",\n")); - } - manifest.push_str("];\n"); - let manifest_out = out_dir.join("v3_generated_files.rs"); - fs::write(&manifest_out, manifest) - .unwrap_or_else(|e| panic!("failed to write {}: {}", manifest_out.display(), e)); - let extdeps_out = out_dir.join("v3_extdeps_files.rs"); - fs::write(&extdeps_out, extdeps_generated) - .unwrap_or_else(|e| panic!("failed to write {}: {}", extdeps_out.display(), e)); - let gunbc_out = out_dir.join("v3_gunbc_files.rs"); - fs::write(&gunbc_out, gunbc_generated) - .unwrap_or_else(|e| panic!("failed to write {}: {}", gunbc_out.display(), e)); -} diff --git a/src/v3/compiler/operators.dag b/src/v3/compiler/operators.dag deleted file mode 100644 index 8043ac03354..00000000000 --- a/src/v3/compiler/operators.dag +++ /dev/null @@ -1,73 +0,0 @@ -module v3.compiler.operators - -import std.substrate { ArithmeticOp, ComparisonOp, LogicalOp, OperatorKind } - -fn from_symbol(symbol: String) -> OperatorKind? { - if symbol == "+" then Some(Arithmetic(Add)) - else if symbol == "-" then Some(Arithmetic(Sub)) - else if symbol == "*" then Some(Arithmetic(Mul)) - else if symbol == "/" then Some(Arithmetic(Div)) - else if symbol == "==" then Some(Comparison(Eq)) - else if symbol == "!=" then Some(Comparison(Ne)) - else if symbol == "<" then Some(Comparison(Lt)) - else if symbol == "<=" then Some(Comparison(Le)) - else if symbol == ">" then Some(Comparison(Gt)) - else if symbol == ">=" then Some(Comparison(Ge)) - else if symbol == "&&" then Some(Logical(And)) - else if symbol == "||" then Some(Logical(Or)) - else None -} - -fn symbol(op: OperatorKind) -> String = - match op { - Arithmetic(arith) => - match arith { - Add => "+" - Sub => "-" - Mul => "*" - Div => "/" - } - Comparison(comp) => - match comp { - Eq => "==" - Ne => "!=" - Lt => "<" - Le => "<=" - Gt => ">" - Ge => ">=" - } - Logical(logical) => - match logical { - And => "&&" - Or => "||" - } - } - -fn algebra_field_name(op: OperatorKind) -> String = - match op { - Arithmetic(arith) => - match arith { - Add => "add" - Sub => "sub" - Mul => "mul" - Div => "div" - } - Comparison(comp) => - match comp { - Eq => "eq" - Ne => "ne" - Lt => "lt" - Le => "le" - Gt => "gt" - Ge => "ge" - } - // Logical ops map to `BooleanAlgebra` record fields in `dsl/std/algebra.dag` - // (`meet` / `join`), not surface spellings `and` / `or`. - // Single Rust projection: `operators_generated.rs` (`crate::operators::algebra_field_name`) - // — there is no parallel `src/operators.rs` (infer/emit both import this crate only). - Logical(logical) => - match logical { - And => "meet" - Or => "join" - } - } diff --git a/src/v3/compiler/parse_parser_body.txt b/src/v3/compiler/parse_parser_body.txt deleted file mode 100644 index 4b97cfaa30d..00000000000 --- a/src/v3/compiler/parse_parser_body.txt +++ /dev/null @@ -1,1969 +0,0 @@ -// RESIDUAL SEMANTIC AUTHORITY — recursive-descent parse algorithm. -// This is **parser staging**, not SG-2c closure: the Surface carrier schema lives in -// `src/v3/std/parse_surface.dag`, the binary-operator-at-precedence-level table lives in -// `parse_tables.dag` (SG-2c-1 grammar-tables prototype), and `regen_parse` splices this -// fragment after the emitted `Surface*` definitions inside `parse_generated.rs`. -// -// **SG-2c-1 reduction (not retirement).** The per-precedence-level functions below -// (`parse_logical_or`, `parse_logical_and`, `parse_comparison`, `parse_additive`, -// `parse_term`) used to open-code the token → `OperatorKind` mapping in five separate -// match blocks. That mapping is now authored as `binary_op_*` data rows in -// `parse_tables.dag` and consumed here via `binary_op_at_level`. The SG-2c -// `parse_primary` cluster: SG-2c-6 `PrimaryPrefixRow` + `primary_prefix_dispatch` -// (prefix openers) and SG-2c-7 `PrimaryAtomRow` + `primary_atom_class` (int/bool/ -// string/lambda/ident atomic forms). The parser's control flow — cursor mechanics, -// recursive descent, error recovery, span fusion — remains semantic authority in -// this file. -// -// Dissolution trigger (SG-2c proper): delete this file when parse **logic** is -// structurally `.dag`-owned (SELF_HOSTING §6 Phase 4a direct port or Phase 4b -// grammar-as-data) and `regen_parse` emits the full module without any external -// Rust body fragment. SG-2c proper is blocked on a named substrate capability — -// recursive list-body emission over `List` with cursor threading — declared -// in `src/v3/std/list.dag:13-15` ("the current compiler still lacks full structural -// recursion + list-body emission support"). Until that lands, any `.dag` port of -// the recursive-descent algorithm routes through a hidden Rust host layer. -// - -/// Host-authored names that may appear as the sole RHS identifier of a -/// `type T = U` **alias** even when `U` is not declared in the same module -/// (bootstrap / prelude spellings). Keep this list conservative: expand it -/// when integration tests surface a legitimate `type X = Builtin` alias the -/// two-pass disambiguator mis-classified as a nullary sum. -const PRELUDE_BARE_RHS_ALIAS_IDENTS: &[&str] = &[ - "Bit", - "Bool", - "Char", - "Classical", - "Double", - "Float", - "Float32", - "Float64", - "Int", - "Int8", - "Int16", - "Int32", - "Int64", - "List", - "Map", - "Nat", - "Never", - "Str", - "String", - "Set", - "UInt", - "UInt8", - "UInt16", - "UInt32", - "UInt64", - "Unit", - "Vec", - "Void", - "Word8", - "Word16", - "Word32", - "Word64", -]; - -/// Build the identifier set for which a bare `type T = U` RHS must classify -/// as [`SurfaceItem::TypeAlias`]: prelude spellings, explicit `import … { … }` -/// names, and every `type` / `data` LHS in the module (declaration order does -/// not matter — forward aliases to sibling types stay aliases). Local generic -/// binders are declaration-scoped and are added only at the RHS lookahead site. -fn collect_bare_rhs_alias_reference_idents(items: &[SurfaceItem]) -> HashSet { - let mut out = HashSet::new(); - for name in PRELUDE_BARE_RHS_ALIAS_IDENTS { - out.insert((*name).to_string()); - } - for item in items { - match item { - SurfaceItem::Import { names, .. } => { - for n in names { - out.insert(n.clone()); - } - } - SurfaceItem::TypeRecord { name, .. } - | SurfaceItem::TypeSum { name, .. } - | SurfaceItem::TypeAlias { name, .. } - | SurfaceItem::TypeAtom { name, .. } => { - out.insert(name.clone()); - } - SurfaceItem::Data { name, .. } => { - out.insert(name.clone()); - } - _ => {} - } - } - out -} - -pub fn parse(tokens: &[Token], file: &str) -> Result { - let pass1_items = { - let mut parser = Parser { - tokens, - pos: 0, - file, - bare_rhs_alias_reference_idents: None, - }; - let mut items = Vec::new(); - while !parser.at_eof() { - items.push(parser.parse_item()?); - } - items - }; - let refs = collect_bare_rhs_alias_reference_idents(&pass1_items); - let mut parser = Parser { - tokens, - pos: 0, - file, - bare_rhs_alias_reference_idents: Some(refs), - }; - let mut items = Vec::new(); - while !parser.at_eof() { - items.push(parser.parse_item()?); - } - Ok(SurfaceModule { items }) -} - -struct Parser<'a> { - tokens: &'a [Token], - pos: usize, - file: &'a str, - /// `None` during pass 1 (bare-RHS sum disambiguation disabled). `Some` during - /// pass 2: a bare `type T = U` is [`SurfaceItem::TypeSum`] iff `U` is **not** - /// in this set (prelude + imports + module `type`/`data` LHS names). - bare_rhs_alias_reference_idents: Option>, -} - -impl<'a> Parser<'a> { - fn peek(&self) -> &Token { - &self.tokens[self.pos] - } - - fn bump(&mut self) -> &Token { - let t = &self.tokens[self.pos]; - self.pos += 1; - t - } - - fn at_eof(&self) -> bool { - matches!(self.peek().kind, TokenKind::Eof) - } - - fn expect_kind(&mut self, expected: TokenKind) -> Result { - let token = self.bump().clone(); - if token.kind == expected { - Ok(token) - } else { - Err(Diagnostic::ParseError { - message: format!("expected {expected:?}, got {:?}", token.kind), - span: token.span, - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("ParseError"), - }) - } - } - - /// Parse the next top-level item. Every surface form emits a real - /// `SurfaceItem` — the earlier "parser-absorbed" path was deleted - /// at M1(2.7) per the QW1/QW2/QW3 scaffold-honesty fix. Module, - /// import, and data items lower to no-ops (or declaration-only - /// scaffolds) at M1(2.7), but the parsed facts flow forward. - /// - /// **SG-2c-2 keyword→dispatch edge is table-owned:** which `TokenKind` - /// opens which item form comes from `parse_tables.dag` (`TopLevelItemKwRow`), - /// projected by `regen_parse_tables` into `parse_tables::top_level_item_dispatch`. - /// This function only maps `ItemDispatchKind` → the corresponding `parse_*_item` - /// entry point (control flow stays here; the keyword set is not open-coded). - fn parse_item(&mut self) -> Result { - let tk = &self.peek().kind; - match top_level_item_dispatch(tk) { - Some(ItemDispatchKind::Let) => self.parse_let_item(), - Some(ItemDispatchKind::Fn) => self.parse_fn_item(), - Some(ItemDispatchKind::Type) => self.parse_type_item(), - Some(ItemDispatchKind::Module) => self.parse_module_item(), - Some(ItemDispatchKind::Import) => self.parse_import_item(), - Some(ItemDispatchKind::Data) => self.parse_data_item(), - None => Err(Diagnostic::ParseError { - message: format!( - "expected `let`, `fn`, `type`, `module`, `import`, or `data`, got {tk:?}" - ), - span: self.peek().span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("ParseError"), - }), - } - } - - /// Parse `module foo.bar.baz` into a `SurfaceItem::Module { path }`. - /// At M1(2.7) lowering is a no-op, but the parsed path survives - /// for M2 module scoping to consume. - fn parse_module_item(&mut self) -> Result { - let kw = self.expect_kind(TokenKind::KwModule)?; - let path = self.parse_dotted_path()?; - // The dotted path ends at the last parsed identifier; use its - // span's end as the item's end. `parse_dotted_path` doesn't - // return spans, so fall back to the current position's - // previous token span. The simplest correct thing: use the - // last token consumed by peek-1. - let end = self.tokens[self.pos.saturating_sub(1)].span.byte_end; - Ok(SurfaceItem::Module { - path, - span: SourceSpan::new(self.file, kw.span.byte_start, end), - }) - } - - /// Parse `import foo.bar { Name1, Name2 }` into - /// `SurfaceItem::Import { path, names }`. The names list is - /// optional (bare `import foo.bar` imports everything). - fn parse_import_item(&mut self) -> Result { - let kw = self.expect_kind(TokenKind::KwImport)?; - let path = self.parse_dotted_path()?; - let mut names: Vec = Vec::new(); - if matches!(self.peek().kind, TokenKind::LBrace) { - self.bump(); - if !matches!(self.peek().kind, TokenKind::RBrace) { - loop { - names.push(self.parse_ident()?); - if matches!(self.peek().kind, TokenKind::Comma) { - self.bump(); - continue; - } - break; - } - } - self.expect_kind(TokenKind::RBrace)?; - } - let end = self.tokens[self.pos.saturating_sub(1)].span.byte_end; - Ok(SurfaceItem::Import { - path, - names, - span: SourceSpan::new(self.file, kw.span.byte_start, end), - }) - } - - /// Parse `data name: Type = { body }` into `SurfaceItem::Data`. - /// - /// **M1(3) PR-B change:** the body is now attempted as a record - /// literal first. A 3-token lookahead (`{`, `Ident`, `:`) decides - /// between: - /// - /// - **Record literal**: the body is parsed as a - /// `SurfaceExpr::Record { fields, span }` and stored in - /// `SurfaceItem::Data.body = Some(...)`. Lowering runs - /// inhabitance checking against the type annotation (walks - /// the Conj children, matches labels, validates literal-only - /// field values) and produces a - /// `ValueBody::Structural { fields }` on the declaration. - /// - **Unparseable body**: any body whose first three tokens - /// don't match `{ Ident :` falls back to the brace-skip path - /// (preserving the span) and `SurfaceItem::Data.body = None`. - /// Lowering produces a `ValueBody::Unparsed(span)` scaffold - /// which `reject_user_unparsed_scaffolds` rejects for user - /// code and tolerates for bootstrap fixtures (R14 behavior). - /// - /// The lookahead is unambiguous because record field syntax - /// starts with `Ident :` and no other valid body shape does. - fn parse_data_item(&mut self) -> Result { - let kw = self.expect_kind(TokenKind::KwData)?; - let name = self.parse_ident()?; - self.expect_kind(TokenKind::Colon)?; - let ty = self.parse_type_expr()?; - self.expect_kind(TokenKind::Eq)?; - // DB-10 (3a.2): `data x: T = ` accepts three body shapes: - // 1. Record literal (`{ name: v, ... }`) — lowered to - // ValueBody::Structural via inhabitance checking. - // 2. Opaque brace body (`{ ... }` without record-literal - // shape) — preserved as ValueBody::Unparsed. - // 3. Scalar expression (no leading `{`) — lowered to - // ValueBody::Scalar. Required for scalar constants - // like `data answer: Int = 42` that `compiler.dag` uses. - if !matches!(self.peek().kind, TokenKind::LBrace) { - let body_expr = self.parse_expr()?; - let body_span_ref = expr_span(&body_expr); - let body_start = body_span_ref.byte_start; - let body_end = body_span_ref.byte_end; - return Ok(SurfaceItem::Data { - name, - ty, - body: Some(body_expr), - body_span: SourceSpan::new(self.file, body_start, body_end), - span: SourceSpan::new(self.file, kw.span.byte_start, body_end), - }); - } - // Peek three tokens for the record-literal lookahead. - let open_span = self.peek().span.clone(); - let is_record_literal = self.looks_like_record_literal(); - if is_record_literal { - let body_expr = self.parse_record_literal()?; - let body_end = match &body_expr { - SurfaceExpr::Record { span, .. } => span.byte_end, - _ => unreachable!("parse_record_literal always returns Record"), - }; - return Ok(SurfaceItem::Data { - name, - ty, - body: Some(body_expr), - body_span: SourceSpan::new(self.file, open_span.byte_start, body_end), - span: SourceSpan::new(self.file, kw.span.byte_start, body_end), - }); - } - // Sibling lookahead for map literals (`{ String : ...`). Routes - // string-keyed `{...}` data bodies into `parse_map_literal`, - // emitting `SurfaceExpr::Map`. Disambiguation is unambiguous: - // record-literal lookahead requires `{ Ident :`; map-literal - // requires `{ StringLit :`. Bare `{}` (empty) and any other - // shape continue to fall through to `skip_brace_balanced`. - if self.looks_like_map_literal() { - let body_expr = self.parse_map_literal()?; - let body_end = match &body_expr { - SurfaceExpr::Map { span, .. } => span.byte_end, - _ => unreachable!("parse_map_literal always returns Map"), - }; - return Ok(SurfaceItem::Data { - name, - ty, - body: Some(body_expr), - body_span: SourceSpan::new(self.file, open_span.byte_start, body_end), - span: SourceSpan::new(self.file, kw.span.byte_start, body_end), - }); - } - let end = self.skip_brace_balanced()?; - let body_span = SourceSpan::new(self.file, open_span.byte_start, end); - Ok(SurfaceItem::Data { - name, - ty, - body: None, - body_span, - span: SourceSpan::new(self.file, kw.span.byte_start, end), - }) - } - - /// 3-token lookahead for record-literal disambiguation (`parse_data_item`, - /// brace-bodied `fn` on `.v3`). Returns `true` when: - /// - /// - **`{}`**: `LBrace` immediately followed by `RBrace` (empty record). - /// - **`{ label: expr`**: `LBrace`, then a field label token (`Ident(_)` or any - /// token accepted via `soft_keyword_ident_spelling`, e.g. `KwType` for - /// `type:`), then `:` — same label set as `parse_field_label`. - /// - /// Otherwise returns `false` so callers can try map-literal lookahead or - /// other paths. - fn looks_like_record_literal(&self) -> bool { - let t0 = self.tokens.get(self.pos); - let t1 = self.tokens.get(self.pos + 1); - let t2 = self.tokens.get(self.pos + 2); - match (t0, t1) { - (Some(a), Some(b)) if matches!(a.kind, TokenKind::LBrace) && matches!(b.kind, TokenKind::RBrace) => true, - _ => match (t0, t1, t2) { - (Some(a), Some(b), Some(c)) => { - matches!(a.kind, TokenKind::LBrace) - && (matches!(b.kind, TokenKind::Ident(_)) - || soft_keyword_ident_spelling(&b.kind).is_some()) - && matches!(c.kind, TokenKind::Colon) - } - _ => false, - }, - } - } - - /// Parse a record literal starting at `{`. Called from - /// `parse_data_item` after `looks_like_record_literal` confirms - /// the lookahead. Reads `label: expr` pairs separated by `,` (or - /// whitespace), terminated by `}`. Each field's value is any - /// `SurfaceExpr` — lowering (not parsing) enforces the literal- - /// only restriction. - fn parse_record_literal(&mut self) -> Result { - let open = self.expect_kind(TokenKind::LBrace)?; - let mut fields: Vec = Vec::new(); - while !matches!(self.peek().kind, TokenKind::RBrace) { - let (field_name, name_span) = self.parse_field_label()?; - self.expect_kind(TokenKind::Colon)?; - let value = self.parse_expr()?; - let field_end = expr_span(&value).byte_end; - fields.push(SurfaceRecordField { - name: field_name, - value, - span: SourceSpan::new(self.file, name_span.byte_start, field_end), - }); - // Accept an optional comma between fields (whitespace - // alone is also permitted). - if matches!(self.peek().kind, TokenKind::Comma) { - self.bump(); - } - } - let close = self.expect_kind(TokenKind::RBrace)?; - Ok(SurfaceExpr::Record { - fields, - span: SourceSpan::new(self.file, open.span.byte_start, close.span.byte_end), - }) - } - - /// 3-token lookahead for the map-literal disambiguation in - /// `parse_data_item`. Returns `true` when the next three tokens are - /// `{`, then `StringLit(_)`, then `:` — the unambiguous start of a - /// map-literal entry. Sibling to `looks_like_record_literal` - /// (`{ Ident :`); the two are mutually exclusive at the entry token - /// because a string-literal token is structurally distinct from an - /// identifier token. Empty `{}` falls through to neither (and routes - /// into `skip_brace_balanced` per the existing scaffolded-body - /// path) — string-key non-empty maps are the only shape this lane - /// admits; empty-map syntax is deferred until a real consumer needs - /// it (no consumer in the 22-declaration survey produces an empty - /// map literal at the top level). - fn looks_like_map_literal(&self) -> bool { - let t0 = self.tokens.get(self.pos); - let t1 = self.tokens.get(self.pos + 1); - let t2 = self.tokens.get(self.pos + 2); - match (t0, t1, t2) { - (Some(a), Some(b), Some(c)) => { - matches!(a.kind, TokenKind::LBrace) - && matches!(b.kind, TokenKind::StringLit(_)) - && matches!(c.kind, TokenKind::Colon) - } - _ => false, - } - } - - /// Parse a map literal starting at `{`. Called from - /// `parse_data_item` after `looks_like_map_literal` confirms the - /// lookahead. Reads `"key": expr` pairs separated by `,` (or - /// whitespace), terminated by `}`. Each entry's key is the parsed - /// string-literal contents (the parser only enters this path after - /// `looks_like_map_literal` matched a `StringLit` token; any - /// non-string key here is an internal invariant violation). - fn parse_map_literal(&mut self) -> Result { - let open = self.expect_kind(TokenKind::LBrace)?; - let mut entries: Vec = Vec::new(); - while !matches!(self.peek().kind, TokenKind::RBrace) { - let key_token = self.bump().clone(); - let (key, key_span) = match key_token.kind { - TokenKind::StringLit(s) => (s, key_token.span.clone()), - other => { - return Err(Diagnostic::ParseError { - message: format!( - "expected string-literal key in map literal, got {other:?}" - ), - span: key_token.span, - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("ParseError"), - }); - } - }; - self.expect_kind(TokenKind::Colon)?; - let value = self.parse_expr()?; - let value_end = expr_span(&value).byte_end; - entries.push(SurfaceMapEntry { - key, - key_span: key_span.clone(), - value, - span: SourceSpan::new(self.file, key_span.byte_start, value_end), - }); - if matches!(self.peek().kind, TokenKind::Comma) { - self.bump(); - } - } - let close = self.expect_kind(TokenKind::RBrace)?; - Ok(SurfaceExpr::Map { - entries, - span: SourceSpan::new(self.file, open.span.byte_start, close.span.byte_end), - }) - } - - fn parse_named_expr_fields( - &mut self, - ) -> Result<(Vec, SourceSpan), Diagnostic> { - let open = self.expect_kind(TokenKind::LBrace)?; - let mut fields: Vec = Vec::new(); - while !matches!(self.peek().kind, TokenKind::RBrace) { - let (field_name, name_span) = self.parse_field_label()?; - self.expect_kind(TokenKind::Colon)?; - let value = self.parse_expr()?; - let field_end = expr_span(&value).byte_end; - fields.push(SurfaceRecordField { - name: field_name, - value, - span: SourceSpan::new(self.file, name_span.byte_start, field_end), - }); - if matches!(self.peek().kind, TokenKind::Comma) { - self.bump(); - } - } - let close = self.expect_kind(TokenKind::RBrace)?; - Ok(( - fields, - SourceSpan::new(self.file, open.span.byte_start, close.span.byte_end), - )) - } - - fn parse_named_pattern_fields( - &mut self, - ) -> Result<(Vec, SourceSpan), Diagnostic> { - let open = self.expect_kind(TokenKind::LBrace)?; - let mut fields: Vec = Vec::new(); - while !matches!(self.peek().kind, TokenKind::RBrace) { - let (field_name, name_span) = self.parse_field_label()?; - self.expect_kind(TokenKind::Colon)?; - let binding_token = self.bump().clone(); - let binding = match binding_token.kind { - TokenKind::Ident(binding) => binding, - other => { - return Err(Diagnostic::ParseError { - message: format!( - "expected binding name in named payload match pattern after `{field_name}:`, got {other:?}" - ), - span: binding_token.span, - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("ParseError"), - }); - } - }; - fields.push(SurfacePatternField { - name: field_name, - binding, - span: SourceSpan::new(self.file, name_span.byte_start, binding_token.span.byte_end), - }); - if matches!(self.peek().kind, TokenKind::Comma) { - self.bump(); - } - } - let close = self.expect_kind(TokenKind::RBrace)?; - Ok(( - fields, - SourceSpan::new(self.file, open.span.byte_start, close.span.byte_end), - )) - } - - fn brace_starts_match_arms(&self) -> bool { - if !matches!(self.peek().kind, TokenKind::LBrace) { - return false; - } - let mut depth = 0usize; - let mut idx = self.pos; - let mut only_empty_block_so_far = true; - while let Some(token) = self.tokens.get(idx) { - match token.kind { - TokenKind::LBrace => depth += 1, - TokenKind::RBrace => { - if depth == 0 { - return false; - } - depth -= 1; - if depth == 0 { - // `match x {}` is a valid empty-arm block that - // should parse and fail later during lowering/ - // validation as non-exhaustive, not be - // reinterpreted as `x {}` (a named constructor - // expression with empty fields). - return only_empty_block_so_far; - } - } - TokenKind::FatArrow if depth == 1 => return true, - _ if depth == 1 => only_empty_block_so_far = false, - TokenKind::Eof => return false, - _ => {} - } - idx += 1; - } - false - } - - fn parse_dotted_path(&mut self) -> Result, Diagnostic> { - let mut path = vec![self.parse_ident()?]; - while matches!(self.peek().kind, TokenKind::Dot) { - self.bump(); - path.push(self.parse_ident()?); - } - Ok(path) - } - - /// Consume a brace-balanced token range starting at the current - /// `{` and returning the byte offset of the matching `}`. Used for - /// opaque fn/data bodies at M1(2.6). Errors if EOF is reached - /// before the braces balance. - fn skip_brace_balanced(&mut self) -> Result { - let open = self.expect_kind(TokenKind::LBrace)?; - let mut depth: i32 = 1; - loop { - if self.at_eof() { - return Err(Diagnostic::ParseError { - message: "unterminated block body: reached EOF before closing `}`".to_string(), - span: open.span, - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("ParseError"), - }); - } - let token = self.bump().clone(); - match token.kind { - TokenKind::LBrace => depth += 1, - TokenKind::RBrace => { - depth -= 1; - if depth == 0 { - return Ok(token.span.byte_end); - } - } - _ => {} - } - } - } - - fn parse_let_item(&mut self) -> Result { - self.expect_kind(TokenKind::KwLet)?; - let name = self.parse_ident()?; - let type_ann = if matches!(self.peek().kind, TokenKind::Colon) { - self.bump(); - Some(self.parse_type_expr()?) - } else { - None - }; - self.expect_kind(TokenKind::Eq)?; - let expr = self.parse_expr()?; - Ok(SurfaceItem::Let { - name, - type_ann, - expr, - }) - } - - /// User `.v3` modules parse brace-bodied `fn` bodies as real - /// `SurfaceExpr` trees (single expression, record literal, or - /// `parse_expr` + `FnExternalBody` fallback for multi-statement - /// blocks). Authority `.dag` sources (`dsl/std`, `src/v3/std`, - /// compiler/spec fixtures, etc.) keep the legacy brace-skip → - /// `FnExternalBody` path so bootstrap snapshots and staged std - /// `ArrowBody::Unparsed` contracts stay byte-stable until a - /// dedicated bootstrap regen lane opts the corpus in. - fn fn_brace_body_parse_as_expression(&self) -> bool { - self.file.ends_with(".v3") - } - - /// After `{`, `parse_expr` fails immediately on `KwLet` (statements are not - /// expressions). Only that shape uses `FnExternalBody` + brace-skip on - /// `parse_expr` `Err` — other failures are malformed single-expression probes - /// and must surface the parser diagnostic (fail-closed at parse time). - fn fn_brace_body_expr_err_falls_back_to_external(&self, first_inner_token_pos: usize) -> bool { - matches!( - self.tokens - .get(first_inner_token_pos) - .map(|t| &t.kind), - Some(TokenKind::KwLet) - ) - } - - /// Brace-bodied `fn` **record** lookahead: must stay aligned with - /// `parse_field_label` / `parse_record_literal` (same entry shapes as - /// `parse_data_item`: `{}`, `{ ident: expr`, `{ type: expr`, …). - fn fn_brace_body_looks_like_record_literal(&self) -> bool { - self.looks_like_record_literal() - } - - fn parse_fn_item(&mut self) -> Result { - let fn_kw = self.expect_kind(TokenKind::KwFn)?; - let name = self.parse_ident()?; - let type_params = self.parse_optional_type_params()?; - self.expect_kind(TokenKind::LParen)?; - let params = self.parse_params()?; - self.expect_kind(TokenKind::RParen)?; - self.expect_kind(TokenKind::Arrow)?; - let return_type = self.parse_type_expr()?; - match &self.peek().kind { - TokenKind::Eq => { - // Expression-body form: `fn f(x) -> T = expr`. - self.bump(); - let body_expr = self.parse_expr()?; - let end = expr_span(&body_expr).byte_end; - Ok(SurfaceItem::Fn { - name, - type_params, - params, - return_type, - body: body_expr, - span: SourceSpan::new(self.file, fn_kw.span.byte_start, end), - }) - } - TokenKind::LBrace => { - // Brace-bodied `fn f(x) -> T { body }`. - // - // Non-`.v3` sources (staged `.dag` corpus): preserve the - // legacy `FnExternalBody` + brace-skip path — see - // `fn_brace_body_parse_as_expression`. - // - // `.v3` user sources: when `{` begins a record literal (`{}` or - // `{ label: expr, ... }`, including `{ type: ... }` via - // `parse_field_label` soft keywords) or a string-key **map** - // literal (`{ "key": expr, ... }` — same disambiguation order as - // `parse_data_item`), parse that surface form. Otherwise probe a - // single `SurfaceExpr` through the closing `}`. - // - // Otherwise try a single complete `SurfaceExpr` through the - // closing `}`. If the expression parses but does not exhaust - // the brace (e.g. multi-`let` sequences), rewind and fall back to - // `FnExternalBody` + brace-skip. If `parse_expr` errors and the - // first inner token is `let`, use the same fallback (statement - // scaffold); otherwise propagate the parse diagnostic. - if !self.fn_brace_body_parse_as_expression() { - let open = self.peek().span.clone(); - let end = self.skip_brace_balanced()?; - let body_span = SourceSpan::new(self.file, open.byte_start, end); - return Ok(SurfaceItem::FnExternalBody { - name, - type_params, - params, - return_type, - body_span, - span: SourceSpan::new(self.file, fn_kw.span.byte_start, end), - }); - } - if self.fn_brace_body_looks_like_record_literal() { - let body_expr = self.parse_record_literal()?; - let end = expr_span(&body_expr).byte_end; - Ok(SurfaceItem::Fn { - name, - type_params, - params, - return_type, - body: body_expr, - span: SourceSpan::new(self.file, fn_kw.span.byte_start, end), - }) - } else if self.looks_like_map_literal() { - let body_expr = self.parse_map_literal()?; - let end = expr_span(&body_expr).byte_end; - Ok(SurfaceItem::Fn { - name, - type_params, - params, - return_type, - body: body_expr, - span: SourceSpan::new(self.file, fn_kw.span.byte_start, end), - }) - } else { - let checkpoint = self.pos; - self.expect_kind(TokenKind::LBrace)?; - let first_inner_token_pos = self.pos; - match self.parse_expr() { - Ok(body_expr) => { - if matches!(self.peek().kind, TokenKind::RBrace) { - let close = self.expect_kind(TokenKind::RBrace)?; - let end = close.span.byte_end; - Ok(SurfaceItem::Fn { - name, - type_params, - params, - return_type, - body: body_expr, - span: SourceSpan::new(self.file, fn_kw.span.byte_start, end), - }) - } else { - self.pos = checkpoint; - let open = self.peek().span.clone(); - let end = self.skip_brace_balanced()?; - let body_span = SourceSpan::new(self.file, open.byte_start, end); - Ok(SurfaceItem::FnExternalBody { - name, - type_params, - params, - return_type, - body_span, - span: SourceSpan::new(self.file, fn_kw.span.byte_start, end), - }) - } - } - Err(diag) => { - if self.fn_brace_body_expr_err_falls_back_to_external(first_inner_token_pos) - { - self.pos = checkpoint; - let open = self.peek().span.clone(); - let end = self.skip_brace_balanced()?; - let body_span = SourceSpan::new(self.file, open.byte_start, end); - Ok(SurfaceItem::FnExternalBody { - name, - type_params, - params, - return_type, - body_span, - span: SourceSpan::new(self.file, fn_kw.span.byte_start, end), - }) - } else { - self.pos = checkpoint; - Err(diag) - } - } - } - } - } - other => Err(Diagnostic::ParseError { - message: format!("expected `=` or `{{` after fn return type, got {other:?}"), - span: self.peek().span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("ParseError"), - }), - } - } - - fn parse_type_item(&mut self) -> Result { - let type_kw = self.expect_kind(TokenKind::KwType)?; - let name_token = self.bump().clone(); - let name = match &name_token.kind { - TokenKind::Ident(n) => n.clone(), - other => { - return Err(Diagnostic::ParseError { - message: format!("expected type name, got {other:?}"), - span: name_token.span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("ParseError"), - }); - } - }; - let type_params = self.parse_optional_type_params()?; - - match &self.peek().kind { - TokenKind::LBrace => { - self.bump(); - let fields = self.parse_record_fields()?; - let close = self.expect_kind(TokenKind::RBrace)?; - Ok(SurfaceItem::TypeRecord { - name, - type_params, - fields, - span: SourceSpan::new(self.file, type_kw.span.byte_start, close.span.byte_end), - }) - } - TokenKind::Ident(ref s) if s == "inhabits" => { - let clause_start = self.peek().span.byte_start; - self.bump(); - let inhabits = self.parse_type_expr()?; - let eq = self.expect_kind(TokenKind::Eq)?; - let inhabits_clause_span = - SourceSpan::new(self.file, clause_start, eq.span.byte_end); - self.parse_type_rhs_after_eq( - name, - type_params, - type_kw.span, - Some(inhabits), - Some(inhabits_clause_span), - false, - None, - ) - } - TokenKind::Ident(ref s) if s == "nominal_opaque" => { - self.bump(); - let eq = self.expect_kind(TokenKind::Eq)?; - self.parse_type_rhs_after_eq( - name, - type_params, - type_kw.span, - None, - None, - true, - Some(eq.span.clone()), - ) - } - TokenKind::Eq => { - self.bump(); - self.parse_type_rhs_after_eq(name, type_params, type_kw.span, None, None, false, None) - } - _ => Ok(SurfaceItem::TypeAtom { - name, - type_params, - span: SourceSpan::new(self.file, type_kw.span.byte_start, name_token.span.byte_end), - }), - } - } - - fn parse_optional_type_params(&mut self) -> Result, Diagnostic> { - if !matches!(self.peek().kind, TokenKind::Lt) { - return Ok(Vec::new()); - } - self.bump(); - let mut params = vec![self.parse_ident()?]; - while matches!(self.peek().kind, TokenKind::Comma) { - self.bump(); - params.push(self.parse_ident()?); - } - self.expect_kind(TokenKind::Gt)?; - Ok(params) - } - - /// Record field labels reuse [`Self::parse_ident`] semantics but also - /// accept `type` — the tokenizer maps it to [`TokenKind::KwType`], yet - /// `dsl/std/resources.dag` names a field `type` on `ResourceHandle`. Field - /// position is unambiguous (`type` cannot start a type expression here). - fn parse_field_label(&mut self) -> Result<(String, SourceSpan), Diagnostic> { - let name_token = self.bump().clone(); - let name = if let TokenKind::Ident(name) = &name_token.kind { - name.clone() - } else if let Some(spelling) = soft_keyword_ident_spelling(&name_token.kind) { - spelling.to_string() - } else { - return Err(Diagnostic::ParseError { - message: format!("expected field label, got {:?}", name_token.kind), - span: name_token.span, - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("ParseError"), - }); - }; - Ok((name, name_token.span)) - } - - fn parse_record_fields(&mut self) -> Result, Diagnostic> { - let mut fields = Vec::new(); - while !matches!(self.peek().kind, TokenKind::RBrace) { - let (name, _) = self.parse_field_label()?; - self.expect_kind(TokenKind::Colon)?; - let ty = self.parse_type_expr()?; - fields.push(SurfaceField { name, ty }); - if matches!(self.peek().kind, TokenKind::Comma | TokenKind::Semicolon) { - self.bump(); - } - } - Ok(fields) - } - - /// After `type Name =`, decide between TypeSum (one-or-more variants - /// separated by `|`, or a **single** variant without a top-level `|` when - /// it opens as `Variant { ... }` / `Variant(...)` — PR-A.3 EvalStrategy - /// carrier) and TypeAlias (a single type expression). A variant looks like - /// `Ident`, `Ident(...)`, or `Ident { ... }`. A type expression can start - /// with `Ident<...>` (parameterized), `fn(...)` (arrow), or a bare `Ident` - /// at RHS end (alias to another type — **not** a nullary sum; use - /// `Variant()` for a single nullary sum variant without `|`). - /// - /// Optional alias-RHS `where` (DB-11): `where [, ]*` parses - /// to `SurfaceExpr` (comma-separated parts fold as left-associated `&&`). - #[allow(clippy::too_many_arguments)] - fn parse_type_rhs_after_eq( - &mut self, - name: String, - type_params: Vec, - type_kw_span: SourceSpan, - inhabits: Option, - inhabits_clause_span: Option, - nominal_opaque: bool, - nominal_opaque_clause_span: Option, - ) -> Result { - if !self.rhs_is_sum(&type_params) { - if inhabits.is_some() { - return Err(Diagnostic::ParseError { - message: String::from( - "`inhabits` is only supported when the type RHS is a sum (`A | B | ...`)", - ), - span: inhabits_clause_span - .clone() - .unwrap_or_else(|| type_kw_span.clone()), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("ParseError"), - }); - } - let target = self.parse_type_expr()?; - let (refinement, end) = if matches!(self.peek().kind, TokenKind::KwWhere) { - self.parse_type_alias_where_tail()? - } else { - (None, target.span().byte_end) - }; - return Ok(SurfaceItem::TypeAlias { - name, - type_params, - nominal_opaque, - target, - refinement, - span: SourceSpan::new(self.file, type_kw_span.byte_start, end), - }); - } - if nominal_opaque { - return Err(Diagnostic::ParseError { - message: String::from( - "`nominal_opaque` is only supported when the type RHS is an alias", - ), - span: nominal_opaque_clause_span - .clone() - .unwrap_or_else(|| type_kw_span.clone()), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("ParseError"), - }); - } - - let variants = self.parse_sum_variants()?; - let end = variants - .last() - .map(|v| v.span.byte_end) - .unwrap_or(type_kw_span.byte_end); - Ok(SurfaceItem::TypeSum { - name, - type_params, - variants, - inhabits, - span: SourceSpan::new(self.file, type_kw_span.byte_start, end), - }) - } - - fn fold_type_alias_where_parts(&self, mut parts: Vec) -> SurfaceExpr { - debug_assert!(!parts.is_empty()); - if parts.len() == 1 { - return parts.pop().expect("len checked"); - } - let mut lhs = parts.remove(0); - for rhs in parts { - let start = crate::lower_helpers::expr_span(&lhs).byte_start; - let end = crate::lower_helpers::expr_span(&rhs).byte_end; - lhs = SurfaceExpr::Operator { - op: OperatorKind::Logical(LogicalOp::And), - args: vec![lhs, rhs], - span: SourceSpan::new(self.file, start, end), - }; - } - lhs - } - - /// After `where`, parse one or more comma-separated expressions until the - /// next top-level item boundary (commas inside calls/parens stay inside - /// `parse_expr`). - /// - /// **Legacy `dsl/std/types.dag` constraint spellings** (`pattern("…")`, - /// `range(min: 1, max: 5)`, `brand("…")`, bare `non_empty`, …) share this - /// same expression surface — there is no parallel implicit-subject - /// micro-grammar: they must tokenize as `SurfaceExpr` so SG-2 can parse - /// the std corpus. `parse_call_args` recognizes `f(a: x, b: y)`-shaped - /// opens so inner commas in `range(min: …, max: …)` are not mistaken for - /// top-level `where` segment separators (they desugar to a single - /// `Record` argument). The same path covers **one** bound, e.g. - /// `range(min: 1)` (still `Ident` + `:` after `(`). SG-2 - /// `handwritten_parser_accepts_types_dag` tokenizes and parses the full - /// `dsl/std/types.dag` corpus; PB-1’s committed `bootstrap_std_generated.rs` - /// snapshot carries **no** parse-phase `Diagnostic` rows for that file. - /// **Lowering** does not emit `Bool` predicate bodies for - /// `dsl/std/types.dag` until helpers resolve (see - /// `lower_type_alias_refinements_phase` / `alloc_deferred_types_dag_refinement_placeholder` - /// in `lower.rs`): a **placeholder** `Declaration::refinement` carries the - /// fact that a `where` was authored (P3 — not a silent `None`), while PB-1 - /// stays diagnostic-clean. - fn parse_type_alias_where_tail(&mut self) -> Result<(Option, u32), Diagnostic> { - self.expect_kind(TokenKind::KwWhere)?; - let mut parts = vec![self.parse_expr()?]; - while matches!(self.peek().kind, TokenKind::Comma) { - self.bump(); - parts.push(self.parse_expr()?); - } - let end = crate::lower_helpers::expr_span(parts.last().expect("at least one where-part")) - .byte_end; - let combined = self.fold_type_alias_where_parts(parts); - Ok((Some(combined), end)) - } - - /// Lookahead: after `=`, is the RHS a sum? True when (a) a top-level `|` - /// exists before the next item boundary, or (b) the RHS opens as - /// `Variant {` / `Variant(` at depth zero (single-variant sum without `|`). - /// Tracks paren/brace depth so a `|` inside a payload list doesn't confuse - /// the scan. [`Self::parse_sum_variants`] skips a **leading** run of `|` - /// tokens so `| A | B` and `A | B` both parse. - /// - /// Do **not** treat [`TokenKind::Ident`] `inhabits` as an item boundary: it - /// can spell a sum variant / record field (see [`Self::parse_field_label`], - /// [`Self::parse_variant`]). - /// - /// [`TokenKind::KwType`] is likewise accepted as a variant/field spelling, - /// but it also begins every top-level `type` declaration. Whitespace is - /// not tokenized, so distinguish `type | …` (variant label) from - /// `type Name =` / `type Name<` / `type Name inhabits` (next decl) via a - /// two-token lookahead when depth is zero. - fn rhs_is_sum(&self, local_alias_reference_idents: &[String]) -> bool { - if self.rhs_opens_single_variant_sum_shape(local_alias_reference_idents) { - return true; - } - let mut i = self.pos; - let mut depth: i32 = 0; - while i < self.tokens.len() { - if let Some(role) = bracket_role(&self.tokens[i].kind) { - match role { - BracketRole::Opener => { - depth += 1; - i += 1; - continue; - } - BracketRole::Closer => { - if depth == 0 { - return false; - } - depth -= 1; - i += 1; - continue; - } - } - } - match &self.tokens[i].kind { - TokenKind::Pipe if depth == 0 => return true, - TokenKind::KwType if depth == 0 => { - let next = self.tokens.get(i + 1).map(|t| &t.kind); - let next2 = self.tokens.get(i + 2).map(|t| &t.kind); - let next_decl = match (next, next2) { - (Some(TokenKind::Ident(_)), Some(TokenKind::Eq | TokenKind::Lt)) => true, - (Some(TokenKind::Ident(_)), Some(TokenKind::Ident(s))) if s == "inhabits" => { - true - } - _ => false, - }; - if next_decl { - return false; - } - } - TokenKind::KwWhere | TokenKind::Eof if depth == 0 => return false, - _ if depth == 0 && is_type_rhs_boundary_keyword(&self.tokens[i].kind) => { - return false; - } - _ => {} - } - i += 1; - } - false - } - - /// After `=`, does the RHS open as a single sum variant without a top-level - /// `|`? True for `Variant { ... }`, `Variant(...)` / `Variant()`, and bare - /// `Variant` when the spelling is not a known alias target. False for - /// `Variant` — that begins a parameterized **alias** RHS - /// (`parse_type_expr`), not a variant payload. - fn rhs_opens_single_variant_sum_shape(&self, local_alias_reference_idents: &[String]) -> bool { - let i = self.pos; - let Some(t0) = self.tokens.get(i) else { - return false; - }; - let label = match &t0.kind { - TokenKind::Ident(s) => Some(s.as_str()), - _ => soft_keyword_ident_spelling(&t0.kind), - }; - let Some(label) = label else { - return false; - }; - if matches!( - self.tokens.get(i + 1).map(|t| &t.kind), - Some(TokenKind::LBrace) | Some(TokenKind::LParen) - ) { - return true; - } - let Some(refs) = &self.bare_rhs_alias_reference_idents else { - return false; - }; - if refs.contains(label) - || local_alias_reference_idents - .iter() - .any(|name| name == label) - { - return false; - } - matches!( - self.tokens.get(i + 1).map(|t| &t.kind), - Some(TokenKind::KwWhere | TokenKind::Eof) - ) || self - .tokens - .get(i + 1) - .is_some_and(|t| is_type_rhs_boundary_keyword(&t.kind)) - } - - fn parse_sum_variants(&mut self) -> Result, Diagnostic> { - while matches!(self.peek().kind, TokenKind::Pipe) { - self.bump(); - } - let mut variants = vec![self.parse_variant()?]; - while matches!(self.peek().kind, TokenKind::Pipe) { - self.bump(); - variants.push(self.parse_variant()?); - } - Ok(variants) - } - - fn parse_variant(&mut self) -> Result { - let name_token = self.bump().clone(); - let name = if let TokenKind::Ident(name) = &name_token.kind { - name.clone() - } else if let Some(spelling) = soft_keyword_ident_spelling(&name_token.kind) { - spelling.to_string() - } else { - return Err(Diagnostic::ParseError { - message: format!("expected variant name, got {:?}", name_token.kind), - span: name_token.span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("ParseError"), - }); - }; - match &self.peek().kind { - TokenKind::LParen => { - self.bump(); - let payload = self.parse_type_expr_list_until(TokenKind::RParen)?; - let close = self.expect_kind(TokenKind::RParen)?; - Ok(SurfaceVariant { - name, - payload: VariantPayload::Positional(payload), - span: SourceSpan::new( - self.file, - name_token.span.byte_start, - close.span.byte_end, - ), - }) - } - TokenKind::LBrace => { - self.bump(); - let fields = self.parse_record_fields()?; - let close = self.expect_kind(TokenKind::RBrace)?; - Ok(SurfaceVariant { - name, - payload: VariantPayload::Record(fields), - span: SourceSpan::new( - self.file, - name_token.span.byte_start, - close.span.byte_end, - ), - }) - } - _ => Ok(SurfaceVariant { - name, - payload: VariantPayload::Positional(Vec::new()), - span: name_token.span, - }), - } - } - - fn parse_params(&mut self) -> Result, Diagnostic> { - let mut params = Vec::new(); - if matches!(self.peek().kind, TokenKind::RParen) { - return Ok(params); - } - loop { - let name = self.parse_ident()?; - self.expect_kind(TokenKind::Colon)?; - let ty = self.parse_type_expr()?; - // DB-11 (3a.3): optional refinement predicate after the - // parameter's type. Parsed as an ordinary expression in - // the parameter's scope; lowering resolves operators - // against the parameter's type algebra. - let refinement = if matches!(self.peek().kind, TokenKind::KwWhere) { - self.bump(); - Some(self.parse_expr()?) - } else { - None - }; - params.push(SurfaceParam { - name, - ty, - refinement, - }); - if matches!(self.peek().kind, TokenKind::Comma) { - self.bump(); - continue; - } - break; - } - Ok(params) - } - - fn parse_type_expr(&mut self) -> Result { - let mut ty = self.parse_atom_type()?; - while matches!(self.peek().kind, TokenKind::Question) { - let q = self.bump().clone(); - let start = ty.span().byte_start; - ty = SurfaceType::Optional { - inner: Box::new(ty), - span: SourceSpan::new(self.file, start, q.span.byte_end), - }; - } - Ok(ty) - } - - fn parse_atom_type(&mut self) -> Result { - if matches!(self.peek().kind, TokenKind::KwFn) { - let fn_tok = self.bump().clone(); - self.expect_kind(TokenKind::LParen)?; - let inputs = self.parse_type_expr_list_until(TokenKind::RParen)?; - self.expect_kind(TokenKind::RParen)?; - self.expect_kind(TokenKind::Arrow)?; - let output = self.parse_type_expr()?; - let end = output.span().byte_end; - return Ok(SurfaceType::Arrow { - inputs, - output: Box::new(output), - span: SourceSpan::new(self.file, fn_tok.span.byte_start, end), - }); - } - - let token = self.bump().clone(); - let name = match token.kind { - TokenKind::Ident(n) => n, - other => { - return Err(Diagnostic::ParseError { - message: format!("expected type name, got {other:?}"), - span: token.span, - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("ParseError"), - }); - } - }; - - if matches!(self.peek().kind, TokenKind::Lt) && self.looks_like_type_args() { - self.bump(); - let args = self.parse_type_angle_arg_list_until_gt()?; - let close = self.expect_kind(TokenKind::Gt)?; - Ok(SurfaceType::Parameterized { - name, - args, - span: SourceSpan::new(self.file, token.span.byte_start, close.span.byte_end), - }) - } else { - Ok(SurfaceType::Named { - name, - span: token.span, - }) - } - } - - /// `<` is ambiguous: type-parameter delimiter vs. less-than operator. In - /// type position (parse_atom_type), we only see `<` after a bare Ident, so - /// it's always type args. In expression position (parse_comparison), - /// parse_atom_type is not called. This helper exists for defensive future - /// callers and currently always returns true. - fn looks_like_type_args(&self) -> bool { - true - } - - /// Decimal width literal permitted **only** inside `<…>` type-argument lists - /// (e.g. `Int<64>`). Standalone `let x: 64 = …` must stay a parse error — gate #60 - /// (single authority: this fragment is spliced by `regen_parse`; do not edit only - /// `parse_generated.rs` without updating here). - fn parse_width_nat_type_argument(&mut self) -> Result { - let token = self.bump().clone(); - match token.kind { - TokenKind::IntLit(decimal) => Ok(TypeAngleArg::WidthNatLiteral { - decimal, - span: token.span, - }), - other => Err(Diagnostic::ParseError { - message: format!("expected decimal width literal, got {other:?}"), - span: token.span, - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("ParseError"), - }), - } - } - - fn parse_type_angle_arg_list_until_gt(&mut self) -> Result, Diagnostic> { - let end = TokenKind::Gt; - let mut args = Vec::new(); - if self.peek().kind == end { - return Ok(args); - } - loop { - if matches!(self.peek().kind, TokenKind::IntLit(_)) { - args.push(self.parse_width_nat_type_argument()?); - } else { - let ty = self.parse_type_expr()?; - args.push(TypeAngleArg::TypeExpr { ty: Box::new(ty) }); - } - if matches!(self.peek().kind, TokenKind::Comma) { - self.bump(); - continue; - } - break; - } - Ok(args) - } - - fn parse_type_expr_list_until( - &mut self, - end: TokenKind, - ) -> Result, Diagnostic> { - let mut types = Vec::new(); - if self.peek().kind == end { - return Ok(types); - } - loop { - types.push(self.parse_type_expr()?); - if matches!(self.peek().kind, TokenKind::Comma) { - self.bump(); - continue; - } - break; - } - Ok(types) - } - - fn parse_ident(&mut self) -> Result { - let token = self.bump().clone(); - match token.kind { - TokenKind::Ident(name) => Ok(name), - other => Err(Diagnostic::ParseError { - message: format!("expected identifier, got {other:?}"), - span: token.span, - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("ParseError"), - }), - } - } - - fn parse_expr(&mut self) -> Result { - self.parse_logical_or() - } - - // Per-precedence-level functions below are lowest-to-highest binding - // (Or → And → Comparison → Additive → Multiplicative). The token → - // `OperatorKind` map for each level is authored declaratively in - // `parse_tables.dag` and consumed via `binary_op_at_level`; this file - // owns control flow (chaining, non-chaining, span fusion) only. - - fn parse_logical_or(&mut self) -> Result { - let mut lhs = self.parse_logical_and()?; - while let Some(op) = binary_op_at_level(&self.peek().kind, BinaryOpLevel::Or) { - self.bump(); - let rhs = self.parse_logical_and()?; - let start = expr_span(&lhs).byte_start; - let end = expr_span(&rhs).byte_end; - lhs = SurfaceExpr::Operator { - op, - args: vec![lhs, rhs], - span: SourceSpan::new(self.file, start, end), - }; - } - Ok(lhs) - } - - fn parse_logical_and(&mut self) -> Result { - let mut lhs = self.parse_comparison()?; - while let Some(op) = binary_op_at_level(&self.peek().kind, BinaryOpLevel::And) { - self.bump(); - let rhs = self.parse_comparison()?; - let start = expr_span(&lhs).byte_start; - let end = expr_span(&rhs).byte_end; - lhs = SurfaceExpr::Operator { - op, - args: vec![lhs, rhs], - span: SourceSpan::new(self.file, start, end), - }; - } - Ok(lhs) - } - - fn parse_comparison(&mut self) -> Result { - let lhs = self.parse_additive()?; - if let Some(op) = binary_op_at_level(&self.peek().kind, BinaryOpLevel::Comparison) { - self.bump(); - let rhs = self.parse_additive()?; - let start = expr_span(&lhs).byte_start; - let end = expr_span(&rhs).byte_end; - Ok(SurfaceExpr::Operator { - op, - args: vec![lhs, rhs], - span: SourceSpan::new(self.file, start, end), - }) - } else { - Ok(lhs) - } - } - - fn parse_additive(&mut self) -> Result { - let mut lhs = self.parse_term()?; - while let Some(op) = binary_op_at_level(&self.peek().kind, BinaryOpLevel::Additive) { - self.bump(); - let rhs = self.parse_term()?; - let start = expr_span(&lhs).byte_start; - let end = expr_span(&rhs).byte_end; - lhs = SurfaceExpr::Operator { - op, - args: vec![lhs, rhs], - span: SourceSpan::new(self.file, start, end), - }; - } - Ok(lhs) - } - - fn parse_term(&mut self) -> Result { - let mut lhs = self.parse_pipe()?; - while let Some(op) = binary_op_at_level(&self.peek().kind, BinaryOpLevel::Multiplicative) { - self.bump(); - let rhs = self.parse_pipe()?; - let start = expr_span(&lhs).byte_start; - let end = expr_span(&rhs).byte_end; - lhs = SurfaceExpr::Operator { - op, - args: vec![lhs, rhs], - span: SourceSpan::new(self.file, start, end), - }; - } - Ok(lhs) - } - - fn parse_pipe(&mut self) -> Result { - let mut lhs = self.parse_primary()?; - while matches!(self.peek().kind, TokenKind::PipeArrow) { - self.bump(); - lhs = self.parse_pipe_target(lhs)?; - } - Ok(lhs) - } - - fn parse_pipe_target(&mut self, lhs: SurfaceExpr) -> Result { - let start = expr_span(&lhs).byte_start; - let target_token = self.bump().clone(); - let target_expr = match target_token.kind { - TokenKind::Ident(name) => self.parse_ident_expr(name, target_token.span.clone())?, - other => { - return Err(Diagnostic::ParseError { - message: format!( - "expected function name after `|>`, got {other:?} — pipe desugars only to `f` or `f(...)`" - ), - span: target_token.span, - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("ParseError"), - }); - } - }; - match target_expr { - SurfaceExpr::Var { name, span } => Ok(SurfaceExpr::Call { - target: name, - args: vec![lhs], - span: SourceSpan::new(self.file, start, span.byte_end), - }), - SurfaceExpr::Call { - target, - mut args, - span, - } => { - let mut injected_args = Vec::with_capacity(args.len() + 1); - injected_args.push(lhs); - injected_args.append(&mut args); - Ok(SurfaceExpr::Call { - target, - args: injected_args, - span: SourceSpan::new(self.file, start, span.byte_end), - }) - } - SurfaceExpr::Path { span, .. } => Err(Diagnostic::ParseError { - message: - "expected function name or call after `|>`; dotted paths are not callable in the current surface grammar" - .to_string(), - span, - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("ParseError"), - }), - SurfaceExpr::PathCall { span, .. } => Err(Diagnostic::ParseError { - message: - "expected function name or call after `|>`; dotted-path calls are not pipe targets in the current surface grammar" - .to_string(), - span, - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("ParseError"), - }), - SurfaceExpr::VariantRecord { span, .. } => Err(Diagnostic::ParseError { - message: - "expected function name or call after `|>`; named constructor literals are values, not callable pipe targets" - .to_string(), - span, - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("ParseError"), - }), - _ => unreachable!("parse_ident_expr only returns Var, Call, Path, PathCall, or VariantRecord"), - } - } - - fn parse_primary(&mut self) -> Result { - let peek = &self.peek().kind; - // Map literals share the `{` prefix with record literals. Top-level `data` - // disambiguates via `looks_like_map_literal` before `parse_record_literal`; - // mirror that here so nested `Map` fields (e.g. GitHub Actions - // `with:`) can use string keys like `"fetch-depth"`. - if matches!(peek, TokenKind::LBrace) && self.looks_like_map_literal() { - return self.parse_map_literal(); - } - match primary_prefix_dispatch(peek) { - Some(PrimaryPrefixDispatch::If) => return self.parse_if(), - Some(PrimaryPrefixDispatch::Match) => return self.parse_match(), - Some(PrimaryPrefixDispatch::Record) => return self.parse_record_literal(), - Some(PrimaryPrefixDispatch::List) => return self.parse_list_literal(), - Some(PrimaryPrefixDispatch::Caret) => return self.parse_caret(), - None => {} - } - let token = self.bump().clone(); - let cls = primary_atom_class(&token.kind).ok_or_else(|| Diagnostic::ParseError { - message: format!("expected primary expression, got {:?}", token.kind), - span: token.span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("ParseError"), - })?; - match (cls, token.kind) { - (PrimaryAtomClass::IntLiteral, TokenKind::IntLit(value)) => Ok(SurfaceExpr::Literal { - value: SurfaceLiteral::Int(value), - span: token.span, - }), - (PrimaryAtomClass::True, TokenKind::KwTrue) => Ok(SurfaceExpr::Literal { - value: SurfaceLiteral::Bool(true), - span: token.span, - }), - (PrimaryAtomClass::False, TokenKind::KwFalse) => Ok(SurfaceExpr::Literal { - value: SurfaceLiteral::Bool(false), - span: token.span, - }), - (PrimaryAtomClass::String, TokenKind::StringLit(value)) => Ok(SurfaceExpr::Literal { - value: SurfaceLiteral::String(value), - span: token.span, - }), - (PrimaryAtomClass::Pipe, TokenKind::Pipe) => self.parse_lambda(token.span), - (PrimaryAtomClass::Ident, TokenKind::Ident(name)) => { - self.parse_ident_expr(name, token.span) - } - (class, other) => Err(Diagnostic::ParseError { - message: format!( - "internal: primary-atom class {class:?} does not match `TokenKind` {other:?} \ - (fix `PrimaryAtomRow` in `parse_tables.dag` or `regen_parse_tables` output)" - ), - span: token.span, - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("ParseError"), - }), - } - } - - /// `^IDENT` → opaque `Symbol` literal (spelling only; no name resolution). - /// `^(Expr)` → `discriminant(Expr)` surface sugar (reify ctor name of value). - fn parse_caret(&mut self) -> Result { - let caret = self.expect_kind(TokenKind::Caret)?; - let start = caret.span.byte_start; - match &self.peek().kind { - TokenKind::Ident(name) => { - let ident = self.bump().clone(); - let TokenKind::Ident(spelling) = ident.kind else { - unreachable!("peek matched Ident"); - }; - Ok(SurfaceExpr::Literal { - value: SurfaceLiteral::Symbol(spelling), - span: SourceSpan::new(self.file, start, ident.span.byte_end), - }) - } - TokenKind::LParen => { - self.bump(); - let inner = self.parse_expr()?; - let close = self.expect_kind(TokenKind::RParen)?; - Ok(SurfaceExpr::Call { - target: "discriminant".to_string(), - args: vec![inner], - span: SourceSpan::new(self.file, start, close.span.byte_end), - }) - } - other => Err(Diagnostic::ParseError { - message: format!( - "expected identifier or `(` after `^` (symbol literal or discriminant), got {other:?}" - ), - span: self.peek().span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("ParseError"), - }), - } - } - - fn parse_list_literal(&mut self) -> Result { - let open = self.expect_kind(TokenKind::LBracket)?; - let mut elements = Vec::new(); - while !matches!(self.peek().kind, TokenKind::RBracket) { - elements.push(self.parse_expr()?); - if matches!(self.peek().kind, TokenKind::Comma) { - self.bump(); - } else if !matches!(self.peek().kind, TokenKind::RBracket) { - return Err(Diagnostic::ParseError { - message: format!( - "expected `,` or `]` in list literal, got {:?}", - self.peek().kind - ), - span: self.peek().span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("ParseError"), - }); - } - } - let close = self.expect_kind(TokenKind::RBracket)?; - Ok(SurfaceExpr::List { - elements, - span: SourceSpan::new(self.file, open.span.byte_start, close.span.byte_end), - }) - } - - fn parse_ident_expr( - &mut self, - name: String, - span: SourceSpan, - ) -> Result { - if matches!(self.peek().kind, TokenKind::LParen) { - self.bump(); - let args = self.parse_call_args()?; - let close = self.expect_kind(TokenKind::RParen)?; - let start = span.byte_start; - let end = close.span.byte_end; - Ok(SurfaceExpr::Call { - target: name, - args, - span: SourceSpan::new(self.file, start, end), - }) - } else if matches!(self.peek().kind, TokenKind::LBrace) && !self.brace_starts_match_arms() { - let (fields, fields_span) = self.parse_named_expr_fields()?; - Ok(SurfaceExpr::VariantRecord { - target: name, - fields, - span: SourceSpan::new(self.file, span.byte_start, fields_span.byte_end), - }) - } else if matches!(self.peek().kind, TokenKind::Dot) { - // Member-access chain: Ident (. Ident)+. Always - // reads at least one additional segment because - // the Dot is in the peek. Lowers to - // `SurfaceExpr::Path` for downstream resolution - // via top-level symbol + Conj-child walk by label. - let mut segments = vec![name]; - let mut segment_spans = vec![span.clone()]; - let start = span.byte_start; - let mut end = span.byte_end; - while matches!(self.peek().kind, TokenKind::Dot) { - self.bump(); - let next = self.bump().clone(); - match next.kind { - TokenKind::Ident(n) => { - end = next.span.byte_end; - segments.push(n); - segment_spans.push(next.span.clone()); - } - other => { - return Err(Diagnostic::ParseError { - message: format!( - "expected identifier after `.` in dotted path, got {other:?}" - ), - span: next.span, - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("ParseError"), - }); - } - } - } - // Prereq-X1: `.(args)` is call-on-field-access. - // After the dotted-segment walk, peek for `(`. If present, - // consume the call args and emit `PathCall`. The lowerer - // (Prereq-X1.a) only accepts `PathCall` whose head segment - // is a static `data` binding with `ValueBody::Structural`; - // parameter heads (X1.b) and other runtime-sourced heads - // produce typed lowering diagnostics. - if matches!(self.peek().kind, TokenKind::LParen) { - self.bump(); - let args = self.parse_call_args()?; - let close = self.expect_kind(TokenKind::RParen)?; - return Ok(SurfaceExpr::PathCall { - segments, - segment_spans, - args, - span: SourceSpan::new(self.file, start, close.span.byte_end), - }); - } - Ok(SurfaceExpr::Path { - segments, - segment_spans, - span: SourceSpan::new(self.file, start, end), - }) - } else { - Ok(SurfaceExpr::Var { name, span }) - } - } - - fn parse_lambda(&mut self, open_span: SourceSpan) -> Result { - let mut params = Vec::new(); - if !matches!(self.peek().kind, TokenKind::Pipe) { - loop { - let token = self.bump().clone(); - match token.kind { - TokenKind::Ident(name) => params.push(name), - other => { - return Err(Diagnostic::ParseError { - message: format!( - "expected identifier in lambda parameter list, got {other:?}" - ), - span: token.span, - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("ParseError"), - }); - } - } - if matches!(self.peek().kind, TokenKind::Comma) { - self.bump(); - continue; - } - break; - } - } - self.expect_kind(TokenKind::Pipe)?; - let body = self.parse_expr()?; - let end = expr_span(&body).byte_end; - Ok(SurfaceExpr::Lambda { - params, - body: Box::new(body), - span: SourceSpan::new(self.file, open_span.byte_start, end), - }) - } - - /// True when the next argument is `label:` — enables `f(a: 1, b: 2)` call sugar - /// that desugars to `f(Record { a: 1, b: 2 })` so `types.dag` refinements like - /// `range(min: 1, max: 5)` parse without changing the `SurfaceExpr::Call` shape. - fn call_args_open_with_named_field(&self) -> bool { - matches!(self.tokens.get(self.pos).map(|t| &t.kind), Some(TokenKind::Ident(_))) - && matches!( - self.tokens.get(self.pos + 1).map(|t| &t.kind), - Some(TokenKind::Colon) - ) - } - - /// Parse `label: expr` groups separated by commas until `)` (not consumed). - fn parse_paren_named_field_call_args(&mut self) -> Result { - let start = self.peek().span.byte_start; - let mut fields: Vec = Vec::new(); - loop { - let (field_name, name_span) = self.parse_field_label()?; - self.expect_kind(TokenKind::Colon)?; - let value = self.parse_expr()?; - let field_end = expr_span(&value).byte_end; - fields.push(SurfaceRecordField { - name: field_name, - value, - span: SourceSpan::new(self.file, name_span.byte_start, field_end), - }); - if matches!(self.peek().kind, TokenKind::Comma) { - self.bump(); - continue; - } - break; - } - let end = fields - .last() - .map(|f| f.span.byte_end) - .unwrap_or(start); - Ok(SurfaceExpr::Record { - fields, - span: SourceSpan::new(self.file, start, end), - }) - } - - fn parse_call_args(&mut self) -> Result, Diagnostic> { - let mut args = Vec::new(); - if matches!(self.peek().kind, TokenKind::RParen) { - return Ok(args); - } - if self.call_args_open_with_named_field() { - args.push(self.parse_paren_named_field_call_args()?); - return Ok(args); - } - loop { - args.push(self.parse_expr()?); - if matches!(self.peek().kind, TokenKind::Comma) { - self.bump(); - continue; - } - break; - } - Ok(args) - } - - fn parse_if(&mut self) -> Result { - let if_token = self.bump().clone(); - debug_assert!(matches!(if_token.kind, TokenKind::KwIf)); - let cond = self.parse_expr()?; - self.expect_kind(TokenKind::KwThen)?; - let then_branch = self.parse_expr()?; - self.expect_kind(TokenKind::KwElse)?; - let else_branch = self.parse_expr()?; - let start = if_token.span.byte_start; - let end = expr_span(&else_branch).byte_end; - Ok(SurfaceExpr::If { - cond: Box::new(cond), - then_branch: Box::new(then_branch), - else_branch: Box::new(else_branch), - span: SourceSpan::new(self.file, start, end), - }) - } - - /// Parse a `match { => ... }` - /// expression. At M1(2.8) patterns are limited to bare variant - /// constructors (`Ident`), positional single-payload captures - /// (`Variant(binding)`), and named-payload captures - /// (`Variant { field: binding }`). Arms are brace-separated with - /// optional comma between them for readability; we accept either. - fn parse_match(&mut self) -> Result { - let match_token = self.bump().clone(); - debug_assert!(matches!(match_token.kind, TokenKind::KwMatch)); - let scrutinee = self.parse_expr()?; - self.expect_kind(TokenKind::LBrace)?; - let mut arms: Vec = Vec::new(); - while !matches!(self.peek().kind, TokenKind::RBrace) { - arms.push(self.parse_match_arm()?); - // Accept an optional comma between arms. - if matches!(self.peek().kind, TokenKind::Comma) { - self.bump(); - } - } - let close = self.expect_kind(TokenKind::RBrace)?; - let start = match_token.span.byte_start; - let end = close.span.byte_end; - Ok(SurfaceExpr::Match { - scrutinee: Box::new(scrutinee), - arms, - span: SourceSpan::new(self.file, start, end), - }) - } - - fn parse_match_arm(&mut self) -> Result { - let name_token = self.bump().clone(); - let pattern = match &name_token.kind { - TokenKind::Ident(name) => { - if matches!(self.peek().kind, TokenKind::LParen) { - self.bump(); - let binding_token = self.bump().clone(); - let binding_name = match &binding_token.kind { - TokenKind::Ident(binding) => binding.clone(), - other => { - return Err(Diagnostic::ParseError { - message: format!( - "expected binding name in payload match pattern after `{name}(`, got {other:?}" - ), - span: binding_token.span, - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("ParseError"), - }); - } - }; - let close = self.expect_kind(TokenKind::RParen)?; - SurfacePattern::VariantWith { - name: name.clone(), - binding: binding_name, - span: SourceSpan::new( - self.file, - name_token.span.byte_start, - close.span.byte_end, - ), - } - } else if matches!(self.peek().kind, TokenKind::LBrace) { - let (fields, fields_span) = self.parse_named_pattern_fields()?; - SurfacePattern::VariantFields { - name: name.clone(), - fields, - span: SourceSpan::new( - self.file, - name_token.span.byte_start, - fields_span.byte_end, - ), - } - } else { - SurfacePattern::BareVariant { - name: name.clone(), - span: name_token.span.clone(), - } - } - } - other => { - return Err(Diagnostic::ParseError { - message: format!( - "expected variant name in match pattern, got {other:?} — M1(2.8) supports `Variant => expr`, `Variant(binding) => expr`, and `Variant {{ field: binding }} => expr`" - ), - span: name_token.span, - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("ParseError"), - }); - } - }; - self.expect_kind(TokenKind::FatArrow)?; - let body = self.parse_expr()?; - let start = name_token.span.byte_start; - let end = expr_span(&body).byte_end; - Ok(SurfaceMatchArm { - pattern, - body, - span: SourceSpan::new(self.file, start, end), - }) - } -} - -pub(crate) fn expr_span(expr: &SurfaceExpr) -> &SourceSpan { - match expr { - SurfaceExpr::Literal { span, .. } - | SurfaceExpr::Var { span, .. } - | SurfaceExpr::Path { span, .. } - | SurfaceExpr::Call { span, .. } - | SurfaceExpr::VariantRecord { span, .. } - | SurfaceExpr::Operator { span, .. } - | SurfaceExpr::Lambda { span, .. } - | SurfaceExpr::If { span, .. } - | SurfaceExpr::Match { span, .. } - | SurfaceExpr::Record { span, .. } - | SurfaceExpr::List { span, .. } - | SurfaceExpr::Map { span, .. } - | SurfaceExpr::PathCall { span, .. } => span, - } -} diff --git a/src/v3/compiler/parse_tables.dag b/src/v3/compiler/parse_tables.dag deleted file mode 100644 index 725c5f52197..00000000000 --- a/src/v3/compiler/parse_tables.dag +++ /dev/null @@ -1,521 +0,0 @@ -// v3.compiler.parse_tables — SG-2c-1 grammar-tables prototype authority. -// -// **SG-2c cluster (structural lane) — `parse_primary` prefix + atom family.** -// Two table surfaces in one function: (A) `PrimaryPrefixRow` / `primary_prefix_dispatch` -// (SG-2c-6), (B) `PrimaryAtomRow` / `primary_atom_class` (SG-2c-7). Same-PR receipt: -// authority in this file; `regen_parse_tables` to `parse_tables_generated.rs`; -// `regen_parse` of `parse_parser_body.txt` to `parse_generated.rs`; -// `sg2c1_parse_tables_authority_test` ratchet; open-coded `TokenKind` dispatch in -// `parse_primary` removed in favor of those projections. -// -// **Scope.** SG-2c proper (parser authority proper — retiring -// `parse_parser_body.txt` as parse logic) is blocked on a named -// substrate capability: recursive list-body emission over `List` -// with cursor threading. See `src/v3/std/list.dag:13-15` ("the current -// compiler still lacks full structural recursion + list-body emission -// support") and SELF_HOSTING.md §6 Phase 4a. Until that lands, any full -// `.dag` parser port routes through a hidden Rust host layer, which -// SG-2c's STOP-AND-ESCALATE bullet forbids. -// -// **What this file is.** The bounded, honest subset of parser -// authority that DOES fit current `.dag` capabilities: pure -// declarative tables: (1) binary operator token-to-semantics mapping -// (SG-2c-1), (2) top-level item keyword → `parse_item` dispatch -// class (SG-2c-2), (3) type-RHS boundary keyword membership -// (SG-2c-3), (4) bracket opener/closer role membership (SG-2c-4, -// consumed by the parser's depth-tracking scan helpers `skip_where_clause` -// and `rhs_is_sum`), (5) primary-expression prefix openers (SG-2c-6, -// consumed by `parse_primary`), and (6) primary-expression atomic tail tokens -// after the prefix pass (SG-2c-7, same function). The binary-operator table replaced hand-coded -// matches across five parser precedence functions in -// `parse_parser_body.txt` -// (`parse_logical_or`, `parse_logical_and`, `parse_comparison`, -// `parse_additive`, `parse_term`). Those functions now call the -// generated helper `binary_op_at_level` instead of open-coding the -// token → `OperatorKind` match. **SG-2c cluster (prefix + atom family):** after -// the `parse_primary` prefix pass (`PrimaryPrefixRow` → -// `primary_prefix_dispatch`, SG-2c-6), the non-prefix first token of a primary -// is classified by `PrimaryAtomRow` (SG-2c-7) via `primary_atom_class` so the -// closed set of `Int`/`true`/`false`/string/lambda/ident forms stays table-owned. -// -// **What this file is NOT.** Parser control flow. Cursor mechanics. -// Error recovery. Item-kind dispatch. Recursive-descent itself. Those -// remain semantic authority in `parse_parser_body.txt` (explicitly -// residual; see header there). -// -// **Dissolution trigger.** Full parser authority proper (SG-2c -// proper) is blocked on recursive list-body emission from -// `std/list.dag`. Once that lands, `parse_parser_body.txt` can be -// ported to `.dag` as recursive-descent functions on `List` -// and this table becomes one data section of a larger `parse.dag` -// (or merges into a Phase 4b grammar-as-data spec). -// -// **Rust projection.** `src/v3/compiler/src/parse_tables_generated.rs` -// is produced by `cargo run -p v3-compiler --bin regen_parse_tables` -// — do not hand-edit it. The freshness ratchet lives in -// `tests/integration/sg2c1_parse_tables_authority_test.rs`. -// -// **Same-PR consumer (E-6).** SG-2c-2 projection `top_level_item_dispatch` -// / Rust `ItemDispatchKind` (derived from keyword rows only) is consumed by the -// live parser: `parse_item` in `parse_parser_body.txt` (spliced into -// `parse_generated.rs` via `regen_parse`). -// -// **Same-PR consumer (E-6).** SG-2c-3 projection `is_type_rhs_boundary_keyword` -// is emitted from the existing `TopLevelItemKwRow` facts and consumed by the -// live parser's type-RHS lookahead helpers `skip_where_clause` and -// `rhs_is_sum` in `parse_parser_body.txt`. -// -// **Same-PR consumer (E-6).** SG-2c-4 projection `bracket_role` / `BracketRole` -// is emitted from `BracketRow` facts and consumed by the same type-RHS -// helpers `skip_where_clause` and `rhs_is_sum` in `parse_parser_body.txt`, -// replacing two duplicated inline bracket-membership match blocks. -// -// **Same-PR consumer (E-6).** SG-2c-6 projection `primary_prefix_dispatch` / -// `PrimaryPrefixDispatch` is emitted from `PrimaryPrefixRow` facts and -// consumed by `parse_primary` in `parse_parser_body.txt`, replacing the -// four inline `if matches!(peek, …)` prefix probes. -// -// **Same-PR consumer (E-6).** SG-2c-7 projection `primary_atom_class` / -// `PrimaryAtomClass` is emitted from `PrimaryAtomRow` facts and consumed -// in the same `parse_primary` function after the prefix pass, replacing the -// open `match` on the post-bump `TokenKind` for atomic primary forms. - -module v3.compiler.parse_tables - -// Precedence level of a binary operator. Mirrors the five parser -// precedence functions in `parse_parser_body.txt` (lowest to highest -// binding): logical-or, logical-and, comparison, additive, -// multiplicative. The parser consumes this enum by filtering -// `binary_op_at_level(token, LEVEL)` at each precedence function. -// -// Dissolution classification: **🟡 YELLOW (scaffold)** per -// `docs/modeling-discipline.md` §4. A richer source exists -// (precedence is a 1D numeric ordering — Pattern 4), but -// extraction is not cheap today: a precedence-climbing surface -// grammar reformulation rides the same lane as SG-2c proper, -// which is blocked on recursive list-body emission over -// `List`. See trigger at the bottom of this ledger. -// -// Dissolution ledger (4-pattern check per THESIS §"Structural -// decompression"; MODELING M7 / feedback_coproduct_dissolution): -// - **Pattern 1 (fact placement)**: fails. Each variant is just a -// coordinate key, not a distinct payload shape. Scattering into -// five per-variant side tables ("is_or_level", "is_and_level", ...) -// would duplicate `BinaryOpRow` per level with no payload -// difference, adding dispatch rather than removing it. -// - **Pattern 2 (variant-is-data)**: fails. All variants are nullary -// and structurally identical — this IS the discriminant-only shape; -// a unified representation would be the enum itself. -// - **Pattern 3 (algebraic form)**: fails. There is no shared -// algebra the five variants inhabit; they are distinct parser -// control-flow points, not elements of a computed structure. -// - **Pattern 4 (dimensional)**: **passes structurally, deferred -// on substrate**. Precedence is a 1D total order -// (Or < And < Comparison < Additive < Multiplicative) and could -// be encoded as `Int where 1 <= n <= 5`. Not extracted today -// because (a) the only consumer is five hand-authored parser -// functions in `parse_parser_body.txt` that select by name — -// there is no algebraic consumer that exploits the dimension -// yet, so collapsing to `Int` loses `binary_op_at_level`'s -// exhaustive `match (tk, level)` without a corresponding gain; -// (b) the consumer itself (the recursive-descent parser) is -// pinned as residual semantic authority, blocked on the same -// substrate gap as SG-2c proper. -// -// **Named trigger (YELLOW):** when surface-grammar precedence is -// reformulated as a structural fact — i.e. a precedence-climbing -// interpreter reading a numeric ordering — dissolve `BinaryOpLevel` -// to `Int where 1 <= n <= 5` and let the interpreter consume the -// dimension. That reformulation rides the same lane as SG-2c -// proper (retiring `parse_parser_body.txt`), which is blocked on -// recursive list-body emission over `List` per -// `src/v3/std/list.dag:13-15`. Both dissolutions unlock together. -type BinaryOpLevel - = Or - | And - | Comparison - | Additive - | Multiplicative - -// One row per binary-operator token. `token_variant` is the -// `TokenKind` variant name (e.g. "PipePipe"); `operator_symbol` is -// the canonical operator spelling that `operators.dag::from_symbol` -// already maps to an `OperatorKind`; `level` is the parser -// precedence function that should consume this token. Keyed on the -// textual variant name to avoid importing `tokenize.TokenKind` here -// (scope: declarative data only, not cross-module structural -// matching — that widens to SG-2c proper). -// -// **Grounding in the shared-syntax authority.** Each row is -// structurally cross-validated at regen time, so the table is a -// projection of the shared authority rather than a parallel -// restatement. Four joins close every drift surface: -// - `token_variant` must match a `TokenKind` variant in `tokenize.dag` -// - `operator_symbol` must map to an `OperatorKind` via -// `operators.dag::from_symbol` -// - `(operator_symbol, level)` must agree with `dag_operators` in -// `dsl/extdeps/languages/dag/syntax.dag`: the canonical -// `left_bp` for the symbol must fall inside the bp band assigned -// to the declared `level` (see `level_for_bp` in -// `regen_parse_tables_emit.rs`) -// - the `OperatorKind` returned by `operators.dag::from_symbol` must -// have a leaf variant whose name matches the shared authority's -// `binop` field — so `operators.dag` and `dag_operators` cannot -// disagree on what a symbol means -// If any shared authority shifts, regen fails closed here before -// any parser change ships. -type BinaryOpRow { - token_variant: String - operator_symbol: String - level: BinaryOpLevel -} - -data binary_op_pipepipe: BinaryOpRow = { - token_variant: "PipePipe" - operator_symbol: "||" - level: Or -} - -data binary_op_ampamp: BinaryOpRow = { - token_variant: "AmpAmp" - operator_symbol: "&&" - level: And -} - -data binary_op_eqeq: BinaryOpRow = { - token_variant: "EqEq" - operator_symbol: "==" - level: Comparison -} - -data binary_op_noteq: BinaryOpRow = { - token_variant: "NotEq" - operator_symbol: "!=" - level: Comparison -} - -data binary_op_lt: BinaryOpRow = { - token_variant: "Lt" - operator_symbol: "<" - level: Comparison -} - -data binary_op_le: BinaryOpRow = { - token_variant: "Le" - operator_symbol: "<=" - level: Comparison -} - -data binary_op_gt: BinaryOpRow = { - token_variant: "Gt" - operator_symbol: ">" - level: Comparison -} - -data binary_op_ge: BinaryOpRow = { - token_variant: "Ge" - operator_symbol: ">=" - level: Comparison -} - -data binary_op_plus: BinaryOpRow = { - token_variant: "Plus" - operator_symbol: "+" - level: Additive -} - -data binary_op_minus: BinaryOpRow = { - token_variant: "Minus" - operator_symbol: "-" - level: Additive -} - -data binary_op_star: BinaryOpRow = { - token_variant: "Star" - operator_symbol: "*" - level: Multiplicative -} - -data binary_op_slash: BinaryOpRow = { - token_variant: "Slash" - operator_symbol: "/" - level: Multiplicative -} - -// --- SG-2c-2: top-level item keyword dispatch (`parse_item` in -// `parse_parser_body.txt`). Each row lists one dedicated keyword -// `TokenKind` variant. **Substrate authority is only `token_variant`**. -// Regen emits the Rust projection `ItemDispatchKind` by taking the unique -// set of `strip_prefix("Kw")` labels from all rows (`KwLet` → `Let`) — there -// is **no** separate `ItemDispatchKind` coproduct authored here (M7 / one -// domain, one authority in `parse_tables.dag`). -// -// Dispatch classification for top-level item forms — discriminant-only -// projection keyed by authoritative lexer tokens (join `tokenize.dag`). -// -// Dissolution classification: **🟡 YELLOW (scaffold)** per -// `docs/modeling-discipline.md` §4. Same structural situation as -// `BinaryOpLevel`: each emitted enum variant is a parser entry coordinate, not a -// distinct payload algebra; full dissolution rides SG-2c proper (blocked -// on recursive list-body emission over `List`). -// -// Dissolution ledger (4-pattern check): -// - **Pattern 1 (fact placement)**: fails. Dispatch keys are coordinate keys for -// `parse_*_item` entry points, not relocatable facts. -// - **Pattern 2 (variant-is-data)**: **passes**: substrate rows are -// `token_variant` only; the Rust `ItemDispatchKind` enum is a pure projection -// over those strings, not a second `.dag` coproduct. -// - **Pattern 3 (algebraic form)**: fails. No shared algebra across item forms. -// - **Pattern 4 (dimensional)**: fails / not applicable (cardinality comes only from -// how many `TopLevelItemKwRow` facts exist, not from a substrate enum type). -// -// **M7 note:** there is **no** `type ItemDispatchKind` in `parse_tables.dag` — only -// `TopLevelItemKwRow` rows. Rust `ItemDispatchKind` is regen-only (unique `Kw`-strip -// labels); not a second authored closed set in substrate. -// -// **Named trigger (YELLOW):** dissolve with SG-2c proper when -// `parse_parser_body.txt` ports to `.dag` list-body recursion. - -// Authored fact: which `TokenKind` keyword opens a top-level item (dispatch -// label for Rust is `token_variant.strip_prefix("Kw")`, validated at regen). -// -// **M7 / INVARIANTS (single authority, consumed).** Not a shadow table: regen -// (`regen_parse_tables_emit::collect_top_level_item_kw_rows` → `emit_module`) -// validates each row against `tokenize.dag` and emits -// `parse_tables_generated.rs` (`ItemDispatchKind` + `top_level_item_dispatch`; enum is projection-only). -// The live parser calls `top_level_item_dispatch` from `parse_item` -// (`parse_parser_body.txt`, spliced into `parse_generated.rs`). Ratchet: -// `sg2c1_parse_tables_authority_test` + checked-in generated module snapshot. -type TopLevelItemKwRow { - token_variant: String -} - -// Each row below feeds `collect_top_level_item_kw_rows` → emitted -// `parse_tables_generated.rs::top_level_item_dispatch`; `parse_item` calls that -// helper instead of matching `TokenKind::Kw*` — not a duplicate dispatch table. - -data top_level_kw_let: TopLevelItemKwRow = { - token_variant: "KwLet" -} - -data top_level_kw_fn: TopLevelItemKwRow = { - token_variant: "KwFn" -} - -data top_level_kw_type: TopLevelItemKwRow = { - token_variant: "KwType" -} - -data top_level_kw_module: TopLevelItemKwRow = { - token_variant: "KwModule" -} - -data top_level_kw_import: TopLevelItemKwRow = { - token_variant: "KwImport" -} - -data top_level_kw_data: TopLevelItemKwRow = { - token_variant: "KwData" -} - -// --- SG-2c-5: keyword-token aliases that the parser accepts as bare -// identifier spellings in label/name positions. Today this is the -// `KwType -> "type"` carveout used by both record-field labels and sum-variant names. -// The parser consumes the generated -// `soft_keyword_ident_spelling` projection rather than duplicating the -// `TokenKind::KwType => "type"` match at each call site. -// -// Dissolution classification: **🟡 YELLOW (scaffold)**. Same shape as -// `TopLevelItemKwRow`: substrate rows author only `token_variant`; the -// Rust string spelling is a projection (`Kw` prefix stripped and -// lowercased), not a second `.dag` field. Full dissolution rides -// SG-2c proper when parser control flow ports out of -// `parse_parser_body.txt`. -type SoftKeywordIdentRow { - token_variant: String -} - -data soft_keyword_ident_type: SoftKeywordIdentRow = { - token_variant: "KwType" -} - -// --- SG-2c-4: bracket opener / closer membership table. Parser helpers -// that skip or scan token spans while tracking paren/brace/bracket depth -// (`skip_where_clause`, `rhs_is_sum` in `parse_parser_body.txt`) dispatch -// on exactly this three-pair set. Authored here once and consumed via -// the generated `bracket_role` projection; the two duplicated inline -// `TokenKind::L{Paren,Brace,Bracket}` / `TokenKind::R{Paren,Brace,Bracket}` -// match blocks collapse to one structural lookup. -// -// Dissolution classification: **🟡 YELLOW (scaffold)** per -// `docs/modeling-discipline.md` §4. Same structural situation as the -// other SG-2c tables: each emitted `BracketRole` variant is a -// parser-dispatch coordinate, not a distinct payload algebra; full -// dissolution rides SG-2c proper (blocked on recursive list-body -// emission over `List`). -// -// Dissolution ledger (4-pattern check): -// - **Pattern 1 (fact placement)**: fails. Role is a coordinate key for -// depth-tracking control flow, not a relocatable payload. -// - **Pattern 2 (variant-is-data)**: **passes**: substrate rows are -// `token_variant` only; the Rust `BracketRole` enum is a pure -// projection derived from the `L`/`R` prefix at regen time, not a -// second `.dag` coproduct and not a separately authored field (same -// one-authority shape as `TopLevelItemKwRow` → `ItemDispatchKind`). -// - **Pattern 3 (algebraic form)**: fails. Openers and closers are -// not elements of a shared computed algebra at this level; bracket -// pairing is enforced by the grammar structurally, not here. -// - **Pattern 4 (dimensional)**: fails. Not a numeric ordering. -// -// **Named trigger (YELLOW):** dissolve with SG-2c proper when -// `parse_parser_body.txt` ports to `.dag` list-body recursion and the -// depth-tracking helpers become structural traversals rather than -// token-index scans. - -// One row per bracketing `TokenKind` variant. Keyed on the textual -// variant name (same convention as `BinaryOpRow` / `TopLevelItemKwRow`) -// and cross-validated against `tokenize.dag::TokenKind` at regen. -// -// **M7 / INVARIANTS (single authority).** `token_variant` is the only -// authored field; `BracketRole` is emitted by regen as a pure projection -// over the `L`/`R` prefix of each row's `token_variant` — not authored -// here as a separate field or as a `.dag` coproduct. Mirrors -// `TopLevelItemKwRow` → `ItemDispatchKind` (dispatch label derived via -// `strip_prefix("Kw")`): one authored fact, role follows structurally. -type BracketRow { - token_variant: String -} - -data bracket_lparen: BracketRow = { - token_variant: "LParen" -} - -data bracket_lbrace: BracketRow = { - token_variant: "LBrace" -} - -data bracket_lbracket: BracketRow = { - token_variant: "LBracket" -} - -data bracket_rparen: BracketRow = { - token_variant: "RParen" -} - -data bracket_rbrace: BracketRow = { - token_variant: "RBrace" -} - -data bracket_rbracket: BracketRow = { - token_variant: "RBracket" -} - -// --- SG-2c-6: `parse_primary` prefix opener dispatch. Before the -// post-bump atomic match (`IntLit`, booleans, `StringLit`, `|`, ident), -// `parse_primary` dispatches on exactly this closed set of peek tokens: -// `if`, `match`, `{`, `[` → dedicated parsers. Authored here once; -// `PrimaryPrefixDispatch` is regen-only (projection over `token_variant` -// rows — same M7 shape as `TopLevelItemKwRow` → `ItemDispatchKind`). -// -// Dissolution classification: **🟡 YELLOW (scaffold)** per -// `docs/modeling-discipline.md` §4. Same structural situation as the -// other SG-2c tables: each emitted `PrimaryPrefixDispatch` variant is a -// parser entry coordinate for a dedicated `parse_*` arm, not a distinct -// payload algebra; full dissolution rides SG-2c proper (blocked on -// recursive list-body emission over `List`). -// -// Dissolution ledger (4-pattern check): -// - **Pattern 1 (fact placement)**: fails. Prefix keys are coordinate keys -// for `parse_if` / `parse_match` / `parse_record_literal` / -// `parse_list_literal` entry points, not relocatable facts. -// - **Pattern 2 (variant-is-data)**: **passes**: substrate rows are -// `token_variant` only; the Rust `PrimaryPrefixDispatch` enum is a pure -// projection at regen time, not a second `.dag` coproduct. -// - **Pattern 3 (algebraic form)**: fails. No shared algebra across these -// four distinct primary forms at this token-dispatch layer. -// - **Pattern 4 (dimensional)**: fails. Not a numeric ordering. -// -// **Named trigger (YELLOW):** dissolve with SG-2c proper when -// `parse_parser_body.txt` ports to `.dag` list-body recursion over -// `List` (substrate capability per `src/v3/std/list.dag:13-15`) and -// `parse_primary` prefix openers become structural dispatch in the ported -// parse module — this `PrimaryPrefixRow` table folds into that parse -// authority instead of a separate regen-only Rust host shim. -// -// **M7 note:** no `type PrimaryPrefixDispatch` in substrate — only -// `PrimaryPrefixRow { token_variant }`; Rust enum labels derive at regen -// (`Kw*` → `strip_prefix("Kw")`; `LBrace` → `Record`; `LBracket` → `List`). - -type PrimaryPrefixRow { - token_variant: String -} - -data primary_prefix_kw_if: PrimaryPrefixRow = { - token_variant: "KwIf" -} - -data primary_prefix_kw_match: PrimaryPrefixRow = { - token_variant: "KwMatch" -} - -data primary_prefix_lbrace: PrimaryPrefixRow = { - token_variant: "LBrace" -} - -data primary_prefix_lbracket: PrimaryPrefixRow = { - token_variant: "LBracket" -} - -data primary_prefix_caret: PrimaryPrefixRow = { - token_variant: "Caret" -} - -// --- SG-2c-7: `parse_primary` atomic tail (after prefix pass). The bump that -// follows a non-prefix `peek` must be one of: integer literal, boolean -// keyword literals, string, `Pipe` (single `|`, not `PipeArrow` / `|>`) for -// lambda syntax, or identifier — the -// closed set that the parser accepts as a primary expression *atom*. Authored -// here once; `PrimaryAtomClass` and `primary_atom_class` are regen-only -// (projection over `token_variant` rows, same M7 shape as -// `PrimaryPrefixRow` → `PrimaryPrefixDispatch`). -// -// **Cluster boundary (SG-2c wave).** This table pairs with SG-2c-6: both are -// `parse_primary`-local dispatch; together they form one “parser dispatch -// family” extraction (prefix openers + atomic forms) under a single -// `parse_tables` authority surface. -// -// Dissolution classification: **🟡 YELLOW (scaffold)**. Same as other -// `parse_tables` row families. Full dissolution rides SG-2c proper (blocked -// on recursive `List` list-body emission). -type PrimaryAtomRow { - token_variant: String -} - -// Dispatch labels (Rust `PrimaryAtomClass` variants) derive at regen: see -// `primary_atom_class_label_from_token_variant` in `regen_parse_tables_emit.rs` -// (closed allowlist: `IntLit` → `IntLiteral`, `Kw{True,False}` → `{True,False}`, -// `StringLit` → `String`, `Pipe` → `Pipe`, `Ident` → `Ident`). - -data primary_atom_int_lit: PrimaryAtomRow = { - token_variant: "IntLit" -} - -data primary_atom_kw_true: PrimaryAtomRow = { - token_variant: "KwTrue" -} - -data primary_atom_kw_false: PrimaryAtomRow = { - token_variant: "KwFalse" -} - -data primary_atom_string_lit: PrimaryAtomRow = { - token_variant: "StringLit" -} - -data primary_atom_pipe: PrimaryAtomRow = { - token_variant: "Pipe" -} - -data primary_atom_ident: PrimaryAtomRow = { - token_variant: "Ident" -} diff --git a/src/v3/compiler/pipeline.dag b/src/v3/compiler/pipeline.dag deleted file mode 100644 index 7eb6bd69215..00000000000 --- a/src/v3/compiler/pipeline.dag +++ /dev/null @@ -1,121 +0,0 @@ -module v3.compiler.pipeline - -import v3.std.substrate { Dag } -import v3.spec.v3_l1 { DeclarationRef } -import v3.spec.rust { LanguageSpec } - -// L1.5 pipeline authority. The staged bootstrap upgrades the five -// stage declarations below to `ArrowBody::ExternalRealization` -// bodies so the declaration table carries the intended host-backed -// execution shape. The source bodies stay trivially type-correct so -// the file parses and lowers cleanly today. - -type CompilerHostRealization { - symbol: String -} - -type PipelineSnapshotKind = SnapshotSurface | SnapshotDag | SnapshotText - -type PipelineStageBinding { - stage: DeclarationRef - realization: DeclarationRef - snapshot: PipelineSnapshotKind -} - -data parse_realization: CompilerHostRealization = { - symbol: "v3_compiler::parse" -} - -data lower_realization: CompilerHostRealization = { - symbol: "v3_compiler::lower" -} - -data infer_realization: CompilerHostRealization = { - symbol: "v3_compiler::infer" -} - -data compute_ownership_realization: CompilerHostRealization = { - symbol: "v3_compiler::compute_ownership" -} - -data emit_realization: CompilerHostRealization = { - symbol: "v3_compiler::emit" -} - -data lens_complexity_realization: CompilerHostRealization = { - symbol: "v3_compiler::lens_complexity" -} - -data parse_stage_binding: PipelineStageBinding = { - stage: parse - realization: parse_realization - snapshot: SnapshotSurface -} - -data lower_stage_binding: PipelineStageBinding = { - stage: lower - realization: lower_realization - snapshot: SnapshotDag -} - -data infer_stage_binding: PipelineStageBinding = { - stage: infer - realization: infer_realization - snapshot: SnapshotDag -} - -data compute_ownership_stage_binding: PipelineStageBinding = { - stage: compute_ownership - realization: compute_ownership_realization - snapshot: SnapshotDag -} - -data lens_complexity_stage_binding: PipelineStageBinding = { - stage: lens_complexity - realization: lens_complexity_realization - snapshot: SnapshotDag -} - -data emit_stage_binding: PipelineStageBinding = { - stage: emit - realization: emit_realization - snapshot: SnapshotText -} - -fn parse(source: String, file: String) -> Dag { - host parse -} - -fn lower(dag: Dag) -> Dag { - host lower -} - -fn infer(dag: Dag) -> Dag { - host infer -} - -fn compute_ownership(dag: Dag) -> Dag { - host ownership -} - -fn lens_complexity(dag: Dag) -> Dag { - host complexity -} - -fn emit( - inferred: Dag, - ownership: Dag, - complexity: Dag, - spec: LanguageSpec -) -> String { - host emit -} - -fn compile(source: String, file: String, spec: LanguageSpec) -> String { - parse - lower - infer - compute_ownership - lens_complexity - emit -} diff --git a/src/v3/compiler/regen.dag b/src/v3/compiler/regen.dag deleted file mode 100644 index d488f279db9..00000000000 --- a/src/v3/compiler/regen.dag +++ /dev/null @@ -1,129 +0,0 @@ -module v3.compiler.regen - -import std.types { FilePath, NonEmptyStr } - -// Lens regen registry. Each `data _entry: LensRegistryEntry` -// record below is picked up structurally by the `regen_lens` binary -// (`dag.declarations().filter(meta_tag == LensRegistryEntry)`), which -// then reads `lens_file`, emits the Rust projection via -// `emit_rust_module`, and writes to `generated_file`. Mirrors the -// `PipelineStageBinding` pattern in `src/v3/compiler/pipeline.dag`. -// -// Adding a new generated lens is a pure `.dag` edit: drop the lens -// source in `src/v3/lenses/`, add a `data ..._entry: LensRegistryEntry` -// record here with the three paths filled in, and -// `cargo run -p v3-compiler --bin regen_lens` picks it up. No -// per-lens Rust driver is added or edited. -// -// `name` composes from `std.types::NonEmptyStr` (= `String where -// non_empty`) so the `--lens ` selector key cannot encode an -// empty string. `lens_file` and `generated_file` compose from -// `std.types::FilePath` (also `String where non_empty`) per -// MODELING M9 — every field attaches to the existing path/identifier -// vocabulary rather than reintroduce a raw `String`. Refinement -// means empty-string entries cannot be lowered into the registry, -// closing the "illegal states representable" hole that a raw -// `String` would leave open across all three fields. -// -// **Band-C cementing dispatch.** Each new `LensRegistryEntry` must -// update `docs/v3-lens-capability-register.md` (see its Discipline -// section). If the register row is `BEHAVIORALLY COMPLETE` and names -// a concrete v2 counterpart, add a matching behavioral cementing -// module under `src/v3/compiler/tests/integration/cementing/`, wire it -// in `tests/integration.rs` via `#[path = "integration/cementing/.rs"]`, -// extend `src/v3/std/verification.dag` (`data lens_capability_register_rows`) and -// `src/v3/compiler/tests/dag/cementing_dispatch.dag` (receipt list) in the same PR -// (runner receipt: `t_pb_b_1_dag_runner_test::cementing_dispatch_suite_passes_through_runner`). -// See `TESTING.md` ("Cementing tests (Band C — lens subsumption)"). - -type LensRegistryEntry { - name: NonEmptyStr - lens_file: FilePath - generated_file: FilePath -} - -data lens_cost_entry: LensRegistryEntry = { - name: "cost" - lens_file: "src/v3/lenses/complexity.dag" - generated_file: "src/v3/compiler/src/complexity_lens_generated.rs" -} - -data lens_cost_symbolic_entry: LensRegistryEntry = { - name: "cost_symbolic" - lens_file: "src/v3/lenses/cost.dag" - generated_file: "src/v3/compiler/src/cost_symbolic_lens_generated.rs" -} - -data lens_cost_target_realization_entry: LensRegistryEntry = { - name: "cost_target_realization" - lens_file: "src/v3/lenses/cost_target_realization.dag" - generated_file: "src/v3/compiler/src/lens_cost_target_realization_generated.rs" -} - -data lens_effect_enumeration_entry: LensRegistryEntry = { - name: "effect_enumeration" - lens_file: "src/v3/lenses/effect_enumeration.dag" - generated_file: "src/v3/compiler/src/lens_effect_enumeration_generated.rs" -} - -data lens_parallelism_entry: LensRegistryEntry = { - name: "parallelism" - lens_file: "src/v3/lenses/parallelism.dag" - generated_file: "src/v3/compiler/src/lens_parallelism_generated.rs" -} - -data lens_idempotency_entry: LensRegistryEntry = { - name: "idempotency" - lens_file: "src/v3/lenses/idempotency.dag" - generated_file: "src/v3/compiler/src/lens_idempotency_generated.rs" -} - -data lens_provenance_entry: LensRegistryEntry = { - name: "provenance" - lens_file: "src/v3/lenses/provenance.dag" - generated_file: "src/v3/compiler/src/lens_provenance_generated.rs" -} - -data lens_structural_resolution_entry: LensRegistryEntry = { - name: "structural_resolution" - lens_file: "src/v3/lenses/structural_resolution.dag" - generated_file: "src/v3/compiler/src/lens_structural_resolution_generated.rs" -} - -data lens_unused_parameters_entry: LensRegistryEntry = { - name: "unused_parameters" - lens_file: "src/v3/lenses/unused_parameters.dag" - generated_file: "src/v3/compiler/src/lens_unused_parameters_generated.rs" -} - -// Absorbed from SG-4 prep (PR #562): `regen_infer_helpers.rs` was -// landed as a per-file regen driver mirroring the deleted -// `regen_lens_*` bins, explicitly flagged in its own header as -// "SG-6 owns folding all of these into a single generic regen -// target". This is that absorption. `infer_helpers.dag` is a lens -// in the broad sense the registry uses (reads substrate Dag, emits -// a Rust module via `emit_rust_module`), so it fits the existing -// `LensRegistryEntry` shape without a rename. A future `.dag` -// artifact that is genuinely non-lens would trigger the widening -// to a `GeneratedArtifactEntry` carrier. -data lens_infer_helpers_entry: LensRegistryEntry = { - name: "infer_helpers" - lens_file: "src/v3/lenses/infer_helpers.dag" - generated_file: "src/v3/compiler/src/infer_helpers_generated.rs" -} - -data lens_variant_payload_entry: LensRegistryEntry = { - name: "variant_payload" - lens_file: "src/v3/lenses/variant_payload.dag" - generated_file: "src/v3/compiler/src/variant_payload_generated.rs" -} - -// SG-3g prototype — first `.dag`-authority lowering helper. Slice -// rationale and emitter gaps that blocked wider extraction are in -// `lenses/lower_helpers.dag`. `lower.rs` consumes `expr_span` via -// `crate::lower_helpers` (SG-3g-b wire-in). -data lens_lower_helpers_entry: LensRegistryEntry = { - name: "lower_helpers" - lens_file: "src/v3/lenses/lower_helpers.dag" - generated_file: "src/v3/compiler/src/lower_helpers_generated.rs" -} diff --git a/src/v3/compiler/src/bin/boundary_emit_gates.rs b/src/v3/compiler/src/bin/boundary_emit_gates.rs deleted file mode 100644 index 56e11a663c9..00000000000 --- a/src/v3/compiler/src/bin/boundary_emit_gates.rs +++ /dev/null @@ -1,55 +0,0 @@ -// `eprintln!` is on the project's disallowed-macros list (library code must -// use structured error returns). Binary entrypoints may opt in per the lint -// note; this bin is a host-shim whose only behavior is exit-code + stderr -// for human debugging when a gate fails. -#![allow(clippy::disallowed_macros)] - -//! Boundary emit — `ExecuteCommand` logical child for `.dag` `TestClaim` -//! wrappers (`tests/dag/boundary_emit_gates.template.dag`). Subcommands wrap -//! `v3_compiler::boundary_emit_gates::check_*` so hand-Rust `#[test]` harnesses -//! and `.dag`-driven gates share one implementation. - -use std::process::ExitCode; - -use v3_compiler::boundary_emit_gates; - -fn usage() -> ! { - eprintln!( - "usage: boundary_emit_gates \n\ - subcommands: m2-destructure-alias | m2-arm-aliased-ref | m2-rustfmt-valid | \ - python-checked-division-roundtrip" - ); - std::process::exit(2); -} - -fn main() -> ExitCode { - let mut args = std::env::args().skip(1); - let sub = args.next().unwrap_or_else(|| usage()); - if args.next().is_some() { - usage(); - } - - let result = match sub.as_str() { - "m2-destructure-alias" => { - boundary_emit_gates::check_m2_multi_field_struct_variant_destructure_alias() - } - "m2-arm-aliased-ref" => { - boundary_emit_gates::check_m2_multi_field_struct_variant_arm_aliased_ref() - } - "m2-rustfmt-valid" => { - boundary_emit_gates::check_m2_multi_field_struct_variant_rustfmt_valid() - } - "python-checked-division-roundtrip" => { - boundary_emit_gates::check_python_checked_division_roundtrips() - } - _ => usage(), - }; - - match result { - Ok(()) => ExitCode::SUCCESS, - Err(detail) => { - eprintln!("boundary_emit_gates {sub}: {detail}"); - ExitCode::FAILURE - } - } -} diff --git a/src/v3/compiler/src/bin/r1c_e_emit_gates.rs b/src/v3/compiler/src/bin/r1c_e_emit_gates.rs deleted file mode 100644 index 73c11a9d0c1..00000000000 --- a/src/v3/compiler/src/bin/r1c_e_emit_gates.rs +++ /dev/null @@ -1,64 +0,0 @@ -// `eprintln!` is on the project's disallowed-macros list (library code must -// use structured error returns). Binary entrypoints may opt in per the lint -// note; this bin is a host-shim whose only behavior is exit-code + stderr -// for human debugging when a gate fails. -#![allow(clippy::disallowed_macros)] - -//! R1C-E — `ExecuteCommand` logical child for the T-Emit `.dag` `TestClaim` -//! wrappers. The on-disk `.dag` template (path resolved by the matching -//! integration-test driver) substitutes `env!("CARGO_BIN_EXE_r1c_e_emit_gates")` -//! at test-crate compile time so no checked-in absolute path goes stale. -//! -//! Each subcommand calls into `v3_compiler::r1c_e_gates::check_*`. The function -//! returns `Ok(())` (exit 0) or `Err(detail)` (write detail to stderr, exit 1). -//! `ExecuteCommand` reads only the exit code — stderr is for human debugging -//! when a gate flips red. -//! -//! Subcommands (one per `.dag` `TestClaim` in the R1C-E template set): -//! - `generic-bounds` → `check_generic_bounds_survive` -//! - `rust-fixtures` → `check_emit_rust_fixtures_rustc_green` -//! - `omni-demo` → `check_omni_demo_fixtures_green` (requires `go` + `python3`) -//! - `program-fixtures-post-emit` → `check_program_fixtures_post_emit_clean_all_targets` -//! (requires `rustc`, `gofmt`, and `python3` on PATH) -//! -//! Adding a subcommand: extend the `match` below and the `.dag` template in -//! lockstep. **Do not** add stdin/stdout capture or recursive `cargo` here — -//! see PR #792 for the bounded `ExecuteCommand` discipline. - -use std::process::ExitCode; - -use v3_compiler::r1c_e_gates; - -fn usage() -> ! { - eprintln!( - "usage: r1c_e_emit_gates \n\ - subcommands: generic-bounds | rust-fixtures | omni-demo | program-fixtures-post-emit" - ); - std::process::exit(2); -} - -fn main() -> ExitCode { - let mut args = std::env::args().skip(1); - let sub = args.next().unwrap_or_else(|| usage()); - if args.next().is_some() { - usage(); - } - - let result = match sub.as_str() { - "generic-bounds" => r1c_e_gates::check_generic_bounds_survive(), - "rust-fixtures" => r1c_e_gates::check_emit_rust_fixtures_rustc_green(), - "omni-demo" => r1c_e_gates::check_omni_demo_fixtures_green(), - "program-fixtures-post-emit" => { - r1c_e_gates::check_program_fixtures_post_emit_clean_all_targets() - } - _ => usage(), - }; - - match result { - Ok(()) => ExitCode::SUCCESS, - Err(detail) => { - eprintln!("r1c_e_emit_gates {sub}: {detail}"); - ExitCode::FAILURE - } - } -} diff --git a/src/v3/compiler/src/bin/regen_bootstrap.rs b/src/v3/compiler/src/bin/regen_bootstrap.rs deleted file mode 100644 index 618842a54c3..00000000000 --- a/src/v3/compiler/src/bin/regen_bootstrap.rs +++ /dev/null @@ -1,162 +0,0 @@ -//! Regenerate `bootstrap_*_generated.rs` snapshots from on-disk `.dag` sources. -//! -//! This binary is the sole `v3-compiler` target with `required-features = -//! ["bootstrap-regen-fresh"]`, so the fresh-parse bootstrap subgraph is not part -//! of the default library build graph. -//! -//! PB-1-e mechanism (ii): the **fresh-compile vs committed snapshot** gate lives -//! here, not in `cargo test`. Use `--verify` in CI (or before push) to assert the -//! checked-in `bootstrap_*.rs` files match a from-scratch compile; omit `--verify` -//! to write updated snapshots after intentional `.dag` changes. -//! -//! Local invocation (feature is required): -//! `cargo run -p v3-compiler --features bootstrap-regen-fresh --bin regen_bootstrap` -//! (append `-- --verify` to check without writing). - -use std::env; -use std::fs; -use std::io::{self, Write}; -use std::path::{Path, PathBuf}; - -use v3_compiler::{ - compile_full_bootstrap_dag_from_std_seed, - compile_full_bootstrap_without_parse_surface_dag_from_std_seed, compile_std_bootstrap_dag, - generated_files::GENERATED_FILES, render_bootstrap_generated_rs, - render_bootstrap_std_generated_rs, -}; - -const GENERATED_STD_FILE: &str = "src/v3/compiler/src/bootstrap_std_generated.rs"; -const GENERATED_FULL_FILE: &str = "src/v3/compiler/src/bootstrap_generated.rs"; -const GENERATED_NO_PARSE_SURFACE_FILE: &str = - "src/v3/compiler/src/bootstrap_generated_without_parse_surface.rs"; - -fn main() { - let args: Vec = env::args().skip(1).collect(); - let verify_only = match args.as_slice() { - [] => false, - [flag] if flag == "--verify" => true, - unexpected => { - let _ = writeln!( - io::stderr(), - "regen_bootstrap: unexpected arguments: {unexpected:?}\n\ - Usage: regen_bootstrap [--verify]\n\ - Omit flags to write snapshots; pass exactly `--verify` to check without writing." - ); - std::process::exit(2); - } - }; - - for generated_file in [ - GENERATED_STD_FILE, - GENERATED_FULL_FILE, - GENERATED_NO_PARSE_SURFACE_FILE, - ] { - assert!( - GENERATED_FILES.contains(&generated_file), - "`regen_bootstrap` writes `{generated_file}` but that path is not \ - registered in `REGEN_OUTPUTS` in `src/v3/compiler/build.rs`." - ); - } - - let manifest_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - - let std_dag = compile_std_bootstrap_dag(); - let std_formatted = render_bootstrap_std_generated_rs(&std_dag) - .unwrap_or_else(|e| panic!("regen_bootstrap std: {e}")); - - let full_dag = compile_full_bootstrap_dag_from_std_seed(std_dag.clone()); - let full_formatted = render_bootstrap_generated_rs( - &full_dag, - "dsl/std/*.dag + src/v3/std/*.dag + src/v3/spec/*.dag + src/v3/compiler/*.dag minus tokenize.dag + dsl/extdeps/languages/rust/primitives.dag", - "bootstrapped_fixture_dag", - ) - .unwrap_or_else(|e| panic!("regen_bootstrap full: {e}")); - - let full_no_parse_surface_dag = - compile_full_bootstrap_without_parse_surface_dag_from_std_seed(std_dag); - let full_no_parse_surface_formatted = render_bootstrap_generated_rs( - &full_no_parse_surface_dag, - "dsl/std/*.dag + src/v3/std/*.dag + src/v3/spec/*.dag + src/v3/compiler/*.dag minus tokenize.dag, src/v3/std/parse_surface.dag, src/v3/spec/{rust,go,python}.dag + dsl/extdeps/languages/rust/primitives.dag", - "bootstrapped_fixture_without_parse_surface_dag", - ) - .unwrap_or_else(|e| panic!("regen_bootstrap no-parse-surface: {e}")); - - if verify_only { - assert_disk_matches(&manifest_dir, "bootstrap_std_generated.rs", &std_formatted); - assert_disk_matches(&manifest_dir, "bootstrap_generated.rs", &full_formatted); - assert_disk_matches( - &manifest_dir, - "bootstrap_generated_without_parse_surface.rs", - &full_no_parse_surface_formatted, - ); - println!("regen_bootstrap --verify: committed snapshots match fresh compile."); - return; - } - - write_generated(&manifest_dir, "bootstrap_std_generated.rs", &std_formatted); - write_generated(&manifest_dir, "bootstrap_generated.rs", &full_formatted); - write_generated( - &manifest_dir, - "bootstrap_generated_without_parse_surface.rs", - &full_no_parse_surface_formatted, - ); -} - -fn assert_disk_matches(manifest_dir: &Path, file_name: &str, expected: &str) { - let path = manifest_dir.join("src").join(file_name); - let on_disk = - fs::read_to_string(&path).unwrap_or_else(|e| panic!("read {}: {e}", path.display())); - if on_disk != expected { - let hint = first_text_mismatch_hint(&on_disk, expected); - panic!( - "{file_name}: committed snapshot does not match fresh compile from .dag sources. \ - Run `cargo run -p v3-compiler --features bootstrap-regen-fresh --bin regen_bootstrap` \ - (without `--verify`) to \ - regenerate after intentional authority edits, or fix unintended drift. \ - {hint}", - ); - } -} - -/// Byte offset of first differing UTF-8 byte, lengths, and a small lossy window -/// around the mismatch (UTF-8 boundaries not guaranteed inside the window). -fn first_text_mismatch_hint(on_disk: &str, expected: &str) -> String { - const RADIUS: usize = 40; - let a = on_disk.as_bytes(); - let b = expected.as_bytes(); - let prefix_len = a.len().min(b.len()); - let mut first_diff = None; - for i in 0..prefix_len { - if a[i] != b[i] { - first_diff = Some(i); - break; - } - } - // If one string is a strict prefix of the other, all shared bytes match. - let offset = first_diff.unwrap_or(prefix_len); - let window_disk = lossy_byte_window(a, offset, RADIUS); - let window_exp = lossy_byte_window(b, offset, RADIUS); - format!( - "(first differing byte index: {offset}, on_disk_len={}, expected_len={}, \ - on_disk[…]≈{:?}, expected[…]≈{:?})", - on_disk.len(), - expected.len(), - window_disk, - window_exp, - ) -} - -fn lossy_byte_window(bytes: &[u8], center: usize, radius: usize) -> String { - if bytes.is_empty() { - return String::new(); - } - let start = center.saturating_sub(radius).min(bytes.len()); - let end = (center + radius).min(bytes.len()); - String::from_utf8_lossy(&bytes[start..end]).into_owned() -} - -fn write_generated(manifest_dir: &Path, file_name: &str, contents: &str) { - let out_path = manifest_dir.join("src").join(file_name); - std::fs::write(&out_path, contents).unwrap_or_else(|e| panic!("write {file_name}: {e}")); - println!("wrote {}", out_path.display()); -} diff --git a/src/v3/compiler/src/bin/regen_parse.rs b/src/v3/compiler/src/bin/regen_parse.rs deleted file mode 100644 index ca00ad5b5b2..00000000000 --- a/src/v3/compiler/src/bin/regen_parse.rs +++ /dev/null @@ -1,42 +0,0 @@ -//! Regenerate `parse_generated.rs` from `src/v3/std/parse_surface.dag` (Surface carriers) -//! plus `parse_parser_body.txt` (sibling file under `src/v3/compiler/`). -//! -//! **Parser staging (PR posture — option 1), not SG-2b closure:** `parse_surface.dag` is -//! the Surface **carrier** authority (shared with `parse_surface_generated.rs`); `parse_parser_body.txt` -//! remains temporary **semantic** algorithm authority until a follow-on lane lands true `.dag` parse -//! rules. **Dissolution:** same trigger as the header on `parse_parser_body.txt` (delete the fragment -//! once `regen_parse` emits the algorithm from `.dag` alone). - -use std::path::PathBuf; - -use v3_compiler::generated_files::GENERATED_FILES; -use v3_compiler::render_parse_generated_rs; - -const GENERATED_FILE: &str = "src/v3/compiler/src/parse_generated.rs"; -const SURFACE_TYPES_AUTHORITY_FILE: &str = "src/v3/std/parse_surface.dag"; -const PARSER_BODY_REL: &str = "parse_parser_body.txt"; - -fn main() { - assert!( - GENERATED_FILES.contains(&GENERATED_FILE), - "`regen_parse` writes `{GENERATED_FILE}` but that path is not \ - registered in `REGEN_OUTPUTS` in `src/v3/compiler/build.rs`." - ); - - let manifest_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - let dag_path = manifest_dir - .join("..") - .join("std") - .join("parse_surface.dag"); - let source = std::fs::read_to_string(&dag_path).expect("read parse_surface.dag"); - let body_path = manifest_dir.join(PARSER_BODY_REL); - let parser_body = std::fs::read_to_string(&body_path) - .unwrap_or_else(|e| panic!("read parser body fragment `{}`: {e}", body_path.display())); - - let formatted = render_parse_generated_rs(&source, SURFACE_TYPES_AUTHORITY_FILE, &parser_body) - .unwrap_or_else(|e| panic!("{e}")); - - let out_path = manifest_dir.join("src").join("parse_generated.rs"); - std::fs::write(&out_path, &formatted).expect("write parse_generated.rs"); - println!("wrote {}", out_path.display()); -} diff --git a/src/v3/compiler/src/bin/regen_parse_tables.rs b/src/v3/compiler/src/bin/regen_parse_tables.rs deleted file mode 100644 index 2367b603edf..00000000000 --- a/src/v3/compiler/src/bin/regen_parse_tables.rs +++ /dev/null @@ -1,62 +0,0 @@ -//! SG-2c grammar-tables — Regenerate `parse_tables_generated.rs` from -//! `src/v3/compiler/parse_tables.dag`. Thin host shim: the render logic -//! lives in `v3_compiler::regen_parse_tables_emit::render_parse_tables_generated_rs` -//! so hermetic integration tests can compare in-memory without spawning -//! this binary through `cargo run` (which blows the 2s per-test ratchet -//! on cold CI). -//! -//! Emitted projection includes **SG-2c-1** `binary_op_at_level` / `BinaryOpLevel`, -//! **SG-2c-2** `top_level_item_dispatch` / `ItemDispatchKind`, **SG-2c-3** -//! `is_type_rhs_boundary_keyword`, **SG-2c-4** `bracket_role` / `BracketRole`, -//! **SG-2c-5** `soft_keyword_ident_spelling`, **SG-2c-6** `primary_prefix_dispatch` / -//! `PrimaryPrefixDispatch`, and **SG-2c-7** `primary_atom_class` / `PrimaryAtomClass` -//! (see `regen_parse_tables_emit.rs`; not in this file). -//! -//! Scope (grammar-tables prototype, NOT SG-2c proper) — see -//! `src/v3/compiler/parse_tables.dag` for the full scope note and -//! dissolution trigger (recursive list-body emission over `List`). - -use std::path::PathBuf; - -use v3_compiler::generated_files::GENERATED_FILES; -use v3_compiler::render_parse_tables_generated_rs; - -const GENERATED_FILE: &str = "src/v3/compiler/src/parse_tables_generated.rs"; -const PARSE_TABLES_AUTHORITY_FILE: &str = "src/v3/compiler/parse_tables.dag"; -const TOKENIZE_AUTHORITY_FILE: &str = "src/v3/compiler/tokenize.dag"; -const SHARED_SYNTAX_FILE: &str = "dsl/extdeps/languages/dag/syntax.dag"; - -fn main() { - assert!( - GENERATED_FILES.contains(&GENERATED_FILE), - "`regen_parse_tables` writes `{GENERATED_FILE}` but that path is not \ - registered in `REGEN_OUTPUTS` in `src/v3/compiler/build.rs`." - ); - - let manifest_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - let repo_root = manifest_dir - .parent() - .and_then(|p| p.parent()) - .and_then(|p| p.parent()) - .expect("src/v3/compiler has a repo-root ancestor"); - - let tables_source = std::fs::read_to_string(manifest_dir.join("parse_tables.dag")) - .expect("read parse_tables.dag"); - let tokenize_source = - std::fs::read_to_string(manifest_dir.join("tokenize.dag")).expect("read tokenize.dag"); - let shared_syntax_source = std::fs::read_to_string(repo_root.join(SHARED_SYNTAX_FILE)) - .unwrap_or_else(|e| panic!("read shared syntax authority `{SHARED_SYNTAX_FILE}`: {e}")); - - let formatted = render_parse_tables_generated_rs( - &tables_source, - PARSE_TABLES_AUTHORITY_FILE, - &tokenize_source, - TOKENIZE_AUTHORITY_FILE, - &shared_syntax_source, - ) - .unwrap_or_else(|e| panic!("{e}")); - - let out_path = manifest_dir.join("src").join("parse_tables_generated.rs"); - std::fs::write(&out_path, &formatted).expect("write parse_tables_generated.rs"); - println!("wrote {}", out_path.display()); -} diff --git a/src/v3/compiler/src/bin/regen_tokenize.rs b/src/v3/compiler/src/bin/regen_tokenize.rs deleted file mode 100644 index 5e1c4ac8a44..00000000000 --- a/src/v3/compiler/src/bin/regen_tokenize.rs +++ /dev/null @@ -1,9 +0,0 @@ -//! Regenerate `tokenize_generated.rs` from `src/v3/compiler/tokenize.dag`. -//! -//! Implementation lives in `v3_compiler::regen_tokenize` so integration tests -//! can invoke the same pipeline in-process (no nested `cargo run`). - -fn main() { - let manifest_dir = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")); - v3_compiler::regen_tokenize::write_tokenize_generated_rs(&manifest_dir); -} diff --git a/src/v3/compiler/src/bin/regen_v3.rs b/src/v3/compiler/src/bin/regen_v3.rs deleted file mode 100644 index 3b11dc75bbf..00000000000 --- a/src/v3/compiler/src/bin/regen_v3.rs +++ /dev/null @@ -1,103 +0,0 @@ -use std::env; -use std::fs; -use std::io::{self, Write}; -use std::path::Path; -use std::process::ExitCode; - -use v3_compiler::{ - compare_stage_snapshots, compile_stage_snapshots, default_fixed_point_source, - FixedPointMismatch, StageSnapshotError, -}; - -fn main() -> ExitCode { - match run() { - Ok(()) => ExitCode::SUCCESS, - Err(message) => { - let _ = writeln!(io::stderr(), "{message}"); - ExitCode::FAILURE - } - } -} - -fn run() -> Result<(), String> { - let mut source_path: Option = None; - let mut file_name: Option = None; - let mut inject_stage: Option = env::var("GUNBC_REGEN_INJECT_STAGE").ok(); - - let mut args = env::args().skip(1); - while let Some(arg) = args.next() { - match arg.as_str() { - "--source" => { - source_path = Some( - args.next() - .ok_or_else(|| "--source requires a path".to_string())?, - ); - } - "--file" => { - file_name = Some( - args.next() - .ok_or_else(|| "--file requires a name".to_string())?, - ); - } - "--inject-stage" => { - inject_stage = Some( - args.next() - .ok_or_else(|| "--inject-stage requires a stage name".to_string())?, - ); - } - other => return Err(format!("unknown argument `{other}`")), - } - } - - let (source, file) = match source_path { - Some(path) => { - let source = fs::read_to_string(&path) - .map_err(|err| format!("failed to read {}: {err}", path))?; - let file = file_name.unwrap_or_else(|| { - Path::new(&path) - .file_name() - .and_then(|name| name.to_str()) - .unwrap_or("input.v3") - .to_string() - }); - (source, file) - } - None => ( - default_fixed_point_source().to_string(), - file_name.unwrap_or_else(|| "fixed_point_input.v3".to_string()), - ), - }; - - let pass1 = compile_stage_snapshots(&source, &file).map_err(render_snapshot_error)?; - let mut pass2 = compile_stage_snapshots(&source, &file).map_err(render_snapshot_error)?; - - if let Some(stage_name) = inject_stage { - let snapshot = pass2 - .iter_mut() - .find(|snapshot| snapshot.stage == stage_name) - .ok_or_else(|| format!("unknown stage `{stage_name}`"))?; - snapshot - .bytes - .extend_from_slice(b"\n# synthetic divergence\n"); - snapshot.dag = None; - } - - compare_stage_snapshots(&pass1, &pass2).map_err(render_mismatch)?; - println!("fixed-point verified across {} stages", pass1.len()); - Ok(()) -} - -fn render_snapshot_error(error: StageSnapshotError) -> String { - match error { - StageSnapshotError::Compile(error) => format!("compile failed: {error:?}"), - StageSnapshotError::Emit(error) => format!("emit failed: {error:?}"), - StageSnapshotError::Pipeline(error) => format!("pipeline authority failed: {error}"), - } -} - -fn render_mismatch(mismatch: FixedPointMismatch) -> String { - format!( - "FIXED-POINT FAILURE at stage `{}`: {}", - mismatch.stage, mismatch.detail - ) -} diff --git a/src/v3/compiler/src/bin/self_host_fixed_point.rs b/src/v3/compiler/src/bin/self_host_fixed_point.rs deleted file mode 100644 index 43411710b8e..00000000000 --- a/src/v3/compiler/src/bin/self_host_fixed_point.rs +++ /dev/null @@ -1,267 +0,0 @@ -//! DB-8 — fixed-point ratchet driver (`docs/design-fixed-point-ratchet.md`). -//! -//! **R3 cross-read (P0 pin, no new pass/fail):** R3 program-plan §1.8 gate **#16** -//! (`pb_self_compile_fixed_point`, T-FixedPoint) has a **strong** thesis horizon -//! distinct from the R1 `verification.dag` claim of the same name — see -//! `docs/r3-structure.md` §"T-FixedPoint" (two-horizon framing), -//! `docs/briefs/r3-pb-t-fixedpoint-worker.md` (dispatch preconditions; future -//! `pb_self_compile_fixed_point_strong`), and `docs/briefs/r3-wave1-pb2-fixedpoint-gate16-r3-horizon-worker.md`. -//! 2026-05-13 joint-precondition coordination audit: -//! `docs/audit/r3-gap3-fixed-point-precondition-coordination-2026-05-13.md` — all four -//! joint preconditions read non-green at HEAD; `pb_self_compile_fixed_point_strong` -//! must not be authored in `src/v3/std/verification.dag` until the single dispatch -//! ledger read turns green (per that audit's sequencing rule). -//! History and CI posture for this binary: `docs/db-history/db-8.md`. -//! -//! Full cycle (emit → `rustc` → run → byte-diff) requires a v3-parseable -//! `dsl/gunbc/compiler.dag` **and** an emitted CLI that can re-run emission on -//! that file. Until Lane 3 Stage 3c, `compiler.dag` is a cycle meta-model that -//! does not yet parse under the v3 surface grammar; this binary still: -//! - proves the **pipeline snapshot** fixed point on [`v3_compiler::default_fixed_point_source`] -//! (same contract as `regen_v3`, includes the emit stage); -//! - probes `compiler.dag`, emits `target/self_host/stage1.rs` when parse succeeds; -//! - attempts `rustc` when compilation is meaningful; -//! - writes `target/self_host/receipt.json` for trend monitoring (DB-8 §Open questions, Q3). -//! -//! Single authority for byte-identical emission across processes: [`v3_compiler::emit::emit`] -//! + determinism tests (`tests/determinism_test.rs`) — see `feedback_substrate_principle_audit` Q5. -//! -//! **Exit status (Invariant D-1):** when `compiler.dag` parses and the emit→`rustc`→run→diff slice -//! runs, any failure on that slice returns **`Err`** from [`run`] so the process exits **non-zero** -//! after writing `receipt.json`. Workflow policy (“do not block merges yet”) is enforced by -//! `continue-on-error` on the CI job/step — not by treating a failed slice as `Ok`. -//! -//! **R3 gate #71 (`--r3-gate-71-demonstration`):** after writing `receipt.json`, fail the process -//! unless `compiler.dag` parsed under v3 and the receipt records `fixed_point_diff` → `ok`. DB-8’s -//! default (no flag) stays staged-friendly: parse failure alone still exits 0 once the receipt is -//! written. - -use std::fs; -use std::io::{self, Write}; -use std::path::{Path, PathBuf}; -use std::process::ExitCode; -use std::process::{Command, Stdio}; - -use v3_compiler::compile_to_dag; -use v3_compiler::emit::{emit, EmitTarget}; -use v3_compiler::self_host_receipt_p0 as receipt_p0; -use v3_compiler::{ - compare_stage_snapshots, compile_stage_snapshots, default_fixed_point_source, CompileError, -}; - -fn workspace_root() -> PathBuf { - PathBuf::from(env!("CARGO_MANIFEST_DIR")) - .join("..") - .join("..") - .join("..") -} - -fn write_receipt(path: &Path, json: &str) { - if let Some(parent) = path.parent() { - let _ = fs::create_dir_all(parent); - } - let _ = fs::write(path, json); -} - -const R3_GATE_71_FLAG: &str = "--r3-gate-71-demonstration"; - -fn main() -> ExitCode { - let gate_71 = std::env::args().any(|a| a == R3_GATE_71_FLAG); - match run(gate_71) { - Ok(()) => ExitCode::SUCCESS, - Err(e) => { - let _ = writeln!(io::stderr(), "{e}"); - ExitCode::from(1) - } - } -} - -fn run(gate_71_demonstration: bool) -> Result<(), String> { - let root = workspace_root(); - let out_dir = root.join("target").join("self_host"); - fs::create_dir_all(&out_dir).map_err(|e| format!("create {}: {e}", out_dir.display()))?; - - let receipt_path = out_dir.join("receipt.json"); - - // Staged ratchet (always): pipeline snapshots identical across two compiles of the default source. - let pass1 = compile_stage_snapshots(default_fixed_point_source(), "fixed_point_input.v3") - .map_err(|e| format!("pipeline snapshot pass1: {e:?}"))?; - let pass2 = compile_stage_snapshots(default_fixed_point_source(), "fixed_point_input.v3") - .map_err(|e| format!("pipeline snapshot pass2: {e:?}"))?; - compare_stage_snapshots(&pass1, &pass2).map_err(|m| m.detail.clone())?; - - let compiler_rel = Path::new("dsl/gunbc/compiler.dag"); - let compiler_abs = root.join(compiler_rel); - let compiler_dag_text = fs::read_to_string(&compiler_abs) - .map_err(|e| format!("read {}: {e}", compiler_abs.display()))?; - - let compiler_parse = match compile_to_dag(&compiler_dag_text, "dsl/gunbc/compiler.dag") { - Ok(dag) => Ok(dag), - Err(CompileError::Semantic(d)) => Err(format!( - "compiler.dag semantic errors: {:?}", - d.diagnostics() - )), - Err(e) => Err(format!("compiler.dag: {e:?}")), - }; - let compiler_dag_parsed = compiler_parse.is_ok(); - - // When `compiler.dag` parses and we exercise emit→rustc→run→diff, any failure on that - // slice must exit non-zero (Invariant D-1 / DB-8 fail-closed). Parse failure alone stays - // exit 0 — expected until v3 grammar + Lane 1e land (staged ratchet). - let mut self_host_slice_failed: Option = None; - // Single in-process authority for gate #71 — INVARIANTS.md C-5 (no string-sentinel probing - // of the serialized receipt to decide control flow). - let mut fixed_point_diff_ok = false; - - // P0 / DB-8 `receipt.json` always-emitted keys — checked before write by - // `receipt_p0::validate_receipt_json_always_emitted_keys` / `top_level_property_needle` - // (two spaces + `"key":`). Keep these three emission anchors aligned with that helper: - // (1) pipeline field right after `{`, (2) `K_COMPILER_DAG_V3_PARSE` in `Ok` + `Err` arms, - // (3) `K_STATUS` on the closing field before `}`. - let mut receipt = String::new(); - receipt.push_str("{\n"); - receipt.push_str(&format!( - " \"{}\": \"ok\",\n", - receipt_p0::K_PIPELINE_FIXED_POINT_DEFAULT_SOURCE - )); - - match compiler_parse { - Ok(dag) => { - receipt.push_str(&format!( - " \"{}\": \"ok\",\n", - receipt_p0::K_COMPILER_DAG_V3_PARSE - )); - let stage1 = - emit(&dag, EmitTarget::Rust).map_err(|e| format!("emit compiler.dag: {e:?}"))?; - let stage1_path = out_dir.join("stage1.rs"); - fs::write(&stage1_path, &stage1.text) - .map_err(|e| format!("write {}: {e}", stage1_path.display()))?; - receipt.push_str(&format!(" \"stage1_rs_bytes\": {},\n", stage1.text.len())); - - let bin_path = out_dir.join("stage1_bin"); - let rustc_inv = Command::new("rustc") - .arg("--edition=2021") - .arg(&stage1_path) - .arg("-o") - .arg(&bin_path) - .stderr(Stdio::piped()) - .output() - .map_err(|e| format!("rustc: {e}"))?; - - if rustc_inv.status.success() { - receipt.push_str(" \"stage1_rustc\": \"ok\",\n"); - let run = Command::new(&bin_path) - .arg(&compiler_abs) - .output() - .map_err(|e| format!("run stage1_bin: {e}"))?; - if run.status.success() { - let stage2_path = out_dir.join("stage2.rs"); - receipt.push_str(&format!( - " \"self_host_run_stderr_len\": {},\n", - run.stderr.len() - )); - if fs::read(&stage2_path).is_ok() { - let a = fs::read(&stage1_path).map_err(|e| e.to_string())?; - let b = fs::read(&stage2_path).map_err(|e| e.to_string())?; - if a == b { - fixed_point_diff_ok = true; - receipt.push_str(" \"fixed_point_diff\": \"ok\",\n"); - } else { - receipt.push_str(" \"fixed_point_diff\": \"mismatch\",\n"); - self_host_slice_failed = Some( - "fixed-point: stage1.rs bytes != stage2.rs (Invariant D-1)" - .to_string(), - ); - } - } else { - receipt - .push_str(" \"fixed_point_diff\": \"skipped_stage2_not_written\",\n"); - } - } else { - let stderr = String::from_utf8_lossy(&run.stderr); - receipt.push_str(&format!( - " \"self_host_run\": {},\n", - json_string(&format!("failed: {stderr}")) - )); - self_host_slice_failed = - Some(format!("self_host_run: stage1_bin failed: {stderr}")); - } - } else { - let stderr = String::from_utf8_lossy(&rustc_inv.stderr); - receipt.push_str(&format!( - " \"stage1_rustc\": {},\n", - json_string(&format!("failed: {stderr}")) - )); - self_host_slice_failed = Some(format!("rustc failed on stage1.rs: {stderr}")); - } - } - Err(msg) => { - receipt.push_str(&format!( - " \"{}\": {},\n", - receipt_p0::K_COMPILER_DAG_V3_PARSE, - json_string(&msg) - )); - } - } - - let exit_status = if self_host_slice_failed.is_some() { - "failed_self_host_slice" - } else { - "completed" - }; - receipt.push_str(&format!( - " \"{}\": {}\n}}\n", - receipt_p0::K_STATUS, - json_string(exit_status) - )); - - // Must match the three anchors documented on `self_host_receipt_p0::top_level_property_needle`. - receipt_p0::validate_receipt_json_always_emitted_keys(&receipt).map_err(|e| { - format!("self_host_fixed_point: receipt contract (P0 always-emitted keys): {e}") - })?; - - write_receipt(&receipt_path, &receipt); - writeln!( - io::stdout(), - "self_host_fixed_point: receipt -> {}", - receipt_path.display() - ) - .map_err(|e| e.to_string())?; - - if let Some(detail) = self_host_slice_failed { - let _ = writeln!(io::stderr(), "{detail}"); - return Err(detail); - } - - if gate_71_demonstration { - if !compiler_dag_parsed { - return Err(format!( - "{R3_GATE_71_FLAG}: require v3 parse of dsl/gunbc/compiler.dag (see receipt {:?})", - receipt_path.display() - )); - } - if !fixed_point_diff_ok { - return Err(format!( - "{R3_GATE_71_FLAG}: require emit→rustc→run byte-identical slice (fixed_point_diff did not reach ok; receipt {:?})", - receipt_path.display() - )); - } - } - - Ok(()) -} - -fn json_string(s: &str) -> String { - let mut out = String::new(); - out.push('"'); - for ch in s.chars() { - match ch { - '\\' => out.push_str("\\\\"), - '"' => out.push_str("\\\""), - c if c.is_control() => out.push_str(&format!("\\u{:04x}", c as u32)), - c => out.push(c), - } - } - out.push('"'); - out -} diff --git a/src/v3/compiler/src/bootstrap.rs b/src/v3/compiler/src/bootstrap.rs deleted file mode 100644 index b4ecf821801..00000000000 --- a/src/v3/compiler/src/bootstrap.rs +++ /dev/null @@ -1,594 +0,0 @@ -// Dag::new() bootstrap. -// -// PB-1 closure: `Dag::new()` no longer tokenizes/parses/lowers any -// bootstrap authority at runtime. Five bootstrap authority sets -// are loaded from committed generated snapshots: -// -// - `std_fixtures` (`dsl/std/*.dag`, including `std.unicode`) -// - `STAGED_FILES` / `V3_SPECS` / `COMPILER_FILES` / extdeps primitives — fresh -// tokenize/parse/lower lives in `bootstrap_regen_fresh.rs` behind feature -// `bootstrap-regen-fresh` (`regen_bootstrap` only). `Dag::new()` does not load -// them from disk at runtime. -// -// **Single authority at runtime:** `Dag::new()` (and `std_fixture_bootstrap_snapshot`) -// materialize **only** from the committed `bootstrap_*_generated.rs` snapshots -// (`include!` / generated Rust). They never re-tokenize or re-parse the `OUT_DIR` -// fixture string tables — those arrays exist solely for the feature-gated regen host. -// -// `compile_parse_surface_std_authority_dag` uses the companion snapshot -// that omits `src/v3/std/parse_surface.dag`, so a fresh parse+lower of -// that authority still stays first-of-name. -// -// **Target-language realization facts stay out of bootstrap.** Realization -// facts for emitted languages live in `dsl/extdeps/languages/*` per the -// thesis and are consumed by the per-target emitters at emission time via -// `SubstrateAccessorBinding` records — compiler code does not manufacture -// those. The L1.5 exception remains: `src/v3/compiler/pipeline.dag` stage -// declarations are upgraded in-place to `ArrowBody::ExternalRealization` -// so the compiler's own pipeline authority lives in the bootstrap Dag with -// the intended stage-body shape. -// -// **B4.4 bootstrap fixture set.** The structural carrier -// `bootstrap_fixture_authority` in -// `src/v3/std/extdeps_bootstrap_fixtures.dag` is the substrate authority for -// *which* `.dag` files participate. The PB-1-e regen host filters -// `build.rs`-emitted `STAGED_FILES` (covering `src/v3/std/*.dag`) and -// `EXTDEPS_FILES` (covering `dsl/extdeps/**/*.dag`) through -// [`BOOTSTRAP_FIXTURE_PATH_KEYS`] (must stay in lockstep with that -// declaration's `virtual_path` fields). The fixture set is mixed-tree as of -// T-Ground-LanguageSpec scope E.1: per-target method-template-contract -// lists live under `src/v3/std/` (avoiding the v2 walker's `dsl/` traversal -// per the post-#1187 regression analysis), while target-primitive -// declarations remain under `dsl/extdeps/languages/`. Only authorities -// whose content is pure structural **data** are loaded. Arrow/realization -// files (`rust/emit.dag`, `rust/types.dag`, etc.) are deliberately excluded -// — their bodies stay per-target emitter-side, not in the bootstrap Dag. -// Expansion adds a field to the carrier + a key in `BOOTSTRAP_FIXTURE_PATH_KEYS` -// once new fixture authorities reach the same pilot stage. -// -// **Structural list load (Path 2 scoping).** The top-level -// `rust_grounding_primitives: List = [...]` data declaration now -// lowers with `value_body = ValueBody::List(_)`: both the type structure and -// the 10-element pilot enumeration are walkable by downstream grounding -// consumers. Map-shaped bootstrap data such as `kernel_algebra_profile` -// now lowers through the sibling `ValueBody::Map` carrier. -// -// Transitional shape: PB-Bootstrap-Process lane (Zero-Floor program; -// tracked in `docs/design-pure-bootstrap-zero.md` §"New lanes") absorbs -// `bootstrap.rs` entirely when it lands `bootstrap.dag` declaring the -// workflow as data — at that point this loader logic becomes part of the -// to-be-generated content with no hand-Rust edit. -// -// Bootstrap failures (tokenize/parse/lower errors on std/ files, -// unresolved cross-file references) attach to the Dag's diagnostic -// table via `Dag::attach_diagnostic` rather than panicking, so -// `compile_to_dag` surfaces them through `Err(CompileError::Semantic(dag))` -// on every subsequent call — the same structural channel user errors -// go through. A failed bootstrap is visible to callers without a -// side channel. -// -// **PB-1-e split — what stays here:** `materialize_pipeline_realizations`, and -// `report_pipeline_authority_error` remain -// in this file because the `#[cfg(test)]` module below exercises them on -// `Dag::new()` snapshots. The regen-only fresh tokenize/parse/lower loop lives in -// `bootstrap_regen_fresh.rs` (feature `bootstrap-regen-fresh`); do not duplicate -// pipeline materialization there without relocating or rewriting these unit tests. - -use crate::dag::{ArrowBody, Dag, TemplateArgument, TypeConnective}; -use crate::diagnostics::{BootstrapAuthorityKey, Correction, Diagnostic, SourceSpan}; -use crate::pipeline_authority::ordered_pipeline_stages; - -// Used by `materialize_pipeline_realizations` (regen + unit tests below). When -// `bootstrap-regen-fresh` is off, that path is cfg-dead in non-test lib builds. -#[cfg_attr(not(feature = "bootstrap-regen-fresh"), allow(dead_code))] -const PIPELINE_REALIZATION_META: &str = "CompilerHostRealization"; - -/// Virtual paths selecting `.dag` sources for PB-1-e bootstrap regen. -/// -/// Mixed-tree fixture set (per T-Ground-LanguageSpec scope E.1): paths -/// resolve against `STAGED_FILES` (covering `src/v3/std/*.dag`) and -/// `EXTDEPS_FILES` (covering `dsl/extdeps/**/*.dag`). The regen host -/// (`bootstrap_regen_fresh`) walks both sets to locate each path. -/// -/// **Lockstep:** each entry must match a `virtual_path` on -/// `bootstrap_fixture_authority` in `src/v3/std/extdeps_bootstrap_fixtures.dag`. -/// `Dag::bootstrap_fixture_virtual_paths` is compared to this slice when the -/// committed bootstrap snapshots initialize (`dag.rs` LazyLock). -pub const BOOTSTRAP_FIXTURE_PATH_KEYS: &[&str] = &[ - "dsl/extdeps/languages/rust/primitives.dag", - "src/v3/std/rust_method_template_contracts.dag", - "src/v3/std/python_method_template_contracts.dag", - "src/v3/std/go_method_template_contracts.dag", - "src/v3/std/anthropic_operations.dag", - "src/v3/std/cross_target_coverage.dag", - "dsl/extdeps/cron/schedule_model.dag", - "dsl/extdeps/github/github.dag", - "dsl/extdeps/github/actions.dag", - "dsl/extdeps/github/ci.dag", -]; - -// DB-14 substrate accessors (`port` / `node` / `resolve_producer`) are -// deliberately NOT materialized at bootstrap. Their Arrow bodies stay -// `Unparsed` (the `{ host }` stub) because the accessor → realization -// mapping is TARGET-specific — upgrading the Arrow body once at bootstrap -// to a single realization would silently overwrite when a second emitter -// registers its own binding. Each emitter reads `SubstrateAccessorBinding` -// records at emission time, filters by its own `language: LanguageSpec` -// id, and dispatches to the target-matching realization's carrier -// template. See `emit_rust::RealizationIndexes::substrate_accessors`. -// -// This diverges from `materialize_pipeline_realizations` (above), which -// DOES upgrade Arrow bodies — pipeline stages are target-invariant -// (same runtime for every target), so "one realization per stage" is -// the correct authority there. - -#[cfg_attr(not(feature = "bootstrap-regen-fresh"), allow(dead_code))] -pub(crate) fn materialize_pipeline_realizations(dag: &mut Dag) { - let stages = match ordered_pipeline_stages(dag) { - Ok(stages) => stages, - Err(error) => { - report_pipeline_authority_error(dag, error, pipeline_authority_span()); - return; - } - }; - let Some(meta_decl_id) = dag - .declaration_by_name(PIPELINE_REALIZATION_META) - .map(|decl| decl.id) - else { - report_pipeline_authority_error( - dag, - format!("missing pipeline realization meta `{PIPELINE_REALIZATION_META}`"), - pipeline_authority_span(), - ); - return; - }; - let meta_connective = match dag.declaration(meta_decl_id).connective.clone() { - connective @ TypeConnective::Conj { .. } => connective, - _ => { - report_pipeline_authority_error( - dag, - format!( - "pipeline realization meta `{PIPELINE_REALIZATION_META}` must lower to a record" - ), - dag.declaration(meta_decl_id).span.clone(), - ); - return; - } - }; - - for stage in &stages { - let realization_span = dag.declaration(stage.realization).span.clone(); - let realization = dag.declaration_mut(stage.realization); - if realization.meta_tag != Some(meta_decl_id) { - report_pipeline_authority_error( - dag, - format!( - "pipeline realization `{}` is not tagged with `{PIPELINE_REALIZATION_META}`", - stage.realization_name - ), - realization_span, - ); - continue; - } - realization.connective = meta_connective.clone(); - } - - for stage in stages { - let stage_span = dag.declaration(stage.stage).span.clone(); - let stage_decl = dag.declaration_mut(stage.stage); - match &mut stage_decl.connective { - TypeConnective::Arrow { body, .. } => { - *body = ArrowBody::ExternalRealization(stage.realization); - } - _ => report_pipeline_authority_error( - dag, - format!( - "pipeline stage `{}` must lower to an arrow", - stage.stage_name - ), - stage_span, - ), - } - } -} - -/// Synthesize a span for pipeline-authority errors that occur before any -/// stage binding is in hand (binding-type missing, meta-type missing, -/// etc.). The path string is routed through the -/// [`BootstrapAuthorityKey`] egress accessor (display-only), not pulled -/// from the `PIPELINE_AUTHORITY_FILE` constant — this keeps the witness -/// the structural source for bootstrap-attribution; the `(file, 0, 0)` -/// shape remains diagnostic display, not a participation key (audit -/// row #6 retirement; bootstrap.rs slice 1 of 2). -#[cfg_attr(not(feature = "bootstrap-regen-fresh"), allow(dead_code))] -fn pipeline_authority_span() -> SourceSpan { - let key = crate::diagnostics::BootstrapAuthorityKey::for_pipeline_authority(); - SourceSpan::new(key.path(), 0, 0) -} - -#[cfg_attr(not(feature = "bootstrap-regen-fresh"), allow(dead_code))] -fn report_pipeline_authority_error(dag: &mut Dag, name: String, span: SourceSpan) { - dag.attach_bootstrap_diagnostic( - crate::diagnostics::BootstrapAuthorityKey::for_pipeline_authority(), - Diagnostic::ResolveError { - name, - span, - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "BootstrapDiagnostic", - ), - }, - ); -} - -/// Fail-closed witness for Lane 1e-2b: authoritative kernel `Bool` in -/// [`BootstrapAuthorityKey::for_kernel_bool`] must exist and carry -/// `Declaration.inhabits` for `BooleanAlgebra`. -/// -/// Lowering wires this on the `dsl/std/types.dag` `TypeSum` path -/// ([`crate::lower::wire_kernel_bool_boolean_algebra_inhabits`]); this -/// finalization check restores the bootstrap-wide guarantee previously carried -/// by the post-parse patch sweep so regressions still surface through -/// [`Dag::attach_bootstrap_diagnostic`] (INVARIANTS P3) if that branch is ever -/// skipped or the snapshot drifts. -pub(crate) fn ensure_kernel_bool_lane1e2b_bootstrap_witness(dag: &mut Dag) { - let key = BootstrapAuthorityKey::for_kernel_bool(); - let bool_id = match dag - .declarations() - .iter() - .find(|d| d.name.as_deref() == Some("Bool") && d.span.file == key.path()) - { - Some(d) => d.id, - None => { - dag.attach_bootstrap_diagnostic( - key.clone(), - Diagnostic::ResolveError { - name: "bootstrap: Lane 1e-2b Path A — kernel `Bool` missing from bootstrap Dag \ - (`dsl/std/types.dag` authority); cannot establish `BooleanAlgebra` \ - inhabitance" - .to_string(), - span: SourceSpan::new(key.path(), 0, 0), - correction: Correction::deferred_for_diagnostic_class("BootstrapDiagnostic"), - }, - ); - return; - } - }; - - if dag.declaration(bool_id).inhabits.is_none() { - crate::lower::wire_kernel_bool_boolean_algebra_inhabits(dag, bool_id); - } - let Some(inh_id) = dag.declaration(bool_id).inhabits else { - return; - }; - - let inh_decl = dag.declaration(inh_id); - let ok = match &inh_decl.connective { - TypeConnective::Instantiation { - template, - arguments, - } => { - dag.declaration(*template).name.as_deref() == Some("BooleanAlgebra") - && matches!( - arguments.as_slice(), - [TemplateArgument { value, .. }] if *value == bool_id - ) - } - _ => false, - }; - if !ok { - let span = dag.declaration(bool_id).span.clone(); - dag.attach_bootstrap_diagnostic( - key, - Diagnostic::ResolveError { - name: "bootstrap: Lane 1e-2b Path A — kernel `Bool` `inhabits` is not a \ - `BooleanAlgebra` instantiation" - .to_string(), - span, - correction: Correction::deferred_for_diagnostic_class("BootstrapDiagnostic"), - }, - ); - } -} - -#[cfg(test)] -mod tests { - //! §6.5 realization smoke test. The stub chain (Realization meta- - //! type, realization instance, realization Arrow) is constructed - //! entirely inside this test module — no production bootstrap code - //! is involved. The test exercises the - //! `ArrowBody::ExternalRealization` substrate path end-to-end - //! (construction + typed-edge validation + inference dispatch) - //! without manufacturing realization facts at `Dag::new()` time. - - use super::*; - use crate::dag::{ArrowBody, AtomPayload, Declaration, DeclarationId, TypeConnective}; - - /// Build a Realization → instance → Arrow chain inside a fresh Dag. - /// Returns the Arrow's DeclarationId so callers can walk it. - fn inject_test_realization(dag: &mut Dag) -> DeclarationId { - let span = SourceSpan::new("", 0, 0); - - let meta_type_id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: meta_type_id, - name: Some("TestRealization".to_string()), - connective: TypeConnective::Conj { - children: Vec::new(), - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - - let instance_id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: instance_id, - name: None, - connective: TypeConnective::Conj { - children: Vec::new(), - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: Some(meta_type_id), - specialization_parent: None, - inhabits: None, - - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - - // Typed-edge check: verify the instance is realization-shaped - // before encoding it in `ArrowBody::ExternalRealization`. This - // is the same invariant `infer::is_realization_shape` enforces - // at dispatch time; the test asserts it at construction time - // as well, so both sides of the invariant are exercised. - let instance_decl = dag.declaration(instance_id); - assert!( - matches!(instance_decl.connective, TypeConnective::Conj { .. }), - "realization instance must be a Conj" - ); - assert_eq!( - instance_decl.meta_tag, - Some(meta_type_id), - "realization instance's meta_tag must point at the TestRealization meta-type" - ); - - // Use an anonymous Int primitive reference for the Arrow - // inputs/output. At runtime, the smoke test walks through the - // real Int declaration via `declaration_by_name`. - let int_id = dag - .declaration_by_name("Int") - .expect("Int is populated by bootstrap before the test runs") - .id; - let arrow_id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: arrow_id, - name: None, - connective: TypeConnective::Arrow { - inputs: vec![int_id, int_id], - output: int_id, - body: ArrowBody::ExternalRealization(instance_id), - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - - value_body: None, - refinement: None, - nominal_opacity: None, - span, - }); - - arrow_id - } - - #[test] - fn smoke_int_add_external_realization() { - let mut dag = Dag::new(); - let arrow_id = inject_test_realization(&mut dag); - - let arrow_decl = dag.declaration(arrow_id); - let (inputs, output, body) = match &arrow_decl.connective { - TypeConnective::Arrow { - inputs, - output, - body, - } => (inputs.clone(), *output, body.clone()), - other => panic!("expected realization arrow, got {other:?}"), - }; - assert_eq!(inputs.len(), 2); - assert_eq!(inputs[0], output); - assert!( - arrow_decl.name.is_none(), - "realization arrow is anonymous so it stays out of declaration_by_name" - ); - - let realization_id = match body { - ArrowBody::ExternalRealization(id) => id, - other => panic!("expected ExternalRealization body, got {other:?}"), - }; - let realization_decl = dag.declaration(realization_id); - assert!( - realization_decl.name.is_none(), - "realization instance is anonymous" - ); - assert!( - matches!(realization_decl.connective, TypeConnective::Conj { .. }), - "realization instance must be a Conj" - ); - - let meta_type_id = realization_decl - .meta_tag - .expect("realization instance must carry a meta_tag"); - let meta_type_decl = dag.declaration(meta_type_id); - assert_eq!( - meta_type_decl.name.as_deref(), - Some("TestRealization"), - "meta_tag points at the test-local meta-type" - ); - assert!( - realization_decl.inhabits.is_none(), - "realization instance uses meta_tag only, not inhabits" - ); - - // Self-check on the AtomPayload enum so the test depends on - // its shape (otherwise an unused import warning fires). - let _probe: Option<&AtomPayload> = None; - } - - #[test] - fn malformed_pipeline_stage_attaches_diagnostic() { - use crate::diagnostics::BootstrapAuthorityKey; - - let mut dag = Dag::new(); - assert!(dag.diagnostics().is_empty(), "bootstrap should start clean"); - - let parse_stage = dag - .declaration_by_name("parse") - .expect("parse stage present") - .id; - dag.declaration_mut(parse_stage).connective = TypeConnective::Conj { - children: Vec::new(), - }; - - materialize_pipeline_realizations(&mut dag); - - // Consumer-side dispatch on attribution witness, not on - // `span.file == PIPELINE_AUTHORITY_FILE` (audit row #6 - // retirement; bootstrap.rs slice 1 of 2). - let expected_key = BootstrapAuthorityKey::for_pipeline_authority(); - let mut matched = 0usize; - for (_, diag, attribution) in dag.diagnostics().iter_attributed() { - let Diagnostic::ResolveError { name, .. } = diag else { - continue; - }; - if !name.contains("pipeline stage `parse`") { - continue; - } - assert!( - attribution.is_bootstrap(), - "malformed-stage diagnostic must carry BootstrapAuthority attribution, got {attribution:?}" - ); - assert_eq!( - attribution.as_bootstrap_authority(), - Some(&expected_key), - "attribution witness must match pipeline-authority key" - ); - matched += 1; - } - assert_eq!( - matched, 1, - "expected exactly one bootstrap-attributed pipeline-stage diagnostic, got {matched}" - ); - } - - #[test] - fn kernel_bool_path_a_attaches_diagnostic_when_boolean_algebra_unresolvable() { - let mut dag = Dag::new(); - assert!( - dag.diagnostics().is_empty(), - "production bootstrap should satisfy Path A preconditions: {:?}", - dag.diagnostics().iter().collect::>() - ); - - let bool_id = dag - .declaration_by_name("Bool") - .expect("kernel Bool from std") - .id; - dag.declaration_mut(bool_id).inhabits = None; - - let ba_id = dag - .declaration_by_name("BooleanAlgebra") - .expect("BooleanAlgebra from std") - .id; - dag.declaration_mut(ba_id).name = Some("__test_hidden_BooleanAlgebra".to_string()); - - crate::lower::wire_kernel_bool_boolean_algebra_inhabits(&mut dag, bool_id); - - assert!( - dag.declaration(bool_id).inhabits.is_none(), - "inhabits must stay unset when the patch cannot complete" - ); - assert!( - dag.diagnostics().iter().any(|(_, diag)| { - matches!( - diag, - Diagnostic::ResolveError { name, .. } - if name.contains("Lane 1e-2b Path A") && name.contains("BooleanAlgebra") - ) - }), - "expected bootstrap Path A diagnostic, got {:?}", - dag.diagnostics().iter().collect::>() - ); - } - - /// PB row 82 surface: detached phantom-port bootstrap diagnostics - /// must carry [`DiagnosticAttribution::BootstrapAuthority`] so - /// Verification can recover bootstrap origin without comparing - /// `SourceSpan.file` against a known authority path. Drives the - /// same Path A failure as the sibling test above and asserts the - /// attribution surface; consumer-side dispatch uses - /// `attribution.is_bootstrap()` and witness identity. - #[test] - fn kernel_bool_path_a_diagnostic_carries_bootstrap_authority_attribution() { - use crate::diagnostics::{BootstrapAuthorityKey, DiagnosticAttribution}; - - let mut dag = Dag::new(); - let bool_id = dag.declaration_by_name("Bool").expect("kernel Bool").id; - dag.declaration_mut(bool_id).inhabits = None; - let ba_id = dag - .declaration_by_name("BooleanAlgebra") - .expect("BooleanAlgebra") - .id; - dag.declaration_mut(ba_id).name = Some("__test_hidden_BooleanAlgebra".to_string()); - - crate::lower::wire_kernel_bool_boolean_algebra_inhabits(&mut dag, bool_id); - - let expected_key = BootstrapAuthorityKey::for_kernel_bool(); - let mut bootstrap_attributed = 0usize; - for (port, diag, attribution) in dag.diagnostics().iter_attributed() { - // Sanity-check: the message we expect from this scenario. - let Diagnostic::ResolveError { name, .. } = diag else { - continue; - }; - if !(name.contains("Lane 1e-2b Path A") && name.contains("BooleanAlgebra")) { - continue; - } - // Consumer-side dispatch: no `span.file ==` compare here. - assert!( - attribution.is_bootstrap(), - "Path A diagnostic at port {port:?} must be DiagnosticAttribution::BootstrapAuthority(_), got {attribution:?}" - ); - assert_eq!( - attribution.as_bootstrap_authority(), - Some(&expected_key), - "attribution witness must match dsl/std/types.dag bootstrap-authority key" - ); - // Same answer through the per-port accessor. - assert_eq!( - dag.diagnostics().attribution(port), - Some(&DiagnosticAttribution::BootstrapAuthority( - expected_key.clone() - )) - ); - bootstrap_attributed += 1; - } - assert_eq!( - bootstrap_attributed, 1, - "expected exactly one bootstrap-attributed Path A diagnostic, got {bootstrap_attributed} \ - (table: {:?})", - dag.diagnostics().iter_attributed().collect::>() - ); - } -} diff --git a/src/v3/compiler/src/bootstrap_generated.rs b/src/v3/compiler/src/bootstrap_generated.rs deleted file mode 100644 index b4bfddd2ce9..00000000000 --- a/src/v3/compiler/src/bootstrap_generated.rs +++ /dev/null @@ -1,109094 +0,0 @@ -// AUTO-GENERATED from `dsl/std/*.dag + src/v3/std/*.dag + src/v3/spec/*.dag + src/v3/compiler/*.dag minus tokenize.dag + dsl/extdeps/languages/rust/primitives.dag` via `regen_bootstrap`. -// Regenerate instead of hand-editing. - -pub(crate) fn bootstrapped_fixture_dag() -> Dag { - Dag { - nodes: bootstrapped_fixture_dag_nodes(), - declarations: bootstrapped_fixture_dag_declarations(), - ports: bootstrapped_fixture_dag_ports(), - diagnostics: bootstrapped_fixture_dag_diagnostics(), - next_node_id: 1031, - next_declaration_id: 3413, - next_port_id: 1207, - primitives: PrimitiveCache::default(), - substrate_markers: SubstrateMarkers::default(), - realization_metas: RealizationMetaCache::default(), - target_syntax: TargetSyntaxCache::default(), - stdlib_types: StdlibTypeCache::default(), - emit_anchors: EmitAnchorCache::default(), - pattern_binding_rule_variants: PatternBindingRuleVariants::default(), - variant_payload_field_access_rule_variants: VariantPayloadFieldAccessRuleVariants::default( - ), - verifier_output_policy_variants: VerifierOutputPolicyVariants::default(), - callable_strategy_variants: CallableStrategyVariants::default(), - emit_model_variants: EmitModelVariants::default(), - clusters: bootstrapped_fixture_dag_clusters(), - optional_match_disjs: bootstrapped_fixture_dag_optional_match_disjs(), - declaration_append_begin_after_bootstrap: 3413, - } -} - -#[allow(clippy::vec_init_then_push)] -fn bootstrapped_fixture_dag_nodes() -> Vec { - { - let mut nodes = Vec::with_capacity(1031); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(0), - data: LiteralBits::Int("0".to_string()), - output: PortId(1), - span: SourceSpan::new("dsl/std/integer.dag", 9242, 9249), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(1), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Gt)), - inputs: vec![PortId(0), PortId(1)], - output: PortId(2), - span: SourceSpan::new("dsl/std/integer.dag", 9242, 9249), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(2), - name: "".to_string(), - value: PortId(2), - params: vec![PortId(0)], - span: SourceSpan::new("dsl/std/integer.dag", 9242, 9249), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(3), - data: LiteralBits::Int("0".to_string()), - output: PortId(4), - span: SourceSpan::new("dsl/std/types.dag", 9194, 9208), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(4), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Ge)), - inputs: vec![PortId(3), PortId(4)], - output: PortId(5), - span: SourceSpan::new("dsl/std/types.dag", 9194, 9208), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(5), - data: LiteralBits::Int("55295".to_string()), - output: PortId(6), - span: SourceSpan::new("dsl/std/types.dag", 9194, 9208), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(6), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Le)), - inputs: vec![PortId(3), PortId(6)], - output: PortId(7), - span: SourceSpan::new("dsl/std/types.dag", 9194, 9208), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(7), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(5), PortId(7)], - output: PortId(8), - span: SourceSpan::new("dsl/std/types.dag", 9194, 9208), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(8), - data: LiteralBits::Int("57344".to_string()), - output: PortId(9), - span: SourceSpan::new("dsl/std/types.dag", 9194, 9208), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(9), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Ge)), - inputs: vec![PortId(3), PortId(9)], - output: PortId(10), - span: SourceSpan::new("dsl/std/types.dag", 9194, 9208), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(10), - data: LiteralBits::Int("1114111".to_string()), - output: PortId(11), - span: SourceSpan::new("dsl/std/types.dag", 9194, 9208), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(11), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Le)), - inputs: vec![PortId(3), PortId(11)], - output: PortId(12), - span: SourceSpan::new("dsl/std/types.dag", 9194, 9208), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(12), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(10), PortId(12)], - output: PortId(13), - span: SourceSpan::new("dsl/std/types.dag", 9194, 9208), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(13), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::Or)), - inputs: vec![PortId(8), PortId(13)], - output: PortId(14), - span: SourceSpan::new("dsl/std/types.dag", 9194, 9208), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(14), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(3), PortId(3)], - output: PortId(15), - span: SourceSpan::new("dsl/std/types.dag", 9210, 9223), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(15), - data: LiteralBits::String("Char".to_string()), - output: PortId(16), - span: SourceSpan::new("dsl/std/types.dag", 9210, 9223), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(16), - data: LiteralBits::String("Char".to_string()), - output: PortId(17), - span: SourceSpan::new("dsl/std/types.dag", 9210, 9223), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(17), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(16), PortId(17)], - output: PortId(18), - span: SourceSpan::new("dsl/std/types.dag", 9210, 9223), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(18), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(15), PortId(18)], - output: PortId(19), - span: SourceSpan::new("dsl/std/types.dag", 9210, 9223), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(19), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(14), PortId(19)], - output: PortId(20), - span: SourceSpan::new("dsl/std/types.dag", 9194, 9223), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(20), - name: "".to_string(), - value: PortId(20), - params: vec![PortId(3)], - span: SourceSpan::new("dsl/std/types.dag", 9194, 9223), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(21), - data: LiteralBits::Int("1".to_string()), - output: PortId(22), - span: SourceSpan::new("dsl/std/types.dag", 11619, 11640), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(22), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Ge)), - inputs: vec![PortId(21), PortId(22)], - output: PortId(23), - span: SourceSpan::new("dsl/std/types.dag", 11619, 11640), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(23), - data: LiteralBits::Int("5".to_string()), - output: PortId(24), - span: SourceSpan::new("dsl/std/types.dag", 11619, 11640), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(24), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Le)), - inputs: vec![PortId(21), PortId(24)], - output: PortId(25), - span: SourceSpan::new("dsl/std/types.dag", 11619, 11640), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(25), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(23), PortId(25)], - output: PortId(26), - span: SourceSpan::new("dsl/std/types.dag", 11619, 11640), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(26), - name: "".to_string(), - value: PortId(26), - params: vec![PortId(21)], - span: SourceSpan::new("dsl/std/types.dag", 11619, 11640), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(27), - data: LiteralBits::Int("100".to_string()), - output: PortId(28), - span: SourceSpan::new("dsl/std/types.dag", 11671, 11696), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(28), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Ge)), - inputs: vec![PortId(27), PortId(28)], - output: PortId(29), - span: SourceSpan::new("dsl/std/types.dag", 11671, 11696), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(29), - data: LiteralBits::Int("599".to_string()), - output: PortId(30), - span: SourceSpan::new("dsl/std/types.dag", 11671, 11696), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(30), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Le)), - inputs: vec![PortId(27), PortId(30)], - output: PortId(31), - span: SourceSpan::new("dsl/std/types.dag", 11671, 11696), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(31), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(29), PortId(31)], - output: PortId(32), - span: SourceSpan::new("dsl/std/types.dag", 11671, 11696), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(32), - name: "".to_string(), - value: PortId(32), - params: vec![PortId(27)], - span: SourceSpan::new("dsl/std/types.dag", 11671, 11696), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(33), - data: LiteralBits::Int("1".to_string()), - output: PortId(34), - span: SourceSpan::new("dsl/std/types.dag", 11827, 11852), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(34), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Ge)), - inputs: vec![PortId(33), PortId(34)], - output: PortId(35), - span: SourceSpan::new("dsl/std/types.dag", 11827, 11852), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(35), - data: LiteralBits::Int("65535".to_string()), - output: PortId(36), - span: SourceSpan::new("dsl/std/types.dag", 11827, 11852), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(36), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Le)), - inputs: vec![PortId(33), PortId(36)], - output: PortId(37), - span: SourceSpan::new("dsl/std/types.dag", 11827, 11852), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(37), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(35), PortId(37)], - output: PortId(38), - span: SourceSpan::new("dsl/std/types.dag", 11827, 11852), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(38), - name: "".to_string(), - value: PortId(38), - params: vec![PortId(33)], - span: SourceSpan::new("dsl/std/types.dag", 11827, 11852), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(39), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(39), PortId(39)], - output: PortId(40), - span: SourceSpan::new("dsl/std/types.dag", 13050, 13070), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(40), - data: LiteralBits::String("PathSegment".to_string()), - output: PortId(41), - span: SourceSpan::new("dsl/std/types.dag", 13050, 13070), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(41), - data: LiteralBits::String("PathSegment".to_string()), - output: PortId(42), - span: SourceSpan::new("dsl/std/types.dag", 13050, 13070), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(42), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(41), PortId(42)], - output: PortId(43), - span: SourceSpan::new("dsl/std/types.dag", 13050, 13070), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(43), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(40), PortId(43)], - output: PortId(44), - span: SourceSpan::new("dsl/std/types.dag", 13050, 13070), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(44), - name: "".to_string(), - value: PortId(44), - params: vec![PortId(39)], - span: SourceSpan::new("dsl/std/types.dag", 13050, 13070), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(45), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(45), PortId(45)], - output: PortId(46), - span: SourceSpan::new("dsl/std/types.dag", 13110, 13130), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(46), - data: LiteralBits::String("GlobSegment".to_string()), - output: PortId(47), - span: SourceSpan::new("dsl/std/types.dag", 13110, 13130), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(47), - data: LiteralBits::String("GlobSegment".to_string()), - output: PortId(48), - span: SourceSpan::new("dsl/std/types.dag", 13110, 13130), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(48), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(47), PortId(48)], - output: PortId(49), - span: SourceSpan::new("dsl/std/types.dag", 13110, 13130), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(49), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(46), PortId(49)], - output: PortId(50), - span: SourceSpan::new("dsl/std/types.dag", 13110, 13130), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(50), - name: "".to_string(), - value: PortId(50), - params: vec![PortId(45)], - span: SourceSpan::new("dsl/std/types.dag", 13110, 13130), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(51), - data: LiteralBits::Int("0".to_string()), - output: PortId(52), - span: SourceSpan::new("dsl/std/types.dag", 14114, 14127), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(52), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Ge)), - inputs: vec![PortId(51), PortId(52)], - output: PortId(53), - span: SourceSpan::new("dsl/std/types.dag", 14114, 14127), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(53), - name: "".to_string(), - value: PortId(53), - params: vec![PortId(51)], - span: SourceSpan::new("dsl/std/types.dag", 14114, 14127), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(54), - data: LiteralBits::Int("0".to_string()), - output: PortId(55), - span: SourceSpan::new("dsl/std/types.dag", 14159, 14172), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(55), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Ge)), - inputs: vec![PortId(54), PortId(55)], - output: PortId(56), - span: SourceSpan::new("dsl/std/types.dag", 14159, 14172), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(56), - name: "".to_string(), - value: PortId(56), - params: vec![PortId(54)], - span: SourceSpan::new("dsl/std/types.dag", 14159, 14172), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(57), - data: LiteralBits::Int("0".to_string()), - output: PortId(58), - span: SourceSpan::new("dsl/std/types.dag", 14204, 14217), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(58), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Ge)), - inputs: vec![PortId(57), PortId(58)], - output: PortId(59), - span: SourceSpan::new("dsl/std/types.dag", 14204, 14217), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(59), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(57), PortId(57)], - output: PortId(60), - span: SourceSpan::new("dsl/std/types.dag", 14219, 14240), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(60), - data: LiteralBits::String("Milliseconds".to_string()), - output: PortId(61), - span: SourceSpan::new("dsl/std/types.dag", 14219, 14240), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(61), - data: LiteralBits::String("Milliseconds".to_string()), - output: PortId(62), - span: SourceSpan::new("dsl/std/types.dag", 14219, 14240), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(62), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(61), PortId(62)], - output: PortId(63), - span: SourceSpan::new("dsl/std/types.dag", 14219, 14240), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(63), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(60), PortId(63)], - output: PortId(64), - span: SourceSpan::new("dsl/std/types.dag", 14219, 14240), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(64), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(59), PortId(64)], - output: PortId(65), - span: SourceSpan::new("dsl/std/types.dag", 14204, 14240), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(65), - name: "".to_string(), - value: PortId(65), - params: vec![PortId(57)], - span: SourceSpan::new("dsl/std/types.dag", 14204, 14240), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(66), - data: LiteralBits::Int("0".to_string()), - output: PortId(67), - span: SourceSpan::new("dsl/std/types.dag", 14272, 14285), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(67), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Ge)), - inputs: vec![PortId(66), PortId(67)], - output: PortId(68), - span: SourceSpan::new("dsl/std/types.dag", 14272, 14285), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(68), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(66), PortId(66)], - output: PortId(69), - span: SourceSpan::new("dsl/std/types.dag", 14287, 14303), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(69), - data: LiteralBits::String("Seconds".to_string()), - output: PortId(70), - span: SourceSpan::new("dsl/std/types.dag", 14287, 14303), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(70), - data: LiteralBits::String("Seconds".to_string()), - output: PortId(71), - span: SourceSpan::new("dsl/std/types.dag", 14287, 14303), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(71), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(70), PortId(71)], - output: PortId(72), - span: SourceSpan::new("dsl/std/types.dag", 14287, 14303), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(72), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(69), PortId(72)], - output: PortId(73), - span: SourceSpan::new("dsl/std/types.dag", 14287, 14303), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(73), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(68), PortId(73)], - output: PortId(74), - span: SourceSpan::new("dsl/std/types.dag", 14272, 14303), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(74), - name: "".to_string(), - value: PortId(74), - params: vec![PortId(66)], - span: SourceSpan::new("dsl/std/types.dag", 14272, 14303), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(75), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(75), PortId(75)], - output: PortId(76), - span: SourceSpan::new("dsl/std/types.dag", 14509, 14529), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(76), - data: LiteralBits::String("LogicalTime".to_string()), - output: PortId(77), - span: SourceSpan::new("dsl/std/types.dag", 14509, 14529), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(77), - data: LiteralBits::String("LogicalTime".to_string()), - output: PortId(78), - span: SourceSpan::new("dsl/std/types.dag", 14509, 14529), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(78), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(77), PortId(78)], - output: PortId(79), - span: SourceSpan::new("dsl/std/types.dag", 14509, 14529), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(79), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(76), PortId(79)], - output: PortId(80), - span: SourceSpan::new("dsl/std/types.dag", 14509, 14529), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(80), - name: "".to_string(), - value: PortId(80), - params: vec![PortId(75)], - span: SourceSpan::new("dsl/std/types.dag", 14509, 14529), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(81), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(81), PortId(81)], - output: PortId(82), - span: SourceSpan::new("dsl/std/types.dag", 15091, 15108), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(82), - data: LiteralBits::String("IntentId".to_string()), - output: PortId(83), - span: SourceSpan::new("dsl/std/types.dag", 15091, 15108), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(83), - data: LiteralBits::String("IntentId".to_string()), - output: PortId(84), - span: SourceSpan::new("dsl/std/types.dag", 15091, 15108), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(84), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(83), PortId(84)], - output: PortId(85), - span: SourceSpan::new("dsl/std/types.dag", 15091, 15108), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(85), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(82), PortId(85)], - output: PortId(86), - span: SourceSpan::new("dsl/std/types.dag", 15091, 15108), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(86), - name: "".to_string(), - value: PortId(86), - params: vec![PortId(81)], - span: SourceSpan::new("dsl/std/types.dag", 15091, 15108), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(87), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(87), PortId(87)], - output: PortId(88), - span: SourceSpan::new("dsl/std/types.dag", 15147, 15163), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(88), - data: LiteralBits::String("IssueId".to_string()), - output: PortId(89), - span: SourceSpan::new("dsl/std/types.dag", 15147, 15163), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(89), - data: LiteralBits::String("IssueId".to_string()), - output: PortId(90), - span: SourceSpan::new("dsl/std/types.dag", 15147, 15163), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(90), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(89), PortId(90)], - output: PortId(91), - span: SourceSpan::new("dsl/std/types.dag", 15147, 15163), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(91), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(88), PortId(91)], - output: PortId(92), - span: SourceSpan::new("dsl/std/types.dag", 15147, 15163), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(92), - name: "".to_string(), - value: PortId(92), - params: vec![PortId(87)], - span: SourceSpan::new("dsl/std/types.dag", 15147, 15163), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(93), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(93), PortId(93)], - output: PortId(94), - span: SourceSpan::new("dsl/std/types.dag", 15202, 15217), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(94), - data: LiteralBits::String("RunKey".to_string()), - output: PortId(95), - span: SourceSpan::new("dsl/std/types.dag", 15202, 15217), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(95), - data: LiteralBits::String("RunKey".to_string()), - output: PortId(96), - span: SourceSpan::new("dsl/std/types.dag", 15202, 15217), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(96), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(95), PortId(96)], - output: PortId(97), - span: SourceSpan::new("dsl/std/types.dag", 15202, 15217), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(97), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(94), PortId(97)], - output: PortId(98), - span: SourceSpan::new("dsl/std/types.dag", 15202, 15217), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(98), - name: "".to_string(), - value: PortId(98), - params: vec![PortId(93)], - span: SourceSpan::new("dsl/std/types.dag", 15202, 15217), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(99), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(99), PortId(99)], - output: PortId(100), - span: SourceSpan::new("dsl/std/types.dag", 15256, 15275), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(100), - data: LiteralBits::String("ArtifactId".to_string()), - output: PortId(101), - span: SourceSpan::new("dsl/std/types.dag", 15256, 15275), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(101), - data: LiteralBits::String("ArtifactId".to_string()), - output: PortId(102), - span: SourceSpan::new("dsl/std/types.dag", 15256, 15275), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(102), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(101), PortId(102)], - output: PortId(103), - span: SourceSpan::new("dsl/std/types.dag", 15256, 15275), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(103), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(100), PortId(103)], - output: PortId(104), - span: SourceSpan::new("dsl/std/types.dag", 15256, 15275), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(104), - name: "".to_string(), - value: PortId(104), - params: vec![PortId(99)], - span: SourceSpan::new("dsl/std/types.dag", 15256, 15275), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(105), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(105), PortId(105)], - output: PortId(106), - span: SourceSpan::new("dsl/std/types.dag", 15314, 15333), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(106), - data: LiteralBits::String("LeaseToken".to_string()), - output: PortId(107), - span: SourceSpan::new("dsl/std/types.dag", 15314, 15333), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(107), - data: LiteralBits::String("LeaseToken".to_string()), - output: PortId(108), - span: SourceSpan::new("dsl/std/types.dag", 15314, 15333), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(108), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(107), PortId(108)], - output: PortId(109), - span: SourceSpan::new("dsl/std/types.dag", 15314, 15333), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(109), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(106), PortId(109)], - output: PortId(110), - span: SourceSpan::new("dsl/std/types.dag", 15314, 15333), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(110), - name: "".to_string(), - value: PortId(110), - params: vec![PortId(105)], - span: SourceSpan::new("dsl/std/types.dag", 15314, 15333), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(111), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(111), PortId(111)], - output: PortId(112), - span: SourceSpan::new("dsl/std/types.dag", 15372, 15389), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(112), - data: LiteralBits::String("WorkerId".to_string()), - output: PortId(113), - span: SourceSpan::new("dsl/std/types.dag", 15372, 15389), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(113), - data: LiteralBits::String("WorkerId".to_string()), - output: PortId(114), - span: SourceSpan::new("dsl/std/types.dag", 15372, 15389), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(114), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(113), PortId(114)], - output: PortId(115), - span: SourceSpan::new("dsl/std/types.dag", 15372, 15389), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(115), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(112), PortId(115)], - output: PortId(116), - span: SourceSpan::new("dsl/std/types.dag", 15372, 15389), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(116), - name: "".to_string(), - value: PortId(116), - params: vec![PortId(111)], - span: SourceSpan::new("dsl/std/types.dag", 15372, 15389), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(117), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(117), PortId(117)], - output: PortId(118), - span: SourceSpan::new("dsl/std/types.dag", 15428, 15446), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(118), - data: LiteralBits::String("CommentId".to_string()), - output: PortId(119), - span: SourceSpan::new("dsl/std/types.dag", 15428, 15446), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(119), - data: LiteralBits::String("CommentId".to_string()), - output: PortId(120), - span: SourceSpan::new("dsl/std/types.dag", 15428, 15446), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(120), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(119), PortId(120)], - output: PortId(121), - span: SourceSpan::new("dsl/std/types.dag", 15428, 15446), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(121), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(118), PortId(121)], - output: PortId(122), - span: SourceSpan::new("dsl/std/types.dag", 15428, 15446), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(122), - name: "".to_string(), - value: PortId(122), - params: vec![PortId(117)], - span: SourceSpan::new("dsl/std/types.dag", 15428, 15446), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(123), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(123), PortId(123)], - output: PortId(124), - span: SourceSpan::new("dsl/std/types.dag", 15485, 15503), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(124), - data: LiteralBits::String("SignalKey".to_string()), - output: PortId(125), - span: SourceSpan::new("dsl/std/types.dag", 15485, 15503), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(125), - data: LiteralBits::String("SignalKey".to_string()), - output: PortId(126), - span: SourceSpan::new("dsl/std/types.dag", 15485, 15503), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(126), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(125), PortId(126)], - output: PortId(127), - span: SourceSpan::new("dsl/std/types.dag", 15485, 15503), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(127), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(124), PortId(127)], - output: PortId(128), - span: SourceSpan::new("dsl/std/types.dag", 15485, 15503), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(128), - name: "".to_string(), - value: PortId(128), - params: vec![PortId(123)], - span: SourceSpan::new("dsl/std/types.dag", 15485, 15503), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(129), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(129), PortId(129)], - output: PortId(130), - span: SourceSpan::new("dsl/std/types.dag", 15542, 15562), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(130), - data: LiteralBits::String("ContentHash".to_string()), - output: PortId(131), - span: SourceSpan::new("dsl/std/types.dag", 15542, 15562), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(131), - data: LiteralBits::String("ContentHash".to_string()), - output: PortId(132), - span: SourceSpan::new("dsl/std/types.dag", 15542, 15562), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(132), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(131), PortId(132)], - output: PortId(133), - span: SourceSpan::new("dsl/std/types.dag", 15542, 15562), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(133), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(130), PortId(133)], - output: PortId(134), - span: SourceSpan::new("dsl/std/types.dag", 15542, 15562), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(134), - name: "".to_string(), - value: PortId(134), - params: vec![PortId(129)], - span: SourceSpan::new("dsl/std/types.dag", 15542, 15562), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(135), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(135), PortId(135)], - output: PortId(136), - span: SourceSpan::new("dsl/std/types.dag", 15837, 15864), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(136), - data: LiteralBits::String("WorkflowProducerId".to_string()), - output: PortId(137), - span: SourceSpan::new("dsl/std/types.dag", 15837, 15864), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(137), - data: LiteralBits::String("WorkflowProducerId".to_string()), - output: PortId(138), - span: SourceSpan::new("dsl/std/types.dag", 15837, 15864), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(138), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(137), PortId(138)], - output: PortId(139), - span: SourceSpan::new("dsl/std/types.dag", 15837, 15864), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(139), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(136), PortId(139)], - output: PortId(140), - span: SourceSpan::new("dsl/std/types.dag", 15837, 15864), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(140), - name: "".to_string(), - value: PortId(140), - params: vec![PortId(135)], - span: SourceSpan::new("dsl/std/types.dag", 15837, 15864), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(141), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(141), PortId(141)], - output: PortId(142), - span: SourceSpan::new("dsl/std/types.dag", 15909, 15936), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(142), - data: LiteralBits::String("WorkflowObserverId".to_string()), - output: PortId(143), - span: SourceSpan::new("dsl/std/types.dag", 15909, 15936), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(143), - data: LiteralBits::String("WorkflowObserverId".to_string()), - output: PortId(144), - span: SourceSpan::new("dsl/std/types.dag", 15909, 15936), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(144), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(143), PortId(144)], - output: PortId(145), - span: SourceSpan::new("dsl/std/types.dag", 15909, 15936), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(145), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(142), PortId(145)], - output: PortId(146), - span: SourceSpan::new("dsl/std/types.dag", 15909, 15936), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(146), - name: "".to_string(), - value: PortId(146), - params: vec![PortId(141)], - span: SourceSpan::new("dsl/std/types.dag", 15909, 15936), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(147), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(147), PortId(147)], - output: PortId(148), - span: SourceSpan::new("dsl/std/types.dag", 15979, 16004), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(148), - data: LiteralBits::String("WorkflowProverId".to_string()), - output: PortId(149), - span: SourceSpan::new("dsl/std/types.dag", 15979, 16004), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(149), - data: LiteralBits::String("WorkflowProverId".to_string()), - output: PortId(150), - span: SourceSpan::new("dsl/std/types.dag", 15979, 16004), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(150), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(149), PortId(150)], - output: PortId(151), - span: SourceSpan::new("dsl/std/types.dag", 15979, 16004), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(151), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(148), PortId(151)], - output: PortId(152), - span: SourceSpan::new("dsl/std/types.dag", 15979, 16004), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(152), - name: "".to_string(), - value: PortId(152), - params: vec![PortId(147)], - span: SourceSpan::new("dsl/std/types.dag", 15979, 16004), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(153), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(153), PortId(153)], - output: PortId(154), - span: SourceSpan::new("dsl/std/types.dag", 16044, 16066), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(154), - data: LiteralBits::String("WorkflowRunId".to_string()), - output: PortId(155), - span: SourceSpan::new("dsl/std/types.dag", 16044, 16066), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(155), - data: LiteralBits::String("WorkflowRunId".to_string()), - output: PortId(156), - span: SourceSpan::new("dsl/std/types.dag", 16044, 16066), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(156), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(155), PortId(156)], - output: PortId(157), - span: SourceSpan::new("dsl/std/types.dag", 16044, 16066), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(157), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(154), PortId(157)], - output: PortId(158), - span: SourceSpan::new("dsl/std/types.dag", 16044, 16066), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(158), - name: "".to_string(), - value: PortId(158), - params: vec![PortId(153)], - span: SourceSpan::new("dsl/std/types.dag", 16044, 16066), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(159), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(159), PortId(159)], - output: PortId(160), - span: SourceSpan::new("dsl/std/types.dag", 22653, 22678), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(160), - data: LiteralBits::String("FilesystemHandle".to_string()), - output: PortId(161), - span: SourceSpan::new("dsl/std/types.dag", 22653, 22678), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(161), - data: LiteralBits::String("FilesystemHandle".to_string()), - output: PortId(162), - span: SourceSpan::new("dsl/std/types.dag", 22653, 22678), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(162), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(161), PortId(162)], - output: PortId(163), - span: SourceSpan::new("dsl/std/types.dag", 22653, 22678), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(163), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(160), PortId(163)], - output: PortId(164), - span: SourceSpan::new("dsl/std/types.dag", 22653, 22678), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(164), - name: "".to_string(), - value: PortId(164), - params: vec![PortId(159)], - span: SourceSpan::new("dsl/std/types.dag", 22653, 22678), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(165), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(165), PortId(165)], - output: PortId(166), - span: SourceSpan::new("dsl/std/types.dag", 22714, 22736), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(166), - data: LiteralBits::String("NetworkHandle".to_string()), - output: PortId(167), - span: SourceSpan::new("dsl/std/types.dag", 22714, 22736), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(167), - data: LiteralBits::String("NetworkHandle".to_string()), - output: PortId(168), - span: SourceSpan::new("dsl/std/types.dag", 22714, 22736), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(168), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(167), PortId(168)], - output: PortId(169), - span: SourceSpan::new("dsl/std/types.dag", 22714, 22736), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(169), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(166), PortId(169)], - output: PortId(170), - span: SourceSpan::new("dsl/std/types.dag", 22714, 22736), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(170), - name: "".to_string(), - value: PortId(170), - params: vec![PortId(165)], - span: SourceSpan::new("dsl/std/types.dag", 22714, 22736), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(171), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(171), PortId(171)], - output: PortId(172), - span: SourceSpan::new("dsl/std/types.dag", 22774, 22793), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(172), - data: LiteralBits::String("ToolHandle".to_string()), - output: PortId(173), - span: SourceSpan::new("dsl/std/types.dag", 22774, 22793), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(173), - data: LiteralBits::String("ToolHandle".to_string()), - output: PortId(174), - span: SourceSpan::new("dsl/std/types.dag", 22774, 22793), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(174), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(173), PortId(174)], - output: PortId(175), - span: SourceSpan::new("dsl/std/types.dag", 22774, 22793), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(175), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(172), PortId(175)], - output: PortId(176), - span: SourceSpan::new("dsl/std/types.dag", 22774, 22793), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(176), - name: "".to_string(), - value: PortId(176), - params: vec![PortId(171)], - span: SourceSpan::new("dsl/std/types.dag", 22774, 22793), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(177), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(179), - span: SourceSpan::new("dsl/std/unicode.dag", 4240, 4253), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(178), - data: LiteralBits::Int("9".to_string()), - output: PortId(180), - span: SourceSpan::new("dsl/std/unicode.dag", 4257, 4258), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(179), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(179), PortId(180)], - output: PortId(181), - span: SourceSpan::new("dsl/std/unicode.dag", 4240, 4258), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(180), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(182), - span: SourceSpan::new("dsl/std/unicode.dag", 4262, 4275), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(181), - data: LiteralBits::Int("10".to_string()), - output: PortId(183), - span: SourceSpan::new("dsl/std/unicode.dag", 4279, 4281), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(182), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(182), PortId(183)], - output: PortId(184), - span: SourceSpan::new("dsl/std/unicode.dag", 4262, 4281), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(183), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::Or)), - inputs: vec![PortId(181), PortId(184)], - output: PortId(185), - span: SourceSpan::new("dsl/std/unicode.dag", 4240, 4281), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(184), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(186), - span: SourceSpan::new("dsl/std/unicode.dag", 4285, 4298), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(185), - data: LiteralBits::Int("12".to_string()), - output: PortId(187), - span: SourceSpan::new("dsl/std/unicode.dag", 4302, 4304), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(186), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(186), PortId(187)], - output: PortId(188), - span: SourceSpan::new("dsl/std/unicode.dag", 4285, 4304), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(187), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::Or)), - inputs: vec![PortId(185), PortId(188)], - output: PortId(189), - span: SourceSpan::new("dsl/std/unicode.dag", 4240, 4304), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(188), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(190), - span: SourceSpan::new("dsl/std/unicode.dag", 4314, 4327), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(189), - data: LiteralBits::Int("13".to_string()), - output: PortId(191), - span: SourceSpan::new("dsl/std/unicode.dag", 4331, 4333), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(190), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(190), PortId(191)], - output: PortId(192), - span: SourceSpan::new("dsl/std/unicode.dag", 4314, 4333), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(191), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::Or)), - inputs: vec![PortId(189), PortId(192)], - output: PortId(193), - span: SourceSpan::new("dsl/std/unicode.dag", 4240, 4333), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(192), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(194), - span: SourceSpan::new("dsl/std/unicode.dag", 4337, 4350), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(193), - data: LiteralBits::Int("32".to_string()), - output: PortId(195), - span: SourceSpan::new("dsl/std/unicode.dag", 4354, 4356), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(194), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(194), PortId(195)], - output: PortId(196), - span: SourceSpan::new("dsl/std/unicode.dag", 4337, 4356), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(195), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::Or)), - inputs: vec![PortId(193), PortId(196)], - output: PortId(197), - span: SourceSpan::new("dsl/std/unicode.dag", 4240, 4356), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(196), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(198), - span: SourceSpan::new("dsl/std/unicode.dag", 4370, 4383), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(197), - data: LiteralBits::Int("48".to_string()), - output: PortId(199), - span: SourceSpan::new("dsl/std/unicode.dag", 4387, 4389), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(198), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Ge)), - inputs: vec![PortId(198), PortId(199)], - output: PortId(200), - span: SourceSpan::new("dsl/std/unicode.dag", 4370, 4389), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(199), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(201), - span: SourceSpan::new("dsl/std/unicode.dag", 4393, 4406), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(200), - data: LiteralBits::Int("57".to_string()), - output: PortId(202), - span: SourceSpan::new("dsl/std/unicode.dag", 4410, 4412), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(201), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Le)), - inputs: vec![PortId(201), PortId(202)], - output: PortId(203), - span: SourceSpan::new("dsl/std/unicode.dag", 4393, 4412), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(202), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(200), PortId(203)], - output: PortId(204), - span: SourceSpan::new("dsl/std/unicode.dag", 4370, 4412), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(203), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(205), - span: SourceSpan::new("dsl/std/unicode.dag", 4437, 4450), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(204), - data: LiteralBits::Int("65".to_string()), - output: PortId(206), - span: SourceSpan::new("dsl/std/unicode.dag", 4454, 4456), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(205), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Ge)), - inputs: vec![PortId(205), PortId(206)], - output: PortId(207), - span: SourceSpan::new("dsl/std/unicode.dag", 4437, 4456), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(206), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(208), - span: SourceSpan::new("dsl/std/unicode.dag", 4460, 4473), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(207), - data: LiteralBits::Int("90".to_string()), - output: PortId(209), - span: SourceSpan::new("dsl/std/unicode.dag", 4477, 4479), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(208), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Le)), - inputs: vec![PortId(208), PortId(209)], - output: PortId(210), - span: SourceSpan::new("dsl/std/unicode.dag", 4460, 4479), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(209), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(207), PortId(210)], - output: PortId(211), - span: SourceSpan::new("dsl/std/unicode.dag", 4437, 4479), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(210), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(212), - span: SourceSpan::new("dsl/std/unicode.dag", 4489, 4502), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(211), - data: LiteralBits::Int("97".to_string()), - output: PortId(213), - span: SourceSpan::new("dsl/std/unicode.dag", 4506, 4508), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(212), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Ge)), - inputs: vec![PortId(212), PortId(213)], - output: PortId(214), - span: SourceSpan::new("dsl/std/unicode.dag", 4489, 4508), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(213), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(215), - span: SourceSpan::new("dsl/std/unicode.dag", 4512, 4525), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(214), - data: LiteralBits::Int("122".to_string()), - output: PortId(216), - span: SourceSpan::new("dsl/std/unicode.dag", 4529, 4532), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(215), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Le)), - inputs: vec![PortId(215), PortId(216)], - output: PortId(217), - span: SourceSpan::new("dsl/std/unicode.dag", 4512, 4532), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(216), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(214), PortId(217)], - output: PortId(218), - span: SourceSpan::new("dsl/std/unicode.dag", 4489, 4532), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(217), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::Or)), - inputs: vec![PortId(211), PortId(218)], - output: PortId(219), - span: SourceSpan::new("dsl/std/unicode.dag", 4437, 4532), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(218), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(220), - span: SourceSpan::new("dsl/std/unicode.dag", 4542, 4555), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(219), - data: LiteralBits::Int("95".to_string()), - output: PortId(221), - span: SourceSpan::new("dsl/std/unicode.dag", 4559, 4561), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(220), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(220), PortId(221)], - output: PortId(222), - span: SourceSpan::new("dsl/std/unicode.dag", 4542, 4561), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(221), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::Or)), - inputs: vec![PortId(219), PortId(222)], - output: PortId(223), - span: SourceSpan::new("dsl/std/unicode.dag", 4437, 4561), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(222), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(224), - span: SourceSpan::new("dsl/std/unicode.dag", 4746, 4759), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(223), - data: LiteralBits::Int("48".to_string()), - output: PortId(225), - span: SourceSpan::new("dsl/std/unicode.dag", 4763, 4765), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(224), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Ge)), - inputs: vec![PortId(224), PortId(225)], - output: PortId(226), - span: SourceSpan::new("dsl/std/unicode.dag", 4746, 4765), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(225), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(227), - span: SourceSpan::new("dsl/std/unicode.dag", 4769, 4782), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(226), - data: LiteralBits::Int("57".to_string()), - output: PortId(228), - span: SourceSpan::new("dsl/std/unicode.dag", 4786, 4788), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(227), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Le)), - inputs: vec![PortId(227), PortId(228)], - output: PortId(229), - span: SourceSpan::new("dsl/std/unicode.dag", 4769, 4788), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(228), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(226), PortId(229)], - output: PortId(230), - span: SourceSpan::new("dsl/std/unicode.dag", 4746, 4788), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(229), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(231), - span: SourceSpan::new("dsl/std/unicode.dag", 4798, 4811), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(230), - data: LiteralBits::Int("65".to_string()), - output: PortId(232), - span: SourceSpan::new("dsl/std/unicode.dag", 4815, 4817), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(231), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Ge)), - inputs: vec![PortId(231), PortId(232)], - output: PortId(233), - span: SourceSpan::new("dsl/std/unicode.dag", 4798, 4817), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(232), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(234), - span: SourceSpan::new("dsl/std/unicode.dag", 4821, 4834), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(233), - data: LiteralBits::Int("90".to_string()), - output: PortId(235), - span: SourceSpan::new("dsl/std/unicode.dag", 4838, 4840), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(234), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Le)), - inputs: vec![PortId(234), PortId(235)], - output: PortId(236), - span: SourceSpan::new("dsl/std/unicode.dag", 4821, 4840), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(235), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(233), PortId(236)], - output: PortId(237), - span: SourceSpan::new("dsl/std/unicode.dag", 4798, 4840), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(236), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::Or)), - inputs: vec![PortId(230), PortId(237)], - output: PortId(238), - span: SourceSpan::new("dsl/std/unicode.dag", 4746, 4840), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(237), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(239), - span: SourceSpan::new("dsl/std/unicode.dag", 4850, 4863), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(238), - data: LiteralBits::Int("97".to_string()), - output: PortId(240), - span: SourceSpan::new("dsl/std/unicode.dag", 4867, 4869), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(239), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Ge)), - inputs: vec![PortId(239), PortId(240)], - output: PortId(241), - span: SourceSpan::new("dsl/std/unicode.dag", 4850, 4869), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(240), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(242), - span: SourceSpan::new("dsl/std/unicode.dag", 4873, 4886), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(241), - data: LiteralBits::Int("122".to_string()), - output: PortId(243), - span: SourceSpan::new("dsl/std/unicode.dag", 4890, 4893), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(242), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Le)), - inputs: vec![PortId(242), PortId(243)], - output: PortId(244), - span: SourceSpan::new("dsl/std/unicode.dag", 4873, 4893), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(243), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(241), PortId(244)], - output: PortId(245), - span: SourceSpan::new("dsl/std/unicode.dag", 4850, 4893), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(244), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::Or)), - inputs: vec![PortId(238), PortId(245)], - output: PortId(246), - span: SourceSpan::new("dsl/std/unicode.dag", 4746, 4893), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(245), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(247), - span: SourceSpan::new("dsl/std/unicode.dag", 4903, 4916), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(246), - data: LiteralBits::Int("95".to_string()), - output: PortId(248), - span: SourceSpan::new("dsl/std/unicode.dag", 4920, 4922), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(247), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(247), PortId(248)], - output: PortId(249), - span: SourceSpan::new("dsl/std/unicode.dag", 4903, 4922), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(248), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::Or)), - inputs: vec![PortId(246), PortId(249)], - output: PortId(250), - span: SourceSpan::new("dsl/std/unicode.dag", 4746, 4922), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(249), - input: PortId(178), - paths: vec![ - Path { - body: NodeId(195), - output: PortId(197), - pattern: BranchPattern::UnresolvedVariant { - name: "Whitespace".to_string(), - span: SourceSpan::new("dsl/std/unicode.dag", 4220, 4230), - }, - binding: None, - }, - Path { - body: NodeId(202), - output: PortId(204), - pattern: BranchPattern::UnresolvedVariant { - name: "Digit".to_string(), - span: SourceSpan::new("dsl/std/unicode.dag", 4361, 4366), - }, - binding: None, - }, - Path { - body: NodeId(221), - output: PortId(223), - pattern: BranchPattern::UnresolvedVariant { - name: "IdentStart".to_string(), - span: SourceSpan::new("dsl/std/unicode.dag", 4417, 4427), - }, - binding: None, - }, - Path { - body: NodeId(248), - output: PortId(250), - pattern: BranchPattern::UnresolvedVariant { - name: "IdentContinue".to_string(), - span: SourceSpan::new("dsl/std/unicode.dag", 4723, 4736), - }, - binding: None, - }, - ], - output: PortId(251), - span: SourceSpan::new("dsl/std/unicode.dag", 4115, 4926), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(250), - name: "char_in_class".to_string(), - value: PortId(251), - params: vec![PortId(177), PortId(178)], - span: SourceSpan::new("dsl/std/unicode.dag", 4115, 4926), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(251), - data: LiteralBits::Int("0".to_string()), - output: PortId(253), - span: SourceSpan::new("dsl/std/unicode.dag", 8909, 8910), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(252), - target: TransformTarget::Operator(OperatorKind::Arithmetic(ArithmeticOp::Add)), - inputs: vec![PortId(252), PortId(253)], - output: PortId(254), - span: SourceSpan::new("dsl/std/unicode.dag", 8905, 8910), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(253), - name: "code_point".to_string(), - value: PortId(254), - params: vec![PortId(252)], - span: SourceSpan::new("dsl/std/unicode.dag", 8905, 8910), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(254), - target: TransformTarget::Callable(DeclarationId(763)), - inputs: vec![PortId(255)], - output: PortId(256), - span: SourceSpan::new("src/v3/std/effects.dag", 20290, 20316), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(255), - target: TransformTarget::Callable(DeclarationId(762)), - inputs: vec![PortId(256)], - output: PortId(257), - span: SourceSpan::new("src/v3/std/effects.dag", 20290, 20344), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(256), - name: "operation_is_breaking".to_string(), - value: PortId(257), - params: vec![PortId(255)], - span: SourceSpan::new("src/v3/std/effects.dag", 20290, 20344), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(257), - data: LiteralBits::Bool(false), - output: PortId(259), - span: SourceSpan::new("src/v3/std/effects.dag", 20440, 20445), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(258), - data: LiteralBits::Bool(true), - output: PortId(260), - span: SourceSpan::new("src/v3/std/effects.dag", 20464, 20468), - lane2_workflow: None, - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(259), - input: PortId(258), - paths: vec![ - Path { - body: NodeId(257), - output: PortId(259), - pattern: BranchPattern::UnresolvedVariant { - name: "IsIdempotent".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 20424, 20436), - }, - binding: None, - }, - Path { - body: NodeId(258), - output: PortId(260), - pattern: BranchPattern::UnresolvedVariant { - name: "IsBreaking".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 20450, 20460), - }, - binding: None, - }, - ], - output: PortId(261), - span: SourceSpan::new("src/v3/std/effects.dag", 20406, 20472), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(260), - name: "effect_shape_is_breaking".to_string(), - value: PortId(261), - params: vec![PortId(258)], - span: SourceSpan::new("src/v3/std/effects.dag", 20406, 20472), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(261), - data: LiteralBits::Bool(true), - output: PortId(263), - span: SourceSpan::new("src/v3/std/effects.dag", 23788, 23792), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(262), - data: LiteralBits::Bool(true), - output: PortId(264), - span: SourceSpan::new("src/v3/std/effects.dag", 23805, 23809), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(263), - data: LiteralBits::Bool(true), - output: PortId(265), - span: SourceSpan::new("src/v3/std/effects.dag", 23825, 23829), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(264), - data: LiteralBits::Bool(false), - output: PortId(266), - span: SourceSpan::new("src/v3/std/effects.dag", 23842, 23847), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(265), - data: LiteralBits::Bool(false), - output: PortId(267), - span: SourceSpan::new("src/v3/std/effects.dag", 23859, 23864), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(266), - data: LiteralBits::Bool(false), - output: PortId(268), - span: SourceSpan::new("src/v3/std/effects.dag", 23878, 23883), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(267), - data: LiteralBits::Bool(false), - output: PortId(269), - span: SourceSpan::new("src/v3/std/effects.dag", 23898, 23903), - lane2_workflow: None, - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(268), - input: PortId(262), - paths: vec![ - Path { - body: NodeId(261), - output: PortId(263), - pattern: BranchPattern::UnresolvedVariant { - name: "GET".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 23781, 23784), - }, - binding: None, - }, - Path { - body: NodeId(262), - output: PortId(264), - pattern: BranchPattern::UnresolvedVariant { - name: "HEAD".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 23797, 23801), - }, - binding: None, - }, - Path { - body: NodeId(263), - output: PortId(265), - pattern: BranchPattern::UnresolvedVariant { - name: "OPTIONS".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 23814, 23821), - }, - binding: None, - }, - Path { - body: NodeId(264), - output: PortId(266), - pattern: BranchPattern::UnresolvedVariant { - name: "POST".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 23834, 23838), - }, - binding: None, - }, - Path { - body: NodeId(265), - output: PortId(267), - pattern: BranchPattern::UnresolvedVariant { - name: "PUT".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 23852, 23855), - }, - binding: None, - }, - Path { - body: NodeId(266), - output: PortId(268), - pattern: BranchPattern::UnresolvedVariant { - name: "PATCH".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 23869, 23874), - }, - binding: None, - }, - Path { - body: NodeId(267), - output: PortId(269), - pattern: BranchPattern::UnresolvedVariant { - name: "DELETE".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 23888, 23894), - }, - binding: None, - }, - ], - output: PortId(270), - span: SourceSpan::new("src/v3/std/effects.dag", 23762, 23907), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(269), - name: "method_is_read".to_string(), - value: PortId(270), - params: vec![PortId(262)], - span: SourceSpan::new("src/v3/std/effects.dag", 23762, 23907), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(270), - data: LiteralBits::Bool(true), - output: PortId(272), - span: SourceSpan::new("src/v3/std/effects.dag", 23987, 23991), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(271), - data: LiteralBits::Bool(true), - output: PortId(273), - span: SourceSpan::new("src/v3/std/effects.dag", 24005, 24009), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(272), - data: LiteralBits::Bool(false), - output: PortId(274), - span: SourceSpan::new("src/v3/std/effects.dag", 24021, 24026), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(273), - data: LiteralBits::Bool(false), - output: PortId(275), - span: SourceSpan::new("src/v3/std/effects.dag", 24039, 24044), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(274), - data: LiteralBits::Bool(false), - output: PortId(276), - span: SourceSpan::new("src/v3/std/effects.dag", 24059, 24064), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(275), - data: LiteralBits::Bool(false), - output: PortId(277), - span: SourceSpan::new("src/v3/std/effects.dag", 24077, 24082), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(276), - data: LiteralBits::Bool(false), - output: PortId(278), - span: SourceSpan::new("src/v3/std/effects.dag", 24098, 24103), - lane2_workflow: None, - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(277), - input: PortId(271), - paths: vec![ - Path { - body: NodeId(270), - output: PortId(272), - pattern: BranchPattern::UnresolvedVariant { - name: "PUT".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 23980, 23983), - }, - binding: None, - }, - Path { - body: NodeId(271), - output: PortId(273), - pattern: BranchPattern::UnresolvedVariant { - name: "PATCH".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 23996, 24001), - }, - binding: None, - }, - Path { - body: NodeId(272), - output: PortId(274), - pattern: BranchPattern::UnresolvedVariant { - name: "GET".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 24014, 24017), - }, - binding: None, - }, - Path { - body: NodeId(273), - output: PortId(275), - pattern: BranchPattern::UnresolvedVariant { - name: "POST".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 24031, 24035), - }, - binding: None, - }, - Path { - body: NodeId(274), - output: PortId(276), - pattern: BranchPattern::UnresolvedVariant { - name: "DELETE".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 24049, 24055), - }, - binding: None, - }, - Path { - body: NodeId(275), - output: PortId(277), - pattern: BranchPattern::UnresolvedVariant { - name: "HEAD".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 24069, 24073), - }, - binding: None, - }, - Path { - body: NodeId(276), - output: PortId(278), - pattern: BranchPattern::UnresolvedVariant { - name: "OPTIONS".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 24087, 24094), - }, - binding: None, - }, - ], - output: PortId(279), - span: SourceSpan::new("src/v3/std/effects.dag", 23961, 24107), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(278), - name: "method_is_upsert".to_string(), - value: PortId(279), - params: vec![PortId(271)], - span: SourceSpan::new("src/v3/std/effects.dag", 23961, 24107), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(279), - data: LiteralBits::Bool(true), - output: PortId(281), - span: SourceSpan::new("src/v3/std/effects.dag", 24186, 24190), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(280), - data: LiteralBits::Bool(false), - output: PortId(282), - span: SourceSpan::new("src/v3/std/effects.dag", 24202, 24207), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(281), - data: LiteralBits::Bool(false), - output: PortId(283), - span: SourceSpan::new("src/v3/std/effects.dag", 24219, 24224), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(282), - data: LiteralBits::Bool(false), - output: PortId(284), - span: SourceSpan::new("src/v3/std/effects.dag", 24238, 24243), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(283), - data: LiteralBits::Bool(false), - output: PortId(285), - span: SourceSpan::new("src/v3/std/effects.dag", 24258, 24263), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(284), - data: LiteralBits::Bool(false), - output: PortId(286), - span: SourceSpan::new("src/v3/std/effects.dag", 24276, 24281), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(285), - data: LiteralBits::Bool(false), - output: PortId(287), - span: SourceSpan::new("src/v3/std/effects.dag", 24297, 24302), - lane2_workflow: None, - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(286), - input: PortId(280), - paths: vec![ - Path { - body: NodeId(279), - output: PortId(281), - pattern: BranchPattern::UnresolvedVariant { - name: "POST".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 24178, 24182), - }, - binding: None, - }, - Path { - body: NodeId(280), - output: PortId(282), - pattern: BranchPattern::UnresolvedVariant { - name: "GET".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 24195, 24198), - }, - binding: None, - }, - Path { - body: NodeId(281), - output: PortId(283), - pattern: BranchPattern::UnresolvedVariant { - name: "PUT".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 24212, 24215), - }, - binding: None, - }, - Path { - body: NodeId(282), - output: PortId(284), - pattern: BranchPattern::UnresolvedVariant { - name: "PATCH".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 24229, 24234), - }, - binding: None, - }, - Path { - body: NodeId(283), - output: PortId(285), - pattern: BranchPattern::UnresolvedVariant { - name: "DELETE".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 24248, 24254), - }, - binding: None, - }, - Path { - body: NodeId(284), - output: PortId(286), - pattern: BranchPattern::UnresolvedVariant { - name: "HEAD".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 24268, 24272), - }, - binding: None, - }, - Path { - body: NodeId(285), - output: PortId(287), - pattern: BranchPattern::UnresolvedVariant { - name: "OPTIONS".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 24286, 24293), - }, - binding: None, - }, - ], - output: PortId(288), - span: SourceSpan::new("src/v3/std/effects.dag", 24159, 24306), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(287), - name: "method_is_post".to_string(), - value: PortId(288), - params: vec![PortId(280)], - span: SourceSpan::new("src/v3/std/effects.dag", 24159, 24306), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(288), - data: LiteralBits::Bool(true), - output: PortId(290), - span: SourceSpan::new("src/v3/std/effects.dag", 24389, 24393), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(289), - data: LiteralBits::Bool(false), - output: PortId(291), - span: SourceSpan::new("src/v3/std/effects.dag", 24405, 24410), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(290), - data: LiteralBits::Bool(false), - output: PortId(292), - span: SourceSpan::new("src/v3/std/effects.dag", 24423, 24428), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(291), - data: LiteralBits::Bool(false), - output: PortId(293), - span: SourceSpan::new("src/v3/std/effects.dag", 24440, 24445), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(292), - data: LiteralBits::Bool(false), - output: PortId(294), - span: SourceSpan::new("src/v3/std/effects.dag", 24459, 24464), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(293), - data: LiteralBits::Bool(false), - output: PortId(295), - span: SourceSpan::new("src/v3/std/effects.dag", 24477, 24482), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(294), - data: LiteralBits::Bool(false), - output: PortId(296), - span: SourceSpan::new("src/v3/std/effects.dag", 24498, 24503), - lane2_workflow: None, - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(295), - input: PortId(289), - paths: vec![ - Path { - body: NodeId(288), - output: PortId(290), - pattern: BranchPattern::UnresolvedVariant { - name: "DELETE".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 24379, 24385), - }, - binding: None, - }, - Path { - body: NodeId(289), - output: PortId(291), - pattern: BranchPattern::UnresolvedVariant { - name: "GET".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 24398, 24401), - }, - binding: None, - }, - Path { - body: NodeId(290), - output: PortId(292), - pattern: BranchPattern::UnresolvedVariant { - name: "POST".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 24415, 24419), - }, - binding: None, - }, - Path { - body: NodeId(291), - output: PortId(293), - pattern: BranchPattern::UnresolvedVariant { - name: "PUT".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 24433, 24436), - }, - binding: None, - }, - Path { - body: NodeId(292), - output: PortId(294), - pattern: BranchPattern::UnresolvedVariant { - name: "PATCH".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 24450, 24455), - }, - binding: None, - }, - Path { - body: NodeId(293), - output: PortId(295), - pattern: BranchPattern::UnresolvedVariant { - name: "HEAD".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 24469, 24473), - }, - binding: None, - }, - Path { - body: NodeId(294), - output: PortId(296), - pattern: BranchPattern::UnresolvedVariant { - name: "OPTIONS".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 24487, 24494), - }, - binding: None, - }, - ], - output: PortId(297), - span: SourceSpan::new("src/v3/std/effects.dag", 24360, 24507), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(296), - name: "method_is_delete".to_string(), - value: PortId(297), - params: vec![PortId(289)], - span: SourceSpan::new("src/v3/std/effects.dag", 24360, 24507), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(297), - target: TransformTarget::UnresolvedFieldProject { - field_label: "count".to_string(), - }, - inputs: vec![PortId(299)], - output: PortId(300), - span: SourceSpan::new("src/v3/std/substrate.dag", 18465, 18470), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(298), - target: TransformTarget::UnresolvedFieldProject { - field_label: "measure".to_string(), - }, - inputs: vec![PortId(301)], - output: PortId(302), - span: SourceSpan::new("src/v3/std/substrate.dag", 18503, 18510), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(299), - input: PortId(298), - paths: vec![ - Path { - body: NodeId(297), - output: PortId(300), - pattern: BranchPattern::UnresolvedVariant { - name: "Cardinality".to_string(), - span: SourceSpan::new("src/v3/std/substrate.dag", 18433, 18453), - }, - binding: Some(PayloadBinding { - binding_name: "payload".to_string(), - payload_port: PortId(299), - }), - }, - Path { - body: NodeId(298), - output: PortId(302), - pattern: BranchPattern::UnresolvedVariant { - name: "Descent".to_string(), - span: SourceSpan::new("src/v3/std/substrate.dag", 18475, 18491), - }, - binding: Some(PayloadBinding { - binding_name: "payload".to_string(), - payload_port: PortId(301), - }), - }, - ], - output: PortId(303), - span: SourceSpan::new("src/v3/std/substrate.dag", 18415, 18514), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(300), - name: "loop_bound_measure".to_string(), - value: PortId(303), - params: vec![PortId(298)], - span: SourceSpan::new("src/v3/std/substrate.dag", 18415, 18514), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(301), - target: TransformTarget::ResolvedFieldProject { - field_label: "source_port".to_string(), - }, - inputs: vec![PortId(304)], - output: PortId(306), - span: SourceSpan::new("src/v3/std/algebra.dag", 7604, 7615), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(302), - target: TransformTarget::ResolvedFieldProject { - field_label: "source_port".to_string(), - }, - inputs: vec![PortId(305)], - output: PortId(307), - span: SourceSpan::new("src/v3/std/algebra.dag", 7621, 7632), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(303), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(306), PortId(307)], - output: PortId(308), - span: SourceSpan::new("src/v3/std/algebra.dag", 7602, 7632), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(304), - name: "size_variable_eq".to_string(), - value: PortId(308), - params: vec![PortId(304), PortId(305)], - span: SourceSpan::new("src/v3/std/algebra.dag", 7602, 7632), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(305), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(310), - span: SourceSpan::new("src/v3/std/algebra.dag", 10300, 10305), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(306), - target: TransformTarget::Callable(DeclarationId(920)), - inputs: vec![PortId(310), PortId(309)], - output: PortId(311), - span: SourceSpan::new("src/v3/std/algebra.dag", 10291, 10322), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(307), - name: "dominate_scan_init".to_string(), - value: PortId(311), - params: vec![PortId(309)], - span: SourceSpan::new("src/v3/std/algebra.dag", 10291, 10322), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(308), - target: TransformTarget::Callable(DeclarationId(2226)), - inputs: vec![PortId(312)], - output: PortId(314), - span: SourceSpan::new("src/v3/std/algebra.dag", 11495, 11507), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(309), - target: TransformTarget::Callable(DeclarationId(2228)), - inputs: vec![PortId(314)], - output: PortId(315), - span: SourceSpan::new("src/v3/std/algebra.dag", 11488, 11535), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(310), - target: TransformTarget::Callable(DeclarationId(2172)), - inputs: vec![PortId(312), PortId(313), PortId(315)], - output: PortId(316), - span: SourceSpan::new("src/v3/std/algebra.dag", 11149, 11539), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(311), - name: "two_terms".to_string(), - value: PortId(316), - params: vec![PortId(312), PortId(313)], - span: SourceSpan::new("src/v3/std/algebra.dag", 11149, 11539), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(312), - target: TransformTarget::Callable(DeclarationId(2174)), - inputs: vec![PortId(317), PortId(318), PortId(319)], - output: PortId(320), - span: SourceSpan::new("src/v3/std/algebra.dag", 11670, 11726), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(313), - name: "many_terms".to_string(), - value: PortId(320), - params: vec![PortId(317), PortId(318), PortId(319)], - span: SourceSpan::new("src/v3/std/algebra.dag", 11670, 11726), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(314), - target: TransformTarget::Callable(DeclarationId(2229)), - inputs: vec![PortId(321)], - output: PortId(322), - span: SourceSpan::new("src/v3/std/algebra.dag", 11795, 11810), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(315), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(323), - span: SourceSpan::new("src/v3/std/algebra.dag", 11826, 11831), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(316), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(325), - span: SourceSpan::new("src/v3/std/algebra.dag", 11847, 11852), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(317), - input: PortId(322), - paths: vec![ - Path { - body: NodeId(315), - output: PortId(323), - pattern: BranchPattern::UnresolvedVariant { - name: "Empty".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 11817, 11822), - }, - binding: None, - }, - Path { - body: NodeId(316), - output: PortId(325), - pattern: BranchPattern::UnresolvedVariant { - name: "Cons".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 11836, 11843), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(324), - }), - }, - ], - output: PortId(326), - span: SourceSpan::new("src/v3/std/algebra.dag", 11789, 11856), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(318), - name: "reject_all_symbolic_costs".to_string(), - value: PortId(326), - params: vec![PortId(321)], - span: SourceSpan::new("src/v3/std/algebra.dag", 11789, 11856), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(319), - data: LiteralBits::Int("2".to_string()), - output: PortId(328), - span: SourceSpan::new("src/v3/std/algebra.dag", 11941, 11942), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(320), - target: TransformTarget::UnresolvedFieldProject { - field_label: "previous".to_string(), - }, - inputs: vec![PortId(329)], - output: PortId(330), - span: SourceSpan::new("src/v3/std/algebra.dag", 11994, 12002), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(321), - target: TransformTarget::Callable(DeclarationId(927)), - inputs: vec![PortId(330)], - output: PortId(331), - span: SourceSpan::new("src/v3/std/algebra.dag", 11975, 12003), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(322), - data: LiteralBits::Int("1".to_string()), - output: PortId(332), - span: SourceSpan::new("src/v3/std/algebra.dag", 12006, 12007), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(323), - target: TransformTarget::Operator(OperatorKind::Arithmetic(ArithmeticOp::Add)), - inputs: vec![PortId(331), PortId(332)], - output: PortId(333), - span: SourceSpan::new("src/v3/std/algebra.dag", 11975, 12007), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(324), - input: PortId(327), - paths: vec![ - Path { - body: NodeId(319), - output: PortId(328), - pattern: BranchPattern::UnresolvedVariant { - name: "DegreeTwo".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 11928, 11937), - }, - binding: None, - }, - Path { - body: NodeId(323), - output: PortId(333), - pattern: BranchPattern::UnresolvedVariant { - name: "DegreeSuccessor".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 11947, 11971), - }, - binding: Some(PayloadBinding { - binding_name: "payload".to_string(), - payload_port: PortId(329), - }), - }, - ], - output: PortId(334), - span: SourceSpan::new("src/v3/std/algebra.dag", 11909, 12011), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Loop(LoopNode { - id: NodeId(325), - source: PortId(327), - init: PortId(327), - body: NodeId(324), - bound: LoopBound::Cardinality { count: PortId(327) }, - output: PortId(335), - span: SourceSpan::new("src/v3/std/algebra.dag", 11909, 12011), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(326), - name: "degree_raw".to_string(), - value: PortId(335), - params: vec![PortId(327)], - span: SourceSpan::new("src/v3/std/algebra.dag", 11909, 12011), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(327), - target: TransformTarget::Callable(DeclarationId(924)), - inputs: vec![PortId(336), PortId(337)], - output: PortId(338), - span: SourceSpan::new("src/v3/std/algebra.dag", 12333, 12348), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(328), - target: TransformTarget::Callable(DeclarationId(2213)), - inputs: vec![PortId(338)], - output: PortId(339), - span: SourceSpan::new("src/v3/std/algebra.dag", 12325, 12349), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(329), - target: TransformTarget::Callable(DeclarationId(940)), - inputs: vec![PortId(339)], - output: PortId(340), - span: SourceSpan::new("src/v3/std/algebra.dag", 12315, 12350), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(330), - name: "sequential".to_string(), - value: PortId(340), - params: vec![PortId(336), PortId(337)], - span: SourceSpan::new("src/v3/std/algebra.dag", 12315, 12350), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(331), - target: TransformTarget::Callable(DeclarationId(924)), - inputs: vec![PortId(341), PortId(342)], - output: PortId(343), - span: SourceSpan::new("src/v3/std/algebra.dag", 12630, 12652), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(332), - target: TransformTarget::Callable(DeclarationId(2211)), - inputs: vec![PortId(343)], - output: PortId(344), - span: SourceSpan::new("src/v3/std/algebra.dag", 12618, 12653), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(333), - target: TransformTarget::Callable(DeclarationId(940)), - inputs: vec![PortId(344)], - output: PortId(345), - span: SourceSpan::new("src/v3/std/algebra.dag", 12608, 12654), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(334), - name: "iterate".to_string(), - value: PortId(345), - params: vec![PortId(341), PortId(342)], - span: SourceSpan::new("src/v3/std/algebra.dag", 12608, 12654), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(335), - target: TransformTarget::Callable(DeclarationId(933)), - inputs: vec![PortId(347), PortId(346)], - output: PortId(348), - span: SourceSpan::new("src/v3/std/algebra.dag", 13598, 13623), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(336), - target: TransformTarget::Callable(DeclarationId(931)), - inputs: vec![PortId(346), PortId(347)], - output: PortId(349), - span: SourceSpan::new("src/v3/std/algebra.dag", 13654, 13681), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(337), - input: PortId(348), - paths: vec![ - Path { - body: NodeId(337), - output: PortId(347), - pattern: BranchPattern::UnresolvedVariant { - name: "True".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 13633, 13642), - }, - binding: None, - }, - Path { - body: NodeId(336), - output: PortId(349), - pattern: BranchPattern::UnresolvedVariant { - name: "False".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 13654, 13681), - }, - binding: None, - }, - ], - output: PortId(350), - span: SourceSpan::new("src/v3/std/algebra.dag", 13595, 13681), - emit_participation: None, - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(338), - name: "max_path_step".to_string(), - value: PortId(350), - params: vec![PortId(346), PortId(347)], - span: SourceSpan::new("src/v3/std/algebra.dag", 13595, 13681), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(339), - target: TransformTarget::Callable(DeclarationId(933)), - inputs: vec![PortId(351), PortId(352)], - output: PortId(353), - span: SourceSpan::new("src/v3/std/algebra.dag", 13765, 13790), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(340), - target: TransformTarget::Callable(DeclarationId(928)), - inputs: vec![PortId(351), PortId(352)], - output: PortId(354), - span: SourceSpan::new("src/v3/std/algebra.dag", 13815, 13841), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(341), - input: PortId(353), - paths: vec![ - Path { - body: NodeId(341), - output: PortId(351), - pattern: BranchPattern::UnresolvedVariant { - name: "True".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 13800, 13803), - }, - binding: None, - }, - Path { - body: NodeId(340), - output: PortId(354), - pattern: BranchPattern::UnresolvedVariant { - name: "False".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 13815, 13841), - }, - binding: None, - }, - ], - output: PortId(355), - span: SourceSpan::new("src/v3/std/algebra.dag", 13762, 13841), - emit_participation: None, - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(342), - name: "keep_or_sum".to_string(), - value: PortId(355), - params: vec![PortId(351), PortId(352)], - span: SourceSpan::new("src/v3/std/algebra.dag", 13762, 13841), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(343), - data: LiteralBits::Int("0".to_string()), - output: PortId(357), - span: SourceSpan::new("src/v3/std/algebra.dag", 14227, 14228), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(344), - target: TransformTarget::Callable(DeclarationId(2207)), - inputs: vec![PortId(357)], - output: PortId(358), - span: SourceSpan::new("src/v3/std/algebra.dag", 14214, 14229), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(345), - target: TransformTarget::Callable(DeclarationId(2231)), - inputs: vec![PortId(356), PortId(358)], - output: PortId(359), - span: SourceSpan::new("src/v3/std/algebra.dag", 14202, 14245), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(346), - name: "max_path".to_string(), - value: PortId(359), - params: vec![PortId(356)], - span: SourceSpan::new("src/v3/std/algebra.dag", 14202, 14245), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(347), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(363), - span: SourceSpan::new("src/v3/std/algebra.dag", 15204, 15208), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(348), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(366), - span: SourceSpan::new("src/v3/std/algebra.dag", 15275, 15279), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(349), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(368), - span: SourceSpan::new("src/v3/std/algebra.dag", 15306, 15311), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(350), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(370), - span: SourceSpan::new("src/v3/std/algebra.dag", 15337, 15342), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(351), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(372), - span: SourceSpan::new("src/v3/std/algebra.dag", 15372, 15377), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(352), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(374), - span: SourceSpan::new("src/v3/std/algebra.dag", 15404, 15409), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(353), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(376), - span: SourceSpan::new("src/v3/std/algebra.dag", 15432, 15437), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(354), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(378), - span: SourceSpan::new("src/v3/std/algebra.dag", 15460, 15465), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(355), - input: PortId(361), - paths: vec![ - Path { - body: NodeId(348), - output: PortId(366), - pattern: BranchPattern::UnresolvedVariant { - name: "ConstantCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 15256, 15271), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(365), - }), - }, - Path { - body: NodeId(349), - output: PortId(368), - pattern: BranchPattern::UnresolvedVariant { - name: "UnknownCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 15288, 15302), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(367), - }), - }, - Path { - body: NodeId(350), - output: PortId(370), - pattern: BranchPattern::UnresolvedVariant { - name: "LinearCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 15320, 15333), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(369), - }), - }, - Path { - body: NodeId(351), - output: PortId(372), - pattern: BranchPattern::UnresolvedVariant { - name: "PolynomialCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 15351, 15368), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(371), - }), - }, - Path { - body: NodeId(352), - output: PortId(374), - pattern: BranchPattern::UnresolvedVariant { - name: "ProductCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 15386, 15400), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(373), - }), - }, - Path { - body: NodeId(353), - output: PortId(376), - pattern: BranchPattern::UnresolvedVariant { - name: "SumCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 15418, 15428), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(375), - }), - }, - Path { - body: NodeId(354), - output: PortId(378), - pattern: BranchPattern::UnresolvedVariant { - name: "LogCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 15446, 15456), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(377), - }), - }, - ], - output: PortId(379), - span: SourceSpan::new("src/v3/std/algebra.dag", 15238, 15473), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(356), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(382), - span: SourceSpan::new("src/v3/std/algebra.dag", 15539, 15543), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(357), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(384), - span: SourceSpan::new("src/v3/std/algebra.dag", 15566, 15570), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(358), - target: TransformTarget::Callable(DeclarationId(934)), - inputs: vec![PortId(380), PortId(385)], - output: PortId(386), - span: SourceSpan::new("src/v3/std/algebra.dag", 15597, 15623), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(359), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(388), - span: SourceSpan::new("src/v3/std/algebra.dag", 15669, 15674), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(360), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(390), - span: SourceSpan::new("src/v3/std/algebra.dag", 15701, 15706), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(361), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(392), - span: SourceSpan::new("src/v3/std/algebra.dag", 15733, 15738), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(362), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(394), - span: SourceSpan::new("src/v3/std/algebra.dag", 15761, 15766), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(363), - input: PortId(361), - paths: vec![ - Path { - body: NodeId(356), - output: PortId(382), - pattern: BranchPattern::UnresolvedVariant { - name: "ConstantCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 15520, 15535), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(381), - }), - }, - Path { - body: NodeId(357), - output: PortId(384), - pattern: BranchPattern::UnresolvedVariant { - name: "LogCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 15552, 15562), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(383), - }), - }, - Path { - body: NodeId(358), - output: PortId(386), - pattern: BranchPattern::UnresolvedVariant { - name: "LinearCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 15579, 15593), - }, - binding: Some(PayloadBinding { - binding_name: "vb".to_string(), - payload_port: PortId(385), - }), - }, - Path { - body: NodeId(359), - output: PortId(388), - pattern: BranchPattern::UnresolvedVariant { - name: "PolynomialCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 15632, 15655), - }, - binding: Some(PayloadBinding { - binding_name: "payload".to_string(), - payload_port: PortId(387), - }), - }, - Path { - body: NodeId(360), - output: PortId(390), - pattern: BranchPattern::UnresolvedVariant { - name: "UnknownCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 15683, 15697), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(389), - }), - }, - Path { - body: NodeId(361), - output: PortId(392), - pattern: BranchPattern::UnresolvedVariant { - name: "ProductCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 15715, 15729), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(391), - }), - }, - Path { - body: NodeId(362), - output: PortId(394), - pattern: BranchPattern::UnresolvedVariant { - name: "SumCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 15747, 15757), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(393), - }), - }, - ], - output: PortId(395), - span: SourceSpan::new("src/v3/std/algebra.dag", 15502, 15774), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(364), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(398), - span: SourceSpan::new("src/v3/std/algebra.dag", 15844, 15848), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(365), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(400), - span: SourceSpan::new("src/v3/std/algebra.dag", 15871, 15875), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(366), - target: TransformTarget::UnresolvedFieldProject { - field_label: "var".to_string(), - }, - inputs: vec![PortId(396)], - output: PortId(402), - span: SourceSpan::new("src/v3/std/algebra.dag", 15934, 15937), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(367), - target: TransformTarget::Callable(DeclarationId(934)), - inputs: vec![PortId(402), PortId(401)], - output: PortId(403), - span: SourceSpan::new("src/v3/std/algebra.dag", 15912, 15942), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(368), - target: TransformTarget::UnresolvedFieldProject { - field_label: "var".to_string(), - }, - inputs: vec![PortId(396)], - output: PortId(405), - span: SourceSpan::new("src/v3/std/algebra.dag", 16008, 16011), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(369), - target: TransformTarget::UnresolvedFieldProject { - field_label: "var".to_string(), - }, - inputs: vec![PortId(404)], - output: PortId(406), - span: SourceSpan::new("src/v3/std/algebra.dag", 16016, 16019), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(370), - target: TransformTarget::Callable(DeclarationId(934)), - inputs: vec![PortId(405), PortId(406)], - output: PortId(407), - span: SourceSpan::new("src/v3/std/algebra.dag", 15986, 16020), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(371), - target: TransformTarget::UnresolvedFieldProject { - field_label: "degree".to_string(), - }, - inputs: vec![PortId(396)], - output: PortId(408), - span: SourceSpan::new("src/v3/std/algebra.dag", 16052, 16058), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(372), - target: TransformTarget::Callable(DeclarationId(927)), - inputs: vec![PortId(408)], - output: PortId(409), - span: SourceSpan::new("src/v3/std/algebra.dag", 16038, 16059), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(373), - target: TransformTarget::UnresolvedFieldProject { - field_label: "degree".to_string(), - }, - inputs: vec![PortId(404)], - output: PortId(410), - span: SourceSpan::new("src/v3/std/algebra.dag", 16077, 16083), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(374), - target: TransformTarget::Callable(DeclarationId(927)), - inputs: vec![PortId(410)], - output: PortId(411), - span: SourceSpan::new("src/v3/std/algebra.dag", 16063, 16084), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(375), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Ge)), - inputs: vec![PortId(409), PortId(411)], - output: PortId(412), - span: SourceSpan::new("src/v3/std/algebra.dag", 16038, 16084), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(376), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(413), - span: SourceSpan::new("src/v3/std/algebra.dag", 16112, 16117), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(377), - input: PortId(407), - paths: vec![ - Path { - body: NodeId(375), - output: PortId(412), - pattern: BranchPattern::UnresolvedVariant { - name: "True".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 16038, 16084), - }, - binding: None, - }, - Path { - body: NodeId(376), - output: PortId(413), - pattern: BranchPattern::UnresolvedVariant { - name: "False".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 16112, 16117), - }, - binding: None, - }, - ], - output: PortId(414), - span: SourceSpan::new("src/v3/std/algebra.dag", 15983, 16117), - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(378), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(416), - span: SourceSpan::new("src/v3/std/algebra.dag", 16144, 16149), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(379), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(418), - span: SourceSpan::new("src/v3/std/algebra.dag", 16176, 16181), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(380), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(420), - span: SourceSpan::new("src/v3/std/algebra.dag", 16204, 16209), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(381), - input: PortId(361), - paths: vec![ - Path { - body: NodeId(364), - output: PortId(398), - pattern: BranchPattern::UnresolvedVariant { - name: "ConstantCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 15825, 15840), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(397), - }), - }, - Path { - body: NodeId(365), - output: PortId(400), - pattern: BranchPattern::UnresolvedVariant { - name: "LogCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 15857, 15867), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(399), - }), - }, - Path { - body: NodeId(367), - output: PortId(403), - pattern: BranchPattern::UnresolvedVariant { - name: "LinearCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 15884, 15898), - }, - binding: Some(PayloadBinding { - binding_name: "vb".to_string(), - payload_port: PortId(401), - }), - }, - Path { - body: NodeId(377), - output: PortId(414), - pattern: BranchPattern::UnresolvedVariant { - name: "PolynomialCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 15951, 15969), - }, - binding: Some(PayloadBinding { - binding_name: "pb".to_string(), - payload_port: PortId(404), - }), - }, - Path { - body: NodeId(378), - output: PortId(416), - pattern: BranchPattern::UnresolvedVariant { - name: "UnknownCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 16126, 16140), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(415), - }), - }, - Path { - body: NodeId(379), - output: PortId(418), - pattern: BranchPattern::UnresolvedVariant { - name: "ProductCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 16158, 16172), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(417), - }), - }, - Path { - body: NodeId(380), - output: PortId(420), - pattern: BranchPattern::UnresolvedVariant { - name: "SumCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 16190, 16200), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(419), - }), - }, - ], - output: PortId(421), - span: SourceSpan::new("src/v3/std/algebra.dag", 15807, 16217), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(382), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(424), - span: SourceSpan::new("src/v3/std/algebra.dag", 16280, 16284), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(383), - target: TransformTarget::Callable(DeclarationId(934)), - inputs: vec![PortId(422), PortId(425)], - output: PortId(426), - span: SourceSpan::new("src/v3/std/algebra.dag", 16308, 16334), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(384), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(428), - span: SourceSpan::new("src/v3/std/algebra.dag", 16360, 16365), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(385), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(430), - span: SourceSpan::new("src/v3/std/algebra.dag", 16395, 16400), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(386), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(432), - span: SourceSpan::new("src/v3/std/algebra.dag", 16427, 16432), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(387), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(434), - span: SourceSpan::new("src/v3/std/algebra.dag", 16455, 16460), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(388), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(436), - span: SourceSpan::new("src/v3/std/algebra.dag", 16487, 16492), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(389), - input: PortId(361), - paths: vec![ - Path { - body: NodeId(382), - output: PortId(424), - pattern: BranchPattern::UnresolvedVariant { - name: "ConstantCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 16261, 16276), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(423), - }), - }, - Path { - body: NodeId(383), - output: PortId(426), - pattern: BranchPattern::UnresolvedVariant { - name: "LogCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 16293, 16304), - }, - binding: Some(PayloadBinding { - binding_name: "vb".to_string(), - payload_port: PortId(425), - }), - }, - Path { - body: NodeId(384), - output: PortId(428), - pattern: BranchPattern::UnresolvedVariant { - name: "LinearCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 16343, 16356), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(427), - }), - }, - Path { - body: NodeId(385), - output: PortId(430), - pattern: BranchPattern::UnresolvedVariant { - name: "PolynomialCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 16374, 16391), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(429), - }), - }, - Path { - body: NodeId(386), - output: PortId(432), - pattern: BranchPattern::UnresolvedVariant { - name: "ProductCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 16409, 16423), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(431), - }), - }, - Path { - body: NodeId(387), - output: PortId(434), - pattern: BranchPattern::UnresolvedVariant { - name: "SumCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 16441, 16451), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(433), - }), - }, - Path { - body: NodeId(388), - output: PortId(436), - pattern: BranchPattern::UnresolvedVariant { - name: "UnknownCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 16469, 16483), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(435), - }), - }, - ], - output: PortId(437), - span: SourceSpan::new("src/v3/std/algebra.dag", 16243, 16500), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(390), - target: TransformTarget::Callable(DeclarationId(941)), - inputs: vec![PortId(438)], - output: PortId(439), - span: SourceSpan::new("src/v3/std/algebra.dag", 16927, 16945), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(391), - target: TransformTarget::Callable(DeclarationId(921)), - inputs: vec![PortId(361)], - output: PortId(440), - span: SourceSpan::new("src/v3/std/algebra.dag", 16957, 16978), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(392), - target: TransformTarget::Callable(DeclarationId(2233)), - inputs: vec![PortId(439), PortId(440)], - output: PortId(441), - span: SourceSpan::new("src/v3/std/algebra.dag", 16911, 17021), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(393), - target: TransformTarget::Callable(DeclarationId(957)), - inputs: vec![PortId(441)], - output: PortId(442), - span: SourceSpan::new("src/v3/std/algebra.dag", 16893, 17029), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(394), - target: TransformTarget::Callable(DeclarationId(941)), - inputs: vec![PortId(443)], - output: PortId(444), - span: SourceSpan::new("src/v3/std/algebra.dag", 17092, 17110), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(395), - target: TransformTarget::Callable(DeclarationId(921)), - inputs: vec![PortId(361)], - output: PortId(445), - span: SourceSpan::new("src/v3/std/algebra.dag", 17122, 17143), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(396), - target: TransformTarget::Callable(DeclarationId(2235)), - inputs: vec![PortId(444), PortId(445)], - output: PortId(446), - span: SourceSpan::new("src/v3/std/algebra.dag", 17076, 17186), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(397), - target: TransformTarget::Callable(DeclarationId(957)), - inputs: vec![PortId(446)], - output: PortId(447), - span: SourceSpan::new("src/v3/std/algebra.dag", 17058, 17194), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(398), - input: PortId(360), - paths: vec![ - Path { - body: NodeId(347), - output: PortId(363), - pattern: BranchPattern::UnresolvedVariant { - name: "UnknownCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 15186, 15200), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(362), - }), - }, - Path { - body: NodeId(355), - output: PortId(379), - pattern: BranchPattern::UnresolvedVariant { - name: "ConstantCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 15213, 15228), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(364), - }), - }, - Path { - body: NodeId(363), - output: PortId(395), - pattern: BranchPattern::UnresolvedVariant { - name: "LinearCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 15478, 15492), - }, - binding: Some(PayloadBinding { - binding_name: "va".to_string(), - payload_port: PortId(380), - }), - }, - Path { - body: NodeId(381), - output: PortId(421), - pattern: BranchPattern::UnresolvedVariant { - name: "PolynomialCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 15779, 15797), - }, - binding: Some(PayloadBinding { - binding_name: "pa".to_string(), - payload_port: PortId(396), - }), - }, - Path { - body: NodeId(389), - output: PortId(437), - pattern: BranchPattern::UnresolvedVariant { - name: "LogCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 16222, 16233), - }, - binding: Some(PayloadBinding { - binding_name: "va".to_string(), - payload_port: PortId(422), - }), - }, - Path { - body: NodeId(393), - output: PortId(442), - pattern: BranchPattern::UnresolvedVariant { - name: "ProductCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 16865, 16883), - }, - binding: Some(PayloadBinding { - binding_name: "terms".to_string(), - payload_port: PortId(438), - }), - }, - Path { - body: NodeId(397), - output: PortId(447), - pattern: BranchPattern::UnresolvedVariant { - name: "SumCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 17034, 17048), - }, - binding: Some(PayloadBinding { - binding_name: "terms".to_string(), - payload_port: PortId(443), - }), - }, - ], - output: PortId(448), - span: SourceSpan::new("src/v3/std/algebra.dag", 15172, 17198), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(399), - name: "dominates".to_string(), - value: PortId(448), - params: vec![PortId(360), PortId(361)], - span: SourceSpan::new("src/v3/std/algebra.dag", 15172, 17198), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(400), - target: TransformTarget::Callable(DeclarationId(917)), - inputs: vec![PortId(449), PortId(450)], - output: PortId(451), - span: SourceSpan::new("src/v3/std/algebra.dag", 17268, 17290), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(401), - name: "same_size_variable".to_string(), - value: PortId(451), - params: vec![PortId(449), PortId(450)], - span: SourceSpan::new("src/v3/std/algebra.dag", 17268, 17290), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(402), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(454), - span: SourceSpan::new("src/v3/std/algebra.dag", 18426, 18430), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(403), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(455), - span: SourceSpan::new("src/v3/std/algebra.dag", 18495, 18500), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(404), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(456), - span: SourceSpan::new("src/v3/std/algebra.dag", 18529, 18533), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(405), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(458), - span: SourceSpan::new("src/v3/std/algebra.dag", 18564, 18568), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(406), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(459), - span: SourceSpan::new("src/v3/std/algebra.dag", 18595, 18599), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(407), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(460), - span: SourceSpan::new("src/v3/std/algebra.dag", 18629, 18633), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(408), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(461), - span: SourceSpan::new("src/v3/std/algebra.dag", 18657, 18661), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(409), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(462), - span: SourceSpan::new("src/v3/std/algebra.dag", 18682, 18686), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(410), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(463), - span: SourceSpan::new("src/v3/std/algebra.dag", 18712, 18716), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(411), - input: PortId(453), - paths: vec![ - Path { - body: NodeId(403), - output: PortId(455), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassUnknown".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 18479, 18491), - }, - binding: None, - }, - Path { - body: NodeId(404), - output: PortId(456), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassExponential".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 18509, 18525), - }, - binding: None, - }, - Path { - body: NodeId(405), - output: PortId(458), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassPolynomial".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 18542, 18560), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(457), - }), - }, - Path { - body: NodeId(406), - output: PortId(459), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassQuadratic".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 18577, 18591), - }, - binding: None, - }, - Path { - body: NodeId(407), - output: PortId(460), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassLinearithmic".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 18608, 18625), - }, - binding: None, - }, - Path { - body: NodeId(408), - output: PortId(461), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassLinear".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 18642, 18653), - }, - binding: None, - }, - Path { - body: NodeId(409), - output: PortId(462), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassLog".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 18670, 18678), - }, - binding: None, - }, - Path { - body: NodeId(410), - output: PortId(463), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassConstant".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 18695, 18708), - }, - binding: None, - }, - ], - output: PortId(464), - span: SourceSpan::new("src/v3/std/algebra.dag", 18461, 18724), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(412), - target: TransformTarget::UnresolvedFieldProject { - field_label: "degree".to_string(), - }, - inputs: vec![PortId(465)], - output: PortId(466), - span: SourceSpan::new("src/v3/std/algebra.dag", 18747, 18758), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(413), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(467), - span: SourceSpan::new("src/v3/std/algebra.dag", 18804, 18809), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(414), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(468), - span: SourceSpan::new("src/v3/std/algebra.dag", 18838, 18843), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(415), - target: TransformTarget::UnresolvedFieldProject { - field_label: "degree".to_string(), - }, - inputs: vec![PortId(469)], - output: PortId(470), - span: SourceSpan::new("src/v3/std/algebra.dag", 18870, 18881), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(416), - target: TransformTarget::Callable(DeclarationId(1166)), - inputs: vec![PortId(466)], - output: PortId(471), - span: SourceSpan::new("src/v3/std/algebra.dag", 18897, 18924), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(417), - target: TransformTarget::Callable(DeclarationId(1166)), - inputs: vec![PortId(470)], - output: PortId(472), - span: SourceSpan::new("src/v3/std/algebra.dag", 18928, 18955), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(418), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Ge)), - inputs: vec![PortId(471), PortId(472)], - output: PortId(473), - span: SourceSpan::new("src/v3/std/algebra.dag", 18897, 18955), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(419), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(474), - span: SourceSpan::new("src/v3/std/algebra.dag", 18982, 18986), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(420), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(475), - span: SourceSpan::new("src/v3/std/algebra.dag", 19016, 19020), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(421), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(476), - span: SourceSpan::new("src/v3/std/algebra.dag", 19044, 19048), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(422), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(477), - span: SourceSpan::new("src/v3/std/algebra.dag", 19069, 19073), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(423), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(478), - span: SourceSpan::new("src/v3/std/algebra.dag", 19099, 19103), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(424), - input: PortId(453), - paths: vec![ - Path { - body: NodeId(413), - output: PortId(467), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassUnknown".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 18788, 18800), - }, - binding: None, - }, - Path { - body: NodeId(414), - output: PortId(468), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassExponential".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 18818, 18834), - }, - binding: None, - }, - Path { - body: NodeId(418), - output: PortId(473), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassPolynomial".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 18852, 18883), - }, - binding: Some(PayloadBinding { - binding_name: "d_b".to_string(), - payload_port: PortId(469), - }), - }, - Path { - body: NodeId(419), - output: PortId(474), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassQuadratic".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 18964, 18978), - }, - binding: None, - }, - Path { - body: NodeId(420), - output: PortId(475), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassLinearithmic".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 18995, 19012), - }, - binding: None, - }, - Path { - body: NodeId(421), - output: PortId(476), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassLinear".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19029, 19040), - }, - binding: None, - }, - Path { - body: NodeId(422), - output: PortId(477), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassLog".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19057, 19065), - }, - binding: None, - }, - Path { - body: NodeId(423), - output: PortId(478), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassConstant".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19082, 19095), - }, - binding: None, - }, - ], - output: PortId(479), - span: SourceSpan::new("src/v3/std/algebra.dag", 18770, 19111), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(425), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(480), - span: SourceSpan::new("src/v3/std/algebra.dag", 19175, 19179), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(426), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(481), - span: SourceSpan::new("src/v3/std/algebra.dag", 19200, 19204), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(427), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(482), - span: SourceSpan::new("src/v3/std/algebra.dag", 19228, 19232), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(428), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(483), - span: SourceSpan::new("src/v3/std/algebra.dag", 19262, 19266), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(429), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(484), - span: SourceSpan::new("src/v3/std/algebra.dag", 19293, 19297), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(430), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(486), - span: SourceSpan::new("src/v3/std/algebra.dag", 19328, 19333), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(431), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(487), - span: SourceSpan::new("src/v3/std/algebra.dag", 19362, 19367), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(432), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(488), - span: SourceSpan::new("src/v3/std/algebra.dag", 19392, 19397), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(433), - input: PortId(453), - paths: vec![ - Path { - body: NodeId(425), - output: PortId(480), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassConstant".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19158, 19171), - }, - binding: None, - }, - Path { - body: NodeId(426), - output: PortId(481), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassLog".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19188, 19196), - }, - binding: None, - }, - Path { - body: NodeId(427), - output: PortId(482), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassLinear".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19213, 19224), - }, - binding: None, - }, - Path { - body: NodeId(428), - output: PortId(483), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassLinearithmic".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19241, 19258), - }, - binding: None, - }, - Path { - body: NodeId(429), - output: PortId(484), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassQuadratic".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19275, 19289), - }, - binding: None, - }, - Path { - body: NodeId(430), - output: PortId(486), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassPolynomial".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19306, 19324), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(485), - }), - }, - Path { - body: NodeId(431), - output: PortId(487), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassExponential".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19342, 19358), - }, - binding: None, - }, - Path { - body: NodeId(432), - output: PortId(488), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassUnknown".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19376, 19388), - }, - binding: None, - }, - ], - output: PortId(489), - span: SourceSpan::new("src/v3/std/algebra.dag", 19140, 19405), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(434), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(490), - span: SourceSpan::new("src/v3/std/algebra.dag", 19472, 19476), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(435), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(491), - span: SourceSpan::new("src/v3/std/algebra.dag", 19497, 19501), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(436), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(492), - span: SourceSpan::new("src/v3/std/algebra.dag", 19525, 19529), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(437), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(493), - span: SourceSpan::new("src/v3/std/algebra.dag", 19559, 19563), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(438), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(494), - span: SourceSpan::new("src/v3/std/algebra.dag", 19590, 19595), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(439), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(496), - span: SourceSpan::new("src/v3/std/algebra.dag", 19626, 19631), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(440), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(497), - span: SourceSpan::new("src/v3/std/algebra.dag", 19660, 19665), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(441), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(498), - span: SourceSpan::new("src/v3/std/algebra.dag", 19690, 19695), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(442), - input: PortId(453), - paths: vec![ - Path { - body: NodeId(434), - output: PortId(490), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassConstant".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19455, 19468), - }, - binding: None, - }, - Path { - body: NodeId(435), - output: PortId(491), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassLog".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19485, 19493), - }, - binding: None, - }, - Path { - body: NodeId(436), - output: PortId(492), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassLinear".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19510, 19521), - }, - binding: None, - }, - Path { - body: NodeId(437), - output: PortId(493), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassLinearithmic".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19538, 19555), - }, - binding: None, - }, - Path { - body: NodeId(438), - output: PortId(494), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassQuadratic".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19572, 19586), - }, - binding: None, - }, - Path { - body: NodeId(439), - output: PortId(496), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassPolynomial".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19604, 19622), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(495), - }), - }, - Path { - body: NodeId(440), - output: PortId(497), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassExponential".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19640, 19656), - }, - binding: None, - }, - Path { - body: NodeId(441), - output: PortId(498), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassUnknown".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19674, 19686), - }, - binding: None, - }, - ], - output: PortId(499), - span: SourceSpan::new("src/v3/std/algebra.dag", 19437, 19703), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(443), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(500), - span: SourceSpan::new("src/v3/std/algebra.dag", 19764, 19768), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(444), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(501), - span: SourceSpan::new("src/v3/std/algebra.dag", 19789, 19793), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(445), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(502), - span: SourceSpan::new("src/v3/std/algebra.dag", 19817, 19821), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(446), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(503), - span: SourceSpan::new("src/v3/std/algebra.dag", 19851, 19856), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(447), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(504), - span: SourceSpan::new("src/v3/std/algebra.dag", 19883, 19888), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(448), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(506), - span: SourceSpan::new("src/v3/std/algebra.dag", 19919, 19924), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(449), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(507), - span: SourceSpan::new("src/v3/std/algebra.dag", 19953, 19958), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(450), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(508), - span: SourceSpan::new("src/v3/std/algebra.dag", 19983, 19988), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(451), - input: PortId(453), - paths: vec![ - Path { - body: NodeId(443), - output: PortId(500), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassConstant".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19747, 19760), - }, - binding: None, - }, - Path { - body: NodeId(444), - output: PortId(501), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassLog".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19777, 19785), - }, - binding: None, - }, - Path { - body: NodeId(445), - output: PortId(502), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassLinear".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19802, 19813), - }, - binding: None, - }, - Path { - body: NodeId(446), - output: PortId(503), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassLinearithmic".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19830, 19847), - }, - binding: None, - }, - Path { - body: NodeId(447), - output: PortId(504), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassQuadratic".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19865, 19879), - }, - binding: None, - }, - Path { - body: NodeId(448), - output: PortId(506), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassPolynomial".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19897, 19915), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(505), - }), - }, - Path { - body: NodeId(449), - output: PortId(507), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassExponential".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19933, 19949), - }, - binding: None, - }, - Path { - body: NodeId(450), - output: PortId(508), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassUnknown".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19967, 19979), - }, - binding: None, - }, - ], - output: PortId(509), - span: SourceSpan::new("src/v3/std/algebra.dag", 19729, 19996), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(452), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(510), - span: SourceSpan::new("src/v3/std/algebra.dag", 20054, 20058), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(453), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(511), - span: SourceSpan::new("src/v3/std/algebra.dag", 20079, 20083), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(454), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(512), - span: SourceSpan::new("src/v3/std/algebra.dag", 20107, 20112), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(455), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(513), - span: SourceSpan::new("src/v3/std/algebra.dag", 20142, 20147), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(456), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(514), - span: SourceSpan::new("src/v3/std/algebra.dag", 20174, 20179), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(457), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(516), - span: SourceSpan::new("src/v3/std/algebra.dag", 20210, 20215), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(458), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(517), - span: SourceSpan::new("src/v3/std/algebra.dag", 20244, 20249), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(459), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(518), - span: SourceSpan::new("src/v3/std/algebra.dag", 20274, 20279), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(460), - input: PortId(453), - paths: vec![ - Path { - body: NodeId(452), - output: PortId(510), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassConstant".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 20037, 20050), - }, - binding: None, - }, - Path { - body: NodeId(453), - output: PortId(511), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassLog".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 20067, 20075), - }, - binding: None, - }, - Path { - body: NodeId(454), - output: PortId(512), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassLinear".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 20092, 20103), - }, - binding: None, - }, - Path { - body: NodeId(455), - output: PortId(513), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassLinearithmic".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 20121, 20138), - }, - binding: None, - }, - Path { - body: NodeId(456), - output: PortId(514), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassQuadratic".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 20156, 20170), - }, - binding: None, - }, - Path { - body: NodeId(457), - output: PortId(516), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassPolynomial".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 20188, 20206), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(515), - }), - }, - Path { - body: NodeId(458), - output: PortId(517), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassExponential".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 20224, 20240), - }, - binding: None, - }, - Path { - body: NodeId(459), - output: PortId(518), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassUnknown".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 20258, 20270), - }, - binding: None, - }, - ], - output: PortId(519), - span: SourceSpan::new("src/v3/std/algebra.dag", 20019, 20287), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(461), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(520), - span: SourceSpan::new("src/v3/std/algebra.dag", 20350, 20354), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(462), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(521), - span: SourceSpan::new("src/v3/std/algebra.dag", 20375, 20380), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(463), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(522), - span: SourceSpan::new("src/v3/std/algebra.dag", 20404, 20409), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(464), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(523), - span: SourceSpan::new("src/v3/std/algebra.dag", 20439, 20444), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(465), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(524), - span: SourceSpan::new("src/v3/std/algebra.dag", 20471, 20476), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(466), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(526), - span: SourceSpan::new("src/v3/std/algebra.dag", 20507, 20512), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(467), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(527), - span: SourceSpan::new("src/v3/std/algebra.dag", 20541, 20546), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(468), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(528), - span: SourceSpan::new("src/v3/std/algebra.dag", 20571, 20576), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(469), - input: PortId(453), - paths: vec![ - Path { - body: NodeId(461), - output: PortId(520), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassConstant".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 20333, 20346), - }, - binding: None, - }, - Path { - body: NodeId(462), - output: PortId(521), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassLog".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 20363, 20371), - }, - binding: None, - }, - Path { - body: NodeId(463), - output: PortId(522), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassLinear".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 20389, 20400), - }, - binding: None, - }, - Path { - body: NodeId(464), - output: PortId(523), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassLinearithmic".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 20418, 20435), - }, - binding: None, - }, - Path { - body: NodeId(465), - output: PortId(524), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassQuadratic".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 20453, 20467), - }, - binding: None, - }, - Path { - body: NodeId(466), - output: PortId(526), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassPolynomial".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 20485, 20503), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(525), - }), - }, - Path { - body: NodeId(467), - output: PortId(527), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassExponential".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 20521, 20537), - }, - binding: None, - }, - Path { - body: NodeId(468), - output: PortId(528), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassUnknown".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 20555, 20567), - }, - binding: None, - }, - ], - output: PortId(529), - span: SourceSpan::new("src/v3/std/algebra.dag", 20315, 20584), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(470), - input: PortId(452), - paths: vec![ - Path { - body: NodeId(402), - output: PortId(454), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassUnknown".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 18410, 18422), - }, - binding: None, - }, - Path { - body: NodeId(411), - output: PortId(464), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassExponential".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 18435, 18451), - }, - binding: None, - }, - Path { - body: NodeId(424), - output: PortId(479), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassPolynomial".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 18729, 18760), - }, - binding: Some(PayloadBinding { - binding_name: "d_a".to_string(), - payload_port: PortId(465), - }), - }, - Path { - body: NodeId(433), - output: PortId(489), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassQuadratic".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19116, 19130), - }, - binding: None, - }, - Path { - body: NodeId(442), - output: PortId(499), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassLinearithmic".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19410, 19427), - }, - binding: None, - }, - Path { - body: NodeId(451), - output: PortId(509), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassLinear".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19708, 19719), - }, - binding: None, - }, - Path { - body: NodeId(460), - output: PortId(519), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassLog".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 20001, 20009), - }, - binding: None, - }, - Path { - body: NodeId(469), - output: PortId(529), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassConstant".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 20292, 20305), - }, - binding: None, - }, - ], - output: PortId(530), - span: SourceSpan::new("src/v3/std/algebra.dag", 18396, 20588), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(471), - name: "asymptotic_dominates".to_string(), - value: PortId(530), - params: vec![PortId(452), PortId(453)], - span: SourceSpan::new("src/v3/std/algebra.dag", 18396, 20588), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(472), - target: TransformTarget::Callable(DeclarationId(936)), - inputs: vec![PortId(531), PortId(532)], - output: PortId(533), - span: SourceSpan::new("src/v3/std/algebra.dag", 20681, 20707), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(473), - input: PortId(533), - paths: vec![ - Path { - body: NodeId(473), - output: PortId(532), - pattern: BranchPattern::UnresolvedVariant { - name: "True".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 20713, 20714), - }, - binding: None, - }, - Path { - body: NodeId(473), - output: PortId(531), - pattern: BranchPattern::UnresolvedVariant { - name: "False".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 20720, 20721), - }, - binding: None, - }, - ], - output: PortId(534), - span: SourceSpan::new("src/v3/std/algebra.dag", 20678, 20721), - emit_participation: None, - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(474), - name: "meet_asymptotic_class".to_string(), - value: PortId(534), - params: vec![PortId(531), PortId(532)], - span: SourceSpan::new("src/v3/std/algebra.dag", 20678, 20721), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(475), - target: TransformTarget::Callable(DeclarationId(936)), - inputs: vec![PortId(535), PortId(536)], - output: PortId(537), - span: SourceSpan::new("src/v3/std/algebra.dag", 20814, 20840), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(476), - input: PortId(537), - paths: vec![ - Path { - body: NodeId(476), - output: PortId(535), - pattern: BranchPattern::UnresolvedVariant { - name: "True".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 20846, 20847), - }, - binding: None, - }, - Path { - body: NodeId(476), - output: PortId(536), - pattern: BranchPattern::UnresolvedVariant { - name: "False".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 20853, 20854), - }, - binding: None, - }, - ], - output: PortId(538), - span: SourceSpan::new("src/v3/std/algebra.dag", 20811, 20854), - emit_participation: None, - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(477), - name: "join_asymptotic_class".to_string(), - value: PortId(538), - params: vec![PortId(535), PortId(536)], - span: SourceSpan::new("src/v3/std/algebra.dag", 20811, 20854), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(478), - target: TransformTarget::Callable(DeclarationId(941)), - inputs: vec![PortId(540)], - output: PortId(541), - span: SourceSpan::new("src/v3/std/algebra.dag", 22044, 22062), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(479), - target: TransformTarget::Callable(DeclarationId(942)), - inputs: vec![PortId(541)], - output: PortId(542), - span: SourceSpan::new("src/v3/std/algebra.dag", 22025, 22063), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(480), - target: TransformTarget::Callable(DeclarationId(948)), - inputs: vec![PortId(542)], - output: PortId(543), - span: SourceSpan::new("src/v3/std/algebra.dag", 22014, 22064), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(481), - target: TransformTarget::Callable(DeclarationId(941)), - inputs: vec![PortId(544)], - output: PortId(545), - span: SourceSpan::new("src/v3/std/algebra.dag", 22168, 22186), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(482), - target: TransformTarget::Callable(DeclarationId(943)), - inputs: vec![PortId(545)], - output: PortId(546), - span: SourceSpan::new("src/v3/std/algebra.dag", 22136, 22187), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(483), - target: TransformTarget::Callable(DeclarationId(945)), - inputs: vec![PortId(546)], - output: PortId(547), - span: SourceSpan::new("src/v3/std/algebra.dag", 22112, 22188), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(484), - target: TransformTarget::Callable(DeclarationId(950)), - inputs: vec![PortId(547)], - output: PortId(548), - span: SourceSpan::new("src/v3/std/algebra.dag", 22097, 22189), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(485), - input: PortId(539), - paths: vec![ - Path { - body: NodeId(485), - output: PortId(539), - pattern: BranchPattern::UnresolvedVariant { - name: "ConstantCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 21892, 21904), - }, - binding: None, - }, - Path { - body: NodeId(485), - output: PortId(539), - pattern: BranchPattern::UnresolvedVariant { - name: "LinearCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 21914, 21924), - }, - binding: None, - }, - Path { - body: NodeId(485), - output: PortId(539), - pattern: BranchPattern::UnresolvedVariant { - name: "PolynomialCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 21934, 21948), - }, - binding: None, - }, - Path { - body: NodeId(485), - output: PortId(539), - pattern: BranchPattern::UnresolvedVariant { - name: "LogCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 21958, 21965), - }, - binding: None, - }, - Path { - body: NodeId(485), - output: PortId(539), - pattern: BranchPattern::UnresolvedVariant { - name: "UnknownCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 21975, 21986), - }, - binding: None, - }, - Path { - body: NodeId(480), - output: PortId(543), - pattern: BranchPattern::UnresolvedVariant { - name: "SumCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 21996, 22010), - }, - binding: Some(PayloadBinding { - binding_name: "terms".to_string(), - payload_port: PortId(540), - }), - }, - Path { - body: NodeId(484), - output: PortId(548), - pattern: BranchPattern::UnresolvedVariant { - name: "ProductCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 22069, 22087), - }, - binding: Some(PayloadBinding { - binding_name: "terms".to_string(), - payload_port: PortId(544), - }), - }, - ], - output: PortId(549), - span: SourceSpan::new("src/v3/std/algebra.dag", 21878, 22193), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(486), - name: "normalize".to_string(), - value: PortId(549), - params: vec![PortId(539)], - span: SourceSpan::new("src/v3/std/algebra.dag", 21878, 22193), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(487), - target: TransformTarget::ResolvedFieldProject { - field_label: "first".to_string(), - }, - inputs: vec![PortId(550)], - output: PortId(551), - span: SourceSpan::new("src/v3/std/algebra.dag", 22286, 22291), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(488), - target: TransformTarget::ResolvedFieldProject { - field_label: "second".to_string(), - }, - inputs: vec![PortId(550)], - output: PortId(552), - span: SourceSpan::new("src/v3/std/algebra.dag", 22304, 22310), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(489), - target: TransformTarget::ResolvedFieldProject { - field_label: "rest".to_string(), - }, - inputs: vec![PortId(550)], - output: PortId(553), - span: SourceSpan::new("src/v3/std/algebra.dag", 22318, 22322), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(490), - target: TransformTarget::Callable(DeclarationId(2236)), - inputs: vec![PortId(552), PortId(553)], - output: PortId(554), - span: SourceSpan::new("src/v3/std/algebra.dag", 22293, 22323), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(491), - target: TransformTarget::Callable(DeclarationId(2237)), - inputs: vec![PortId(551), PortId(554)], - output: PortId(555), - span: SourceSpan::new("src/v3/std/algebra.dag", 22275, 22324), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(492), - name: "nsl_to_list".to_string(), - value: PortId(555), - params: vec![PortId(550)], - span: SourceSpan::new("src/v3/std/algebra.dag", 22275, 22324), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(493), - target: TransformTarget::Callable(DeclarationId(2238)), - inputs: vec![], - output: PortId(557), - span: SourceSpan::new("src/v3/std/algebra.dag", 22603, 22610), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(494), - target: TransformTarget::UnresolvedFieldProject { - field_label: "head".to_string(), - }, - inputs: vec![PortId(558)], - output: PortId(559), - span: SourceSpan::new("src/v3/std/algebra.dag", 22666, 22670), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(495), - target: TransformTarget::Callable(DeclarationId(946)), - inputs: vec![PortId(559)], - output: PortId(560), - span: SourceSpan::new("src/v3/std/algebra.dag", 22641, 22671), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(496), - target: TransformTarget::UnresolvedFieldProject { - field_label: "tail".to_string(), - }, - inputs: vec![PortId(558)], - output: PortId(561), - span: SourceSpan::new("src/v3/std/algebra.dag", 22712, 22716), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(497), - target: TransformTarget::Callable(DeclarationId(942)), - inputs: vec![PortId(561)], - output: PortId(562), - span: SourceSpan::new("src/v3/std/algebra.dag", 22685, 22717), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(498), - target: TransformTarget::UnresolvedFieldProject { - field_label: "head".to_string(), - }, - inputs: vec![PortId(558)], - output: PortId(563), - span: SourceSpan::new("src/v3/std/algebra.dag", 22750, 22754), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(499), - target: TransformTarget::UnresolvedFieldProject { - field_label: "tail".to_string(), - }, - inputs: vec![PortId(558)], - output: PortId(564), - span: SourceSpan::new("src/v3/std/algebra.dag", 22783, 22787), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(500), - target: TransformTarget::Callable(DeclarationId(942)), - inputs: vec![PortId(564)], - output: PortId(565), - span: SourceSpan::new("src/v3/std/algebra.dag", 22756, 22788), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(501), - target: TransformTarget::Callable(DeclarationId(2239)), - inputs: vec![PortId(563), PortId(565)], - output: PortId(566), - span: SourceSpan::new("src/v3/std/algebra.dag", 22737, 22789), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(502), - input: PortId(560), - paths: vec![ - Path { - body: NodeId(497), - output: PortId(562), - pattern: BranchPattern::UnresolvedVariant { - name: "True".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 22685, 22717), - }, - binding: None, - }, - Path { - body: NodeId(501), - output: PortId(566), - pattern: BranchPattern::UnresolvedVariant { - name: "False".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 22737, 22789), - }, - binding: None, - }, - ], - output: PortId(567), - span: SourceSpan::new("src/v3/std/algebra.dag", 22638, 22789), - emit_participation: None, - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(503), - input: PortId(556), - paths: vec![ - Path { - body: NodeId(493), - output: PortId(557), - pattern: BranchPattern::UnresolvedVariant { - name: "Empty".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 22594, 22599), - }, - binding: None, - }, - Path { - body: NodeId(502), - output: PortId(567), - pattern: BranchPattern::UnresolvedVariant { - name: "Cons".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 22615, 22628), - }, - binding: Some(PayloadBinding { - binding_name: "payload".to_string(), - payload_port: PortId(558), - }), - }, - ], - output: PortId(568), - span: SourceSpan::new("src/v3/std/algebra.dag", 22576, 22793), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Loop(LoopNode { - id: NodeId(504), - source: PortId(556), - init: PortId(556), - body: NodeId(503), - bound: LoopBound::Cardinality { count: PortId(556) }, - output: PortId(569), - span: SourceSpan::new("src/v3/std/algebra.dag", 22576, 22793), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(505), - name: "drop_additive_zero".to_string(), - value: PortId(569), - params: vec![PortId(556)], - span: SourceSpan::new("src/v3/std/algebra.dag", 22576, 22793), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(506), - target: TransformTarget::Callable(DeclarationId(944)), - inputs: vec![PortId(570)], - output: PortId(571), - span: SourceSpan::new("src/v3/std/algebra.dag", 23093, 23108), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(507), - data: LiteralBits::Int("0".to_string()), - output: PortId(572), - span: SourceSpan::new("src/v3/std/algebra.dag", 23136, 23137), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(508), - target: TransformTarget::Callable(DeclarationId(2207)), - inputs: vec![PortId(572)], - output: PortId(573), - span: SourceSpan::new("src/v3/std/algebra.dag", 23123, 23138), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(509), - target: TransformTarget::Callable(DeclarationId(2240)), - inputs: vec![], - output: PortId(574), - span: SourceSpan::new("src/v3/std/algebra.dag", 23140, 23147), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(510), - target: TransformTarget::Callable(DeclarationId(2241)), - inputs: vec![PortId(573), PortId(574)], - output: PortId(575), - span: SourceSpan::new("src/v3/std/algebra.dag", 23118, 23148), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(511), - input: PortId(571), - paths: vec![ - Path { - body: NodeId(510), - output: PortId(575), - pattern: BranchPattern::UnresolvedVariant { - name: "True".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 23118, 23148), - }, - binding: None, - }, - Path { - body: NodeId(511), - output: PortId(570), - pattern: BranchPattern::UnresolvedVariant { - name: "False".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 23160, 23165), - }, - binding: None, - }, - ], - output: PortId(576), - span: SourceSpan::new("src/v3/std/algebra.dag", 23090, 23165), - emit_participation: None, - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(512), - name: "collapse_on_multiplicative_zero".to_string(), - value: PortId(576), - params: vec![PortId(570)], - span: SourceSpan::new("src/v3/std/algebra.dag", 23090, 23165), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(513), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(578), - span: SourceSpan::new("src/v3/std/algebra.dag", 23245, 23250), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(514), - target: TransformTarget::UnresolvedFieldProject { - field_label: "head".to_string(), - }, - inputs: vec![PortId(579)], - output: PortId(580), - span: SourceSpan::new("src/v3/std/algebra.dag", 23297, 23301), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(515), - target: TransformTarget::Callable(DeclarationId(946)), - inputs: vec![PortId(580)], - output: PortId(581), - span: SourceSpan::new("src/v3/std/algebra.dag", 23272, 23302), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(516), - target: TransformTarget::UnresolvedFieldProject { - field_label: "tail".to_string(), - }, - inputs: vec![PortId(579)], - output: PortId(582), - span: SourceSpan::new("src/v3/std/algebra.dag", 23323, 23327), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(517), - target: TransformTarget::Callable(DeclarationId(944)), - inputs: vec![PortId(582)], - output: PortId(583), - span: SourceSpan::new("src/v3/std/algebra.dag", 23306, 23328), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(518), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::Or)), - inputs: vec![PortId(581), PortId(583)], - output: PortId(584), - span: SourceSpan::new("src/v3/std/algebra.dag", 23272, 23328), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(519), - input: PortId(577), - paths: vec![ - Path { - body: NodeId(513), - output: PortId(578), - pattern: BranchPattern::UnresolvedVariant { - name: "Empty".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 23236, 23241), - }, - binding: None, - }, - Path { - body: NodeId(518), - output: PortId(584), - pattern: BranchPattern::UnresolvedVariant { - name: "Cons".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 23255, 23268), - }, - binding: Some(PayloadBinding { - binding_name: "payload".to_string(), - payload_port: PortId(579), - }), - }, - ], - output: PortId(585), - span: SourceSpan::new("src/v3/std/algebra.dag", 23218, 23332), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Loop(LoopNode { - id: NodeId(520), - source: PortId(577), - init: PortId(577), - body: NodeId(519), - bound: LoopBound::Cardinality { count: PortId(577) }, - output: PortId(586), - span: SourceSpan::new("src/v3/std/algebra.dag", 23218, 23332), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(521), - name: "any_zero".to_string(), - value: PortId(586), - params: vec![PortId(577)], - span: SourceSpan::new("src/v3/std/algebra.dag", 23218, 23332), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(522), - target: TransformTarget::Callable(DeclarationId(2242)), - inputs: vec![], - output: PortId(588), - span: SourceSpan::new("src/v3/std/algebra.dag", 23597, 23604), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(523), - target: TransformTarget::UnresolvedFieldProject { - field_label: "head".to_string(), - }, - inputs: vec![PortId(589)], - output: PortId(590), - span: SourceSpan::new("src/v3/std/algebra.dag", 23659, 23663), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(524), - target: TransformTarget::Callable(DeclarationId(947)), - inputs: vec![PortId(590)], - output: PortId(591), - span: SourceSpan::new("src/v3/std/algebra.dag", 23635, 23664), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(525), - target: TransformTarget::UnresolvedFieldProject { - field_label: "tail".to_string(), - }, - inputs: vec![PortId(589)], - output: PortId(592), - span: SourceSpan::new("src/v3/std/algebra.dag", 23710, 23714), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(526), - target: TransformTarget::Callable(DeclarationId(945)), - inputs: vec![PortId(592)], - output: PortId(593), - span: SourceSpan::new("src/v3/std/algebra.dag", 23678, 23715), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(527), - target: TransformTarget::UnresolvedFieldProject { - field_label: "head".to_string(), - }, - inputs: vec![PortId(589)], - output: PortId(594), - span: SourceSpan::new("src/v3/std/algebra.dag", 23748, 23752), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(528), - target: TransformTarget::UnresolvedFieldProject { - field_label: "tail".to_string(), - }, - inputs: vec![PortId(589)], - output: PortId(595), - span: SourceSpan::new("src/v3/std/algebra.dag", 23786, 23790), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(529), - target: TransformTarget::Callable(DeclarationId(945)), - inputs: vec![PortId(595)], - output: PortId(596), - span: SourceSpan::new("src/v3/std/algebra.dag", 23754, 23791), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(530), - target: TransformTarget::Callable(DeclarationId(2243)), - inputs: vec![PortId(594), PortId(596)], - output: PortId(597), - span: SourceSpan::new("src/v3/std/algebra.dag", 23735, 23792), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(531), - input: PortId(591), - paths: vec![ - Path { - body: NodeId(526), - output: PortId(593), - pattern: BranchPattern::UnresolvedVariant { - name: "True".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 23678, 23715), - }, - binding: None, - }, - Path { - body: NodeId(530), - output: PortId(597), - pattern: BranchPattern::UnresolvedVariant { - name: "False".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 23735, 23792), - }, - binding: None, - }, - ], - output: PortId(598), - span: SourceSpan::new("src/v3/std/algebra.dag", 23632, 23792), - emit_participation: None, - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(532), - input: PortId(587), - paths: vec![ - Path { - body: NodeId(522), - output: PortId(588), - pattern: BranchPattern::UnresolvedVariant { - name: "Empty".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 23588, 23593), - }, - binding: None, - }, - Path { - body: NodeId(531), - output: PortId(598), - pattern: BranchPattern::UnresolvedVariant { - name: "Cons".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 23609, 23622), - }, - binding: Some(PayloadBinding { - binding_name: "payload".to_string(), - payload_port: PortId(589), - }), - }, - ], - output: PortId(599), - span: SourceSpan::new("src/v3/std/algebra.dag", 23570, 23796), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Loop(LoopNode { - id: NodeId(533), - source: PortId(587), - init: PortId(587), - body: NodeId(532), - bound: LoopBound::Cardinality { count: PortId(587) }, - output: PortId(600), - span: SourceSpan::new("src/v3/std/algebra.dag", 23570, 23796), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(534), - name: "drop_multiplicative_one".to_string(), - value: PortId(600), - params: vec![PortId(587)], - span: SourceSpan::new("src/v3/std/algebra.dag", 23570, 23796), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(535), - data: LiteralBits::Int("0".to_string()), - output: PortId(603), - span: SourceSpan::new("src/v3/std/algebra.dag", 23885, 23886), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(536), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(602), PortId(603)], - output: PortId(604), - span: SourceSpan::new("src/v3/std/algebra.dag", 23880, 23886), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(537), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(606), - span: SourceSpan::new("src/v3/std/algebra.dag", 23908, 23913), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(538), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(608), - span: SourceSpan::new("src/v3/std/algebra.dag", 23939, 23944), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(539), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(610), - span: SourceSpan::new("src/v3/std/algebra.dag", 23967, 23972), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(540), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(612), - span: SourceSpan::new("src/v3/std/algebra.dag", 23991, 23996), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(541), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(614), - span: SourceSpan::new("src/v3/std/algebra.dag", 24015, 24020), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(542), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(616), - span: SourceSpan::new("src/v3/std/algebra.dag", 24043, 24048), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(543), - input: PortId(601), - paths: vec![ - Path { - body: NodeId(536), - output: PortId(604), - pattern: BranchPattern::UnresolvedVariant { - name: "ConstantCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 23861, 23876), - }, - binding: Some(PayloadBinding { - binding_name: "n".to_string(), - payload_port: PortId(602), - }), - }, - Path { - body: NodeId(537), - output: PortId(606), - pattern: BranchPattern::UnresolvedVariant { - name: "LinearCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 23891, 23904), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(605), - }), - }, - Path { - body: NodeId(538), - output: PortId(608), - pattern: BranchPattern::UnresolvedVariant { - name: "PolynomialCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 23918, 23935), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(607), - }), - }, - Path { - body: NodeId(539), - output: PortId(610), - pattern: BranchPattern::UnresolvedVariant { - name: "ProductCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 23949, 23963), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(609), - }), - }, - Path { - body: NodeId(540), - output: PortId(612), - pattern: BranchPattern::UnresolvedVariant { - name: "SumCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 23977, 23987), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(611), - }), - }, - Path { - body: NodeId(541), - output: PortId(614), - pattern: BranchPattern::UnresolvedVariant { - name: "LogCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 24001, 24011), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(613), - }), - }, - Path { - body: NodeId(542), - output: PortId(616), - pattern: BranchPattern::UnresolvedVariant { - name: "UnknownCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 24025, 24039), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(615), - }), - }, - ], - output: PortId(617), - span: SourceSpan::new("src/v3/std/algebra.dag", 23847, 24052), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(544), - name: "is_zero_constant".to_string(), - value: PortId(617), - params: vec![PortId(601)], - span: SourceSpan::new("src/v3/std/algebra.dag", 23847, 24052), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(545), - data: LiteralBits::Int("1".to_string()), - output: PortId(620), - span: SourceSpan::new("src/v3/std/algebra.dag", 24140, 24141), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(546), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(619), PortId(620)], - output: PortId(621), - span: SourceSpan::new("src/v3/std/algebra.dag", 24135, 24141), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(547), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(623), - span: SourceSpan::new("src/v3/std/algebra.dag", 24163, 24168), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(548), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(625), - span: SourceSpan::new("src/v3/std/algebra.dag", 24194, 24199), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(549), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(627), - span: SourceSpan::new("src/v3/std/algebra.dag", 24222, 24227), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(550), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(629), - span: SourceSpan::new("src/v3/std/algebra.dag", 24246, 24251), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(551), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(631), - span: SourceSpan::new("src/v3/std/algebra.dag", 24270, 24275), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(552), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(633), - span: SourceSpan::new("src/v3/std/algebra.dag", 24298, 24303), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(553), - input: PortId(618), - paths: vec![ - Path { - body: NodeId(546), - output: PortId(621), - pattern: BranchPattern::UnresolvedVariant { - name: "ConstantCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 24116, 24131), - }, - binding: Some(PayloadBinding { - binding_name: "n".to_string(), - payload_port: PortId(619), - }), - }, - Path { - body: NodeId(547), - output: PortId(623), - pattern: BranchPattern::UnresolvedVariant { - name: "LinearCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 24146, 24159), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(622), - }), - }, - Path { - body: NodeId(548), - output: PortId(625), - pattern: BranchPattern::UnresolvedVariant { - name: "PolynomialCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 24173, 24190), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(624), - }), - }, - Path { - body: NodeId(549), - output: PortId(627), - pattern: BranchPattern::UnresolvedVariant { - name: "ProductCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 24204, 24218), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(626), - }), - }, - Path { - body: NodeId(550), - output: PortId(629), - pattern: BranchPattern::UnresolvedVariant { - name: "SumCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 24232, 24242), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(628), - }), - }, - Path { - body: NodeId(551), - output: PortId(631), - pattern: BranchPattern::UnresolvedVariant { - name: "LogCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 24256, 24266), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(630), - }), - }, - Path { - body: NodeId(552), - output: PortId(633), - pattern: BranchPattern::UnresolvedVariant { - name: "UnknownCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 24280, 24294), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(632), - }), - }, - ], - output: PortId(634), - span: SourceSpan::new("src/v3/std/algebra.dag", 24102, 24307), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(554), - name: "is_one_constant".to_string(), - value: PortId(634), - params: vec![PortId(618)], - span: SourceSpan::new("src/v3/std/algebra.dag", 24102, 24307), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(555), - data: LiteralBits::Int("0".to_string()), - output: PortId(636), - span: SourceSpan::new("src/v3/std/algebra.dag", 25193, 25194), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(556), - target: TransformTarget::Callable(DeclarationId(2207)), - inputs: vec![PortId(636)], - output: PortId(637), - span: SourceSpan::new("src/v3/std/algebra.dag", 25180, 25195), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(557), - target: TransformTarget::UnresolvedFieldProject { - field_label: "tail".to_string(), - }, - inputs: vec![PortId(638)], - output: PortId(639), - span: SourceSpan::new("src/v3/std/algebra.dag", 25237, 25241), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(558), - target: TransformTarget::UnresolvedFieldProject { - field_label: "head".to_string(), - }, - inputs: vec![PortId(638)], - output: PortId(640), - span: SourceSpan::new("src/v3/std/algebra.dag", 25269, 25273), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(559), - target: TransformTarget::UnresolvedFieldProject { - field_label: "head".to_string(), - }, - inputs: vec![PortId(638)], - output: PortId(642), - span: SourceSpan::new("src/v3/std/algebra.dag", 25330, 25334), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(560), - target: TransformTarget::UnresolvedFieldProject { - field_label: "tail".to_string(), - }, - inputs: vec![PortId(638)], - output: PortId(643), - span: SourceSpan::new("src/v3/std/algebra.dag", 25344, 25348), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(561), - target: TransformTarget::Callable(DeclarationId(2244)), - inputs: vec![PortId(642), PortId(643)], - output: PortId(644), - span: SourceSpan::new("src/v3/std/algebra.dag", 25317, 25349), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(562), - target: TransformTarget::Callable(DeclarationId(960)), - inputs: vec![PortId(644)], - output: PortId(645), - span: SourceSpan::new("src/v3/std/algebra.dag", 25302, 25350), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(563), - target: TransformTarget::Callable(DeclarationId(949)), - inputs: vec![PortId(645)], - output: PortId(646), - span: SourceSpan::new("src/v3/std/algebra.dag", 25293, 25351), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(564), - input: PortId(639), - paths: vec![ - Path { - body: NodeId(558), - output: PortId(640), - pattern: BranchPattern::UnresolvedVariant { - name: "Empty".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 25252, 25257), - }, - binding: None, - }, - Path { - body: NodeId(563), - output: PortId(646), - pattern: BranchPattern::UnresolvedVariant { - name: "Cons".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 25282, 25289), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(641), - }), - }, - ], - output: PortId(647), - span: SourceSpan::new("src/v3/std/algebra.dag", 25223, 25359), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(565), - input: PortId(635), - paths: vec![ - Path { - body: NodeId(556), - output: PortId(637), - pattern: BranchPattern::UnresolvedVariant { - name: "Empty".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 25171, 25176), - }, - binding: None, - }, - Path { - body: NodeId(564), - output: PortId(647), - pattern: BranchPattern::UnresolvedVariant { - name: "Cons".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 25200, 25213), - }, - binding: Some(PayloadBinding { - binding_name: "payload".to_string(), - payload_port: PortId(638), - }), - }, - ], - output: PortId(648), - span: SourceSpan::new("src/v3/std/algebra.dag", 25153, 25363), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(566), - name: "reduce_sum".to_string(), - value: PortId(648), - params: vec![PortId(635)], - span: SourceSpan::new("src/v3/std/algebra.dag", 25153, 25363), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(567), - data: LiteralBits::Int("0".to_string()), - output: PortId(650), - span: SourceSpan::new("src/v3/std/algebra.dag", 25464, 25465), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(568), - target: TransformTarget::Callable(DeclarationId(2207)), - inputs: vec![PortId(650)], - output: PortId(651), - span: SourceSpan::new("src/v3/std/algebra.dag", 25451, 25466), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(569), - target: TransformTarget::UnresolvedFieldProject { - field_label: "tail".to_string(), - }, - inputs: vec![PortId(652)], - output: PortId(653), - span: SourceSpan::new("src/v3/std/algebra.dag", 25508, 25512), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(570), - target: TransformTarget::UnresolvedFieldProject { - field_label: "head".to_string(), - }, - inputs: vec![PortId(652)], - output: PortId(654), - span: SourceSpan::new("src/v3/std/algebra.dag", 25540, 25544), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(571), - target: TransformTarget::UnresolvedFieldProject { - field_label: "head".to_string(), - }, - inputs: vec![PortId(652)], - output: PortId(656), - span: SourceSpan::new("src/v3/std/algebra.dag", 25596, 25600), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(572), - target: TransformTarget::UnresolvedFieldProject { - field_label: "head".to_string(), - }, - inputs: vec![PortId(655)], - output: PortId(657), - span: SourceSpan::new("src/v3/std/algebra.dag", 25609, 25613), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(573), - target: TransformTarget::UnresolvedFieldProject { - field_label: "tail".to_string(), - }, - inputs: vec![PortId(655)], - output: PortId(658), - span: SourceSpan::new("src/v3/std/algebra.dag", 25622, 25626), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(574), - target: TransformTarget::Callable(DeclarationId(925)), - inputs: vec![PortId(656), PortId(657), PortId(658)], - output: PortId(659), - span: SourceSpan::new("src/v3/std/algebra.dag", 25577, 25627), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(575), - target: TransformTarget::Callable(DeclarationId(2213)), - inputs: vec![PortId(659)], - output: PortId(660), - span: SourceSpan::new("src/v3/std/algebra.dag", 25569, 25628), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(576), - input: PortId(653), - paths: vec![ - Path { - body: NodeId(570), - output: PortId(654), - pattern: BranchPattern::UnresolvedVariant { - name: "Empty".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 25523, 25528), - }, - binding: None, - }, - Path { - body: NodeId(575), - output: PortId(660), - pattern: BranchPattern::UnresolvedVariant { - name: "Cons".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 25553, 25565), - }, - binding: Some(PayloadBinding { - binding_name: "second".to_string(), - payload_port: PortId(655), - }), - }, - ], - output: PortId(661), - span: SourceSpan::new("src/v3/std/algebra.dag", 25494, 25636), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(577), - input: PortId(649), - paths: vec![ - Path { - body: NodeId(568), - output: PortId(651), - pattern: BranchPattern::UnresolvedVariant { - name: "Empty".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 25442, 25447), - }, - binding: None, - }, - Path { - body: NodeId(576), - output: PortId(661), - pattern: BranchPattern::UnresolvedVariant { - name: "Cons".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 25471, 25484), - }, - binding: Some(PayloadBinding { - binding_name: "payload".to_string(), - payload_port: PortId(652), - }), - }, - ], - output: PortId(662), - span: SourceSpan::new("src/v3/std/algebra.dag", 25424, 25640), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(578), - name: "wrap_sum".to_string(), - value: PortId(662), - params: vec![PortId(649)], - span: SourceSpan::new("src/v3/std/algebra.dag", 25424, 25640), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(579), - data: LiteralBits::Int("1".to_string()), - output: PortId(664), - span: SourceSpan::new("src/v3/std/algebra.dag", 25930, 25931), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(580), - target: TransformTarget::Callable(DeclarationId(2207)), - inputs: vec![PortId(664)], - output: PortId(665), - span: SourceSpan::new("src/v3/std/algebra.dag", 25917, 25932), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(581), - target: TransformTarget::UnresolvedFieldProject { - field_label: "tail".to_string(), - }, - inputs: vec![PortId(666)], - output: PortId(667), - span: SourceSpan::new("src/v3/std/algebra.dag", 25974, 25978), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(582), - target: TransformTarget::UnresolvedFieldProject { - field_label: "head".to_string(), - }, - inputs: vec![PortId(666)], - output: PortId(668), - span: SourceSpan::new("src/v3/std/algebra.dag", 26006, 26010), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(583), - target: TransformTarget::UnresolvedFieldProject { - field_label: "tail".to_string(), - }, - inputs: vec![PortId(669)], - output: PortId(670), - span: SourceSpan::new("src/v3/std/algebra.dag", 26058, 26062), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(584), - target: TransformTarget::UnresolvedFieldProject { - field_label: "head".to_string(), - }, - inputs: vec![PortId(666)], - output: PortId(671), - span: SourceSpan::new("src/v3/std/algebra.dag", 26117, 26121), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(585), - target: TransformTarget::UnresolvedFieldProject { - field_label: "head".to_string(), - }, - inputs: vec![PortId(669)], - output: PortId(672), - span: SourceSpan::new("src/v3/std/algebra.dag", 26130, 26134), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(586), - target: TransformTarget::Callable(DeclarationId(951)), - inputs: vec![PortId(671), PortId(672)], - output: PortId(673), - span: SourceSpan::new("src/v3/std/algebra.dag", 26086, 26135), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(587), - target: TransformTarget::UnresolvedFieldProject { - field_label: "head".to_string(), - }, - inputs: vec![PortId(666)], - output: PortId(675), - span: SourceSpan::new("src/v3/std/algebra.dag", 26190, 26194), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(588), - target: TransformTarget::UnresolvedFieldProject { - field_label: "head".to_string(), - }, - inputs: vec![PortId(669)], - output: PortId(676), - span: SourceSpan::new("src/v3/std/algebra.dag", 26203, 26207), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(589), - target: TransformTarget::UnresolvedFieldProject { - field_label: "tail".to_string(), - }, - inputs: vec![PortId(669)], - output: PortId(677), - span: SourceSpan::new("src/v3/std/algebra.dag", 26216, 26220), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(590), - target: TransformTarget::Callable(DeclarationId(925)), - inputs: vec![PortId(675), PortId(676), PortId(677)], - output: PortId(678), - span: SourceSpan::new("src/v3/std/algebra.dag", 26171, 26221), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(591), - target: TransformTarget::Callable(DeclarationId(2211)), - inputs: vec![PortId(678)], - output: PortId(679), - span: SourceSpan::new("src/v3/std/algebra.dag", 26159, 26222), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(592), - input: PortId(670), - paths: vec![ - Path { - body: NodeId(586), - output: PortId(673), - pattern: BranchPattern::UnresolvedVariant { - name: "Empty".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 26077, 26082), - }, - binding: None, - }, - Path { - body: NodeId(591), - output: PortId(679), - pattern: BranchPattern::UnresolvedVariant { - name: "Cons".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 26148, 26155), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(674), - }), - }, - ], - output: PortId(680), - span: SourceSpan::new("src/v3/std/algebra.dag", 26045, 26234), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(593), - input: PortId(667), - paths: vec![ - Path { - body: NodeId(582), - output: PortId(668), - pattern: BranchPattern::UnresolvedVariant { - name: "Empty".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 25989, 25994), - }, - binding: None, - }, - Path { - body: NodeId(592), - output: PortId(680), - pattern: BranchPattern::UnresolvedVariant { - name: "Cons".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 26019, 26031), - }, - binding: Some(PayloadBinding { - binding_name: "second".to_string(), - payload_port: PortId(669), - }), - }, - ], - output: PortId(681), - span: SourceSpan::new("src/v3/std/algebra.dag", 25960, 26242), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(594), - input: PortId(663), - paths: vec![ - Path { - body: NodeId(580), - output: PortId(665), - pattern: BranchPattern::UnresolvedVariant { - name: "Empty".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 25908, 25913), - }, - binding: None, - }, - Path { - body: NodeId(593), - output: PortId(681), - pattern: BranchPattern::UnresolvedVariant { - name: "Cons".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 25937, 25950), - }, - binding: Some(PayloadBinding { - binding_name: "payload".to_string(), - payload_port: PortId(666), - }), - }, - ], - output: PortId(682), - span: SourceSpan::new("src/v3/std/algebra.dag", 25890, 26246), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(595), - name: "reduce_product".to_string(), - value: PortId(682), - params: vec![PortId(663)], - span: SourceSpan::new("src/v3/std/algebra.dag", 25890, 26246), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(596), - target: TransformTarget::Callable(DeclarationId(952)), - inputs: vec![PortId(685), PortId(683), PortId(684)], - output: PortId(686), - span: SourceSpan::new("src/v3/std/algebra.dag", 26523, 26552), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(597), - target: TransformTarget::Callable(DeclarationId(955)), - inputs: vec![PortId(683), PortId(684)], - output: PortId(688), - span: SourceSpan::new("src/v3/std/algebra.dag", 26576, 26594), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(598), - target: TransformTarget::Callable(DeclarationId(955)), - inputs: vec![PortId(683), PortId(684)], - output: PortId(690), - span: SourceSpan::new("src/v3/std/algebra.dag", 26620, 26638), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(599), - target: TransformTarget::Callable(DeclarationId(955)), - inputs: vec![PortId(683), PortId(684)], - output: PortId(692), - span: SourceSpan::new("src/v3/std/algebra.dag", 26657, 26675), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(600), - target: TransformTarget::Callable(DeclarationId(955)), - inputs: vec![PortId(683), PortId(684)], - output: PortId(694), - span: SourceSpan::new("src/v3/std/algebra.dag", 26694, 26712), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(601), - target: TransformTarget::Callable(DeclarationId(955)), - inputs: vec![PortId(683), PortId(684)], - output: PortId(696), - span: SourceSpan::new("src/v3/std/algebra.dag", 26735, 26753), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(602), - target: TransformTarget::Callable(DeclarationId(955)), - inputs: vec![PortId(683), PortId(684)], - output: PortId(698), - span: SourceSpan::new("src/v3/std/algebra.dag", 26776, 26794), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(603), - input: PortId(683), - paths: vec![ - Path { - body: NodeId(596), - output: PortId(686), - pattern: BranchPattern::UnresolvedVariant { - name: "LinearCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 26505, 26519), - }, - binding: Some(PayloadBinding { - binding_name: "va".to_string(), - payload_port: PortId(685), - }), - }, - Path { - body: NodeId(597), - output: PortId(688), - pattern: BranchPattern::UnresolvedVariant { - name: "ConstantCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 26557, 26572), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(687), - }), - }, - Path { - body: NodeId(598), - output: PortId(690), - pattern: BranchPattern::UnresolvedVariant { - name: "PolynomialCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 26599, 26616), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(689), - }), - }, - Path { - body: NodeId(599), - output: PortId(692), - pattern: BranchPattern::UnresolvedVariant { - name: "LogCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 26643, 26653), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(691), - }), - }, - Path { - body: NodeId(600), - output: PortId(694), - pattern: BranchPattern::UnresolvedVariant { - name: "SumCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 26680, 26690), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(693), - }), - }, - Path { - body: NodeId(601), - output: PortId(696), - pattern: BranchPattern::UnresolvedVariant { - name: "ProductCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 26717, 26731), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(695), - }), - }, - Path { - body: NodeId(602), - output: PortId(698), - pattern: BranchPattern::UnresolvedVariant { - name: "UnknownCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 26758, 26772), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(697), - }), - }, - ], - output: PortId(699), - span: SourceSpan::new("src/v3/std/algebra.dag", 26491, 26798), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(604), - name: "combine_binary_product".to_string(), - value: PortId(699), - params: vec![PortId(683), PortId(684)], - span: SourceSpan::new("src/v3/std/algebra.dag", 26491, 26798), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(605), - target: TransformTarget::Callable(DeclarationId(953)), - inputs: vec![PortId(700), PortId(703), PortId(701), PortId(702)], - output: PortId(704), - span: SourceSpan::new("src/v3/std/algebra.dag", 26927, 26963), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(606), - target: TransformTarget::Callable(DeclarationId(955)), - inputs: vec![PortId(701), PortId(702)], - output: PortId(706), - span: SourceSpan::new("src/v3/std/algebra.dag", 26987, 27005), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(607), - target: TransformTarget::Callable(DeclarationId(955)), - inputs: vec![PortId(701), PortId(702)], - output: PortId(708), - span: SourceSpan::new("src/v3/std/algebra.dag", 27031, 27049), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(608), - target: TransformTarget::Callable(DeclarationId(955)), - inputs: vec![PortId(701), PortId(702)], - output: PortId(710), - span: SourceSpan::new("src/v3/std/algebra.dag", 27068, 27086), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(609), - target: TransformTarget::Callable(DeclarationId(955)), - inputs: vec![PortId(701), PortId(702)], - output: PortId(712), - span: SourceSpan::new("src/v3/std/algebra.dag", 27105, 27123), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(610), - target: TransformTarget::Callable(DeclarationId(955)), - inputs: vec![PortId(701), PortId(702)], - output: PortId(714), - span: SourceSpan::new("src/v3/std/algebra.dag", 27146, 27164), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(611), - target: TransformTarget::Callable(DeclarationId(955)), - inputs: vec![PortId(701), PortId(702)], - output: PortId(716), - span: SourceSpan::new("src/v3/std/algebra.dag", 27187, 27205), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(612), - input: PortId(702), - paths: vec![ - Path { - body: NodeId(605), - output: PortId(704), - pattern: BranchPattern::UnresolvedVariant { - name: "LinearCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 26909, 26923), - }, - binding: Some(PayloadBinding { - binding_name: "vb".to_string(), - payload_port: PortId(703), - }), - }, - Path { - body: NodeId(606), - output: PortId(706), - pattern: BranchPattern::UnresolvedVariant { - name: "ConstantCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 26968, 26983), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(705), - }), - }, - Path { - body: NodeId(607), - output: PortId(708), - pattern: BranchPattern::UnresolvedVariant { - name: "PolynomialCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 27010, 27027), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(707), - }), - }, - Path { - body: NodeId(608), - output: PortId(710), - pattern: BranchPattern::UnresolvedVariant { - name: "LogCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 27054, 27064), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(709), - }), - }, - Path { - body: NodeId(609), - output: PortId(712), - pattern: BranchPattern::UnresolvedVariant { - name: "SumCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 27091, 27101), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(711), - }), - }, - Path { - body: NodeId(610), - output: PortId(714), - pattern: BranchPattern::UnresolvedVariant { - name: "ProductCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 27128, 27142), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(713), - }), - }, - Path { - body: NodeId(611), - output: PortId(716), - pattern: BranchPattern::UnresolvedVariant { - name: "UnknownCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 27169, 27183), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(715), - }), - }, - ], - output: PortId(717), - span: SourceSpan::new("src/v3/std/algebra.dag", 26895, 27209), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(613), - name: "combine_linear_with".to_string(), - value: PortId(717), - params: vec![PortId(700), PortId(701), PortId(702)], - span: SourceSpan::new("src/v3/std/algebra.dag", 26895, 27209), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(614), - target: TransformTarget::Callable(DeclarationId(934)), - inputs: vec![PortId(718), PortId(719)], - output: PortId(722), - span: SourceSpan::new("src/v3/std/algebra.dag", 27340, 27366), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(615), - target: TransformTarget::Callable(DeclarationId(954)), - inputs: vec![PortId(718)], - output: PortId(723), - span: SourceSpan::new("src/v3/std/algebra.dag", 27376, 27397), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(616), - target: TransformTarget::Callable(DeclarationId(955)), - inputs: vec![PortId(720), PortId(721)], - output: PortId(724), - span: SourceSpan::new("src/v3/std/algebra.dag", 27409, 27427), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(617), - input: PortId(722), - paths: vec![ - Path { - body: NodeId(615), - output: PortId(723), - pattern: BranchPattern::UnresolvedVariant { - name: "True".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 27376, 27397), - }, - binding: None, - }, - Path { - body: NodeId(616), - output: PortId(724), - pattern: BranchPattern::UnresolvedVariant { - name: "False".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 27409, 27427), - }, - binding: None, - }, - ], - output: PortId(725), - span: SourceSpan::new("src/v3/std/algebra.dag", 27337, 27427), - emit_participation: None, - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(618), - name: "collapse_linear_square".to_string(), - value: PortId(725), - params: vec![PortId(718), PortId(719), PortId(720), PortId(721)], - span: SourceSpan::new("src/v3/std/algebra.dag", 27337, 27427), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(619), - target: TransformTarget::Callable(DeclarationId(924)), - inputs: vec![PortId(726), PortId(727)], - output: PortId(728), - span: SourceSpan::new("src/v3/std/algebra.dag", 27617, 27632), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(620), - target: TransformTarget::Callable(DeclarationId(2211)), - inputs: vec![PortId(728)], - output: PortId(729), - span: SourceSpan::new("src/v3/std/algebra.dag", 27605, 27633), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(621), - name: "product_pair".to_string(), - value: PortId(729), - params: vec![PortId(726), PortId(727)], - span: SourceSpan::new("src/v3/std/algebra.dag", 27605, 27633), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(622), - target: TransformTarget::ResolvedFieldProject { - field_label: "any".to_string(), - }, - inputs: vec![PortId(730)], - output: PortId(732), - span: SourceSpan::new("src/v3/std/algebra.dag", 27733, 27736), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(623), - target: TransformTarget::ResolvedFieldProject { - field_label: "pivot".to_string(), - }, - inputs: vec![PortId(730)], - output: PortId(733), - span: SourceSpan::new("src/v3/std/algebra.dag", 27757, 27762), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(624), - target: TransformTarget::Callable(DeclarationId(933)), - inputs: vec![PortId(731), PortId(733)], - output: PortId(734), - span: SourceSpan::new("src/v3/std/algebra.dag", 27740, 27763), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(625), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::Or)), - inputs: vec![PortId(732), PortId(734)], - output: PortId(735), - span: SourceSpan::new("src/v3/std/algebra.dag", 27729, 27763), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(626), - target: TransformTarget::ResolvedFieldProject { - field_label: "pivot".to_string(), - }, - inputs: vec![PortId(730)], - output: PortId(736), - span: SourceSpan::new("src/v3/std/algebra.dag", 27777, 27782), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(627), - target: TransformTarget::Callable(DeclarationId(920)), - inputs: vec![PortId(735), PortId(736)], - output: PortId(737), - span: SourceSpan::new("src/v3/std/algebra.dag", 27720, 27784), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(628), - name: "fold_or_dominate_scan".to_string(), - value: PortId(737), - params: vec![PortId(730), PortId(731)], - span: SourceSpan::new("src/v3/std/algebra.dag", 27720, 27784), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(629), - target: TransformTarget::ResolvedFieldProject { - field_label: "any".to_string(), - }, - inputs: vec![PortId(738)], - output: PortId(739), - span: SourceSpan::new("src/v3/std/algebra.dag", 27838, 27841), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(630), - name: "scan_hit".to_string(), - value: PortId(739), - params: vec![PortId(738)], - span: SourceSpan::new("src/v3/std/algebra.dag", 27833, 27841), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(631), - target: TransformTarget::Callable(DeclarationId(2245)), - inputs: vec![], - output: PortId(742), - span: SourceSpan::new("src/v3/std/algebra.dag", 27988, 27995), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(632), - target: TransformTarget::UnresolvedFieldProject { - field_label: "head".to_string(), - }, - inputs: vec![PortId(743)], - output: PortId(744), - span: SourceSpan::new("src/v3/std/algebra.dag", 28052, 28056), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(633), - target: TransformTarget::Callable(DeclarationId(933)), - inputs: vec![PortId(741), PortId(744)], - output: PortId(745), - span: SourceSpan::new("src/v3/std/algebra.dag", 28026, 28057), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(634), - target: TransformTarget::UnresolvedFieldProject { - field_label: "tail".to_string(), - }, - inputs: vec![PortId(743)], - output: PortId(746), - span: SourceSpan::new("src/v3/std/algebra.dag", 28103, 28107), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(635), - target: TransformTarget::Callable(DeclarationId(958)), - inputs: vec![PortId(746), PortId(741)], - output: PortId(747), - span: SourceSpan::new("src/v3/std/algebra.dag", 28071, 28116), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(636), - target: TransformTarget::UnresolvedFieldProject { - field_label: "head".to_string(), - }, - inputs: vec![PortId(743)], - output: PortId(748), - span: SourceSpan::new("src/v3/std/algebra.dag", 28149, 28153), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(637), - target: TransformTarget::UnresolvedFieldProject { - field_label: "tail".to_string(), - }, - inputs: vec![PortId(743)], - output: PortId(749), - span: SourceSpan::new("src/v3/std/algebra.dag", 28187, 28191), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(638), - target: TransformTarget::Callable(DeclarationId(958)), - inputs: vec![PortId(749), PortId(741)], - output: PortId(750), - span: SourceSpan::new("src/v3/std/algebra.dag", 28155, 28200), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(639), - target: TransformTarget::Callable(DeclarationId(2246)), - inputs: vec![PortId(748), PortId(750)], - output: PortId(751), - span: SourceSpan::new("src/v3/std/algebra.dag", 28136, 28201), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(640), - input: PortId(745), - paths: vec![ - Path { - body: NodeId(635), - output: PortId(747), - pattern: BranchPattern::UnresolvedVariant { - name: "True".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 28071, 28116), - }, - binding: None, - }, - Path { - body: NodeId(639), - output: PortId(751), - pattern: BranchPattern::UnresolvedVariant { - name: "False".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 28136, 28201), - }, - binding: None, - }, - ], - output: PortId(752), - span: SourceSpan::new("src/v3/std/algebra.dag", 28023, 28201), - emit_participation: None, - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(641), - input: PortId(740), - paths: vec![ - Path { - body: NodeId(631), - output: PortId(742), - pattern: BranchPattern::UnresolvedVariant { - name: "Empty".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 27979, 27984), - }, - binding: None, - }, - Path { - body: NodeId(640), - output: PortId(752), - pattern: BranchPattern::UnresolvedVariant { - name: "Cons".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 28000, 28013), - }, - binding: Some(PayloadBinding { - binding_name: "payload".to_string(), - payload_port: PortId(743), - }), - }, - ], - output: PortId(753), - span: SourceSpan::new("src/v3/std/algebra.dag", 27956, 28205), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Loop(LoopNode { - id: NodeId(642), - source: PortId(740), - init: PortId(740), - body: NodeId(641), - bound: LoopBound::Cardinality { count: PortId(740) }, - output: PortId(754), - span: SourceSpan::new("src/v3/std/algebra.dag", 27956, 28205), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(643), - name: "filter_not_dominated_by".to_string(), - value: PortId(754), - params: vec![PortId(740), PortId(741)], - span: SourceSpan::new("src/v3/std/algebra.dag", 27956, 28205), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(644), - target: TransformTarget::Callable(DeclarationId(921)), - inputs: vec![PortId(756)], - output: PortId(757), - span: SourceSpan::new("src/v3/std/algebra.dag", 28329, 28353), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(645), - target: TransformTarget::Callable(DeclarationId(2248)), - inputs: vec![PortId(755), PortId(757)], - output: PortId(758), - span: SourceSpan::new("src/v3/std/algebra.dag", 28319, 28377), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(646), - target: TransformTarget::Callable(DeclarationId(957)), - inputs: vec![PortId(758)], - output: PortId(759), - span: SourceSpan::new("src/v3/std/algebra.dag", 28310, 28378), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(647), - target: TransformTarget::Callable(DeclarationId(958)), - inputs: vec![PortId(755), PortId(756)], - output: PortId(760), - span: SourceSpan::new("src/v3/std/algebra.dag", 28414, 28448), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(648), - target: TransformTarget::Callable(DeclarationId(2249)), - inputs: vec![PortId(756), PortId(760)], - output: PortId(761), - span: SourceSpan::new("src/v3/std/algebra.dag", 28403, 28449), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(649), - input: PortId(759), - paths: vec![ - Path { - body: NodeId(649), - output: PortId(755), - pattern: BranchPattern::UnresolvedVariant { - name: "True".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 28388, 28391), - }, - binding: None, - }, - Path { - body: NodeId(648), - output: PortId(761), - pattern: BranchPattern::UnresolvedVariant { - name: "False".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 28403, 28449), - }, - binding: None, - }, - ], - output: PortId(762), - span: SourceSpan::new("src/v3/std/algebra.dag", 28307, 28449), - emit_participation: None, - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(650), - name: "drop_dominated_step".to_string(), - value: PortId(762), - params: vec![PortId(755), PortId(756)], - span: SourceSpan::new("src/v3/std/algebra.dag", 28307, 28449), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(651), - target: TransformTarget::Callable(DeclarationId(2250)), - inputs: vec![], - output: PortId(764), - span: SourceSpan::new("src/v3/std/algebra.dag", 28720, 28727), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(652), - target: TransformTarget::Callable(DeclarationId(2252)), - inputs: vec![PortId(763), PortId(764)], - output: PortId(765), - span: SourceSpan::new("src/v3/std/algebra.dag", 28708, 28749), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(653), - name: "drop_dominated".to_string(), - value: PortId(765), - params: vec![PortId(763)], - span: SourceSpan::new("src/v3/std/algebra.dag", 28708, 28749), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(654), - data: LiteralBits::Int("0".to_string()), - output: PortId(767), - span: SourceSpan::new("src/v3/std/induction.dag", 31081, 31082), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(655), - target: TransformTarget::Callable(DeclarationId(2207)), - inputs: vec![PortId(767)], - output: PortId(768), - span: SourceSpan::new("src/v3/std/induction.dag", 31068, 31083), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(656), - target: TransformTarget::UnresolvedFieldProject { - field_label: "cost".to_string(), - }, - inputs: vec![PortId(769)], - output: PortId(770), - span: SourceSpan::new("src/v3/std/induction.dag", 31102, 31109), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(657), - target: TransformTarget::Callable(DeclarationId(1204)), - inputs: vec![PortId(770)], - output: PortId(771), - span: SourceSpan::new("src/v3/std/induction.dag", 31115, 31141), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(658), - target: TransformTarget::UnresolvedFieldProject { - field_label: "factors".to_string(), - }, - inputs: vec![PortId(772)], - output: PortId(773), - span: SourceSpan::new("src/v3/std/induction.dag", 31161, 31172), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(659), - target: TransformTarget::Callable(DeclarationId(1205)), - inputs: vec![PortId(773)], - output: PortId(774), - span: SourceSpan::new("src/v3/std/induction.dag", 31178, 31207), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(660), - target: TransformTarget::UnresolvedFieldProject { - field_label: "terms".to_string(), - }, - inputs: vec![PortId(775)], - output: PortId(776), - span: SourceSpan::new("src/v3/std/induction.dag", 31233, 31242), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(661), - target: TransformTarget::Callable(DeclarationId(1207)), - inputs: vec![PortId(776)], - output: PortId(777), - span: SourceSpan::new("src/v3/std/induction.dag", 31248, 31276), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(662), - target: TransformTarget::UnresolvedFieldProject { - field_label: "terms".to_string(), - }, - inputs: vec![PortId(778)], - output: PortId(779), - span: SourceSpan::new("src/v3/std/induction.dag", 31292, 31301), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(663), - data: LiteralBits::String( - "CostBound SumBound awaits non-recursive projection lowering".to_string(), - ), - output: PortId(780), - span: SourceSpan::new("src/v3/std/induction.dag", 31319, 31380), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(664), - target: TransformTarget::Callable(DeclarationId(2215)), - inputs: vec![PortId(780)], - output: PortId(781), - span: SourceSpan::new("src/v3/std/induction.dag", 31307, 31381), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(665), - data: LiteralBits::String("forever bound".to_string()), - output: PortId(782), - span: SourceSpan::new("src/v3/std/induction.dag", 31414, 31429), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(666), - target: TransformTarget::Callable(DeclarationId(2215)), - inputs: vec![PortId(782)], - output: PortId(783), - span: SourceSpan::new("src/v3/std/induction.dag", 31402, 31430), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(667), - data: LiteralBits::String("invalid cost bound".to_string()), - output: PortId(784), - span: SourceSpan::new("src/v3/std/induction.dag", 31461, 31481), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(668), - target: TransformTarget::Callable(DeclarationId(2215)), - inputs: vec![PortId(784)], - output: PortId(785), - span: SourceSpan::new("src/v3/std/induction.dag", 31449, 31482), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(669), - input: PortId(766), - paths: vec![ - Path { - body: NodeId(655), - output: PortId(768), - pattern: BranchPattern::UnresolvedVariant { - name: "ConstantBound".to_string(), - span: SourceSpan::new("src/v3/std/induction.dag", 31051, 31064), - }, - binding: None, - }, - Path { - body: NodeId(657), - output: PortId(771), - pattern: BranchPattern::UnresolvedVariant { - name: "AtomicBound".to_string(), - span: SourceSpan::new("src/v3/std/induction.dag", 31088, 31111), - }, - binding: Some(PayloadBinding { - binding_name: "c".to_string(), - payload_port: PortId(769), - }), - }, - Path { - body: NodeId(659), - output: PortId(774), - pattern: BranchPattern::UnresolvedVariant { - name: "ProductBound".to_string(), - span: SourceSpan::new("src/v3/std/induction.dag", 31146, 31174), - }, - binding: Some(PayloadBinding { - binding_name: "fs".to_string(), - payload_port: PortId(772), - }), - }, - Path { - body: NodeId(661), - output: PortId(777), - pattern: BranchPattern::UnresolvedVariant { - name: "SumOfProductsBound".to_string(), - span: SourceSpan::new("src/v3/std/induction.dag", 31212, 31244), - }, - binding: Some(PayloadBinding { - binding_name: "ts".to_string(), - payload_port: PortId(775), - }), - }, - Path { - body: NodeId(664), - output: PortId(781), - pattern: BranchPattern::UnresolvedVariant { - name: "SumBound".to_string(), - span: SourceSpan::new("src/v3/std/induction.dag", 31281, 31303), - }, - binding: Some(PayloadBinding { - binding_name: "ts".to_string(), - payload_port: PortId(778), - }), - }, - Path { - body: NodeId(666), - output: PortId(783), - pattern: BranchPattern::UnresolvedVariant { - name: "ForeverBound".to_string(), - span: SourceSpan::new("src/v3/std/induction.dag", 31386, 31398), - }, - binding: None, - }, - Path { - body: NodeId(668), - output: PortId(785), - pattern: BranchPattern::UnresolvedVariant { - name: "ErrorBound".to_string(), - span: SourceSpan::new("src/v3/std/induction.dag", 31435, 31445), - }, - binding: None, - }, - ], - output: PortId(786), - span: SourceSpan::new("src/v3/std/induction.dag", 31033, 31486), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(670), - name: "cost_bound_to_symbolic".to_string(), - value: PortId(786), - params: vec![PortId(766)], - span: SourceSpan::new("src/v3/std/induction.dag", 31033, 31486), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(671), - target: TransformTarget::UnresolvedFieldProject { - field_label: "param".to_string(), - }, - inputs: vec![PortId(788)], - output: PortId(789), - span: SourceSpan::new("src/v3/std/induction.dag", 31581, 31589), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(672), - target: TransformTarget::UnresolvedFieldProject { - field_label: "exponent".to_string(), - }, - inputs: vec![PortId(788)], - output: PortId(790), - span: SourceSpan::new("src/v3/std/induction.dag", 31591, 31602), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(673), - data: LiteralBits::String( - "CostBound named polynomial atom lacks structural SizeVariable port".to_string(), - ), - output: PortId(791), - span: SourceSpan::new("src/v3/std/induction.dag", 31626, 31694), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(674), - target: TransformTarget::Callable(DeclarationId(2215)), - inputs: vec![PortId(791)], - output: PortId(792), - span: SourceSpan::new("src/v3/std/induction.dag", 31614, 31695), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(675), - target: TransformTarget::UnresolvedFieldProject { - field_label: "param".to_string(), - }, - inputs: vec![PortId(793)], - output: PortId(794), - span: SourceSpan::new("src/v3/std/induction.dag", 31710, 31718), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(676), - data: LiteralBits::String( - "CostBound named log atom lacks structural SizeVariable port".to_string(), - ), - output: PortId(795), - span: SourceSpan::new("src/v3/std/induction.dag", 31742, 31803), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(677), - target: TransformTarget::Callable(DeclarationId(2215)), - inputs: vec![PortId(795)], - output: PortId(796), - span: SourceSpan::new("src/v3/std/induction.dag", 31730, 31804), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(678), - input: PortId(787), - paths: vec![ - Path { - body: NodeId(674), - output: PortId(792), - pattern: BranchPattern::UnresolvedVariant { - name: "PolyCost".to_string(), - span: SourceSpan::new("src/v3/std/induction.dag", 31570, 31604), - }, - binding: Some(PayloadBinding { - binding_name: "__payload_31570_31604".to_string(), - payload_port: PortId(788), - }), - }, - Path { - body: NodeId(677), - output: PortId(796), - pattern: BranchPattern::UnresolvedVariant { - name: "LogCost".to_string(), - span: SourceSpan::new("src/v3/std/induction.dag", 31700, 31720), - }, - binding: Some(PayloadBinding { - binding_name: "p".to_string(), - payload_port: PortId(793), - }), - }, - ], - output: PortId(797), - span: SourceSpan::new("src/v3/std/induction.dag", 31553, 31808), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(679), - name: "atomic_cost_to_symbolic".to_string(), - value: PortId(797), - params: vec![PortId(787)], - span: SourceSpan::new("src/v3/std/induction.dag", 31553, 31808), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(680), - target: TransformTarget::Callable(DeclarationId(1205)), - inputs: vec![PortId(798)], - output: PortId(799), - span: SourceSpan::new("src/v3/std/induction.dag", 31995, 32029), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(681), - name: "product_term_to_symbolic".to_string(), - value: PortId(799), - params: vec![PortId(798)], - span: SourceSpan::new("src/v3/std/induction.dag", 31995, 32029), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(682), - target: TransformTarget::ResolvedFieldProject { - field_label: "nodes".to_string(), - }, - inputs: vec![PortId(800)], - output: PortId(801), - span: SourceSpan::new("src/v3/std/workflows.dag", 1007, 1012), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(683), - name: "behavior_spine".to_string(), - value: PortId(801), - params: vec![PortId(800)], - span: SourceSpan::new("src/v3/std/workflows.dag", 1005, 1012), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(684), - data: LiteralBits::String("src/v3/std/timing_lens.dag".to_string()), - output: PortId(802), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 1586, 1614), - lane2_workflow: None, - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(685), - name: "timing_lens_module_path_witness".to_string(), - value: PortId(802), - params: vec![], - span: SourceSpan::new("src/v3/std/timing_lens.dag", 1586, 1614), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(686), - target: TransformTarget::Callable(DeclarationId(1252)), - inputs: vec![ - PortId(803), - PortId(804), - PortId(805), - PortId(806), - PortId(807), - ], - output: PortId(808), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 7446, 7589), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(687), - name: "gate_62_file_attachment_demo_record".to_string(), - value: PortId(808), - params: vec![ - PortId(803), - PortId(804), - PortId(805), - PortId(806), - PortId(807), - ], - span: SourceSpan::new("src/v3/std/timing_lens.dag", 7446, 7589), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(688), - target: TransformTarget::Callable(DeclarationId(2694)), - inputs: vec![], - output: PortId(809), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 9640, 9650), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(689), - name: "timing_measurement_unobserved".to_string(), - value: PortId(809), - params: vec![], - span: SourceSpan::new("src/v3/std/timing_lens.dag", 9640, 9650), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(690), - target: TransformTarget::Callable(DeclarationId(2694)), - inputs: vec![], - output: PortId(813), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 9958, 9968), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(691), - target: TransformTarget::Callable(DeclarationId(2694)), - inputs: vec![], - output: PortId(814), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10020, 10030), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(692), - target: TransformTarget::Callable(DeclarationId(2696)), - inputs: vec![], - output: PortId(815), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10048, 10053), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(693), - target: TransformTarget::Callable(DeclarationId(2696)), - inputs: vec![], - output: PortId(816), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10075, 10080), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(694), - target: TransformTarget::UnresolvedFieldProject { - field_label: "duration".to_string(), - }, - inputs: vec![PortId(817)], - output: PortId(818), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10100, 10111), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(695), - target: TransformTarget::Callable(DeclarationId(2696)), - inputs: vec![], - output: PortId(819), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10117, 10122), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(696), - input: PortId(811), - paths: vec![ - Path { - body: NodeId(691), - output: PortId(814), - pattern: BranchPattern::UnresolvedVariant { - name: "Unobserved".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10006, 10016), - }, - binding: None, - }, - Path { - body: NodeId(692), - output: PortId(815), - pattern: BranchPattern::UnresolvedVariant { - name: "Stale".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10039, 10044), - }, - binding: None, - }, - Path { - body: NodeId(693), - output: PortId(816), - pattern: BranchPattern::UnresolvedVariant { - name: "Ambiguous".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10062, 10071), - }, - binding: None, - }, - Path { - body: NodeId(695), - output: PortId(819), - pattern: BranchPattern::UnresolvedVariant { - name: "Observed".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10089, 10113), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(817), - }), - }, - ], - output: PortId(820), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 9988, 10130), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(697), - target: TransformTarget::Callable(DeclarationId(2694)), - inputs: vec![], - output: PortId(821), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10186, 10196), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(698), - target: TransformTarget::Callable(DeclarationId(2696)), - inputs: vec![], - output: PortId(822), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10214, 10219), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(699), - target: TransformTarget::Callable(DeclarationId(2695)), - inputs: vec![], - output: PortId(823), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10241, 10250), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(700), - target: TransformTarget::UnresolvedFieldProject { - field_label: "duration".to_string(), - }, - inputs: vec![PortId(824)], - output: PortId(825), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10270, 10281), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(701), - target: TransformTarget::Callable(DeclarationId(2695)), - inputs: vec![], - output: PortId(826), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10287, 10296), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(702), - input: PortId(811), - paths: vec![ - Path { - body: NodeId(697), - output: PortId(821), - pattern: BranchPattern::UnresolvedVariant { - name: "Unobserved".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10172, 10182), - }, - binding: None, - }, - Path { - body: NodeId(698), - output: PortId(822), - pattern: BranchPattern::UnresolvedVariant { - name: "Stale".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10205, 10210), - }, - binding: None, - }, - Path { - body: NodeId(699), - output: PortId(823), - pattern: BranchPattern::UnresolvedVariant { - name: "Ambiguous".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10228, 10237), - }, - binding: None, - }, - Path { - body: NodeId(701), - output: PortId(826), - pattern: BranchPattern::UnresolvedVariant { - name: "Observed".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10259, 10283), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(824), - }), - }, - ], - output: PortId(827), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10154, 10304), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(703), - target: TransformTarget::UnresolvedFieldProject { - field_label: "duration".to_string(), - }, - inputs: vec![PortId(828)], - output: PortId(829), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10320, 10332), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(704), - target: TransformTarget::Callable(DeclarationId(2694)), - inputs: vec![], - output: PortId(830), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10376, 10386), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(705), - target: TransformTarget::Callable(DeclarationId(2696)), - inputs: vec![], - output: PortId(831), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10404, 10409), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(706), - target: TransformTarget::Callable(DeclarationId(2695)), - inputs: vec![], - output: PortId(832), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10431, 10440), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(707), - target: TransformTarget::UnresolvedFieldProject { - field_label: "duration".to_string(), - }, - inputs: vec![PortId(833)], - output: PortId(834), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10460, 10472), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(708), - target: TransformTarget::UnresolvedFieldProject { - field_label: "count".to_string(), - }, - inputs: vec![PortId(829)], - output: PortId(835), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10552, 10557), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(709), - target: TransformTarget::UnresolvedFieldProject { - field_label: "count".to_string(), - }, - inputs: vec![PortId(834)], - output: PortId(836), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10563, 10568), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(710), - target: TransformTarget::Operator(OperatorKind::Arithmetic(ArithmeticOp::Add)), - inputs: vec![PortId(835), PortId(836)], - output: PortId(837), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10549, 10568), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(711), - target: TransformTarget::Callable(DeclarationId(1249)), - inputs: vec![PortId(837)], - output: PortId(838), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10540, 10570), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(712), - target: TransformTarget::Callable(DeclarationId(2693)), - inputs: vec![PortId(838)], - output: PortId(839), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10519, 10572), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(713), - target: TransformTarget::UnresolvedFieldProject { - field_label: "count".to_string(), - }, - inputs: vec![PortId(829)], - output: PortId(840), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10641, 10646), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(714), - target: TransformTarget::UnresolvedFieldProject { - field_label: "count".to_string(), - }, - inputs: vec![PortId(834)], - output: PortId(841), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10652, 10657), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(715), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Gt)), - inputs: vec![PortId(840), PortId(841)], - output: PortId(842), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10638, 10657), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(716), - input: PortId(842), - paths: vec![ - Path { - body: NodeId(703), - output: PortId(829), - pattern: BranchPattern::UnresolvedVariant { - name: "True".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10663, 10665), - }, - binding: None, - }, - Path { - body: NodeId(707), - output: PortId(834), - pattern: BranchPattern::UnresolvedVariant { - name: "False".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10671, 10673), - }, - binding: None, - }, - ], - output: PortId(843), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10635, 10673), - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(717), - target: TransformTarget::Callable(DeclarationId(2693)), - inputs: vec![PortId(843)], - output: PortId(844), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10600, 10688), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(718), - input: PortId(812), - paths: vec![ - Path { - body: NodeId(712), - output: PortId(839), - pattern: BranchPattern::UnresolvedVariant { - name: "True".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10519, 10572), - }, - binding: None, - }, - Path { - body: NodeId(717), - output: PortId(844), - pattern: BranchPattern::UnresolvedVariant { - name: "False".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10600, 10688), - }, - binding: None, - }, - ], - output: PortId(845), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10488, 10688), - emit_participation: None, - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(719), - input: PortId(811), - paths: vec![ - Path { - body: NodeId(704), - output: PortId(830), - pattern: BranchPattern::UnresolvedVariant { - name: "Unobserved".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10362, 10372), - }, - binding: None, - }, - Path { - body: NodeId(705), - output: PortId(831), - pattern: BranchPattern::UnresolvedVariant { - name: "Stale".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10395, 10400), - }, - binding: None, - }, - Path { - body: NodeId(706), - output: PortId(832), - pattern: BranchPattern::UnresolvedVariant { - name: "Ambiguous".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10418, 10427), - }, - binding: None, - }, - Path { - body: NodeId(718), - output: PortId(845), - pattern: BranchPattern::UnresolvedVariant { - name: "Observed".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10449, 10474), - }, - binding: Some(PayloadBinding { - binding_name: "bx".to_string(), - payload_port: PortId(833), - }), - }, - ], - output: PortId(846), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10344, 10696), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(720), - input: PortId(810), - paths: vec![ - Path { - body: NodeId(690), - output: PortId(813), - pattern: BranchPattern::UnresolvedVariant { - name: "Unobserved".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 9944, 9954), - }, - binding: None, - }, - Path { - body: NodeId(696), - output: PortId(820), - pattern: BranchPattern::UnresolvedVariant { - name: "Stale".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 9973, 9978), - }, - binding: None, - }, - Path { - body: NodeId(702), - output: PortId(827), - pattern: BranchPattern::UnresolvedVariant { - name: "Ambiguous".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10135, 10144), - }, - binding: None, - }, - Path { - body: NodeId(719), - output: PortId(846), - pattern: BranchPattern::UnresolvedVariant { - name: "Observed".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10309, 10334), - }, - binding: Some(PayloadBinding { - binding_name: "ax".to_string(), - payload_port: PortId(828), - }), - }, - ], - output: PortId(847), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 9930, 10700), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(721), - name: "timing_measurement_lens_combine".to_string(), - value: PortId(847), - params: vec![PortId(810), PortId(811), PortId(812)], - span: SourceSpan::new("src/v3/std/timing_lens.dag", 9930, 10700), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(722), - data: LiteralBits::Bool(true), - output: PortId(850), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10906, 10910), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(723), - target: TransformTarget::Callable(DeclarationId(1260)), - inputs: vec![PortId(848), PortId(849), PortId(850)], - output: PortId(851), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10868, 10911), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(724), - name: "timing_sequential_op".to_string(), - value: PortId(851), - params: vec![PortId(848), PortId(849)], - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10868, 10911), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(725), - data: LiteralBits::Int("0".to_string()), - output: PortId(852), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10963, 10964), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(726), - target: TransformTarget::Callable(DeclarationId(1249)), - inputs: vec![PortId(852)], - output: PortId(853), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10954, 10966), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(727), - name: "nanoseconds_zero".to_string(), - value: PortId(853), - params: vec![], - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10954, 10966), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(728), - target: TransformTarget::Callable(DeclarationId(1262)), - inputs: vec![], - output: PortId(854), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 11046, 11064), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(729), - target: TransformTarget::Callable(DeclarationId(2693)), - inputs: vec![PortId(854)], - output: PortId(855), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 11025, 11066), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(730), - name: "timing_sequential_identity".to_string(), - value: PortId(855), - params: vec![], - span: SourceSpan::new("src/v3/std/timing_lens.dag", 11025, 11066), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(731), - data: LiteralBits::Bool(false), - output: PortId(858), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 11253, 11258), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(732), - target: TransformTarget::Callable(DeclarationId(1260)), - inputs: vec![PortId(856), PortId(857), PortId(858)], - output: PortId(859), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 11215, 11259), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(733), - name: "timing_branch_op".to_string(), - value: PortId(859), - params: vec![PortId(856), PortId(857)], - span: SourceSpan::new("src/v3/std/timing_lens.dag", 11215, 11259), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(734), - data: LiteralBits::String( - "R3 Gap 9 row #106 timing-lens diagnostic roundtrip".to_string(), - ), - output: PortId(860), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 11877, 11929), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { id: NodeId(735), data: LiteralBits::String("thread timing measurement/budget source spans through gate #58 enforcement and replace this scaffold diagnostic with a generated/data-backed LiveCorrection".to_string()), output: PortId(861), span: SourceSpan::new("src/v3/std/timing_lens.dag", 11950, 12107), lane2_workflow: None })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(736), - target: TransformTarget::Callable(DeclarationId(1050)), - inputs: vec![PortId(860), PortId(861)], - output: PortId(862), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 11864, 12111), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(737), - name: "timing_lens_correction_retirement_plan".to_string(), - value: PortId(862), - params: vec![], - span: SourceSpan::new("src/v3/std/timing_lens.dag", 11864, 12111), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Value(ValueNode { id: NodeId(738), data: LiteralBits::String("TimingLensScaffoldDiagnostic does not yet compute a source-level live correction witness".to_string()), output: PortId(863), span: SourceSpan::new("src/v3/std/timing_lens.dag", 12192, 12282), lane2_workflow: None })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(739), - target: TransformTarget::Callable(DeclarationId(1265)), - inputs: vec![], - output: PortId(864), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 12288, 12328), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(740), - target: TransformTarget::Callable(DeclarationId(2376)), - inputs: vec![PortId(863), PortId(864)], - output: PortId(865), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 12168, 12332), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(741), - name: "timing_lens_deferred_correction".to_string(), - value: PortId(865), - params: vec![], - span: SourceSpan::new("src/v3/std/timing_lens.dag", 12168, 12332), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(742), - target: TransformTarget::UnresolvedFieldProject { - field_label: "span".to_string(), - }, - inputs: vec![PortId(867)], - output: PortId(868), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 12603, 12607), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(743), - target: TransformTarget::UnresolvedFieldProject { - field_label: "span".to_string(), - }, - inputs: vec![PortId(869)], - output: PortId(870), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 12630, 12634), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(744), - target: TransformTarget::UnresolvedFieldProject { - field_label: "span".to_string(), - }, - inputs: vec![PortId(871)], - output: PortId(872), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 12656, 12660), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(745), - target: TransformTarget::UnresolvedFieldProject { - field_label: "span".to_string(), - }, - inputs: vec![PortId(873)], - output: PortId(874), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 12678, 12682), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(746), - target: TransformTarget::UnresolvedFieldProject { - field_label: "span".to_string(), - }, - inputs: vec![PortId(875)], - output: PortId(876), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 12706, 12710), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(747), - input: PortId(866), - paths: vec![ - Path { - body: NodeId(742), - output: PortId(868), - pattern: BranchPattern::UnresolvedVariant { - name: "Value".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 12589, 12597), - }, - binding: Some(PayloadBinding { - binding_name: "v".to_string(), - payload_port: PortId(867), - }), - }, - Path { - body: NodeId(743), - output: PortId(870), - pattern: BranchPattern::UnresolvedVariant { - name: "Transform".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 12612, 12624), - }, - binding: Some(PayloadBinding { - binding_name: "t".to_string(), - payload_port: PortId(869), - }), - }, - Path { - body: NodeId(744), - output: PortId(872), - pattern: BranchPattern::UnresolvedVariant { - name: "Branch".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 12639, 12649), - }, - binding: Some(PayloadBinding { - binding_name: "br".to_string(), - payload_port: PortId(871), - }), - }, - Path { - body: NodeId(745), - output: PortId(874), - pattern: BranchPattern::UnresolvedVariant { - name: "Loop".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 12665, 12672), - }, - binding: Some(PayloadBinding { - binding_name: "l".to_string(), - payload_port: PortId(873), - }), - }, - Path { - body: NodeId(746), - output: PortId(876), - pattern: BranchPattern::UnresolvedVariant { - name: "Bind".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 12687, 12697), - }, - binding: Some(PayloadBinding { - binding_name: "bind".to_string(), - payload_port: PortId(875), - }), - }, - ], - output: PortId(877), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 12575, 12714), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(748), - name: "timing_lens_behavior_span".to_string(), - value: PortId(877), - params: vec![PortId(866)], - span: SourceSpan::new("src/v3/std/timing_lens.dag", 12575, 12714), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(749), - target: TransformTarget::Callable(DeclarationId(2369)), - inputs: vec![], - output: PortId(880), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 13082, 13094), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(750), - target: TransformTarget::Callable(DeclarationId(2377)), - inputs: vec![PortId(880)], - output: PortId(881), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 13069, 13095), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(751), - target: TransformTarget::Callable(DeclarationId(1266)), - inputs: vec![], - output: PortId(882), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 13143, 13176), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(752), - target: TransformTarget::Callable(DeclarationId(1055)), - inputs: vec![PortId(881), PortId(879), PortId(878), PortId(882)], - output: PortId(883), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 13057, 13180), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(753), - name: "timing_lens_scaffold_non_evidence_diagnostic".to_string(), - value: PortId(883), - params: vec![PortId(878), PortId(879)], - span: SourceSpan::new("src/v3/std/timing_lens.dag", 13057, 13180), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(754), - target: TransformTarget::Callable(DeclarationId(1248)), - inputs: vec![], - output: PortId(884), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 13487, 13520), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(755), - data: LiteralBits::Int("0".to_string()), - output: PortId(885), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 13532, 13533), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(756), - data: LiteralBits::Int("0".to_string()), - output: PortId(886), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 13543, 13544), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(757), - target: TransformTarget::Callable(DeclarationId(155)), - inputs: vec![PortId(884), PortId(885), PortId(886)], - output: PortId(887), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 13475, 13548), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(758), - name: "timing_lens_degenerate_empty_dag_span".to_string(), - value: PortId(887), - params: vec![], - span: SourceSpan::new("src/v3/std/timing_lens.dag", 13475, 13548), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(759), - target: TransformTarget::Callable(DeclarationId(1247)), - inputs: vec![PortId(888)], - output: PortId(890), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 14101, 14118), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(760), - target: TransformTarget::ResolvedFieldProject { - field_label: "declarations".to_string(), - }, - inputs: vec![PortId(888)], - output: PortId(891), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 14148, 14160), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(761), - target: TransformTarget::UnresolvedFieldProject { - field_label: "head".to_string(), - }, - inputs: vec![PortId(892)], - output: PortId(893), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 14283, 14287), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(762), - target: TransformTarget::UnresolvedFieldProject { - field_label: "span".to_string(), - }, - inputs: vec![PortId(893)], - output: PortId(894), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 14288, 14292), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(763), - target: TransformTarget::Callable(DeclarationId(1268)), - inputs: vec![PortId(889), PortId(894)], - output: PortId(895), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 14229, 14293), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(764), - target: TransformTarget::Callable(DeclarationId(2407)), - inputs: vec![PortId(895)], - output: PortId(896), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 14193, 14305), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(765), - target: TransformTarget::Callable(DeclarationId(1269)), - inputs: vec![], - output: PortId(897), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 14449, 14488), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(766), - target: TransformTarget::Callable(DeclarationId(1268)), - inputs: vec![PortId(889), PortId(897)], - output: PortId(898), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 14369, 14502), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(767), - target: TransformTarget::Callable(DeclarationId(2407)), - inputs: vec![PortId(898)], - output: PortId(899), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 14333, 14514), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(768), - input: PortId(891), - paths: vec![ - Path { - body: NodeId(764), - output: PortId(896), - pattern: BranchPattern::UnresolvedVariant { - name: "Cons".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 14171, 14179), - }, - binding: Some(PayloadBinding { - binding_name: "dd".to_string(), - payload_port: PortId(892), - }), - }, - Path { - body: NodeId(767), - output: PortId(899), - pattern: BranchPattern::UnresolvedVariant { - name: "Empty".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 14314, 14319), - }, - binding: None, - }, - ], - output: PortId(900), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 14140, 14522), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(769), - target: TransformTarget::UnresolvedFieldProject { - field_label: "head".to_string(), - }, - inputs: vec![PortId(901)], - output: PortId(902), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 14688, 14692), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(770), - target: TransformTarget::Callable(DeclarationId(1267)), - inputs: vec![PortId(902)], - output: PortId(903), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 14654, 14693), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(771), - target: TransformTarget::Callable(DeclarationId(1268)), - inputs: vec![PortId(889), PortId(903)], - output: PortId(904), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 14582, 14703), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(772), - target: TransformTarget::Callable(DeclarationId(2407)), - inputs: vec![PortId(904)], - output: PortId(905), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 14550, 14711), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(773), - input: PortId(890), - paths: vec![ - Path { - body: NodeId(768), - output: PortId(900), - pattern: BranchPattern::UnresolvedVariant { - name: "Empty".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 14125, 14130), - }, - binding: None, - }, - Path { - body: NodeId(772), - output: PortId(905), - pattern: BranchPattern::UnresolvedVariant { - name: "Cons".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 14527, 14540), - }, - binding: Some(PayloadBinding { - binding_name: "payload".to_string(), - payload_port: PortId(901), - }), - }, - ], - output: PortId(906), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 14095, 14715), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(774), - name: "timing_lens_validate_non_observed".to_string(), - value: PortId(906), - params: vec![PortId(888), PortId(889)], - span: SourceSpan::new("src/v3/std/timing_lens.dag", 14095, 14715), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(775), - target: TransformTarget::UnresolvedFieldProject { - field_label: "duration".to_string(), - }, - inputs: vec![PortId(909)], - output: PortId(910), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 15166, 15177), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(776), - target: TransformTarget::Callable(DeclarationId(1259)), - inputs: vec![], - output: PortId(912), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 15229, 15260), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(777), - target: TransformTarget::Callable(DeclarationId(1259)), - inputs: vec![], - output: PortId(914), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 15283, 15314), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(778), - input: PortId(908), - paths: vec![ - Path { - body: NodeId(776), - output: PortId(912), - pattern: BranchPattern::UnresolvedVariant { - name: "Cardinality".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 15211, 15225), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(911), - }), - }, - Path { - body: NodeId(777), - output: PortId(914), - pattern: BranchPattern::UnresolvedVariant { - name: "Descent".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 15269, 15279), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(913), - }), - }, - ], - output: PortId(915), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 15189, 15322), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(779), - target: TransformTarget::Callable(DeclarationId(2694)), - inputs: vec![], - output: PortId(916), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 15341, 15351), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(780), - target: TransformTarget::Callable(DeclarationId(2695)), - inputs: vec![], - output: PortId(917), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 15369, 15378), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(781), - target: TransformTarget::Callable(DeclarationId(2696)), - inputs: vec![], - output: PortId(918), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 15392, 15397), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(782), - input: PortId(907), - paths: vec![ - Path { - body: NodeId(778), - output: PortId(915), - pattern: BranchPattern::UnresolvedVariant { - name: "Observed".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 15155, 15179), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(909), - }), - }, - Path { - body: NodeId(779), - output: PortId(916), - pattern: BranchPattern::UnresolvedVariant { - name: "Unobserved".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 15327, 15337), - }, - binding: None, - }, - Path { - body: NodeId(780), - output: PortId(917), - pattern: BranchPattern::UnresolvedVariant { - name: "Ambiguous".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 15356, 15365), - }, - binding: None, - }, - Path { - body: NodeId(781), - output: PortId(918), - pattern: BranchPattern::UnresolvedVariant { - name: "Stale".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 15383, 15388), - }, - binding: None, - }, - ], - output: PortId(919), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 15138, 15401), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(783), - name: "timing_measurement_iterate".to_string(), - value: PortId(919), - params: vec![PortId(907), PortId(908)], - span: SourceSpan::new("src/v3/std/timing_lens.dag", 15138, 15401), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(784), - target: TransformTarget::Callable(DeclarationId(1247)), - inputs: vec![PortId(920)], - output: PortId(923), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16297, 16314), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(785), - target: TransformTarget::Callable(DeclarationId(725)), - inputs: vec![PortId(923)], - output: PortId(924), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16288, 16315), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(786), - target: TransformTarget::Callable(DeclarationId(1259)), - inputs: vec![], - output: PortId(925), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16330, 16361), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(787), - target: TransformTarget::Callable(DeclarationId(2703)), - inputs: vec![PortId(925)], - output: PortId(926), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16321, 16362), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(788), - target: TransformTarget::Callable(DeclarationId(1259)), - inputs: vec![], - output: PortId(927), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16377, 16408), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(789), - target: TransformTarget::Callable(DeclarationId(2704)), - inputs: vec![PortId(927)], - output: PortId(928), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16368, 16409), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(790), - input: PortId(924), - paths: vec![ - Path { - body: NodeId(787), - output: PortId(926), - pattern: BranchPattern::UnresolvedVariant { - name: "True".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16321, 16362), - }, - binding: None, - }, - Path { - body: NodeId(789), - output: PortId(928), - pattern: BranchPattern::UnresolvedVariant { - name: "False".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16368, 16409), - }, - binding: None, - }, - ], - output: PortId(929), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16285, 16409), - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(791), - target: TransformTarget::Callable(DeclarationId(1247)), - inputs: vec![PortId(920)], - output: PortId(931), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16448, 16465), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(792), - target: TransformTarget::Callable(DeclarationId(725)), - inputs: vec![PortId(931)], - output: PortId(932), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16439, 16466), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(793), - target: TransformTarget::Callable(DeclarationId(1259)), - inputs: vec![], - output: PortId(933), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16481, 16512), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(794), - target: TransformTarget::Callable(DeclarationId(2705)), - inputs: vec![PortId(933)], - output: PortId(934), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16472, 16513), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(795), - target: TransformTarget::Callable(DeclarationId(1259)), - inputs: vec![], - output: PortId(935), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16528, 16559), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(796), - target: TransformTarget::Callable(DeclarationId(2706)), - inputs: vec![PortId(935)], - output: PortId(936), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16519, 16560), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(797), - input: PortId(932), - paths: vec![ - Path { - body: NodeId(794), - output: PortId(934), - pattern: BranchPattern::UnresolvedVariant { - name: "True".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16472, 16513), - }, - binding: None, - }, - Path { - body: NodeId(796), - output: PortId(936), - pattern: BranchPattern::UnresolvedVariant { - name: "False".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16519, 16560), - }, - binding: None, - }, - ], - output: PortId(937), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16436, 16560), - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(798), - target: TransformTarget::Callable(DeclarationId(1247)), - inputs: vec![PortId(920)], - output: PortId(939), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16596, 16613), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(799), - target: TransformTarget::Callable(DeclarationId(725)), - inputs: vec![PortId(939)], - output: PortId(940), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16587, 16614), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(800), - target: TransformTarget::Callable(DeclarationId(1259)), - inputs: vec![], - output: PortId(941), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16629, 16660), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(801), - target: TransformTarget::Callable(DeclarationId(2707)), - inputs: vec![PortId(941)], - output: PortId(942), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16620, 16661), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(802), - target: TransformTarget::Callable(DeclarationId(1259)), - inputs: vec![], - output: PortId(943), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16676, 16707), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(803), - target: TransformTarget::Callable(DeclarationId(2708)), - inputs: vec![PortId(943)], - output: PortId(944), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16667, 16708), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(804), - input: PortId(940), - paths: vec![ - Path { - body: NodeId(801), - output: PortId(942), - pattern: BranchPattern::UnresolvedVariant { - name: "True".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16620, 16661), - }, - binding: None, - }, - Path { - body: NodeId(803), - output: PortId(944), - pattern: BranchPattern::UnresolvedVariant { - name: "False".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16667, 16708), - }, - binding: None, - }, - ], - output: PortId(945), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16584, 16708), - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(805), - target: TransformTarget::Callable(DeclarationId(1247)), - inputs: vec![PortId(920)], - output: PortId(947), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16742, 16759), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(806), - target: TransformTarget::Callable(DeclarationId(725)), - inputs: vec![PortId(947)], - output: PortId(948), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16733, 16760), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(807), - target: TransformTarget::Callable(DeclarationId(1259)), - inputs: vec![], - output: PortId(949), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16775, 16806), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(808), - target: TransformTarget::Callable(DeclarationId(2709)), - inputs: vec![PortId(949)], - output: PortId(950), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16766, 16807), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(809), - target: TransformTarget::Callable(DeclarationId(1259)), - inputs: vec![], - output: PortId(951), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16822, 16853), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(810), - target: TransformTarget::Callable(DeclarationId(2710)), - inputs: vec![PortId(951)], - output: PortId(952), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16813, 16854), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(811), - input: PortId(948), - paths: vec![ - Path { - body: NodeId(808), - output: PortId(950), - pattern: BranchPattern::UnresolvedVariant { - name: "True".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16766, 16807), - }, - binding: None, - }, - Path { - body: NodeId(810), - output: PortId(952), - pattern: BranchPattern::UnresolvedVariant { - name: "False".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16813, 16854), - }, - binding: None, - }, - ], - output: PortId(953), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16730, 16854), - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(812), - target: TransformTarget::Callable(DeclarationId(1247)), - inputs: vec![PortId(920)], - output: PortId(955), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16888, 16905), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(813), - target: TransformTarget::Callable(DeclarationId(725)), - inputs: vec![PortId(955)], - output: PortId(956), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16879, 16906), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(814), - target: TransformTarget::Callable(DeclarationId(1259)), - inputs: vec![], - output: PortId(957), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16921, 16952), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(815), - target: TransformTarget::Callable(DeclarationId(2711)), - inputs: vec![PortId(957)], - output: PortId(958), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16912, 16953), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(816), - target: TransformTarget::Callable(DeclarationId(1259)), - inputs: vec![], - output: PortId(959), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16968, 16999), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(817), - target: TransformTarget::Callable(DeclarationId(2712)), - inputs: vec![PortId(959)], - output: PortId(960), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16959, 17000), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(818), - input: PortId(956), - paths: vec![ - Path { - body: NodeId(815), - output: PortId(958), - pattern: BranchPattern::UnresolvedVariant { - name: "True".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16912, 16953), - }, - binding: None, - }, - Path { - body: NodeId(817), - output: PortId(960), - pattern: BranchPattern::UnresolvedVariant { - name: "False".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16959, 17000), - }, - binding: None, - }, - ], - output: PortId(961), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16876, 17000), - emit_participation: None, - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(819), - input: PortId(921), - paths: vec![ - Path { - body: NodeId(790), - output: PortId(929), - pattern: BranchPattern::UnresolvedVariant { - name: "Value".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16267, 16275), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(922), - }), - }, - Path { - body: NodeId(797), - output: PortId(937), - pattern: BranchPattern::UnresolvedVariant { - name: "Transform".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16414, 16426), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(930), - }), - }, - Path { - body: NodeId(804), - output: PortId(945), - pattern: BranchPattern::UnresolvedVariant { - name: "Branch".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16565, 16574), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(938), - }), - }, - Path { - body: NodeId(811), - output: PortId(953), - pattern: BranchPattern::UnresolvedVariant { - name: "Loop".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16713, 16720), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(946), - }), - }, - Path { - body: NodeId(818), - output: PortId(961), - pattern: BranchPattern::UnresolvedVariant { - name: "Bind".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16859, 16866), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(954), - }), - }, - ], - output: PortId(962), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16253, 17004), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(820), - name: "timing_lens_read".to_string(), - value: PortId(962), - params: vec![PortId(920), PortId(921)], - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16253, 17004), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(821), - target: TransformTarget::UnresolvedFieldProject { - field_label: "duration".to_string(), - }, - inputs: vec![PortId(965)], - output: PortId(966), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 17125, 17136), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(822), - target: TransformTarget::Callable(DeclarationId(1247)), - inputs: vec![PortId(963)], - output: PortId(967), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 17160, 17177), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(823), - target: TransformTarget::Callable(DeclarationId(725)), - inputs: vec![PortId(967)], - output: PortId(968), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 17151, 17178), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(824), - target: TransformTarget::Callable(DeclarationId(2406)), - inputs: vec![], - output: PortId(969), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 17184, 17196), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(825), - target: TransformTarget::Callable(DeclarationId(2406)), - inputs: vec![], - output: PortId(970), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 17202, 17214), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(826), - input: PortId(968), - paths: vec![ - Path { - body: NodeId(824), - output: PortId(969), - pattern: BranchPattern::UnresolvedVariant { - name: "True".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 17184, 17196), - }, - binding: None, - }, - Path { - body: NodeId(825), - output: PortId(970), - pattern: BranchPattern::UnresolvedVariant { - name: "False".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 17202, 17214), - }, - binding: None, - }, - ], - output: PortId(971), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 17148, 17214), - emit_participation: None, - })); - nodes.push(Behavior::Value(ValueNode { id: NodeId(827), data: LiteralBits::String("timing_lens_validate: TimingMeasurement.Unobserved is not admissible evidence at this scaffold (missing external timing row).".to_string()), output: PortId(972), span: SourceSpan::new("src/v3/std/timing_lens.dag", 17293, 17420), lane2_workflow: None })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(828), - target: TransformTarget::Callable(DeclarationId(1270)), - inputs: vec![PortId(963), PortId(972)], - output: PortId(973), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 17239, 17428), - })); - nodes.push(Behavior::Value(ValueNode { id: NodeId(829), data: LiteralBits::String("timing_lens_validate: TimingMeasurement.Ambiguous is not admissible evidence at this scaffold (conflicting timing facts).".to_string()), output: PortId(974), span: SourceSpan::new("src/v3/std/timing_lens.dag", 17506, 17629), lane2_workflow: None })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(830), - target: TransformTarget::Callable(DeclarationId(1270)), - inputs: vec![PortId(963), PortId(974)], - output: PortId(975), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 17452, 17637), - })); - nodes.push(Behavior::Value(ValueNode { id: NodeId(831), data: LiteralBits::String("timing_lens_validate: TimingMeasurement.Stale is not admissible evidence at this scaffold (digest/run mismatch vs attachment).".to_string()), output: PortId(976), span: SourceSpan::new("src/v3/std/timing_lens.dag", 17711, 17839), lane2_workflow: None })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(832), - target: TransformTarget::Callable(DeclarationId(1270)), - inputs: vec![PortId(963), PortId(976)], - output: PortId(977), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 17657, 17847), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(833), - input: PortId(964), - paths: vec![ - Path { - body: NodeId(826), - output: PortId(971), - pattern: BranchPattern::UnresolvedVariant { - name: "Observed".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 17114, 17138), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(965), - }), - }, - Path { - body: NodeId(828), - output: PortId(973), - pattern: BranchPattern::UnresolvedVariant { - name: "Unobserved".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 17219, 17229), - }, - binding: None, - }, - Path { - body: NodeId(830), - output: PortId(975), - pattern: BranchPattern::UnresolvedVariant { - name: "Ambiguous".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 17433, 17442), - }, - binding: None, - }, - Path { - body: NodeId(832), - output: PortId(977), - pattern: BranchPattern::UnresolvedVariant { - name: "Stale".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 17642, 17647), - }, - binding: None, - }, - ], - output: PortId(978), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 17093, 17851), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(834), - name: "timing_lens_validate".to_string(), - value: PortId(978), - params: vec![PortId(963), PortId(964)], - span: SourceSpan::new("src/v3/std/timing_lens.dag", 17093, 17851), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(835), - data: LiteralBits::Int("999999999999999999".to_string()), - output: PortId(979), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19017, 19035), - lane2_workflow: None, - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(836), - name: "timing_enforcement_fault_sentinel_count".to_string(), - value: PortId(979), - params: vec![], - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19017, 19035), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(837), - target: TransformTarget::UnresolvedFieldProject { - field_label: "duration".to_string(), - }, - inputs: vec![PortId(981)], - output: PortId(982), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19148, 19159), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(838), - target: TransformTarget::Callable(DeclarationId(2698)), - inputs: vec![PortId(982)], - output: PortId(983), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19165, 19186), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(839), - target: TransformTarget::Callable(DeclarationId(2699)), - inputs: vec![], - output: PortId(984), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19205, 19221), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(840), - target: TransformTarget::Callable(DeclarationId(2699)), - inputs: vec![], - output: PortId(985), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19239, 19255), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(841), - target: TransformTarget::Callable(DeclarationId(2699)), - inputs: vec![], - output: PortId(986), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19269, 19285), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(842), - input: PortId(980), - paths: vec![ - Path { - body: NodeId(838), - output: PortId(983), - pattern: BranchPattern::UnresolvedVariant { - name: "Observed".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19137, 19161), - }, - binding: Some(PayloadBinding { - binding_name: "d".to_string(), - payload_port: PortId(981), - }), - }, - Path { - body: NodeId(839), - output: PortId(984), - pattern: BranchPattern::UnresolvedVariant { - name: "Unobserved".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19191, 19201), - }, - binding: None, - }, - Path { - body: NodeId(840), - output: PortId(985), - pattern: BranchPattern::UnresolvedVariant { - name: "Ambiguous".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19226, 19235), - }, - binding: None, - }, - Path { - body: NodeId(841), - output: PortId(986), - pattern: BranchPattern::UnresolvedVariant { - name: "Stale".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19260, 19265), - }, - binding: None, - }, - ], - output: PortId(987), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19123, 19289), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(843), - name: "timing_enforcement_project".to_string(), - value: PortId(987), - params: vec![PortId(980)], - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19123, 19289), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(844), - target: TransformTarget::UnresolvedFieldProject { - field_label: "duration".to_string(), - }, - inputs: vec![PortId(990)], - output: PortId(991), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19405, 19416), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(845), - target: TransformTarget::UnresolvedFieldProject { - field_label: "count".to_string(), - }, - inputs: vec![PortId(991)], - output: PortId(992), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19433, 19438), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(846), - target: TransformTarget::ResolvedFieldProject { - field_label: "max".to_string(), - }, - inputs: vec![PortId(989)], - output: PortId(993), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19450, 19453), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(847), - target: TransformTarget::ResolvedFieldProject { - field_label: "count".to_string(), - }, - inputs: vec![PortId(993)], - output: PortId(994), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19454, 19459), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(848), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Gt)), - inputs: vec![PortId(992), PortId(994)], - output: PortId(995), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19431, 19459), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(849), - data: LiteralBits::Int("0".to_string()), - output: PortId(996), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19465, 19466), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(850), - data: LiteralBits::Int("0".to_string()), - output: PortId(997), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19470, 19471), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(851), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(996), PortId(997)], - output: PortId(998), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19465, 19471), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(852), - data: LiteralBits::Int("0".to_string()), - output: PortId(999), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19477, 19478), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(853), - data: LiteralBits::Int("1".to_string()), - output: PortId(1000), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19482, 19483), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(854), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(999), PortId(1000)], - output: PortId(1001), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19477, 19483), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(855), - input: PortId(995), - paths: vec![ - Path { - body: NodeId(851), - output: PortId(998), - pattern: BranchPattern::UnresolvedVariant { - name: "True".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19465, 19471), - }, - binding: None, - }, - Path { - body: NodeId(854), - output: PortId(1001), - pattern: BranchPattern::UnresolvedVariant { - name: "False".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19477, 19483), - }, - binding: None, - }, - ], - output: PortId(1002), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19428, 19483), - emit_participation: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(856), - data: LiteralBits::Int("0".to_string()), - output: PortId(1003), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19502, 19503), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(857), - data: LiteralBits::Int("0".to_string()), - output: PortId(1004), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19507, 19508), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(858), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(1003), PortId(1004)], - output: PortId(1005), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19502, 19508), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(859), - data: LiteralBits::Int("0".to_string()), - output: PortId(1006), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19526, 19527), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(860), - data: LiteralBits::Int("0".to_string()), - output: PortId(1007), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19531, 19532), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(861), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(1006), PortId(1007)], - output: PortId(1008), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19526, 19532), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(862), - data: LiteralBits::Int("0".to_string()), - output: PortId(1009), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19546, 19547), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(863), - data: LiteralBits::Int("0".to_string()), - output: PortId(1010), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19551, 19552), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(864), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(1009), PortId(1010)], - output: PortId(1011), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19546, 19552), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(865), - input: PortId(988), - paths: vec![ - Path { - body: NodeId(855), - output: PortId(1002), - pattern: BranchPattern::UnresolvedVariant { - name: "Observed".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19394, 19418), - }, - binding: Some(PayloadBinding { - binding_name: "d".to_string(), - payload_port: PortId(990), - }), - }, - Path { - body: NodeId(858), - output: PortId(1005), - pattern: BranchPattern::UnresolvedVariant { - name: "Unobserved".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19488, 19498), - }, - binding: None, - }, - Path { - body: NodeId(861), - output: PortId(1008), - pattern: BranchPattern::UnresolvedVariant { - name: "Ambiguous".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19513, 19522), - }, - binding: None, - }, - Path { - body: NodeId(864), - output: PortId(1011), - pattern: BranchPattern::UnresolvedVariant { - name: "Stale".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19537, 19542), - }, - binding: None, - }, - ], - output: PortId(1012), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19380, 19556), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(866), - name: "timing_enforcement_violates".to_string(), - value: PortId(1012), - params: vec![PortId(988), PortId(989)], - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19380, 19556), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(867), - target: TransformTarget::Callable(DeclarationId(1263)), - inputs: vec![], - output: PortId(1016), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3349, 3377), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(868), - target: TransformTarget::Callable(DeclarationId(1273)), - inputs: vec![PortId(1013), PortId(1016)], - output: PortId(1017), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3325, 3378), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(869), - target: TransformTarget::Callable(DeclarationId(1263)), - inputs: vec![], - output: PortId(1018), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3414, 3442), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(870), - target: TransformTarget::Callable(DeclarationId(2734)), - inputs: vec![PortId(1018)], - output: PortId(1019), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3405, 3443), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(871), - target: TransformTarget::UnresolvedFieldProject { - field_label: "value".to_string(), - }, - inputs: vec![PortId(1020)], - output: PortId(1021), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3469, 3477), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(872), - target: TransformTarget::Callable(DeclarationId(1263)), - inputs: vec![], - output: PortId(1022), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3492, 3520), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(873), - target: TransformTarget::Callable(DeclarationId(2735)), - inputs: vec![PortId(1022)], - output: PortId(1023), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3483, 3521), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(874), - input: PortId(1017), - paths: vec![ - Path { - body: NodeId(870), - output: PortId(1019), - pattern: BranchPattern::UnresolvedVariant { - name: "NoDiagnostic".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 3389, - 3401, - ), - }, - binding: None, - }, - Path { - body: NodeId(873), - output: PortId(1023), - pattern: BranchPattern::UnresolvedVariant { - name: "SomeDiagnostic".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 3452, - 3479, - ), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(1020), - }), - }, - ], - output: PortId(1024), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3319, 3529), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(875), - target: TransformTarget::Callable(DeclarationId(1263)), - inputs: vec![], - output: PortId(1026), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3586, 3614), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(876), - target: TransformTarget::Callable(DeclarationId(1273)), - inputs: vec![PortId(1013), PortId(1026)], - output: PortId(1027), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3562, 3615), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(877), - target: TransformTarget::Callable(DeclarationId(1263)), - inputs: vec![], - output: PortId(1028), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3651, 3679), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(878), - target: TransformTarget::Callable(DeclarationId(2736)), - inputs: vec![PortId(1028)], - output: PortId(1029), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3642, 3680), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(879), - target: TransformTarget::UnresolvedFieldProject { - field_label: "value".to_string(), - }, - inputs: vec![PortId(1030)], - output: PortId(1031), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3706, 3714), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(880), - target: TransformTarget::Callable(DeclarationId(1263)), - inputs: vec![], - output: PortId(1032), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3729, 3757), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(881), - target: TransformTarget::Callable(DeclarationId(2737)), - inputs: vec![PortId(1032)], - output: PortId(1033), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3720, 3758), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(882), - input: PortId(1027), - paths: vec![ - Path { - body: NodeId(878), - output: PortId(1029), - pattern: BranchPattern::UnresolvedVariant { - name: "NoDiagnostic".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 3626, - 3638, - ), - }, - binding: None, - }, - Path { - body: NodeId(881), - output: PortId(1033), - pattern: BranchPattern::UnresolvedVariant { - name: "SomeDiagnostic".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 3689, - 3716, - ), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(1030), - }), - }, - ], - output: PortId(1034), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3556, 3766), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(883), - target: TransformTarget::Callable(DeclarationId(1263)), - inputs: vec![], - output: PortId(1036), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3820, 3848), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(884), - target: TransformTarget::Callable(DeclarationId(1273)), - inputs: vec![PortId(1013), PortId(1036)], - output: PortId(1037), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3796, 3849), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(885), - target: TransformTarget::Callable(DeclarationId(1263)), - inputs: vec![], - output: PortId(1038), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3885, 3913), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(886), - target: TransformTarget::Callable(DeclarationId(2738)), - inputs: vec![PortId(1038)], - output: PortId(1039), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3876, 3914), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(887), - target: TransformTarget::UnresolvedFieldProject { - field_label: "value".to_string(), - }, - inputs: vec![PortId(1040)], - output: PortId(1041), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3940, 3948), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(888), - target: TransformTarget::Callable(DeclarationId(1263)), - inputs: vec![], - output: PortId(1042), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3963, 3991), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(889), - target: TransformTarget::Callable(DeclarationId(2739)), - inputs: vec![PortId(1042)], - output: PortId(1043), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3954, 3992), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(890), - input: PortId(1037), - paths: vec![ - Path { - body: NodeId(886), - output: PortId(1039), - pattern: BranchPattern::UnresolvedVariant { - name: "NoDiagnostic".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 3860, - 3872, - ), - }, - binding: None, - }, - Path { - body: NodeId(889), - output: PortId(1043), - pattern: BranchPattern::UnresolvedVariant { - name: "SomeDiagnostic".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 3923, - 3950, - ), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(1040), - }), - }, - ], - output: PortId(1044), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3790, 4000), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(891), - target: TransformTarget::Callable(DeclarationId(1263)), - inputs: vec![], - output: PortId(1046), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 4052, 4080), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(892), - target: TransformTarget::Callable(DeclarationId(1273)), - inputs: vec![PortId(1013), PortId(1046)], - output: PortId(1047), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 4028, 4081), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(893), - target: TransformTarget::Callable(DeclarationId(1263)), - inputs: vec![], - output: PortId(1048), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 4117, 4145), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(894), - target: TransformTarget::Callable(DeclarationId(2740)), - inputs: vec![PortId(1048)], - output: PortId(1049), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 4108, 4146), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(895), - target: TransformTarget::UnresolvedFieldProject { - field_label: "value".to_string(), - }, - inputs: vec![PortId(1050)], - output: PortId(1051), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 4172, 4180), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(896), - target: TransformTarget::Callable(DeclarationId(1263)), - inputs: vec![], - output: PortId(1052), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 4195, 4223), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(897), - target: TransformTarget::Callable(DeclarationId(2741)), - inputs: vec![PortId(1052)], - output: PortId(1053), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 4186, 4224), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(898), - input: PortId(1047), - paths: vec![ - Path { - body: NodeId(894), - output: PortId(1049), - pattern: BranchPattern::UnresolvedVariant { - name: "NoDiagnostic".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 4092, - 4104, - ), - }, - binding: None, - }, - Path { - body: NodeId(897), - output: PortId(1053), - pattern: BranchPattern::UnresolvedVariant { - name: "SomeDiagnostic".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 4155, - 4182, - ), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(1050), - }), - }, - ], - output: PortId(1054), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 4022, 4232), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(899), - target: TransformTarget::Callable(DeclarationId(1263)), - inputs: vec![], - output: PortId(1056), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 4284, 4312), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(900), - target: TransformTarget::Callable(DeclarationId(1273)), - inputs: vec![PortId(1013), PortId(1056)], - output: PortId(1057), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 4260, 4313), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(901), - target: TransformTarget::Callable(DeclarationId(1263)), - inputs: vec![], - output: PortId(1058), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 4349, 4377), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(902), - target: TransformTarget::Callable(DeclarationId(2742)), - inputs: vec![PortId(1058)], - output: PortId(1059), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 4340, 4378), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(903), - target: TransformTarget::UnresolvedFieldProject { - field_label: "value".to_string(), - }, - inputs: vec![PortId(1060)], - output: PortId(1061), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 4404, 4412), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(904), - target: TransformTarget::Callable(DeclarationId(1263)), - inputs: vec![], - output: PortId(1062), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 4427, 4455), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(905), - target: TransformTarget::Callable(DeclarationId(2743)), - inputs: vec![PortId(1062)], - output: PortId(1063), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 4418, 4456), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(906), - input: PortId(1057), - paths: vec![ - Path { - body: NodeId(902), - output: PortId(1059), - pattern: BranchPattern::UnresolvedVariant { - name: "NoDiagnostic".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 4324, - 4336, - ), - }, - binding: None, - }, - Path { - body: NodeId(905), - output: PortId(1063), - pattern: BranchPattern::UnresolvedVariant { - name: "SomeDiagnostic".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 4387, - 4414, - ), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(1060), - }), - }, - ], - output: PortId(1064), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 4254, 4464), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(907), - input: PortId(1014), - paths: vec![ - Path { - body: NodeId(874), - output: PortId(1024), - pattern: BranchPattern::UnresolvedVariant { - name: "Value".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 3301, - 3309, - ), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(1015), - }), - }, - Path { - body: NodeId(882), - output: PortId(1034), - pattern: BranchPattern::UnresolvedVariant { - name: "Transform".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 3534, - 3546, - ), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(1025), - }), - }, - Path { - body: NodeId(890), - output: PortId(1044), - pattern: BranchPattern::UnresolvedVariant { - name: "Branch".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 3771, - 3780, - ), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(1035), - }), - }, - Path { - body: NodeId(898), - output: PortId(1054), - pattern: BranchPattern::UnresolvedVariant { - name: "Loop".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 4005, - 4012, - ), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(1045), - }), - }, - Path { - body: NodeId(906), - output: PortId(1064), - pattern: BranchPattern::UnresolvedVariant { - name: "Bind".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 4237, - 4244, - ), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(1055), - }), - }, - ], - output: PortId(1065), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3287, 4468), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(908), - name: "ci_demo_timing_read".to_string(), - value: PortId(1065), - params: vec![PortId(1013), PortId(1014)], - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3287, 4468), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(909), - target: TransformTarget::Callable(DeclarationId(1282)), - inputs: vec![PortId(1066), PortId(1067)], - output: PortId(1068), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 4859, 4884), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(910), - name: "ci_wad_modeled_workflow_timing_witness".to_string(), - value: PortId(1068), - params: vec![PortId(1066), PortId(1067)], - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 4859, 4884), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(911), - target: TransformTarget::Callable(DeclarationId(2744)), - inputs: vec![], - output: PortId(1069), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5142, 5147), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(912), - name: "_ci_wad_seed_list_declaration_empty".to_string(), - value: PortId(1069), - params: vec![], - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5142, 5147), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(913), - target: TransformTarget::Callable(DeclarationId(2745)), - inputs: vec![], - output: PortId(1070), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5207, 5212), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(914), - name: "_ci_wad_seed_list_behavior_empty".to_string(), - value: PortId(1070), - params: vec![], - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5207, 5212), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(915), - target: TransformTarget::Callable(DeclarationId(2746)), - inputs: vec![], - output: PortId(1071), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5270, 5275), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(916), - name: "_ci_wad_seed_list_dagport_empty".to_string(), - value: PortId(1071), - params: vec![], - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5270, 5275), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(917), - target: TransformTarget::Callable(DeclarationId(2747)), - inputs: vec![], - output: PortId(1072), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5333, 5338), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(918), - name: "_ci_wad_seed_list_cluster_empty".to_string(), - value: PortId(1072), - params: vec![], - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5333, 5338), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(919), - target: TransformTarget::Callable(DeclarationId(2748)), - inputs: vec![], - output: PortId(1073), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5397, 5402), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(920), - name: "_ci_wad_empty_list_diagnostic".to_string(), - value: PortId(1073), - params: vec![], - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5397, 5402), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(921), - target: TransformTarget::Callable(DeclarationId(2749)), - inputs: vec![], - output: PortId(1074), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5477, 5482), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(922), - name: "_ci_wad_empty_list_witness_tm".to_string(), - value: PortId(1074), - params: vec![], - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5477, 5482), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(923), - target: TransformTarget::Callable(DeclarationId(2751)), - inputs: vec![PortId(1075)], - output: PortId(1076), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5593, 5604), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(924), - target: TransformTarget::Callable(DeclarationId(1289)), - inputs: vec![], - output: PortId(1077), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5612, 5643), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(925), - target: TransformTarget::Callable(DeclarationId(2750)), - inputs: vec![PortId(1076), PortId(1077)], - output: PortId(1078), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5580, 5645), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(926), - name: "_ci_wad_witnesses_singleton_tm".to_string(), - value: PortId(1078), - params: vec![PortId(1075)], - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5580, 5645), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(927), - target: TransformTarget::Callable(DeclarationId(1288)), - inputs: vec![], - output: PortId(1080), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5746, 5777), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(928), - target: TransformTarget::Callable(DeclarationId(2752)), - inputs: vec![PortId(1079), PortId(1080)], - output: PortId(1081), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5721, 5779), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(929), - name: "_ci_wad_violations_singleton".to_string(), - value: PortId(1081), - params: vec![PortId(1079)], - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5721, 5779), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(930), - data: LiteralBits::String("ci_modeled_timing".to_string()), - output: PortId(1083), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5914, 5933), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(931), - target: TransformTarget::Callable(DeclarationId(1290)), - inputs: vec![PortId(1082)], - output: PortId(1084), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5967, 6000), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(932), - target: TransformTarget::Callable(DeclarationId(2753)), - inputs: vec![PortId(1083), PortId(1082), PortId(1084)], - output: PortId(1085), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5880, 6005), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(933), - name: "_ci_wad_dimension_ok_tm_payload".to_string(), - value: PortId(1085), - params: vec![PortId(1082)], - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5880, 6005), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(934), - data: LiteralBits::String("ci_modeled_timing".to_string()), - output: PortId(1088), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 6162, 6181), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(935), - target: TransformTarget::Callable(DeclarationId(1291)), - inputs: vec![PortId(1087)], - output: PortId(1089), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 6199, 6233), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(936), - target: TransformTarget::Callable(DeclarationId(1290)), - inputs: vec![PortId(1086)], - output: PortId(1090), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 6250, 6283), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(937), - target: TransformTarget::Callable(DeclarationId(2754)), - inputs: vec![PortId(1088), PortId(1089), PortId(1090)], - output: PortId(1091), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 6126, 6288), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(938), - name: "_ci_wad_dimension_fail_tm_payload".to_string(), - value: PortId(1091), - params: vec![PortId(1086), PortId(1087)], - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 6126, 6288), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(939), - target: TransformTarget::Callable(DeclarationId(1247)), - inputs: vec![PortId(1092)], - output: PortId(1094), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 6651, 6668), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(940), - target: TransformTarget::Callable(DeclarationId(1292)), - inputs: vec![PortId(1093)], - output: PortId(1095), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 6684, 6718), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(941), - target: TransformTarget::UnresolvedFieldProject { - field_label: "head".to_string(), - }, - inputs: vec![PortId(1096)], - output: PortId(1097), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 6730, 6738), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(942), - target: TransformTarget::UnresolvedFieldProject { - field_label: "tail".to_string(), - }, - inputs: vec![PortId(1096)], - output: PortId(1098), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 6740, 6748), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(943), - target: TransformTarget::Callable(DeclarationId(1292)), - inputs: vec![PortId(1093)], - output: PortId(1099), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 6754, 6788), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(944), - input: PortId(1094), - paths: vec![ - Path { - body: NodeId(940), - output: PortId(1095), - pattern: BranchPattern::UnresolvedVariant { - name: "Empty".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 6675, - 6680, - ), - }, - binding: None, - }, - Path { - body: NodeId(943), - output: PortId(1099), - pattern: BranchPattern::UnresolvedVariant { - name: "Cons".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 6723, - 6750, - ), - }, - binding: Some(PayloadBinding { - binding_name: "__payload_6723_6750".to_string(), - payload_port: PortId(1096), - }), - }, - ], - output: PortId(1100), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 6645, 6792), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(945), - name: "report_dim_ok_tm".to_string(), - value: PortId(1100), - params: vec![PortId(1092), PortId(1093)], - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 6645, 6792), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(946), - target: TransformTarget::Callable(DeclarationId(1247)), - inputs: vec![PortId(1101)], - output: PortId(1104), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 6912, 6929), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(947), - target: TransformTarget::Callable(DeclarationId(1293)), - inputs: vec![PortId(1102), PortId(1103)], - output: PortId(1105), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 6945, 6987), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(948), - target: TransformTarget::UnresolvedFieldProject { - field_label: "head".to_string(), - }, - inputs: vec![PortId(1106)], - output: PortId(1107), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 6999, 7007), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(949), - target: TransformTarget::UnresolvedFieldProject { - field_label: "tail".to_string(), - }, - inputs: vec![PortId(1106)], - output: PortId(1108), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7009, 7017), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(950), - target: TransformTarget::Callable(DeclarationId(1293)), - inputs: vec![PortId(1102), PortId(1103)], - output: PortId(1109), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7023, 7065), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(951), - input: PortId(1104), - paths: vec![ - Path { - body: NodeId(947), - output: PortId(1105), - pattern: BranchPattern::UnresolvedVariant { - name: "Empty".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 6936, - 6941, - ), - }, - binding: None, - }, - Path { - body: NodeId(950), - output: PortId(1109), - pattern: BranchPattern::UnresolvedVariant { - name: "Cons".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 6992, - 7019, - ), - }, - binding: Some(PayloadBinding { - binding_name: "__payload_6992_7019".to_string(), - payload_port: PortId(1106), - }), - }, - ], - output: PortId(1110), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 6906, 7069), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(952), - name: "report_dim_fail_tm".to_string(), - value: PortId(1110), - params: vec![PortId(1101), PortId(1102), PortId(1103)], - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 6906, 7069), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(953), - target: TransformTarget::Callable(DeclarationId(1294)), - inputs: vec![PortId(1111), PortId(1112)], - output: PortId(1114), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7227, 7249), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(954), - target: TransformTarget::UnresolvedFieldProject { - field_label: "value".to_string(), - }, - inputs: vec![PortId(1115)], - output: PortId(1116), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7271, 7282), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(955), - target: TransformTarget::Callable(DeclarationId(1295)), - inputs: vec![PortId(1111), PortId(1112), PortId(1116)], - output: PortId(1117), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7288, 7318), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(956), - input: PortId(1113), - paths: vec![ - Path { - body: NodeId(953), - output: PortId(1114), - pattern: BranchPattern::UnresolvedVariant { - name: "NoDiagnostic".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 7211, - 7223, - ), - }, - binding: None, - }, - Path { - body: NodeId(955), - output: PortId(1117), - pattern: BranchPattern::UnresolvedVariant { - name: "SomeDiagnostic".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 7254, - 7284, - ), - }, - binding: Some(PayloadBinding { - binding_name: "diag".to_string(), - payload_port: PortId(1115), - }), - }, - ], - output: PortId(1118), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7196, 7322), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(957), - name: "report_inhabits_branch_tm".to_string(), - value: PortId(1118), - params: vec![PortId(1111), PortId(1112), PortId(1113)], - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7196, 7322), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(958), - target: TransformTarget::Callable(DeclarationId(1273)), - inputs: vec![PortId(1119), PortId(1121)], - output: PortId(1122), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7502, 7528), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(959), - target: TransformTarget::Callable(DeclarationId(1296)), - inputs: vec![PortId(1119), PortId(1121), PortId(1122)], - output: PortId(1123), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7470, 7529), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(960), - target: TransformTarget::UnresolvedFieldProject { - field_label: "reason".to_string(), - }, - inputs: vec![PortId(1124)], - output: PortId(1125), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7545, 7554), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(961), - target: TransformTarget::UnresolvedFieldProject { - field_label: "subject".to_string(), - }, - inputs: vec![PortId(1124)], - output: PortId(1126), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7556, 7568), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(962), - target: TransformTarget::Callable(DeclarationId(1263)), - inputs: vec![], - output: PortId(1128), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7676, 7704), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(963), - target: TransformTarget::Callable(DeclarationId(1267)), - inputs: vec![PortId(1127)], - output: PortId(1129), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7766, 7796), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(964), - target: TransformTarget::Callable(DeclarationId(1268)), - inputs: vec![PortId(1125), PortId(1129)], - output: PortId(1130), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7718, 7797), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(965), - target: TransformTarget::Callable(DeclarationId(1295)), - inputs: vec![PortId(1119), PortId(1128), PortId(1130)], - output: PortId(1131), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7629, 7809), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(966), - target: TransformTarget::UnresolvedFieldProject { - field_label: "port".to_string(), - }, - inputs: vec![PortId(1132)], - output: PortId(1133), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7846, 7854), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(967), - target: TransformTarget::Callable(DeclarationId(1263)), - inputs: vec![], - output: PortId(1134), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7917, 7945), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(968), - target: TransformTarget::Callable(DeclarationId(1269)), - inputs: vec![], - output: PortId(1135), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 8007, 8046), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(969), - target: TransformTarget::Callable(DeclarationId(1268)), - inputs: vec![PortId(1125), PortId(1135)], - output: PortId(1136), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7959, 8047), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(970), - target: TransformTarget::Callable(DeclarationId(1295)), - inputs: vec![PortId(1119), PortId(1134), PortId(1136)], - output: PortId(1137), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7870, 8059), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(971), - target: TransformTarget::UnresolvedFieldProject { - field_label: "producer".to_string(), - }, - inputs: vec![PortId(1138)], - output: PortId(1139), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 8096, 8108), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(972), - target: TransformTarget::Callable(DeclarationId(1263)), - inputs: vec![], - output: PortId(1140), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 8171, 8199), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(973), - target: TransformTarget::Callable(DeclarationId(1269)), - inputs: vec![], - output: PortId(1141), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 8261, 8300), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(974), - target: TransformTarget::Callable(DeclarationId(1268)), - inputs: vec![PortId(1125), PortId(1141)], - output: PortId(1142), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 8213, 8301), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(975), - target: TransformTarget::Callable(DeclarationId(1295)), - inputs: vec![PortId(1119), PortId(1140), PortId(1142)], - output: PortId(1143), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 8124, 8313), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(976), - input: PortId(1126), - paths: vec![ - Path { - body: NodeId(965), - output: PortId(1131), - pattern: BranchPattern::UnresolvedVariant { - name: "AtBehavior".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 7600, - 7615, - ), - }, - binding: Some(PayloadBinding { - binding_name: "beh".to_string(), - payload_port: PortId(1127), - }), - }, - Path { - body: NodeId(970), - output: PortId(1137), - pattern: BranchPattern::UnresolvedVariant { - name: "ProducerLookupMissingPort".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 7818, - 7856, - ), - }, - binding: Some(PayloadBinding { - binding_name: "_p".to_string(), - payload_port: PortId(1132), - }), - }, - Path { - body: NodeId(975), - output: PortId(1143), - pattern: BranchPattern::UnresolvedVariant { - name: "ProducerLookupMissingNode".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 8068, - 8110, - ), - }, - binding: Some(PayloadBinding { - binding_name: "_q".to_string(), - payload_port: PortId(1138), - }), - }, - ], - output: PortId(1144), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7580, 8321), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(977), - input: PortId(1120), - paths: vec![ - Path { - body: NodeId(959), - output: PortId(1123), - pattern: BranchPattern::UnresolvedVariant { - name: "Inhabits".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 7455, - 7466, - ), - }, - binding: Some(PayloadBinding { - binding_name: "c".to_string(), - payload_port: PortId(1121), - }), - }, - Path { - body: NodeId(976), - output: PortId(1144), - pattern: BranchPattern::UnresolvedVariant { - name: "Violates".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 7534, - 7570, - ), - }, - binding: Some(PayloadBinding { - binding_name: "__payload_7534_7570".to_string(), - payload_port: PortId(1124), - }), - }, - ], - output: PortId(1145), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7441, 8325), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(978), - name: "dimension_report_tm_from_witness".to_string(), - value: PortId(1145), - params: vec![PortId(1119), PortId(1120)], - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7441, 8325), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(979), - target: TransformTarget::Callable(DeclarationId(1247)), - inputs: vec![PortId(1146)], - output: PortId(1148), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 9304, 9321), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(980), - target: TransformTarget::Callable(DeclarationId(725)), - inputs: vec![PortId(1148)], - output: PortId(1149), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 9295, 9322), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(981), - target: TransformTarget::Callable(DeclarationId(1282)), - inputs: vec![PortId(1146), PortId(1147)], - output: PortId(1150), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 9368, 9393), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(982), - target: TransformTarget::Callable(DeclarationId(1297)), - inputs: vec![PortId(1146), PortId(1150)], - output: PortId(1151), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 9332, 9394), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(983), - target: TransformTarget::Callable(DeclarationId(1283)), - inputs: vec![PortId(1146), PortId(1147)], - output: PortId(1152), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 9442, 9486), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(984), - target: TransformTarget::Callable(DeclarationId(1297)), - inputs: vec![PortId(1146), PortId(1152)], - output: PortId(1153), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 9406, 9487), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(985), - input: PortId(1149), - paths: vec![ - Path { - body: NodeId(982), - output: PortId(1151), - pattern: BranchPattern::UnresolvedVariant { - name: "True".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 9332, - 9394, - ), - }, - binding: None, - }, - Path { - body: NodeId(984), - output: PortId(1153), - pattern: BranchPattern::UnresolvedVariant { - name: "False".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 9406, - 9487, - ), - }, - binding: None, - }, - ], - output: PortId(1154), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 9292, 9487), - emit_participation: None, - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(986), - name: "demo_ci_modeled_timing_dimension_report".to_string(), - value: PortId(1154), - params: vec![PortId(1146), PortId(1147)], - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 9292, 9487), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(987), - target: TransformTarget::Callable(DeclarationId(1343)), - inputs: vec![PortId(1156)], - output: PortId(1157), - span: SourceSpan::new("src/v3/std/verification.dag", 31362, 31385), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(988), - target: TransformTarget::Callable(DeclarationId(1344)), - inputs: vec![PortId(1158)], - output: PortId(1159), - span: SourceSpan::new("src/v3/std/verification.dag", 31407, 31441), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(989), - input: PortId(1155), - paths: vec![ - Path { - body: NodeId(987), - output: PortId(1157), - pattern: BranchPattern::UnresolvedVariant { - name: "Enumerated".to_string(), - span: SourceSpan::new("src/v3/std/verification.dag", 31345, 31358), - }, - binding: Some(PayloadBinding { - binding_name: "c".to_string(), - payload_port: PortId(1156), - }), - }, - Path { - body: NodeId(988), - output: PortId(1159), - pattern: BranchPattern::UnresolvedVariant { - name: "Quantified".to_string(), - span: SourceSpan::new("src/v3/std/verification.dag", 31390, 31403), - }, - binding: Some(PayloadBinding { - binding_name: "q".to_string(), - payload_port: PortId(1158), - }), - }, - ], - output: PortId(1160), - span: SourceSpan::new("src/v3/std/verification.dag", 31327, 31445), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(990), - name: "obligation_for_suite_claim".to_string(), - value: PortId(1160), - params: vec![PortId(1155)], - span: SourceSpan::new("src/v3/std/verification.dag", 31327, 31445), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(991), - data: LiteralBits::String("+".to_string()), - output: PortId(1163), - span: SourceSpan::new("src/v3/compiler/operators.dag", 886, 889), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(992), - data: LiteralBits::String("-".to_string()), - output: PortId(1164), - span: SourceSpan::new("src/v3/compiler/operators.dag", 905, 908), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(993), - data: LiteralBits::String("*".to_string()), - output: PortId(1165), - span: SourceSpan::new("src/v3/compiler/operators.dag", 924, 927), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(994), - data: LiteralBits::String("/".to_string()), - output: PortId(1166), - span: SourceSpan::new("src/v3/compiler/operators.dag", 943, 946), - lane2_workflow: None, - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(995), - input: PortId(1162), - paths: vec![ - Path { - body: NodeId(991), - output: PortId(1163), - pattern: BranchPattern::UnresolvedVariant { - name: "Add".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 879, 882), - }, - binding: None, - }, - Path { - body: NodeId(992), - output: PortId(1164), - pattern: BranchPattern::UnresolvedVariant { - name: "Sub".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 898, 901), - }, - binding: None, - }, - Path { - body: NodeId(993), - output: PortId(1165), - pattern: BranchPattern::UnresolvedVariant { - name: "Mul".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 917, 920), - }, - binding: None, - }, - Path { - body: NodeId(994), - output: PortId(1166), - pattern: BranchPattern::UnresolvedVariant { - name: "Div".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 936, 939), - }, - binding: None, - }, - ], - output: PortId(1167), - span: SourceSpan::new("src/v3/compiler/operators.dag", 857, 954), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(996), - data: LiteralBits::String("==".to_string()), - output: PortId(1169), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1012, 1016), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(997), - data: LiteralBits::String("!=".to_string()), - output: PortId(1170), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1031, 1035), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(998), - data: LiteralBits::String("<".to_string()), - output: PortId(1171), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1050, 1053), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(999), - data: LiteralBits::String("<=".to_string()), - output: PortId(1172), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1068, 1072), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(1000), - data: LiteralBits::String(">".to_string()), - output: PortId(1173), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1087, 1090), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(1001), - data: LiteralBits::String(">=".to_string()), - output: PortId(1174), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1105, 1109), - lane2_workflow: None, - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(1002), - input: PortId(1168), - paths: vec![ - Path { - body: NodeId(996), - output: PortId(1169), - pattern: BranchPattern::UnresolvedVariant { - name: "Eq".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1006, 1008), - }, - binding: None, - }, - Path { - body: NodeId(997), - output: PortId(1170), - pattern: BranchPattern::UnresolvedVariant { - name: "Ne".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1025, 1027), - }, - binding: None, - }, - Path { - body: NodeId(998), - output: PortId(1171), - pattern: BranchPattern::UnresolvedVariant { - name: "Lt".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1044, 1046), - }, - binding: None, - }, - Path { - body: NodeId(999), - output: PortId(1172), - pattern: BranchPattern::UnresolvedVariant { - name: "Le".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1062, 1064), - }, - binding: None, - }, - Path { - body: NodeId(1000), - output: PortId(1173), - pattern: BranchPattern::UnresolvedVariant { - name: "Gt".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1081, 1083), - }, - binding: None, - }, - Path { - body: NodeId(1001), - output: PortId(1174), - pattern: BranchPattern::UnresolvedVariant { - name: "Ge".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1099, 1101), - }, - binding: None, - }, - ], - output: PortId(1175), - span: SourceSpan::new("src/v3/compiler/operators.dag", 985, 1117), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(1003), - data: LiteralBits::String("&&".to_string()), - output: PortId(1177), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1179, 1183), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(1004), - data: LiteralBits::String("||".to_string()), - output: PortId(1178), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1198, 1202), - lane2_workflow: None, - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(1005), - input: PortId(1176), - paths: vec![ - Path { - body: NodeId(1003), - output: PortId(1177), - pattern: BranchPattern::UnresolvedVariant { - name: "And".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1172, 1175), - }, - binding: None, - }, - Path { - body: NodeId(1004), - output: PortId(1178), - pattern: BranchPattern::UnresolvedVariant { - name: "Or".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1192, 1194), - }, - binding: None, - }, - ], - output: PortId(1179), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1148, 1210), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(1006), - input: PortId(1161), - paths: vec![ - Path { - body: NodeId(995), - output: PortId(1167), - pattern: BranchPattern::UnresolvedVariant { - name: "Arithmetic".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 830, 847), - }, - binding: Some(PayloadBinding { - binding_name: "arith".to_string(), - payload_port: PortId(1162), - }), - }, - Path { - body: NodeId(1002), - output: PortId(1175), - pattern: BranchPattern::UnresolvedVariant { - name: "Comparison".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 959, 975), - }, - binding: Some(PayloadBinding { - binding_name: "comp".to_string(), - payload_port: PortId(1168), - }), - }, - Path { - body: NodeId(1005), - output: PortId(1179), - pattern: BranchPattern::UnresolvedVariant { - name: "Logical".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1122, 1138), - }, - binding: Some(PayloadBinding { - binding_name: "logical".to_string(), - payload_port: PortId(1176), - }), - }, - ], - output: PortId(1180), - span: SourceSpan::new("src/v3/compiler/operators.dag", 815, 1214), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(1007), - name: "symbol".to_string(), - value: PortId(1180), - params: vec![PortId(1161)], - span: SourceSpan::new("src/v3/compiler/operators.dag", 815, 1214), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(1008), - data: LiteralBits::String("add".to_string()), - output: PortId(1183), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1341, 1346), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(1009), - data: LiteralBits::String("sub".to_string()), - output: PortId(1184), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1362, 1367), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(1010), - data: LiteralBits::String("mul".to_string()), - output: PortId(1185), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1383, 1388), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(1011), - data: LiteralBits::String("div".to_string()), - output: PortId(1186), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1404, 1409), - lane2_workflow: None, - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(1012), - input: PortId(1182), - paths: vec![ - Path { - body: NodeId(1008), - output: PortId(1183), - pattern: BranchPattern::UnresolvedVariant { - name: "Add".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1334, 1337), - }, - binding: None, - }, - Path { - body: NodeId(1009), - output: PortId(1184), - pattern: BranchPattern::UnresolvedVariant { - name: "Sub".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1355, 1358), - }, - binding: None, - }, - Path { - body: NodeId(1010), - output: PortId(1185), - pattern: BranchPattern::UnresolvedVariant { - name: "Mul".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1376, 1379), - }, - binding: None, - }, - Path { - body: NodeId(1011), - output: PortId(1186), - pattern: BranchPattern::UnresolvedVariant { - name: "Div".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1397, 1400), - }, - binding: None, - }, - ], - output: PortId(1187), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1312, 1417), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(1013), - data: LiteralBits::String("eq".to_string()), - output: PortId(1189), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1475, 1479), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(1014), - data: LiteralBits::String("ne".to_string()), - output: PortId(1190), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1494, 1498), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(1015), - data: LiteralBits::String("lt".to_string()), - output: PortId(1191), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1513, 1517), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(1016), - data: LiteralBits::String("le".to_string()), - output: PortId(1192), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1532, 1536), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(1017), - data: LiteralBits::String("gt".to_string()), - output: PortId(1193), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1551, 1555), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(1018), - data: LiteralBits::String("ge".to_string()), - output: PortId(1194), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1570, 1574), - lane2_workflow: None, - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(1019), - input: PortId(1188), - paths: vec![ - Path { - body: NodeId(1013), - output: PortId(1189), - pattern: BranchPattern::UnresolvedVariant { - name: "Eq".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1469, 1471), - }, - binding: None, - }, - Path { - body: NodeId(1014), - output: PortId(1190), - pattern: BranchPattern::UnresolvedVariant { - name: "Ne".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1488, 1490), - }, - binding: None, - }, - Path { - body: NodeId(1015), - output: PortId(1191), - pattern: BranchPattern::UnresolvedVariant { - name: "Lt".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1507, 1509), - }, - binding: None, - }, - Path { - body: NodeId(1016), - output: PortId(1192), - pattern: BranchPattern::UnresolvedVariant { - name: "Le".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1526, 1528), - }, - binding: None, - }, - Path { - body: NodeId(1017), - output: PortId(1193), - pattern: BranchPattern::UnresolvedVariant { - name: "Gt".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1545, 1547), - }, - binding: None, - }, - Path { - body: NodeId(1018), - output: PortId(1194), - pattern: BranchPattern::UnresolvedVariant { - name: "Ge".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1564, 1566), - }, - binding: None, - }, - ], - output: PortId(1195), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1448, 1582), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(1020), - data: LiteralBits::String("meet".to_string()), - output: PortId(1197), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1978, 1984), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(1021), - data: LiteralBits::String("join".to_string()), - output: PortId(1198), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1999, 2005), - lane2_workflow: None, - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(1022), - input: PortId(1196), - paths: vec![ - Path { - body: NodeId(1020), - output: PortId(1197), - pattern: BranchPattern::UnresolvedVariant { - name: "And".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1971, 1974), - }, - binding: None, - }, - Path { - body: NodeId(1021), - output: PortId(1198), - pattern: BranchPattern::UnresolvedVariant { - name: "Or".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1993, 1995), - }, - binding: None, - }, - ], - output: PortId(1199), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1947, 2013), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(1023), - input: PortId(1181), - paths: vec![ - Path { - body: NodeId(1012), - output: PortId(1187), - pattern: BranchPattern::UnresolvedVariant { - name: "Arithmetic".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1285, 1302), - }, - binding: Some(PayloadBinding { - binding_name: "arith".to_string(), - payload_port: PortId(1182), - }), - }, - Path { - body: NodeId(1019), - output: PortId(1195), - pattern: BranchPattern::UnresolvedVariant { - name: "Comparison".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1422, 1438), - }, - binding: Some(PayloadBinding { - binding_name: "comp".to_string(), - payload_port: PortId(1188), - }), - }, - Path { - body: NodeId(1022), - output: PortId(1199), - pattern: BranchPattern::UnresolvedVariant { - name: "Logical".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1921, 1937), - }, - binding: Some(PayloadBinding { - binding_name: "logical".to_string(), - payload_port: PortId(1196), - }), - }, - ], - output: PortId(1200), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1270, 2017), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(1024), - name: "algebra_field_name".to_string(), - value: PortId(1200), - params: vec![PortId(1181)], - span: SourceSpan::new("src/v3/compiler/operators.dag", 1270, 2017), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(1025), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(1201), PortId(1201)], - output: PortId(1202), - span: SourceSpan::new("dsl/extdeps/github/ci.dag", 2673, 2714), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(1026), - data: LiteralBits::String("GitHubActionsWorkflowStemSegment".to_string()), - output: PortId(1203), - span: SourceSpan::new("dsl/extdeps/github/ci.dag", 2673, 2714), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(1027), - data: LiteralBits::String("GitHubActionsWorkflowStemSegment".to_string()), - output: PortId(1204), - span: SourceSpan::new("dsl/extdeps/github/ci.dag", 2673, 2714), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(1028), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(1203), PortId(1204)], - output: PortId(1205), - span: SourceSpan::new("dsl/extdeps/github/ci.dag", 2673, 2714), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(1029), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(1202), PortId(1205)], - output: PortId(1206), - span: SourceSpan::new("dsl/extdeps/github/ci.dag", 2673, 2714), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(1030), - name: "".to_string(), - value: PortId(1206), - params: vec![PortId(1201)], - span: SourceSpan::new("dsl/extdeps/github/ci.dag", 2673, 2714), - lane2_workflow: None, - emit_participation: None, - })); - nodes - } -} - -#[allow(clippy::vec_init_then_push)] -fn bootstrapped_fixture_dag_declarations() -> Vec { - { - let mut declarations = Vec::with_capacity(3413); - declarations.push(Declaration { - id: DeclarationId(0), - name: Some("Classical".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "True".to_string(), - ty: DeclarationId(313), - }, - Field { - label: "False".to_string(), - ty: DeclarationId(314), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/logic.dag", 287, 316), - }); - declarations.push(Declaration { - id: DeclarationId(1), - name: Some("classical_not".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(0)], - output: DeclarationId(0), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/logic.dag", 362, 429)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/logic.dag", 318, 429), - }); - declarations.push(Declaration { - id: DeclarationId(2), - name: Some("classical_and".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(0), DeclarationId(0)], - output: DeclarationId(0), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/logic.dag", 489, 553)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/logic.dag", 431, 553), - }); - declarations.push(Declaration { - id: DeclarationId(3), - name: Some("classical_or".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(0), DeclarationId(0)], - output: DeclarationId(0), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/logic.dag", 612, 675)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/logic.dag", 555, 675), - }); - declarations.push(Declaration { - id: DeclarationId(4), - name: Some("Bit".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(0), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/bit.dag", 897, 917), - }); - declarations.push(Declaration { - id: DeclarationId(5), - name: Some("Nibble".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "bits".to_string(), - ty: DeclarationId(315), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/bit.dag", 1003, 1034), - }); - declarations.push(Declaration { - id: DeclarationId(6), - name: Some("Byte".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "bits".to_string(), - ty: DeclarationId(316), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/bit.dag", 1118, 1147), - }); - declarations.push(Declaration { - id: DeclarationId(7), - name: Some("Word16".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "bytes".to_string(), - ty: DeclarationId(317), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/bit.dag", 1251, 1284), - }); - declarations.push(Declaration { - id: DeclarationId(8), - name: Some("Word32".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "bytes".to_string(), - ty: DeclarationId(318), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/bit.dag", 1285, 1318), - }); - declarations.push(Declaration { - id: DeclarationId(9), - name: Some("Word64".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "bytes".to_string(), - ty: DeclarationId(319), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/bit.dag", 1319, 1352), - }); - declarations.push(Declaration { - id: DeclarationId(10), - name: Some("Word128".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "bytes".to_string(), - ty: DeclarationId(320), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/bit.dag", 1353, 1387), - }); - declarations.push(Declaration { - id: DeclarationId(11), - name: Some("Result".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Ok".to_string(), - ty: DeclarationId(321), - }, - Field { - label: "Err".to_string(), - ty: DeclarationId(322), - }, - ], - }, - type_params: vec![DeclarationId(12), DeclarationId(13)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/error_primitives.dag", 597, 657), - }); - declarations.push(Declaration { - id: DeclarationId(12), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("ok".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/error_primitives.dag", 597, 657), - }); - declarations.push(Declaration { - id: DeclarationId(13), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("err".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/error_primitives.dag", 597, 657), - }); - declarations.push(Declaration { - id: DeclarationId(14), - name: Some("DivError".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "DivideByZero".to_string(), - ty: DeclarationId(323), - }, - Field { - label: "Overflow".to_string(), - ty: DeclarationId(324), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/error_primitives.dag", 920, 959), - }); - declarations.push(Declaration { - id: DeclarationId(15), - name: Some("Magma".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "op".to_string(), - ty: DeclarationId(334), - }], - }, - type_params: vec![DeclarationId(16)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 4702, 4739), - }); - declarations.push(Declaration { - id: DeclarationId(16), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 4702, 4739), - }); - declarations.push(Declaration { - id: DeclarationId(17), - name: Some("Semigroup".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "op".to_string(), - ty: DeclarationId(335), - }], - }, - type_params: vec![DeclarationId(18)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 4817, 4939), - }); - declarations.push(Declaration { - id: DeclarationId(18), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 4817, 4939), - }); - declarations.push(Declaration { - id: DeclarationId(19), - name: Some("Monoid".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "op".to_string(), - ty: DeclarationId(336), - }, - Field { - label: "identity".to_string(), - ty: DeclarationId(20), - }, - ], - }, - type_params: vec![DeclarationId(20)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 5037, 5089), - }); - declarations.push(Declaration { - id: DeclarationId(20), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 5037, 5089), - }); - declarations.push(Declaration { - id: DeclarationId(21), - name: Some("CommutativeMonoid".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "op".to_string(), - ty: DeclarationId(337), - }, - Field { - label: "identity".to_string(), - ty: DeclarationId(22), - }, - ], - }, - type_params: vec![DeclarationId(22)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 5148, 5239), - }); - declarations.push(Declaration { - id: DeclarationId(22), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 5148, 5239), - }); - declarations.push(Declaration { - id: DeclarationId(23), - name: Some("Group".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "op".to_string(), - ty: DeclarationId(338), - }, - Field { - label: "identity".to_string(), - ty: DeclarationId(24), - }, - Field { - label: "inverse".to_string(), - ty: DeclarationId(339), - }, - ], - }, - type_params: vec![DeclarationId(24)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 5311, 5384), - }); - declarations.push(Declaration { - id: DeclarationId(24), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 5311, 5384), - }); - declarations.push(Declaration { - id: DeclarationId(25), - name: Some("AbelianGroup".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "op".to_string(), - ty: DeclarationId(340), - }, - Field { - label: "identity".to_string(), - ty: DeclarationId(26), - }, - Field { - label: "inverse".to_string(), - ty: DeclarationId(341), - }, - ], - }, - type_params: vec![DeclarationId(26)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 5422, 5530), - }); - declarations.push(Declaration { - id: DeclarationId(26), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 5422, 5530), - }); - declarations.push(Declaration { - id: DeclarationId(27), - name: Some("GroupCompletion".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![DeclarationId(28)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 7957, 7977), - }); - declarations.push(Declaration { - id: DeclarationId(28), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("M".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 7957, 7977), - }); - declarations.push(Declaration { - id: DeclarationId(29), - name: Some("FieldOfFractions".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![DeclarationId(30)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 10044, 10065), - }); - declarations.push(Declaration { - id: DeclarationId(30), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("R".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 10044, 10065), - }); - declarations.push(Declaration { - id: DeclarationId(31), - name: Some("Semiring".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "add".to_string(), - ty: DeclarationId(342), - }, - Field { - label: "zero".to_string(), - ty: DeclarationId(32), - }, - Field { - label: "mul".to_string(), - ty: DeclarationId(343), - }, - Field { - label: "one".to_string(), - ty: DeclarationId(32), - }, - ], - }, - type_params: vec![DeclarationId(32)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 10502, 10583), - }); - declarations.push(Declaration { - id: DeclarationId(32), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 10502, 10583), - }); - declarations.push(Declaration { - id: DeclarationId(33), - name: Some("CommutativeSemiring".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "add".to_string(), - ty: DeclarationId(344), - }, - Field { - label: "zero".to_string(), - ty: DeclarationId(34), - }, - Field { - label: "mul".to_string(), - ty: DeclarationId(345), - }, - Field { - label: "one".to_string(), - ty: DeclarationId(34), - }, - ], - }, - type_params: vec![DeclarationId(34)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 10977, 11069), - }); - declarations.push(Declaration { - id: DeclarationId(34), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 10977, 11069), - }); - declarations.push(Declaration { - id: DeclarationId(35), - name: Some("Ring".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "add".to_string(), - ty: DeclarationId(346), - }, - Field { - label: "zero".to_string(), - ty: DeclarationId(36), - }, - Field { - label: "negate".to_string(), - ty: DeclarationId(347), - }, - Field { - label: "mul".to_string(), - ty: DeclarationId(348), - }, - Field { - label: "one".to_string(), - ty: DeclarationId(36), - }, - ], - }, - type_params: vec![DeclarationId(36)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 11196, 11294), - }); - declarations.push(Declaration { - id: DeclarationId(36), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 11196, 11294), - }); - declarations.push(Declaration { - id: DeclarationId(37), - name: Some("OrderedRing".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "add".to_string(), - ty: DeclarationId(349), - }, - Field { - label: "sub".to_string(), - ty: DeclarationId(350), - }, - Field { - label: "zero".to_string(), - ty: DeclarationId(38), - }, - Field { - label: "negate".to_string(), - ty: DeclarationId(351), - }, - Field { - label: "mul".to_string(), - ty: DeclarationId(352), - }, - Field { - label: "div".to_string(), - ty: DeclarationId(354), - }, - Field { - label: "one".to_string(), - ty: DeclarationId(38), - }, - Field { - label: "compare".to_string(), - ty: DeclarationId(355), - }, - Field { - label: "eq".to_string(), - ty: DeclarationId(356), - }, - Field { - label: "ne".to_string(), - ty: DeclarationId(357), - }, - Field { - label: "lt".to_string(), - ty: DeclarationId(358), - }, - Field { - label: "le".to_string(), - ty: DeclarationId(359), - }, - Field { - label: "gt".to_string(), - ty: DeclarationId(360), - }, - Field { - label: "ge".to_string(), - ty: DeclarationId(361), - }, - ], - }, - type_params: vec![DeclarationId(38)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12055, 12390), - }); - declarations.push(Declaration { - id: DeclarationId(38), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12055, 12390), - }); - declarations.push(Declaration { - id: DeclarationId(39), - name: Some("Field".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "add".to_string(), - ty: DeclarationId(362), - }, - Field { - label: "zero".to_string(), - ty: DeclarationId(40), - }, - Field { - label: "negate".to_string(), - ty: DeclarationId(363), - }, - Field { - label: "mul".to_string(), - ty: DeclarationId(364), - }, - Field { - label: "one".to_string(), - ty: DeclarationId(40), - }, - Field { - label: "reciprocal".to_string(), - ty: DeclarationId(365), - }, - Field { - label: "compare".to_string(), - ty: DeclarationId(366), - }, - ], - }, - type_params: vec![DeclarationId(40)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12528, 12684), - }); - declarations.push(Declaration { - id: DeclarationId(40), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12528, 12684), - }); - declarations.push(Declaration { - id: DeclarationId(41), - name: Some("Lattice".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "meet".to_string(), - ty: DeclarationId(367), - }, - Field { - label: "join".to_string(), - ty: DeclarationId(368), - }, - ], - }, - type_params: vec![DeclarationId(42)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 13004, 13067), - }); - declarations.push(Declaration { - id: DeclarationId(42), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 13004, 13067), - }); - declarations.push(Declaration { - id: DeclarationId(43), - name: Some("BoundedLattice".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "meet".to_string(), - ty: DeclarationId(369), - }, - Field { - label: "join".to_string(), - ty: DeclarationId(370), - }, - Field { - label: "top".to_string(), - ty: DeclarationId(44), - }, - Field { - label: "bottom".to_string(), - ty: DeclarationId(44), - }, - ], - }, - type_params: vec![DeclarationId(44)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 13175, 13266), - }); - declarations.push(Declaration { - id: DeclarationId(44), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 13175, 13266), - }); - declarations.push(Declaration { - id: DeclarationId(45), - name: Some("BooleanAlgebra".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "meet".to_string(), - ty: DeclarationId(371), - }, - Field { - label: "join".to_string(), - ty: DeclarationId(372), - }, - Field { - label: "complement".to_string(), - ty: DeclarationId(373), - }, - Field { - label: "top".to_string(), - ty: DeclarationId(46), - }, - Field { - label: "bottom".to_string(), - ty: DeclarationId(46), - }, - ], - }, - type_params: vec![DeclarationId(46)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 13464, 13580), - }); - declarations.push(Declaration { - id: DeclarationId(46), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 13464, 13580), - }); - declarations.push(Declaration { - id: DeclarationId(47), - name: Some("FreeMonoid".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "concat".to_string(), - ty: DeclarationId(377), - }, - Field { - label: "empty".to_string(), - ty: DeclarationId(378), - }, - Field { - label: "append".to_string(), - ty: DeclarationId(380), - }, - Field { - label: "slice".to_string(), - ty: DeclarationId(382), - }, - Field { - label: "length".to_string(), - ty: DeclarationId(383), - }, - Field { - label: "is_empty".to_string(), - ty: DeclarationId(384), - }, - Field { - label: "count".to_string(), - ty: DeclarationId(385), - }, - Field { - label: "first".to_string(), - ty: DeclarationId(387), - }, - Field { - label: "last".to_string(), - ty: DeclarationId(389), - }, - Field { - label: "map".to_string(), - ty: DeclarationId(392), - }, - Field { - label: "filter".to_string(), - ty: DeclarationId(395), - }, - Field { - label: "fold".to_string(), - ty: DeclarationId(397), - }, - Field { - label: "flat_map".to_string(), - ty: DeclarationId(401), - }, - Field { - label: "any".to_string(), - ty: DeclarationId(403), - }, - Field { - label: "all".to_string(), - ty: DeclarationId(405), - }, - Field { - label: "enumerate".to_string(), - ty: DeclarationId(409), - }, - Field { - label: "reverse".to_string(), - ty: DeclarationId(411), - }, - Field { - label: "skip".to_string(), - ty: DeclarationId(413), - }, - Field { - label: "take".to_string(), - ty: DeclarationId(415), - }, - Field { - label: "sort_by".to_string(), - ty: DeclarationId(418), - }, - Field { - label: "contains".to_string(), - ty: DeclarationId(419), - }, - ], - }, - type_params: vec![DeclarationId(48)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17472, 18434), - }); - declarations.push(Declaration { - id: DeclarationId(48), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17472, 18434), - }); - declarations.push(Declaration { - id: DeclarationId(49), - name: Some("PartialFunction".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "lookup".to_string(), - ty: DeclarationId(422), - }, - Field { - label: "empty".to_string(), - ty: DeclarationId(423), - }, - Field { - label: "get".to_string(), - ty: DeclarationId(425), - }, - Field { - label: "insert".to_string(), - ty: DeclarationId(427), - }, - Field { - label: "merge".to_string(), - ty: DeclarationId(430), - }, - Field { - label: "keys".to_string(), - ty: DeclarationId(432), - }, - Field { - label: "values".to_string(), - ty: DeclarationId(434), - }, - Field { - label: "has".to_string(), - ty: DeclarationId(435), - }, - Field { - label: "contains_key".to_string(), - ty: DeclarationId(436), - }, - Field { - label: "size".to_string(), - ty: DeclarationId(437), - }, - ], - }, - type_params: vec![DeclarationId(50), DeclarationId(51)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18963, 19310), - }); - declarations.push(Declaration { - id: DeclarationId(50), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("K".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18963, 19310), - }); - declarations.push(Declaration { - id: DeclarationId(51), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("V".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18963, 19310), - }); - declarations.push(Declaration { - id: DeclarationId(52), - name: Some("Ordering".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Less".to_string(), - ty: DeclarationId(438), - }, - Field { - label: "Equal".to_string(), - ty: DeclarationId(439), - }, - Field { - label: "Greater".to_string(), - ty: DeclarationId(440), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19511, 19549), - }); - declarations.push(Declaration { - id: DeclarationId(53), - name: Some("AlgebraProfile".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "OrderedRingProfile".to_string(), - ty: DeclarationId(441), - }, - Field { - label: "ApproximateFieldProfile".to_string(), - ty: DeclarationId(442), - }, - Field { - label: "BooleanAlgebraProfile".to_string(), - ty: DeclarationId(443), - }, - Field { - label: "BooleanAlgebraCollectionProfile".to_string(), - ty: DeclarationId(444), - }, - Field { - label: "FreeMonoidScalarProfile".to_string(), - ty: DeclarationId(445), - }, - Field { - label: "FreeMonoidCollectionProfile".to_string(), - ty: DeclarationId(446), - }, - Field { - label: "PartialFunctionProfile".to_string(), - ty: DeclarationId(447), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 21634, 21853), - }); - declarations.push(Declaration { - id: DeclarationId(54), - name: Some("ContainerSource".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "SameAsReceiver".to_string(), - ty: DeclarationId(448), - }, - Field { - label: "Named".to_string(), - ty: DeclarationId(449), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 21855, 21921), - }); - declarations.push(Declaration { - id: DeclarationId(55), - name: Some("AlgebraTypeTemplate".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ReceiverSelf".to_string(), - ty: DeclarationId(450), - }, - Field { - label: "ReceiverElement".to_string(), - ty: DeclarationId(451), - }, - Field { - label: "ReceiverKey".to_string(), - ty: DeclarationId(452), - }, - Field { - label: "ReceiverValue".to_string(), - ty: DeclarationId(453), - }, - Field { - label: "NamedTemplate".to_string(), - ty: DeclarationId(454), - }, - Field { - label: "ContainerOf".to_string(), - ty: DeclarationId(455), - }, - Field { - label: "OptionalOf".to_string(), - ty: DeclarationId(456), - }, - Field { - label: "WitnessOf".to_string(), - ty: DeclarationId(457), - }, - Field { - label: "TupleOf".to_string(), - ty: DeclarationId(458), - }, - Field { - label: "CallableOf".to_string(), - ty: DeclarationId(460), - }, - Field { - label: "AlgebraTypeVariable".to_string(), - ty: DeclarationId(461), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 21923, 22416), - }); - declarations.push(Declaration { - id: DeclarationId(56), - name: Some("CollectionSizeEffect".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ShrinkEffect".to_string(), - ty: DeclarationId(462), - }, - Field { - label: "ProjectionEffect".to_string(), - ty: DeclarationId(463), - }, - Field { - label: "IdentityEffect".to_string(), - ty: DeclarationId(464), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 22632, 22809), - }); - declarations.push(Declaration { - id: DeclarationId(57), - name: Some("CostShape".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ShapeConstant".to_string(), - ty: DeclarationId(465), - }, - Field { - label: "ShapeLinearScan".to_string(), - ty: DeclarationId(466), - }, - Field { - label: "ShapeIterateBody".to_string(), - ty: DeclarationId(467), - }, - Field { - label: "ShapeSortBody".to_string(), - ty: DeclarationId(468), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23267, 23452), - }); - declarations.push(Declaration { - id: DeclarationId(58), - name: Some("AlgebraFieldTemplate".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "param_types".to_string(), - ty: DeclarationId(469), - }, - Field { - label: "return_type".to_string(), - ty: DeclarationId(55), - }, - Field { - label: "size_effect".to_string(), - ty: DeclarationId(470), - }, - Field { - label: "cost_shape".to_string(), - ty: DeclarationId(471), - }, - Field { - label: "callback_element_position".to_string(), - ty: DeclarationId(472), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23477, 23908), - }); - declarations.push(Declaration { - id: DeclarationId(59), - name: Some("kernel_algebra_profile".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(53), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(473)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Map( - FieldMap::from_entries(vec![ - ( - "Int".to_string(), - FieldValue::Variant { - constructor: DeclarationId(441), - payload: vec![], - }, - ), - ( - "Float".to_string(), - FieldValue::Variant { - constructor: DeclarationId(442), - payload: vec![], - }, - ), - ( - "Bool".to_string(), - FieldValue::Variant { - constructor: DeclarationId(443), - payload: vec![], - }, - ), - ( - "String".to_string(), - FieldValue::Variant { - constructor: DeclarationId(445), - payload: vec![], - }, - ), - ( - "List".to_string(), - FieldValue::Variant { - constructor: DeclarationId(446), - payload: vec![], - }, - ), - ( - "Set".to_string(), - FieldValue::Variant { - constructor: DeclarationId(444), - payload: vec![], - }, - ), - ( - "Map".to_string(), - FieldValue::Variant { - constructor: DeclarationId(447), - payload: vec![], - }, - ), - ]) - .expect("ValueBody::Map"), - )), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23910, 24220), - }); - declarations.push(Declaration { - id: DeclarationId(60), - name: Some("ordered_ring_templates".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(325), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/algebra.dag", 24280, 25425)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 24222, 25425), - }); - declarations.push(Declaration { - id: DeclarationId(61), - name: Some("approximate_field_templates".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(326), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/algebra.dag", 25490, 26584)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 25427, 26584), - }); - declarations.push(Declaration { - id: DeclarationId(62), - name: Some("boolean_algebra_templates".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(327), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/algebra.dag", 26647, 27408)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 26586, 27408), - }); - declarations.push(Declaration { - id: DeclarationId(63), - name: Some("boolean_algebra_collection_templates".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(328), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/algebra.dag", 27773, 31163)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 27701, 31163), - }); - declarations.push(Declaration { - id: DeclarationId(64), - name: Some("free_monoid_scalar_templates".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(329), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/algebra.dag", 31229, 34472)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 31165, 34472), - }); - declarations.push(Declaration { - id: DeclarationId(65), - name: Some("free_monoid_collection_templates".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(330), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/algebra.dag", 34542, 39903)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 34474, 39903), - }); - declarations.push(Declaration { - id: DeclarationId(66), - name: Some("partial_function_templates".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(331), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/algebra.dag", 39967, 42790)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 39905, 42790), - }); - declarations.push(Declaration { - id: DeclarationId(67), - name: Some("algebra_templates_for_profile".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(53)], - output: DeclarationId(332), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/algebra.dag", 42880, 43343)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 42792, 43343), - }); - declarations.push(Declaration { - id: DeclarationId(68), - name: Some("algebra_type_param_names".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(53)], - output: DeclarationId(333), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/algebra.dag", 43685, 43966)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 43616, 43966), - }); - declarations.push(Declaration { - id: DeclarationId(69), - name: Some("Magnitude".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/magnitude.dag", 1464, 1478), - }); - declarations.push(Declaration { - id: DeclarationId(70), - name: Some("MachineWidth".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![DeclarationId(71)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/machine_constraints.dag", 3296, 3313), - }); - declarations.push(Declaration { - id: DeclarationId(71), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("bits".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/machine_constraints.dag", 3296, 3313), - }); - declarations.push(Declaration { - id: DeclarationId(72), - name: Some("PointerWidth".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/machine_constraints.dag", 6208, 6225), - }); - declarations.push(Declaration { - id: DeclarationId(73), - name: Some("Compose".to_string()), - connective: TypeConnective::Disj { - variants: vec![Field { - label: "Phantom".to_string(), - ty: DeclarationId(474), - }], - }, - type_params: vec![DeclarationId(74), DeclarationId(75)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/machine_constraints.dag", 7292, 7342), - }); - declarations.push(Declaration { - id: DeclarationId(74), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Algebra".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/machine_constraints.dag", 7292, 7342), - }); - declarations.push(Declaration { - id: DeclarationId(75), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam( - "MachineConstraint".to_string(), - )), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/machine_constraints.dag", 7292, 7342), - }); - declarations.push(Declaration { - id: DeclarationId(76), - name: Some("Nat".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(33), - arguments: vec![TemplateArgument { - parameter: DeclarationId(34), - value: DeclarationId(69), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/nat.dag", 2186, 2227), - }); - declarations.push(Declaration { - id: DeclarationId(77), - name: Some("Int8".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(73), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(74), - value: DeclarationId(87), - }, - TemplateArgument { - parameter: DeclarationId(75), - value: DeclarationId(476), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2549, 2590), - }); - declarations.push(Declaration { - id: DeclarationId(78), - name: Some("Int16".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(73), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(74), - value: DeclarationId(87), - }, - TemplateArgument { - parameter: DeclarationId(75), - value: DeclarationId(478), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2591, 2634), - }); - declarations.push(Declaration { - id: DeclarationId(79), - name: Some("Int32".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(73), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(74), - value: DeclarationId(87), - }, - TemplateArgument { - parameter: DeclarationId(75), - value: DeclarationId(480), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2635, 2678), - }); - declarations.push(Declaration { - id: DeclarationId(80), - name: Some("Int64".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(73), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(74), - value: DeclarationId(87), - }, - TemplateArgument { - parameter: DeclarationId(75), - value: DeclarationId(482), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2679, 2722), - }); - declarations.push(Declaration { - id: DeclarationId(81), - name: Some("Int128".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(73), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(74), - value: DeclarationId(87), - }, - TemplateArgument { - parameter: DeclarationId(75), - value: DeclarationId(484), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2723, 2768), - }); - declarations.push(Declaration { - id: DeclarationId(82), - name: Some("UInt8".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(73), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(74), - value: DeclarationId(88), - }, - TemplateArgument { - parameter: DeclarationId(75), - value: DeclarationId(486), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2834, 2877), - }); - declarations.push(Declaration { - id: DeclarationId(83), - name: Some("UInt16".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(73), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(74), - value: DeclarationId(88), - }, - TemplateArgument { - parameter: DeclarationId(75), - value: DeclarationId(488), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2878, 2923), - }); - declarations.push(Declaration { - id: DeclarationId(84), - name: Some("UInt32".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(73), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(74), - value: DeclarationId(88), - }, - TemplateArgument { - parameter: DeclarationId(75), - value: DeclarationId(490), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2924, 2969), - }); - declarations.push(Declaration { - id: DeclarationId(85), - name: Some("UInt64".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(73), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(74), - value: DeclarationId(88), - }, - TemplateArgument { - parameter: DeclarationId(75), - value: DeclarationId(492), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2970, 3015), - }); - declarations.push(Declaration { - id: DeclarationId(86), - name: Some("UInt128".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(73), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(74), - value: DeclarationId(88), - }, - TemplateArgument { - parameter: DeclarationId(75), - value: DeclarationId(494), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 3016, 3063), - }); - declarations.push(Declaration { - id: DeclarationId(87), - name: Some("Int".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(25), - arguments: vec![TemplateArgument { - parameter: DeclarationId(26), - value: DeclarationId(495), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 5921, 5966), - }); - declarations.push(Declaration { - id: DeclarationId(88), - name: Some("UInt".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(76), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 5967, 5982), - }); - declarations.push(Declaration { - id: DeclarationId(89), - name: Some("IntPlatform".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(73), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(74), - value: DeclarationId(87), - }, - TemplateArgument { - parameter: DeclarationId(75), - value: DeclarationId(496), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 7619, 7680), - }); - declarations.push(Declaration { - id: DeclarationId(90), - name: Some("UIntPlatform".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(73), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(74), - value: DeclarationId(88), - }, - TemplateArgument { - parameter: DeclarationId(75), - value: DeclarationId(497), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 7681, 7742), - }); - declarations.push(Declaration { - id: DeclarationId(91), - name: Some("NonNegativeInt".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(76), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 9184, 9209), - }); - declarations.push(Declaration { - id: DeclarationId(92), - name: Some("PositiveInt".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(76))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(498)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 9210, 9249), - }); - declarations.push(Declaration { - id: DeclarationId(93), - name: Some("Rational".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(39), - arguments: vec![TemplateArgument { - parameter: DeclarationId(40), - value: DeclarationId(499), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/rational.dag", 1245, 1289), - }); - declarations.push(Declaration { - id: DeclarationId(94), - name: Some("RoundingMode".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ToNearestEven".to_string(), - ty: DeclarationId(500), - }, - Field { - label: "ToZero".to_string(), - ty: DeclarationId(501), - }, - Field { - label: "ToPositiveInfinity".to_string(), - ty: DeclarationId(502), - }, - Field { - label: "ToNegativeInfinity".to_string(), - ty: DeclarationId(503), - }, - Field { - label: "ToAwayFromZero".to_string(), - ty: DeclarationId(504), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 1030, 1141), - }); - declarations.push(Declaration { - id: DeclarationId(95), - name: Some("Precision".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Unbounded".to_string(), - ty: DeclarationId(505), - }, - Field { - label: "BinaryPrecision".to_string(), - ty: DeclarationId(506), - }, - Field { - label: "DecimalPrecision".to_string(), - ty: DeclarationId(507), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 1404, 1589), - }); - declarations.push(Declaration { - id: DeclarationId(96), - name: Some("NanPolicy".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "NoNaN".to_string(), - ty: DeclarationId(508), - }, - Field { - label: "QuietNaN".to_string(), - ty: DeclarationId(509), - }, - Field { - label: "QuietAndSignalingNaN".to_string(), - ty: DeclarationId(510), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 1812, 1868), - }); - declarations.push(Declaration { - id: DeclarationId(97), - name: Some("InfinityPolicy".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "NoInfinity".to_string(), - ty: DeclarationId(511), - }, - Field { - label: "SignedInfinity".to_string(), - ty: DeclarationId(512), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 2096, 2145), - }); - declarations.push(Declaration { - id: DeclarationId(98), - name: Some("SignedZeroPolicy".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "NoSignedZero".to_string(), - ty: DeclarationId(513), - }, - Field { - label: "SignedZero".to_string(), - ty: DeclarationId(514), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 2376, 2425), - }); - declarations.push(Declaration { - id: DeclarationId(99), - name: Some("SubnormalPolicy".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "NoSubnormals".to_string(), - ty: DeclarationId(515), - }, - Field { - label: "GradualUnderflow".to_string(), - ty: DeclarationId(516), - }, - Field { - label: "FlushToZero".to_string(), - ty: DeclarationId(517), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 2720, 2788), - }); - declarations.push(Declaration { - id: DeclarationId(100), - name: Some("SpecialValues".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "nan".to_string(), - ty: DeclarationId(96), - }, - Field { - label: "infinity".to_string(), - ty: DeclarationId(97), - }, - Field { - label: "signed_zero".to_string(), - ty: DeclarationId(98), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 3064, 3162), - }); - declarations.push(Declaration { - id: DeclarationId(101), - name: Some("ApproximateField".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "base".to_string(), - ty: DeclarationId(518), - }, - Field { - label: "rounding".to_string(), - ty: DeclarationId(94), - }, - Field { - label: "precision".to_string(), - ty: DeclarationId(95), - }, - Field { - label: "special_values".to_string(), - ty: DeclarationId(100), - }, - Field { - label: "subnormal_policy".to_string(), - ty: DeclarationId(99), - }, - ], - }, - type_params: vec![DeclarationId(102)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 3398, 3559), - }); - declarations.push(Declaration { - id: DeclarationId(102), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("F".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 3398, 3559), - }); - declarations.push(Declaration { - id: DeclarationId(103), - name: Some("Ieee754Float".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/float.dag", 1255, 1272), - }); - declarations.push(Declaration { - id: DeclarationId(104), - name: Some("Real".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(101), - arguments: vec![TemplateArgument { - parameter: DeclarationId(102), - value: DeclarationId(519), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/float.dag", 1453, 1504), - }); - declarations.push(Declaration { - id: DeclarationId(105), - name: Some("Real32".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(73), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(74), - value: DeclarationId(104), - }, - TemplateArgument { - parameter: DeclarationId(75), - value: DeclarationId(521), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/float.dag", 1726, 1771), - }); - declarations.push(Declaration { - id: DeclarationId(106), - name: Some("Real64".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(73), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(74), - value: DeclarationId(104), - }, - TemplateArgument { - parameter: DeclarationId(75), - value: DeclarationId(523), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/float.dag", 1772, 1817), - }); - declarations.push(Declaration { - id: DeclarationId(107), - name: Some("Float32".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(105), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/float.dag", 1819, 1840), - }); - declarations.push(Declaration { - id: DeclarationId(108), - name: Some("Float64".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(106), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/float.dag", 1841, 1862), - }); - declarations.push(Declaration { - id: DeclarationId(109), - name: Some("Float".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(108), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/float.dag", 1881, 1901), - }); - declarations.push(Declaration { - id: DeclarationId(110), - name: Some("kernel_type_set".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(124), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(639)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Map( - FieldMap::from_entries(vec![ - ( - "String".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ( - "Int".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ( - "Bool".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ( - "Float".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ( - "Secret".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ( - "Json".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ( - "Unit".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ( - "Bytes".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ]) - .expect("ValueBody::Map"), - )), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 3041, 3206), - }); - declarations.push(Declaration { - id: DeclarationId(111), - name: Some("is_kernel_type".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227)], - output: DeclarationId(124), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/types.dag", 3248, 3349)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 3208, 3349), - }); - declarations.push(Declaration { - id: DeclarationId(112), - name: Some("container_type_arity".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(87), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(640)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Map( - FieldMap::from_entries(vec![ - ( - "List".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ( - "Set".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ( - "Map".to_string(), - FieldValue::Literal(LiteralBits::Int("2".to_string())), - ), - ( - "Witness".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ]) - .expect("ValueBody::Map"), - )), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 3511, 3606), - }); - declarations.push(Declaration { - id: DeclarationId(113), - name: Some("is_container_type".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227)], - output: DeclarationId(124), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/types.dag", 3651, 3758)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 3608, 3758), - }); - declarations.push(Declaration { - id: DeclarationId(114), - name: Some("container_expected_arity".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227)], - output: DeclarationId(524), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/types.dag", 3810, 3851)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 3760, 3851), - }); - declarations.push(Declaration { - id: DeclarationId(115), - name: Some("container_param_names_for".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227)], - output: DeclarationId(525), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/types.dag", 4091, 4296)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 4027, 4296), - }); - declarations.push(Declaration { - id: DeclarationId(116), - name: Some("container_param_name".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227), DeclarationId(87)], - output: DeclarationId(526), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/types.dag", 4364, 4612)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 4298, 4612), - }); - declarations.push(Declaration { - id: DeclarationId(117), - name: Some("ordered_element_collections".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(124), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(641)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Map( - FieldMap::from_entries(vec![( - "List".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - )]) - .expect("ValueBody::Map"), - )), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 4806, 4878), - }); - declarations.push(Declaration { - id: DeclarationId(118), - name: Some("is_ordered_element_collection".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227)], - output: DeclarationId(124), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/types.dag", 4935, 4992)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 4880, 4992), - }); - declarations.push(Declaration { - id: DeclarationId(119), - name: Some("container_template_algebra_rows".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(642)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Map( - FieldMap::from_entries(vec![ - ( - "List".to_string(), - FieldValue::Literal(LiteralBits::String("FreeMonoid".to_string())), - ), - ( - "list".to_string(), - FieldValue::Literal(LiteralBits::String("FreeMonoid".to_string())), - ), - ( - "Set".to_string(), - FieldValue::Literal(LiteralBits::String("BooleanAlgebra".to_string())), - ), - ( - "set".to_string(), - FieldValue::Literal(LiteralBits::String("BooleanAlgebra".to_string())), - ), - ( - "Map".to_string(), - FieldValue::Literal(LiteralBits::String("PartialFunction".to_string())), - ), - ( - "map".to_string(), - FieldValue::Literal(LiteralBits::String("PartialFunction".to_string())), - ), - ( - "FreeMonoid".to_string(), - FieldValue::Literal(LiteralBits::String("FreeMonoid".to_string())), - ), - ( - "free_monoid".to_string(), - FieldValue::Literal(LiteralBits::String("FreeMonoid".to_string())), - ), - ( - "BooleanAlgebra".to_string(), - FieldValue::Literal(LiteralBits::String("BooleanAlgebra".to_string())), - ), - ( - "boolean_algebra".to_string(), - FieldValue::Literal(LiteralBits::String("BooleanAlgebra".to_string())), - ), - ( - "PartialFunction".to_string(), - FieldValue::Literal(LiteralBits::String("PartialFunction".to_string())), - ), - ( - "partial_function".to_string(), - FieldValue::Literal(LiteralBits::String("PartialFunction".to_string())), - ), - ]) - .expect("ValueBody::Map"), - )), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 5784, 6223), - }); - declarations.push(Declaration { - id: DeclarationId(120), - name: Some("container_template_alias_rows".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(643)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Map( - FieldMap::from_entries(vec![ - ( - "List".to_string(), - FieldValue::Literal(LiteralBits::String("FreeMonoid".to_string())), - ), - ( - "list".to_string(), - FieldValue::Literal(LiteralBits::String("FreeMonoid".to_string())), - ), - ( - "Set".to_string(), - FieldValue::Literal(LiteralBits::String("BooleanAlgebra".to_string())), - ), - ( - "set".to_string(), - FieldValue::Literal(LiteralBits::String("BooleanAlgebra".to_string())), - ), - ( - "Map".to_string(), - FieldValue::Literal(LiteralBits::String("PartialFunction".to_string())), - ), - ( - "map".to_string(), - FieldValue::Literal(LiteralBits::String("PartialFunction".to_string())), - ), - ]) - .expect("ValueBody::Map"), - )), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 6389, 6607), - }); - declarations.push(Declaration { - id: DeclarationId(121), - name: Some("container_template_algebra".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227)], - output: DeclarationId(527), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/types.dag", 6664, 6716)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 6609, 6716), - }); - declarations.push(Declaration { - id: DeclarationId(122), - name: Some("container_template_alias_algebra".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227)], - output: DeclarationId(528), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/types.dag", 6779, 6829)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 6718, 6829), - }); - declarations.push(Declaration { - id: DeclarationId(123), - name: Some("canonical_container_names".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(529), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/types.dag", 7242, 7332)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 7195, 7332), - }); - declarations.push(Declaration { - id: DeclarationId(124), - name: Some("Bool".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "True".to_string(), - ty: DeclarationId(530), - }, - Field { - label: "False".to_string(), - ty: DeclarationId(531), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: Some(DeclarationId(532)), - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 8306, 8330), - }); - declarations.push(Declaration { - id: DeclarationId(125), - name: Some("Unit".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 8398, 8407), - }); - declarations.push(Declaration { - id: DeclarationId(126), - name: Some("Json".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 8524, 8533), - }); - declarations.push(Declaration { - id: DeclarationId(127), - name: Some("Bytes".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 8534, 8544), - }); - declarations.push(Declaration { - id: DeclarationId(128), - name: Some("Char".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(87))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(644)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 9172, 9223), - }); - declarations.push(Declaration { - id: DeclarationId(129), - name: Some("List".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(130), - }], - }, - type_params: vec![DeclarationId(130)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 9987, 10027), - }); - declarations.push(Declaration { - id: DeclarationId(130), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("element".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 9987, 10027), - }); - declarations.push(Declaration { - id: DeclarationId(131), - name: Some("Set".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(45), - arguments: vec![TemplateArgument { - parameter: DeclarationId(46), - value: DeclarationId(132), - }], - }, - type_params: vec![DeclarationId(132)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 10028, 10071), - }); - declarations.push(Declaration { - id: DeclarationId(132), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("element".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 10028, 10071), - }); - declarations.push(Declaration { - id: DeclarationId(133), - name: Some("Map".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(49), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(50), - value: DeclarationId(134), - }, - TemplateArgument { - parameter: DeclarationId(51), - value: DeclarationId(135), - }, - ], - }, - type_params: vec![DeclarationId(134), DeclarationId(135)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 10072, 10122), - }); - declarations.push(Declaration { - id: DeclarationId(134), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("key".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 10072, 10122), - }); - declarations.push(Declaration { - id: DeclarationId(135), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("value".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 10072, 10122), - }); - declarations.push(Declaration { - id: DeclarationId(136), - name: Some("CommitSha".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 11468, 11494), - }); - declarations.push(Declaration { - id: DeclarationId(137), - name: Some("Sha256".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 11562, 11588), - }); - declarations.push(Declaration { - id: DeclarationId(138), - name: Some("RetryCount".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(87))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(645)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 11589, 11640), - }); - declarations.push(Declaration { - id: DeclarationId(139), - name: Some("HttpStatus".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(87))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(646)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 11641, 11696), - }); - declarations.push(Declaration { - id: DeclarationId(140), - name: Some("Email".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 11770, 11796), - }); - declarations.push(Declaration { - id: DeclarationId(141), - name: Some("Port".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(87))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(647)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 11797, 11852), - }); - declarations.push(Declaration { - id: DeclarationId(142), - name: Some("GistId".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 11941, 11967), - }); - declarations.push(Declaration { - id: DeclarationId(143), - name: Some("Secret".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: Some(NominalOpacity { - permitted_accessors: vec![], - }), - span: SourceSpan::new("dsl/std/types.dag", 11968, 12009), - }); - declarations.push(Declaration { - id: DeclarationId(144), - name: Some("SecretValue".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(143))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(648)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 12010, 12052), - }); - declarations.push(Declaration { - id: DeclarationId(145), - name: Some("Url".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 12113, 12139), - }); - declarations.push(Declaration { - id: DeclarationId(146), - name: Some("SemVer".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 12212, 12238), - }); - declarations.push(Declaration { - id: DeclarationId(147), - name: Some("NonEmptyStr".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(227))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(649)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 12239, 12284), - }); - declarations.push(Declaration { - id: DeclarationId(148), - name: Some("LanguageId".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(227))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(650)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 12285, 12330), - }); - declarations.push(Declaration { - id: DeclarationId(149), - name: Some("SecretName".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(227))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(651)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 12331, 12376), - }); - declarations.push(Declaration { - id: DeclarationId(150), - name: Some("PathSegment".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(147))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(652)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 13011, 13070), - }); - declarations.push(Declaration { - id: DeclarationId(151), - name: Some("GlobSegment".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(147))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(653)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 13071, 13130), - }); - declarations.push(Declaration { - id: DeclarationId(152), - name: Some("FilePathParts".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "segments".to_string(), - ty: DeclarationId(533), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 13131, 13183), - }); - declarations.push(Declaration { - id: DeclarationId(153), - name: Some("GlobPattern".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "segments".to_string(), - ty: DeclarationId(534), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 13184, 13234), - }); - declarations.push(Declaration { - id: DeclarationId(154), - name: Some("FilePath".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(227))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(654)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 13235, 13278), - }); - declarations.push(Declaration { - id: DeclarationId(155), - name: Some("SourceSpan".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "file".to_string(), - ty: DeclarationId(154), - }, - Field { - label: "start".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "end".to_string(), - ty: DeclarationId(87), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 13896, 13956), - }); - declarations.push(Declaration { - id: DeclarationId(156), - name: Some("Timestamp".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 14056, 14082), - }); - declarations.push(Declaration { - id: DeclarationId(157), - name: Some("EpochMs".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(87))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(655)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 14083, 14127), - }); - declarations.push(Declaration { - id: DeclarationId(158), - name: Some("Duration".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(87))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(656)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 14128, 14172), - }); - declarations.push(Declaration { - id: DeclarationId(159), - name: Some("Milliseconds".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(87))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(657)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 14173, 14240), - }); - declarations.push(Declaration { - id: DeclarationId(160), - name: Some("Seconds".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(87))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(658)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 14241, 14303), - }); - declarations.push(Declaration { - id: DeclarationId(161), - name: Some("LogicalTime".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(147))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(659)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 14470, 14529), - }); - declarations.push(Declaration { - id: DeclarationId(162), - name: Some("IntentId".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(147))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(660)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15053, 15108), - }); - declarations.push(Declaration { - id: DeclarationId(163), - name: Some("IssueId".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(147))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(661)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15109, 15163), - }); - declarations.push(Declaration { - id: DeclarationId(164), - name: Some("RunKey".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(147))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(662)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15164, 15217), - }); - declarations.push(Declaration { - id: DeclarationId(165), - name: Some("ArtifactId".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(147))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(663)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15218, 15275), - }); - declarations.push(Declaration { - id: DeclarationId(166), - name: Some("LeaseToken".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(147))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(664)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15276, 15333), - }); - declarations.push(Declaration { - id: DeclarationId(167), - name: Some("WorkerId".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(147))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(665)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15334, 15389), - }); - declarations.push(Declaration { - id: DeclarationId(168), - name: Some("CommentId".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(147))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(666)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15390, 15446), - }); - declarations.push(Declaration { - id: DeclarationId(169), - name: Some("SignalKey".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(147))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(667)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15447, 15503), - }); - declarations.push(Declaration { - id: DeclarationId(170), - name: Some("ContentHash".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(147))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(668)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15504, 15562), - }); - declarations.push(Declaration { - id: DeclarationId(171), - name: Some("WorkflowProducerId".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(147))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(669)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15793, 15864), - }); - declarations.push(Declaration { - id: DeclarationId(172), - name: Some("WorkflowObserverId".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(147))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(670)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15865, 15936), - }); - declarations.push(Declaration { - id: DeclarationId(173), - name: Some("WorkflowProverId".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(147))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(671)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15937, 16004), - }); - declarations.push(Declaration { - id: DeclarationId(174), - name: Some("WorkflowRunId".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(147))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(672)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 16005, 16066), - }); - declarations.push(Declaration { - id: DeclarationId(175), - name: Some("GitRef".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(227))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(673)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 16146, 16188), - }); - declarations.push(Declaration { - id: DeclarationId(176), - name: Some("GcpProjectId".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(227))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(674)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 16573, 16615), - }); - declarations.push(Declaration { - id: DeclarationId(177), - name: Some("ServiceAccountEmail".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 16740, 16773), - }); - declarations.push(Declaration { - id: DeclarationId(178), - name: Some("Platform".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Linux".to_string(), - ty: DeclarationId(535), - }, - Field { - label: "Macos".to_string(), - ty: DeclarationId(536), - }, - Field { - label: "Windows".to_string(), - ty: DeclarationId(537), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17159, 17202), - }); - declarations.push(Declaration { - id: DeclarationId(179), - name: Some("TopologyNodeKind".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Pure".to_string(), - ty: DeclarationId(538), - }, - Field { - label: "Transport".to_string(), - ty: DeclarationId(539), - }, - Field { - label: "SubDag".to_string(), - ty: DeclarationId(540), - }, - Field { - label: "Env".to_string(), - ty: DeclarationId(541), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17330, 17385), - }); - declarations.push(Declaration { - id: DeclarationId(180), - name: Some("DocSourceKind".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Template".to_string(), - ty: DeclarationId(542), - }, - Field { - label: "Generated".to_string(), - ty: DeclarationId(543), - }, - Field { - label: "Static".to_string(), - ty: DeclarationId(544), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17386, 17439), - }); - declarations.push(Declaration { - id: DeclarationId(181), - name: Some("FermiDepth".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Xs".to_string(), - ty: DeclarationId(545), - }, - Field { - label: "S".to_string(), - ty: DeclarationId(546), - }, - Field { - label: "M".to_string(), - ty: DeclarationId(547), - }, - Field { - label: "L".to_string(), - ty: DeclarationId(548), - }, - Field { - label: "Xl".to_string(), - ty: DeclarationId(549), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17441, 17478), - }); - declarations.push(Declaration { - id: DeclarationId(182), - name: Some("CredentialFlow".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Stored".to_string(), - ty: DeclarationId(550), - }, - Field { - label: "PlatformInjected".to_string(), - ty: DeclarationId(551), - }, - Field { - label: "WorkloadIdentity".to_string(), - ty: DeclarationId(554), - }, - Field { - label: "InteractiveAuth".to_string(), - ty: DeclarationId(556), - }, - Field { - label: "Chained".to_string(), - ty: DeclarationId(558), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17726, 18048), - }); - declarations.push(Declaration { - id: DeclarationId(183), - name: Some("Arch".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "X86_64".to_string(), - ty: DeclarationId(559), - }, - Field { - label: "X86".to_string(), - ty: DeclarationId(560), - }, - Field { - label: "Aarch64".to_string(), - ty: DeclarationId(561), - }, - Field { - label: "Arm".to_string(), - ty: DeclarationId(562), - }, - Field { - label: "Armv7".to_string(), - ty: DeclarationId(563), - }, - Field { - label: "Mips".to_string(), - ty: DeclarationId(564), - }, - Field { - label: "Mipsel".to_string(), - ty: DeclarationId(565), - }, - Field { - label: "Mips64".to_string(), - ty: DeclarationId(566), - }, - Field { - label: "Mips64el".to_string(), - ty: DeclarationId(567), - }, - Field { - label: "Riscv64".to_string(), - ty: DeclarationId(568), - }, - Field { - label: "Wasm32".to_string(), - ty: DeclarationId(569), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18123, 18226), - }); - declarations.push(Declaration { - id: DeclarationId(184), - name: Some("Vendor".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "UnknownVendor".to_string(), - ty: DeclarationId(570), - }, - Field { - label: "Pc".to_string(), - ty: DeclarationId(571), - }, - Field { - label: "Apple".to_string(), - ty: DeclarationId(572), - }, - Field { - label: "W64".to_string(), - ty: DeclarationId(573), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18227, 18273), - }); - declarations.push(Declaration { - id: DeclarationId(185), - name: Some("Os".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Linux".to_string(), - ty: DeclarationId(574), - }, - Field { - label: "Macos".to_string(), - ty: DeclarationId(575), - }, - Field { - label: "Windows".to_string(), - ty: DeclarationId(576), - }, - Field { - label: "Freebsd".to_string(), - ty: DeclarationId(577), - }, - Field { - label: "Android".to_string(), - ty: DeclarationId(578), - }, - Field { - label: "Ios".to_string(), - ty: DeclarationId(579), - }, - Field { - label: "Wasi".to_string(), - ty: DeclarationId(580), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18274, 18340), - }); - declarations.push(Declaration { - id: DeclarationId(186), - name: Some("AbiEnv".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "NoneAbi".to_string(), - ty: DeclarationId(581), - }, - Field { - label: "Gnu".to_string(), - ty: DeclarationId(582), - }, - Field { - label: "GnuEabi".to_string(), - ty: DeclarationId(583), - }, - Field { - label: "GnuEabihf".to_string(), - ty: DeclarationId(584), - }, - Field { - label: "Musl".to_string(), - ty: DeclarationId(585), - }, - Field { - label: "Msvc".to_string(), - ty: DeclarationId(586), - }, - Field { - label: "AndroidAbi".to_string(), - ty: DeclarationId(587), - }, - Field { - label: "Eabi".to_string(), - ty: DeclarationId(588), - }, - Field { - label: "Eabihf".to_string(), - ty: DeclarationId(589), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18341, 18433), - }); - declarations.push(Declaration { - id: DeclarationId(187), - name: Some("ExecutionEnv".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Native".to_string(), - ty: DeclarationId(590), - }, - Field { - label: "Wsl".to_string(), - ty: DeclarationId(591), - }, - Field { - label: "Container".to_string(), - ty: DeclarationId(592), - }, - Field { - label: "Ci".to_string(), - ty: DeclarationId(593), - }, - Field { - label: "Emulator".to_string(), - ty: DeclarationId(594), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18434, 18494), - }); - declarations.push(Declaration { - id: DeclarationId(188), - name: Some("TargetTriple".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "arch".to_string(), - ty: DeclarationId(183), - }, - Field { - label: "vendor".to_string(), - ty: DeclarationId(184), - }, - Field { - label: "os".to_string(), - ty: DeclarationId(185), - }, - Field { - label: "env".to_string(), - ty: DeclarationId(595), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18496, 18571), - }); - declarations.push(Declaration { - id: DeclarationId(189), - name: Some("RuntimePlatform".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "host".to_string(), - ty: DeclarationId(188), - }, - Field { - label: "env".to_string(), - ty: DeclarationId(187), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18573, 18638), - }); - declarations.push(Declaration { - id: DeclarationId(190), - name: Some("EntryKind".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "RegularFile".to_string(), - ty: DeclarationId(596), - }, - Field { - label: "Directory".to_string(), - ty: DeclarationId(597), - }, - Field { - label: "Symlink".to_string(), - ty: DeclarationId(598), - }, - Field { - label: "Missing".to_string(), - ty: DeclarationId(599), - }, - Field { - label: "Other".to_string(), - ty: DeclarationId(600), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18947, 19025), - }); - declarations.push(Declaration { - id: DeclarationId(191), - name: Some("SymlinkTarget".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "TargetFile".to_string(), - ty: DeclarationId(601), - }, - Field { - label: "TargetDir".to_string(), - ty: DeclarationId(602), - }, - Field { - label: "Broken".to_string(), - ty: DeclarationId(603), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 19155, 19213), - }); - declarations.push(Declaration { - id: DeclarationId(192), - name: Some("TextFilePath".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(154), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 20374, 20404), - }); - declarations.push(Declaration { - id: DeclarationId(193), - name: Some("BinaryFilePath".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(154), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 20485, 20515), - }); - declarations.push(Declaration { - id: DeclarationId(194), - name: Some("MimeType".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 20732, 20754), - }); - declarations.push(Declaration { - id: DeclarationId(195), - name: Some("HttpMethod".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "GET".to_string(), - ty: DeclarationId(604), - }, - Field { - label: "POST".to_string(), - ty: DeclarationId(605), - }, - Field { - label: "PUT".to_string(), - ty: DeclarationId(606), - }, - Field { - label: "PATCH".to_string(), - ty: DeclarationId(607), - }, - Field { - label: "DELETE".to_string(), - ty: DeclarationId(608), - }, - Field { - label: "HEAD".to_string(), - ty: DeclarationId(609), - }, - Field { - label: "OPTIONS".to_string(), - ty: DeclarationId(610), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 21498, 21566), - }); - declarations.push(Declaration { - id: DeclarationId(196), - name: Some("AuthScheme".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Bearer".to_string(), - ty: DeclarationId(611), - }, - Field { - label: "Header".to_string(), - ty: DeclarationId(612), - }, - Field { - label: "Basic".to_string(), - ty: DeclarationId(613), - }, - Field { - label: "ApiKey".to_string(), - ty: DeclarationId(614), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22034, 22130), - }); - declarations.push(Declaration { - id: DeclarationId(197), - name: Some("AccessToken".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "token".to_string(), - ty: DeclarationId(143), - }, - Field { - label: "scheme".to_string(), - ty: DeclarationId(196), - }, - Field { - label: "expires_at".to_string(), - ty: DeclarationId(615), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22252, 22385), - }); - declarations.push(Declaration { - id: DeclarationId(198), - name: Some("Credential".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "token".to_string(), - ty: DeclarationId(143), - }, - Field { - label: "scheme".to_string(), - ty: DeclarationId(196), - }, - Field { - label: "header_name".to_string(), - ty: DeclarationId(616), - }, - Field { - label: "source_id".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "required_scopes".to_string(), - ty: DeclarationId(617), - }, - Field { - label: "expires_in".to_string(), - ty: DeclarationId(618), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22387, 22537), - }); - declarations.push(Declaration { - id: DeclarationId(199), - name: Some("FilesystemHandle".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(154))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(675)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22614, 22678), - }); - declarations.push(Declaration { - id: DeclarationId(200), - name: Some("NetworkHandle".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(125))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(676)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22679, 22736), - }); - declarations.push(Declaration { - id: DeclarationId(201), - name: Some("ToolHandle".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(227))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(677)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22737, 22793), - }); - declarations.push(Declaration { - id: DeclarationId(202), - name: Some("TransportRequest".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "method".to_string(), - ty: DeclarationId(195), - }, - Field { - label: "url".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "headers".to_string(), - ty: DeclarationId(126), - }, - Field { - label: "body".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22870, 22961), - }); - declarations.push(Declaration { - id: DeclarationId(203), - name: Some("TransportResponse".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "status".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "headers".to_string(), - ty: DeclarationId(126), - }, - Field { - label: "body".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22963, 23034), - }); - declarations.push(Declaration { - id: DeclarationId(204), - name: Some("FileResponse".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "path".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "success".to_string(), - ty: DeclarationId(124), - }, - Field { - label: "content".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 23036, 23106), - }); - declarations.push(Declaration { - id: DeclarationId(205), - name: Some("ShellResponse".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "exit_code".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "stdout".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "stderr".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 23108, 23181), - }); - declarations.push(Declaration { - id: DeclarationId(206), - name: Some("RestResponse".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "status".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "headers".to_string(), - ty: DeclarationId(126), - }, - Field { - label: "body".to_string(), - ty: DeclarationId(126), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 23183, 23247), - }); - declarations.push(Declaration { - id: DeclarationId(207), - name: Some("TestResult".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "ok".to_string(), - ty: DeclarationId(124), - }, - Field { - label: "stdout".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "stderr".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "duration_ms".to_string(), - ty: DeclarationId(159), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 23324, 23431), - }); - declarations.push(Declaration { - id: DeclarationId(208), - name: Some("Summary".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "total".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "passed".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "failed".to_string(), - ty: DeclarationId(87), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 23433, 23490), - }); - declarations.push(Declaration { - id: DeclarationId(209), - name: Some("StageResult".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "success".to_string(), - ty: DeclarationId(124), - }, - Field { - label: "stdout".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "stderr".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "skipped".to_string(), - ty: DeclarationId(124), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 23492, 23593), - }); - declarations.push(Declaration { - id: DeclarationId(210), - name: Some("DocumentLine".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "text".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "is_comment".to_string(), - ty: DeclarationId(124), - }, - Field { - label: "is_blank".to_string(), - ty: DeclarationId(124), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 23746, 23818), - }); - declarations.push(Declaration { - id: DeclarationId(211), - name: Some("DocumentSection".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "title".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "has_title".to_string(), - ty: DeclarationId(124), - }, - Field { - label: "lines".to_string(), - ty: DeclarationId(619), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 23820, 23906), - }); - declarations.push(Declaration { - id: DeclarationId(212), - name: Some("Document".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "header".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "has_header".to_string(), - ty: DeclarationId(124), - }, - Field { - label: "comment_prefix".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "sections".to_string(), - ty: DeclarationId(620), - }, - Field { - label: "trailing_newline".to_string(), - ty: DeclarationId(124), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 23908, 24045), - }); - declarations.push(Declaration { - id: DeclarationId(213), - name: Some("TextFile".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "path".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "document".to_string(), - ty: DeclarationId(212), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24047, 24100), - }); - declarations.push(Declaration { - id: DeclarationId(214), - name: Some("RenderedTextFile".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "path".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "content".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24102, 24160), - }); - declarations.push(Declaration { - id: DeclarationId(215), - name: Some("ToolEntry".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "command".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "description".to_string(), - ty: DeclarationId(621), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24237, 24311), - }); - declarations.push(Declaration { - id: DeclarationId(216), - name: Some("ToolRegistry".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "tools".to_string(), - ty: DeclarationId(622), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24313, 24359), - }); - declarations.push(Declaration { - id: DeclarationId(217), - name: Some("DagTopology".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "nodes".to_string(), - ty: DeclarationId(623), - }, - Field { - label: "edges".to_string(), - ty: DeclarationId(624), - }, - Field { - label: "subdag_boundaries".to_string(), - ty: DeclarationId(625), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24618, 24728), - }); - declarations.push(Declaration { - id: DeclarationId(218), - name: Some("TopologyNode".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "id".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "label".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "kind".to_string(), - ty: DeclarationId(179), - }, - Field { - label: "parent".to_string(), - ty: DeclarationId(626), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24730, 24850), - }); - declarations.push(Declaration { - id: DeclarationId(219), - name: Some("TopologyEdge".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "from".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "to".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "port".to_string(), - ty: DeclarationId(627), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24852, 24917), - }); - declarations.push(Declaration { - id: DeclarationId(220), - name: Some("DagDiff".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "added".to_string(), - ty: DeclarationId(628), - }, - Field { - label: "removed".to_string(), - ty: DeclarationId(629), - }, - Field { - label: "changed".to_string(), - ty: DeclarationId(630), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24919, 25005), - }); - declarations.push(Declaration { - id: DeclarationId(221), - name: Some("CodegenTarget".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "path".to_string(), - ty: DeclarationId(154), - }, - Field { - label: "backend".to_string(), - ty: DeclarationId(631), - }, - Field { - label: "target".to_string(), - ty: DeclarationId(632), - }, - Field { - label: "runtime_env".to_string(), - ty: DeclarationId(633), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25074, 25208), - }); - declarations.push(Declaration { - id: DeclarationId(222), - name: Some("CodegenBackend".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Rust".to_string(), - ty: DeclarationId(634), - }, - Field { - label: "Go".to_string(), - ty: DeclarationId(635), - }, - Field { - label: "C".to_string(), - ty: DeclarationId(636), - }, - Field { - label: "Mips".to_string(), - ty: DeclarationId(637), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25210, 25252), - }); - declarations.push(Declaration { - id: DeclarationId(223), - name: Some("PragmaDirective".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "key".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "value".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "scope".to_string(), - ty: DeclarationId(638), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25254, 25325), - }); - declarations.push(Declaration { - id: DeclarationId(224), - name: Some("DocSource".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "path".to_string(), - ty: DeclarationId(154), - }, - Field { - label: "kind".to_string(), - ty: DeclarationId(180), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25466, 25523), - }); - declarations.push(Declaration { - id: DeclarationId(225), - name: Some("ReferenceModel".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![DeclarationId(226)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 27457, 27476), - }); - declarations.push(Declaration { - id: DeclarationId(226), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 27457, 27476), - }); - declarations.push(Declaration { - id: DeclarationId(227), - name: Some("String".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(128), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/string_type.dag", 606, 636), - }); - declarations.push(Declaration { - id: DeclarationId(228), - name: Some("CharClass".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Whitespace".to_string(), - ty: DeclarationId(678), - }, - Field { - label: "Digit".to_string(), - ty: DeclarationId(679), - }, - Field { - label: "IdentStart".to_string(), - ty: DeclarationId(680), - }, - Field { - label: "IdentContinue".to_string(), - ty: DeclarationId(681), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 3662, 3726), - }); - declarations.push(Declaration { - id: DeclarationId(229), - name: Some("char_in_class".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(128), DeclarationId(228)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(250))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 4059, 4926), - }); - declarations.push(Declaration { - id: DeclarationId(230), - name: Some("DisplayWidth".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ZeroWidth".to_string(), - ty: DeclarationId(682), - }, - Field { - label: "Narrow".to_string(), - ty: DeclarationId(683), - }, - Field { - label: "Wide".to_string(), - ty: DeclarationId(684), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 5290, 5335), - }); - declarations.push(Declaration { - id: DeclarationId(231), - name: Some("display_width_columns".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(230)], - output: DeclarationId(87), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/unicode.dag", 5386, 5462)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 5337, 5462), - }); - declarations.push(Declaration { - id: DeclarationId(232), - name: Some("UnicodeBlock".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "start".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "end_inclusive".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "default_width".to_string(), - ty: DeclarationId(230), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 5697, 5797), - }); - declarations.push(Declaration { - id: DeclarationId(233), - name: Some("zero_width_blocks".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(232), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(685)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::List(vec![ - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String( - "Combining Diacritical Marks".to_string(), - )), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("768".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("879".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(682), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String( - "Combining Diacritical Marks Extended".to_string(), - )), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("6832".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("6911".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(682), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String( - "Combining Diacritical Marks Supplement".to_string(), - )), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("7616".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("7679".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(682), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String( - "Combining Marks for Symbols".to_string(), - )), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("8400".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("8447".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(682), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("Variation Selectors".to_string())), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("65024".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("65039".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(682), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String( - "Combining Half Marks".to_string(), - )), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("65056".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("65071".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(682), - payload: vec![], - }, - ), - ]), - ])), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 5859, 6608), - }); - declarations.push(Declaration { - id: DeclarationId(234), - name: Some("zero_width_codepoints".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(686)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::List(vec![ - FieldValue::Literal(LiteralBits::Int("8203".to_string())), - FieldValue::Literal(LiteralBits::Int("8204".to_string())), - FieldValue::Literal(LiteralBits::Int("8205".to_string())), - FieldValue::Literal(LiteralBits::Int("65279".to_string())), - ])), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 6675, 6887), - }); - declarations.push(Declaration { - id: DeclarationId(235), - name: Some("wide_blocks".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(232), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(687)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::List(vec![ - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("Hangul Jamo".to_string())), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("4352".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("4447".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(684), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String( - "CJK Radicals and Symbols".to_string(), - )), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("11904".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("12350".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(684), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String( - "Hiragana / Katakana / CJK Compat".to_string(), - )), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("12353".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("13247".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(684), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("CJK Extension A".to_string())), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("13312".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("19903".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(684), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String( - "CJK Unified Ideographs".to_string(), - )), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("19968".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("40959".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(684), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String( - "Yi Syllables and Radicals".to_string(), - )), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("40960".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("42191".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(684), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("Hangul Syllables".to_string())), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("44032".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("55215".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(684), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String( - "CJK Compatibility Ideographs".to_string(), - )), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("63744".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("64255".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(684), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String( - "CJK Compatibility Forms".to_string(), - )), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("65072".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("65135".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(684), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("Fullwidth ASCII".to_string())), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("65281".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("65376".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(684), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("Fullwidth Signs".to_string())), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("65504".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("65510".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(684), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("CJK Extension B+".to_string())), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("131072".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("196607".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(684), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("CJK Extension G+".to_string())), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("196608".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("262143".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(684), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String( - "Misc Symbols and Dingbats".to_string(), - )), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("9728".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("10175".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(684), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String( - "Symbols / Pictographs / Emoticons".to_string(), - )), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("127744".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("129535".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(684), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("Symbols Extended".to_string())), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("129536".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("131071".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(684), - payload: vec![], - }, - ), - ]), - ])), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 6934, 8723), - }); - declarations.push(Declaration { - id: DeclarationId(236), - name: Some("code_point".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(128)], - output: DeclarationId(87), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(253))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 8873, 8910), - }); - declarations.push(Declaration { - id: DeclarationId(237), - name: Some("in_block".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87), DeclarationId(232)], - output: DeclarationId(124), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/unicode.dag", 8962, 9014)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 8912, 9014), - }); - declarations.push(Declaration { - id: DeclarationId(238), - name: Some("char_display_width".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(128)], - output: DeclarationId(230), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/unicode.dag", 9063, 9366)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 9016, 9366), - }); - declarations.push(Declaration { - id: DeclarationId(239), - name: Some("char_width".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(128)], - output: DeclarationId(87), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/unicode.dag", 9398, 9454)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 9368, 9454), - }); - declarations.push(Declaration { - id: DeclarationId(240), - name: Some("string_display_width".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227)], - output: DeclarationId(87), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/unicode.dag", 9498, 9636)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 9456, 9636), - }); - declarations.push(Declaration { - id: DeclarationId(241), - name: Some("repeat_string_loop".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227), DeclarationId(227), DeclarationId(87)], - output: DeclarationId(227), - body: ArrowBody::Unparsed(SourceSpan::new( - "dsl/std/render_repeat_string_bootstrap.dag", - 598, - 717, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/render_repeat_string_bootstrap.dag", 526, 717), - }); - declarations.push(Declaration { - id: DeclarationId(242), - name: Some("repeat_string".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227), DeclarationId(87)], - output: DeclarationId(227), - body: ArrowBody::Unparsed(SourceSpan::new( - "dsl/std/render_repeat_string_bootstrap.dag", - 765, - 818, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/render_repeat_string_bootstrap.dag", 719, 818), - }); - declarations.push(Declaration { - id: DeclarationId(243), - name: Some("MethodDeclaration".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "name".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 4779, 4820), - }); - declarations.push(Declaration { - id: DeclarationId(244), - name: Some("add_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("add".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 5269, 5321), - }); - declarations.push(Declaration { - id: DeclarationId(245), - name: Some("all_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("all".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 5322, 5374), - }); - declarations.push(Declaration { - id: DeclarationId(246), - name: Some("any_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("any".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 5375, 5427), - }); - declarations.push(Declaration { - id: DeclarationId(247), - name: Some("append_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("append".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 5428, 5486), - }); - declarations.push(Declaration { - id: DeclarationId(248), - name: Some("bottom_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("bottom".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 5487, 5545), - }); - declarations.push(Declaration { - id: DeclarationId(249), - name: Some("chars_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("chars".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 5546, 5602), - }); - declarations.push(Declaration { - id: DeclarationId(250), - name: Some("clamp_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("clamp".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 5603, 5659), - }); - declarations.push(Declaration { - id: DeclarationId(251), - name: Some("compare_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("compare".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 5660, 5720), - }); - declarations.push(Declaration { - id: DeclarationId(252), - name: Some("complement_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("complement".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 5721, 5787), - }); - declarations.push(Declaration { - id: DeclarationId(253), - name: Some("concat_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("concat".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 5788, 5846), - }); - declarations.push(Declaration { - id: DeclarationId(254), - name: Some("contains_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("contains".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 5847, 5909), - }); - declarations.push(Declaration { - id: DeclarationId(255), - name: Some("count_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("count".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 5910, 5966), - }); - declarations.push(Declaration { - id: DeclarationId(256), - name: Some("diff_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("diff".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 5967, 6021), - }); - declarations.push(Declaration { - id: DeclarationId(257), - name: Some("empty_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("empty".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 6022, 6078), - }); - declarations.push(Declaration { - id: DeclarationId(258), - name: Some("ends_with_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("ends_with".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 6079, 6143), - }); - declarations.push(Declaration { - id: DeclarationId(259), - name: Some("enumerate_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("enumerate".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 6144, 6208), - }); - declarations.push(Declaration { - id: DeclarationId(260), - name: Some("filter_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("filter".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 6209, 6267), - }); - declarations.push(Declaration { - id: DeclarationId(261), - name: Some("first_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("first".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 6268, 6324), - }); - declarations.push(Declaration { - id: DeclarationId(262), - name: Some("flat_map_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("flat_map".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 6325, 6387), - }); - declarations.push(Declaration { - id: DeclarationId(263), - name: Some("fold_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("fold".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 6388, 6442), - }); - declarations.push(Declaration { - id: DeclarationId(264), - name: Some("get_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("get".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 6443, 6495), - }); - declarations.push(Declaration { - id: DeclarationId(265), - name: Some("has_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("has".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 6496, 6548), - }); - declarations.push(Declaration { - id: DeclarationId(266), - name: Some("intersect_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("intersect".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 6549, 6613), - }); - declarations.push(Declaration { - id: DeclarationId(267), - name: Some("is_empty_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("is_empty".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 6614, 6676), - }); - declarations.push(Declaration { - id: DeclarationId(268), - name: Some("join_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("join".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 6677, 6731), - }); - declarations.push(Declaration { - id: DeclarationId(269), - name: Some("keys_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("keys".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 6732, 6786), - }); - declarations.push(Declaration { - id: DeclarationId(270), - name: Some("last_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("last".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 6787, 6841), - }); - declarations.push(Declaration { - id: DeclarationId(271), - name: Some("length_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("length".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 6842, 6900), - }); - declarations.push(Declaration { - id: DeclarationId(272), - name: Some("list_push_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("list_push".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 6901, 6965), - }); - declarations.push(Declaration { - id: DeclarationId(273), - name: Some("lookup_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("lookup".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 6966, 7024), - }); - declarations.push(Declaration { - id: DeclarationId(274), - name: Some("map_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("map".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 7025, 7077), - }); - declarations.push(Declaration { - id: DeclarationId(275), - name: Some("map_contains_key_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("map_contains_key".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 7078, 7156), - }); - declarations.push(Declaration { - id: DeclarationId(276), - name: Some("map_get_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("map_get".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 7157, 7217), - }); - declarations.push(Declaration { - id: DeclarationId(277), - name: Some("map_has_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("map_has".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 7218, 7278), - }); - declarations.push(Declaration { - id: DeclarationId(278), - name: Some("map_insert_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("map_insert".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 7279, 7345), - }); - declarations.push(Declaration { - id: DeclarationId(279), - name: Some("map_keys_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("map_keys".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 7346, 7408), - }); - declarations.push(Declaration { - id: DeclarationId(280), - name: Some("map_merge_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("map_merge".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 7409, 7473), - }); - declarations.push(Declaration { - id: DeclarationId(281), - name: Some("map_values_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("map_values".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 7474, 7540), - }); - declarations.push(Declaration { - id: DeclarationId(282), - name: Some("meet_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("meet".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 7541, 7595), - }); - declarations.push(Declaration { - id: DeclarationId(283), - name: Some("member_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("member".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 7596, 7654), - }); - declarations.push(Declaration { - id: DeclarationId(284), - name: Some("mul_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("mul".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 7655, 7707), - }); - declarations.push(Declaration { - id: DeclarationId(285), - name: Some("negate_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("negate".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 7708, 7766), - }); - declarations.push(Declaration { - id: DeclarationId(286), - name: Some("one_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("one".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 7767, 7819), - }); - declarations.push(Declaration { - id: DeclarationId(287), - name: Some("reciprocal_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("reciprocal".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 7820, 7886), - }); - declarations.push(Declaration { - id: DeclarationId(288), - name: Some("replace_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("replace".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 7887, 7947), - }); - declarations.push(Declaration { - id: DeclarationId(289), - name: Some("reverse_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("reverse".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 7948, 8008), - }); - declarations.push(Declaration { - id: DeclarationId(290), - name: Some("skip_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("skip".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 8009, 8063), - }); - declarations.push(Declaration { - id: DeclarationId(291), - name: Some("sort_by_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("sort_by".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 8064, 8124), - }); - declarations.push(Declaration { - id: DeclarationId(292), - name: Some("split_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("split".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 8125, 8181), - }); - declarations.push(Declaration { - id: DeclarationId(293), - name: Some("starts_with_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("starts_with".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 8182, 8250), - }); - declarations.push(Declaration { - id: DeclarationId(294), - name: Some("string_contains_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("string_contains".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 8251, 8327), - }); - declarations.push(Declaration { - id: DeclarationId(295), - name: Some("substring_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("substring".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 8328, 8392), - }); - declarations.push(Declaration { - id: DeclarationId(296), - name: Some("take_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("take".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 8393, 8447), - }); - declarations.push(Declaration { - id: DeclarationId(297), - name: Some("to_int_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("to_int".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 8448, 8506), - }); - declarations.push(Declaration { - id: DeclarationId(298), - name: Some("to_lower_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("to_lower".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 8507, 8569), - }); - declarations.push(Declaration { - id: DeclarationId(299), - name: Some("to_string_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("to_string".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 8570, 8634), - }); - declarations.push(Declaration { - id: DeclarationId(300), - name: Some("to_upper_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("to_upper".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 8635, 8697), - }); - declarations.push(Declaration { - id: DeclarationId(301), - name: Some("top_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("top".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 8698, 8750), - }); - declarations.push(Declaration { - id: DeclarationId(302), - name: Some("trim_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("trim".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 8751, 8805), - }); - declarations.push(Declaration { - id: DeclarationId(303), - name: Some("union_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("union".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 8806, 8862), - }); - declarations.push(Declaration { - id: DeclarationId(304), - name: Some("values_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("values".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 8863, 8921), - }); - declarations.push(Declaration { - id: DeclarationId(305), - name: Some("with_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("with".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 8922, 8976), - }); - declarations.push(Declaration { - id: DeclarationId(306), - name: Some("zero_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("zero".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 8977, 9031), - }); - declarations.push(Declaration { - id: DeclarationId(307), - name: Some("DeclarationRef".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/serialization.dag", 692, 720), - }); - declarations.push(Declaration { - id: DeclarationId(308), - name: Some("VariantNaming".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "AsAuthored".to_string(), - ty: DeclarationId(688), - }, - Field { - label: "SnakeCase".to_string(), - ty: DeclarationId(689), - }, - Field { - label: "StripPrefixAndSnakeCase".to_string(), - ty: DeclarationId(690), - }, - Field { - label: "StripSuffixAndSnakeCase".to_string(), - ty: DeclarationId(691), - }, - Field { - label: "StripPrefixSuffixAndSnakeCase".to_string(), - ty: DeclarationId(692), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/serialization.dag", 1850, 2060), - }); - declarations.push(Declaration { - id: DeclarationId(309), - name: Some("VariantEncoding".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "StringVariant".to_string(), - ty: DeclarationId(693), - }, - Field { - label: "InternallyTaggedObject".to_string(), - ty: DeclarationId(694), - }, - Field { - label: "UntaggedVariant".to_string(), - ty: DeclarationId(695), - }, - Field { - label: "TaggedVariant".to_string(), - ty: DeclarationId(696), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/serialization.dag", 2606, 2780), - }); - declarations.push(Declaration { - id: DeclarationId(310), - name: Some("CoproductWireContract".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "coproduct".to_string(), - ty: DeclarationId(307), - }, - Field { - label: "encoding".to_string(), - ty: DeclarationId(309), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/serialization.dag", 3002, 3088), - }); - declarations.push(Declaration { - id: DeclarationId(311), - name: Some("WireContract".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "variant_encoding".to_string(), - ty: DeclarationId(309), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/serialization.dag", 3233, 3290), - }); - declarations.push(Declaration { - id: DeclarationId(312), - name: Some("WireFormat".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Json".to_string(), - ty: DeclarationId(697), - }, - Field { - label: "Text".to_string(), - ty: DeclarationId(698), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/serialization.dag", 3481, 3510), - }); - declarations.push(Declaration { - id: DeclarationId(313), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/logic.dag", 304, 308), - }); - declarations.push(Declaration { - id: DeclarationId(314), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/logic.dag", 311, 316), - }); - declarations.push(Declaration { - id: DeclarationId(315), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(4), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/bit.dag", 1023, 1032), - }); - declarations.push(Declaration { - id: DeclarationId(316), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(4), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/bit.dag", 1136, 1145), - }); - declarations.push(Declaration { - id: DeclarationId(317), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(6), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/bit.dag", 1272, 1282), - }); - declarations.push(Declaration { - id: DeclarationId(318), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(6), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/bit.dag", 1306, 1316), - }); - declarations.push(Declaration { - id: DeclarationId(319), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(6), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/bit.dag", 1340, 1350), - }); - declarations.push(Declaration { - id: DeclarationId(320), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(6), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/bit.dag", 1375, 1385), - }); - declarations.push(Declaration { - id: DeclarationId(321), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "value".to_string(), - ty: DeclarationId(12), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/error_primitives.dag", 620, 636), - }); - declarations.push(Declaration { - id: DeclarationId(322), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "value".to_string(), - ty: DeclarationId(13), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/error_primitives.dag", 639, 657), - }); - declarations.push(Declaration { - id: DeclarationId(323), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/error_primitives.dag", 936, 948), - }); - declarations.push(Declaration { - id: DeclarationId(324), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/error_primitives.dag", 951, 959), - }); - declarations.push(Declaration { - id: DeclarationId(325), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(58), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 24253, 24279), - }); - declarations.push(Declaration { - id: DeclarationId(326), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(58), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 25463, 25489), - }); - declarations.push(Declaration { - id: DeclarationId(327), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(58), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 26620, 26646), - }); - declarations.push(Declaration { - id: DeclarationId(328), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(58), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 27746, 27772), - }); - declarations.push(Declaration { - id: DeclarationId(329), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(58), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 31202, 31228), - }); - declarations.push(Declaration { - id: DeclarationId(330), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(58), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 34515, 34541), - }); - declarations.push(Declaration { - id: DeclarationId(331), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(58), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 39940, 39966), - }); - declarations.push(Declaration { - id: DeclarationId(332), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(58), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 42853, 42879), - }); - declarations.push(Declaration { - id: DeclarationId(333), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 43672, 43684), - }); - declarations.push(Declaration { - id: DeclarationId(334), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(16), DeclarationId(16)], - output: DeclarationId(16), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 4724, 4737), - }); - declarations.push(Declaration { - id: DeclarationId(335), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(18), DeclarationId(18)], - output: DeclarationId(18), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 4843, 4856), - }); - declarations.push(Declaration { - id: DeclarationId(336), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(20), DeclarationId(20)], - output: DeclarationId(20), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 5060, 5073), - }); - declarations.push(Declaration { - id: DeclarationId(337), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(22), DeclarationId(22)], - output: DeclarationId(22), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 5182, 5195), - }); - declarations.push(Declaration { - id: DeclarationId(338), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(24), DeclarationId(24)], - output: DeclarationId(24), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 5333, 5346), - }); - declarations.push(Declaration { - id: DeclarationId(339), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(24)], - output: DeclarationId(24), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 5372, 5382), - }); - declarations.push(Declaration { - id: DeclarationId(340), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(26), DeclarationId(26)], - output: DeclarationId(26), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 5451, 5464), - }); - declarations.push(Declaration { - id: DeclarationId(341), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(26)], - output: DeclarationId(26), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 5490, 5500), - }); - declarations.push(Declaration { - id: DeclarationId(342), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(32), DeclarationId(32)], - output: DeclarationId(32), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 10528, 10541), - }); - declarations.push(Declaration { - id: DeclarationId(343), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(32), DeclarationId(32)], - output: DeclarationId(32), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 10559, 10572), - }); - declarations.push(Declaration { - id: DeclarationId(344), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(34), DeclarationId(34)], - output: DeclarationId(34), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 11014, 11027), - }); - declarations.push(Declaration { - id: DeclarationId(345), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(34), DeclarationId(34)], - output: DeclarationId(34), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 11045, 11058), - }); - declarations.push(Declaration { - id: DeclarationId(346), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(36), DeclarationId(36)], - output: DeclarationId(36), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 11218, 11231), - }); - declarations.push(Declaration { - id: DeclarationId(347), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(36)], - output: DeclarationId(36), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 11252, 11262), - }); - declarations.push(Declaration { - id: DeclarationId(348), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(36), DeclarationId(36)], - output: DeclarationId(36), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 11270, 11283), - }); - declarations.push(Declaration { - id: DeclarationId(349), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(38), DeclarationId(38)], - output: DeclarationId(38), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12084, 12097), - }); - declarations.push(Declaration { - id: DeclarationId(350), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(38), DeclarationId(38)], - output: DeclarationId(38), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12105, 12118), - }); - declarations.push(Declaration { - id: DeclarationId(351), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(38)], - output: DeclarationId(38), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12139, 12149), - }); - declarations.push(Declaration { - id: DeclarationId(352), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(38), DeclarationId(38)], - output: DeclarationId(38), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12157, 12170), - }); - declarations.push(Declaration { - id: DeclarationId(353), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(11), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(12), - value: DeclarationId(38), - }, - TemplateArgument { - parameter: DeclarationId(13), - value: DeclarationId(14), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12190, 12209), - }); - declarations.push(Declaration { - id: DeclarationId(354), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(38), DeclarationId(38)], - output: DeclarationId(353), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12178, 12209), - }); - declarations.push(Declaration { - id: DeclarationId(355), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(38), DeclarationId(38)], - output: DeclarationId(52), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12230, 12250), - }); - declarations.push(Declaration { - id: DeclarationId(356), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(38), DeclarationId(38)], - output: DeclarationId(124), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12257, 12273), - }); - declarations.push(Declaration { - id: DeclarationId(357), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(38), DeclarationId(38)], - output: DeclarationId(124), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12280, 12296), - }); - declarations.push(Declaration { - id: DeclarationId(358), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(38), DeclarationId(38)], - output: DeclarationId(124), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12303, 12319), - }); - declarations.push(Declaration { - id: DeclarationId(359), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(38), DeclarationId(38)], - output: DeclarationId(124), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12326, 12342), - }); - declarations.push(Declaration { - id: DeclarationId(360), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(38), DeclarationId(38)], - output: DeclarationId(124), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12349, 12365), - }); - declarations.push(Declaration { - id: DeclarationId(361), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(38), DeclarationId(38)], - output: DeclarationId(124), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12372, 12388), - }); - declarations.push(Declaration { - id: DeclarationId(362), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(40), DeclarationId(40)], - output: DeclarationId(40), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12551, 12564), - }); - declarations.push(Declaration { - id: DeclarationId(363), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(40)], - output: DeclarationId(40), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12585, 12595), - }); - declarations.push(Declaration { - id: DeclarationId(364), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(40), DeclarationId(40)], - output: DeclarationId(40), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12603, 12616), - }); - declarations.push(Declaration { - id: DeclarationId(365), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(40)], - output: DeclarationId(40), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12640, 12650), - }); - declarations.push(Declaration { - id: DeclarationId(366), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(40), DeclarationId(40)], - output: DeclarationId(52), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12662, 12682), - }); - declarations.push(Declaration { - id: DeclarationId(367), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(42), DeclarationId(42)], - output: DeclarationId(42), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 13030, 13043), - }); - declarations.push(Declaration { - id: DeclarationId(368), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(42), DeclarationId(42)], - output: DeclarationId(42), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 13052, 13065), - }); - declarations.push(Declaration { - id: DeclarationId(369), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(44), DeclarationId(44)], - output: DeclarationId(44), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 13208, 13221), - }); - declarations.push(Declaration { - id: DeclarationId(370), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(44), DeclarationId(44)], - output: DeclarationId(44), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 13230, 13243), - }); - declarations.push(Declaration { - id: DeclarationId(371), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(46), DeclarationId(46)], - output: DeclarationId(46), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 13497, 13510), - }); - declarations.push(Declaration { - id: DeclarationId(372), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(46), DeclarationId(46)], - output: DeclarationId(46), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 13519, 13532), - }); - declarations.push(Declaration { - id: DeclarationId(373), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(46)], - output: DeclarationId(46), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 13547, 13557), - }); - declarations.push(Declaration { - id: DeclarationId(374), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(48), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17529, 17542), - }); - declarations.push(Declaration { - id: DeclarationId(375), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(48), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17544, 17557), - }); - declarations.push(Declaration { - id: DeclarationId(376), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(48), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17562, 17575), - }); - declarations.push(Declaration { - id: DeclarationId(377), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(374), DeclarationId(375)], - output: DeclarationId(376), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17526, 17575), - }); - declarations.push(Declaration { - id: DeclarationId(378), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(48), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17585, 17598), - }); - declarations.push(Declaration { - id: DeclarationId(379), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(48), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17618, 17631), - }); - declarations.push(Declaration { - id: DeclarationId(380), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(48)], - output: DeclarationId(379), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17609, 17631), - }); - declarations.push(Declaration { - id: DeclarationId(381), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(48), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17733, 17746), - }); - declarations.push(Declaration { - id: DeclarationId(382), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87), DeclarationId(87)], - output: DeclarationId(381), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17717, 17746), - }); - declarations.push(Declaration { - id: DeclarationId(383), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(87), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17757, 17768), - }); - declarations.push(Declaration { - id: DeclarationId(384), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(124), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17781, 17793), - }); - declarations.push(Declaration { - id: DeclarationId(385), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(87), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17803, 17814), - }); - declarations.push(Declaration { - id: DeclarationId(386), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(48), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17832, 17834), - }); - declarations.push(Declaration { - id: DeclarationId(387), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(386), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17824, 17834), - }); - declarations.push(Declaration { - id: DeclarationId(388), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(48), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17851, 17853), - }); - declarations.push(Declaration { - id: DeclarationId(389), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(388), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17843, 17853), - }); - declarations.push(Declaration { - id: DeclarationId(390), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(48)], - output: DeclarationId(48), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17951, 17961), - }); - declarations.push(Declaration { - id: DeclarationId(391), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(48), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17966, 17979), - }); - declarations.push(Declaration { - id: DeclarationId(392), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(390)], - output: DeclarationId(391), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17948, 17979), - }); - declarations.push(Declaration { - id: DeclarationId(393), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(48)], - output: DeclarationId(124), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17993, 18006), - }); - declarations.push(Declaration { - id: DeclarationId(394), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(48), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18011, 18024), - }); - declarations.push(Declaration { - id: DeclarationId(395), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(393)], - output: DeclarationId(394), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17990, 18024), - }); - declarations.push(Declaration { - id: DeclarationId(396), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(48), DeclarationId(48)], - output: DeclarationId(48), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18039, 18052), - }); - declarations.push(Declaration { - id: DeclarationId(397), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(48), DeclarationId(396)], - output: DeclarationId(48), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18033, 18058), - }); - declarations.push(Declaration { - id: DeclarationId(398), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(48), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18083, 18096), - }); - declarations.push(Declaration { - id: DeclarationId(399), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(48)], - output: DeclarationId(398), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18074, 18096), - }); - declarations.push(Declaration { - id: DeclarationId(400), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(48), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18101, 18114), - }); - declarations.push(Declaration { - id: DeclarationId(401), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(399)], - output: DeclarationId(400), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18071, 18114), - }); - declarations.push(Declaration { - id: DeclarationId(402), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(48)], - output: DeclarationId(124), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18125, 18138), - }); - declarations.push(Declaration { - id: DeclarationId(403), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(402)], - output: DeclarationId(124), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18122, 18147), - }); - declarations.push(Declaration { - id: DeclarationId(404), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(48)], - output: DeclarationId(124), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18158, 18171), - }); - declarations.push(Declaration { - id: DeclarationId(405), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(404)], - output: DeclarationId(124), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18155, 18180), - }); - declarations.push(Declaration { - id: DeclarationId(406), - name: None, - connective: TypeConnective::Atom(AtomPayload::UnresolvedIdentifier( - "Tuple".to_string(), - )), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18245, 18258), - }); - declarations.push(Declaration { - id: DeclarationId(407), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(406), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18245, 18258), - }); - declarations.push(Declaration { - id: DeclarationId(408), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(407), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18234, 18259), - }); - declarations.push(Declaration { - id: DeclarationId(409), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(408), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18226, 18259), - }); - declarations.push(Declaration { - id: DeclarationId(410), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(48), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18279, 18292), - }); - declarations.push(Declaration { - id: DeclarationId(411), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(410), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18271, 18292), - }); - declarations.push(Declaration { - id: DeclarationId(412), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(48), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18312, 18325), - }); - declarations.push(Declaration { - id: DeclarationId(413), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87)], - output: DeclarationId(412), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18301, 18325), - }); - declarations.push(Declaration { - id: DeclarationId(414), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(48), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18345, 18358), - }); - declarations.push(Declaration { - id: DeclarationId(415), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87)], - output: DeclarationId(414), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18334, 18358), - }); - declarations.push(Declaration { - id: DeclarationId(416), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(48), DeclarationId(48)], - output: DeclarationId(87), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18373, 18388), - }); - declarations.push(Declaration { - id: DeclarationId(417), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(48), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18393, 18406), - }); - declarations.push(Declaration { - id: DeclarationId(418), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(416)], - output: DeclarationId(417), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18370, 18406), - }); - declarations.push(Declaration { - id: DeclarationId(419), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(48)], - output: DeclarationId(124), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18419, 18432), - }); - declarations.push(Declaration { - id: DeclarationId(420), - name: None, - connective: TypeConnective::Atom(AtomPayload::ResolvedByName(DeclarationId(1058))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19011, 19021), - }); - declarations.push(Declaration { - id: DeclarationId(421), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(420), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19011, 19021), - }); - declarations.push(Declaration { - id: DeclarationId(422), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(50)], - output: DeclarationId(421), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19002, 19021), - }); - declarations.push(Declaration { - id: DeclarationId(423), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(49), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(50), - value: DeclarationId(50), - }, - TemplateArgument { - parameter: DeclarationId(51), - value: DeclarationId(51), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19031, 19052), - }); - declarations.push(Declaration { - id: DeclarationId(424), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(51), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19069, 19071), - }); - declarations.push(Declaration { - id: DeclarationId(425), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(50)], - output: DeclarationId(424), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19060, 19071), - }); - declarations.push(Declaration { - id: DeclarationId(426), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(49), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(50), - value: DeclarationId(50), - }, - TemplateArgument { - parameter: DeclarationId(51), - value: DeclarationId(51), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19094, 19115), - }); - declarations.push(Declaration { - id: DeclarationId(427), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(50), DeclarationId(51)], - output: DeclarationId(426), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19082, 19115), - }); - declarations.push(Declaration { - id: DeclarationId(428), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(49), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(50), - value: DeclarationId(50), - }, - TemplateArgument { - parameter: DeclarationId(51), - value: DeclarationId(51), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19128, 19149), - }); - declarations.push(Declaration { - id: DeclarationId(429), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(49), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(50), - value: DeclarationId(50), - }, - TemplateArgument { - parameter: DeclarationId(51), - value: DeclarationId(51), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19154, 19175), - }); - declarations.push(Declaration { - id: DeclarationId(430), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(428)], - output: DeclarationId(429), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19125, 19175), - }); - declarations.push(Declaration { - id: DeclarationId(431), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(50), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19192, 19205), - }); - declarations.push(Declaration { - id: DeclarationId(432), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(431), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19184, 19205), - }); - declarations.push(Declaration { - id: DeclarationId(433), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(51), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19224, 19237), - }); - declarations.push(Declaration { - id: DeclarationId(434), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(433), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19216, 19237), - }); - declarations.push(Declaration { - id: DeclarationId(435), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(50)], - output: DeclarationId(124), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19245, 19258), - }); - declarations.push(Declaration { - id: DeclarationId(436), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(50)], - output: DeclarationId(124), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19275, 19288), - }); - declarations.push(Declaration { - id: DeclarationId(437), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(87), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19297, 19308), - }); - declarations.push(Declaration { - id: DeclarationId(438), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19527, 19531), - }); - declarations.push(Declaration { - id: DeclarationId(439), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19534, 19539), - }); - declarations.push(Declaration { - id: DeclarationId(440), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19542, 19549), - }); - declarations.push(Declaration { - id: DeclarationId(441), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 21658, 21676), - }); - declarations.push(Declaration { - id: DeclarationId(442), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 21681, 21704), - }); - declarations.push(Declaration { - id: DeclarationId(443), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 21709, 21730), - }); - declarations.push(Declaration { - id: DeclarationId(444), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 21735, 21766), - }); - declarations.push(Declaration { - id: DeclarationId(445), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 21771, 21794), - }); - declarations.push(Declaration { - id: DeclarationId(446), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 21799, 21826), - }); - declarations.push(Declaration { - id: DeclarationId(447), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 21831, 21853), - }); - declarations.push(Declaration { - id: DeclarationId(448), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 21880, 21894), - }); - declarations.push(Declaration { - id: DeclarationId(449), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "name".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 21899, 21921), - }); - declarations.push(Declaration { - id: DeclarationId(450), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 21952, 21964), - }); - declarations.push(Declaration { - id: DeclarationId(451), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 21969, 21984), - }); - declarations.push(Declaration { - id: DeclarationId(452), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 21989, 22000), - }); - declarations.push(Declaration { - id: DeclarationId(453), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 22005, 22018), - }); - declarations.push(Declaration { - id: DeclarationId(454), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "name".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 22023, 22053), - }); - declarations.push(Declaration { - id: DeclarationId(455), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "source".to_string(), - ty: DeclarationId(54), - }, - Field { - label: "element".to_string(), - ty: DeclarationId(55), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 22058, 22127), - }); - declarations.push(Declaration { - id: DeclarationId(456), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "inner".to_string(), - ty: DeclarationId(55), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 22132, 22173), - }); - declarations.push(Declaration { - id: DeclarationId(457), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "inner".to_string(), - ty: DeclarationId(55), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 22178, 22218), - }); - declarations.push(Declaration { - id: DeclarationId(458), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "first".to_string(), - ty: DeclarationId(55), - }, - Field { - label: "second".to_string(), - ty: DeclarationId(55), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 22223, 22290), - }); - declarations.push(Declaration { - id: DeclarationId(459), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(55), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 22316, 22341), - }); - declarations.push(Declaration { - id: DeclarationId(460), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "params".to_string(), - ty: DeclarationId(459), - }, - Field { - label: "return_type".to_string(), - ty: DeclarationId(55), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 22295, 22377), - }); - declarations.push(Declaration { - id: DeclarationId(461), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "id".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 22382, 22416), - }); - declarations.push(Declaration { - id: DeclarationId(462), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 22662, 22674), - }); - declarations.push(Declaration { - id: DeclarationId(463), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 22732, 22748), - }); - declarations.push(Declaration { - id: DeclarationId(464), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 22795, 22809), - }); - declarations.push(Declaration { - id: DeclarationId(465), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23286, 23299), - }); - declarations.push(Declaration { - id: DeclarationId(466), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23315, 23330), - }); - declarations.push(Declaration { - id: DeclarationId(467), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23376, 23392), - }); - declarations.push(Declaration { - id: DeclarationId(468), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23439, 23452), - }); - declarations.push(Declaration { - id: DeclarationId(469), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(55), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23535, 23560), - }); - declarations.push(Declaration { - id: DeclarationId(470), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(56), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23611, 23632), - }); - declarations.push(Declaration { - id: DeclarationId(471), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(57), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23647, 23657), - }); - declarations.push(Declaration { - id: DeclarationId(472), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(87), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23902, 23906), - }); - declarations.push(Declaration { - id: DeclarationId(473), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(53), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23939, 23966), - }); - declarations.push(Declaration { - id: DeclarationId(474), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/machine_constraints.dag", 7335, 7342), - }); - declarations.push(Declaration { - id: DeclarationId(475), - name: None, - connective: TypeConnective::Atom(AtomPayload::Literal(LiteralBits::Int( - "8".to_string(), - ))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2587, 2588), - }); - declarations.push(Declaration { - id: DeclarationId(476), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(70), - arguments: vec![TemplateArgument { - parameter: DeclarationId(71), - value: DeclarationId(475), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2574, 2589), - }); - declarations.push(Declaration { - id: DeclarationId(477), - name: None, - connective: TypeConnective::Atom(AtomPayload::Literal(LiteralBits::Int( - "16".to_string(), - ))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2630, 2632), - }); - declarations.push(Declaration { - id: DeclarationId(478), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(70), - arguments: vec![TemplateArgument { - parameter: DeclarationId(71), - value: DeclarationId(477), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2617, 2633), - }); - declarations.push(Declaration { - id: DeclarationId(479), - name: None, - connective: TypeConnective::Atom(AtomPayload::Literal(LiteralBits::Int( - "32".to_string(), - ))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2674, 2676), - }); - declarations.push(Declaration { - id: DeclarationId(480), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(70), - arguments: vec![TemplateArgument { - parameter: DeclarationId(71), - value: DeclarationId(479), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2661, 2677), - }); - declarations.push(Declaration { - id: DeclarationId(481), - name: None, - connective: TypeConnective::Atom(AtomPayload::Literal(LiteralBits::Int( - "64".to_string(), - ))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2718, 2720), - }); - declarations.push(Declaration { - id: DeclarationId(482), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(70), - arguments: vec![TemplateArgument { - parameter: DeclarationId(71), - value: DeclarationId(481), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2705, 2721), - }); - declarations.push(Declaration { - id: DeclarationId(483), - name: None, - connective: TypeConnective::Atom(AtomPayload::Literal(LiteralBits::Int( - "128".to_string(), - ))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2763, 2766), - }); - declarations.push(Declaration { - id: DeclarationId(484), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(70), - arguments: vec![TemplateArgument { - parameter: DeclarationId(71), - value: DeclarationId(483), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2750, 2767), - }); - declarations.push(Declaration { - id: DeclarationId(485), - name: None, - connective: TypeConnective::Atom(AtomPayload::Literal(LiteralBits::Int( - "8".to_string(), - ))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2874, 2875), - }); - declarations.push(Declaration { - id: DeclarationId(486), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(70), - arguments: vec![TemplateArgument { - parameter: DeclarationId(71), - value: DeclarationId(485), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2861, 2876), - }); - declarations.push(Declaration { - id: DeclarationId(487), - name: None, - connective: TypeConnective::Atom(AtomPayload::Literal(LiteralBits::Int( - "16".to_string(), - ))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2919, 2921), - }); - declarations.push(Declaration { - id: DeclarationId(488), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(70), - arguments: vec![TemplateArgument { - parameter: DeclarationId(71), - value: DeclarationId(487), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2906, 2922), - }); - declarations.push(Declaration { - id: DeclarationId(489), - name: None, - connective: TypeConnective::Atom(AtomPayload::Literal(LiteralBits::Int( - "32".to_string(), - ))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2965, 2967), - }); - declarations.push(Declaration { - id: DeclarationId(490), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(70), - arguments: vec![TemplateArgument { - parameter: DeclarationId(71), - value: DeclarationId(489), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2952, 2968), - }); - declarations.push(Declaration { - id: DeclarationId(491), - name: None, - connective: TypeConnective::Atom(AtomPayload::Literal(LiteralBits::Int( - "64".to_string(), - ))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 3011, 3013), - }); - declarations.push(Declaration { - id: DeclarationId(492), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(70), - arguments: vec![TemplateArgument { - parameter: DeclarationId(71), - value: DeclarationId(491), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2998, 3014), - }); - declarations.push(Declaration { - id: DeclarationId(493), - name: None, - connective: TypeConnective::Atom(AtomPayload::Literal(LiteralBits::Int( - "128".to_string(), - ))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 3058, 3061), - }); - declarations.push(Declaration { - id: DeclarationId(494), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(70), - arguments: vec![TemplateArgument { - parameter: DeclarationId(71), - value: DeclarationId(493), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 3045, 3062), - }); - declarations.push(Declaration { - id: DeclarationId(495), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(27), - arguments: vec![TemplateArgument { - parameter: DeclarationId(28), - value: DeclarationId(76), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 5945, 5965), - }); - declarations.push(Declaration { - id: DeclarationId(496), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(70), - arguments: vec![TemplateArgument { - parameter: DeclarationId(71), - value: DeclarationId(72), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 7653, 7679), - }); - declarations.push(Declaration { - id: DeclarationId(497), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(70), - arguments: vec![TemplateArgument { - parameter: DeclarationId(71), - value: DeclarationId(72), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 7715, 7741), - }); - declarations.push(Declaration { - id: DeclarationId(498), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(76)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(2))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 9242, 9249), - }); - declarations.push(Declaration { - id: DeclarationId(499), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(29), - arguments: vec![TemplateArgument { - parameter: DeclarationId(30), - value: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/rational.dag", 1267, 1288), - }); - declarations.push(Declaration { - id: DeclarationId(500), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 1052, 1065), - }); - declarations.push(Declaration { - id: DeclarationId(501), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 1070, 1076), - }); - declarations.push(Declaration { - id: DeclarationId(502), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 1081, 1099), - }); - declarations.push(Declaration { - id: DeclarationId(503), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 1104, 1122), - }); - declarations.push(Declaration { - id: DeclarationId(504), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 1127, 1141), - }); - declarations.push(Declaration { - id: DeclarationId(505), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 1423, 1432), - }); - declarations.push(Declaration { - id: DeclarationId(506), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "significand_bits".to_string(), - ty: DeclarationId(92), - }, - Field { - label: "exponent_bits".to_string(), - ty: DeclarationId(92), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 1437, 1514), - }); - declarations.push(Declaration { - id: DeclarationId(507), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "digits".to_string(), - ty: DeclarationId(92), - }, - Field { - label: "exponent_digits".to_string(), - ty: DeclarationId(92), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 1519, 1589), - }); - declarations.push(Declaration { - id: DeclarationId(508), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 1829, 1834), - }); - declarations.push(Declaration { - id: DeclarationId(509), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 1837, 1845), - }); - declarations.push(Declaration { - id: DeclarationId(510), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 1848, 1868), - }); - declarations.push(Declaration { - id: DeclarationId(511), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 2118, 2128), - }); - declarations.push(Declaration { - id: DeclarationId(512), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 2131, 2145), - }); - declarations.push(Declaration { - id: DeclarationId(513), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 2400, 2412), - }); - declarations.push(Declaration { - id: DeclarationId(514), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 2415, 2425), - }); - declarations.push(Declaration { - id: DeclarationId(515), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 2743, 2755), - }); - declarations.push(Declaration { - id: DeclarationId(516), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 2758, 2774), - }); - declarations.push(Declaration { - id: DeclarationId(517), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 2777, 2788), - }); - declarations.push(Declaration { - id: DeclarationId(518), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(39), - arguments: vec![TemplateArgument { - parameter: DeclarationId(40), - value: DeclarationId(102), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 3433, 3441), - }); - declarations.push(Declaration { - id: DeclarationId(519), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(29), - arguments: vec![TemplateArgument { - parameter: DeclarationId(30), - value: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/float.dag", 1482, 1503), - }); - declarations.push(Declaration { - id: DeclarationId(520), - name: None, - connective: TypeConnective::Atom(AtomPayload::Literal(LiteralBits::Int( - "32".to_string(), - ))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/float.dag", 1767, 1769), - }); - declarations.push(Declaration { - id: DeclarationId(521), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(70), - arguments: vec![TemplateArgument { - parameter: DeclarationId(71), - value: DeclarationId(520), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/float.dag", 1754, 1770), - }); - declarations.push(Declaration { - id: DeclarationId(522), - name: None, - connective: TypeConnective::Atom(AtomPayload::Literal(LiteralBits::Int( - "64".to_string(), - ))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/float.dag", 1813, 1815), - }); - declarations.push(Declaration { - id: DeclarationId(523), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(70), - arguments: vec![TemplateArgument { - parameter: DeclarationId(71), - value: DeclarationId(522), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/float.dag", 1800, 1816), - }); - declarations.push(Declaration { - id: DeclarationId(524), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(87), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 3805, 3809), - }); - declarations.push(Declaration { - id: DeclarationId(525), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 4078, 4090), - }); - declarations.push(Declaration { - id: DeclarationId(526), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 4356, 4363), - }); - declarations.push(Declaration { - id: DeclarationId(527), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 6656, 6663), - }); - declarations.push(Declaration { - id: DeclarationId(528), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 6771, 6778), - }); - declarations.push(Declaration { - id: DeclarationId(529), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 7229, 7241), - }); - declarations.push(Declaration { - id: DeclarationId(530), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 8318, 8322), - }); - declarations.push(Declaration { - id: DeclarationId(531), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 8325, 8330), - }); - declarations.push(Declaration { - id: DeclarationId(532), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(45), - arguments: vec![TemplateArgument { - parameter: DeclarationId(46), - value: DeclarationId(124), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 8306, 8330), - }); - declarations.push(Declaration { - id: DeclarationId(533), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(150), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 13164, 13181), - }); - declarations.push(Declaration { - id: DeclarationId(534), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(151), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 13215, 13232), - }); - declarations.push(Declaration { - id: DeclarationId(535), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17179, 17184), - }); - declarations.push(Declaration { - id: DeclarationId(536), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17187, 17192), - }); - declarations.push(Declaration { - id: DeclarationId(537), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17195, 17202), - }); - declarations.push(Declaration { - id: DeclarationId(538), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17354, 17358), - }); - declarations.push(Declaration { - id: DeclarationId(539), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17361, 17370), - }); - declarations.push(Declaration { - id: DeclarationId(540), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17373, 17379), - }); - declarations.push(Declaration { - id: DeclarationId(541), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17382, 17385), - }); - declarations.push(Declaration { - id: DeclarationId(542), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17410, 17418), - }); - declarations.push(Declaration { - id: DeclarationId(543), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17421, 17430), - }); - declarations.push(Declaration { - id: DeclarationId(544), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17433, 17439), - }); - declarations.push(Declaration { - id: DeclarationId(545), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17459, 17461), - }); - declarations.push(Declaration { - id: DeclarationId(546), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17464, 17465), - }); - declarations.push(Declaration { - id: DeclarationId(547), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17468, 17469), - }); - declarations.push(Declaration { - id: DeclarationId(548), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17472, 17473), - }); - declarations.push(Declaration { - id: DeclarationId(549), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17476, 17478), - }); - declarations.push(Declaration { - id: DeclarationId(550), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "secret_name".to_string(), - ty: DeclarationId(147), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17750, 17785), - }); - declarations.push(Declaration { - id: DeclarationId(551), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "env_var".to_string(), - ty: DeclarationId(147), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17790, 17831), - }); - declarations.push(Declaration { - id: DeclarationId(552), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(177), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17906, 17926), - }); - declarations.push(Declaration { - id: DeclarationId(553), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17941, 17953), - }); - declarations.push(Declaration { - id: DeclarationId(554), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "audience".to_string(), - ty: DeclarationId(147), - }, - Field { - label: "service_account".to_string(), - ty: DeclarationId(552), - }, - Field { - label: "scopes".to_string(), - ty: DeclarationId(553), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17836, 17959), - }); - declarations.push(Declaration { - id: DeclarationId(555), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17990, 18002), - }); - declarations.push(Declaration { - id: DeclarationId(556), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "scopes".to_string(), - ty: DeclarationId(555), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17964, 18004), - }); - declarations.push(Declaration { - id: DeclarationId(557), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(182), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18026, 18046), - }); - declarations.push(Declaration { - id: DeclarationId(558), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "steps".to_string(), - ty: DeclarationId(557), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18009, 18048), - }); - declarations.push(Declaration { - id: DeclarationId(559), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18135, 18141), - }); - declarations.push(Declaration { - id: DeclarationId(560), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18144, 18147), - }); - declarations.push(Declaration { - id: DeclarationId(561), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18150, 18157), - }); - declarations.push(Declaration { - id: DeclarationId(562), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18160, 18163), - }); - declarations.push(Declaration { - id: DeclarationId(563), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18166, 18171), - }); - declarations.push(Declaration { - id: DeclarationId(564), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18174, 18178), - }); - declarations.push(Declaration { - id: DeclarationId(565), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18181, 18187), - }); - declarations.push(Declaration { - id: DeclarationId(566), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18190, 18196), - }); - declarations.push(Declaration { - id: DeclarationId(567), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18199, 18207), - }); - declarations.push(Declaration { - id: DeclarationId(568), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18210, 18217), - }); - declarations.push(Declaration { - id: DeclarationId(569), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18220, 18226), - }); - declarations.push(Declaration { - id: DeclarationId(570), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18241, 18254), - }); - declarations.push(Declaration { - id: DeclarationId(571), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18257, 18259), - }); - declarations.push(Declaration { - id: DeclarationId(572), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18262, 18267), - }); - declarations.push(Declaration { - id: DeclarationId(573), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18270, 18273), - }); - declarations.push(Declaration { - id: DeclarationId(574), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18284, 18289), - }); - declarations.push(Declaration { - id: DeclarationId(575), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18292, 18297), - }); - declarations.push(Declaration { - id: DeclarationId(576), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18300, 18307), - }); - declarations.push(Declaration { - id: DeclarationId(577), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18310, 18317), - }); - declarations.push(Declaration { - id: DeclarationId(578), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18320, 18327), - }); - declarations.push(Declaration { - id: DeclarationId(579), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18330, 18333), - }); - declarations.push(Declaration { - id: DeclarationId(580), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18336, 18340), - }); - declarations.push(Declaration { - id: DeclarationId(581), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18355, 18362), - }); - declarations.push(Declaration { - id: DeclarationId(582), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18365, 18368), - }); - declarations.push(Declaration { - id: DeclarationId(583), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18371, 18378), - }); - declarations.push(Declaration { - id: DeclarationId(584), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18381, 18390), - }); - declarations.push(Declaration { - id: DeclarationId(585), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18393, 18397), - }); - declarations.push(Declaration { - id: DeclarationId(586), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18400, 18404), - }); - declarations.push(Declaration { - id: DeclarationId(587), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18407, 18417), - }); - declarations.push(Declaration { - id: DeclarationId(588), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18420, 18424), - }); - declarations.push(Declaration { - id: DeclarationId(589), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18427, 18433), - }); - declarations.push(Declaration { - id: DeclarationId(590), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18454, 18460), - }); - declarations.push(Declaration { - id: DeclarationId(591), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18463, 18466), - }); - declarations.push(Declaration { - id: DeclarationId(592), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18469, 18478), - }); - declarations.push(Declaration { - id: DeclarationId(593), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18481, 18483), - }); - declarations.push(Declaration { - id: DeclarationId(594), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18486, 18494), - }); - declarations.push(Declaration { - id: DeclarationId(595), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(186), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18562, 18569), - }); - declarations.push(Declaration { - id: DeclarationId(596), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18966, 18977), - }); - declarations.push(Declaration { - id: DeclarationId(597), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18982, 18991), - }); - declarations.push(Declaration { - id: DeclarationId(598), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18996, 19003), - }); - declarations.push(Declaration { - id: DeclarationId(599), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 19008, 19015), - }); - declarations.push(Declaration { - id: DeclarationId(600), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 19020, 19025), - }); - declarations.push(Declaration { - id: DeclarationId(601), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 19178, 19188), - }); - declarations.push(Declaration { - id: DeclarationId(602), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 19193, 19202), - }); - declarations.push(Declaration { - id: DeclarationId(603), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 19207, 19213), - }); - declarations.push(Declaration { - id: DeclarationId(604), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 21516, 21519), - }); - declarations.push(Declaration { - id: DeclarationId(605), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 21522, 21526), - }); - declarations.push(Declaration { - id: DeclarationId(606), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 21529, 21532), - }); - declarations.push(Declaration { - id: DeclarationId(607), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 21535, 21540), - }); - declarations.push(Declaration { - id: DeclarationId(608), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 21543, 21549), - }); - declarations.push(Declaration { - id: DeclarationId(609), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 21552, 21556), - }); - declarations.push(Declaration { - id: DeclarationId(610), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 21559, 21566), - }); - declarations.push(Declaration { - id: DeclarationId(611), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22054, 22060), - }); - declarations.push(Declaration { - id: DeclarationId(612), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "name".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22065, 22088), - }); - declarations.push(Declaration { - id: DeclarationId(613), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "username".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22093, 22119), - }); - declarations.push(Declaration { - id: DeclarationId(614), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22124, 22130), - }); - declarations.push(Declaration { - id: DeclarationId(615), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(156), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22322, 22332), - }); - declarations.push(Declaration { - id: DeclarationId(616), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22457, 22464), - }); - declarations.push(Declaration { - id: DeclarationId(617), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22504, 22516), - }); - declarations.push(Declaration { - id: DeclarationId(618), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(87), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22531, 22535), - }); - declarations.push(Declaration { - id: DeclarationId(619), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(210), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 23886, 23904), - }); - declarations.push(Declaration { - id: DeclarationId(620), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(211), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 23997, 24018), - }); - declarations.push(Declaration { - id: DeclarationId(621), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24302, 24309), - }); - declarations.push(Declaration { - id: DeclarationId(622), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(215), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24342, 24357), - }); - declarations.push(Declaration { - id: DeclarationId(623), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(218), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24646, 24664), - }); - declarations.push(Declaration { - id: DeclarationId(624), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(219), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24674, 24692), - }); - declarations.push(Declaration { - id: DeclarationId(625), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24714, 24726), - }); - declarations.push(Declaration { - id: DeclarationId(626), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24814, 24821), - }); - declarations.push(Declaration { - id: DeclarationId(627), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24908, 24915), - }); - declarations.push(Declaration { - id: DeclarationId(628), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24943, 24955), - }); - declarations.push(Declaration { - id: DeclarationId(629), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24967, 24979), - }); - declarations.push(Declaration { - id: DeclarationId(630), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24991, 25003), - }); - declarations.push(Declaration { - id: DeclarationId(631), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(222), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25138, 25153), - }); - declarations.push(Declaration { - id: DeclarationId(632), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(188), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25164, 25177), - }); - declarations.push(Declaration { - id: DeclarationId(633), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(187), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25193, 25206), - }); - declarations.push(Declaration { - id: DeclarationId(634), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25232, 25236), - }); - declarations.push(Declaration { - id: DeclarationId(635), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25239, 25241), - }); - declarations.push(Declaration { - id: DeclarationId(636), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25244, 25245), - }); - declarations.push(Declaration { - id: DeclarationId(637), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25248, 25252), - }); - declarations.push(Declaration { - id: DeclarationId(638), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25316, 25323), - }); - declarations.push(Declaration { - id: DeclarationId(639), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(124), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 3063, 3080), - }); - declarations.push(Declaration { - id: DeclarationId(640), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(87), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 3538, 3554), - }); - declarations.push(Declaration { - id: DeclarationId(641), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(124), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 4840, 4857), - }); - declarations.push(Declaration { - id: DeclarationId(642), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 5822, 5841), - }); - declarations.push(Declaration { - id: DeclarationId(643), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 6425, 6444), - }); - declarations.push(Declaration { - id: DeclarationId(644), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(20))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 9194, 9223), - }); - declarations.push(Declaration { - id: DeclarationId(645), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(26))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 11619, 11640), - }); - declarations.push(Declaration { - id: DeclarationId(646), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(32))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 11671, 11696), - }); - declarations.push(Declaration { - id: DeclarationId(647), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(38))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 11827, 11852), - }); - declarations.push(Declaration { - id: DeclarationId(648), - name: Some("".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 12010, 12052), - }); - declarations.push(Declaration { - id: DeclarationId(649), - name: Some("".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 12239, 12284), - }); - declarations.push(Declaration { - id: DeclarationId(650), - name: Some("".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 12285, 12330), - }); - declarations.push(Declaration { - id: DeclarationId(651), - name: Some("".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 12331, 12376), - }); - declarations.push(Declaration { - id: DeclarationId(652), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(147)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(44))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 13050, 13070), - }); - declarations.push(Declaration { - id: DeclarationId(653), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(147)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(50))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 13110, 13130), - }); - declarations.push(Declaration { - id: DeclarationId(654), - name: Some("".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 13235, 13278), - }); - declarations.push(Declaration { - id: DeclarationId(655), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(53))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 14114, 14127), - }); - declarations.push(Declaration { - id: DeclarationId(656), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(56))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 14159, 14172), - }); - declarations.push(Declaration { - id: DeclarationId(657), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(65))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 14204, 14240), - }); - declarations.push(Declaration { - id: DeclarationId(658), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(74))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 14272, 14303), - }); - declarations.push(Declaration { - id: DeclarationId(659), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(147)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(80))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 14509, 14529), - }); - declarations.push(Declaration { - id: DeclarationId(660), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(147)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(86))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15091, 15108), - }); - declarations.push(Declaration { - id: DeclarationId(661), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(147)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(92))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15147, 15163), - }); - declarations.push(Declaration { - id: DeclarationId(662), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(147)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(98))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15202, 15217), - }); - declarations.push(Declaration { - id: DeclarationId(663), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(147)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(104))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15256, 15275), - }); - declarations.push(Declaration { - id: DeclarationId(664), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(147)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(110))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15314, 15333), - }); - declarations.push(Declaration { - id: DeclarationId(665), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(147)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(116))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15372, 15389), - }); - declarations.push(Declaration { - id: DeclarationId(666), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(147)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(122))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15428, 15446), - }); - declarations.push(Declaration { - id: DeclarationId(667), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(147)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(128))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15485, 15503), - }); - declarations.push(Declaration { - id: DeclarationId(668), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(147)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(134))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15542, 15562), - }); - declarations.push(Declaration { - id: DeclarationId(669), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(147)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(140))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15837, 15864), - }); - declarations.push(Declaration { - id: DeclarationId(670), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(147)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(146))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15909, 15936), - }); - declarations.push(Declaration { - id: DeclarationId(671), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(147)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(152))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15979, 16004), - }); - declarations.push(Declaration { - id: DeclarationId(672), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(147)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(158))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 16044, 16066), - }); - declarations.push(Declaration { - id: DeclarationId(673), - name: Some("".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 16146, 16188), - }); - declarations.push(Declaration { - id: DeclarationId(674), - name: Some("".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 16573, 16615), - }); - declarations.push(Declaration { - id: DeclarationId(675), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(154)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(164))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22653, 22678), - }); - declarations.push(Declaration { - id: DeclarationId(676), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(125)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(170))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22714, 22736), - }); - declarations.push(Declaration { - id: DeclarationId(677), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(176))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22774, 22793), - }); - declarations.push(Declaration { - id: DeclarationId(678), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 3679, 3689), - }); - declarations.push(Declaration { - id: DeclarationId(679), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 3692, 3697), - }); - declarations.push(Declaration { - id: DeclarationId(680), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 3700, 3710), - }); - declarations.push(Declaration { - id: DeclarationId(681), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 3713, 3726), - }); - declarations.push(Declaration { - id: DeclarationId(682), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 5310, 5319), - }); - declarations.push(Declaration { - id: DeclarationId(683), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 5322, 5328), - }); - declarations.push(Declaration { - id: DeclarationId(684), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 5331, 5335), - }); - declarations.push(Declaration { - id: DeclarationId(685), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(232), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 5883, 5901), - }); - declarations.push(Declaration { - id: DeclarationId(686), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 6703, 6712), - }); - declarations.push(Declaration { - id: DeclarationId(687), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(232), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 6952, 6970), - }); - declarations.push(Declaration { - id: DeclarationId(688), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/serialization.dag", 1873, 1883), - }); - declarations.push(Declaration { - id: DeclarationId(689), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/serialization.dag", 1888, 1897), - }); - declarations.push(Declaration { - id: DeclarationId(690), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "prefix".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/serialization.dag", 1902, 1944), - }); - declarations.push(Declaration { - id: DeclarationId(691), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "suffix".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/serialization.dag", 1949, 1991), - }); - declarations.push(Declaration { - id: DeclarationId(692), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "prefix".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "suffix".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/serialization.dag", 1996, 2060), - }); - declarations.push(Declaration { - id: DeclarationId(693), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "naming".to_string(), - ty: DeclarationId(308), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/serialization.dag", 2631, 2670), - }); - declarations.push(Declaration { - id: DeclarationId(694), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "tag_field".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "naming".to_string(), - ty: DeclarationId(308), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/serialization.dag", 2675, 2742), - }); - declarations.push(Declaration { - id: DeclarationId(695), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/serialization.dag", 2747, 2762), - }); - declarations.push(Declaration { - id: DeclarationId(696), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/serialization.dag", 2767, 2780), - }); - declarations.push(Declaration { - id: DeclarationId(697), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/serialization.dag", 3499, 3503), - }); - declarations.push(Declaration { - id: DeclarationId(698), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/serialization.dag", 3506, 3510), - }); - declarations.push(Declaration { - id: DeclarationId(699), - name: Some("List".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Empty".to_string(), - ty: DeclarationId(1870), - }, - Field { - label: "Cons".to_string(), - ty: DeclarationId(1872), - }, - ], - }, - type_params: vec![DeclarationId(700)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 2083, 2159), - }); - declarations.push(Declaration { - id: DeclarationId(700), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("element".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 2083, 2159), - }); - declarations.push(Declaration { - id: DeclarationId(701), - name: Some("empty".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(1840), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/list.dag", 3273, 3284)), - }, - type_params: vec![DeclarationId(702)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 3236, 3284), - }); - declarations.push(Declaration { - id: DeclarationId(702), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("element".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 3236, 3284), - }); - declarations.push(Declaration { - id: DeclarationId(703), - name: Some("cons".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(704), DeclarationId(1841)], - output: DeclarationId(1842), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/list.dag", 3453, 3475)), - }, - type_params: vec![DeclarationId(704)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 3383, 3475), - }); - declarations.push(Declaration { - id: DeclarationId(704), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("element".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 3383, 3475), - }); - declarations.push(Declaration { - id: DeclarationId(705), - name: Some("singleton".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(706)], - output: DeclarationId(1843), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/list.dag", 3570, 3590)), - }, - type_params: vec![DeclarationId(706)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 3519, 3590), - }); - declarations.push(Declaration { - id: DeclarationId(706), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("element".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 3519, 3590), - }); - declarations.push(Declaration { - id: DeclarationId(707), - name: Some("fold".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1844), DeclarationId(709), DeclarationId(1845)], - output: DeclarationId(709), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/list.dag", 4203, 4307)), - }, - type_params: vec![DeclarationId(708), DeclarationId(709)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 4142, 4307), - }); - declarations.push(Declaration { - id: DeclarationId(708), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 4142, 4307), - }); - declarations.push(Declaration { - id: DeclarationId(709), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("U".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 4142, 4307), - }); - declarations.push(Declaration { - id: DeclarationId(710), - name: Some("fold_right".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1846), DeclarationId(712), DeclarationId(1847)], - output: DeclarationId(712), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/list.dag", 4658, 4768)), - }, - type_params: vec![DeclarationId(711), DeclarationId(712)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 4591, 4768), - }); - declarations.push(Declaration { - id: DeclarationId(711), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 4591, 4768), - }); - declarations.push(Declaration { - id: DeclarationId(712), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("U".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 4591, 4768), - }); - declarations.push(Declaration { - id: DeclarationId(713), - name: Some("concat".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1848), DeclarationId(1849)], - output: DeclarationId(1850), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/list.dag", 5386, 5414)), - }, - type_params: vec![DeclarationId(714)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 5314, 5414), - }); - declarations.push(Declaration { - id: DeclarationId(714), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("element".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 5314, 5414), - }); - declarations.push(Declaration { - id: DeclarationId(715), - name: Some("map".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1851), DeclarationId(1852)], - output: DeclarationId(1853), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/list.dag", 5721, 5778)), - }, - type_params: vec![DeclarationId(716), DeclarationId(717)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 5667, 5778), - }); - declarations.push(Declaration { - id: DeclarationId(716), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("A".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 5667, 5778), - }); - declarations.push(Declaration { - id: DeclarationId(717), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("B".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 5667, 5778), - }); - declarations.push(Declaration { - id: DeclarationId(718), - name: Some("filter".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1854), DeclarationId(1855)], - output: DeclarationId(1856), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/list.dag", 5905, 5988)), - }, - type_params: vec![DeclarationId(719)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 5848, 5988), - }); - declarations.push(Declaration { - id: DeclarationId(719), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 5848, 5988), - }); - declarations.push(Declaration { - id: DeclarationId(720), - name: Some("flat_map".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1857), DeclarationId(1859)], - output: DeclarationId(1860), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/list.dag", 6171, 6230)), - }, - type_params: vec![DeclarationId(721), DeclarationId(722)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 6106, 6230), - }); - declarations.push(Declaration { - id: DeclarationId(721), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("A".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 6106, 6230), - }); - declarations.push(Declaration { - id: DeclarationId(722), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("B".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 6106, 6230), - }); - declarations.push(Declaration { - id: DeclarationId(723), - name: Some("length".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1861)], - output: DeclarationId(87), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/list.dag", 6372, 6409)), - }, - type_params: vec![DeclarationId(724)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 6337, 6409), - }); - declarations.push(Declaration { - id: DeclarationId(724), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 6337, 6409), - }); - declarations.push(Declaration { - id: DeclarationId(725), - name: Some("is_empty".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1862)], - output: DeclarationId(124), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/list.dag", 6605, 6671)), - }, - type_params: vec![DeclarationId(726)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 6567, 6671), - }); - declarations.push(Declaration { - id: DeclarationId(726), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 6567, 6671), - }); - declarations.push(Declaration { - id: DeclarationId(727), - name: Some("IndexedElement".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "index".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "value".to_string(), - ty: DeclarationId(728), - }, - ], - }, - type_params: vec![DeclarationId(728)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 6993, 7055), - }); - declarations.push(Declaration { - id: DeclarationId(728), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("element".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 6993, 7055), - }); - declarations.push(Declaration { - id: DeclarationId(729), - name: Some("enumerate".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1863)], - output: DeclarationId(1865), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/list.dag", 7238, 7269)), - }, - type_params: vec![DeclarationId(730)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 7180, 7269), - }); - declarations.push(Declaration { - id: DeclarationId(730), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 7180, 7269), - }); - declarations.push(Declaration { - id: DeclarationId(731), - name: Some("enumerate_helper".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1866), DeclarationId(87)], - output: DeclarationId(1868), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/list.dag", 7463, 7644)), - }, - type_params: vec![DeclarationId(732)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 7386, 7644), - }); - declarations.push(Declaration { - id: DeclarationId(732), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 7386, 7644), - }); - declarations.push(Declaration { - id: DeclarationId(733), - name: Some("contains".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1869), DeclarationId(734)], - output: DeclarationId(124), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/list.dag", 8205, 8332)), - }, - type_params: vec![DeclarationId(734)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 8156, 8332), - }); - declarations.push(Declaration { - id: DeclarationId(734), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 8156, 8332), - }); - declarations.push(Declaration { - id: DeclarationId(735), - name: Some("NodeId".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate_minimal.dag", 1364, 1375), - }); - declarations.push(Declaration { - id: DeclarationId(736), - name: Some("PortId".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate_minimal.dag", 1376, 1387), - }); - declarations.push(Declaration { - id: DeclarationId(737), - name: Some("DeclarationId".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate_minimal.dag", 1388, 1406), - }); - declarations.push(Declaration { - id: DeclarationId(738), - name: Some("ClusterId".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate_minimal.dag", 1407, 1421), - }); - declarations.push(Declaration { - id: DeclarationId(739), - name: Some("NonEmptyList".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "first".to_string(), - ty: DeclarationId(740), - }, - Field { - label: "rest".to_string(), - ty: DeclarationId(1873), - }, - ], - }, - type_params: vec![DeclarationId(740)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate_minimal.dag", 1423, 1492), - }); - declarations.push(Declaration { - id: DeclarationId(740), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("element".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate_minimal.dag", 1423, 1492), - }); - declarations.push(Declaration { - id: DeclarationId(741), - name: Some("NonSingletonList".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "first".to_string(), - ty: DeclarationId(742), - }, - Field { - label: "second".to_string(), - ty: DeclarationId(742), - }, - Field { - label: "rest".to_string(), - ty: DeclarationId(1874), - }, - ], - }, - type_params: vec![DeclarationId(742)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate_minimal.dag", 1494, 1585), - }); - declarations.push(Declaration { - id: DeclarationId(742), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("element".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate_minimal.dag", 1494, 1585), - }); - declarations.push(Declaration { - id: DeclarationId(743), - name: Some("UrlPathToken".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "LiteralToken".to_string(), - ty: DeclarationId(1887), - }, - Field { - label: "ParamToken".to_string(), - ty: DeclarationId(1888), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 7655, 7740), - }); - declarations.push(Declaration { - id: DeclarationId(744), - name: Some("PathTemplate".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "tokens".to_string(), - ty: DeclarationId(1889), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 7742, 7792), - }); - declarations.push(Declaration { - id: DeclarationId(745), - name: Some("PathSegmentTokensResult".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ParsedSegmentTokens".to_string(), - ty: DeclarationId(1891), - }, - Field { - label: "MalformedPathSegment".to_string(), - ty: DeclarationId(1892), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 8148, 8292), - }); - declarations.push(Declaration { - id: DeclarationId(746), - name: Some("PathTemplateParseResult".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ParsedPathTemplate".to_string(), - ty: DeclarationId(1893), - }, - Field { - label: "MalformedPathTemplate".to_string(), - ty: DeclarationId(1894), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 8622, 8775), - }); - declarations.push(Declaration { - id: DeclarationId(747), - name: Some("parse_path_template".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227)], - output: DeclarationId(746), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/effects.dag", 8840, 10145)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 8777, 10145), - }); - declarations.push(Declaration { - id: DeclarationId(748), - name: Some("parse_segment_tokens".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227)], - output: DeclarationId(745), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/effects.dag", 10211, 11850)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 10147, 11850), - }); - declarations.push(Declaration { - id: DeclarationId(749), - name: Some("last_path_param".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(744)], - output: DeclarationId(1875), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/effects.dag", 11906, 12189)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 11852, 12189), - }); - declarations.push(Declaration { - id: DeclarationId(750), - name: Some("IdempotentShape".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ReadEffect".to_string(), - ty: DeclarationId(1895), - }, - Field { - label: "UpsertEffect".to_string(), - ty: DeclarationId(1896), - }, - Field { - label: "DeleteEffect".to_string(), - ty: DeclarationId(1897), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 14473, 14594), - }); - declarations.push(Declaration { - id: DeclarationId(751), - name: Some("BreakingShape".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "CreateEffect".to_string(), - ty: DeclarationId(1898), - }, - Field { - label: "AppendEffect".to_string(), - ty: DeclarationId(1899), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 14817, 14892), - }); - declarations.push(Declaration { - id: DeclarationId(752), - name: Some("EffectShape".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "IsIdempotent".to_string(), - ty: DeclarationId(1900), - }, - Field { - label: "IsBreaking".to_string(), - ty: DeclarationId(1901), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 15293, 15373), - }); - declarations.push(Declaration { - id: DeclarationId(753), - name: Some("CreateCause".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "PostAlways".to_string(), - ty: DeclarationId(1902), - }, - Field { - label: "KeylessFallback".to_string(), - ty: DeclarationId(1903), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 15865, 15939), - }); - declarations.push(Declaration { - id: DeclarationId(754), - name: Some("EffectClassificationFailure".to_string()), - connective: TypeConnective::Disj { - variants: vec![Field { - label: "ClassifierAnchorResolutionFailed".to_string(), - ty: DeclarationId(1904), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 15941, 16010), - }); - declarations.push(Declaration { - id: DeclarationId(755), - name: Some("EffectClassificationResult".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "EffectClassified".to_string(), - ty: DeclarationId(1905), - }, - Field { - label: "EffectClassificationFailed".to_string(), - ty: DeclarationId(1906), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 16012, 16159), - }); - declarations.push(Declaration { - id: DeclarationId(756), - name: Some("KeySource".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "PathParam".to_string(), - ty: DeclarationId(1907), - }, - Field { - label: "InputField".to_string(), - ty: DeclarationId(1908), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 16790, 16869), - }); - declarations.push(Declaration { - id: DeclarationId(757), - name: Some("IdempotencyEvidence".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "LatticeEffect".to_string(), - ty: DeclarationId(1909), - }, - Field { - label: "IdentityEffect".to_string(), - ty: DeclarationId(1910), - }, - Field { - label: "NonIdempotent".to_string(), - ty: DeclarationId(1911), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 17517, 17615), - }); - declarations.push(Declaration { - id: DeclarationId(758), - name: Some("is_idempotent_effect".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(752)], - output: DeclarationId(124), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/effects.dag", 17842, 17914)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 17790, 17914), - }); - declarations.push(Declaration { - id: DeclarationId(759), - name: Some("derive_idempotency_evidence".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(752)], - output: DeclarationId(757), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/effects.dag", 18127, 18647)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 18053, 18647), - }); - declarations.push(Declaration { - id: DeclarationId(760), - name: Some("CompositionVerdict".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "IdempotentComposition".to_string(), - ty: DeclarationId(1912), - }, - Field { - label: "BrokenBy".to_string(), - ty: DeclarationId(1914), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 19999, 20102), - }); - declarations.push(Declaration { - id: DeclarationId(761), - name: Some("operation_is_breaking".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(966)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(256))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 20238, 20344), - }); - declarations.push(Declaration { - id: DeclarationId(762), - name: Some("effect_shape_is_breaking".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(752)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(260))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 20346, 20472), - }); - declarations.push(Declaration { - id: DeclarationId(763), - name: Some("operation_effect_shape".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(966)], - output: DeclarationId(752), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/effects.dag", 20530, 22460)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 20474, 22460), - }); - declarations.push(Declaration { - id: DeclarationId(764), - name: Some("classify_operation_effect".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(966)], - output: DeclarationId(755), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/effects.dag", 22536, 22596)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 22462, 22596), - }); - declarations.push(Declaration { - id: DeclarationId(765), - name: Some("transport_effect_shape".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(966)], - output: DeclarationId(752), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/effects.dag", 22654, 23710)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 22598, 23710), - }); - declarations.push(Declaration { - id: DeclarationId(766), - name: Some("method_is_read".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(195)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(269))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 23712, 23907), - }); - declarations.push(Declaration { - id: DeclarationId(767), - name: Some("method_is_upsert".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(195)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(278))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 23909, 24107), - }); - declarations.push(Declaration { - id: DeclarationId(768), - name: Some("method_is_post".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(195)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(287))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 24109, 24306), - }); - declarations.push(Declaration { - id: DeclarationId(769), - name: Some("method_is_delete".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(195)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(296))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 24308, 24507), - }); - declarations.push(Declaration { - id: DeclarationId(770), - name: Some("operation_resource_key".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(966)], - output: DeclarationId(1876), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/effects.dag", 24561, 24752)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 24509, 24752), - }); - declarations.push(Declaration { - id: DeclarationId(771), - name: Some("breaker_ref".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87)], - output: DeclarationId(1877), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/effects.dag", 24806, 24828)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 24754, 24828), - }); - declarations.push(Declaration { - id: DeclarationId(772), - name: Some("indexed_breaker_ref".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1878)], - output: DeclarationId(1880), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/effects.dag", 24910, 25003)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 24830, 25003), - }); - declarations.push(Declaration { - id: DeclarationId(773), - name: Some("first_breaker_ref".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1881)], - output: DeclarationId(1883), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/effects.dag", 25078, 25261)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 25005, 25261), - }); - declarations.push(Declaration { - id: DeclarationId(774), - name: Some("compose_effects".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1884)], - output: DeclarationId(760), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/effects.dag", 26139, 26262)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 26072, 26262), - }); - declarations.push(Declaration { - id: DeclarationId(775), - name: Some("BoolPortRef".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "port".to_string(), - ty: DeclarationId(736), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 27463, 27498), - }); - declarations.push(Declaration { - id: DeclarationId(776), - name: Some("BranchArm".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "condition".to_string(), - ty: DeclarationId(775), - }, - Field { - label: "body".to_string(), - ty: DeclarationId(777), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 27583, 27649), - }); - declarations.push(Declaration { - id: DeclarationId(777), - name: Some("WorkflowEffect".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "LinearEffect".to_string(), - ty: DeclarationId(1916), - }, - Field { - label: "BranchEffect".to_string(), - ty: DeclarationId(1918), - }, - Field { - label: "LoopEffect".to_string(), - ty: DeclarationId(1919), - }, - Field { - label: "ParallelEffect".to_string(), - ty: DeclarationId(1921), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 28325, 28547), - }); - declarations.push(Declaration { - id: DeclarationId(778), - name: Some("IdempotencyUnsupportedDetail".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "variant_name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "downstream_stage".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "reason".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 28906, 29010), - }); - declarations.push(Declaration { - id: DeclarationId(779), - name: Some("WorkflowIdempotencyReport".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "WorkflowCompositionVerdict".to_string(), - ty: DeclarationId(1922), - }, - Field { - label: "IdempotencyUnsupported".to_string(), - ty: DeclarationId(1923), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 29149, 29287), - }); - declarations.push(Declaration { - id: DeclarationId(780), - name: Some("report_unsupported_workflow_variant".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227), DeclarationId(227), DeclarationId(227)], - output: DeclarationId(779), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/effects.dag", 29429, 29585)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 29289, 29585), - }); - declarations.push(Declaration { - id: DeclarationId(781), - name: Some("ParallelismUnsupportedKind".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "NoWorkflowProjection".to_string(), - ty: DeclarationId(1924), - }, - Field { - label: "NotParallelEffectRoot".to_string(), - ty: DeclarationId(1925), - }, - Field { - label: "NonLinearParallelBranch".to_string(), - ty: DeclarationId(1926), - }, - Field { - label: "PairwiseNonCommute".to_string(), - ty: DeclarationId(1927), - }, - Field { - label: "EffectClassificationUnavailable".to_string(), - ty: DeclarationId(1928), - }, - Field { - label: "LensSurfacePending".to_string(), - ty: DeclarationId(1929), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 29748, 29978), - }); - declarations.push(Declaration { - id: DeclarationId(782), - name: Some("ParallelismUnsupportedDetail".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "kind".to_string(), - ty: DeclarationId(781), - }, - Field { - label: "downstream_stage".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "reason".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 29980, 30096), - }); - declarations.push(Declaration { - id: DeclarationId(783), - name: Some("WorkflowParallelismReport".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ParallelCompositionVerdict".to_string(), - ty: DeclarationId(1930), - }, - Field { - label: "ParallelismUnsupported".to_string(), - ty: DeclarationId(1931), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 30260, 30398), - }); - declarations.push(Declaration { - id: DeclarationId(784), - name: Some("report_parallelism_unsupported".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(781), DeclarationId(227)], - output: DeclarationId(783), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/effects.dag", 30519, 30674)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 30400, 30674), - }); - declarations.push(Declaration { - id: DeclarationId(785), - name: Some("lane2_workflow_idempotency_report".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839), DeclarationId(777)], - output: DeclarationId(779), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/effects.dag", 31148, 31978)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 31054, 31978), - }); - declarations.push(Declaration { - id: DeclarationId(786), - name: Some("IdempotencyTestObligation".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "callable".to_string(), - ty: DeclarationId(965), - }, - Field { - label: "effect_shape".to_string(), - ty: DeclarationId(752), - }, - Field { - label: "claim".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "witness_required".to_string(), - ty: DeclarationId(124), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 32735, 32862), - }); - declarations.push(Declaration { - id: DeclarationId(787), - name: Some("generate_idempotency_obligations".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1885)], - output: DeclarationId(1886), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/effects.dag", 32961, 33255)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 32864, 33255), - }); - declarations.push(Declaration { - id: DeclarationId(788), - name: Some("WorkflowEffectConcern".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "workflow_name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "create_op".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "reason".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 33572, 33663), - }); - declarations.push(Declaration { - id: DeclarationId(789), - name: Some("TypeShape".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "declaration".to_string(), - ty: DeclarationId(737), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 270, 317), - }); - declarations.push(Declaration { - id: DeclarationId(790), - name: Some("SourceByteSpan".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "byte_start".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "byte_end".to_string(), - ty: DeclarationId(87), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 535, 592), - }); - declarations.push(Declaration { - id: DeclarationId(791), - name: Some("PortState".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Uninferred".to_string(), - ty: DeclarationId(1940), - }, - Field { - label: "Resolved".to_string(), - ty: DeclarationId(1941), - }, - Field { - label: "Unresolved".to_string(), - ty: DeclarationId(1942), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 735, 803), - }); - declarations.push(Declaration { - id: DeclarationId(792), - name: Some("DagPort".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "id".to_string(), - ty: DeclarationId(736), - }, - Field { - label: "state".to_string(), - ty: DeclarationId(791), - }, - Field { - label: "produced_by".to_string(), - ty: DeclarationId(1943), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 805, 876), - }); - declarations.push(Declaration { - id: DeclarationId(793), - name: Some("LiteralBits".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "LitInt".to_string(), - ty: DeclarationId(1944), - }, - Field { - label: "LitBool".to_string(), - ty: DeclarationId(1945), - }, - Field { - label: "LitString".to_string(), - ty: DeclarationId(1946), - }, - Field { - label: "LitSymbol".to_string(), - ty: DeclarationId(1947), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 1358, 1543), - }); - declarations.push(Declaration { - id: DeclarationId(794), - name: Some("AtomPayload".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Literal".to_string(), - ty: DeclarationId(1948), - }, - Field { - label: "UnresolvedIdentifier".to_string(), - ty: DeclarationId(1949), - }, - Field { - label: "ResolvedByStructure".to_string(), - ty: DeclarationId(1950), - }, - Field { - label: "ResolvedByName".to_string(), - ty: DeclarationId(1951), - }, - Field { - label: "TypeParam".to_string(), - ty: DeclarationId(1952), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 3655, 3824), - }); - declarations.push(Declaration { - id: DeclarationId(795), - name: Some("PositiveIntervalWidth".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "OneUnit".to_string(), - ty: DeclarationId(1953), - }, - Field { - label: "AdditionalUnit".to_string(), - ty: DeclarationId(1954), - }, - Field { - label: "UnitCount".to_string(), - ty: DeclarationId(1955), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 4417, 6098), - }); - declarations.push(Declaration { - id: DeclarationId(796), - name: Some("IntervalWidth".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ZeroWidth".to_string(), - ty: DeclarationId(1956), - }, - Field { - label: "PositiveWidth".to_string(), - ty: DeclarationId(1957), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 6100, 6173), - }); - declarations.push(Declaration { - id: DeclarationId(797), - name: Some("Interval".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "BoundedInterval".to_string(), - ty: DeclarationId(1958), - }, - Field { - label: "Unbounded".to_string(), - ty: DeclarationId(1959), - }, - ], - }, - type_params: vec![DeclarationId(798)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 6464, 6549), - }); - declarations.push(Declaration { - id: DeclarationId(798), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("D".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 6464, 6549), - }); - declarations.push(Declaration { - id: DeclarationId(799), - name: Some("IntInterval".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(797), - arguments: vec![TemplateArgument { - parameter: DeclarationId(798), - value: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 6699, 6731), - }); - declarations.push(Declaration { - id: DeclarationId(800), - name: Some("BoundDeclaration".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "StaticBound".to_string(), - ty: DeclarationId(1961), - }, - Field { - label: "PlatformDependent".to_string(), - ty: DeclarationId(1962), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 7087, 7161), - }); - declarations.push(Declaration { - id: DeclarationId(801), - name: Some("CardinalityBound".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Exact".to_string(), - ty: DeclarationId(1963), - }, - Field { - label: "AtMostOne".to_string(), - ty: DeclarationId(1964), - }, - Field { - label: "Unbounded".to_string(), - ty: DeclarationId(1965), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 7386, 7450), - }); - declarations.push(Declaration { - id: DeclarationId(802), - name: Some("ConjField".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "label".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "ty".to_string(), - ty: DeclarationId(737), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 7452, 7506), - }); - declarations.push(Declaration { - id: DeclarationId(803), - name: Some("TemplateArgument".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "parameter".to_string(), - ty: DeclarationId(737), - }, - Field { - label: "value".to_string(), - ty: DeclarationId(737), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 7508, 7583), - }); - declarations.push(Declaration { - id: DeclarationId(804), - name: Some("FieldEntry".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "label".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "value".to_string(), - ty: DeclarationId(805), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 7585, 7640), - }); - declarations.push(Declaration { - id: DeclarationId(805), - name: Some("FieldValue".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Literal".to_string(), - ty: DeclarationId(1966), - }, - Field { - label: "Reference".to_string(), - ty: DeclarationId(1967), - }, - Field { - label: "Record".to_string(), - ty: DeclarationId(1969), - }, - Field { - label: "List".to_string(), - ty: DeclarationId(1971), - }, - Field { - label: "Map".to_string(), - ty: DeclarationId(1973), - }, - Field { - label: "Variant".to_string(), - ty: DeclarationId(1975), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 7857, 8093), - }); - declarations.push(Declaration { - id: DeclarationId(806), - name: Some("ValueBody".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ValueBodyUnparsed".to_string(), - ty: DeclarationId(1976), - }, - Field { - label: "ValueBodyStructural".to_string(), - ty: DeclarationId(1978), - }, - Field { - label: "ValueBodyScalar".to_string(), - ty: DeclarationId(1979), - }, - Field { - label: "ValueBodyList".to_string(), - ty: DeclarationId(1981), - }, - Field { - label: "ValueBodyMap".to_string(), - ty: DeclarationId(1983), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 9687, 9892), - }); - declarations.push(Declaration { - id: DeclarationId(807), - name: Some("BindNodeId".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "node".to_string(), - ty: DeclarationId(735), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 10796, 10830), - }); - declarations.push(Declaration { - id: DeclarationId(808), - name: Some("ArrowBody".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "UserDefined".to_string(), - ty: DeclarationId(1984), - }, - Field { - label: "ExternalRealization".to_string(), - ty: DeclarationId(1985), - }, - Field { - label: "Pending".to_string(), - ty: DeclarationId(1986), - }, - Field { - label: "NoBody".to_string(), - ty: DeclarationId(1987), - }, - Field { - label: "Unparsed".to_string(), - ty: DeclarationId(1988), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 11127, 11256), - }); - declarations.push(Declaration { - id: DeclarationId(809), - name: Some("TypeConnective".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Atom".to_string(), - ty: DeclarationId(1989), - }, - Field { - label: "Conj".to_string(), - ty: DeclarationId(1991), - }, - Field { - label: "Disj".to_string(), - ty: DeclarationId(1993), - }, - Field { - label: "Arrow".to_string(), - ty: DeclarationId(1995), - }, - Field { - label: "Cardinality".to_string(), - ty: DeclarationId(1996), - }, - Field { - label: "Instantiation".to_string(), - ty: DeclarationId(1998), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 11461, 11861), - }); - declarations.push(Declaration { - id: DeclarationId(810), - name: Some("Declaration".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "id".to_string(), - ty: DeclarationId(737), - }, - Field { - label: "name".to_string(), - ty: DeclarationId(1999), - }, - Field { - label: "connective".to_string(), - ty: DeclarationId(809), - }, - Field { - label: "type_params".to_string(), - ty: DeclarationId(2000), - }, - Field { - label: "phantom_params".to_string(), - ty: DeclarationId(2001), - }, - Field { - label: "meta_tag".to_string(), - ty: DeclarationId(2002), - }, - Field { - label: "inhabits".to_string(), - ty: DeclarationId(2003), - }, - Field { - label: "value_body".to_string(), - ty: DeclarationId(2004), - }, - Field { - label: "nominal_opacity".to_string(), - ty: DeclarationId(2005), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 11863, 12157), - }); - declarations.push(Declaration { - id: DeclarationId(811), - name: Some("PhantomParameter".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "parameter".to_string(), - ty: DeclarationId(737), - }, - Field { - label: "algebra".to_string(), - ty: DeclarationId(737), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 12630, 12707), - }); - declarations.push(Declaration { - id: DeclarationId(812), - name: Some("NominalOpacity".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "permitted_accessors".to_string(), - ty: DeclarationId(2006), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 13214, 13280), - }); - declarations.push(Declaration { - id: DeclarationId(813), - name: Some("ArithmeticOp".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Add".to_string(), - ty: DeclarationId(2007), - }, - Field { - label: "Sub".to_string(), - ty: DeclarationId(2008), - }, - Field { - label: "Mul".to_string(), - ty: DeclarationId(2009), - }, - Field { - label: "Div".to_string(), - ty: DeclarationId(2010), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 13537, 13586), - }); - declarations.push(Declaration { - id: DeclarationId(814), - name: Some("ComparisonOp".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Eq".to_string(), - ty: DeclarationId(2011), - }, - Field { - label: "Ne".to_string(), - ty: DeclarationId(2012), - }, - Field { - label: "Lt".to_string(), - ty: DeclarationId(2013), - }, - Field { - label: "Le".to_string(), - ty: DeclarationId(2014), - }, - Field { - label: "Gt".to_string(), - ty: DeclarationId(2015), - }, - Field { - label: "Ge".to_string(), - ty: DeclarationId(2016), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 13688, 13747), - }); - declarations.push(Declaration { - id: DeclarationId(815), - name: Some("PerfBaselineMeasurement".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "median_ns".to_string(), - ty: DeclarationId(76), - }, - Field { - label: "p99_delta_ns".to_string(), - ty: DeclarationId(76), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 14202, 14271), - }); - declarations.push(Declaration { - id: DeclarationId(816), - name: Some("LogicalOp".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "And".to_string(), - ty: DeclarationId(2017), - }, - Field { - label: "Or".to_string(), - ty: DeclarationId(2018), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 14505, 14534), - }); - declarations.push(Declaration { - id: DeclarationId(817), - name: Some("OperatorKind".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Arithmetic".to_string(), - ty: DeclarationId(2019), - }, - Field { - label: "Comparison".to_string(), - ty: DeclarationId(2020), - }, - Field { - label: "Logical".to_string(), - ty: DeclarationId(2021), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 14748, 14846), - }); - declarations.push(Declaration { - id: DeclarationId(818), - name: Some("TransformTarget".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Callable".to_string(), - ty: DeclarationId(2022), - }, - Field { - label: "UnresolvedFieldProject".to_string(), - ty: DeclarationId(2023), - }, - Field { - label: "ResolvedFieldProject".to_string(), - ty: DeclarationId(2024), - }, - Field { - label: "Operator".to_string(), - ty: DeclarationId(2025), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 15008, 15203), - }); - declarations.push(Declaration { - id: DeclarationId(819), - name: Some("BranchPattern".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "UnresolvedVariant".to_string(), - ty: DeclarationId(2026), - }, - Field { - label: "ResolvedVariant".to_string(), - ty: DeclarationId(2027), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 15305, 15415), - }); - declarations.push(Declaration { - id: DeclarationId(820), - name: Some("PayloadBinding".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "binding_name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "payload_port".to_string(), - ty: DeclarationId(736), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 15417, 15486), - }); - declarations.push(Declaration { - id: DeclarationId(821), - name: Some("BranchPath".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "body".to_string(), - ty: DeclarationId(735), - }, - Field { - label: "result_port".to_string(), - ty: DeclarationId(736), - }, - Field { - label: "pattern".to_string(), - ty: DeclarationId(819), - }, - Field { - label: "binding".to_string(), - ty: DeclarationId(2028), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 15488, 15596), - }); - declarations.push(Declaration { - id: DeclarationId(822), - name: Some("ParamRef".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "member".to_string(), - ty: DeclarationId(735), - }, - Field { - label: "slot".to_string(), - ty: DeclarationId(87), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 16195, 16241), - }); - declarations.push(Declaration { - id: DeclarationId(823), - name: Some("TransformRef".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "node".to_string(), - ty: DeclarationId(735), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 16753, 16789), - }); - declarations.push(Declaration { - id: DeclarationId(824), - name: Some("ElementRef".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "index".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![DeclarationId(825)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 17406, 17447), - }); - declarations.push(Declaration { - id: DeclarationId(825), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("element".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 17406, 17447), - }); - declarations.push(Declaration { - id: DeclarationId(826), - name: Some("MemberDescent".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "param".to_string(), - ty: DeclarationId(822), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 17449, 17489), - }); - declarations.push(Declaration { - id: DeclarationId(827), - name: Some("IntraClusterCall".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "transform".to_string(), - ty: DeclarationId(823), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 17491, 17542), - }); - declarations.push(Declaration { - id: DeclarationId(828), - name: Some("Cluster".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "members".to_string(), - ty: DeclarationId(2029), - }, - Field { - label: "intra_cluster_calls".to_string(), - ty: DeclarationId(2030), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 17544, 17657), - }); - declarations.push(Declaration { - id: DeclarationId(829), - name: Some("LoopBound".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Cardinality".to_string(), - ty: DeclarationId(2031), - }, - Field { - label: "Descent".to_string(), - ty: DeclarationId(2032), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 18259, 18359), - }); - declarations.push(Declaration { - id: DeclarationId(830), - name: Some("loop_bound_measure".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(829)], - output: DeclarationId(736), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(300))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 18361, 18514), - }); - declarations.push(Declaration { - id: DeclarationId(831), - name: Some("ValueNode".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "id".to_string(), - ty: DeclarationId(735), - }, - Field { - label: "payload".to_string(), - ty: DeclarationId(793), - }, - Field { - label: "result_port".to_string(), - ty: DeclarationId(736), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - Field { - label: "lane2_workflow".to_string(), - ty: DeclarationId(2033), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 18516, 18645), - }); - declarations.push(Declaration { - id: DeclarationId(832), - name: Some("TransformNode".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "id".to_string(), - ty: DeclarationId(735), - }, - Field { - label: "target".to_string(), - ty: DeclarationId(818), - }, - Field { - label: "inputs".to_string(), - ty: DeclarationId(2034), - }, - Field { - label: "result_port".to_string(), - ty: DeclarationId(736), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 18647, 18772), - }); - declarations.push(Declaration { - id: DeclarationId(833), - name: Some("BranchEmitParticipation".to_string()), - connective: TypeConnective::Disj { - variants: vec![Field { - label: "UserMatch".to_string(), - ty: DeclarationId(2035), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 18937, 18979), - }); - declarations.push(Declaration { - id: DeclarationId(834), - name: Some("BranchNode".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "id".to_string(), - ty: DeclarationId(735), - }, - Field { - label: "input".to_string(), - ty: DeclarationId(736), - }, - Field { - label: "paths".to_string(), - ty: DeclarationId(2036), - }, - Field { - label: "result_port".to_string(), - ty: DeclarationId(736), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - Field { - label: "emit_participation".to_string(), - ty: DeclarationId(2037), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 18981, 19143), - }); - declarations.push(Declaration { - id: DeclarationId(835), - name: Some("LoopNode".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "id".to_string(), - ty: DeclarationId(735), - }, - Field { - label: "source".to_string(), - ty: DeclarationId(736), - }, - Field { - label: "init".to_string(), - ty: DeclarationId(736), - }, - Field { - label: "body".to_string(), - ty: DeclarationId(735), - }, - Field { - label: "bound".to_string(), - ty: DeclarationId(829), - }, - Field { - label: "result_port".to_string(), - ty: DeclarationId(736), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19145, 19282), - }); - declarations.push(Declaration { - id: DeclarationId(836), - name: Some("BindEmitParticipation".to_string()), - connective: TypeConnective::Disj { - variants: vec![Field { - label: "UserCallable".to_string(), - ty: DeclarationId(2038), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19524, 19567), - }); - declarations.push(Declaration { - id: DeclarationId(837), - name: Some("BindNode".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "id".to_string(), - ty: DeclarationId(735), - }, - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "result_port".to_string(), - ty: DeclarationId(736), - }, - Field { - label: "params".to_string(), - ty: DeclarationId(2039), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - Field { - label: "lane2_workflow".to_string(), - ty: DeclarationId(2040), - }, - Field { - label: "emit_participation".to_string(), - ty: DeclarationId(2041), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19569, 19757), - }); - declarations.push(Declaration { - id: DeclarationId(838), - name: Some("Behavior".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Value".to_string(), - ty: DeclarationId(2042), - }, - Field { - label: "Transform".to_string(), - ty: DeclarationId(2043), - }, - Field { - label: "Branch".to_string(), - ty: DeclarationId(2044), - }, - Field { - label: "Loop".to_string(), - ty: DeclarationId(2045), - }, - Field { - label: "Bind".to_string(), - ty: DeclarationId(2046), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19829, 19953), - }); - declarations.push(Declaration { - id: DeclarationId(839), - name: Some("Dag".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "declarations".to_string(), - ty: DeclarationId(2047), - }, - Field { - label: "nodes".to_string(), - ty: DeclarationId(2048), - }, - Field { - label: "ports".to_string(), - ty: DeclarationId(2049), - }, - Field { - label: "clusters".to_string(), - ty: DeclarationId(2050), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19955, 20074), - }); - declarations.push(Declaration { - id: DeclarationId(840), - name: Some("SubstrateAccessorRealization".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "carrier".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 21426, 21481), - }); - declarations.push(Declaration { - id: DeclarationId(841), - name: Some("SubstrateAccessorBinding".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "accessor".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "realization".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "language".to_string(), - ty: DeclarationId(1353), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 22248, 22365), - }); - declarations.push(Declaration { - id: DeclarationId(842), - name: Some("port".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839), DeclarationId(736)], - output: DeclarationId(1932), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/substrate.dag", - 22407, - 22422, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 22367, 22422), - }); - declarations.push(Declaration { - id: DeclarationId(843), - name: Some("node".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839), DeclarationId(735)], - output: DeclarationId(1933), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/substrate.dag", - 22465, - 22480, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 22424, 22480), - }); - declarations.push(Declaration { - id: DeclarationId(844), - name: Some("resolve_producer".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839), DeclarationId(736)], - output: DeclarationId(1934), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/substrate.dag", - 22540, - 22567, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 22482, 22567), - }); - declarations.push(Declaration { - id: DeclarationId(845), - name: Some("declaration_by_id".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839), DeclarationId(737)], - output: DeclarationId(1935), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/substrate.dag", - 22929, - 22957, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 22865, 22957), - }); - declarations.push(Declaration { - id: DeclarationId(846), - name: Some("declaration_by_name".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839), DeclarationId(227)], - output: DeclarationId(1936), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/substrate.dag", - 23804, - 23834, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 23743, 23834), - }); - declarations.push(Declaration { - id: DeclarationId(847), - name: Some("lane2_workflow_at".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839), DeclarationId(735)], - output: DeclarationId(1937), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/substrate.dag", - 24130, - 24165, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 24070, 24165), - }); - declarations.push(Declaration { - id: DeclarationId(848), - name: Some("WorkflowRoot".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "SingleRoot".to_string(), - ty: DeclarationId(2051), - }, - Field { - label: "NoRoot".to_string(), - ty: DeclarationId(2052), - }, - Field { - label: "AmbiguousRoot".to_string(), - ty: DeclarationId(2054), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 26133, 26243), - }); - declarations.push(Declaration { - id: DeclarationId(849), - name: Some("workflow_root_port".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839)], - output: DeclarationId(848), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/substrate.dag", - 27749, - 27778, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 27703, 27778), - }); - declarations.push(Declaration { - id: DeclarationId(850), - name: Some("miss_declaration_id_lookup".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(1938), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/substrate.dag", - 28135, - 28145, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 28078, 28145), - }); - declarations.push(Declaration { - id: DeclarationId(851), - name: Some("hit_declaration_id_lookup".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(737)], - output: DeclarationId(1939), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/substrate.dag", - 28220, - 28233, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 28147, 28233), - }); - declarations.push(Declaration { - id: DeclarationId(852), - name: Some("MethodRef".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "decl".to_string(), - ty: DeclarationId(1353), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/methods.dag", 1604, 1645), - }); - declarations.push(Declaration { - id: DeclarationId(853), - name: Some("AnthropicChatMessage".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "UserMessage".to_string(), - ty: DeclarationId(2056), - }, - Field { - label: "AssistantMessage".to_string(), - ty: DeclarationId(2058), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 2660, 2822), - }); - declarations.push(Declaration { - id: DeclarationId(854), - name: Some("ImageSource".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Base64Image".to_string(), - ty: DeclarationId(2059), - }, - Field { - label: "UrlImage".to_string(), - ty: DeclarationId(2060), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 2978, 3093), - }); - declarations.push(Declaration { - id: DeclarationId(855), - name: Some("CacheControl".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "type".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 3260, 3296), - }); - declarations.push(Declaration { - id: DeclarationId(856), - name: Some("AnthropicSearchResultCitationsConfig".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "enabled".to_string(), - ty: DeclarationId(124), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 3393, 3454), - }); - declarations.push(Declaration { - id: DeclarationId(857), - name: Some("AnthropicToolResultContent".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ToolResultText".to_string(), - ty: DeclarationId(2061), - }, - Field { - label: "ToolResultBlocks".to_string(), - ty: DeclarationId(2063), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 3752, 3863), - }); - declarations.push(Declaration { - id: DeclarationId(858), - name: Some("AnthropicToolResultWireTextTag".to_string()), - connective: TypeConnective::Disj { - variants: vec![Field { - label: "Text".to_string(), - ty: DeclarationId(2064), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 5032, 5079), - }); - declarations.push(Declaration { - id: DeclarationId(859), - name: Some("AnthropicPlainTextDocumentMediaType".to_string()), - connective: TypeConnective::Disj { - variants: vec![Field { - label: "TextPlain".to_string(), - ty: DeclarationId(2065), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 5160, 5217), - }); - declarations.push(Declaration { - id: DeclarationId(860), - name: Some("AnthropicToolResultTextBlock".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "type".to_string(), - ty: DeclarationId(858), - }, - Field { - label: "text".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 5308, 5399), - }); - declarations.push(Declaration { - id: DeclarationId(861), - name: Some("AnthropicToolResultBlock".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "AnthropicTextBlock".to_string(), - ty: DeclarationId(2066), - }, - Field { - label: "AnthropicImageBlock".to_string(), - ty: DeclarationId(2067), - }, - Field { - label: "AnthropicDocumentBlock".to_string(), - ty: DeclarationId(2068), - }, - Field { - label: "AnthropicSearchResultBlock".to_string(), - ty: DeclarationId(2072), - }, - Field { - label: "AnthropicToolReferenceBlock".to_string(), - ty: DeclarationId(2073), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 5401, 5874), - }); - declarations.push(Declaration { - id: DeclarationId(862), - name: Some("AnthropicToolResultPlainTextDocumentSource".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "type".to_string(), - ty: DeclarationId(858), - }, - Field { - label: "media_type".to_string(), - ty: DeclarationId(859), - }, - Field { - label: "document_data".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 5876, 6101), - }); - declarations.push(Declaration { - id: DeclarationId(863), - name: Some("AnthropicUserContentBlock".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "UserTextBlock".to_string(), - ty: DeclarationId(2074), - }, - Field { - label: "UserToolResultBlock".to_string(), - ty: DeclarationId(2077), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 6347, 6541), - }); - declarations.push(Declaration { - id: DeclarationId(864), - name: Some("AnthropicAssistantContentBlock".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "AssistantTextBlock".to_string(), - ty: DeclarationId(2078), - }, - Field { - label: "AssistantToolUseBlock".to_string(), - ty: DeclarationId(2079), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 6948, 7114), - }); - declarations.push(Declaration { - id: DeclarationId(865), - name: Some("AnthropicStopReason".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "EndTurn".to_string(), - ty: DeclarationId(2080), - }, - Field { - label: "MaxTokens".to_string(), - ty: DeclarationId(2081), - }, - Field { - label: "StopSequence".to_string(), - ty: DeclarationId(2082), - }, - Field { - label: "ToolUse".to_string(), - ty: DeclarationId(2083), - }, - Field { - label: "PauseTurn".to_string(), - ty: DeclarationId(2084), - }, - Field { - label: "Refusal".to_string(), - ty: DeclarationId(2085), - }, - Field { - label: "ModelContextWindowExceeded".to_string(), - ty: DeclarationId(2086), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 7443, 7579), - }); - declarations.push(Declaration { - id: DeclarationId(866), - name: Some("AnthropicMessages200Citation".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "CharLocation".to_string(), - ty: DeclarationId(2089), - }, - Field { - label: "PageLocation".to_string(), - ty: DeclarationId(2092), - }, - Field { - label: "ContentBlockLocation".to_string(), - ty: DeclarationId(2095), - }, - Field { - label: "WebSearchResultLocation".to_string(), - ty: DeclarationId(2097), - }, - Field { - label: "SearchResultLocation".to_string(), - ty: DeclarationId(2099), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 7781, 8527), - }); - declarations.push(Declaration { - id: DeclarationId(867), - name: Some("AnthropicMessages200ContentBlock".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "MessagesTextBlock".to_string(), - ty: DeclarationId(2102), - }, - Field { - label: "MessagesThinkingBlock".to_string(), - ty: DeclarationId(2103), - }, - Field { - label: "MessagesRedactedThinkingBlock".to_string(), - ty: DeclarationId(2104), - }, - Field { - label: "MessagesToolUseBlock".to_string(), - ty: DeclarationId(2106), - }, - Field { - label: "MessagesServerToolUseBlock".to_string(), - ty: DeclarationId(2108), - }, - Field { - label: "MessagesWebSearchToolResultBlock".to_string(), - ty: DeclarationId(2110), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9064, 9592), - }); - declarations.push(Declaration { - id: DeclarationId(868), - name: Some("AnthropicServerToolName".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "WebSearch".to_string(), - ty: DeclarationId(2111), - }, - Field { - label: "WebFetch".to_string(), - ty: DeclarationId(2112), - }, - Field { - label: "CodeExecution".to_string(), - ty: DeclarationId(2113), - }, - Field { - label: "BashCodeExecution".to_string(), - ty: DeclarationId(2114), - }, - Field { - label: "TextEditorCodeExecution".to_string(), - ty: DeclarationId(2115), - }, - Field { - label: "ToolSearchToolRegex".to_string(), - ty: DeclarationId(2116), - }, - Field { - label: "ToolSearchToolBm25".to_string(), - ty: DeclarationId(2117), - }, - Field { - label: "Advisor".to_string(), - ty: DeclarationId(2118), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9780, 9962), - }); - declarations.push(Declaration { - id: DeclarationId(869), - name: Some("AnthropicMessages200ServiceTier".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Standard".to_string(), - ty: DeclarationId(2119), - }, - Field { - label: "Priority".to_string(), - ty: DeclarationId(2120), - }, - Field { - label: "Batch".to_string(), - ty: DeclarationId(2121), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 10201, 10273), - }); - declarations.push(Declaration { - id: DeclarationId(870), - name: Some("AnthropicMessages200Usage".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "input_tokens".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "output_tokens".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "cache_creation_input_tokens".to_string(), - ty: DeclarationId(2122), - }, - Field { - label: "cache_read_input_tokens".to_string(), - ty: DeclarationId(2123), - }, - Field { - label: "service_tier".to_string(), - ty: DeclarationId(2124), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 10389, 10629), - }); - declarations.push(Declaration { - id: DeclarationId(871), - name: Some("AnthropicMessages200Role".to_string()), - connective: TypeConnective::Disj { - variants: vec![Field { - label: "Assistant".to_string(), - ty: DeclarationId(2125), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 10950, 10993), - }); - declarations.push(Declaration { - id: DeclarationId(872), - name: Some("AnthropicMessages200Body".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "id".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "type".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "role".to_string(), - ty: DeclarationId(871), - }, - Field { - label: "content".to_string(), - ty: DeclarationId(2126), - }, - Field { - label: "model".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "stop_reason".to_string(), - ty: DeclarationId(865), - }, - Field { - label: "stop_sequence".to_string(), - ty: DeclarationId(2127), - }, - Field { - label: "usage".to_string(), - ty: DeclarationId(870), - }, - Field { - label: "container".to_string(), - ty: DeclarationId(2128), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 11340, 11671), - }); - declarations.push(Declaration { - id: DeclarationId(873), - name: Some("anthropic_messages".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![ - DeclarationId(143), - DeclarationId(227), - DeclarationId(2129), - DeclarationId(87), - DeclarationId(2130), - DeclarationId(2131), - ], - output: DeclarationId(872), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/anthropic_messages.dag", - 4627, - 4656, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_messages.dag", 4419, 4656), - }); - declarations.push(Declaration { - id: DeclarationId(874), - name: Some("BinShim".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "entrypoint_name".to_string(), - ty: DeclarationId(147), - }, - Field { - label: "description".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "entry".to_string(), - ty: DeclarationId(1353), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/bin_shim.dag", 801, 894), - }); - declarations.push(Declaration { - id: DeclarationId(875), - name: Some("BootstrapAuthority".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "StdAuthority".to_string(), - ty: DeclarationId(2132), - }, - Field { - label: "V3StdAuthority".to_string(), - ty: DeclarationId(2133), - }, - Field { - label: "V3SpecAuthority".to_string(), - ty: DeclarationId(2134), - }, - Field { - label: "CompilerAuthority".to_string(), - ty: DeclarationId(2135), - }, - Field { - label: "ExtdepsFixtureAuthority".to_string(), - ty: DeclarationId(2136), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/bootstrap_authority.dag", 985, 1114), - }); - declarations.push(Declaration { - id: DeclarationId(876), - name: Some("BootstrapAuthoritySet".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(875), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/bootstrap_authority.dag", 1299, 1359), - }); - declarations.push(Declaration { - id: DeclarationId(877), - name: Some("bootstrap_authority".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(876), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(876)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Map( - FieldMap::from_entries(vec![ - ( - "dsl/std/logic.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2132), - payload: vec![], - }, - ), - ( - "dsl/std/bit.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2132), - payload: vec![], - }, - ), - ( - "dsl/std/error_primitives.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2132), - payload: vec![], - }, - ), - ( - "dsl/std/algebra.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2132), - payload: vec![], - }, - ), - ( - "dsl/std/magnitude.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2132), - payload: vec![], - }, - ), - ( - "dsl/std/machine_constraints.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2132), - payload: vec![], - }, - ), - ( - "dsl/std/nat.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2132), - payload: vec![], - }, - ), - ( - "dsl/std/integer.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2132), - payload: vec![], - }, - ), - ( - "dsl/std/rational.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2132), - payload: vec![], - }, - ), - ( - "dsl/std/float.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2132), - payload: vec![], - }, - ), - ( - "dsl/std/types.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2132), - payload: vec![], - }, - ), - ( - "dsl/std/string_type.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2132), - payload: vec![], - }, - ), - ( - "dsl/std/unicode.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2132), - payload: vec![], - }, - ), - ( - "dsl/std/render_repeat_string_bootstrap.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2132), - payload: vec![], - }, - ), - ( - "dsl/std/methods.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2132), - payload: vec![], - }, - ), - ( - "dsl/std/serialization.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2132), - payload: vec![], - }, - ), - ( - "src/v3/std/algebra.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2133), - payload: vec![], - }, - ), - ( - "src/v3/std/anthropic_messages.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2133), - payload: vec![], - }, - ), - ( - "src/v3/std/anthropic_operations.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2133), - payload: vec![], - }, - ), - ( - "src/v3/std/anthropic_schema.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2133), - payload: vec![], - }, - ), - ( - "src/v3/std/approximate_field.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2133), - payload: vec![], - }, - ), - ( - "src/v3/std/bin_shim.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2133), - payload: vec![], - }, - ), - ( - "src/v3/std/bootstrap_authority.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2133), - payload: vec![], - }, - ), - ( - "src/v3/std/bridge_ledger.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2133), - payload: vec![], - }, - ), - ( - "src/v3/std/clean_emission.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2133), - payload: vec![], - }, - ), - ( - "src/v3/std/computation.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2133), - payload: vec![], - }, - ), - ( - "src/v3/std/computation_model.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2133), - payload: vec![], - }, - ), - ( - "src/v3/std/coproduct_projection.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2133), - payload: vec![], - }, - ), - ( - "src/v3/std/cross_target_coverage.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2133), - payload: vec![], - }, - ), - ( - "src/v3/std/diagnostics.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2133), - payload: vec![], - }, - ), - ( - "src/v3/std/dimensions.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2133), - payload: vec![], - }, - ), - ( - "src/v3/std/effects.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2133), - payload: vec![], - }, - ), - ( - "src/v3/std/emission_provenance.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2133), - payload: vec![], - }, - ), - ( - "src/v3/std/emit_model.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2133), - payload: vec![], - }, - ), - ( - "src/v3/std/extdeps_bootstrap_fixtures.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2133), - payload: vec![], - }, - ), - ( - "src/v3/std/go_method_template_contracts.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2133), - payload: vec![], - }, - ), - ( - "src/v3/std/induction.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2133), - payload: vec![], - }, - ), - ( - "src/v3/std/integer_diagnostic_order.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2133), - payload: vec![], - }, - ), - ( - "src/v3/std/lens.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2133), - payload: vec![], - }, - ), - ( - "src/v3/std/lens_application.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2133), - payload: vec![], - }, - ), - ( - "src/v3/std/list.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2133), - payload: vec![], - }, - ), - ( - "src/v3/std/lookup.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2133), - payload: vec![], - }, - ), - ( - "src/v3/std/methods.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2133), - payload: vec![], - }, - ), - ( - "src/v3/std/parse_surface.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2133), - payload: vec![], - }, - ), - ( - "src/v3/std/python_method_template_contracts.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2133), - payload: vec![], - }, - ), - ( - "src/v3/std/resources.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2133), - payload: vec![], - }, - ), - ( - "src/v3/std/runtime.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2133), - payload: vec![], - }, - ), - ( - "src/v3/std/rust_method_template_contracts.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2133), - payload: vec![], - }, - ), - ( - "src/v3/std/services.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2133), - payload: vec![], - }, - ), - ( - "src/v3/std/substrate.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2133), - payload: vec![], - }, - ), - ( - "src/v3/std/substrate_minimal.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2133), - payload: vec![], - }, - ), - ( - "src/v3/std/termination.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2133), - payload: vec![], - }, - ), - ( - "src/v3/std/timing_lens.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2133), - payload: vec![], - }, - ), - ( - "src/v3/std/t_ci_workflow_as_data_demo.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2133), - payload: vec![], - }, - ), - ( - "src/v3/std/tokenize.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2133), - payload: vec![], - }, - ), - ( - "src/v3/std/verification.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2133), - payload: vec![], - }, - ), - ( - "src/v3/std/workflows.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2133), - payload: vec![], - }, - ), - ( - "src/v3/spec/v3_l1.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2134), - payload: vec![], - }, - ), - ( - "src/v3/spec/go.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2134), - payload: vec![], - }, - ), - ( - "src/v3/spec/python.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2134), - payload: vec![], - }, - ), - ( - "src/v3/spec/rust.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2134), - payload: vec![], - }, - ), - ( - "src/v3/compiler/pipeline.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2135), - payload: vec![], - }, - ), - ( - "src/v3/compiler/operators.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2135), - payload: vec![], - }, - ), - ( - "src/v3/compiler/regen.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2135), - payload: vec![], - }, - ), - ( - "dsl/extdeps/languages/rust/primitives.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2136), - payload: vec![], - }, - ), - ( - "dsl/extdeps/cron/schedule_model.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2136), - payload: vec![], - }, - ), - ( - "dsl/extdeps/github/github.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2136), - payload: vec![], - }, - ), - ( - "dsl/extdeps/github/actions.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2136), - payload: vec![], - }, - ), - ( - "dsl/extdeps/github/ci.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2136), - payload: vec![], - }, - ), - ]) - .expect("ValueBody::Map"), - )), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/bootstrap_authority.dag", 1361, 4934), - }); - declarations.push(Declaration { - id: DeclarationId(878), - name: Some("BridgeStatus".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Retired".to_string(), - ty: DeclarationId(2137), - }, - Field { - label: "Open".to_string(), - ty: DeclarationId(2138), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/bridge_ledger.dag", 4987, 5025), - }); - declarations.push(Declaration { - id: DeclarationId(879), - name: Some("BridgeLedgerRef".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "decl".to_string(), - ty: DeclarationId(1353), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/bridge_ledger.dag", 5989, 6036), - }); - declarations.push(Declaration { - id: DeclarationId(880), - name: Some("BridgeLedgerRow".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "owner".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "status".to_string(), - ty: DeclarationId(878), - }, - Field { - label: "authority".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/bridge_ledger.dag", 6679, 6789), - }); - declarations.push(Declaration { id: DeclarationId(881), name: Some("bridge_ledger".to_string()), connective: TypeConnective::Instantiation { template: DeclarationId(699), arguments: vec![TemplateArgument { parameter: DeclarationId(700), value: DeclarationId(880) }] }, type_params: vec![], phantom_params: Vec::new(), meta_tag: Some(DeclarationId(2139)), specialization_parent: None, inhabits: None, value_body: Some(ValueBody::List(vec![FieldValue::Record(vec![("name".to_string(), FieldValue::Literal(LiteralBits::String("bridge_source_span_file_participation_retired".to_string()))), ("owner".to_string(), FieldValue::Literal(LiteralBits::String("R3".to_string()))), ("status".to_string(), FieldValue::Variant { constructor: DeclarationId(2138), payload: vec![] }), ("authority".to_string(), FieldValue::Literal(LiteralBits::String("ROADMAP.md#lens-fold-file-path-semantics".to_string())))]), FieldValue::Record(vec![("name".to_string(), FieldValue::Literal(LiteralBits::String("bridge_mark_bootstrap_secret_nominal_opacity_retired".to_string()))), ("owner".to_string(), FieldValue::Literal(LiteralBits::String("R2-Substrate".to_string()))), ("status".to_string(), FieldValue::Variant { constructor: DeclarationId(2137), payload: vec![] }), ("authority".to_string(), FieldValue::Literal(LiteralBits::String("PR #937".to_string())))]), FieldValue::Record(vec![("name".to_string(), FieldValue::Literal(LiteralBits::String("bridge_canonical_lens_name_dispatch_pr1183_slice_retired".to_string()))), ("owner".to_string(), FieldValue::Literal(LiteralBits::String("R2-Substrate".to_string()))), ("status".to_string(), FieldValue::Variant { constructor: DeclarationId(2137), payload: vec![] }), ("authority".to_string(), FieldValue::Literal(LiteralBits::String("src/v3/compiler/tests/integration/canonical_lens_bridge_ratchet_test.rs".to_string())))]), FieldValue::Record(vec![("name".to_string(), FieldValue::Literal(LiteralBits::String("bridge_canonical_lens_name_patching_residual".to_string()))), ("owner".to_string(), FieldValue::Literal(LiteralBits::String("PB-Runtime".to_string()))), ("status".to_string(), FieldValue::Variant { constructor: DeclarationId(2137), payload: vec![] }), ("authority".to_string(), FieldValue::Literal(LiteralBits::String("docs/briefs/r3-pb-bridge-canonical-lens-name-dispatch-closure.md".to_string())))]), FieldValue::Record(vec![("name".to_string(), FieldValue::Literal(LiteralBits::String("bridge_include_str_side_channels_retired".to_string()))), ("owner".to_string(), FieldValue::Literal(LiteralBits::String("pipeline_authority".to_string()))), ("status".to_string(), FieldValue::Variant { constructor: DeclarationId(2137), payload: vec![] }), ("authority".to_string(), FieldValue::Literal(LiteralBits::String("src/v3/compiler/tests/integration/l1_5_fixed_point_test.rs".to_string())))]), FieldValue::Record(vec![("name".to_string(), FieldValue::Literal(LiteralBits::String("bridge_exact_string_patching_residual_retired".to_string()))), ("owner".to_string(), FieldValue::Literal(LiteralBits::String("PB-Tier-2".to_string()))), ("status".to_string(), FieldValue::Variant { constructor: DeclarationId(2137), payload: vec![] }), ("authority".to_string(), FieldValue::Literal(LiteralBits::String("src/v3/compiler/tests/integration/bridge_lower_helpers_patch_zero_residual_test.rs".to_string())))]), FieldValue::Record(vec![("name".to_string(), FieldValue::Literal(LiteralBits::String("bridge_exact_string_semantic_patching_residual".to_string()))), ("owner".to_string(), FieldValue::Literal(LiteralBits::String("PB-Runtime".to_string()))), ("status".to_string(), FieldValue::Variant { constructor: DeclarationId(2138), payload: vec![] }), ("authority".to_string(), FieldValue::Literal(LiteralBits::String("docs/briefs/r3-v-bridge-row-4-exact-string-deeper-detail-receipt.md".to_string())))])])), refinement: None, nominal_opacity: None, span: SourceSpan::new("src/v3/std/bridge_ledger.dag", 7253, 8706) }); - declarations.push(Declaration { - id: DeclarationId(882), - name: Some("Mutability".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Immutable".to_string(), - ty: DeclarationId(2140), - }, - Field { - label: "Mutable".to_string(), - ty: DeclarationId(2141), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 340, 381), - }); - declarations.push(Declaration { - id: DeclarationId(883), - name: Some("Purity".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Pure".to_string(), - ty: DeclarationId(2142), - }, - Field { - label: "Effectful".to_string(), - ty: DeclarationId(2143), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 598, 632), - }); - declarations.push(Declaration { - id: DeclarationId(884), - name: Some("Structure".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ExplicitDAG".to_string(), - ty: DeclarationId(2144), - }, - Field { - label: "Arbitrary".to_string(), - ty: DeclarationId(2145), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 891, 935), - }); - declarations.push(Declaration { - id: DeclarationId(885), - name: Some("Iteration".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Bounded".to_string(), - ty: DeclarationId(2146), - }, - Field { - label: "Unbounded".to_string(), - ty: DeclarationId(2147), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 1147, 1187), - }); - declarations.push(Declaration { - id: DeclarationId(886), - name: Some("ComputationModel".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "mutability".to_string(), - ty: DeclarationId(882), - }, - Field { - label: "purity".to_string(), - ty: DeclarationId(883), - }, - Field { - label: "structure".to_string(), - ty: DeclarationId(884), - }, - Field { - label: "iteration".to_string(), - ty: DeclarationId(885), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 1387, 1500), - }); - declarations.push(Declaration { - id: DeclarationId(887), - name: Some("dag_model".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(886), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(886)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "mutability".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2140), - payload: vec![], - }, - ), - ( - "purity".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2142), - payload: vec![], - }, - ), - ( - "structure".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2144), - payload: vec![], - }, - ), - ( - "iteration".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2146), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 1502, 1625), - }); - declarations.push(Declaration { - id: DeclarationId(888), - name: Some("MemoryModel".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ValueOnly".to_string(), - ty: DeclarationId(2148), - }, - Field { - label: "GarbageCollected".to_string(), - ty: DeclarationId(2149), - }, - Field { - label: "RefCounted".to_string(), - ty: DeclarationId(2150), - }, - Field { - label: "OwnershipBased".to_string(), - ty: DeclarationId(2151), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 2014, 2099), - }); - declarations.push(Declaration { - id: DeclarationId(889), - name: Some("ScopeModel".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "LexicalScoping".to_string(), - ty: DeclarationId(2152), - }, - Field { - label: "DynamicScoping".to_string(), - ty: DeclarationId(2153), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 2365, 2418), - }); - declarations.push(Declaration { - id: DeclarationId(890), - name: Some("TargetExecutionModel".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "memory".to_string(), - ty: DeclarationId(888), - }, - Field { - label: "scope".to_string(), - ty: DeclarationId(889), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 2561, 2632), - }); - declarations.push(Declaration { - id: DeclarationId(891), - name: Some("SourceFiltering".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "excluded_prefixes".to_string(), - ty: DeclarationId(2154), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 2774, 2832), - }); - declarations.push(Declaration { - id: DeclarationId(892), - name: Some("ShapeATargetSourceFiltering".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "internal".to_string(), - ty: DeclarationId(891), - }, - Field { - label: "additional_excluded_prefixes".to_string(), - ty: DeclarationId(2155), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 3115, 3224), - }); - declarations.push(Declaration { - id: DeclarationId(893), - name: Some("internal_source_filtering".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(891), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(891)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "excluded_prefixes".to_string(), - FieldValue::List(vec![ - FieldValue::Literal(LiteralBits::String("dsl/std/".to_string())), - FieldValue::Literal(LiteralBits::String("dsl/extdeps/".to_string())), - FieldValue::Literal(LiteralBits::String("src/v3/std/".to_string())), - FieldValue::Literal(LiteralBits::String("src/v3/spec/".to_string())), - ]), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 3226, 3381), - }); - declarations.push(Declaration { - id: DeclarationId(894), - name: Some("ExecutionModelRequirement".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "OwnershipBased".to_string(), - ty: DeclarationId(2156), - }, - Field { - label: "GarbageCollected".to_string(), - ty: DeclarationId(2157), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 3659, 3729), - }); - declarations.push(Declaration { - id: DeclarationId(895), - name: Some("VariantId".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/coproduct_projection.dag", 5139, 5162), - }); - declarations.push(Declaration { - id: DeclarationId(896), - name: Some("WireTagValue".to_string()), - connective: TypeConnective::Disj { - variants: vec![Field { - label: "StringTag".to_string(), - ty: DeclarationId(2158), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/coproduct_projection.dag", 6737, 6786), - }); - declarations.push(Declaration { - id: DeclarationId(897), - name: Some("FieldProjection".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Empty".to_string(), - ty: DeclarationId(2159), - }, - Field { - label: "Populated".to_string(), - ty: DeclarationId(2160), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/coproduct_projection.dag", 7586, 7630), - }); - declarations.push(Declaration { - id: DeclarationId(898), - name: Some("CoproductVariantProjection".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "field_projection".to_string(), - ty: DeclarationId(897), - }, - Field { - label: "wire_tag_value".to_string(), - ty: DeclarationId(896), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/coproduct_projection.dag", 8046, 8150), - }); - declarations.push(Declaration { - id: DeclarationId(899), - name: Some("CoproductProjection".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "declaration".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "wire_tag_field".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "variant_projections".to_string(), - ty: DeclarationId(2161), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/coproduct_projection.dag", 9395, 9557), - }); - declarations.push(Declaration { - id: DeclarationId(900), - name: Some("BootstrapFixture".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "virtual_path".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/extdeps_bootstrap_fixtures.dag", 1395, 1443), - }); - declarations.push(Declaration { - id: DeclarationId(901), - name: Some("BootstrapFixtureSet".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "rust_grounding_primitives".to_string(), - ty: DeclarationId(900), - }, - Field { - label: "rust_method_template_contracts".to_string(), - ty: DeclarationId(900), - }, - Field { - label: "python_method_template_contracts".to_string(), - ty: DeclarationId(900), - }, - Field { - label: "go_method_template_contracts".to_string(), - ty: DeclarationId(900), - }, - Field { - label: "anthropic_operations".to_string(), - ty: DeclarationId(900), - }, - Field { - label: "cross_target_coverage".to_string(), - ty: DeclarationId(900), - }, - Field { - label: "extdeps_cron".to_string(), - ty: DeclarationId(900), - }, - Field { - label: "extdeps_github_github".to_string(), - ty: DeclarationId(900), - }, - Field { - label: "extdeps_github_actions".to_string(), - ty: DeclarationId(900), - }, - Field { - label: "extdeps_github_ci".to_string(), - ty: DeclarationId(900), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/extdeps_bootstrap_fixtures.dag", 1600, 2066), - }); - declarations.push(Declaration { - id: DeclarationId(902), - name: Some("bootstrap_fixture_authority".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(901), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(901)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "rust_grounding_primitives".to_string(), - FieldValue::Record(vec![( - "virtual_path".to_string(), - FieldValue::Literal(LiteralBits::String( - "dsl/extdeps/languages/rust/primitives.dag".to_string(), - )), - )]), - ), - ( - "rust_method_template_contracts".to_string(), - FieldValue::Record(vec![( - "virtual_path".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/std/rust_method_template_contracts.dag".to_string(), - )), - )]), - ), - ( - "python_method_template_contracts".to_string(), - FieldValue::Record(vec![( - "virtual_path".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/std/python_method_template_contracts.dag".to_string(), - )), - )]), - ), - ( - "go_method_template_contracts".to_string(), - FieldValue::Record(vec![( - "virtual_path".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/std/go_method_template_contracts.dag".to_string(), - )), - )]), - ), - ( - "anthropic_operations".to_string(), - FieldValue::Record(vec![( - "virtual_path".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/std/anthropic_operations.dag".to_string(), - )), - )]), - ), - ( - "cross_target_coverage".to_string(), - FieldValue::Record(vec![( - "virtual_path".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/std/cross_target_coverage.dag".to_string(), - )), - )]), - ), - ( - "extdeps_cron".to_string(), - FieldValue::Record(vec![( - "virtual_path".to_string(), - FieldValue::Literal(LiteralBits::String( - "dsl/extdeps/cron/schedule_model.dag".to_string(), - )), - )]), - ), - ( - "extdeps_github_github".to_string(), - FieldValue::Record(vec![( - "virtual_path".to_string(), - FieldValue::Literal(LiteralBits::String( - "dsl/extdeps/github/github.dag".to_string(), - )), - )]), - ), - ( - "extdeps_github_actions".to_string(), - FieldValue::Record(vec![( - "virtual_path".to_string(), - FieldValue::Literal(LiteralBits::String( - "dsl/extdeps/github/actions.dag".to_string(), - )), - )]), - ), - ( - "extdeps_github_ci".to_string(), - FieldValue::Record(vec![( - "virtual_path".to_string(), - FieldValue::Literal(LiteralBits::String( - "dsl/extdeps/github/ci.dag".to_string(), - )), - )]), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/extdeps_bootstrap_fixtures.dag", 2068, 3040), - }); - declarations.push(Declaration { - id: DeclarationId(903), - name: Some("signed_int_diagnostic_order".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1353), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(2162)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::List(vec![ - FieldValue::Reference(DeclarationId(77)), - FieldValue::Reference(DeclarationId(78)), - FieldValue::Reference(DeclarationId(79)), - FieldValue::Reference(DeclarationId(80)), - FieldValue::Reference(DeclarationId(81)), - ])), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/integer_diagnostic_order.dag", 1200, 1304), - }); - declarations.push(Declaration { - id: DeclarationId(904), - name: Some("unsigned_int_diagnostic_order".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1353), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(2163)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::List(vec![ - FieldValue::Reference(DeclarationId(82)), - FieldValue::Reference(DeclarationId(83)), - FieldValue::Reference(DeclarationId(84)), - FieldValue::Reference(DeclarationId(85)), - FieldValue::Reference(DeclarationId(86)), - ])), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/integer_diagnostic_order.dag", 1378, 1489), - }); - declarations.push(Declaration { - id: DeclarationId(905), - name: Some("map_get".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(2164), DeclarationId(906)], - output: DeclarationId(2165), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/lookup.dag", 1451, 1469)), - }, - type_params: vec![DeclarationId(906), DeclarationId(907)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lookup.dag", 1388, 1469), - }); - declarations.push(Declaration { - id: DeclarationId(906), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("key".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lookup.dag", 1388, 1469), - }); - declarations.push(Declaration { - id: DeclarationId(907), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("value".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lookup.dag", 1388, 1469), - }); - declarations.push(Declaration { - id: DeclarationId(908), - name: Some("Lookup".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Miss".to_string(), - ty: DeclarationId(2168), - }, - Field { - label: "Hit".to_string(), - ty: DeclarationId(2169), - }, - ], - }, - type_params: vec![DeclarationId(909)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lookup.dag", 4917, 4959), - }); - declarations.push(Declaration { - id: DeclarationId(909), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("value".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lookup.dag", 4917, 4959), - }); - declarations.push(Declaration { - id: DeclarationId(910), - name: Some("miss_int_lookup".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(2166), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/lookup.dag", 4997, 5007)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lookup.dag", 4961, 5007), - }); - declarations.push(Declaration { - id: DeclarationId(911), - name: Some("hit_int_lookup".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87)], - output: DeclarationId(2167), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/lookup.dag", 5050, 5062)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lookup.dag", 5009, 5062), - }); - declarations.push(Declaration { - id: DeclarationId(912), - name: Some("CollectionSizeEffect".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ShrinkEffect".to_string(), - ty: DeclarationId(2194), - }, - Field { - label: "ProjectionEffect".to_string(), - ty: DeclarationId(2195), - }, - Field { - label: "IdentityEffect".to_string(), - ty: DeclarationId(2196), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 4923, 5005), - }); - declarations.push(Declaration { - id: DeclarationId(913), - name: Some("CostShape".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ShapeConstant".to_string(), - ty: DeclarationId(2197), - }, - Field { - label: "ShapeLinearScan".to_string(), - ty: DeclarationId(2198), - }, - Field { - label: "ShapeIterateBody".to_string(), - ty: DeclarationId(2199), - }, - Field { - label: "ShapeSortBody".to_string(), - ty: DeclarationId(2200), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 5836, 5927), - }); - declarations.push(Declaration { - id: DeclarationId(914), - name: Some("MethodContract".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "algebra_id".to_string(), - ty: DeclarationId(737), - }, - Field { - label: "method_id".to_string(), - ty: DeclarationId(737), - }, - Field { - label: "size_effect".to_string(), - ty: DeclarationId(2201), - }, - Field { - label: "cost_shape".to_string(), - ty: DeclarationId(2202), - }, - Field { - label: "callback_element_position".to_string(), - ty: DeclarationId(2203), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 6688, 6862), - }); - declarations.push(Declaration { - id: DeclarationId(915), - name: Some("SizeVariable".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "source_port".to_string(), - ty: DeclarationId(736), - }, - Field { - label: "display_name".to_string(), - ty: DeclarationId(2204), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 7371, 7438), - }); - declarations.push(Declaration { - id: DeclarationId(916), - name: Some("unnamed_size_variable".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(736)], - output: DeclarationId(915), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/algebra.dag", 7502, 7534)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 7440, 7534), - }); - declarations.push(Declaration { - id: DeclarationId(917), - name: Some("size_variable_eq".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(915), DeclarationId(915)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(304))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 7536, 7632), - }); - declarations.push(Declaration { - id: DeclarationId(918), - name: Some("DegreeAtLeastTwo".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "DegreeTwo".to_string(), - ty: DeclarationId(2205), - }, - Field { - label: "DegreeSuccessor".to_string(), - ty: DeclarationId(2206), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 8379, 8465), - }); - declarations.push(Declaration { - id: DeclarationId(919), - name: Some("SymbolicCost".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ConstantCost".to_string(), - ty: DeclarationId(2207), - }, - Field { - label: "LinearCost".to_string(), - ty: DeclarationId(2208), - }, - Field { - label: "PolynomialCost".to_string(), - ty: DeclarationId(2209), - }, - Field { - label: "ProductCost".to_string(), - ty: DeclarationId(2211), - }, - Field { - label: "SumCost".to_string(), - ty: DeclarationId(2213), - }, - Field { - label: "LogCost".to_string(), - ty: DeclarationId(2214), - }, - Field { - label: "UnknownCost".to_string(), - ty: DeclarationId(2215), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: Some(DeclarationId(2216)), - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 9452, 9761), - }); - declarations.push(Declaration { - id: DeclarationId(920), - name: Some("DominateScanAcc".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "any".to_string(), - ty: DeclarationId(124), - }, - Field { - label: "pivot".to_string(), - ty: DeclarationId(919), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 10167, 10225), - }); - declarations.push(Declaration { - id: DeclarationId(921), - name: Some("dominate_scan_init".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(919)], - output: DeclarationId(920), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(307))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 10227, 10322), - }); - declarations.push(Declaration { - id: DeclarationId(922), - name: Some("miss_symbolic_cost_lookup".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(2170), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/algebra.dag", 10963, 10973)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 10908, 10973), - }); - declarations.push(Declaration { - id: DeclarationId(923), - name: Some("hit_symbolic_cost_lookup".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(919)], - output: DeclarationId(2171), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/algebra.dag", 11047, 11062)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 10975, 11062), - }); - declarations.push(Declaration { - id: DeclarationId(924), - name: Some("two_terms".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(919), DeclarationId(919)], - output: DeclarationId(2172), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(311))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 11064, 11539), - }); - declarations.push(Declaration { - id: DeclarationId(925), - name: Some("many_terms".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(919), DeclarationId(919), DeclarationId(2173)], - output: DeclarationId(2174), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(313))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 11541, 11726), - }); - declarations.push(Declaration { - id: DeclarationId(926), - name: Some("reject_all_symbolic_costs".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(919)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(318))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 11728, 11856), - }); - declarations.push(Declaration { - id: DeclarationId(927), - name: Some("degree_raw".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(918)], - output: DeclarationId(87), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(326))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 11858, 12011), - }); - declarations.push(Declaration { - id: DeclarationId(928), - name: Some("sequential".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(919), DeclarationId(919)], - output: DeclarationId(919), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(330))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 12247, 12350), - }); - declarations.push(Declaration { - id: DeclarationId(929), - name: Some("iterate".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(919), DeclarationId(919)], - output: DeclarationId(919), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(334))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 12536, 12654), - }); - declarations.push(Declaration { - id: DeclarationId(930), - name: Some("max_path_step".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(919), DeclarationId(919)], - output: DeclarationId(919), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(338))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 13514, 13681), - }); - declarations.push(Declaration { - id: DeclarationId(931), - name: Some("keep_or_sum".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(919), DeclarationId(919)], - output: DeclarationId(919), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(342))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 13683, 13841), - }); - declarations.push(Declaration { - id: DeclarationId(932), - name: Some("max_path".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(2175)], - output: DeclarationId(919), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(346))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 14143, 14245), - }); - declarations.push(Declaration { - id: DeclarationId(933), - name: Some("dominates".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(919), DeclarationId(919)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(399))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 15113, 17198), - }); - declarations.push(Declaration { - id: DeclarationId(934), - name: Some("same_size_variable".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(915), DeclarationId(915)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(401))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 17200, 17290), - }); - declarations.push(Declaration { - id: DeclarationId(935), - name: Some("AsymptoticClass".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ClassConstant".to_string(), - ty: DeclarationId(2217), - }, - Field { - label: "ClassLog".to_string(), - ty: DeclarationId(2218), - }, - Field { - label: "ClassLinear".to_string(), - ty: DeclarationId(2219), - }, - Field { - label: "ClassLinearithmic".to_string(), - ty: DeclarationId(2220), - }, - Field { - label: "ClassQuadratic".to_string(), - ty: DeclarationId(2221), - }, - Field { - label: "ClassPolynomial".to_string(), - ty: DeclarationId(2222), - }, - Field { - label: "ClassExponential".to_string(), - ty: DeclarationId(2223), - }, - Field { - label: "ClassUnknown".to_string(), - ty: DeclarationId(2224), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: Some(DeclarationId(2225)), - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 18077, 18318), - }); - declarations.push(Declaration { - id: DeclarationId(936), - name: Some("asymptotic_dominates".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(935), DeclarationId(935)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(471))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 18320, 20588), - }); - declarations.push(Declaration { - id: DeclarationId(937), - name: Some("meet_asymptotic_class".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(935), DeclarationId(935)], - output: DeclarationId(935), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(474))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 20590, 20721), - }); - declarations.push(Declaration { - id: DeclarationId(938), - name: Some("join_asymptotic_class".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(935), DeclarationId(935)], - output: DeclarationId(935), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(477))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 20723, 20854), - }); - declarations.push(Declaration { - id: DeclarationId(939), - name: Some("classify_symbolic_cost".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(919)], - output: DeclarationId(935), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/algebra.dag", 20921, 20954)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 20856, 20954), - }); - declarations.push(Declaration { - id: DeclarationId(940), - name: Some("normalize".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(919)], - output: DeclarationId(919), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(486))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 21828, 22193), - }); - declarations.push(Declaration { - id: DeclarationId(941), - name: Some("nsl_to_list".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(2176)], - output: DeclarationId(2177), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(492))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 22195, 22324), - }); - declarations.push(Declaration { - id: DeclarationId(942), - name: Some("drop_additive_zero".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(2178)], - output: DeclarationId(2179), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(505))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 22501, 22793), - }); - declarations.push(Declaration { - id: DeclarationId(943), - name: Some("collapse_on_multiplicative_zero".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(2180)], - output: DeclarationId(2181), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(512))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 23002, 23165), - }); - declarations.push(Declaration { - id: DeclarationId(944), - name: Some("any_zero".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(2182)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(521))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 23167, 23332), - }); - declarations.push(Declaration { - id: DeclarationId(945), - name: Some("drop_multiplicative_one".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(2183)], - output: DeclarationId(2184), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(534))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 23490, 23796), - }); - declarations.push(Declaration { - id: DeclarationId(946), - name: Some("is_zero_constant".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(919)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(544))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 23798, 24052), - }); - declarations.push(Declaration { - id: DeclarationId(947), - name: Some("is_one_constant".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(919)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(554))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 24054, 24307), - }); - declarations.push(Declaration { - id: DeclarationId(948), - name: Some("reduce_sum".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(2185)], - output: DeclarationId(919), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(566))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 25092, 25363), - }); - declarations.push(Declaration { - id: DeclarationId(949), - name: Some("wrap_sum".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(2186)], - output: DeclarationId(919), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(578))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 25365, 25640), - }); - declarations.push(Declaration { - id: DeclarationId(950), - name: Some("reduce_product".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(2187)], - output: DeclarationId(919), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(595))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 25825, 26246), - }); - declarations.push(Declaration { - id: DeclarationId(951), - name: Some("combine_binary_product".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(919), DeclarationId(919)], - output: DeclarationId(919), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(604))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 26411, 26798), - }); - declarations.push(Declaration { - id: DeclarationId(952), - name: Some("combine_linear_with".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(915), DeclarationId(919), DeclarationId(919)], - output: DeclarationId(919), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(613))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 26800, 27209), - }); - declarations.push(Declaration { - id: DeclarationId(953), - name: Some("collapse_linear_square".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![ - DeclarationId(915), - DeclarationId(915), - DeclarationId(919), - DeclarationId(919), - ], - output: DeclarationId(919), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(618))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 27211, 27427), - }); - declarations.push(Declaration { - id: DeclarationId(954), - name: Some("polynomial_square".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(915)], - output: DeclarationId(919), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/algebra.dag", 27483, 27533)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 27429, 27533), - }); - declarations.push(Declaration { - id: DeclarationId(955), - name: Some("product_pair".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(919), DeclarationId(919)], - output: DeclarationId(919), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(621))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 27535, 27633), - }); - declarations.push(Declaration { - id: DeclarationId(956), - name: Some("fold_or_dominate_scan".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(920), DeclarationId(919)], - output: DeclarationId(920), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(628))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 27635, 27784), - }); - declarations.push(Declaration { - id: DeclarationId(957), - name: Some("scan_hit".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(920)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(630))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 27786, 27841), - }); - declarations.push(Declaration { - id: DeclarationId(958), - name: Some("filter_not_dominated_by".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(2188), DeclarationId(919)], - output: DeclarationId(2189), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(643))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 27843, 28205), - }); - declarations.push(Declaration { - id: DeclarationId(959), - name: Some("drop_dominated_step".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(2190), DeclarationId(919)], - output: DeclarationId(2191), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(650))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 28207, 28449), - }); - declarations.push(Declaration { - id: DeclarationId(960), - name: Some("drop_dominated".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(2192)], - output: DeclarationId(2193), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(653))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 28637, 28749), - }); - declarations.push(Declaration { - id: DeclarationId(961), - name: Some("ResourceHandle".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "type".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "resource_id".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "key".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "cap".to_string(), - ty: DeclarationId(143), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/resources.dag", 739, 827), - }); - declarations.push(Declaration { - id: DeclarationId(962), - name: Some("ResourceReference".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "target".to_string(), - ty: DeclarationId(1353), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/resources.dag", 829, 880), - }); - declarations.push(Declaration { - id: DeclarationId(963), - name: Some("InputField".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/services.dag", 3237, 3255), - }); - declarations.push(Declaration { - id: DeclarationId(964), - name: Some("RestEndpointBinding".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "method".to_string(), - ty: DeclarationId(195), - }, - Field { - label: "path".to_string(), - ty: DeclarationId(744), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/services.dag", 3888, 3960), - }); - declarations.push(Declaration { - id: DeclarationId(965), - name: Some("CallableRef".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "decl".to_string(), - ty: DeclarationId(1353), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/services.dag", 4768, 4811), - }); - declarations.push(Declaration { - id: DeclarationId(966), - name: Some("Operation".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "callable".to_string(), - ty: DeclarationId(965), - }, - Field { - label: "inputs".to_string(), - ty: DeclarationId(2253), - }, - Field { - label: "endpoint".to_string(), - ty: DeclarationId(964), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/services.dag", 5685, 5795), - }); - declarations.push(Declaration { - id: DeclarationId(967), - name: Some("anthropic_operations".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(966), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(2254)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::List(vec![])), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_operations.dag", 6519, 6566), - }); - declarations.push(Declaration { - id: DeclarationId(968), - name: Some("SizeBound".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "CollectionSize".to_string(), - ty: DeclarationId(2261), - }, - Field { - label: "ParserStreamSize".to_string(), - ty: DeclarationId(2262), - }, - Field { - label: "WorklistDrainSize".to_string(), - ty: DeclarationId(2263), - }, - Field { - label: "TreeSize".to_string(), - ty: DeclarationId(2264), - }, - Field { - label: "ArithmeticParam".to_string(), - ty: DeclarationId(2265), - }, - Field { - label: "ExplicitCountZero".to_string(), - ty: DeclarationId(2266), - }, - Field { - label: "ExplicitCountPositive".to_string(), - ty: DeclarationId(2267), - }, - Field { - label: "Forever".to_string(), - ty: DeclarationId(2268), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 1411, 1707), - }); - declarations.push(Declaration { - id: DeclarationId(969), - name: Some("tree_size_bound".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227)], - output: DeclarationId(968), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/computation.dag", - 1756, - 1787, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 1709, 1787), - }); - declarations.push(Declaration { - id: DeclarationId(970), - name: Some("CallPattern".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ChildAccessorCall".to_string(), - ty: DeclarationId(2269), - }, - Field { - label: "CollectionShrinkCall".to_string(), - ty: DeclarationId(2270), - }, - Field { - label: "ArithmeticSubtractCall".to_string(), - ty: DeclarationId(2271), - }, - Field { - label: "ArithmeticDivideCall".to_string(), - ty: DeclarationId(2272), - }, - Field { - label: "ParserAdvanceCall".to_string(), - ty: DeclarationId(2273), - }, - Field { - label: "WorklistDrainCall".to_string(), - ty: DeclarationId(2274), - }, - Field { - label: "FoldBodyCall".to_string(), - ty: DeclarationId(2275), - }, - Field { - label: "SameArgumentCall".to_string(), - ty: DeclarationId(2276), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 2038, 2485), - }); - declarations.push(Declaration { - id: DeclarationId(971), - name: Some("per_call_pattern_at".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839), DeclarationId(735)], - output: DeclarationId(2255), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/computation.dag", - 2764, - 2794, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 2698, 2794), - }); - declarations.push(Declaration { - id: DeclarationId(972), - name: Some("per_call_descent_operand_port".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839), DeclarationId(735)], - output: DeclarationId(2256), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/computation.dag", - 2969, - 3009, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 2898, 3009), - }); - declarations.push(Declaration { - id: DeclarationId(973), - name: Some("ShrinkFactor".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "UnitShrink".to_string(), - ty: DeclarationId(2277), - }, - Field { - label: "ConstantShrink".to_string(), - ty: DeclarationId(2278), - }, - Field { - label: "ProportionalShrink".to_string(), - ty: DeclarationId(2279), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 3199, 3339), - }); - declarations.push(Declaration { - id: DeclarationId(974), - name: Some("IterationPrimitive".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Fold".to_string(), - ty: DeclarationId(2280), - }, - Field { - label: "Descend".to_string(), - ty: DeclarationId(2281), - }, - Field { - label: "Repeat".to_string(), - ty: DeclarationId(2282), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 3501, 3556), - }); - declarations.push(Declaration { - id: DeclarationId(975), - name: Some("LoweringTarget".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "primitive".to_string(), - ty: DeclarationId(974), - }, - Field { - label: "bound".to_string(), - ty: DeclarationId(968), - }, - Field { - label: "evidence".to_string(), - ty: DeclarationId(1157), - }, - Field { - label: "factor".to_string(), - ty: DeclarationId(2283), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 3748, 3874), - }); - declarations.push(Declaration { - id: DeclarationId(976), - name: Some("lower_call_pattern".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(970)], - output: DeclarationId(975), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/computation.dag", - 4185, - 5736, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 4123, 5736), - }); - declarations.push(Declaration { - id: DeclarationId(977), - name: Some("size_bound_param".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(968)], - output: DeclarationId(2257), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/computation.dag", - 5787, - 6212, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 5738, 6212), - }); - declarations.push(Declaration { - id: DeclarationId(978), - name: Some("is_constant_bound".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(968)], - output: DeclarationId(124), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/computation.dag", - 6261, - 6432, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 6214, 6432), - }); - declarations.push(Declaration { - id: DeclarationId(979), - name: Some("forever_iteration_bound".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(87), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/computation.dag", - 6549, - 6572, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 6513, 6572), - }); - declarations.push(Declaration { - id: DeclarationId(980), - name: Some("constant_bound_value".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(968)], - output: DeclarationId(2258), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/computation.dag", - 6715, - 6980, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 6665, 6980), - }); - declarations.push(Declaration { - id: DeclarationId(981), - name: Some("IterationDimension".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "TreeDescent".to_string(), - ty: DeclarationId(2284), - }, - Field { - label: "CollectionFold".to_string(), - ty: DeclarationId(2285), - }, - Field { - label: "ArithmeticRepeat".to_string(), - ty: DeclarationId(2286), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 7465, 7648), - }); - declarations.push(Declaration { - id: DeclarationId(982), - name: Some("algebra_profile_to_dimension".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(53)], - output: DeclarationId(2259), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/computation.dag", - 7781, - 8274, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 7701, 8274), - }); - declarations.push(Declaration { - id: DeclarationId(983), - name: Some("type_iteration_dimension".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227)], - output: DeclarationId(2260), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/computation.dag", - 8346, - 8565, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 8276, 8565), - }); - declarations.push(Declaration { - id: DeclarationId(984), - name: Some("EmissionRule".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emission_provenance.dag", 2797, 2823), - }); - declarations.push(Declaration { - id: DeclarationId(985), - name: Some("OptionalSourceSpan".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "NoSourceSpan".to_string(), - ty: DeclarationId(2287), - }, - Field { - label: "SomeSourceSpan".to_string(), - ty: DeclarationId(2288), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emission_provenance.dag", 3681, 3762), - }); - declarations.push(Declaration { - id: DeclarationId(986), - name: Some("EmissionProvenance".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "emitted_line".to_string(), - ty: DeclarationId(92), - }, - Field { - label: "rule".to_string(), - ty: DeclarationId(984), - }, - Field { - label: "source_span".to_string(), - ty: DeclarationId(985), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emission_provenance.dag", 4898, 5008), - }); - declarations.push(Declaration { - id: DeclarationId(987), - name: Some("TypeRealization".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "language".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "target".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "carrier".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "is_copy".to_string(), - ty: DeclarationId(124), - }, - Field { - label: "fields".to_string(), - ty: DeclarationId(2289), - }, - Field { - label: "cost".to_string(), - ty: DeclarationId(87), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 736, 887), - }); - declarations.push(Declaration { - id: DeclarationId(988), - name: Some("TargetIntegerTypeInhabitance".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "language".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "kernel_integer".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "algebra".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "bound".to_string(), - ty: DeclarationId(989), - }, - Field { - label: "type_realization".to_string(), - ty: DeclarationId(1353), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 2385, 2840), - }); - declarations.push(Declaration { - id: DeclarationId(989), - name: Some("TargetIntegerInhabitanceBound".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "BoundUnspecified".to_string(), - ty: DeclarationId(2290), - }, - Field { - label: "StaticBoundFact".to_string(), - ty: DeclarationId(2291), - }, - Field { - label: "PlatformDependentFact".to_string(), - ty: DeclarationId(2292), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 4334, 4686), - }); - declarations.push(Declaration { - id: DeclarationId(990), - name: Some("FieldBinding".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "dag_name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "access".to_string(), - ty: DeclarationId(991), - }, - Field { - label: "borrowed_read".to_string(), - ty: DeclarationId(124), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 4688, 4772), - }); - declarations.push(Declaration { - id: DeclarationId(991), - name: Some("FieldAccess".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "DirectField".to_string(), - ty: DeclarationId(2293), - }, - Field { - label: "AccessorMethod".to_string(), - ty: DeclarationId(2294), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 5155, 5222), - }); - declarations.push(Declaration { - id: DeclarationId(992), - name: Some("OperatorRealization".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "language".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "target".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "op".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "carrier".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "cost".to_string(), - ty: DeclarationId(87), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 5224, 5355), - }); - declarations.push(Declaration { - id: DeclarationId(993), - name: Some("BehaviorRealization".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "language".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "target".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "carrier".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "cost".to_string(), - ty: DeclarationId(87), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 5357, 5467), - }); - declarations.push(Declaration { - id: DeclarationId(994), - name: Some("CallableRealization".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "language".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "target".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "strategy".to_string(), - ty: DeclarationId(1003), - }, - Field { - label: "parameters".to_string(), - ty: DeclarationId(2295), - }, - Field { - label: "cost".to_string(), - ty: DeclarationId(87), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 5469, 5628), - }); - declarations.push(Declaration { - id: DeclarationId(995), - name: Some("CallableParameter".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "slot".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "disposition".to_string(), - ty: DeclarationId(996), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 6050, 6124), - }); - declarations.push(Declaration { - id: DeclarationId(996), - name: Some("ParameterDisposition".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Borrowed".to_string(), - ty: DeclarationId(2296), - }, - Field { - label: "Consumed".to_string(), - ty: DeclarationId(2297), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 6581, 6632), - }); - declarations.push(Declaration { - id: DeclarationId(997), - name: Some("StringOwnershipAxis".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Owned".to_string(), - ty: DeclarationId(2298), - }, - Field { - label: "Borrowed".to_string(), - ty: DeclarationId(2299), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 7044, 7091), - }); - declarations.push(Declaration { - id: DeclarationId(998), - name: Some("StringLifetimeAxis".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "SelfContained".to_string(), - ty: DeclarationId(2300), - }, - Field { - label: "Caller".to_string(), - ty: DeclarationId(2301), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 7399, 7451), - }); - declarations.push(Declaration { - id: DeclarationId(999), - name: Some("StringGrowabilityAxis".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Growable".to_string(), - ty: DeclarationId(2302), - }, - Field { - label: "Fixed".to_string(), - ty: DeclarationId(2303), - }, - Field { - label: "NotApplicable".to_string(), - ty: DeclarationId(2304), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 7678, 7745), - }); - declarations.push(Declaration { - id: DeclarationId(1000), - name: Some("StringEncodingAxis".to_string()), - connective: TypeConnective::Disj { - variants: vec![Field { - label: "Utf8FreeMonoidChar".to_string(), - ty: DeclarationId(2305), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 8054, 8100), - }); - declarations.push(Declaration { - id: DeclarationId(1001), - name: Some("StringFamilyInhabitanceRow".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "language".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "target_type".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "type_realization".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "ownership".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "lifetime".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "growability".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "encoding".to_string(), - ty: DeclarationId(1353), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 8684, 8923), - }); - declarations.push(Declaration { - id: DeclarationId(1002), - name: Some("TypeInstantiationRealization".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "language".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "target".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "carrier".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "cost".to_string(), - ty: DeclarationId(87), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 8925, 9044), - }); - declarations.push(Declaration { - id: DeclarationId(1003), - name: Some("CallableStrategy".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ListEmpty".to_string(), - ty: DeclarationId(2306), - }, - Field { - label: "ListSingleton".to_string(), - ty: DeclarationId(2307), - }, - Field { - label: "ListCons".to_string(), - ty: DeclarationId(2308), - }, - Field { - label: "ListConcat".to_string(), - ty: DeclarationId(2309), - }, - Field { - label: "ListLength".to_string(), - ty: DeclarationId(2310), - }, - Field { - label: "ListIsEmpty".to_string(), - ty: DeclarationId(2311), - }, - Field { - label: "ListFold".to_string(), - ty: DeclarationId(2312), - }, - Field { - label: "ListMap".to_string(), - ty: DeclarationId(2313), - }, - Field { - label: "ListFilter".to_string(), - ty: DeclarationId(2314), - }, - Field { - label: "ListContains".to_string(), - ty: DeclarationId(2315), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 9449, 9618), - }); - declarations.push(Declaration { - id: DeclarationId(1004), - name: Some("PatternRealization".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "language".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "target".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "strategy".to_string(), - ty: DeclarationId(1005), - }, - Field { - label: "empty_variant".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "cons_variant".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "scrutinee".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "empty_pattern".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "cons_pattern".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "head_expr".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "tail_expr".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "cost".to_string(), - ty: DeclarationId(87), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 11557, 11846), - }); - declarations.push(Declaration { - id: DeclarationId(1005), - name: Some("PatternStrategy".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "PlaceholderPatternStrategy".to_string(), - ty: DeclarationId(2316), - }, - Field { - label: "VectorList".to_string(), - ty: DeclarationId(2317), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 12286, 12352), - }); - declarations.push(Declaration { - id: DeclarationId(1006), - name: Some("StatementSyntax".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "let_binding".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "let_binding_inferred".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 12354, 12431), - }); - declarations.push(Declaration { - id: DeclarationId(1007), - name: Some("ExpressionSyntax".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "field_access".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "function_call".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "closure".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 12433, 12523), - }); - declarations.push(Declaration { - id: DeclarationId(1008), - name: Some("ForEachSyntax".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "prefix".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "separator".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 12525, 12584), - }); - declarations.push(Declaration { - id: DeclarationId(1009), - name: Some("ControlFlowSyntax".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "if_else".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "match_arm".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "for_each_syntax".to_string(), - ty: DeclarationId(1008), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 12586, 12683), - }); - declarations.push(Declaration { - id: DeclarationId(1010), - name: Some("LiteralSyntax".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "true_keyword".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "false_keyword".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "string_delimiter".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 12685, 12781), - }); - declarations.push(Declaration { - id: DeclarationId(1011), - name: Some("ModuleSyntax".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "path_separator".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 12783, 12829), - }); - declarations.push(Declaration { - id: DeclarationId(1012), - name: Some("FunctionSyntax".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "definition".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "definition_exported".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "definition_void".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "param_with_type".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "param_separator".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 12831, 12983), - }); - declarations.push(Declaration { - id: DeclarationId(1013), - name: Some("TypeApplicationSyntax".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "optional".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 12985, 13034), - }); - declarations.push(Declaration { - id: DeclarationId(1014), - name: Some("TypeDefinitionSyntax".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "struct_def".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "struct_field".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "enum_def".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "enum_unit_variant".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "enum_data_variant".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 13248, 13396), - }); - declarations.push(Declaration { - id: DeclarationId(1015), - name: Some("RecordDeriveTemplateBundle".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "struct_def_no_debug".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "enum_def_no_debug".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 14057, 14150), - }); - declarations.push(Declaration { - id: DeclarationId(1016), - name: Some("PatternMatchSyntax".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "match_expr".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "match_arm".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "variant_pattern".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "variant_pattern_positional".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "variant_pattern_empty".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "field_binding".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "field_binding_separator".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "wildcard".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 14854, 15094), - }); - declarations.push(Declaration { - id: DeclarationId(1017), - name: Some("CollectionOps".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "concat_contract".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "length_contract".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "is_empty_contract".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "fold_contract".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "filter_contract".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "flat_map_contract".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "any_contract".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "all_contract".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "map_contract".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "filter".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "contains".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "empty_list".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "list_literal".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "cons".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 15096, 16332), - }); - declarations.push(Declaration { - id: DeclarationId(1018), - name: Some("ValueConstructionSyntax".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "struct_literal".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "struct_field_init".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "struct_field_separator".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "variant_construction".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "variant_named_construction".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 16334, 16520), - }); - declarations.push(Declaration { - id: DeclarationId(1019), - name: Some("RenderingModel".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "read".to_string(), - ty: DeclarationId(1020), - }, - Field { - label: "construct".to_string(), - ty: DeclarationId(1021), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 16522, 16597), - }); - declarations.push(Declaration { - id: DeclarationId(1020), - name: Some("ReadStrategy".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Borrow".to_string(), - ty: DeclarationId(2318), - }, - Field { - label: "PassByValue".to_string(), - ty: DeclarationId(2319), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 17095, 17139), - }); - declarations.push(Declaration { - id: DeclarationId(1021), - name: Some("ConstructStrategy".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "CopyOrClone".to_string(), - ty: DeclarationId(2320), - }, - Field { - label: "PassByValue".to_string(), - ty: DeclarationId(2321), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 17432, 17486), - }); - declarations.push(Declaration { - id: DeclarationId(1022), - name: Some("LanguageSpec".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "statements".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "expressions".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "control_flow".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "literals".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "modules".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "functions".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "type_applications".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "type_definitions".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "record_derive_templates".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "patterns".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "collection_ops".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "values".to_string(), - ty: DeclarationId(1353), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 17488, 18014), - }); - declarations.push(Declaration { - id: DeclarationId(1023), - name: Some("PlaceholderConvention".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "IndexedArgs".to_string(), - ty: DeclarationId(2322), - }, - Field { - label: "NamedArg".to_string(), - ty: DeclarationId(2323), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 19388, 19443), - }); - declarations.push(Declaration { - id: DeclarationId(1024), - name: Some("MethodEmitTemplate".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "SingleTemplate".to_string(), - ty: DeclarationId(2324), - }, - Field { - label: "HigherOrderTemplates".to_string(), - ty: DeclarationId(2325), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 20578, 20734), - }); - declarations.push(Declaration { - id: DeclarationId(1025), - name: Some("MethodTemplateContract".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "dag_method".to_string(), - ty: DeclarationId(852), - }, - Field { - label: "runtime_template".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "emit_template".to_string(), - ty: DeclarationId(1024), - }, - Field { - label: "wraps_result".to_string(), - ty: DeclarationId(124), - }, - Field { - label: "placeholder_convention".to_string(), - ty: DeclarationId(1023), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 22527, 22714), - }); - declarations.push(Declaration { - id: DeclarationId(1026), - name: Some("CleanEmissionContract".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "expression_wrapping".to_string(), - ty: DeclarationId(1028), - }, - Field { - label: "pattern_bindings".to_string(), - ty: DeclarationId(1029), - }, - Field { - label: "variant_payload_field_access".to_string(), - ty: DeclarationId(1030), - }, - Field { - label: "imports".to_string(), - ty: DeclarationId(1031), - }, - Field { - label: "block_return".to_string(), - ty: DeclarationId(1032), - }, - Field { - label: "variable_bindings".to_string(), - ty: DeclarationId(1033), - }, - Field { - label: "match_arm_body".to_string(), - ty: DeclarationId(1034), - }, - Field { - label: "correction_style".to_string(), - ty: DeclarationId(1035), - }, - Field { - label: "post_emit_verifier".to_string(), - ty: DeclarationId(1036), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 562, 944), - }); - declarations.push(Declaration { - id: DeclarationId(1027), - name: Some("TargetCleanEmissionBinding".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "language".to_string(), - ty: DeclarationId(1022), - }, - Field { - label: "clean_emission".to_string(), - ty: DeclarationId(1026), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 1748, 1848), - }); - declarations.push(Declaration { - id: DeclarationId(1028), - name: Some("ExpressionWrappingRule".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "WrapEverything".to_string(), - ty: DeclarationId(2326), - }, - Field { - label: "WrapOnlyInOperandPosition".to_string(), - ty: DeclarationId(2327), - }, - Field { - label: "NoWrapping".to_string(), - ty: DeclarationId(2328), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 2192, 2283), - }); - declarations.push(Declaration { - id: DeclarationId(1029), - name: Some("PatternBindingRule".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "EmitBindingAlways".to_string(), - ty: DeclarationId(2329), - }, - Field { - label: "EmitUnderscoreWhenUnused".to_string(), - ty: DeclarationId(2330), - }, - Field { - label: "EmitPrefixedUnderscoreWhenUnused".to_string(), - ty: DeclarationId(2331), - }, - Field { - label: "NotApplicablePatternBinding".to_string(), - ty: DeclarationId(2332), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 2520, 2663), - }); - declarations.push(Declaration { - id: DeclarationId(1030), - name: Some("VariantPayloadFieldAccessRule".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "AccessFromPayloadBinding".to_string(), - ty: DeclarationId(2333), - }, - Field { - label: "OverrideNamedFieldsAtBindingSite".to_string(), - ty: DeclarationId(2334), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 3330, 3430), - }); - declarations.push(Declaration { - id: DeclarationId(1031), - name: Some("ImportRule".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ImportEverythingDeclared".to_string(), - ty: DeclarationId(2335), - }, - Field { - label: "IncludeOnlyReferenced".to_string(), - ty: DeclarationId(2336), - }, - Field { - label: "ImportPerUsageSite".to_string(), - ty: DeclarationId(2337), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 3544, 3637), - }); - declarations.push(Declaration { - id: DeclarationId(1032), - name: Some("BlockReturnRule".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "WrapReturnValue".to_string(), - ty: DeclarationId(2338), - }, - Field { - label: "NoWrappingOnTerminalExpression".to_string(), - ty: DeclarationId(2339), - }, - Field { - label: "ExplicitReturnKeyword".to_string(), - ty: DeclarationId(2340), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 3756, 3857), - }); - declarations.push(Declaration { - id: DeclarationId(1033), - name: Some("VariableBindingRule".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "EmitLetBindingAlways".to_string(), - ty: DeclarationId(2341), - }, - Field { - label: "EmitLetUnderscoreWhenUnused".to_string(), - ty: DeclarationId(2342), - }, - Field { - label: "OmitLetBinding".to_string(), - ty: DeclarationId(2343), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 3995, 4095), - }); - declarations.push(Declaration { - id: DeclarationId(1034), - name: Some("MatchArmBodyRule".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "WrapBody".to_string(), - ty: DeclarationId(2344), - }, - Field { - label: "NoWrappingOnNonComplexBody".to_string(), - ty: DeclarationId(2345), - }, - Field { - label: "NotApplicableMatchArmBody".to_string(), - ty: DeclarationId(2346), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 4328, 4423), - }); - declarations.push(Declaration { - id: DeclarationId(1035), - name: Some("CorrectionStyle".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "indent_unit".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "line_ending".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "string_quote".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "trailing_semicolon".to_string(), - ty: DeclarationId(124), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 4736, 4854), - }); - declarations.push(Declaration { - id: DeclarationId(1036), - name: Some("PostEmitVerifier".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "command".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "args".to_string(), - ty: DeclarationId(2347), - }, - Field { - label: "syntax_only".to_string(), - ty: DeclarationId(124), - }, - Field { - label: "expected_exit_code".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "output_policy".to_string(), - ty: DeclarationId(1037), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 5270, 5418), - }); - declarations.push(Declaration { - id: DeclarationId(1037), - name: Some("VerifierOutputPolicy".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "IgnoreVerifierOutput".to_string(), - ty: DeclarationId(2348), - }, - Field { - label: "RequireEmptyStdout".to_string(), - ty: DeclarationId(2349), - }, - Field { - label: "RequireEmptyStderr".to_string(), - ty: DeclarationId(2350), - }, - Field { - label: "RequireEmptyStdoutAndStderr".to_string(), - ty: DeclarationId(2351), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 5663, 5791), - }); - declarations.push(Declaration { - id: DeclarationId(1038), - name: Some("ShapeATarget".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1022), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/cross_target_coverage.dag", 2839, 2871), - }); - declarations.push(Declaration { - id: DeclarationId(1039), - name: Some("rust_shape_a_target".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1038), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1038)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Unparsed(SourceSpan::new( - "src/v3/std/cross_target_coverage.dag", - 2914, - 2927, - ))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/cross_target_coverage.dag", 2873, 2927), - }); - declarations.push(Declaration { - id: DeclarationId(1040), - name: Some("python_shape_a_target".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1038), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1038)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Unparsed(SourceSpan::new( - "src/v3/std/cross_target_coverage.dag", - 2971, - 2986, - ))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/cross_target_coverage.dag", 2928, 2986), - }); - declarations.push(Declaration { - id: DeclarationId(1041), - name: Some("go_shape_a_target".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1038), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1038)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Unparsed(SourceSpan::new( - "src/v3/std/cross_target_coverage.dag", - 3026, - 3037, - ))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/cross_target_coverage.dag", 2987, 3037), - }); - declarations.push(Declaration { - id: DeclarationId(1042), - name: Some("FormAxis".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Atom".to_string(), - ty: DeclarationId(2352), - }, - Field { - label: "Conj".to_string(), - ty: DeclarationId(2353), - }, - Field { - label: "Disj".to_string(), - ty: DeclarationId(2354), - }, - Field { - label: "Arrow".to_string(), - ty: DeclarationId(2355), - }, - Field { - label: "Cardinality".to_string(), - ty: DeclarationId(2356), - }, - Field { - label: "Instantiation".to_string(), - ty: DeclarationId(2357), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/cross_target_coverage.dag", 3837, 3909), - }); - declarations.push(Declaration { - id: DeclarationId(1043), - name: Some("BehaviorAxis".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Value".to_string(), - ty: DeclarationId(2358), - }, - Field { - label: "Transform".to_string(), - ty: DeclarationId(2359), - }, - Field { - label: "Branch".to_string(), - ty: DeclarationId(2360), - }, - Field { - label: "Loop".to_string(), - ty: DeclarationId(2361), - }, - Field { - label: "Bind".to_string(), - ty: DeclarationId(2362), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/cross_target_coverage.dag", 4469, 4529), - }); - declarations.push(Declaration { - id: DeclarationId(1044), - name: Some("MethodTemplateContractKey".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "target".to_string(), - ty: DeclarationId(1038), - }, - Field { - label: "dag_method".to_string(), - ty: DeclarationId(852), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/cross_target_coverage.dag", 4913, 4994), - }); - declarations.push(Declaration { - id: DeclarationId(1045), - name: Some("EmissionCell".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "connective".to_string(), - ty: DeclarationId(1042), - }, - Field { - label: "behavior".to_string(), - ty: DeclarationId(1043), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/cross_target_coverage.dag", 5427, 5496), - }); - declarations.push(Declaration { - id: DeclarationId(1046), - name: Some("EmissionPathProjection".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "row_identity".to_string(), - ty: DeclarationId(1044), - }, - Field { - label: "cells".to_string(), - ty: DeclarationId(2363), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/cross_target_coverage.dag", 5842, 5943), - }); - declarations.push(Declaration { - id: DeclarationId(1047), - name: Some("emission_path_projections".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1046), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(2364)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::List(vec![ - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1039)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(255)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2356), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2359), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1039)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(268)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2356), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2359), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1039)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(292)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2356), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2359), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1039)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(270)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2356), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2359), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1039)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(261)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2356), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2359), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1039)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(259)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2356), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2359), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1039)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(249)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2356), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2359), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1039)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(260)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2356), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2359), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1039)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(246)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2356), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2359), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1039)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(245)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2356), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2359), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1039)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(262)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2356), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2359), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1039)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(290)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2356), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2359), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1039)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(296)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2356), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2359), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1040)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(255)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2356), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2359), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1040)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(268)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2356), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2359), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1040)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(292)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2356), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2359), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1040)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(270)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2356), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2359), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1040)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(261)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2356), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2359), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1040)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(259)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2356), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2359), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1040)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(249)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2356), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2359), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1040)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(260)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2356), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2359), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1040)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(246)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2356), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2359), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1040)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(245)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2356), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2359), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1040)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(262)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2356), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2359), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1040)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(290)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2356), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2359), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1040)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(296)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2356), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2359), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1040)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(291)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2356), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2359), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1040)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(247)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2356), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2359), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1040)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(294)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2356), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2359), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1041)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(255)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2356), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2359), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1041)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(268)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2356), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2359), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1041)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(292)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2356), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2359), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1041)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(260)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2356), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2359), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1041)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(246)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2356), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2359), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1041)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(245)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2356), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2359), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1041)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(262)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2356), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2359), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1041)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(290)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2356), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2359), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1041)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(296)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2356), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2359), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1041)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(291)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2356), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2359), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1041)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(247)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2356), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2359), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1041)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(294)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2356), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2359), - payload: vec![], - }, - ), - ])]), - ), - ]), - ])), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/cross_target_coverage.dag", 6364, 12528), - }); - declarations.push(Declaration { - id: DeclarationId(1048), - name: Some("CompilerDiagnosticKind".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "TokenizerError".to_string(), - ty: DeclarationId(2365), - }, - Field { - label: "ParseError".to_string(), - ty: DeclarationId(2366), - }, - Field { - label: "TypeMismatch".to_string(), - ty: DeclarationId(2367), - }, - Field { - label: "ArityMismatch".to_string(), - ty: DeclarationId(2368), - }, - Field { - label: "ResolveError".to_string(), - ty: DeclarationId(2369), - }, - Field { - label: "UnitMismatch".to_string(), - ty: DeclarationId(2370), - }, - Field { - label: "BranchConditionNotBool".to_string(), - ty: DeclarationId(2371), - }, - Field { - label: "MagnitudeOutOfRange".to_string(), - ty: DeclarationId(2372), - }, - Field { - label: "MalformedIntegerRangeFact".to_string(), - ty: DeclarationId(2373), - }, - Field { - label: "NominalOpacityViolation".to_string(), - ty: DeclarationId(2374), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 1067, 1306), - }); - declarations.push(Declaration { - id: DeclarationId(1049), - name: Some("CorrectionWitness".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "description".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - Field { - label: "new_source".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 1517, 1777), - }); - declarations.push(Declaration { - id: DeclarationId(1050), - name: Some("RetirementPlan".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "owner".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "exit_condition".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 1982, 2046), - }); - declarations.push(Declaration { - id: DeclarationId(1051), - name: Some("Correction".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "LiveCorrection".to_string(), - ty: DeclarationId(2375), - }, - Field { - label: "DeferredCorrection".to_string(), - ty: DeclarationId(2376), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 2896, 3036), - }); - declarations.push(Declaration { - id: DeclarationId(1052), - name: Some("DiagnosticKindDecl".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "payload".to_string(), - ty: DeclarationId(789), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 3816, 3879), - }); - declarations.push(Declaration { - id: DeclarationId(1053), - name: Some("LensInstanceKindWitness".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "kind_decl".to_string(), - ty: DeclarationId(1353), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 6081, 6141), - }); - declarations.push(Declaration { - id: DeclarationId(1054), - name: Some("AnyDiagnosticKind".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "CompilerKind".to_string(), - ty: DeclarationId(2377), - }, - Field { - label: "LensInstanceKind".to_string(), - ty: DeclarationId(2378), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 6750, 6859), - }); - declarations.push(Declaration { - id: DeclarationId(1055), - name: Some("Diagnostic".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "kind".to_string(), - ty: DeclarationId(1054), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - Field { - label: "message".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "correction".to_string(), - ty: DeclarationId(1051), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 7228, 7335), - }); - declarations.push(Declaration { - id: DeclarationId(1056), - name: Some("EmissionDiagnostic".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "UnderRefined".to_string(), - ty: DeclarationId(2379), - }, - Field { - label: "NoInhabitant".to_string(), - ty: DeclarationId(2380), - }, - Field { - label: "ContradictoryUse".to_string(), - ty: DeclarationId(2382), - }, - Field { - label: "OutOfR2Scope".to_string(), - ty: DeclarationId(2383), - }, - Field { - label: "LifetimeProgramExtractionPending".to_string(), - ty: DeclarationId(2384), - }, - Field { - label: "FoldNotImplemented".to_string(), - ty: DeclarationId(2385), - }, - Field { - label: "MissingEmissionPath".to_string(), - ty: DeclarationId(2386), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 9969, 12739), - }); - declarations.push(Declaration { - id: DeclarationId(1057), - name: Some("ViolatesSubject".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "AtBehavior".to_string(), - ty: DeclarationId(2401), - }, - Field { - label: "ProducerLookupMissingPort".to_string(), - ty: DeclarationId(2402), - }, - Field { - label: "ProducerLookupMissingNode".to_string(), - ty: DeclarationId(2403), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 2360, 2503), - }); - declarations.push(Declaration { - id: DeclarationId(1058), - name: Some("Witness".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Inhabits".to_string(), - ty: DeclarationId(2404), - }, - Field { - label: "Violates".to_string(), - ty: DeclarationId(2405), - }, - ], - }, - type_params: vec![DeclarationId(1059)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 2505, 2606), - }); - declarations.push(Declaration { - id: DeclarationId(1059), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Carrier".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 2505, 2606), - }); - declarations.push(Declaration { - id: DeclarationId(1060), - name: Some("OptionalDiagnostic".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "NoDiagnostic".to_string(), - ty: DeclarationId(2406), - }, - Field { - label: "SomeDiagnostic".to_string(), - ty: DeclarationId(2407), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 2760, 2841), - }); - declarations.push(Declaration { - id: DeclarationId(1061), - name: Some("DimensionReport".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "DimensionOk".to_string(), - ty: DeclarationId(2410), - }, - Field { - label: "DimensionFail".to_string(), - ty: DeclarationId(2414), - }, - ], - }, - type_params: vec![DeclarationId(1062)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 3200, 3476), - }); - declarations.push(Declaration { - id: DeclarationId(1062), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Carrier".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 3200, 3476), - }); - declarations.push(Declaration { - id: DeclarationId(1063), - name: Some("AnalysisDimension".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "witness_of".to_string(), - ty: DeclarationId(2416), - }, - Field { - label: "compose".to_string(), - ty: DeclarationId(2417), - }, - Field { - label: "break_diagnostic".to_string(), - ty: DeclarationId(2418), - }, - ], - }, - type_params: vec![DeclarationId(1064)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 4727, 4920), - }); - declarations.push(Declaration { - id: DeclarationId(1064), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Carrier".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 4727, 4920), - }); - declarations.push(Declaration { - id: DeclarationId(1065), - name: Some("Dimension".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "value".to_string(), - ty: DeclarationId(1067), - }], - }, - type_params: vec![DeclarationId(1066), DeclarationId(1067)], - phantom_params: vec![PhantomParameter { - parameter: DeclarationId(1066), - algebra: DeclarationId(2419), - }], - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 5561, 5611), - }); - declarations.push(Declaration { - id: DeclarationId(1066), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Unit".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 5561, 5611), - }); - declarations.push(Declaration { - id: DeclarationId(1067), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Carrier".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 5561, 5611), - }); - declarations.push(Declaration { - id: DeclarationId(1068), - name: Some("Meters".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 5613, 5624), - }); - declarations.push(Declaration { - id: DeclarationId(1069), - name: Some("Seconds".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 5625, 5637), - }); - declarations.push(Declaration { - id: DeclarationId(1070), - name: Some("Kilograms".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 5638, 5652), - }); - declarations.push(Declaration { - id: DeclarationId(1071), - name: Some("Amperes".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 5653, 5665), - }); - declarations.push(Declaration { - id: DeclarationId(1072), - name: Some("Kelvin".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 5666, 5677), - }); - declarations.push(Declaration { - id: DeclarationId(1073), - name: Some("Moles".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 5678, 5688), - }); - declarations.push(Declaration { - id: DeclarationId(1074), - name: Some("Candela".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 5689, 5701), - }); - declarations.push(Declaration { - id: DeclarationId(1075), - name: Some("add_dimension".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![ - DeclarationId(2387), - DeclarationId(2388), - DeclarationId(2389), - ], - output: DeclarationId(2390), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/dimensions.dag", 5875, 5897)), - }, - type_params: vec![DeclarationId(1076), DeclarationId(1077)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 5703, 5897), - }); - declarations.push(Declaration { - id: DeclarationId(1076), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Unit".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 5703, 5897), - }); - declarations.push(Declaration { - id: DeclarationId(1077), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Carrier".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 5703, 5897), - }); - declarations.push(Declaration { - id: DeclarationId(1078), - name: Some("sub_dimension".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![ - DeclarationId(2391), - DeclarationId(2392), - DeclarationId(2393), - ], - output: DeclarationId(2394), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/dimensions.dag", 6071, 6093)), - }, - type_params: vec![DeclarationId(1079), DeclarationId(1080)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 5899, 6093), - }); - declarations.push(Declaration { - id: DeclarationId(1079), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Unit".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 5899, 6093), - }); - declarations.push(Declaration { - id: DeclarationId(1080), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Carrier".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 5899, 6093), - }); - declarations.push(Declaration { - id: DeclarationId(1081), - name: Some("mul_dimension_scalar".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![ - DeclarationId(2395), - DeclarationId(2396), - DeclarationId(1083), - ], - output: DeclarationId(2397), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/dimensions.dag", 6259, 6288)), - }, - type_params: vec![DeclarationId(1082), DeclarationId(1083)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 6095, 6288), - }); - declarations.push(Declaration { - id: DeclarationId(1082), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Unit".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 6095, 6288), - }); - declarations.push(Declaration { - id: DeclarationId(1083), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Carrier".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 6095, 6288), - }); - declarations.push(Declaration { - id: DeclarationId(1084), - name: Some("div_dimension_scalar".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![ - DeclarationId(2398), - DeclarationId(2399), - DeclarationId(1086), - ], - output: DeclarationId(2400), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/dimensions.dag", 6454, 6483)), - }, - type_params: vec![DeclarationId(1085), DeclarationId(1086)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 6290, 6483), - }); - declarations.push(Declaration { - id: DeclarationId(1085), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Unit".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 6290, 6483), - }); - declarations.push(Declaration { - id: DeclarationId(1086), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Carrier".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 6290, 6483), - }); - declarations.push(Declaration { - id: DeclarationId(1087), - name: Some("go_language_spec_free_monoid_concat_contract".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1025), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1025)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(253)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String( - "append({left}, {right}...)".to_string(), - )), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2324), - payload: vec![FieldValue::Literal(LiteralBits::String( - "append({left}, {right}...)".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2323), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/go_method_template_contracts.dag", 3213, 3515), - }); - declarations.push(Declaration { - id: DeclarationId(1088), - name: Some("go_language_spec_free_monoid_length_contract".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1025), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1025)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(271)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String("int64(len({recv}))".to_string())), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2324), - payload: vec![FieldValue::Literal(LiteralBits::String( - "int64(len({recv}))".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2323), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/go_method_template_contracts.dag", 3517, 3803), - }); - declarations.push(Declaration { - id: DeclarationId(1089), - name: Some("go_language_spec_free_monoid_emptiness_contract".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1025), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1025)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(267)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String("len({recv}) == 0".to_string())), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2324), - payload: vec![FieldValue::Literal(LiteralBits::String( - "len({recv}) == 0".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2323), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/go_method_template_contracts.dag", 3895, 4182), - }); - declarations.push(Declaration { - id: DeclarationId(1090), - name: Some("go_language_spec_free_monoid_fold_contract".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1025), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1025)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(263)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String( - "/* fold({recv}, {init}, {body}) */".to_string(), - )), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2324), - payload: vec![FieldValue::Literal(LiteralBits::String( - "/* fold({recv}, {init}, {body}) */".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2323), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/go_method_template_contracts.dag", 4617, 4931), - }); - declarations.push(Declaration { - id: DeclarationId(1091), - name: Some("go_language_spec_map_contract".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1025), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1025)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(274)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String( - "/* map({recv}, {body}) */".to_string(), - )), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2324), - payload: vec![FieldValue::Literal(LiteralBits::String( - "/* map({recv}, {body}) */".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2323), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/go_method_template_contracts.dag", 5417, 5699), - }); - declarations.push(Declaration { - id: DeclarationId(1092), - name: Some("go_filter_method_template_contract".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1025), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1025)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(260)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String( - "v2rt.Filter({recv}, {arg})".to_string(), - )), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2324), - payload: vec![FieldValue::Literal(LiteralBits::String( - "v2rt.Filter({recv}, {arg})".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2323), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/go_method_template_contracts.dag", 5701, 5993), - }); - declarations.push(Declaration { - id: DeclarationId(1093), - name: Some("go_any_method_template_contract".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1025), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1025)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(246)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String( - "v2rt.Any({recv}, {arg})".to_string(), - )), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2324), - payload: vec![FieldValue::Literal(LiteralBits::String( - "v2rt.Any({recv}, {arg})".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2323), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/go_method_template_contracts.dag", 5995, 6275), - }); - declarations.push(Declaration { - id: DeclarationId(1094), - name: Some("go_all_method_template_contract".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1025), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1025)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(245)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String( - "v2rt.All({recv}, {arg})".to_string(), - )), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2324), - payload: vec![FieldValue::Literal(LiteralBits::String( - "v2rt.All({recv}, {arg})".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2323), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/go_method_template_contracts.dag", 6277, 6557), - }); - declarations.push(Declaration { - id: DeclarationId(1095), - name: Some("go_flat_map_method_template_contract".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1025), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1025)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(262)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String( - "v2rt.FlatMap({recv}, {arg})".to_string(), - )), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2324), - payload: vec![FieldValue::Literal(LiteralBits::String( - "v2rt.FlatMap({recv}, {arg})".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2323), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/go_method_template_contracts.dag", 6559, 6857), - }); - declarations.push(Declaration { - id: DeclarationId(1096), - name: Some("go_method_template_contracts".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1025), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(2420)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::List(vec![ - FieldValue::Record(vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(255)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String("len({recv})".to_string())), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2324), - payload: vec![FieldValue::Literal(LiteralBits::String( - "len({recv})".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2323), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(268)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String( - "strings.Join({recv}, {arg})".to_string(), - )), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2324), - payload: vec![FieldValue::Literal(LiteralBits::String( - "strings.Join({recv}, {arg})".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2323), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(292)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String( - "strings.Split({recv}, {arg})".to_string(), - )), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2324), - payload: vec![FieldValue::Literal(LiteralBits::String( - "strings.Split({recv}, {arg})".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2323), - payload: vec![], - }, - ), - ]), - FieldValue::Reference(DeclarationId(1092)), - FieldValue::Reference(DeclarationId(1093)), - FieldValue::Reference(DeclarationId(1094)), - FieldValue::Reference(DeclarationId(1095)), - FieldValue::Record(vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(290)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String("{recv}[{arg}:]".to_string())), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2324), - payload: vec![FieldValue::Literal(LiteralBits::String( - "{recv}[{arg}:]".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2323), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(296)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String("{recv}[:{arg}]".to_string())), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2324), - payload: vec![FieldValue::Literal(LiteralBits::String( - "{recv}[:{arg}]".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2323), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(291)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String( - "v2rt.SortBy({recv}, {arg})".to_string(), - )), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2324), - payload: vec![FieldValue::Literal(LiteralBits::String( - "v2rt.SortBy({recv}, {arg})".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2323), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(247)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String( - "append({recv}, {arg})".to_string(), - )), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2324), - payload: vec![FieldValue::Literal(LiteralBits::String( - "append({recv}, {arg})".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2323), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(294)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String( - "strings.Contains({recv}, {arg})".to_string(), - )), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2324), - payload: vec![FieldValue::Literal(LiteralBits::String( - "strings.Contains({recv}, {arg})".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2323), - payload: vec![], - }, - ), - ]), - ])), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/go_method_template_contracts.dag", 6859, 8941), - }); - declarations.push(Declaration { - id: DeclarationId(1097), - name: Some("Lens".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "read".to_string(), - ty: DeclarationId(2422), - }, - Field { - label: "sequential".to_string(), - ty: DeclarationId(2423), - }, - Field { - label: "branch".to_string(), - ty: DeclarationId(2424), - }, - Field { - label: "iterate".to_string(), - ty: DeclarationId(2425), - }, - Field { - label: "validate".to_string(), - ty: DeclarationId(2426), - }, - ], - }, - type_params: vec![DeclarationId(1098)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens.dag", 4121, 4318), - }); - declarations.push(Declaration { - id: DeclarationId(1098), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("C".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens.dag", 4121, 4318), - }); - declarations.push(Declaration { - id: DeclarationId(1099), - name: Some("SectionRef".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "DeclarationScope".to_string(), - ty: DeclarationId(2427), - }, - Field { - label: "NodeScope".to_string(), - ty: DeclarationId(2428), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens_application.dag", 3544, 3677), - }); - declarations.push(Declaration { - id: DeclarationId(1100), - name: Some("DiagnosticSeverity".to_string()), - connective: TypeConnective::Disj { - variants: vec![Field { - label: "Error".to_string(), - ty: DeclarationId(2429), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens_application.dag", 4530, 4561), - }); - declarations.push(Declaration { - id: DeclarationId(1101), - name: Some("LensEnforcement".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "project".to_string(), - ty: DeclarationId(2430), - }, - Field { - label: "violates".to_string(), - ty: DeclarationId(2431), - }, - ], - }, - type_params: vec![ - DeclarationId(1102), - DeclarationId(1103), - DeclarationId(1104), - ], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens_application.dag", 5737, 5862), - }); - declarations.push(Declaration { - id: DeclarationId(1102), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Output".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens_application.dag", 5737, 5862), - }); - declarations.push(Declaration { - id: DeclarationId(1103), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Budget".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens_application.dag", 5737, 5862), - }); - declarations.push(Declaration { - id: DeclarationId(1104), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Projected".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens_application.dag", 5737, 5862), - }); - declarations.push(Declaration { - id: DeclarationId(1105), - name: Some("EnforceableLens".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "lens".to_string(), - ty: DeclarationId(2432), - }, - Field { - label: "enforcement".to_string(), - ty: DeclarationId(2433), - }, - ], - }, - type_params: vec![ - DeclarationId(1106), - DeclarationId(1107), - DeclarationId(1108), - ], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens_application.dag", 7813, 7943), - }); - declarations.push(Declaration { - id: DeclarationId(1106), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Output".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens_application.dag", 7813, 7943), - }); - declarations.push(Declaration { - id: DeclarationId(1107), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Budget".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens_application.dag", 7813, 7943), - }); - declarations.push(Declaration { - id: DeclarationId(1108), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Projected".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens_application.dag", 7813, 7943), - }); - declarations.push(Declaration { - id: DeclarationId(1109), - name: Some("EnforcedApplication".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "enforceable_lens".to_string(), - ty: DeclarationId(2434), - }, - Field { - label: "section".to_string(), - ty: DeclarationId(1099), - }, - Field { - label: "budget".to_string(), - ty: DeclarationId(1111), - }, - Field { - label: "diagnostic_severity".to_string(), - ty: DeclarationId(1100), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - ], - }, - type_params: vec![ - DeclarationId(1110), - DeclarationId(1111), - DeclarationId(1112), - ], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens_application.dag", 9637, 9855), - }); - declarations.push(Declaration { - id: DeclarationId(1110), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Output".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens_application.dag", 9637, 9855), - }); - declarations.push(Declaration { - id: DeclarationId(1111), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Budget".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens_application.dag", 9637, 9855), - }); - declarations.push(Declaration { - id: DeclarationId(1112), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Projected".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens_application.dag", 9637, 9855), - }); - declarations.push(Declaration { - id: DeclarationId(1113), - name: Some("IntrospectApplication".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "lens".to_string(), - ty: DeclarationId(2435), - }, - Field { - label: "section".to_string(), - ty: DeclarationId(1099), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - ], - }, - type_params: vec![DeclarationId(1114)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens_application.dag", 10728, 10828), - }); - declarations.push(Declaration { - id: DeclarationId(1114), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Output".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens_application.dag", 10728, 10828), - }); - declarations.push(Declaration { - id: DeclarationId(1115), - name: Some("DagDifference".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "detail".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 684, 723), - }); - declarations.push(Declaration { - id: DeclarationId(1116), - name: Some("SurfaceModule".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "items".to_string(), - ty: DeclarationId(2436), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 1149, 1198), - }); - declarations.push(Declaration { - id: DeclarationId(1117), - name: Some("SurfaceParam".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "ty".to_string(), - ty: DeclarationId(1122), - }, - Field { - label: "refinement".to_string(), - ty: DeclarationId(2437), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 1200, 1281), - }); - declarations.push(Declaration { - id: DeclarationId(1118), - name: Some("SurfaceField".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "ty".to_string(), - ty: DeclarationId(1122), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 1283, 1337), - }); - declarations.push(Declaration { - id: DeclarationId(1119), - name: Some("SurfaceVariant".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "payload".to_string(), - ty: DeclarationId(1120), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 1339, 1422), - }); - declarations.push(Declaration { - id: DeclarationId(1120), - name: Some("VariantPayload".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Positional".to_string(), - ty: DeclarationId(2439), - }, - Field { - label: "Record".to_string(), - ty: DeclarationId(2441), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 1712, 1796), - }); - declarations.push(Declaration { - id: DeclarationId(1121), - name: Some("TypeAngleArg".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "TypeExpr".to_string(), - ty: DeclarationId(2442), - }, - Field { - label: "WidthNatLiteral".to_string(), - ty: DeclarationId(2443), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 2067, 2175), - }); - declarations.push(Declaration { - id: DeclarationId(1122), - name: Some("SurfaceType".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Named".to_string(), - ty: DeclarationId(2444), - }, - Field { - label: "Parameterized".to_string(), - ty: DeclarationId(2446), - }, - Field { - label: "Optional".to_string(), - ty: DeclarationId(2447), - }, - Field { - label: "Arrow".to_string(), - ty: DeclarationId(2449), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 2431, 2759), - }); - declarations.push(Declaration { - id: DeclarationId(1123), - name: Some("SurfaceRecordField".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "value".to_string(), - ty: DeclarationId(1129), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 2761, 2843), - }); - declarations.push(Declaration { - id: DeclarationId(1124), - name: Some("SurfaceMapEntry".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "key".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "key_span".to_string(), - ty: DeclarationId(155), - }, - Field { - label: "value".to_string(), - ty: DeclarationId(1129), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 3733, 3834), - }); - declarations.push(Declaration { - id: DeclarationId(1125), - name: Some("SurfaceMatchArm".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "pattern".to_string(), - ty: DeclarationId(1127), - }, - Field { - label: "body".to_string(), - ty: DeclarationId(1129), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 3836, 3925), - }); - declarations.push(Declaration { - id: DeclarationId(1126), - name: Some("SurfacePatternField".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "binding".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 3927, 4007), - }); - declarations.push(Declaration { - id: DeclarationId(1127), - name: Some("SurfacePattern".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "BareVariant".to_string(), - ty: DeclarationId(2450), - }, - Field { - label: "VariantWith".to_string(), - ty: DeclarationId(2451), - }, - Field { - label: "VariantFields".to_string(), - ty: DeclarationId(2453), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 4105, 4371), - }); - declarations.push(Declaration { - id: DeclarationId(1128), - name: Some("SurfaceLiteral".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Int".to_string(), - ty: DeclarationId(2454), - }, - Field { - label: "Bool".to_string(), - ty: DeclarationId(2455), - }, - Field { - label: "String".to_string(), - ty: DeclarationId(2456), - }, - Field { - label: "Symbol".to_string(), - ty: DeclarationId(2457), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 5122, 5210), - }); - declarations.push(Declaration { - id: DeclarationId(1129), - name: Some("SurfaceExpr".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Literal".to_string(), - ty: DeclarationId(2458), - }, - Field { - label: "Var".to_string(), - ty: DeclarationId(2459), - }, - Field { - label: "Path".to_string(), - ty: DeclarationId(2462), - }, - Field { - label: "Call".to_string(), - ty: DeclarationId(2464), - }, - Field { - label: "PathCall".to_string(), - ty: DeclarationId(2468), - }, - Field { - label: "VariantRecord".to_string(), - ty: DeclarationId(2470), - }, - Field { - label: "Operator".to_string(), - ty: DeclarationId(2472), - }, - Field { - label: "Lambda".to_string(), - ty: DeclarationId(2474), - }, - Field { - label: "If".to_string(), - ty: DeclarationId(2475), - }, - Field { - label: "Match".to_string(), - ty: DeclarationId(2477), - }, - Field { - label: "Record".to_string(), - ty: DeclarationId(2479), - }, - Field { - label: "List".to_string(), - ty: DeclarationId(2481), - }, - Field { - label: "Map".to_string(), - ty: DeclarationId(2483), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 5303, 9122), - }); - declarations.push(Declaration { - id: DeclarationId(1130), - name: Some("SurfaceItem".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Let".to_string(), - ty: DeclarationId(2485), - }, - Field { - label: "Fn".to_string(), - ty: DeclarationId(2488), - }, - Field { - label: "FnExternalBody".to_string(), - ty: DeclarationId(2491), - }, - Field { - label: "Data".to_string(), - ty: DeclarationId(2493), - }, - Field { - label: "Module".to_string(), - ty: DeclarationId(2495), - }, - Field { - label: "Import".to_string(), - ty: DeclarationId(2498), - }, - Field { - label: "TypeAtom".to_string(), - ty: DeclarationId(2500), - }, - Field { - label: "TypeRecord".to_string(), - ty: DeclarationId(2503), - }, - Field { - label: "TypeSum".to_string(), - ty: DeclarationId(2507), - }, - Field { - label: "TypeAlias".to_string(), - ty: DeclarationId(2510), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 9991, 11309), - }); - declarations.push(Declaration { - id: DeclarationId(1131), - name: Some("python_language_spec_free_monoid_concat_contract".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1025), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1025)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(253)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String("[*{left}, *{right}]".to_string())), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2324), - payload: vec![FieldValue::Literal(LiteralBits::String( - "[*{left}, *{right}]".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2323), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new( - "src/v3/std/python_method_template_contracts.dag", - 3320, - 3612, - ), - }); - declarations.push(Declaration { - id: DeclarationId(1132), - name: Some("python_language_spec_free_monoid_length_contract".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1025), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1025)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(271)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String("len({recv})".to_string())), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2324), - payload: vec![FieldValue::Literal(LiteralBits::String( - "len({recv})".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2323), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new( - "src/v3/std/python_method_template_contracts.dag", - 3614, - 3890, - ), - }); - declarations.push(Declaration { - id: DeclarationId(1133), - name: Some("python_language_spec_free_monoid_emptiness_contract".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1025), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1025)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(267)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String("(len({recv}) == 0)".to_string())), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2324), - payload: vec![FieldValue::Literal(LiteralBits::String( - "(len({recv}) == 0)".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2323), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new( - "src/v3/std/python_method_template_contracts.dag", - 3997, - 4292, - ), - }); - declarations.push(Declaration { - id: DeclarationId(1134), - name: Some("python_language_spec_free_monoid_fold_contract".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1025), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1025)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(263)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String( - "__v3_fold({recv}, {init}, {body})".to_string(), - )), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2324), - payload: vec![FieldValue::Literal(LiteralBits::String( - "__v3_fold({recv}, {init}, {body})".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2323), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new( - "src/v3/std/python_method_template_contracts.dag", - 4665, - 4981, - ), - }); - declarations.push(Declaration { - id: DeclarationId(1135), - name: Some("python_language_spec_map_contract".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1025), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1025)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(274)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String( - "[{body} for {item} in {recv}]".to_string(), - )), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2324), - payload: vec![FieldValue::Literal(LiteralBits::String( - "[{body} for {item} in {recv}]".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2323), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new( - "src/v3/std/python_method_template_contracts.dag", - 5189, - 5483, - ), - }); - declarations.push(Declaration { - id: DeclarationId(1136), - name: Some("python_filter_method_template_contract".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1025), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1025)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(260)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String( - "[x for x in {recv} if {arg}(x)]".to_string(), - )), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2324), - payload: vec![FieldValue::Literal(LiteralBits::String( - "[x for x in {recv} if {arg}(x)]".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2323), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new( - "src/v3/std/python_method_template_contracts.dag", - 5485, - 5791, - ), - }); - declarations.push(Declaration { - id: DeclarationId(1137), - name: Some("python_any_method_template_contract".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1025), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1025)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(246)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String( - "any({arg}(x) for x in {recv})".to_string(), - )), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2324), - payload: vec![FieldValue::Literal(LiteralBits::String( - "any({arg}(x) for x in {recv})".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2323), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new( - "src/v3/std/python_method_template_contracts.dag", - 5793, - 6089, - ), - }); - declarations.push(Declaration { - id: DeclarationId(1138), - name: Some("python_all_method_template_contract".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1025), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1025)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(245)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String( - "all({arg}(x) for x in {recv})".to_string(), - )), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2324), - payload: vec![FieldValue::Literal(LiteralBits::String( - "all({arg}(x) for x in {recv})".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2323), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new( - "src/v3/std/python_method_template_contracts.dag", - 6091, - 6387, - ), - }); - declarations.push(Declaration { - id: DeclarationId(1139), - name: Some("python_flat_map_method_template_contract".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1025), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1025)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(262)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String( - "[y for x in {recv} for y in {arg}(x)]".to_string(), - )), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2324), - payload: vec![FieldValue::Literal(LiteralBits::String( - "[y for x in {recv} for y in {arg}(x)]".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2323), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new( - "src/v3/std/python_method_template_contracts.dag", - 6389, - 6711, - ), - }); - declarations.push(Declaration { - id: DeclarationId(1140), - name: Some("python_method_template_contracts".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1025), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(2511)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::List(vec![ - FieldValue::Record(vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(255)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String("len({recv})".to_string())), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2324), - payload: vec![FieldValue::Literal(LiteralBits::String( - "len({recv})".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2323), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(268)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String("{arg}.join({recv})".to_string())), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2324), - payload: vec![FieldValue::Literal(LiteralBits::String( - "{arg}.join({recv})".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2323), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(292)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String("{recv}.split({arg})".to_string())), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2324), - payload: vec![FieldValue::Literal(LiteralBits::String( - "{recv}.split({arg})".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2323), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(270)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String( - "{recv}[-1] if {recv} else None".to_string(), - )), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2324), - payload: vec![FieldValue::Literal(LiteralBits::String( - "{recv}[-1] if {recv} else None".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2323), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(261)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String( - "{recv}[0] if {recv} else None".to_string(), - )), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2324), - payload: vec![FieldValue::Literal(LiteralBits::String( - "{recv}[0] if {recv} else None".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2323), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(259)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String( - "list(enumerate({recv}))".to_string(), - )), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2324), - payload: vec![FieldValue::Literal(LiteralBits::String( - "list(enumerate({recv}))".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2323), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(249)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String( - "[ord(c) for c in {recv}]".to_string(), - )), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2324), - payload: vec![FieldValue::Literal(LiteralBits::String( - "[ord(c) for c in {recv}]".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2323), - payload: vec![], - }, - ), - ]), - FieldValue::Reference(DeclarationId(1136)), - FieldValue::Reference(DeclarationId(1137)), - FieldValue::Reference(DeclarationId(1138)), - FieldValue::Reference(DeclarationId(1139)), - FieldValue::Record(vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(290)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String("{recv}[{arg}:]".to_string())), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2324), - payload: vec![FieldValue::Literal(LiteralBits::String( - "{recv}[{arg}:]".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2323), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(296)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String("{recv}[:{arg}]".to_string())), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2324), - payload: vec![FieldValue::Literal(LiteralBits::String( - "{recv}[:{arg}]".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2323), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(291)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String( - "sorted({recv}, key={arg})".to_string(), - )), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2324), - payload: vec![FieldValue::Literal(LiteralBits::String( - "sorted({recv}, key={arg})".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2323), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(247)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String("{recv} + [{arg}]".to_string())), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2324), - payload: vec![FieldValue::Literal(LiteralBits::String( - "{recv} + [{arg}]".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2323), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(294)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String("{arg} in {recv}".to_string())), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2324), - payload: vec![FieldValue::Literal(LiteralBits::String( - "{arg} in {recv}".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2323), - payload: vec![], - }, - ), - ]), - ])), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new( - "src/v3/std/python_method_template_contracts.dag", - 6713, - 9706, - ), - }); - declarations.push(Declaration { - id: DeclarationId(1141), - name: Some("NamedField".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "label".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "value".to_string(), - ty: DeclarationId(1142), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/runtime.dag", 760, 810), - }); - declarations.push(Declaration { - id: DeclarationId(1142), - name: Some("Value".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "LiteralValue".to_string(), - ty: DeclarationId(2513), - }, - Field { - label: "RecordValue".to_string(), - ty: DeclarationId(2515), - }, - Field { - label: "VariantValue".to_string(), - ty: DeclarationId(2516), - }, - Field { - label: "NodeRef".to_string(), - ty: DeclarationId(2517), - }, - Field { - label: "CardinalityValue".to_string(), - ty: DeclarationId(2518), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/runtime.dag", 2122, 2304), - }); - declarations.push(Declaration { - id: DeclarationId(1143), - name: Some("ProgramObservation".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "observed".to_string(), - ty: DeclarationId(1144), - }], - }, - type_params: vec![DeclarationId(1144)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/runtime.dag", 3208, 3264), - }); - declarations.push(Declaration { - id: DeclarationId(1144), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Carrier".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/runtime.dag", 3208, 3264), - }); - declarations.push(Declaration { - id: DeclarationId(1145), - name: Some("EvalFrame".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "bindings".to_string(), - ty: DeclarationId(2519), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/runtime.dag", 3907, 3956), - }); - declarations.push(Declaration { - id: DeclarationId(1146), - name: Some("EvalStateStack".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "frames".to_string(), - ty: DeclarationId(2520), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/runtime.dag", 4510, 4559), - }); - declarations.push(Declaration { - id: DeclarationId(1147), - name: Some("EvalStateKey".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "state".to_string(), - ty: DeclarationId(1146), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/runtime.dag", 4940, 4985), - }); - declarations.push(Declaration { - id: DeclarationId(1148), - name: Some("EvalStrategy".to_string()), - connective: TypeConnective::Disj { - variants: vec![Field { - label: "ApplicativeOrder".to_string(), - ty: DeclarationId(2521), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/runtime.dag", 5368, 5442), - }); - declarations.push(Declaration { - id: DeclarationId(1149), - name: Some("InputEvaluationOrder".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "LeftFirst".to_string(), - ty: DeclarationId(2522), - }, - Field { - label: "RightFirst".to_string(), - ty: DeclarationId(2523), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/runtime.dag", 5654, 5704), - }); - declarations.push(Declaration { - id: DeclarationId(1150), - name: Some("EvalMemoKey".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "program".to_string(), - ty: DeclarationId(737), - }, - Field { - label: "node".to_string(), - ty: DeclarationId(735), - }, - Field { - label: "state_key".to_string(), - ty: DeclarationId(1147), - }, - Field { - label: "strategy".to_string(), - ty: DeclarationId(1148), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/runtime.dag", 6013, 6124), - }); - declarations.push(Declaration { - id: DeclarationId(1151), - name: Some("evaluate".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839), DeclarationId(735), DeclarationId(2512)], - output: DeclarationId(1142), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/runtime.dag", 11260, 11279)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/runtime.dag", 11191, 11279), - }); - declarations.push(Declaration { id: DeclarationId(1152), name: Some("rust_filter_method_template_contract".to_string()), connective: TypeConnective::Instantiation { template: DeclarationId(1025), arguments: vec![] }, type_params: vec![], phantom_params: Vec::new(), meta_tag: Some(DeclarationId(1025)), specialization_parent: None, inhabits: None, value_body: Some(ValueBody::Structural { fields: vec![("dag_method".to_string(), FieldValue::Record(vec![("decl".to_string(), FieldValue::Reference(DeclarationId(260)))])), ("runtime_template".to_string(), FieldValue::Literal(LiteralBits::String("{ let __filter_source = {iter}; let mut __result = Vec::new(); for {param} in __filter_source.iter() { if {body} { __result.push((*{param}).clone()); } } __result }".to_string()))), ("emit_template".to_string(), FieldValue::Variant { constructor: DeclarationId(2325), payload: vec![FieldValue::Literal(LiteralBits::String("{ let __filter_source = {iter}; let mut __result = Vec::new(); for {param} in __filter_source.iter() { if {body} { __result.push((*{param}).clone()); } } __result }".to_string())), FieldValue::Literal(LiteralBits::String("{iter}.filter({arg}).collect::>()".to_string()))] }), ("wraps_result".to_string(), FieldValue::Literal(LiteralBits::Bool(true))), ("placeholder_convention".to_string(), FieldValue::Variant { constructor: DeclarationId(2323), payload: vec![] })] }), refinement: None, nominal_opacity: None, span: SourceSpan::new("src/v3/std/rust_method_template_contracts.dag", 3555, 4208) }); - declarations.push(Declaration { id: DeclarationId(1153), name: Some("rust_any_method_template_contract".to_string()), connective: TypeConnective::Instantiation { template: DeclarationId(1025), arguments: vec![] }, type_params: vec![], phantom_params: Vec::new(), meta_tag: Some(DeclarationId(1025)), specialization_parent: None, inhabits: None, value_body: Some(ValueBody::Structural { fields: vec![("dag_method".to_string(), FieldValue::Record(vec![("decl".to_string(), FieldValue::Reference(DeclarationId(246)))])), ("runtime_template".to_string(), FieldValue::Literal(LiteralBits::String("{ let mut __found = false; for {param} in {iter} { if {body} { __found = true; break; } } __found }".to_string()))), ("emit_template".to_string(), FieldValue::Variant { constructor: DeclarationId(2325), payload: vec![FieldValue::Literal(LiteralBits::String("{ let mut __found = false; for {param} in {iter} { if {body} { __found = true; break; } } __found }".to_string())), FieldValue::Literal(LiteralBits::String("{iter}.any({arg})".to_string()))] }), ("wraps_result".to_string(), FieldValue::Literal(LiteralBits::Bool(false))), ("placeholder_convention".to_string(), FieldValue::Variant { constructor: DeclarationId(2323), payload: vec![] })] }), refinement: None, nominal_opacity: None, span: SourceSpan::new("src/v3/std/rust_method_template_contracts.dag", 4210, 4705) }); - declarations.push(Declaration { id: DeclarationId(1154), name: Some("rust_all_method_template_contract".to_string()), connective: TypeConnective::Instantiation { template: DeclarationId(1025), arguments: vec![] }, type_params: vec![], phantom_params: Vec::new(), meta_tag: Some(DeclarationId(1025)), specialization_parent: None, inhabits: None, value_body: Some(ValueBody::Structural { fields: vec![("dag_method".to_string(), FieldValue::Record(vec![("decl".to_string(), FieldValue::Reference(DeclarationId(245)))])), ("runtime_template".to_string(), FieldValue::Literal(LiteralBits::String("{ let mut __all = true; for {param} in {iter} { if !({body}) { __all = false; break; } } __all }".to_string()))), ("emit_template".to_string(), FieldValue::Variant { constructor: DeclarationId(2325), payload: vec![FieldValue::Literal(LiteralBits::String("{ let mut __all = true; for {param} in {iter} { if !({body}) { __all = false; break; } } __all }".to_string())), FieldValue::Literal(LiteralBits::String("{iter}.all({arg})".to_string()))] }), ("wraps_result".to_string(), FieldValue::Literal(LiteralBits::Bool(false))), ("placeholder_convention".to_string(), FieldValue::Variant { constructor: DeclarationId(2323), payload: vec![] })] }), refinement: None, nominal_opacity: None, span: SourceSpan::new("src/v3/std/rust_method_template_contracts.dag", 4707, 5196) }); - declarations.push(Declaration { id: DeclarationId(1155), name: Some("rust_flat_map_method_template_contract".to_string()), connective: TypeConnective::Instantiation { template: DeclarationId(1025), arguments: vec![] }, type_params: vec![], phantom_params: Vec::new(), meta_tag: Some(DeclarationId(1025)), specialization_parent: None, inhabits: None, value_body: Some(ValueBody::Structural { fields: vec![("dag_method".to_string(), FieldValue::Record(vec![("decl".to_string(), FieldValue::Reference(DeclarationId(262)))])), ("runtime_template".to_string(), FieldValue::Literal(LiteralBits::String("{ let mut __result = Vec::new(); for {param} in {iter} { __result.extend({inner_iter}); } __result }".to_string()))), ("emit_template".to_string(), FieldValue::Variant { constructor: DeclarationId(2325), payload: vec![FieldValue::Literal(LiteralBits::String("{ let mut __result = Vec::new(); for {param} in {iter} { __result.extend({inner_iter}); } __result }".to_string())), FieldValue::Literal(LiteralBits::String("{iter}.flat_map({arg}).collect::>()".to_string()))] }), ("wraps_result".to_string(), FieldValue::Literal(LiteralBits::Bool(true))), ("placeholder_convention".to_string(), FieldValue::Variant { constructor: DeclarationId(2323), payload: vec![] })] }), refinement: None, nominal_opacity: None, span: SourceSpan::new("src/v3/std/rust_method_template_contracts.dag", 5198, 5729) }); - declarations.push(Declaration { id: DeclarationId(1156), name: Some("rust_method_template_contracts".to_string()), connective: TypeConnective::Instantiation { template: DeclarationId(699), arguments: vec![TemplateArgument { parameter: DeclarationId(700), value: DeclarationId(1025) }] }, type_params: vec![], phantom_params: Vec::new(), meta_tag: Some(DeclarationId(2524)), specialization_parent: None, inhabits: None, value_body: Some(ValueBody::List(vec![FieldValue::Record(vec![("dag_method".to_string(), FieldValue::Record(vec![("decl".to_string(), FieldValue::Reference(DeclarationId(255)))])), ("runtime_template".to_string(), FieldValue::Literal(LiteralBits::String("{recv}.len()".to_string()))), ("emit_template".to_string(), FieldValue::Variant { constructor: DeclarationId(2324), payload: vec![FieldValue::Literal(LiteralBits::String("({recv}.len() as i64)".to_string()))] }), ("wraps_result".to_string(), FieldValue::Literal(LiteralBits::Bool(false))), ("placeholder_convention".to_string(), FieldValue::Variant { constructor: DeclarationId(2323), payload: vec![] })]), FieldValue::Record(vec![("dag_method".to_string(), FieldValue::Record(vec![("decl".to_string(), FieldValue::Reference(DeclarationId(268)))])), ("runtime_template".to_string(), FieldValue::Literal(LiteralBits::String("{recv}.join(&{arg})".to_string()))), ("emit_template".to_string(), FieldValue::Variant { constructor: DeclarationId(2324), payload: vec![FieldValue::Literal(LiteralBits::String("{recv}.join(&{arg})".to_string()))] }), ("wraps_result".to_string(), FieldValue::Literal(LiteralBits::Bool(false))), ("placeholder_convention".to_string(), FieldValue::Variant { constructor: DeclarationId(2323), payload: vec![] })]), FieldValue::Record(vec![("dag_method".to_string(), FieldValue::Record(vec![("decl".to_string(), FieldValue::Reference(DeclarationId(292)))])), ("runtime_template".to_string(), FieldValue::Literal(LiteralBits::String("{recv}.split(&{arg}).map(|s| s.to_string()).collect::>()".to_string()))), ("emit_template".to_string(), FieldValue::Variant { constructor: DeclarationId(2324), payload: vec![FieldValue::Literal(LiteralBits::String("{recv}.split(&{arg}).map(|s| s.to_string()).collect::>()".to_string()))] }), ("wraps_result".to_string(), FieldValue::Literal(LiteralBits::Bool(true))), ("placeholder_convention".to_string(), FieldValue::Variant { constructor: DeclarationId(2323), payload: vec![] })]), FieldValue::Record(vec![("dag_method".to_string(), FieldValue::Record(vec![("decl".to_string(), FieldValue::Reference(DeclarationId(270)))])), ("runtime_template".to_string(), FieldValue::Literal(LiteralBits::String("{recv}.last().cloned()".to_string()))), ("emit_template".to_string(), FieldValue::Variant { constructor: DeclarationId(2324), payload: vec![FieldValue::Literal(LiteralBits::String("{recv}.last().cloned()".to_string()))] }), ("wraps_result".to_string(), FieldValue::Literal(LiteralBits::Bool(false))), ("placeholder_convention".to_string(), FieldValue::Variant { constructor: DeclarationId(2323), payload: vec![] })]), FieldValue::Record(vec![("dag_method".to_string(), FieldValue::Record(vec![("decl".to_string(), FieldValue::Reference(DeclarationId(261)))])), ("runtime_template".to_string(), FieldValue::Literal(LiteralBits::String("{recv}.first().cloned()".to_string()))), ("emit_template".to_string(), FieldValue::Variant { constructor: DeclarationId(2324), payload: vec![FieldValue::Literal(LiteralBits::String("{recv}.first().cloned()".to_string()))] }), ("wraps_result".to_string(), FieldValue::Literal(LiteralBits::Bool(false))), ("placeholder_convention".to_string(), FieldValue::Variant { constructor: DeclarationId(2323), payload: vec![] })]), FieldValue::Record(vec![("dag_method".to_string(), FieldValue::Record(vec![("decl".to_string(), FieldValue::Reference(DeclarationId(259)))])), ("runtime_template".to_string(), FieldValue::Literal(LiteralBits::String("{recv}.iter().enumerate().map(|(i, v)| (i, v.clone())).collect::>()".to_string()))), ("emit_template".to_string(), FieldValue::Variant { constructor: DeclarationId(2324), payload: vec![FieldValue::Literal(LiteralBits::String("{recv}.iter().cloned().enumerate().map(|(i, v)| (i as i64, v)).collect::>()".to_string()))] }), ("wraps_result".to_string(), FieldValue::Literal(LiteralBits::Bool(true))), ("placeholder_convention".to_string(), FieldValue::Variant { constructor: DeclarationId(2323), payload: vec![] })]), FieldValue::Record(vec![("dag_method".to_string(), FieldValue::Record(vec![("decl".to_string(), FieldValue::Reference(DeclarationId(249)))])), ("runtime_template".to_string(), FieldValue::Literal(LiteralBits::String("{recv}.chars().map(|c| c as i64).collect::>()".to_string()))), ("emit_template".to_string(), FieldValue::Variant { constructor: DeclarationId(2324), payload: vec![FieldValue::Literal(LiteralBits::String("{recv}.chars().map(|c| c as i64).collect::>()".to_string()))] }), ("wraps_result".to_string(), FieldValue::Literal(LiteralBits::Bool(true))), ("placeholder_convention".to_string(), FieldValue::Variant { constructor: DeclarationId(2323), payload: vec![] })]), FieldValue::Reference(DeclarationId(1152)), FieldValue::Reference(DeclarationId(1153)), FieldValue::Reference(DeclarationId(1154)), FieldValue::Reference(DeclarationId(1155)), FieldValue::Record(vec![("dag_method".to_string(), FieldValue::Record(vec![("decl".to_string(), FieldValue::Reference(DeclarationId(290)))])), ("runtime_template".to_string(), FieldValue::Literal(LiteralBits::String("{recv}.iter().cloned().skip({arg} as usize).collect::>()".to_string()))), ("emit_template".to_string(), FieldValue::Variant { constructor: DeclarationId(2324), payload: vec![FieldValue::Literal(LiteralBits::String("{recv}.iter().cloned().skip({arg} as usize).collect::>()".to_string()))] }), ("wraps_result".to_string(), FieldValue::Literal(LiteralBits::Bool(true))), ("placeholder_convention".to_string(), FieldValue::Variant { constructor: DeclarationId(2323), payload: vec![] })]), FieldValue::Record(vec![("dag_method".to_string(), FieldValue::Record(vec![("decl".to_string(), FieldValue::Reference(DeclarationId(296)))])), ("runtime_template".to_string(), FieldValue::Literal(LiteralBits::String("{recv}.iter().cloned().take({arg} as usize).collect::>()".to_string()))), ("emit_template".to_string(), FieldValue::Variant { constructor: DeclarationId(2324), payload: vec![FieldValue::Literal(LiteralBits::String("{recv}.iter().cloned().take({arg} as usize).collect::>()".to_string()))] }), ("wraps_result".to_string(), FieldValue::Literal(LiteralBits::Bool(true))), ("placeholder_convention".to_string(), FieldValue::Variant { constructor: DeclarationId(2323), payload: vec![] })])])), refinement: None, nominal_opacity: None, span: SourceSpan::new("src/v3/std/rust_method_template_contracts.dag", 5732, 8453) }); - declarations.push(Declaration { - id: DeclarationId(1157), - name: Some("DescentEvidence".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Strict".to_string(), - ty: DeclarationId(2533), - }, - Field { - label: "NonIncreasing".to_string(), - ty: DeclarationId(2534), - }, - Field { - label: "DescentUnknown".to_string(), - ty: DeclarationId(2535), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 742, 810), - }); - declarations.push(Declaration { - id: DeclarationId(1158), - name: Some("evidence_rank".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1157)], - output: DeclarationId(87), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/termination.dag", 856, 938)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 812, 938), - }); - declarations.push(Declaration { - id: DeclarationId(1159), - name: Some("merge_evidence".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1157), DeclarationId(1157)], - output: DeclarationId(1157), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/termination.dag", - 1082, - 1410, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 1005, 1410), - }); - declarations.push(Declaration { - id: DeclarationId(1160), - name: Some("join_evidence".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1157), DeclarationId(1157)], - output: DeclarationId(1157), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/termination.dag", - 1556, - 1755, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 1480, 1755), - }); - declarations.push(Declaration { - id: DeclarationId(1161), - name: Some("promote_to_strict".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1157)], - output: DeclarationId(1157), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/termination.dag", - 2217, - 2336, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 2150, 2336), - }); - declarations.push(Declaration { - id: DeclarationId(1162), - name: Some("optional_evidence_meet".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(2525), DeclarationId(2526)], - output: DeclarationId(2527), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/termination.dag", - 2488, - 2664, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 2400, 2664), - }); - declarations.push(Declaration { - id: DeclarationId(1163), - name: Some("map_evidence_merge_at".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(2528), DeclarationId(227), DeclarationId(1157)], - output: DeclarationId(2529), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/termination.dag", - 2833, - 3007, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 2701, 3007), - }); - declarations.push(Declaration { - id: DeclarationId(1164), - name: Some("RankingDimension".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "TreeSize".to_string(), - ty: DeclarationId(2536), - }, - Field { - label: "ListLength".to_string(), - ty: DeclarationId(2537), - }, - Field { - label: "ArithmeticValue".to_string(), - ty: DeclarationId(2538), - }, - Field { - label: "TokenPosition".to_string(), - ty: DeclarationId(2539), - }, - Field { - label: "SetCardinality".to_string(), - ty: DeclarationId(2540), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 3306, 3502), - }); - declarations.push(Declaration { - id: DeclarationId(1165), - name: Some("PositiveDescentAmount".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "OneStep".to_string(), - ty: DeclarationId(2541), - }, - Field { - label: "AdditionalStep".to_string(), - ty: DeclarationId(2542), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 4478, 4571), - }); - declarations.push(Declaration { - id: DeclarationId(1166), - name: Some("positive_descent_count".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1165)], - output: DeclarationId(87), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/termination.dag", - 4881, - 4989, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 4818, 4989), - }); - declarations.push(Declaration { - id: DeclarationId(1167), - name: Some("ProportionalDivisor".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "DivideByTwo".to_string(), - ty: DeclarationId(2543), - }, - Field { - label: "StrictlyLarger".to_string(), - ty: DeclarationId(2544), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 5455, 5545), - }); - declarations.push(Declaration { - id: DeclarationId(1168), - name: Some("proportional_divisor_to_int".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1167)], - output: DeclarationId(87), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/termination.dag", - 5609, - 5722, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 5547, 5722), - }); - declarations.push(Declaration { - id: DeclarationId(1169), - name: Some("peano_literal_materialization_cap".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(87), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/termination.dag", - 5952, - 5959, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 5906, 5959), - }); - declarations.push(Declaration { - id: DeclarationId(1170), - name: Some("positive_descent_amount_from_positive_int".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87)], - output: DeclarationId(2530), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/termination.dag", - 6420, - 6780, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 6341, 6780), - }); - declarations.push(Declaration { - id: DeclarationId(1171), - name: Some("proportional_divisor_from_int_at_least_two".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87)], - output: DeclarationId(2531), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/termination.dag", - 6860, - 7221, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 6782, 7221), - }); - declarations.push(Declaration { - id: DeclarationId(1172), - name: Some("DescentSource".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ChildAccessor".to_string(), - ty: DeclarationId(2545), - }, - Field { - label: "ListShrink".to_string(), - ty: DeclarationId(2546), - }, - Field { - label: "ArithmeticSubtractDescent".to_string(), - ty: DeclarationId(2547), - }, - Field { - label: "ArithmeticDivideDescent".to_string(), - ty: DeclarationId(2548), - }, - Field { - label: "ParserAdvance".to_string(), - ty: DeclarationId(2549), - }, - Field { - label: "SetRemoval".to_string(), - ty: DeclarationId(2550), - }, - Field { - label: "FoldIteration".to_string(), - ty: DeclarationId(2551), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 7626, 7947), - }); - declarations.push(Declaration { - id: DeclarationId(1173), - name: Some("TerminationProof".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "dimensions".to_string(), - ty: DeclarationId(2552), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 7949, 8011), - }); - declarations.push(Declaration { - id: DeclarationId(1174), - name: Some("ProofEdge".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "caller".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "callee".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "evidence".to_string(), - ty: DeclarationId(2553), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 8156, 8242), - }); - declarations.push(Declaration { - id: DeclarationId(1175), - name: Some("StrictEvidence".to_string()), - connective: TypeConnective::Disj { - variants: vec![Field { - label: "Strict".to_string(), - ty: DeclarationId(2554), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 8716, 8746), - }); - declarations.push(Declaration { - id: DeclarationId(1176), - name: Some("NonStrictEvidence".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "NonIncreasing".to_string(), - ty: DeclarationId(2555), - }, - Field { - label: "DescentUnknown".to_string(), - ty: DeclarationId(2556), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 9112, 9171), - }); - declarations.push(Declaration { - id: DeclarationId(1177), - name: Some("DescentResidual".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "EvidenceUnknown".to_string(), - ty: DeclarationId(2557), - }, - Field { - label: "EvidenceIncomplete".to_string(), - ty: DeclarationId(2558), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 10238, 10320), - }); - declarations.push(Declaration { - id: DeclarationId(1178), - name: Some("DescentExecutionProof".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "cluster".to_string(), - ty: DeclarationId(738), - }, - Field { - label: "port".to_string(), - ty: DeclarationId(736), - }, - Field { - label: "per_path".to_string(), - ty: DeclarationId(2559), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 11157, 11263), - }); - declarations.push(Declaration { - id: DeclarationId(1179), - name: Some("descent_execution_proof".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839), DeclarationId(738), DeclarationId(736)], - output: DeclarationId(2532), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/termination.dag", - 12400, - 12439, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 12279, 12439), - }); - declarations.push(Declaration { - id: DeclarationId(1180), - name: Some("RecursionShape".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "DirectRecursion".to_string(), - ty: DeclarationId(2573), - }, - Field { - label: "ListRecursion".to_string(), - ty: DeclarationId(2574), - }, - Field { - label: "OptionalRecursion".to_string(), - ty: DeclarationId(2575), - }, - Field { - label: "SetRecursion".to_string(), - ty: DeclarationId(2576), - }, - Field { - label: "MapValueRecursion".to_string(), - ty: DeclarationId(2577), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 5605, 5878), - }); - declarations.push(Declaration { - id: DeclarationId(1181), - name: Some("InductiveField".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "type_name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "variant_name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "field_name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "shape".to_string(), - ty: DeclarationId(1180), - }, - Field { - label: "element_type".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 7170, 7592), - }); - declarations.push(Declaration { - id: DeclarationId(1182), - name: Some("recursion_shape_eq".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1180), DeclarationId(1180)], - output: DeclarationId(124), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/induction.dag", 7662, 8034)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 7594, 8034), - }); - declarations.push(Declaration { - id: DeclarationId(1183), - name: Some("inductive_field_eq".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1181), DeclarationId(1181)], - output: DeclarationId(124), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/induction.dag", 8104, 8302)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 8036, 8302), - }); - declarations.push(Declaration { - id: DeclarationId(1184), - name: Some("inductive_field_to_dimension".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1181), DeclarationId(227)], - output: DeclarationId(1164), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/induction.dag", 8768, 8799)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 8678, 8799), - }); - declarations.push(Declaration { - id: DeclarationId(1185), - name: Some("SubValueRelation".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "StrictSubValue".to_string(), - ty: DeclarationId(2578), - }, - Field { - label: "IteratedSubValue".to_string(), - ty: DeclarationId(2579), - }, - Field { - label: "ArithmeticDescent".to_string(), - ty: DeclarationId(2580), - }, - Field { - label: "PreservedValue".to_string(), - ty: DeclarationId(2581), - }, - Field { - label: "NonIncreasingValue".to_string(), - ty: DeclarationId(2582), - }, - Field { - label: "StrictAxisErased".to_string(), - ty: DeclarationId(2583), - }, - Field { - label: "MixedTop".to_string(), - ty: DeclarationId(2584), - }, - Field { - label: "SubValueUnknown".to_string(), - ty: DeclarationId(2585), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 10384, 10677), - }); - declarations.push(Declaration { - id: DeclarationId(1186), - name: Some("sub_value_to_evidence".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1185)], - output: DeclarationId(1157), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 11630, - 12468, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 11558, 12468), - }); - declarations.push(Declaration { - id: DeclarationId(1187), - name: Some("shrink_factor_eq".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(973), DeclarationId(973)], - output: DeclarationId(124), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 12936, - 13422, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 12874, 13422), - }); - declarations.push(Declaration { - id: DeclarationId(1188), - name: Some("sub_value_structural_eq".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1185), DeclarationId(1185)], - output: DeclarationId(124), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 13659, - 14629, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 13582, 14629), - }); - declarations.push(Declaration { - id: DeclarationId(1189), - name: Some("is_strict_style_structural".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1185)], - output: DeclarationId(124), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 14956, - 15166, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 14897, 15166), - }); - declarations.push(Declaration { - id: DeclarationId(1190), - name: Some("sub_value_level".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1185)], - output: DeclarationId(87), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 15215, - 15493, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 15168, 15493), - }); - declarations.push(Declaration { - id: DeclarationId(1191), - name: Some("meet_sub_value".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1185), DeclarationId(1185)], - output: DeclarationId(1185), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 15575, - 16156, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 15495, 16156), - }); - declarations.push(Declaration { - id: DeclarationId(1192), - name: Some("join_sub_value".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1185), DeclarationId(1185)], - output: DeclarationId(1185), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 16238, - 16794, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 16158, 16794), - }); - declarations.push(Declaration { - id: DeclarationId(1193), - name: Some("compose_sub_value".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1185), DeclarationId(1181)], - output: DeclarationId(1185), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 17875, - 17997, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 17787, 17997), - }); - declarations.push(Declaration { - id: DeclarationId(1194), - name: Some("compose_sub_value_relations".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1185), DeclarationId(1185)], - output: DeclarationId(1185), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 18853, - 21192, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 18745, 21192), - }); - declarations.push(Declaration { - id: DeclarationId(1195), - name: Some("sub_value_to_call_pattern".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1185)], - output: DeclarationId(2560), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 21967, - 22925, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 21894, 22925), - }); - declarations.push(Declaration { - id: DeclarationId(1196), - name: Some("sub_value_to_lowering_target".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1185)], - output: DeclarationId(2561), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 23517, - 24833, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 23438, 24833), - }); - declarations.push(Declaration { - id: DeclarationId(1197), - name: Some("PolynomialExponent".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "IntegerExpZero".to_string(), - ty: DeclarationId(2586), - }, - Field { - label: "IntegerExpPos".to_string(), - ty: DeclarationId(2587), - }, - Field { - label: "FractionExp".to_string(), - ty: DeclarationId(2588), - }, - Field { - label: "LogBasedExp".to_string(), - ty: DeclarationId(2589), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 26076, 26331), - }); - declarations.push(Declaration { - id: DeclarationId(1198), - name: Some("poly_exp_degree_one".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(1197), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 26380, - 26419, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 26333, 26419), - }); - declarations.push(Declaration { - id: DeclarationId(1199), - name: Some("AtomicCost".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "PolyCost".to_string(), - ty: DeclarationId(2590), - }, - Field { - label: "LogCost".to_string(), - ty: DeclarationId(2591), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 26931, 27048), - }); - declarations.push(Declaration { - id: DeclarationId(1200), - name: Some("CostBound".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ConstantBound".to_string(), - ty: DeclarationId(2592), - }, - Field { - label: "AtomicBound".to_string(), - ty: DeclarationId(2593), - }, - Field { - label: "ProductBound".to_string(), - ty: DeclarationId(2595), - }, - Field { - label: "SumOfProductsBound".to_string(), - ty: DeclarationId(2598), - }, - Field { - label: "SumBound".to_string(), - ty: DeclarationId(2600), - }, - Field { - label: "ForeverBound".to_string(), - ty: DeclarationId(2601), - }, - Field { - label: "ErrorBound".to_string(), - ty: DeclarationId(2602), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 28678, 29438), - }); - declarations.push(Declaration { - id: DeclarationId(1201), - name: Some("sum_bound".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(2562)], - output: DeclarationId(1200), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 29849, - 29955, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 29799, 29955), - }); - declarations.push(Declaration { - id: DeclarationId(1202), - name: Some("cost_bound_is_sum_bound".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1200)], - output: DeclarationId(124), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 30279, - 30532, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 30230, 30532), - }); - declarations.push(Declaration { - id: DeclarationId(1203), - name: Some("cost_bound_to_symbolic".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1200)], - output: DeclarationId(919), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(670))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 30969, 31486), - }); - declarations.push(Declaration { - id: DeclarationId(1204), - name: Some("atomic_cost_to_symbolic".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1199)], - output: DeclarationId(919), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(679))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 31488, 31808), - }); - declarations.push(Declaration { - id: DeclarationId(1205), - name: Some("product_atoms_to_symbolic".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(2563)], - output: DeclarationId(919), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 31882, - 31918, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 31810, 31918), - }); - declarations.push(Declaration { - id: DeclarationId(1206), - name: Some("product_term_to_symbolic".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(2564)], - output: DeclarationId(919), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(681))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 31920, 32029), - }); - declarations.push(Declaration { - id: DeclarationId(1207), - name: Some("sum_products_to_symbolic".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(2566)], - output: DeclarationId(919), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 32106, - 32141, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 32031, 32141), - }); - declarations.push(Declaration { - id: DeclarationId(1208), - name: Some("cost_constant".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(1200), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 32175, - 32192, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 32143, 32192), - }); - declarations.push(Declaration { - id: DeclarationId(1209), - name: Some("cost_linear".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227)], - output: DeclarationId(1200), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 32236, - 32320, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 32193, 32320), - }); - declarations.push(Declaration { - id: DeclarationId(1210), - name: Some("cost_poly".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227), DeclarationId(87)], - output: DeclarationId(1200), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 32375, - 32774, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 32321, 32774), - }); - declarations.push(Declaration { - id: DeclarationId(1211), - name: Some("cost_root".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227), DeclarationId(87)], - output: DeclarationId(1200), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 32824, - 33098, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 32775, 33098), - }); - declarations.push(Declaration { - id: DeclarationId(1212), - name: Some("cost_sqrt".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227)], - output: DeclarationId(1200), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 33140, - 33173, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 33099, 33173), - }); - declarations.push(Declaration { - id: DeclarationId(1213), - name: Some("cost_cbrt".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227)], - output: DeclarationId(1200), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 33215, - 33248, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 33174, 33248), - }); - declarations.push(Declaration { - id: DeclarationId(1214), - name: Some("cost_log".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227)], - output: DeclarationId(1200), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 33289, - 33339, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 33249, 33339), - }); - declarations.push(Declaration { - id: DeclarationId(1215), - name: Some("cost_nlogn".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227)], - output: DeclarationId(1200), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 33383, - 33501, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 33341, 33501), - }); - declarations.push(Declaration { - id: DeclarationId(1216), - name: Some("cost_graph_linear".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227), DeclarationId(227)], - output: DeclarationId(1200), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 33571, - 33747, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 33503, 33747), - }); - declarations.push(Declaration { - id: DeclarationId(1217), - name: Some("RecurrenceForm".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "param".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "branches".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "divisor".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "work_exponent".to_string(), - ty: DeclarationId(87), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 34904, 34995), - }); - declarations.push(Declaration { - id: DeclarationId(1218), - name: Some("int_add_checked".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87), DeclarationId(87)], - output: DeclarationId(2567), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 35586, - 35837, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 35543, 35837), - }); - declarations.push(Declaration { - id: DeclarationId(1219), - name: Some("int_mul_checked".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87), DeclarationId(87)], - output: DeclarationId(2568), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 35882, - 36671, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 35839, 36671), - }); - declarations.push(Declaration { - id: DeclarationId(1220), - name: Some("bounded_int_pow_exponent".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87)], - output: DeclarationId(2569), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 37131, - 37254, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 37087, 37254), - }); - declarations.push(Declaration { - id: DeclarationId(1221), - name: Some("int_pow_bounded".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87), DeclarationId(87)], - output: DeclarationId(2570), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 37606, - 38651, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 37558, 38651), - }); - declarations.push(Declaration { - id: DeclarationId(1222), - name: Some("ceil_log".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87), DeclarationId(87)], - output: DeclarationId(2571), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 38869, - 38984, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 38823, 38984), - }); - declarations.push(Declaration { - id: DeclarationId(1223), - name: Some("ceil_log_iter".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![ - DeclarationId(87), - DeclarationId(87), - DeclarationId(87), - DeclarationId(87), - ], - output: DeclarationId(2572), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 39141, - 39503, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 39070, 39503), - }); - declarations.push(Declaration { - id: DeclarationId(1224), - name: Some("master_theorem".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1217)], - output: DeclarationId(1200), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 39558, - 41595, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 39505, 41595), - }); - declarations.push(Declaration { - id: DeclarationId(1225), - name: Some("catamorphism_bound".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227), DeclarationId(87)], - output: DeclarationId(1200), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 41948, - 42106, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 41878, 42106), - }); - declarations.push(Declaration { - id: DeclarationId(1226), - name: Some("derive_bound".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![ - DeclarationId(227), - DeclarationId(87), - DeclarationId(973), - DeclarationId(87), - ], - output: DeclarationId(1200), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 42605, - 43629, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 42504, 43629), - }); - declarations.push(Declaration { - id: DeclarationId(1227), - name: Some("tree_traversal_bound".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(1200), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 43962, - 44019, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 43923, 44019), - }); - declarations.push(Declaration { - id: DeclarationId(1228), - name: Some("nested_iteration_bound".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(1200), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 44062, - 44120, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 44021, 44120), - }); - declarations.push(Declaration { - id: DeclarationId(1229), - name: Some("linear_scan_bound".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(1200), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 44220, - 44275, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 44184, 44275), - }); - declarations.push(Declaration { - id: DeclarationId(1230), - name: Some("binary_search_bound".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(1200), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 44472, - 44587, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 44434, 44587), - }); - declarations.push(Declaration { - id: DeclarationId(1231), - name: Some("mergesort_bound".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(1200), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 44667, - 44782, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 44633, 44782), - }); - declarations.push(Declaration { - id: DeclarationId(1232), - name: Some("karatsuba_bound".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(1200), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 44949, - 45068, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 44915, 45068), - }); - declarations.push(Declaration { - id: DeclarationId(1233), - name: Some("strassen_bound".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(1200), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 45233, - 45347, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 45200, 45347), - }); - declarations.push(Declaration { - id: DeclarationId(1234), - name: Some("trial_division_bound".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(1200), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 45464, - 45489, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 45425, 45489), - }); - declarations.push(Declaration { - id: DeclarationId(1235), - name: Some("cube_root_bound".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(1200), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 45524, - 45549, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 45490, 45549), - }); - declarations.push(Declaration { - id: DeclarationId(1236), - name: Some("kth_root_bound".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87)], - output: DeclarationId(1200), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 45631, - 45662, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 45592, 45662), - }); - declarations.push(Declaration { - id: DeclarationId(1237), - name: Some("bfs_dfs_bound".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(1200), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 45898, - 45949, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 45866, 45949), - }); - declarations.push(Declaration { - id: DeclarationId(1238), - name: Some("dijkstra_bound".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(1200), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 46040, - 46322, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 46007, 46322), - }); - declarations.push(Declaration { - id: DeclarationId(1239), - name: Some("bellman_ford_bound".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(1200), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 46425, - 46585, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 46388, 46585), - }); - declarations.push(Declaration { - id: DeclarationId(1240), - name: Some("floyd_warshall_bound".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(1200), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 46692, - 46730, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 46653, 46730), - }); - declarations.push(Declaration { - id: DeclarationId(1241), - name: Some("TokenKind".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "KwLet".to_string(), - ty: DeclarationId(2603), - }, - Field { - label: "KwIf".to_string(), - ty: DeclarationId(2604), - }, - Field { - label: "KwThen".to_string(), - ty: DeclarationId(2605), - }, - Field { - label: "KwElse".to_string(), - ty: DeclarationId(2606), - }, - Field { - label: "KwFn".to_string(), - ty: DeclarationId(2607), - }, - Field { - label: "KwType".to_string(), - ty: DeclarationId(2608), - }, - Field { - label: "KwModule".to_string(), - ty: DeclarationId(2609), - }, - Field { - label: "KwImport".to_string(), - ty: DeclarationId(2610), - }, - Field { - label: "KwMatch".to_string(), - ty: DeclarationId(2611), - }, - Field { - label: "KwData".to_string(), - ty: DeclarationId(2612), - }, - Field { - label: "KwWhere".to_string(), - ty: DeclarationId(2613), - }, - Field { - label: "KwTrue".to_string(), - ty: DeclarationId(2614), - }, - Field { - label: "KwFalse".to_string(), - ty: DeclarationId(2615), - }, - Field { - label: "Ident".to_string(), - ty: DeclarationId(2616), - }, - Field { - label: "IntLit".to_string(), - ty: DeclarationId(2617), - }, - Field { - label: "StringLit".to_string(), - ty: DeclarationId(2618), - }, - Field { - label: "Eq".to_string(), - ty: DeclarationId(2619), - }, - Field { - label: "EqEq".to_string(), - ty: DeclarationId(2620), - }, - Field { - label: "NotEq".to_string(), - ty: DeclarationId(2621), - }, - Field { - label: "Lt".to_string(), - ty: DeclarationId(2622), - }, - Field { - label: "Le".to_string(), - ty: DeclarationId(2623), - }, - Field { - label: "Gt".to_string(), - ty: DeclarationId(2624), - }, - Field { - label: "Ge".to_string(), - ty: DeclarationId(2625), - }, - Field { - label: "Plus".to_string(), - ty: DeclarationId(2626), - }, - Field { - label: "Minus".to_string(), - ty: DeclarationId(2627), - }, - Field { - label: "Star".to_string(), - ty: DeclarationId(2628), - }, - Field { - label: "Slash".to_string(), - ty: DeclarationId(2629), - }, - Field { - label: "AmpAmp".to_string(), - ty: DeclarationId(2630), - }, - Field { - label: "PipePipe".to_string(), - ty: DeclarationId(2631), - }, - Field { - label: "Colon".to_string(), - ty: DeclarationId(2632), - }, - Field { - label: "Arrow".to_string(), - ty: DeclarationId(2633), - }, - Field { - label: "FatArrow".to_string(), - ty: DeclarationId(2634), - }, - Field { - label: "PipeArrow".to_string(), - ty: DeclarationId(2635), - }, - Field { - label: "Dot".to_string(), - ty: DeclarationId(2636), - }, - Field { - label: "LParen".to_string(), - ty: DeclarationId(2637), - }, - Field { - label: "RParen".to_string(), - ty: DeclarationId(2638), - }, - Field { - label: "LBrace".to_string(), - ty: DeclarationId(2639), - }, - Field { - label: "RBrace".to_string(), - ty: DeclarationId(2640), - }, - Field { - label: "LBracket".to_string(), - ty: DeclarationId(2641), - }, - Field { - label: "RBracket".to_string(), - ty: DeclarationId(2642), - }, - Field { - label: "Comma".to_string(), - ty: DeclarationId(2643), - }, - Field { - label: "Semicolon".to_string(), - ty: DeclarationId(2644), - }, - Field { - label: "Pipe".to_string(), - ty: DeclarationId(2645), - }, - Field { - label: "Question".to_string(), - ty: DeclarationId(2646), - }, - Field { - label: "Caret".to_string(), - ty: DeclarationId(2647), - }, - Field { - label: "Eof".to_string(), - ty: DeclarationId(2648), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 627, 1230), - }); - declarations.push(Declaration { - id: DeclarationId(1242), - name: Some("Token".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "kind".to_string(), - ty: DeclarationId(1241), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1365, 1416), - }); - declarations.push(Declaration { - id: DeclarationId(1243), - name: Some("KeywordTokenKind".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "KwLet".to_string(), - ty: DeclarationId(2649), - }, - Field { - label: "KwIf".to_string(), - ty: DeclarationId(2650), - }, - Field { - label: "KwThen".to_string(), - ty: DeclarationId(2651), - }, - Field { - label: "KwElse".to_string(), - ty: DeclarationId(2652), - }, - Field { - label: "KwFn".to_string(), - ty: DeclarationId(2653), - }, - Field { - label: "KwType".to_string(), - ty: DeclarationId(2654), - }, - Field { - label: "KwModule".to_string(), - ty: DeclarationId(2655), - }, - Field { - label: "KwImport".to_string(), - ty: DeclarationId(2656), - }, - Field { - label: "KwMatch".to_string(), - ty: DeclarationId(2657), - }, - Field { - label: "KwData".to_string(), - ty: DeclarationId(2658), - }, - Field { - label: "KwWhere".to_string(), - ty: DeclarationId(2659), - }, - Field { - label: "KwTrue".to_string(), - ty: DeclarationId(2660), - }, - Field { - label: "KwFalse".to_string(), - ty: DeclarationId(2661), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1775, 1941), - }); - declarations.push(Declaration { - id: DeclarationId(1244), - name: Some("PunctTokenKind".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Eq".to_string(), - ty: DeclarationId(2662), - }, - Field { - label: "EqEq".to_string(), - ty: DeclarationId(2663), - }, - Field { - label: "NotEq".to_string(), - ty: DeclarationId(2664), - }, - Field { - label: "Lt".to_string(), - ty: DeclarationId(2665), - }, - Field { - label: "Le".to_string(), - ty: DeclarationId(2666), - }, - Field { - label: "Gt".to_string(), - ty: DeclarationId(2667), - }, - Field { - label: "Ge".to_string(), - ty: DeclarationId(2668), - }, - Field { - label: "Plus".to_string(), - ty: DeclarationId(2669), - }, - Field { - label: "Minus".to_string(), - ty: DeclarationId(2670), - }, - Field { - label: "Star".to_string(), - ty: DeclarationId(2671), - }, - Field { - label: "Slash".to_string(), - ty: DeclarationId(2672), - }, - Field { - label: "AmpAmp".to_string(), - ty: DeclarationId(2673), - }, - Field { - label: "PipePipe".to_string(), - ty: DeclarationId(2674), - }, - Field { - label: "Colon".to_string(), - ty: DeclarationId(2675), - }, - Field { - label: "Arrow".to_string(), - ty: DeclarationId(2676), - }, - Field { - label: "FatArrow".to_string(), - ty: DeclarationId(2677), - }, - Field { - label: "PipeArrow".to_string(), - ty: DeclarationId(2678), - }, - Field { - label: "Dot".to_string(), - ty: DeclarationId(2679), - }, - Field { - label: "LParen".to_string(), - ty: DeclarationId(2680), - }, - Field { - label: "RParen".to_string(), - ty: DeclarationId(2681), - }, - Field { - label: "LBrace".to_string(), - ty: DeclarationId(2682), - }, - Field { - label: "RBrace".to_string(), - ty: DeclarationId(2683), - }, - Field { - label: "LBracket".to_string(), - ty: DeclarationId(2684), - }, - Field { - label: "RBracket".to_string(), - ty: DeclarationId(2685), - }, - Field { - label: "Comma".to_string(), - ty: DeclarationId(2686), - }, - Field { - label: "Semicolon".to_string(), - ty: DeclarationId(2687), - }, - Field { - label: "Pipe".to_string(), - ty: DeclarationId(2688), - }, - Field { - label: "Question".to_string(), - ty: DeclarationId(2689), - }, - Field { - label: "Caret".to_string(), - ty: DeclarationId(2690), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2357, 2673), - }); - declarations.push(Declaration { - id: DeclarationId(1245), - name: Some("LocalPunctSpec".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "pattern".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "kind".to_string(), - ty: DeclarationId(1244), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2883, 2947), - }); - declarations.push(Declaration { - id: DeclarationId(1246), - name: Some("StringEscapeSpec".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "suffix".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "output_codepoint".to_string(), - ty: DeclarationId(87), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 3334, 3400), - }); - declarations.push(Declaration { - id: DeclarationId(1247), - name: Some("behavior_spine".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839)], - output: DeclarationId(2691), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(683))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/workflows.dag", 957, 1012), - }); - declarations.push(Declaration { - id: DeclarationId(1248), - name: Some("timing_lens_module_path_witness".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(154), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(685))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 1533, 1614), - }); - declarations.push(Declaration { - id: DeclarationId(1249), - name: Some("Nanoseconds".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "count".to_string(), - ty: DeclarationId(76), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 2075, 2108), - }); - declarations.push(Declaration { - id: DeclarationId(1250), - name: Some("TimingMeasurement".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Observed".to_string(), - ty: DeclarationId(2693), - }, - Field { - label: "Unobserved".to_string(), - ty: DeclarationId(2694), - }, - Field { - label: "Ambiguous".to_string(), - ty: DeclarationId(2695), - }, - Field { - label: "Stale".to_string(), - ty: DeclarationId(2696), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 4119, 4219), - }); - declarations.push(Declaration { - id: DeclarationId(1251), - name: Some("WorkflowObservationAnchor".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "subject_node".to_string(), - ty: DeclarationId(735), - }, - Field { - label: "artifact_digest".to_string(), - ty: DeclarationId(170), - }, - Field { - label: "producer_id".to_string(), - ty: DeclarationId(171), - }, - Field { - label: "observer_id".to_string(), - ty: DeclarationId(172), - }, - Field { - label: "prover_id".to_string(), - ty: DeclarationId(173), - }, - Field { - label: "attached_at_ns".to_string(), - ty: DeclarationId(1249), - }, - Field { - label: "workflow_run_id".to_string(), - ty: DeclarationId(174), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 5680, 5929), - }); - declarations.push(Declaration { - id: DeclarationId(1252), - name: Some("FileAttachment".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "subject_node".to_string(), - ty: DeclarationId(735), - }, - Field { - label: "content_digest".to_string(), - ty: DeclarationId(170), - }, - Field { - label: "producer_id".to_string(), - ty: DeclarationId(171), - }, - Field { - label: "workflow_run_id".to_string(), - ty: DeclarationId(174), - }, - Field { - label: "attached_at_ns".to_string(), - ty: DeclarationId(1249), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 6688, 6861), - }); - declarations.push(Declaration { - id: DeclarationId(1253), - name: Some("gate_62_file_attachment_demo_record".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![ - DeclarationId(735), - DeclarationId(170), - DeclarationId(171), - DeclarationId(174), - DeclarationId(1249), - ], - output: DeclarationId(1252), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(687))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 7262, 7589), - }); - declarations.push(Declaration { - id: DeclarationId(1254), - name: Some("TimingObservationSet".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "observations".to_string(), - ty: DeclarationId(2697), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 7673, 7747), - }); - declarations.push(Declaration { - id: DeclarationId(1255), - name: Some("TimingObservationEntry".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "anchor".to_string(), - ty: DeclarationId(1251), - }, - Field { - label: "measurement".to_string(), - ty: DeclarationId(1250), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 7749, 7849), - }); - declarations.push(Declaration { - id: DeclarationId(1256), - name: Some("TimingBudget".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "max".to_string(), - ty: DeclarationId(1249), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 7987, 8027), - }); - declarations.push(Declaration { - id: DeclarationId(1257), - name: Some("TimingEnforcementProjected".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "TimedUsage".to_string(), - ty: DeclarationId(2698), - }, - Field { - label: "NonEvidenceUsage".to_string(), - ty: DeclarationId(2699), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 9193, 9281), - }); - declarations.push(Declaration { - id: DeclarationId(1258), - name: Some("TimingLens".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1097), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1098), - value: DeclarationId(1250), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 9537, 9578), - }); - declarations.push(Declaration { - id: DeclarationId(1259), - name: Some("timing_measurement_unobserved".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(1250), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(689))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 9580, 9650), - }); - declarations.push(Declaration { - id: DeclarationId(1260), - name: Some("timing_measurement_lens_combine".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1250), DeclarationId(1250), DeclarationId(124)], - output: DeclarationId(1250), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(721))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 9808, 10700), - }); - declarations.push(Declaration { - id: DeclarationId(1261), - name: Some("timing_sequential_op".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1250), DeclarationId(1250)], - output: DeclarationId(1250), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(724))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10775, 10911), - }); - declarations.push(Declaration { - id: DeclarationId(1262), - name: Some("nanoseconds_zero".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(1249), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(727))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10913, 10966), - }); - declarations.push(Declaration { - id: DeclarationId(1263), - name: Some("timing_sequential_identity".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(1250), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(730))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10968, 11066), - }); - declarations.push(Declaration { - id: DeclarationId(1264), - name: Some("timing_branch_op".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1250), DeclarationId(1250)], - output: DeclarationId(1250), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(733))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 11126, 11259), - }); - declarations.push(Declaration { - id: DeclarationId(1265), - name: Some("timing_lens_correction_retirement_plan".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(1050), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(737))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 11798, 12111), - }); - declarations.push(Declaration { - id: DeclarationId(1266), - name: Some("timing_lens_deferred_correction".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(1051), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(741))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 12113, 12332), - }); - declarations.push(Declaration { - id: DeclarationId(1267), - name: Some("timing_lens_behavior_span".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(838)], - output: DeclarationId(155), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(748))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 12515, 12714), - }); - declarations.push(Declaration { - id: DeclarationId(1268), - name: Some("timing_lens_scaffold_non_evidence_diagnostic".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227), DeclarationId(155)], - output: DeclarationId(1055), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(753))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 12961, 13180), - }); - declarations.push(Declaration { - id: DeclarationId(1269), - name: Some("timing_lens_degenerate_empty_dag_span".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(155), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(758))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 13414, 13548), - }); - declarations.push(Declaration { - id: DeclarationId(1270), - name: Some("timing_lens_validate_non_observed".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839), DeclarationId(227)], - output: DeclarationId(1060), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(774))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 14010, 14715), - }); - declarations.push(Declaration { - id: DeclarationId(1271), - name: Some("timing_measurement_iterate".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1250), DeclarationId(829)], - output: DeclarationId(1250), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(783))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 15040, 15401), - }); - declarations.push(Declaration { - id: DeclarationId(1272), - name: Some("timing_lens_read".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839), DeclarationId(838)], - output: DeclarationId(2692), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(820))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16178, 17004), - }); - declarations.push(Declaration { - id: DeclarationId(1273), - name: Some("timing_lens_validate".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839), DeclarationId(1250)], - output: DeclarationId(1060), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(834))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 17006, 17851), - }); - declarations.push(Declaration { - id: DeclarationId(1274), - name: Some("timing_enforcement_fault_sentinel_count".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(76), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(836))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 18961, 19035), - }); - declarations.push(Declaration { - id: DeclarationId(1275), - name: Some("timing_enforcement_project".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1250)], - output: DeclarationId(1257), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(843))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19037, 19289), - }); - declarations.push(Declaration { - id: DeclarationId(1276), - name: Some("timing_enforcement_violates".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1250), DeclarationId(1256)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(866))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19291, 19556), - }); - declarations.push(Declaration { - id: DeclarationId(1277), - name: Some("timing_lens_monoid".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(19), - arguments: vec![TemplateArgument { - parameter: DeclarationId(20), - value: DeclarationId(1250), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(2700)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ("op".to_string(), FieldValue::Reference(DeclarationId(1261))), - ( - "identity".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2693), - payload: vec![FieldValue::Record(vec![( - "count".to_string(), - FieldValue::Literal(LiteralBits::Int("0".to_string())), - )])], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19558, 19689), - }); - declarations.push(Declaration { - id: DeclarationId(1278), - name: Some("timing_lens".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1258), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1258)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("timing".to_string())), - ), - ( - "read".to_string(), - FieldValue::Reference(DeclarationId(1272)), - ), - ( - "sequential".to_string(), - FieldValue::Reference(DeclarationId(1277)), - ), - ( - "branch".to_string(), - FieldValue::Reference(DeclarationId(1264)), - ), - ( - "iterate".to_string(), - FieldValue::Reference(DeclarationId(1271)), - ), - ( - "validate".to_string(), - FieldValue::Reference(DeclarationId(1273)), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19691, 19898), - }); - declarations.push(Declaration { - id: DeclarationId(1279), - name: Some("timing_enforcement".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1101), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(1102), - value: DeclarationId(1250), - }, - TemplateArgument { - parameter: DeclarationId(1103), - value: DeclarationId(1256), - }, - TemplateArgument { - parameter: DeclarationId(1104), - value: DeclarationId(1257), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(2701)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "project".to_string(), - FieldValue::Reference(DeclarationId(1275)), - ), - ( - "violates".to_string(), - FieldValue::Reference(DeclarationId(1276)), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19900, 20085), - }); - declarations.push(Declaration { - id: DeclarationId(1280), - name: Some("timing_enforceable".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1105), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(1106), - value: DeclarationId(1250), - }, - TemplateArgument { - parameter: DeclarationId(1107), - value: DeclarationId(1256), - }, - TemplateArgument { - parameter: DeclarationId(1108), - value: DeclarationId(1257), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(2702)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "lens".to_string(), - FieldValue::Reference(DeclarationId(1278)), - ), - ( - "enforcement".to_string(), - FieldValue::Reference(DeclarationId(1279)), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 20087, 20248), - }); - declarations.push(Declaration { - id: DeclarationId(1281), - name: Some("modeled_gunbc_ci_workflow".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1796), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1796)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Unparsed(SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 1440, - 2696, - ))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 1397, 2696), - }); - declarations.push(Declaration { - id: DeclarationId(1282), - name: Some("ci_demo_timing_read".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839), DeclarationId(838)], - output: DeclarationId(2713), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(908))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3209, 4468), - }); - declarations.push(Declaration { - id: DeclarationId(1283), - name: Some("ci_wad_modeled_workflow_timing_witness".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839), DeclarationId(838)], - output: DeclarationId(2714), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(910))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 4762, 4884), - }); - declarations.push(Declaration { - id: DeclarationId(1284), - name: Some("_ci_wad_seed_list_declaration_empty".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(2715), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(912))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5078, 5147), - }); - declarations.push(Declaration { - id: DeclarationId(1285), - name: Some("_ci_wad_seed_list_behavior_empty".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(2716), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(914))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5149, 5212), - }); - declarations.push(Declaration { - id: DeclarationId(1286), - name: Some("_ci_wad_seed_list_dagport_empty".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(2717), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(916))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5214, 5275), - }); - declarations.push(Declaration { - id: DeclarationId(1287), - name: Some("_ci_wad_seed_list_cluster_empty".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(2718), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(918))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5277, 5338), - }); - declarations.push(Declaration { - id: DeclarationId(1288), - name: Some("_ci_wad_empty_list_diagnostic".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(2719), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(920))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5340, 5402), - }); - declarations.push(Declaration { - id: DeclarationId(1289), - name: Some("_ci_wad_empty_list_witness_tm".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(2721), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(922))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5404, 5482), - }); - declarations.push(Declaration { - id: DeclarationId(1290), - name: Some("_ci_wad_witnesses_singleton_tm".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1250)], - output: DeclarationId(2723), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(926))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5484, 5645), - }); - declarations.push(Declaration { - id: DeclarationId(1291), - name: Some("_ci_wad_violations_singleton".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1055)], - output: DeclarationId(2724), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(929))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5647, 5779), - }); - declarations.push(Declaration { - id: DeclarationId(1292), - name: Some("_ci_wad_dimension_ok_tm_payload".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1250)], - output: DeclarationId(2725), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(933))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5781, 6005), - }); - declarations.push(Declaration { - id: DeclarationId(1293), - name: Some("_ci_wad_dimension_fail_tm_payload".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1250), DeclarationId(1055)], - output: DeclarationId(2726), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(938))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 6007, 6288), - }); - declarations.push(Declaration { - id: DeclarationId(1294), - name: Some("report_dim_ok_tm".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839), DeclarationId(1250)], - output: DeclarationId(2727), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(945))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 6553, 6792), - }); - declarations.push(Declaration { - id: DeclarationId(1295), - name: Some("report_dim_fail_tm".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839), DeclarationId(1250), DeclarationId(1055)], - output: DeclarationId(2728), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(952))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 6794, 7069), - }); - declarations.push(Declaration { - id: DeclarationId(1296), - name: Some("report_inhabits_branch_tm".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839), DeclarationId(1250), DeclarationId(1060)], - output: DeclarationId(2729), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(957))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7071, 7322), - }); - declarations.push(Declaration { - id: DeclarationId(1297), - name: Some("dimension_report_tm_from_witness".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839), DeclarationId(2730)], - output: DeclarationId(2731), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(978))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7324, 8325), - }); - declarations.push(Declaration { - id: DeclarationId(1298), - name: Some("demo_ci_modeled_timing_dimension_report".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839), DeclarationId(838)], - output: DeclarationId(2732), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(986))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 9186, 9487), - }); - declarations.push(Declaration { - id: DeclarationId(1299), - name: Some("gate_58_ci_workflow_timing_row".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "workflow".to_string(), - ty: DeclarationId(1796), - }, - Field { - label: "measurement".to_string(), - ty: DeclarationId(1250), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 10675, 10768), - }); - declarations.push(Declaration { - id: DeclarationId(1300), - name: Some("gate_58_modeled_ci_timing_measurement".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1299), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1299)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "workflow".to_string(), - FieldValue::Reference(DeclarationId(1281)), - ), - ( - "measurement".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2693), - payload: vec![FieldValue::Record(vec![( - "count".to_string(), - FieldValue::Literal(LiteralBits::Int("0".to_string())), - )])], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 10770, 10939), - }); - declarations.push(Declaration { - id: DeclarationId(1301), - name: Some("gate_58_apply_lens_self_application_pass".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1109), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(1110), - value: DeclarationId(1250), - }, - TemplateArgument { - parameter: DeclarationId(1111), - value: DeclarationId(1256), - }, - TemplateArgument { - parameter: DeclarationId(1112), - value: DeclarationId(1257), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(2733)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "enforceable_lens".to_string(), - FieldValue::Reference(DeclarationId(1280)), - ), - ( - "section".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2427), - payload: vec![FieldValue::Reference(DeclarationId(1300))], - }, - ), - ( - "budget".to_string(), - FieldValue::Record(vec![( - "max".to_string(), - FieldValue::Record(vec![( - "count".to_string(), - FieldValue::Literal(LiteralBits::Int("1000000000".to_string())), - )]), - )]), - ), - ( - "diagnostic_severity".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2429), - payload: vec![], - }, - ), - ( - "span".to_string(), - FieldValue::Record(vec![ - ( - "file".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/std/t_ci_workflow_as_data_demo.dag".to_string(), - )), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("0".to_string())), - ), - ( - "end".to_string(), - FieldValue::Literal(LiteralBits::Int("0".to_string())), - ), - ]), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 11199, 11604), - }); - declarations.push(Declaration { - id: DeclarationId(1302), - name: Some("Path".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(154), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 1402, 1422), - }); - declarations.push(Declaration { - id: DeclarationId(1303), - name: Some("SnapshotRef".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(147), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 1423, 1453), - }); - declarations.push(Declaration { - id: DeclarationId(1304), - name: Some("GeneratedManifestEntry".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "PendingFact".to_string(), - ty: DeclarationId(2758), - }, - Field { - label: "ResolvedFact".to_string(), - ty: DeclarationId(2759), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 2584, 2762), - }); - declarations.push(Declaration { - id: DeclarationId(1305), - name: Some("CensusListConstant".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 2969, 2995), - }); - declarations.push(Declaration { - id: DeclarationId(1306), - name: Some("expected_hand_authored_non_test".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1305), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1305)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { fields: vec![] }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 2997, 3058), - }); - declarations.push(Declaration { - id: DeclarationId(1307), - name: Some("expected_hand_authored_test".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1305), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1305)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { fields: vec![] }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 3059, 3116), - }); - declarations.push(Declaration { - id: DeclarationId(1308), - name: Some("expected_hand_authored_fragments".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1305), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1305)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { fields: vec![] }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 3117, 3179), - }); - declarations.push(Declaration { - id: DeclarationId(1309), - name: Some("LensProducerFilesSubsetPredicate".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 3311, 3351), - }); - declarations.push(Declaration { - id: DeclarationId(1310), - name: Some("lens_producer_files_subset_predicate".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1309), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1309)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { fields: vec![] }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 3353, 3433), - }); - declarations.push(Declaration { - id: DeclarationId(1311), - name: Some("BinShimFilesSubsetPredicate".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 3540, 3575), - }); - declarations.push(Declaration { - id: DeclarationId(1312), - name: Some("bin_shim_files_subset_predicate".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1311), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1311)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { fields: vec![] }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 3577, 3647), - }); - declarations.push(Declaration { - id: DeclarationId(1313), - name: Some("CompilerStdPositiveSetRatchet".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 3726, 3763), - }); - declarations.push(Declaration { - id: DeclarationId(1314), - name: Some("compiler_std_positive_set_ratchet".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1313), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1313)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { fields: vec![] }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 3765, 3839), - }); - declarations.push(Declaration { - id: DeclarationId(1315), - name: Some("DiagnosticKind".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "TokenizerError".to_string(), - ty: DeclarationId(2760), - }, - Field { - label: "ParseError".to_string(), - ty: DeclarationId(2761), - }, - Field { - label: "TypeMismatch".to_string(), - ty: DeclarationId(2762), - }, - Field { - label: "ArityMismatch".to_string(), - ty: DeclarationId(2763), - }, - Field { - label: "ResolveError".to_string(), - ty: DeclarationId(2764), - }, - Field { - label: "UnitMismatch".to_string(), - ty: DeclarationId(2765), - }, - Field { - label: "BranchConditionNotBool".to_string(), - ty: DeclarationId(2766), - }, - Field { - label: "MagnitudeOutOfRange".to_string(), - ty: DeclarationId(2767), - }, - Field { - label: "MalformedIntegerRangeFact".to_string(), - ty: DeclarationId(2768), - }, - Field { - label: "NominalOpacityViolation".to_string(), - ty: DeclarationId(2769), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 4174, 4405), - }); - declarations.push(Declaration { - id: DeclarationId(1316), - name: Some("DiagnosticDetailExpectation".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "AnyDetail".to_string(), - ty: DeclarationId(2770), - }, - Field { - label: "Contains".to_string(), - ty: DeclarationId(2771), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 4774, 4841), - }); - declarations.push(Declaration { - id: DeclarationId(1317), - name: Some("DiagnosticReference".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "kind".to_string(), - ty: DeclarationId(1315), - }, - Field { - label: "detail_contains".to_string(), - ty: DeclarationId(1316), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 4985, 5083), - }); - declarations.push(Declaration { - id: DeclarationId(1318), - name: Some("PortStateExpectation".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Resolved".to_string(), - ty: DeclarationId(2772), - }, - Field { - label: "Unresolved".to_string(), - ty: DeclarationId(2773), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 5470, 5523), - }); - declarations.push(Declaration { - id: DeclarationId(1319), - name: Some("PerfBudgetComparisonOp".to_string()), - connective: TypeConnective::Disj { - variants: vec![Field { - label: "AtMostBudget".to_string(), - ty: DeclarationId(2774), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 5716, 5760), - }); - declarations.push(Declaration { - id: DeclarationId(1320), - name: Some("AlgebraicLawKind".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Associativity".to_string(), - ty: DeclarationId(2775), - }, - Field { - label: "Commutativity".to_string(), - ty: DeclarationId(2776), - }, - Field { - label: "Identity".to_string(), - ty: DeclarationId(2777), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 6549, 6619), - }); - declarations.push(Declaration { - id: DeclarationId(1321), - name: Some("ProgramGenerator".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "generator".to_string(), - ty: DeclarationId(1353), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 6856, 6909), - }); - declarations.push(Declaration { - id: DeclarationId(1322), - name: Some("ProgramShape".to_string()), - connective: TypeConnective::Disj { - variants: vec![Field { - label: "LiteralProgram".to_string(), - ty: DeclarationId(2778), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 7142, 7231), - }); - declarations.push(Declaration { - id: DeclarationId(1323), - name: Some("SymbolicCostBindParamExpected".to_string()), - connective: TypeConnective::Disj { - variants: vec![Field { - label: "LinearCostForBindParam".to_string(), - ty: DeclarationId(2779), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 7233, 7325), - }); - declarations.push(Declaration { - id: DeclarationId(1324), - name: Some("BindParamSizeVariable".to_string()), - connective: TypeConnective::Disj { - variants: vec![Field { - label: "SelectedBindParamSizeVariable".to_string(), - ty: DeclarationId(2780), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 7327, 7387), - }); - declarations.push(Declaration { - id: DeclarationId(1325), - name: Some("BindParamRef".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "index".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 7389, 7423), - }); - declarations.push(Declaration { - id: DeclarationId(1326), - name: Some("LensCapabilityStructuralStatus".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "LensCapabilityStructuralTerminal".to_string(), - ty: DeclarationId(2781), - }, - Field { - label: "LensCapabilityStructuralPartial".to_string(), - ty: DeclarationId(2782), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 7949, 8057), - }); - declarations.push(Declaration { - id: DeclarationId(1327), - name: Some("LensCapabilityBehavioralStatus".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "LensCapabilityBehavioralComplete".to_string(), - ty: DeclarationId(2783), - }, - Field { - label: "LensCapabilityBehavioralPartial".to_string(), - ty: DeclarationId(2784), - }, - Field { - label: "LensCapabilityBehavioralStub".to_string(), - ty: DeclarationId(2785), - }, - Field { - label: "LensCapabilityBehavioralNA".to_string(), - ty: DeclarationId(2786), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 8059, 8231), - }); - declarations.push(Declaration { - id: DeclarationId(1328), - name: Some("LensCapabilityV2Counterpart".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "LensCapabilityV2RealV2".to_string(), - ty: DeclarationId(2787), - }, - Field { - label: "LensCapabilityV2NoneV3Native".to_string(), - ty: DeclarationId(2788), - }, - Field { - label: "LensCapabilityV2NotApplicable".to_string(), - ty: DeclarationId(2789), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 8233, 8359), - }); - declarations.push(Declaration { - id: DeclarationId(1329), - name: Some("LensCapabilityRegisterRow".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "lens_basename".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "structural".to_string(), - ty: DeclarationId(1326), - }, - Field { - label: "behavioral".to_string(), - ty: DeclarationId(1327), - }, - Field { - label: "v2_counterpart".to_string(), - ty: DeclarationId(1328), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 8361, 8555), - }); - declarations.push(Declaration { - id: DeclarationId(1330), - name: Some("lens_capability_register_rows".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1329), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(2829)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::List(vec![ - FieldValue::Record(vec![ - ( - "lens_basename".to_string(), - FieldValue::Literal(LiteralBits::String("complexity.dag".to_string())), - ), - ( - "structural".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2781), - payload: vec![], - }, - ), - ( - "behavioral".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2783), - payload: vec![], - }, - ), - ( - "v2_counterpart".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2787), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "lens_basename".to_string(), - FieldValue::Literal(LiteralBits::String("cost.dag".to_string())), - ), - ( - "structural".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2781), - payload: vec![], - }, - ), - ( - "behavioral".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2783), - payload: vec![], - }, - ), - ( - "v2_counterpart".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2787), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "lens_basename".to_string(), - FieldValue::Literal(LiteralBits::String( - "cost_target_realization.dag".to_string(), - )), - ), - ( - "structural".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2781), - payload: vec![], - }, - ), - ( - "behavioral".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2786), - payload: vec![], - }, - ), - ( - "v2_counterpart".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2788), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "lens_basename".to_string(), - FieldValue::Literal(LiteralBits::String( - "effect_enumeration.dag".to_string(), - )), - ), - ( - "structural".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2781), - payload: vec![], - }, - ), - ( - "behavioral".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2783), - payload: vec![], - }, - ), - ( - "v2_counterpart".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2788), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "lens_basename".to_string(), - FieldValue::Literal(LiteralBits::String("idempotency.dag".to_string())), - ), - ( - "structural".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2781), - payload: vec![], - }, - ), - ( - "behavioral".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2783), - payload: vec![], - }, - ), - ( - "v2_counterpart".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2788), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "lens_basename".to_string(), - FieldValue::Literal(LiteralBits::String("parallelism.dag".to_string())), - ), - ( - "structural".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2781), - payload: vec![], - }, - ), - ( - "behavioral".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2783), - payload: vec![], - }, - ), - ( - "v2_counterpart".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2788), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "lens_basename".to_string(), - FieldValue::Literal(LiteralBits::String("provenance.dag".to_string())), - ), - ( - "structural".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2781), - payload: vec![], - }, - ), - ( - "behavioral".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2783), - payload: vec![], - }, - ), - ( - "v2_counterpart".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2788), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "lens_basename".to_string(), - FieldValue::Literal(LiteralBits::String( - "unused_parameters.dag".to_string(), - )), - ), - ( - "structural".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2781), - payload: vec![], - }, - ), - ( - "behavioral".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2783), - payload: vec![], - }, - ), - ( - "v2_counterpart".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2788), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "lens_basename".to_string(), - FieldValue::Literal(LiteralBits::String("variant_payload.dag".to_string())), - ), - ( - "structural".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2781), - payload: vec![], - }, - ), - ( - "behavioral".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2783), - payload: vec![], - }, - ), - ( - "v2_counterpart".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2788), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "lens_basename".to_string(), - FieldValue::Literal(LiteralBits::String( - "structural_resolution.dag".to_string(), - )), - ), - ( - "structural".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2781), - payload: vec![], - }, - ), - ( - "behavioral".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2783), - payload: vec![], - }, - ), - ( - "v2_counterpart".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2788), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "lens_basename".to_string(), - FieldValue::Literal(LiteralBits::String("infer_helpers.dag".to_string())), - ), - ( - "structural".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2782), - payload: vec![], - }, - ), - ( - "behavioral".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2786), - payload: vec![], - }, - ), - ( - "v2_counterpart".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2789), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "lens_basename".to_string(), - FieldValue::Literal(LiteralBits::String("lower_helpers.dag".to_string())), - ), - ( - "structural".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2782), - payload: vec![], - }, - ), - ( - "behavioral".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2786), - payload: vec![], - }, - ), - ( - "v2_counterpart".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2789), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "lens_basename".to_string(), - FieldValue::Literal(LiteralBits::String( - "named_function_count.dag".to_string(), - )), - ), - ( - "structural".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2781), - payload: vec![], - }, - ), - ( - "behavioral".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2786), - payload: vec![], - }, - ), - ( - "v2_counterpart".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2789), - payload: vec![], - }, - ), - ]), - ])), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 8557, 11146), - }); - declarations.push(Declaration { - id: DeclarationId(1331), - name: Some("TestPredicate".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Compiles".to_string(), - ty: DeclarationId(2790), - }, - Field { - label: "FailsWithDiagnostic".to_string(), - ty: DeclarationId(2791), - }, - Field { - label: "OutputEquals".to_string(), - ty: DeclarationId(2792), - }, - Field { - label: "PortHasState".to_string(), - ty: DeclarationId(2793), - }, - Field { - label: "DeclarationHasRefinement".to_string(), - ty: DeclarationId(2794), - }, - Field { - label: "CostBounded".to_string(), - ty: DeclarationId(2795), - }, - Field { - label: "BehavioralObservation".to_string(), - ty: DeclarationId(2796), - }, - Field { - label: "MockBackedInvariant".to_string(), - ty: DeclarationId(2797), - }, - Field { - label: "ExecuteCommand".to_string(), - ty: DeclarationId(2799), - }, - Field { - label: "ForAllTargets".to_string(), - ty: DeclarationId(2801), - }, - Field { - label: "LensOutputEquals".to_string(), - ty: DeclarationId(2802), - }, - Field { - label: "DifferentialEquals".to_string(), - ty: DeclarationId(2803), - }, - Field { - label: "SymbolicCostExprEquals".to_string(), - ty: DeclarationId(2804), - }, - Field { - label: "SymbolicCostExprEqualsForBindParam".to_string(), - ty: DeclarationId(2805), - }, - Field { - label: "PerfWithinBaseline".to_string(), - ty: DeclarationId(2806), - }, - Field { - label: "BinaryDimensionReportEquals".to_string(), - ty: DeclarationId(2807), - }, - Field { - label: "AlgebraicLaw".to_string(), - ty: DeclarationId(2808), - }, - Field { - label: "CensusBoundCheck".to_string(), - ty: DeclarationId(2809), - }, - Field { - label: "CensusSubsetCount".to_string(), - ty: DeclarationId(2810), - }, - Field { - label: "FixedPointConverges".to_string(), - ty: DeclarationId(2811), - }, - Field { - label: "RatchetZero".to_string(), - ty: DeclarationId(2812), - }, - Field { - label: "GeneratedFromDag".to_string(), - ty: DeclarationId(2814), - }, - Field { - label: "CementingDispatchMatchesProjection".to_string(), - ty: DeclarationId(2815), - }, - Field { - label: "ReleaseDeferredClaim".to_string(), - ty: DeclarationId(2816), - }, - Field { - label: "SubstrateResearchDeferredClaim".to_string(), - ty: DeclarationId(2817), - }, - Field { - label: "BridgeLedgerZero".to_string(), - ty: DeclarationId(2818), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 11148, 25196), - }); - declarations.push(Declaration { - id: DeclarationId(1332), - name: Some("ProgramInput".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 25304, 25324), - }); - declarations.push(Declaration { - id: DeclarationId(1333), - name: Some("ProgramOutputBind".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "output_ref".to_string(), - ty: DeclarationId(1353), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 25467, 25522), - }); - declarations.push(Declaration { - id: DeclarationId(1334), - name: Some("TestClaim".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "source".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "file_name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "predicate".to_string(), - ty: DeclarationId(1331), - }, - Field { - label: "requires".to_string(), - ty: DeclarationId(2819), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 26132, 26265), - }); - declarations.push(Declaration { - id: DeclarationId(1335), - name: Some("Quantifier".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ForAll".to_string(), - ty: DeclarationId(2820), - }, - Field { - label: "Exists".to_string(), - ty: DeclarationId(2821), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 26446, 26483), - }); - declarations.push(Declaration { - id: DeclarationId(1336), - name: Some("QuantifiedTestClaim".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "generator".to_string(), - ty: DeclarationId(1321), - }, - Field { - label: "quantifier".to_string(), - ty: DeclarationId(1335), - }, - Field { - label: "predicate".to_string(), - ty: DeclarationId(1331), - }, - Field { - label: "requires".to_string(), - ty: DeclarationId(2822), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 26485, 26646), - }); - declarations.push(Declaration { - id: DeclarationId(1337), - name: Some("TestNodeRef".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "EnumeratedTestNode".to_string(), - ty: DeclarationId(2823), - }, - Field { - label: "QuantifiedTestNode".to_string(), - ty: DeclarationId(2824), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 28627, 28721), - }); - declarations.push(Declaration { - id: DeclarationId(1338), - name: Some("TestNodeCostDimension".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "node".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "budget".to_string(), - ty: DeclarationId(1256), - }, - Field { - label: "measured".to_string(), - ty: DeclarationId(1250), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 28723, 28826), - }); - declarations.push(Declaration { - id: DeclarationId(1339), - name: Some("SuiteClaim".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Enumerated".to_string(), - ty: DeclarationId(2825), - }, - Field { - label: "Quantified".to_string(), - ty: DeclarationId(2826), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 29559, 29636), - }); - declarations.push(Declaration { - id: DeclarationId(1340), - name: Some("TestSuite".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "claims".to_string(), - ty: DeclarationId(2827), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 29638, 29698), - }); - declarations.push(Declaration { - id: DeclarationId(1341), - name: Some("TestObligation".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "claim_name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "resources".to_string(), - ty: DeclarationId(2828), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 29896, 29977), - }); - declarations.push(Declaration { - id: DeclarationId(1342), - name: Some("claim_obligation_resources".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1334)], - output: DeclarationId(2755), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/verification.dag", - 30419, - 30435, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 30348, 30435), - }); - declarations.push(Declaration { - id: DeclarationId(1343), - name: Some("obligation_for_claim".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1334)], - output: DeclarationId(1341), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/verification.dag", - 30493, - 30578, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 30437, 30578), - }); - declarations.push(Declaration { - id: DeclarationId(1344), - name: Some("obligation_for_quantified_claim".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1336)], - output: DeclarationId(1341), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/verification.dag", - 30885, - 30951, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 30808, 30951), - }); - declarations.push(Declaration { - id: DeclarationId(1345), - name: Some("obligation_for_suite_claim".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1339)], - output: DeclarationId(1341), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(990))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 31256, 31445), - }); - declarations.push(Declaration { - id: DeclarationId(1346), - name: Some("materialize_test_obligations".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(2756)], - output: DeclarationId(2757), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/verification.dag", - 31529, - 31574, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 31447, 31574), - }); - declarations.push(Declaration { - id: DeclarationId(1347), - name: Some("ValueBehavior".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/v3_l1.dag", 2935, 2956), - }); - declarations.push(Declaration { - id: DeclarationId(1348), - name: Some("Transform".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/v3_l1.dag", 2957, 2974), - }); - declarations.push(Declaration { - id: DeclarationId(1349), - name: Some("Branch".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/v3_l1.dag", 2975, 2989), - }); - declarations.push(Declaration { - id: DeclarationId(1350), - name: Some("Loop".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/v3_l1.dag", 2990, 3002), - }); - declarations.push(Declaration { - id: DeclarationId(1351), - name: Some("Bind".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/v3_l1.dag", 3003, 3015), - }); - declarations.push(Declaration { - id: DeclarationId(1352), - name: Some("Main".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/v3_l1.dag", 3016, 3028), - }); - declarations.push(Declaration { - id: DeclarationId(1353), - name: Some("DeclarationRef".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/v3_l1.dag", 3761, 3783), - }); - declarations.push(Declaration { - id: DeclarationId(1354), - name: Some("go_execution_model".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(890), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(890)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "memory".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2149), - payload: vec![], - }, - ), - ( - "scope".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2152), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 2055, 2157), - }); - declarations.push(Declaration { - id: DeclarationId(1355), - name: Some("go_source_filtering".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(892), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(892)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "internal".to_string(), - FieldValue::Reference(DeclarationId(893)), - ), - ( - "additional_excluded_prefixes".to_string(), - FieldValue::List(vec![FieldValue::Literal(LiteralBits::String( - "src/v3/compiler/".to_string(), - ))]), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 2159, 2309), - }); - declarations.push(Declaration { - id: DeclarationId(1356), - name: Some("go_execution_requirement".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(894), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(894)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Unparsed(SourceSpan::new( - "src/v3/spec/go.dag", - 2370, - 2386, - ))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 2311, 2386), - }); - declarations.push(Declaration { - id: DeclarationId(1357), - name: Some("go_int".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(87)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("int64".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 2388, 2518), - }); - declarations.push(Declaration { - id: DeclarationId(1358), - name: Some("go_int32".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(79)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("int32".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 2520, 2654), - }); - declarations.push(Declaration { - id: DeclarationId(1359), - name: Some("go_integer_inhabit_i32_at_program_bound".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(988), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(988)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "kernel_integer".to_string(), - FieldValue::Reference(DeclarationId(79)), - ), - ( - "algebra".to_string(), - FieldValue::Reference(DeclarationId(79)), - ), - ( - "bound".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2291), - payload: vec![FieldValue::Variant { - constructor: DeclarationId(1958), - payload: vec![ - FieldValue::Literal(LiteralBits::Int( - "-2147483648".to_string(), - )), - FieldValue::Variant { - constructor: DeclarationId(1957), - payload: vec![FieldValue::Variant { - constructor: DeclarationId(1955), - payload: vec![FieldValue::Literal(LiteralBits::Int( - "4294967295".to_string(), - ))], - }], - }, - ], - }], - }, - ), - ( - "type_realization".to_string(), - FieldValue::Reference(DeclarationId(1358)), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 2656, 2959), - }); - declarations.push(Declaration { - id: DeclarationId(1360), - name: Some("go_integer_inhabit_int_platform_dependent".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(988), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(988)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "kernel_integer".to_string(), - FieldValue::Reference(DeclarationId(87)), - ), - ( - "algebra".to_string(), - FieldValue::Reference(DeclarationId(87)), - ), - ( - "bound".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2292), - payload: vec![], - }, - ), - ( - "type_realization".to_string(), - FieldValue::Reference(DeclarationId(1357)), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 3397, 3598), - }); - declarations.push(Declaration { - id: DeclarationId(1361), - name: Some("go_bool".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(124)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("bool".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 3600, 3731), - }); - declarations.push(Declaration { - id: DeclarationId(1362), - name: Some("go_string".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(227)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("string".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 3733, 3870), - }); - declarations.push(Declaration { - id: DeclarationId(1363), - name: Some("go_node_id".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(735)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("NodeId".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 3872, 4010), - }); - declarations.push(Declaration { - id: DeclarationId(1364), - name: Some("go_port_id".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(736)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("PortId".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 4012, 4150), - }); - declarations.push(Declaration { - id: DeclarationId(1365), - name: Some("go_declaration_id".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(737)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("DeclarationId".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 4152, 4311), - }); - declarations.push(Declaration { - id: DeclarationId(1366), - name: Some("go_cluster_id".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(738)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("ClusterId".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 4313, 4460), - }); - declarations.push(Declaration { - id: DeclarationId(1367), - name: Some("go_type_shape".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(789)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("TypeShape".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("declaration".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "declaration".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ])]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 4462, 4703), - }); - declarations.push(Declaration { - id: DeclarationId(1368), - name: Some("go_port_state".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(791)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("PortState".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 4705, 4853), - }); - declarations.push(Declaration { - id: DeclarationId(1369), - name: Some("go_port".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(792)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("DagPort".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("id".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "id".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("state".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "state".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "produced_by".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "produced_by".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 4855, 5238), - }); - declarations.push(Declaration { - id: DeclarationId(1370), - name: Some("go_source_span".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(155)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("SourceSpan".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("file".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "file".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("start".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "byte_start".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("end".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "byte_end".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 5240, 5634), - }); - declarations.push(Declaration { - id: DeclarationId(1371), - name: Some("go_literal_bits".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(793)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("LiteralBits".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 5636, 5790), - }); - declarations.push(Declaration { - id: DeclarationId(1372), - name: Some("go_atom_payload".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(794)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("AtomPayload".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 5792, 5946), - }); - declarations.push(Declaration { - id: DeclarationId(1373), - name: Some("go_cardinality_bound".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(801)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("CardinalityBound".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 5948, 6117), - }); - declarations.push(Declaration { - id: DeclarationId(1374), - name: Some("go_interval".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(797)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("Interval".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 6119, 6263), - }); - declarations.push(Declaration { - id: DeclarationId(1375), - name: Some("go_positive_interval_width".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(795)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String( - "PositiveIntervalWidth".to_string(), - )), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 6265, 6450), - }); - declarations.push(Declaration { - id: DeclarationId(1376), - name: Some("go_interval_width".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(796)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("IntervalWidth".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 6452, 6612), - }); - declarations.push(Declaration { - id: DeclarationId(1377), - name: Some("go_conj_field".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(802)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("ConjField".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("label".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "label".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("ty".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "ty".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 6614, 6916), - }); - declarations.push(Declaration { - id: DeclarationId(1378), - name: Some("go_template_argument".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(803)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("TemplateArgument".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "parameter".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "parameter".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("value".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "value".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 6918, 7255), - }); - declarations.push(Declaration { - id: DeclarationId(1379), - name: Some("go_phantom_parameter".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(811)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("PhantomParameter".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "parameter".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "parameter".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("algebra".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "algebra".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 7257, 7598), - }); - declarations.push(Declaration { - id: DeclarationId(1380), - name: Some("go_nominal_opacity".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(812)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("NominalOpacity".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "permitted_accessors".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "permitted_accessors".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ])]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 7600, 7872), - }); - declarations.push(Declaration { - id: DeclarationId(1381), - name: Some("go_field_entry".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(804)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("FieldEntry".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("label".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "label".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("value".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "value".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 7874, 8185), - }); - declarations.push(Declaration { - id: DeclarationId(1382), - name: Some("go_non_empty_list".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(739)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("NonEmptyList".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("first".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "first".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("rest".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "rest".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 8187, 8503), - }); - declarations.push(Declaration { - id: DeclarationId(1383), - name: Some("go_non_singleton_list".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(741)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("NonSingletonList".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("first".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "first".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("second".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "second".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("rest".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "rest".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 8505, 8914), - }); - declarations.push(Declaration { - id: DeclarationId(1384), - name: Some("go_param_ref".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(822)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("ParamRef".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("member".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2294), - payload: vec![FieldValue::Literal(LiteralBits::String( - "member_of".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("slot".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2294), - payload: vec![FieldValue::Literal(LiteralBits::String( - "slot_of".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 8916, 9232), - }); - declarations.push(Declaration { - id: DeclarationId(1385), - name: Some("go_transform_ref".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(823)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("TransformRef".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("node".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2294), - payload: vec![FieldValue::Literal(LiteralBits::String( - "node_id".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ])]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 9234, 9475), - }); - declarations.push(Declaration { - id: DeclarationId(1386), - name: Some("go_member_descent".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(826)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("MemberDescent".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("param".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "param".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ])]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 9477, 9718), - }); - declarations.push(Declaration { - id: DeclarationId(1387), - name: Some("go_intra_cluster_call".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(827)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("IntraClusterCall".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("transform".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "transform".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ])]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 9720, 9979), - }); - declarations.push(Declaration { - id: DeclarationId(1388), - name: Some("go_cluster".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(828)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("Cluster".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("members".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "members".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "intra_cluster_calls".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "intra_cluster_calls".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 9981, 10314), - }); - declarations.push(Declaration { - id: DeclarationId(1389), - name: Some("go_field_value".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(805)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("FieldValue".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 10316, 10467), - }); - declarations.push(Declaration { - id: DeclarationId(1390), - name: Some("go_value_body".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(806)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("ValueBody".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 10469, 10617), - }); - declarations.push(Declaration { - id: DeclarationId(1391), - name: Some("go_arrow_body".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(808)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("ArrowBody".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 10619, 10767), - }); - declarations.push(Declaration { - id: DeclarationId(1392), - name: Some("go_type_connective".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(809)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("TypeConnective".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 10769, 10932), - }); - declarations.push(Declaration { - id: DeclarationId(1393), - name: Some("go_declaration".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(810)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("Declaration".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("id".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "id".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("name".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "name".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "connective".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "connective".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "type_params".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "type_params".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "phantom_params".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "phantom_params".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "meta_tag".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "meta_tag".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "inhabits".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "inhabits".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "value_body".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "value_body".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "nominal_opacity".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "nominal_opacity".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("span".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "span".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 10934, 11951), - }); - declarations.push(Declaration { - id: DeclarationId(1394), - name: Some("go_arithmetic_op".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(813)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("ArithmeticOp".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 11953, 12110), - }); - declarations.push(Declaration { - id: DeclarationId(1395), - name: Some("go_comparison_op".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(814)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("ComparisonOp".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 12112, 12269), - }); - declarations.push(Declaration { - id: DeclarationId(1396), - name: Some("go_logical_op".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(816)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("LogicalOp".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 12271, 12419), - }); - declarations.push(Declaration { - id: DeclarationId(1397), - name: Some("go_operator_kind".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(817)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("OperatorKind".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 12421, 12578), - }); - declarations.push(Declaration { - id: DeclarationId(1398), - name: Some("go_transform_target".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(818)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("TransformTarget".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 12580, 12746), - }); - declarations.push(Declaration { - id: DeclarationId(1399), - name: Some("go_branch_pattern".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(819)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("BranchPattern".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 12748, 12908), - }); - declarations.push(Declaration { - id: DeclarationId(1400), - name: Some("go_payload_binding".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(820)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("PayloadBinding".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "binding_name".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "binding_name".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "payload_port".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "payload_port".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 12910, 13261), - }); - declarations.push(Declaration { - id: DeclarationId(1401), - name: Some("go_branch_path".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(821)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("BranchPath".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("body".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "body".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "result_port".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "result_port".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("pattern".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "pattern".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("binding".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "binding".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 13263, 13750), - }); - declarations.push(Declaration { - id: DeclarationId(1402), - name: Some("go_loop_bound".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(829)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("LoopBound".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 13752, 13900), - }); - declarations.push(Declaration { - id: DeclarationId(1403), - name: Some("go_value_node".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(831)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("ValueNode".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("id".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "id".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("payload".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "payload".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "result_port".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "result_port".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("span".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "span".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 14374, 14848), - }); - declarations.push(Declaration { - id: DeclarationId(1404), - name: Some("go_transform_node".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(832)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("TransformNode".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("id".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "id".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("target".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "target".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("inputs".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "inputs".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "result_port".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "result_port".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("span".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "span".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 14850, 15415), - }); - declarations.push(Declaration { - id: DeclarationId(1405), - name: Some("go_branch_node".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(834)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("BranchNode".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("id".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "id".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("input".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "input".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("paths".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "paths".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "result_port".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "result_port".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("span".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "span".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "emit_participation".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "emit_participation".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 15417, 16074), - }); - declarations.push(Declaration { - id: DeclarationId(1406), - name: Some("go_loop_node".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(835)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("LoopNode".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("id".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "id".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("source".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "source".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("init".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "init".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("body".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "body".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("bound".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "bound".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "result_port".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "result_port".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("span".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "span".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 16076, 16778), - }); - declarations.push(Declaration { - id: DeclarationId(1407), - name: Some("go_bind_node".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(837)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("BindNode".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("id".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "id".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("name".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "name".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "result_port".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "result_port".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("params".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "params".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("span".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "span".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "emit_participation".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "emit_participation".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 16780, 17431), - }); - declarations.push(Declaration { - id: DeclarationId(1408), - name: Some("go_behavior".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(838)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("Behavior".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 17433, 17577), - }); - declarations.push(Declaration { - id: DeclarationId(1409), - name: Some("go_dag".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(839)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("Dag".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "declarations".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "declarations".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("nodes".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "nodes".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("ports".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "ports".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "clusters".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "clusters".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 17579, 18046), - }); - declarations.push(Declaration { - id: DeclarationId(1410), - name: Some("go_surface_module".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1116)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("SurfaceModule".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("items".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "items".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ])]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 18349, 18590), - }); - declarations.push(Declaration { - id: DeclarationId(1411), - name: Some("go_surface_item".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1130)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("SurfaceItem".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 18592, 18746), - }); - declarations.push(Declaration { - id: DeclarationId(1412), - name: Some("go_surface_param".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1117)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("SurfaceParam".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("name".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "name".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("ty".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "ty".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "refinement".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "refinement".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 18748, 19146), - }); - declarations.push(Declaration { - id: DeclarationId(1413), - name: Some("go_surface_field".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1118)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("SurfaceField".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("name".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "name".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("ty".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "ty".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 19148, 19457), - }); - declarations.push(Declaration { - id: DeclarationId(1414), - name: Some("go_surface_variant".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1119)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("SurfaceVariant".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("name".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "name".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("payload".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "payload".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("span".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "span".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 19459, 19861), - }); - declarations.push(Declaration { - id: DeclarationId(1415), - name: Some("go_variant_payload".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1120)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("VariantPayload".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 19863, 20026), - }); - declarations.push(Declaration { - id: DeclarationId(1416), - name: Some("go_surface_type".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1122)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("SurfaceType".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 20028, 20182), - }); - declarations.push(Declaration { - id: DeclarationId(1417), - name: Some("go_surface_record_field".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1123)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("SurfaceRecordField".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("name".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "name".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("value".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "value".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("span".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "span".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 20184, 20595), - }); - declarations.push(Declaration { - id: DeclarationId(1418), - name: Some("go_surface_map_entry".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1124)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("SurfaceMapEntry".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("key".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "key".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "key_span".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "key_span".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("value".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "value".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("span".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "span".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 20597, 21082), - }); - declarations.push(Declaration { - id: DeclarationId(1419), - name: Some("go_surface_match_arm".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1125)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("SurfaceMatchArm".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("pattern".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "pattern".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("body".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "body".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("span".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "span".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 21084, 21490), - }); - declarations.push(Declaration { - id: DeclarationId(1420), - name: Some("go_surface_pattern_field".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1126)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("SurfacePatternField".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("name".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "name".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("binding".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "binding".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("span".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "span".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 21492, 21910), - }); - declarations.push(Declaration { - id: DeclarationId(1421), - name: Some("go_surface_pattern".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1127)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("SurfacePattern".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 21912, 22075), - }); - declarations.push(Declaration { - id: DeclarationId(1422), - name: Some("go_surface_literal".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1128)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("SurfaceLiteral".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 22077, 22240), - }); - declarations.push(Declaration { - id: DeclarationId(1423), - name: Some("go_surface_expr".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1129)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("SurfaceExpr".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 22242, 22396), - }); - declarations.push(Declaration { - id: DeclarationId(1424), - name: Some("go_int_add".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(87)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(349))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("({lhs} + {rhs})".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 22398, 22539), - }); - declarations.push(Declaration { - id: DeclarationId(1425), - name: Some("go_int_sub".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(87)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(350))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("({lhs} - {rhs})".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 22541, 22682), - }); - declarations.push(Declaration { - id: DeclarationId(1426), - name: Some("go_int_mul".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(87)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(352))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("({lhs} * {rhs})".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 22684, 22825), - }); - declarations.push(Declaration { - id: DeclarationId(1427), - name: Some("go_int_div".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(87)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(354))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String( - "v3intdiv({lhs}, {rhs})".to_string(), - )), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 22827, 22975), - }); - declarations.push(Declaration { - id: DeclarationId(1428), - name: Some("go_int_eq".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(87)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(356))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("({lhs} == {rhs})".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 22977, 23117), - }); - declarations.push(Declaration { - id: DeclarationId(1429), - name: Some("go_node_id_eq".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(735)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(356))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("({lhs} == {rhs})".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 23119, 23266), - }); - declarations.push(Declaration { - id: DeclarationId(1430), - name: Some("go_port_id_eq".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(736)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(356))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("({lhs} == {rhs})".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 23268, 23415), - }); - declarations.push(Declaration { - id: DeclarationId(1431), - name: Some("go_declaration_id_eq".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(737)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(356))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("({lhs} == {rhs})".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 23417, 23578), - }); - declarations.push(Declaration { - id: DeclarationId(1432), - name: Some("go_int_ne".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(87)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(357))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("({lhs} != {rhs})".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 23580, 23720), - }); - declarations.push(Declaration { - id: DeclarationId(1433), - name: Some("go_node_id_ne".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(735)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(357))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("({lhs} != {rhs})".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 23722, 23869), - }); - declarations.push(Declaration { - id: DeclarationId(1434), - name: Some("go_port_id_ne".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(736)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(357))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("({lhs} != {rhs})".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 23871, 24018), - }); - declarations.push(Declaration { - id: DeclarationId(1435), - name: Some("go_declaration_id_ne".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(737)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(357))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("({lhs} != {rhs})".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 24020, 24181), - }); - declarations.push(Declaration { - id: DeclarationId(1436), - name: Some("go_int_lt".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(87)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(358))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("({lhs} < {rhs})".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 24183, 24322), - }); - declarations.push(Declaration { - id: DeclarationId(1437), - name: Some("go_int_le".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(87)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(359))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("({lhs} <= {rhs})".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 24324, 24464), - }); - declarations.push(Declaration { - id: DeclarationId(1438), - name: Some("go_int_gt".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(87)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(360))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("({lhs} > {rhs})".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 24466, 24605), - }); - declarations.push(Declaration { - id: DeclarationId(1439), - name: Some("go_int_ge".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(87)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(361))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("({lhs} >= {rhs})".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 24607, 24747), - }); - declarations.push(Declaration { - id: DeclarationId(1440), - name: Some("go_bool_meet".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(124)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(371))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("({lhs} && {rhs})".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 24749, 24898), - }); - declarations.push(Declaration { - id: DeclarationId(1441), - name: Some("go_bool_join".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(124)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(372))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("({lhs} || {rhs})".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 24900, 25049), - }); - declarations.push(Declaration { - id: DeclarationId(1442), - name: Some("go_let_stmt".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(993), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(993)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1351)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String( - "var {name} {type} = {value}".to_string(), - )), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("0".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 25051, 25184), - }); - declarations.push(Declaration { - id: DeclarationId(1443), - name: Some("go_if_expr".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(993), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(993)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1349)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String( - "if {cond} { {then} } else { {else} }".to_string(), - )), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("0".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 25186, 25329), - }); - declarations.push(Declaration { - id: DeclarationId(1444), - name: Some("go_main_wrap".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(993), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(993)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1352)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String( - "func main() {\n{body}\nfmt.Println({final})\n}".to_string(), - )), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("0".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 25331, 25484), - }); - declarations.push(Declaration { - id: DeclarationId(1445), - name: Some("go_empty_callable".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(994), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(994)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(701)), - ), - ( - "strategy".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2306), - payload: vec![], - }, - ), - ("parameters".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 25486, 25624), - }); - declarations.push(Declaration { - id: DeclarationId(1446), - name: Some("go_singleton_callable".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(994), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(994)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(705)), - ), - ( - "strategy".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2307), - payload: vec![], - }, - ), - ( - "parameters".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "slot".to_string(), - FieldValue::Literal(LiteralBits::Int("0".to_string())), - ), - ( - "disposition".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2297), - payload: vec![], - }, - ), - ])]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 25626, 25818), - }); - declarations.push(Declaration { - id: DeclarationId(1447), - name: Some("go_cons_callable".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(994), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(994)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(703)), - ), - ( - "strategy".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2308), - payload: vec![], - }, - ), - ( - "parameters".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "slot".to_string(), - FieldValue::Literal(LiteralBits::Int("0".to_string())), - ), - ( - "disposition".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2297), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "slot".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ( - "disposition".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2297), - payload: vec![], - }, - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 25820, 26037), - }); - declarations.push(Declaration { - id: DeclarationId(1448), - name: Some("go_concat_callable".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(994), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(994)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(713)), - ), - ( - "strategy".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2309), - payload: vec![], - }, - ), - ( - "parameters".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "slot".to_string(), - FieldValue::Literal(LiteralBits::Int("0".to_string())), - ), - ( - "disposition".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2297), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "slot".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ( - "disposition".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2297), - payload: vec![], - }, - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 26039, 26262), - }); - declarations.push(Declaration { - id: DeclarationId(1449), - name: Some("go_length_callable".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(994), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(994)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(723)), - ), - ( - "strategy".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2310), - payload: vec![], - }, - ), - ( - "parameters".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "slot".to_string(), - FieldValue::Literal(LiteralBits::Int("0".to_string())), - ), - ( - "disposition".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2296), - payload: vec![], - }, - ), - ])]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 26264, 26447), - }); - declarations.push(Declaration { - id: DeclarationId(1450), - name: Some("go_list_instantiation".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1002), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1002)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(699)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("[]{element}".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 26449, 26585), - }); - declarations.push(Declaration { - id: DeclarationId(1451), - name: Some("go_result_instantiation".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1002), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1002)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(11)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String( - "v3Result[{key}, {value}]".to_string(), - )), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 27271, 27424), - }); - declarations.push(Declaration { - id: DeclarationId(1452), - name: Some("go_map_instantiation".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1002), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1002)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(133)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("map[{key}]{value}".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 27426, 27566), - }); - declarations.push(Declaration { - id: DeclarationId(1453), - name: Some("go_is_empty_callable".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(994), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(994)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(725)), - ), - ( - "strategy".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2311), - payload: vec![], - }, - ), - ( - "parameters".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "slot".to_string(), - FieldValue::Literal(LiteralBits::Int("0".to_string())), - ), - ( - "disposition".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2296), - payload: vec![], - }, - ), - ])]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 27568, 27756), - }); - declarations.push(Declaration { - id: DeclarationId(1454), - name: Some("go_fold_callable".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(994), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(994)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(707)), - ), - ( - "strategy".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2312), - payload: vec![], - }, - ), - ( - "parameters".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "slot".to_string(), - FieldValue::Literal(LiteralBits::Int("0".to_string())), - ), - ( - "disposition".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2296), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "slot".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ( - "disposition".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2297), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "slot".to_string(), - FieldValue::Literal(LiteralBits::Int("2".to_string())), - ), - ( - "disposition".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2296), - payload: vec![], - }, - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 27758, 28015), - }); - declarations.push(Declaration { - id: DeclarationId(1455), - name: Some("go_map_callable".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(994), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(994)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(715)), - ), - ( - "strategy".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2313), - payload: vec![], - }, - ), - ( - "parameters".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "slot".to_string(), - FieldValue::Literal(LiteralBits::Int("0".to_string())), - ), - ( - "disposition".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2296), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "slot".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ( - "disposition".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2296), - payload: vec![], - }, - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 28017, 28231), - }); - declarations.push(Declaration { - id: DeclarationId(1456), - name: Some("go_filter_callable".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(994), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(994)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(718)), - ), - ( - "strategy".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2314), - payload: vec![], - }, - ), - ( - "parameters".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "slot".to_string(), - FieldValue::Literal(LiteralBits::Int("0".to_string())), - ), - ( - "disposition".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2296), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "slot".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ( - "disposition".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2296), - payload: vec![], - }, - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 28233, 28456), - }); - declarations.push(Declaration { - id: DeclarationId(1457), - name: Some("go_contains_callable".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(994), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(994)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(733)), - ), - ( - "strategy".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2315), - payload: vec![], - }, - ), - ( - "parameters".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "slot".to_string(), - FieldValue::Literal(LiteralBits::Int("0".to_string())), - ), - ( - "disposition".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2296), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "slot".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ( - "disposition".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2296), - payload: vec![], - }, - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 28458, 28687), - }); - declarations.push(Declaration { - id: DeclarationId(1458), - name: Some("go_list_pattern".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1004), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1004)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(699)), - ), - ( - "strategy".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2317), - payload: vec![], - }, - ), - ( - "empty_variant".to_string(), - FieldValue::Reference(DeclarationId(1870)), - ), - ( - "cons_variant".to_string(), - FieldValue::Reference(DeclarationId(1872)), - ), - ( - "scrutinee".to_string(), - FieldValue::Literal(LiteralBits::String("{expr}".to_string())), - ), - ( - "empty_pattern".to_string(), - FieldValue::Literal(LiteralBits::String("len({expr}) == 0".to_string())), - ), - ( - "cons_pattern".to_string(), - FieldValue::Literal(LiteralBits::String("{expr}".to_string())), - ), - ( - "head_expr".to_string(), - FieldValue::Literal(LiteralBits::String("{list}[0]".to_string())), - ), - ( - "tail_expr".to_string(), - FieldValue::Literal(LiteralBits::String("{list}[1:]".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 28774, 29080), - }); - declarations.push(Declaration { - id: DeclarationId(1459), - name: Some("go_statements".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1006), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1006)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "let_binding".to_string(), - FieldValue::Literal(LiteralBits::String( - "var {name} {type} = {value}".to_string(), - )), - ), - ( - "let_binding_inferred".to_string(), - FieldValue::Literal(LiteralBits::String("{name} := {value}".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 29082, 29212), - }); - declarations.push(Declaration { - id: DeclarationId(1460), - name: Some("go_expressions".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1007), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1007)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "field_access".to_string(), - FieldValue::Literal(LiteralBits::String("({object}).{field}".to_string())), - ), - ( - "function_call".to_string(), - FieldValue::Literal(LiteralBits::String("{func}({args})".to_string())), - ), - ( - "closure".to_string(), - FieldValue::Literal(LiteralBits::String( - "func({params}) { return {body} }".to_string(), - )), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 29214, 29374), - }); - declarations.push(Declaration { - id: DeclarationId(1461), - name: Some("go_control_flow".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1009), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1009)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "if_else".to_string(), - FieldValue::Literal(LiteralBits::String( - "if {cond} { {then} } else { {else} }".to_string(), - )), - ), - ( - "match_arm".to_string(), - FieldValue::Literal(LiteralBits::String( - "{pattern}: return {body}".to_string(), - )), - ), - ( - "for_each_syntax".to_string(), - FieldValue::Record(vec![ - ( - "prefix".to_string(), - FieldValue::Literal(LiteralBits::String("for _, ".to_string())), - ), - ( - "separator".to_string(), - FieldValue::Literal(LiteralBits::String(" := range ".to_string())), - ), - ]), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 29376, 29577), - }); - declarations.push(Declaration { - id: DeclarationId(1462), - name: Some("go_literals".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1010), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1010)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "true_keyword".to_string(), - FieldValue::Literal(LiteralBits::String("true".to_string())), - ), - ( - "false_keyword".to_string(), - FieldValue::Literal(LiteralBits::String("false".to_string())), - ), - ( - "string_delimiter".to_string(), - FieldValue::Literal(LiteralBits::String("%Q".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 29579, 29689), - }); - declarations.push(Declaration { - id: DeclarationId(1463), - name: Some("go_modules".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1011), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1011)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "path_separator".to_string(), - FieldValue::Literal(LiteralBits::String(".".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 29691, 29748), - }); - declarations.push(Declaration { - id: DeclarationId(1464), - name: Some("go_functions".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1012), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1012)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "definition".to_string(), - FieldValue::Literal(LiteralBits::String( - "func {name}({params}) {ret} { return {body} }".to_string(), - )), - ), - ( - "definition_exported".to_string(), - FieldValue::Literal(LiteralBits::String( - "func {name}({params}) {ret} { return {body} }".to_string(), - )), - ), - ( - "definition_void".to_string(), - FieldValue::Literal(LiteralBits::String( - "func {name}({params}) { {body} }".to_string(), - )), - ), - ( - "param_with_type".to_string(), - FieldValue::Literal(LiteralBits::String("{name} {type}".to_string())), - ), - ( - "param_separator".to_string(), - FieldValue::Literal(LiteralBits::String(", ".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 29750, 30035), - }); - declarations.push(Declaration { - id: DeclarationId(1465), - name: Some("go_type_applications".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1013), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1013)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "optional".to_string(), - FieldValue::Literal(LiteralBits::String("*{element}".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 30037, 30116), - }); - declarations.push(Declaration { - id: DeclarationId(1466), - name: Some("go_type_defs".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1014), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1014)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "struct_def".to_string(), - FieldValue::Literal(LiteralBits::String( - "type {name} struct { {fields} }".to_string(), - )), - ), - ( - "struct_field".to_string(), - FieldValue::Literal(LiteralBits::String("{name} {type}".to_string())), - ), - ( - "enum_def".to_string(), - FieldValue::Literal(LiteralBits::String( - "type {name} interface{}".to_string(), - )), - ), - ( - "enum_unit_variant".to_string(), - FieldValue::Literal(LiteralBits::String("{name}".to_string())), - ), - ( - "enum_data_variant".to_string(), - FieldValue::Literal(LiteralBits::String("{name}".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 30118, 30341), - }); - declarations.push(Declaration { - id: DeclarationId(1467), - name: Some("go_patterns".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1016), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1016)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "match_expr".to_string(), - FieldValue::Literal(LiteralBits::String("{expr}".to_string())), - ), - ( - "match_arm".to_string(), - FieldValue::Literal(LiteralBits::String( - "{pattern}: return {body}".to_string(), - )), - ), - ( - "variant_pattern".to_string(), - FieldValue::Literal(LiteralBits::String("{name}".to_string())), - ), - ( - "variant_pattern_positional".to_string(), - FieldValue::Literal(LiteralBits::String("{name}".to_string())), - ), - ( - "variant_pattern_empty".to_string(), - FieldValue::Literal(LiteralBits::String("{name}".to_string())), - ), - ( - "field_binding".to_string(), - FieldValue::Literal(LiteralBits::String("{field}: {binding}".to_string())), - ), - ( - "field_binding_separator".to_string(), - FieldValue::Literal(LiteralBits::String(", ".to_string())), - ), - ( - "wildcard".to_string(), - FieldValue::Literal(LiteralBits::String("_".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 30343, 30635), - }); - declarations.push(Declaration { - id: DeclarationId(1468), - name: Some("go_collection_ops".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1017), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1017)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "concat_contract".to_string(), - FieldValue::Reference(DeclarationId(1087)), - ), - ( - "length_contract".to_string(), - FieldValue::Reference(DeclarationId(1088)), - ), - ( - "is_empty_contract".to_string(), - FieldValue::Reference(DeclarationId(1089)), - ), - ( - "fold_contract".to_string(), - FieldValue::Reference(DeclarationId(1090)), - ), - ( - "filter_contract".to_string(), - FieldValue::Reference(DeclarationId(1092)), - ), - ( - "flat_map_contract".to_string(), - FieldValue::Reference(DeclarationId(1095)), - ), - ( - "any_contract".to_string(), - FieldValue::Reference(DeclarationId(1093)), - ), - ( - "all_contract".to_string(), - FieldValue::Reference(DeclarationId(1094)), - ), - ( - "map_contract".to_string(), - FieldValue::Reference(DeclarationId(1091)), - ), - ( - "filter".to_string(), - FieldValue::Literal(LiteralBits::String( - "/* filter({recv}, {body}) */".to_string(), - )), - ), - ( - "contains".to_string(), - FieldValue::Literal(LiteralBits::String( - "/* contains({recv}, {item}) */".to_string(), - )), - ), - ( - "empty_list".to_string(), - FieldValue::Literal(LiteralBits::String("nil".to_string())), - ), - ( - "list_literal".to_string(), - FieldValue::Literal(LiteralBits::String( - "[]{element_type}{{{elements}}}".to_string(), - )), - ), - ( - "cons".to_string(), - FieldValue::Literal(LiteralBits::String( - "append([]{element_type}{{{head}}}, {tail}...)".to_string(), - )), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 30637, 31402), - }); - declarations.push(Declaration { - id: DeclarationId(1469), - name: Some("go_value_construction".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1018), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1018)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "struct_literal".to_string(), - FieldValue::Literal(LiteralBits::String( - "{type}{{ {fields} }}".to_string(), - )), - ), - ( - "struct_field_init".to_string(), - FieldValue::Literal(LiteralBits::String("{name}: {value}".to_string())), - ), - ( - "struct_field_separator".to_string(), - FieldValue::Literal(LiteralBits::String(", ".to_string())), - ), - ( - "variant_construction".to_string(), - FieldValue::Literal(LiteralBits::String("{variant}({args})".to_string())), - ), - ( - "variant_named_construction".to_string(), - FieldValue::Literal(LiteralBits::String( - "{variant}{{ {fields} }}".to_string(), - )), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 31404, 31672), - }); - declarations.push(Declaration { - id: DeclarationId(1470), - name: Some("go_record_derive_templates".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1015), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1015)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "struct_def_no_debug".to_string(), - FieldValue::Literal(LiteralBits::String("".to_string())), - ), - ( - "enum_def_no_debug".to_string(), - FieldValue::Literal(LiteralBits::String("".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 32429, 32544), - }); - declarations.push(Declaration { - id: DeclarationId(1471), - name: Some("go_language".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1022), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1022)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "statements".to_string(), - FieldValue::Reference(DeclarationId(1459)), - ), - ( - "expressions".to_string(), - FieldValue::Reference(DeclarationId(1460)), - ), - ( - "control_flow".to_string(), - FieldValue::Reference(DeclarationId(1461)), - ), - ( - "literals".to_string(), - FieldValue::Reference(DeclarationId(1462)), - ), - ( - "modules".to_string(), - FieldValue::Reference(DeclarationId(1463)), - ), - ( - "functions".to_string(), - FieldValue::Reference(DeclarationId(1464)), - ), - ( - "type_applications".to_string(), - FieldValue::Reference(DeclarationId(1465)), - ), - ( - "type_definitions".to_string(), - FieldValue::Reference(DeclarationId(1466)), - ), - ( - "record_derive_templates".to_string(), - FieldValue::Reference(DeclarationId(1470)), - ), - ( - "patterns".to_string(), - FieldValue::Reference(DeclarationId(1467)), - ), - ( - "collection_ops".to_string(), - FieldValue::Reference(DeclarationId(1468)), - ), - ( - "values".to_string(), - FieldValue::Reference(DeclarationId(1469)), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 32546, 32965), - }); - declarations.push(Declaration { - id: DeclarationId(1472), - name: Some("go_correction_style".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1035), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1035)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "indent_unit".to_string(), - FieldValue::Literal(LiteralBits::String("\t".to_string())), - ), - ( - "line_ending".to_string(), - FieldValue::Literal(LiteralBits::String("\n".to_string())), - ), - ( - "string_quote".to_string(), - FieldValue::Literal(LiteralBits::String("%Q".to_string())), - ), - ( - "trailing_semicolon".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 34632, 34768), - }); - declarations.push(Declaration { - id: DeclarationId(1473), - name: Some("go_clean_emission".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1026), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1026)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "expression_wrapping".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2327), - payload: vec![], - }, - ), - ( - "pattern_bindings".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2330), - payload: vec![], - }, - ), - ( - "variant_payload_field_access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2333), - payload: vec![], - }, - ), - ( - "imports".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2336), - payload: vec![], - }, - ), - ( - "block_return".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2340), - payload: vec![], - }, - ), - ( - "variable_bindings".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2342), - payload: vec![], - }, - ), - ( - "match_arm_body".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2346), - payload: vec![], - }, - ), - ( - "correction_style".to_string(), - FieldValue::Reference(DeclarationId(1472)), - ), - ( - "post_emit_verifier".to_string(), - FieldValue::Record(vec![ - ( - "command".to_string(), - FieldValue::Literal(LiteralBits::String("gofmt".to_string())), - ), - ( - "args".to_string(), - FieldValue::List(vec![FieldValue::Literal(LiteralBits::String( - "-l".to_string(), - ))]), - ), - ( - "syntax_only".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ( - "expected_exit_code".to_string(), - FieldValue::Literal(LiteralBits::Int("0".to_string())), - ), - ( - "output_policy".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2349), - payload: vec![], - }, - ), - ]), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 34770, 35328), - }); - declarations.push(Declaration { - id: DeclarationId(1474), - name: Some("go_clean_emission_binding".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1027), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1027)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1471)), - ), - ( - "clean_emission".to_string(), - FieldValue::Reference(DeclarationId(1473)), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/go.dag", 35330, 35454), - }); - declarations.push(Declaration { - id: DeclarationId(1475), - name: Some("python_statements".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1006), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1006)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "let_binding".to_string(), - FieldValue::Literal(LiteralBits::String("{name} = {value}".to_string())), - ), - ( - "let_binding_inferred".to_string(), - FieldValue::Literal(LiteralBits::String("{name} = {value}".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 2347, 2469), - }); - declarations.push(Declaration { - id: DeclarationId(1476), - name: Some("python_expressions".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1007), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1007)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "field_access".to_string(), - FieldValue::Literal(LiteralBits::String("{object}.{field}".to_string())), - ), - ( - "function_call".to_string(), - FieldValue::Literal(LiteralBits::String("{func}({args})".to_string())), - ), - ( - "closure".to_string(), - FieldValue::Literal(LiteralBits::String( - "lambda {params}: {body}".to_string(), - )), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 2471, 2624), - }); - declarations.push(Declaration { - id: DeclarationId(1477), - name: Some("python_control_flow".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1009), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1009)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "if_else".to_string(), - FieldValue::Literal(LiteralBits::String( - "({then} if {cond} else {else})".to_string(), - )), - ), - ( - "match_arm".to_string(), - FieldValue::Literal(LiteralBits::String("{pattern}: {body}".to_string())), - ), - ( - "for_each_syntax".to_string(), - FieldValue::Record(vec![ - ( - "prefix".to_string(), - FieldValue::Literal(LiteralBits::String( - "for {item} in {iter}:\n{body}".to_string(), - )), - ), - ( - "separator".to_string(), - FieldValue::Literal(LiteralBits::String("\n".to_string())), - ), - ]), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 2626, 2841), - }); - declarations.push(Declaration { - id: DeclarationId(1478), - name: Some("python_literals".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1010), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1010)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "true_keyword".to_string(), - FieldValue::Literal(LiteralBits::String("True".to_string())), - ), - ( - "false_keyword".to_string(), - FieldValue::Literal(LiteralBits::String("False".to_string())), - ), - ( - "string_delimiter".to_string(), - FieldValue::Literal(LiteralBits::String("%Q".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 2843, 2957), - }); - declarations.push(Declaration { - id: DeclarationId(1479), - name: Some("python_modules".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1011), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1011)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "path_separator".to_string(), - FieldValue::Literal(LiteralBits::String(".".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 2959, 3020), - }); - declarations.push(Declaration { - id: DeclarationId(1480), - name: Some("python_functions".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1012), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1012)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "definition".to_string(), - FieldValue::Literal(LiteralBits::String( - "def {name}({params}) -> {ret}:\n return {body}".to_string(), - )), - ), - ( - "definition_exported".to_string(), - FieldValue::Literal(LiteralBits::String( - "def {name}({params}) -> {ret}:\n return {body}".to_string(), - )), - ), - ( - "definition_void".to_string(), - FieldValue::Literal(LiteralBits::String( - "def {name}({params}) -> None:\n {body}".to_string(), - )), - ), - ( - "param_with_type".to_string(), - FieldValue::Literal(LiteralBits::String("{name}: {type}".to_string())), - ), - ( - "param_separator".to_string(), - FieldValue::Literal(LiteralBits::String(", ".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 3022, 3329), - }); - declarations.push(Declaration { - id: DeclarationId(1481), - name: Some("python_type_applications".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1013), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1013)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "optional".to_string(), - FieldValue::Literal(LiteralBits::String( - "typing.Optional[{element}]".to_string(), - )), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 3331, 3430), - }); - declarations.push(Declaration { - id: DeclarationId(1482), - name: Some("python_type_definitions".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1014), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1014)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "struct_def".to_string(), - FieldValue::Literal(LiteralBits::String( - "@dataclass\nclass {name}:\n{fields}".to_string(), - )), - ), - ( - "struct_field".to_string(), - FieldValue::Literal(LiteralBits::String("{name}: {type}".to_string())), - ), - ( - "enum_def".to_string(), - FieldValue::Literal(LiteralBits::String( - "class {name}:\n pass\n\n{variants}".to_string(), - )), - ), - ( - "enum_unit_variant".to_string(), - FieldValue::Literal(LiteralBits::String( - "@dataclass\nclass {name}({parent}):\n pass".to_string(), - )), - ), - ( - "enum_data_variant".to_string(), - FieldValue::Literal(LiteralBits::String( - "@dataclass\nclass {name}({parent}):\n{fields}".to_string(), - )), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 3432, 3763), - }); - declarations.push(Declaration { - id: DeclarationId(1483), - name: Some("python_patterns".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1016), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1016)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "match_expr".to_string(), - FieldValue::Literal(LiteralBits::String( - "match {expr} { {arms} }".to_string(), - )), - ), - ( - "match_arm".to_string(), - FieldValue::Literal(LiteralBits::String("{pattern}: {body}".to_string())), - ), - ( - "variant_pattern".to_string(), - FieldValue::Literal(LiteralBits::String("{name}({bindings})".to_string())), - ), - ( - "variant_pattern_positional".to_string(), - FieldValue::Literal(LiteralBits::String("{name}({binding})".to_string())), - ), - ( - "variant_pattern_empty".to_string(), - FieldValue::Literal(LiteralBits::String("{name}()".to_string())), - ), - ( - "field_binding".to_string(), - FieldValue::Literal(LiteralBits::String("{field}={binding}".to_string())), - ), - ( - "field_binding_separator".to_string(), - FieldValue::Literal(LiteralBits::String(", ".to_string())), - ), - ( - "wildcard".to_string(), - FieldValue::Literal(LiteralBits::String("_".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 3765, 4095), - }); - declarations.push(Declaration { - id: DeclarationId(1484), - name: Some("python_collections".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1017), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1017)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "concat_contract".to_string(), - FieldValue::Reference(DeclarationId(1131)), - ), - ( - "length_contract".to_string(), - FieldValue::Reference(DeclarationId(1132)), - ), - ( - "is_empty_contract".to_string(), - FieldValue::Reference(DeclarationId(1133)), - ), - ( - "fold_contract".to_string(), - FieldValue::Reference(DeclarationId(1134)), - ), - ( - "filter_contract".to_string(), - FieldValue::Reference(DeclarationId(1136)), - ), - ( - "flat_map_contract".to_string(), - FieldValue::Reference(DeclarationId(1139)), - ), - ( - "any_contract".to_string(), - FieldValue::Reference(DeclarationId(1137)), - ), - ( - "all_contract".to_string(), - FieldValue::Reference(DeclarationId(1138)), - ), - ( - "map_contract".to_string(), - FieldValue::Reference(DeclarationId(1135)), - ), - ( - "filter".to_string(), - FieldValue::Literal(LiteralBits::String( - "[{item_push} for {item} in {recv} if {predicate}]".to_string(), - )), - ), - ( - "contains".to_string(), - FieldValue::Literal(LiteralBits::String("({item} in {recv})".to_string())), - ), - ( - "empty_list".to_string(), - FieldValue::Literal(LiteralBits::String("[]".to_string())), - ), - ( - "list_literal".to_string(), - FieldValue::Literal(LiteralBits::String("[{elements}]".to_string())), - ), - ( - "cons".to_string(), - FieldValue::Literal(LiteralBits::String("[{head}, *{tail}]".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 4097, 4861), - }); - declarations.push(Declaration { - id: DeclarationId(1485), - name: Some("python_value_construction".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1018), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1018)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "struct_literal".to_string(), - FieldValue::Literal(LiteralBits::String("{name}({fields})".to_string())), - ), - ( - "struct_field_init".to_string(), - FieldValue::Literal(LiteralBits::String("{field}={value}".to_string())), - ), - ( - "struct_field_separator".to_string(), - FieldValue::Literal(LiteralBits::String(", ".to_string())), - ), - ( - "variant_construction".to_string(), - FieldValue::Literal(LiteralBits::String("{name}()".to_string())), - ), - ( - "variant_named_construction".to_string(), - FieldValue::Literal(LiteralBits::String("{name}({fields})".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 4863, 5115), - }); - declarations.push(Declaration { - id: DeclarationId(1486), - name: Some("python_record_derive_templates".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1015), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1015)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "struct_def_no_debug".to_string(), - FieldValue::Literal(LiteralBits::String("".to_string())), - ), - ( - "enum_def_no_debug".to_string(), - FieldValue::Literal(LiteralBits::String("".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 5318, 5437), - }); - declarations.push(Declaration { - id: DeclarationId(1487), - name: Some("python_language".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1022), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1022)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "statements".to_string(), - FieldValue::Reference(DeclarationId(1475)), - ), - ( - "expressions".to_string(), - FieldValue::Reference(DeclarationId(1476)), - ), - ( - "control_flow".to_string(), - FieldValue::Reference(DeclarationId(1477)), - ), - ( - "literals".to_string(), - FieldValue::Reference(DeclarationId(1478)), - ), - ( - "modules".to_string(), - FieldValue::Reference(DeclarationId(1479)), - ), - ( - "functions".to_string(), - FieldValue::Reference(DeclarationId(1480)), - ), - ( - "type_applications".to_string(), - FieldValue::Reference(DeclarationId(1481)), - ), - ( - "type_definitions".to_string(), - FieldValue::Reference(DeclarationId(1482)), - ), - ( - "record_derive_templates".to_string(), - FieldValue::Reference(DeclarationId(1486)), - ), - ( - "patterns".to_string(), - FieldValue::Reference(DeclarationId(1483)), - ), - ( - "collection_ops".to_string(), - FieldValue::Reference(DeclarationId(1484)), - ), - ( - "values".to_string(), - FieldValue::Reference(DeclarationId(1485)), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 5439, 5914), - }); - declarations.push(Declaration { - id: DeclarationId(1488), - name: Some("python_target".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(890), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(890)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "memory".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2149), - payload: vec![], - }, - ), - ( - "scope".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2152), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 5916, 6013), - }); - declarations.push(Declaration { - id: DeclarationId(1489), - name: Some("python_source_filtering".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(892), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(892)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "internal".to_string(), - FieldValue::Reference(DeclarationId(893)), - ), - ( - "additional_excluded_prefixes".to_string(), - FieldValue::List(vec![]), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 6015, 6151), - }); - declarations.push(Declaration { - id: DeclarationId(1490), - name: Some("python_execution_requirement".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(894), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(894)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Unparsed(SourceSpan::new( - "src/v3/spec/python.dag", - 6216, - 6232, - ))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 6153, 6232), - }); - declarations.push(Declaration { - id: DeclarationId(1491), - name: Some("python_int".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(87)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("int".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 6234, 6370), - }); - declarations.push(Declaration { - id: DeclarationId(1492), - name: Some("python_integer_inhabit_at_i32_program_bound".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(988), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(988)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "kernel_integer".to_string(), - FieldValue::Reference(DeclarationId(87)), - ), - ( - "algebra".to_string(), - FieldValue::Reference(DeclarationId(87)), - ), - ( - "bound".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2291), - payload: vec![FieldValue::Variant { - constructor: DeclarationId(1958), - payload: vec![ - FieldValue::Literal(LiteralBits::Int( - "-2147483648".to_string(), - )), - FieldValue::Variant { - constructor: DeclarationId(1957), - payload: vec![FieldValue::Variant { - constructor: DeclarationId(1955), - payload: vec![FieldValue::Literal(LiteralBits::Int( - "4294967295".to_string(), - ))], - }], - }, - ], - }], - }, - ), - ( - "type_realization".to_string(), - FieldValue::Reference(DeclarationId(1491)), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 6463, 6772), - }); - declarations.push(Declaration { - id: DeclarationId(1493), - name: Some("python_integer_inhabit_unbounded_decl".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(988), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(988)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "kernel_integer".to_string(), - FieldValue::Reference(DeclarationId(87)), - ), - ( - "algebra".to_string(), - FieldValue::Reference(DeclarationId(87)), - ), - ( - "bound".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2291), - payload: vec![FieldValue::Variant { - constructor: DeclarationId(1959), - payload: vec![], - }], - }, - ), - ( - "type_realization".to_string(), - FieldValue::Reference(DeclarationId(1491)), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 6850, 7060), - }); - declarations.push(Declaration { - id: DeclarationId(1494), - name: Some("python_bool".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(124)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("bool".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 7062, 7201), - }); - declarations.push(Declaration { - id: DeclarationId(1495), - name: Some("python_string".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(227)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("str".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 7203, 7345), - }); - declarations.push(Declaration { - id: DeclarationId(1496), - name: Some("python_node_id".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(735)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("NodeId".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 7347, 7493), - }); - declarations.push(Declaration { - id: DeclarationId(1497), - name: Some("python_port_id".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(736)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("PortId".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 7495, 7641), - }); - declarations.push(Declaration { - id: DeclarationId(1498), - name: Some("python_declaration_id".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(737)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("DeclarationId".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 7643, 7810), - }); - declarations.push(Declaration { - id: DeclarationId(1499), - name: Some("python_declaration_ref".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1353)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("DeclarationId".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 7812, 7981), - }); - declarations.push(Declaration { - id: DeclarationId(1500), - name: Some("python_source_span".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(155)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("SourceSpan".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 7983, 8142), - }); - declarations.push(Declaration { - id: DeclarationId(1501), - name: Some("python_dag_port".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(792)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("DagPort".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 8144, 8294), - }); - declarations.push(Declaration { - id: DeclarationId(1502), - name: Some("python_branch_path".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(821)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("BranchPath".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 8296, 8455), - }); - declarations.push(Declaration { - id: DeclarationId(1503), - name: Some("python_value_node".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(831)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("ValueNode".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 8457, 8613), - }); - declarations.push(Declaration { - id: DeclarationId(1504), - name: Some("python_transform_node".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(832)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("TransformNode".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 8615, 8783), - }); - declarations.push(Declaration { - id: DeclarationId(1505), - name: Some("python_branch_node".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(834)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("BranchNode".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 8785, 8944), - }); - declarations.push(Declaration { - id: DeclarationId(1506), - name: Some("python_loop_node".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(835)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("LoopNode".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 8946, 9099), - }); - declarations.push(Declaration { - id: DeclarationId(1507), - name: Some("python_bind_node".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(837)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("BindNode".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 9101, 9254), - }); - declarations.push(Declaration { - id: DeclarationId(1508), - name: Some("python_behavior".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(838)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("Behavior".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 9256, 9408), - }); - declarations.push(Declaration { - id: DeclarationId(1509), - name: Some("python_dag".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(839)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("Dag".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 9410, 9547), - }); - declarations.push(Declaration { - id: DeclarationId(1510), - name: Some("python_surface_module".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1116)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("SurfaceModule".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("items".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "items".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ])]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 9621, 9870), - }); - declarations.push(Declaration { - id: DeclarationId(1511), - name: Some("python_surface_item".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1130)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("SurfaceItem".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 9872, 10034), - }); - declarations.push(Declaration { - id: DeclarationId(1512), - name: Some("python_surface_param".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1117)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("SurfaceParam".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("name".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "name".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("ty".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "ty".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "refinement".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "refinement".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 10036, 10442), - }); - declarations.push(Declaration { - id: DeclarationId(1513), - name: Some("python_surface_field".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1118)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("SurfaceField".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("name".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "name".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("ty".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "ty".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 10444, 10761), - }); - declarations.push(Declaration { - id: DeclarationId(1514), - name: Some("python_surface_variant".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1119)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("SurfaceVariant".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("name".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "name".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("payload".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "payload".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("span".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "span".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 10763, 11173), - }); - declarations.push(Declaration { - id: DeclarationId(1515), - name: Some("python_variant_payload".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1120)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("VariantPayload".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 11175, 11346), - }); - declarations.push(Declaration { - id: DeclarationId(1516), - name: Some("python_surface_type".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1122)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("SurfaceType".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 11348, 11510), - }); - declarations.push(Declaration { - id: DeclarationId(1517), - name: Some("python_surface_record_field".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1123)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("SurfaceRecordField".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("name".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "name".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("value".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "value".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("span".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "span".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 11512, 11931), - }); - declarations.push(Declaration { - id: DeclarationId(1518), - name: Some("python_surface_map_entry".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1124)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("SurfaceMapEntry".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("key".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "key".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "key_span".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "key_span".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("value".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "value".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("span".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "span".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 11933, 12426), - }); - declarations.push(Declaration { - id: DeclarationId(1519), - name: Some("python_surface_match_arm".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1125)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("SurfaceMatchArm".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("pattern".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "pattern".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("body".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "body".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("span".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "span".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 12428, 12842), - }); - declarations.push(Declaration { - id: DeclarationId(1520), - name: Some("python_surface_pattern_field".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1126)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("SurfacePatternField".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("name".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "name".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("binding".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "binding".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("span".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "span".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 12844, 13270), - }); - declarations.push(Declaration { - id: DeclarationId(1521), - name: Some("python_surface_pattern".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1127)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("SurfacePattern".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 13272, 13443), - }); - declarations.push(Declaration { - id: DeclarationId(1522), - name: Some("python_surface_literal".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1128)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("SurfaceLiteral".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 13445, 13616), - }); - declarations.push(Declaration { - id: DeclarationId(1523), - name: Some("python_surface_expr".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1129)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("SurfaceExpr".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 13618, 13780), - }); - declarations.push(Declaration { - id: DeclarationId(1524), - name: Some("python_int_add".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(87)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(349))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("({lhs} + {rhs})".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 13782, 13931), - }); - declarations.push(Declaration { - id: DeclarationId(1525), - name: Some("python_int_sub".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(87)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(350))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("({lhs} - {rhs})".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 13933, 14082), - }); - declarations.push(Declaration { - id: DeclarationId(1526), - name: Some("python_int_mul".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(87)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(352))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("({lhs} * {rhs})".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 14084, 14233), - }); - declarations.push(Declaration { - id: DeclarationId(1527), - name: Some("python_int_div".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(87)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(354))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String( - "(__v3_idiv({lhs}, {rhs}))".to_string(), - )), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 14235, 14394), - }); - declarations.push(Declaration { - id: DeclarationId(1528), - name: Some("python_int_eq".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(87)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(356))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("({lhs} == {rhs})".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 14396, 14544), - }); - declarations.push(Declaration { - id: DeclarationId(1529), - name: Some("python_node_id_eq".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(735)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(356))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("({lhs} == {rhs})".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 14546, 14701), - }); - declarations.push(Declaration { - id: DeclarationId(1530), - name: Some("python_port_id_eq".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(736)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(356))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("({lhs} == {rhs})".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 14703, 14858), - }); - declarations.push(Declaration { - id: DeclarationId(1531), - name: Some("python_declaration_id_eq".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(737)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(356))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("({lhs} == {rhs})".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 14860, 15029), - }); - declarations.push(Declaration { - id: DeclarationId(1532), - name: Some("python_int_ne".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(87)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(357))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("({lhs} != {rhs})".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 15031, 15179), - }); - declarations.push(Declaration { - id: DeclarationId(1533), - name: Some("python_int_lt".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(87)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(358))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("({lhs} < {rhs})".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 15181, 15328), - }); - declarations.push(Declaration { - id: DeclarationId(1534), - name: Some("python_int_le".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(87)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(359))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("({lhs} <= {rhs})".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 15330, 15478), - }); - declarations.push(Declaration { - id: DeclarationId(1535), - name: Some("python_int_gt".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(87)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(360))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("({lhs} > {rhs})".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 15480, 15627), - }); - declarations.push(Declaration { - id: DeclarationId(1536), - name: Some("python_int_ge".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(87)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(361))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("({lhs} >= {rhs})".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 15629, 15777), - }); - declarations.push(Declaration { - id: DeclarationId(1537), - name: Some("python_bool_meet".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(124)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(371))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("({lhs} and {rhs})".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 15779, 15937), - }); - declarations.push(Declaration { - id: DeclarationId(1538), - name: Some("python_bool_join".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(124)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(372))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("({lhs} or {rhs})".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 15939, 16096), - }); - declarations.push(Declaration { - id: DeclarationId(1539), - name: Some("python_empty_callable".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(994), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(994)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(701)), - ), - ( - "strategy".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2306), - payload: vec![], - }, - ), - ("parameters".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 16098, 16244), - }); - declarations.push(Declaration { - id: DeclarationId(1540), - name: Some("python_singleton_callable".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(994), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(994)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(705)), - ), - ( - "strategy".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2307), - payload: vec![], - }, - ), - ( - "parameters".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "slot".to_string(), - FieldValue::Literal(LiteralBits::Int("0".to_string())), - ), - ( - "disposition".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2297), - payload: vec![], - }, - ), - ])]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 16246, 16446), - }); - declarations.push(Declaration { - id: DeclarationId(1541), - name: Some("python_cons_callable".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(994), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(994)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(703)), - ), - ( - "strategy".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2308), - payload: vec![], - }, - ), - ( - "parameters".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "slot".to_string(), - FieldValue::Literal(LiteralBits::Int("0".to_string())), - ), - ( - "disposition".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2297), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "slot".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ( - "disposition".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2297), - payload: vec![], - }, - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 16448, 16673), - }); - declarations.push(Declaration { - id: DeclarationId(1542), - name: Some("python_concat_callable".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(994), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(994)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(713)), - ), - ( - "strategy".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2309), - payload: vec![], - }, - ), - ( - "parameters".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "slot".to_string(), - FieldValue::Literal(LiteralBits::Int("0".to_string())), - ), - ( - "disposition".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2297), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "slot".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ( - "disposition".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2297), - payload: vec![], - }, - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 16675, 16906), - }); - declarations.push(Declaration { - id: DeclarationId(1543), - name: Some("python_length_callable".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(994), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(994)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(723)), - ), - ( - "strategy".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2310), - payload: vec![], - }, - ), - ( - "parameters".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "slot".to_string(), - FieldValue::Literal(LiteralBits::Int("0".to_string())), - ), - ( - "disposition".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2296), - payload: vec![], - }, - ), - ])]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 16908, 17099), - }); - declarations.push(Declaration { - id: DeclarationId(1544), - name: Some("python_is_empty_callable".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(994), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(994)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(725)), - ), - ( - "strategy".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2311), - payload: vec![], - }, - ), - ( - "parameters".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "slot".to_string(), - FieldValue::Literal(LiteralBits::Int("0".to_string())), - ), - ( - "disposition".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2296), - payload: vec![], - }, - ), - ])]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 17101, 17297), - }); - declarations.push(Declaration { - id: DeclarationId(1545), - name: Some("python_fold_callable".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(994), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(994)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(707)), - ), - ( - "strategy".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2312), - payload: vec![], - }, - ), - ( - "parameters".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "slot".to_string(), - FieldValue::Literal(LiteralBits::Int("0".to_string())), - ), - ( - "disposition".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2296), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "slot".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ( - "disposition".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2297), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "slot".to_string(), - FieldValue::Literal(LiteralBits::Int("2".to_string())), - ), - ( - "disposition".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2296), - payload: vec![], - }, - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 17299, 17564), - }); - declarations.push(Declaration { - id: DeclarationId(1546), - name: Some("python_map_callable".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(994), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(994)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(715)), - ), - ( - "strategy".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2313), - payload: vec![], - }, - ), - ( - "parameters".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "slot".to_string(), - FieldValue::Literal(LiteralBits::Int("0".to_string())), - ), - ( - "disposition".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2296), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "slot".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ( - "disposition".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2296), - payload: vec![], - }, - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 17566, 17788), - }); - declarations.push(Declaration { - id: DeclarationId(1547), - name: Some("python_filter_callable".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(994), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(994)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(718)), - ), - ( - "strategy".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2314), - payload: vec![], - }, - ), - ( - "parameters".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "slot".to_string(), - FieldValue::Literal(LiteralBits::Int("0".to_string())), - ), - ( - "disposition".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2296), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "slot".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ( - "disposition".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2296), - payload: vec![], - }, - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 17790, 18021), - }); - declarations.push(Declaration { - id: DeclarationId(1548), - name: Some("python_contains_callable".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(994), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(994)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(733)), - ), - ( - "strategy".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2315), - payload: vec![], - }, - ), - ( - "parameters".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "slot".to_string(), - FieldValue::Literal(LiteralBits::Int("0".to_string())), - ), - ( - "disposition".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2296), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "slot".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ( - "disposition".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2296), - payload: vec![], - }, - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 18023, 18260), - }); - declarations.push(Declaration { - id: DeclarationId(1549), - name: Some("python_list_instantiation".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1002), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1002)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(699)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("list[{element}]".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 18262, 18410), - }); - declarations.push(Declaration { id: DeclarationId(1550), name: Some("python_result_instantiation".to_string()), connective: TypeConnective::Instantiation { template: DeclarationId(1002), arguments: vec![] }, type_params: vec![], phantom_params: Vec::new(), meta_tag: Some(DeclarationId(1002)), specialization_parent: None, inhabits: None, value_body: Some(ValueBody::Structural { fields: vec![("language".to_string(), FieldValue::Reference(DeclarationId(1487))), ("target".to_string(), FieldValue::Reference(DeclarationId(11))), ("carrier".to_string(), FieldValue::Literal(LiteralBits::String("typing.Union[typing.Tuple[typing.Literal['Ok'], {key}], typing.Tuple[typing.Literal['Err'], {value}]]".to_string()))), ("cost".to_string(), FieldValue::Literal(LiteralBits::Int("1".to_string())))] }), refinement: None, nominal_opacity: None, span: SourceSpan::new("src/v3/spec/python.dag", 18526, 18764) }); - declarations.push(Declaration { - id: DeclarationId(1551), - name: Some("python_non_empty_list_instantiation".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1002), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1002)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(739)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String( - "NonEmptyList[{element}]".to_string(), - )), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 18855, 19029), - }); - declarations.push(Declaration { - id: DeclarationId(1552), - name: Some("python_non_singleton_list_instantiation".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1002), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1002)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(741)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String( - "NonSingletonList[{element}]".to_string(), - )), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 19031, 19217), - }); - declarations.push(Declaration { - id: DeclarationId(1553), - name: Some("python_list_pattern".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1004), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1004)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(699)), - ), - ( - "strategy".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2317), - payload: vec![], - }, - ), - ( - "empty_variant".to_string(), - FieldValue::Reference(DeclarationId(1870)), - ), - ( - "cons_variant".to_string(), - FieldValue::Reference(DeclarationId(1872)), - ), - ( - "scrutinee".to_string(), - FieldValue::Literal(LiteralBits::String("{expr}".to_string())), - ), - ( - "empty_pattern".to_string(), - FieldValue::Literal(LiteralBits::String("len({expr}) == 0".to_string())), - ), - ( - "cons_pattern".to_string(), - FieldValue::Literal(LiteralBits::String("{expr}".to_string())), - ), - ( - "head_expr".to_string(), - FieldValue::Literal(LiteralBits::String("{list}[0]".to_string())), - ), - ( - "tail_expr".to_string(), - FieldValue::Literal(LiteralBits::String("{list}[1:]".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 19218, 19532), - }); - declarations.push(Declaration { - id: DeclarationId(1554), - name: Some("python_correction_style".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1035), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1035)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "indent_unit".to_string(), - FieldValue::Literal(LiteralBits::String(" ".to_string())), - ), - ( - "line_ending".to_string(), - FieldValue::Literal(LiteralBits::String("\n".to_string())), - ), - ( - "string_quote".to_string(), - FieldValue::Literal(LiteralBits::String("%Q".to_string())), - ), - ( - "trailing_semicolon".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 21597, 21739), - }); - declarations.push(Declaration { - id: DeclarationId(1555), - name: Some("python_clean_emission".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1026), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1026)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "expression_wrapping".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2327), - payload: vec![], - }, - ), - ( - "pattern_bindings".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2332), - payload: vec![], - }, - ), - ( - "variant_payload_field_access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2333), - payload: vec![], - }, - ), - ( - "imports".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2336), - payload: vec![], - }, - ), - ( - "block_return".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2340), - payload: vec![], - }, - ), - ( - "variable_bindings".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2341), - payload: vec![], - }, - ), - ( - "match_arm_body".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2346), - payload: vec![], - }, - ), - ( - "correction_style".to_string(), - FieldValue::Reference(DeclarationId(1554)), - ), - ( - "post_emit_verifier".to_string(), - FieldValue::Record(vec![ - ( - "command".to_string(), - FieldValue::Literal(LiteralBits::String("python3".to_string())), - ), - ( - "args".to_string(), - FieldValue::List(vec![ - FieldValue::Literal(LiteralBits::String("-m".to_string())), - FieldValue::Literal(LiteralBits::String( - "py_compile".to_string(), - )), - ]), - ), - ( - "syntax_only".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ( - "expected_exit_code".to_string(), - FieldValue::Literal(LiteralBits::Int("0".to_string())), - ), - ( - "output_policy".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2348), - payload: vec![], - }, - ), - ]), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 21741, 22321), - }); - declarations.push(Declaration { - id: DeclarationId(1556), - name: Some("python_clean_emission_binding".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1027), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1027)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1487)), - ), - ( - "clean_emission".to_string(), - FieldValue::Reference(DeclarationId(1555)), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/python.dag", 22323, 22459), - }); - declarations.push(Declaration { - id: DeclarationId(1557), - name: Some("rust_execution_model".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(890), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(890)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "memory".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2151), - payload: vec![], - }, - ), - ( - "scope".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2152), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 5124, 5226), - }); - declarations.push(Declaration { - id: DeclarationId(1558), - name: Some("rust_source_filtering".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(892), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(892)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "internal".to_string(), - FieldValue::Reference(DeclarationId(893)), - ), - ( - "additional_excluded_prefixes".to_string(), - FieldValue::List(vec![FieldValue::Literal(LiteralBits::String( - "src/v3/compiler/".to_string(), - ))]), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 5228, 5380), - }); - declarations.push(Declaration { - id: DeclarationId(1559), - name: Some("rust_execution_requirement".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(894), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(894)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Unparsed(SourceSpan::new( - "src/v3/spec/rust.dag", - 5443, - 5457, - ))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 5382, 5457), - }); - declarations.push(Declaration { - id: DeclarationId(1560), - name: Some("rust_int".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(87)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("i64".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 5908, 6040), - }); - declarations.push(Declaration { - id: DeclarationId(1561), - name: Some("rust_uint8".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(82)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("u8".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 6042, 6177), - }); - declarations.push(Declaration { - id: DeclarationId(1562), - name: Some("rust_i32".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(79)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("i32".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 6179, 6313), - }); - declarations.push(Declaration { - id: DeclarationId(1563), - name: Some("rust_f32".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(105)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("f32".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 6411, 6546), - }); - declarations.push(Declaration { - id: DeclarationId(1564), - name: Some("rust_f64".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(106)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("f64".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 6548, 6683), - }); - declarations.push(Declaration { - id: DeclarationId(1565), - name: Some("rust_u32".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(84)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("u32".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 6685, 6820), - }); - declarations.push(Declaration { - id: DeclarationId(1566), - name: Some("rust_i128".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(81)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("i128".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 6822, 6959), - }); - declarations.push(Declaration { - id: DeclarationId(1567), - name: Some("rust_u128".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(86)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("u128".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 7251, 7389), - }); - declarations.push(Declaration { - id: DeclarationId(1568), - name: Some("rust_isize".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(89)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("isize".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 7792, 7936), - }); - declarations.push(Declaration { - id: DeclarationId(1569), - name: Some("rust_usize".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(90)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("usize".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 7938, 8083), - }); - declarations.push(Declaration { - id: DeclarationId(1570), - name: Some("rust_integer_inhabit_u32_at_program_bound".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(988), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(988)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "kernel_integer".to_string(), - FieldValue::Reference(DeclarationId(84)), - ), - ( - "algebra".to_string(), - FieldValue::Reference(DeclarationId(84)), - ), - ( - "bound".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2291), - payload: vec![FieldValue::Variant { - constructor: DeclarationId(1958), - payload: vec![ - FieldValue::Literal(LiteralBits::Int("0".to_string())), - FieldValue::Variant { - constructor: DeclarationId(1957), - payload: vec![FieldValue::Variant { - constructor: DeclarationId(1955), - payload: vec![FieldValue::Literal(LiteralBits::Int( - "4294967295".to_string(), - ))], - }], - }, - ], - }], - }, - ), - ( - "type_realization".to_string(), - FieldValue::Reference(DeclarationId(1565)), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 8504, 8803), - }); - declarations.push(Declaration { - id: DeclarationId(1571), - name: Some("rust_integer_inhabit_i32_at_program_bound".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(988), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(988)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "kernel_integer".to_string(), - FieldValue::Reference(DeclarationId(79)), - ), - ( - "algebra".to_string(), - FieldValue::Reference(DeclarationId(79)), - ), - ( - "bound".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2291), - payload: vec![FieldValue::Variant { - constructor: DeclarationId(1958), - payload: vec![ - FieldValue::Literal(LiteralBits::Int( - "-2147483648".to_string(), - )), - FieldValue::Variant { - constructor: DeclarationId(1957), - payload: vec![FieldValue::Variant { - constructor: DeclarationId(1955), - payload: vec![FieldValue::Literal(LiteralBits::Int( - "4294967295".to_string(), - ))], - }], - }, - ], - }], - }, - ), - ( - "type_realization".to_string(), - FieldValue::Reference(DeclarationId(1562)), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 8805, 9112), - }); - declarations.push(Declaration { - id: DeclarationId(1572), - name: Some("rust_integer_inhabit_i32_bound_unspecified".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(988), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(988)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "kernel_integer".to_string(), - FieldValue::Reference(DeclarationId(79)), - ), - ( - "algebra".to_string(), - FieldValue::Reference(DeclarationId(79)), - ), - ( - "bound".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2290), - payload: vec![], - }, - ), - ( - "type_realization".to_string(), - FieldValue::Reference(DeclarationId(1562)), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 9114, 9319), - }); - declarations.push(Declaration { - id: DeclarationId(1573), - name: Some("rust_integer_inhabit_int64_bound_unspecified".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(988), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(988)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "kernel_integer".to_string(), - FieldValue::Reference(DeclarationId(87)), - ), - ( - "algebra".to_string(), - FieldValue::Reference(DeclarationId(87)), - ), - ( - "bound".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2290), - payload: vec![], - }, - ), - ( - "type_realization".to_string(), - FieldValue::Reference(DeclarationId(1560)), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 9321, 9524), - }); - declarations.push(Declaration { - id: DeclarationId(1574), - name: Some("rust_integer_inhabit_i128_bound_unspecified".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(988), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(988)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "kernel_integer".to_string(), - FieldValue::Reference(DeclarationId(81)), - ), - ( - "algebra".to_string(), - FieldValue::Reference(DeclarationId(81)), - ), - ( - "bound".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2290), - payload: vec![], - }, - ), - ( - "type_realization".to_string(), - FieldValue::Reference(DeclarationId(1566)), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 9526, 9735), - }); - declarations.push(Declaration { - id: DeclarationId(1575), - name: Some("rust_integer_inhabit_u128_bound_unspecified".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(988), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(988)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "kernel_integer".to_string(), - FieldValue::Reference(DeclarationId(86)), - ), - ( - "algebra".to_string(), - FieldValue::Reference(DeclarationId(86)), - ), - ( - "bound".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2290), - payload: vec![], - }, - ), - ( - "type_realization".to_string(), - FieldValue::Reference(DeclarationId(1567)), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 10160, 10371), - }); - declarations.push(Declaration { - id: DeclarationId(1576), - name: Some("rust_integer_inhabit_isize_platform".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(988), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(988)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "kernel_integer".to_string(), - FieldValue::Reference(DeclarationId(89)), - ), - ( - "algebra".to_string(), - FieldValue::Reference(DeclarationId(89)), - ), - ( - "bound".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2292), - payload: vec![], - }, - ), - ( - "type_realization".to_string(), - FieldValue::Reference(DeclarationId(1568)), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 10734, 10951), - }); - declarations.push(Declaration { - id: DeclarationId(1577), - name: Some("rust_integer_inhabit_usize_platform".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(988), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(988)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "kernel_integer".to_string(), - FieldValue::Reference(DeclarationId(90)), - ), - ( - "algebra".to_string(), - FieldValue::Reference(DeclarationId(90)), - ), - ( - "bound".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2292), - payload: vec![], - }, - ), - ( - "type_realization".to_string(), - FieldValue::Reference(DeclarationId(1569)), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 10953, 11172), - }); - declarations.push(Declaration { - id: DeclarationId(1578), - name: Some("rust_bool".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(124)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("bool".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 11174, 11309), - }); - declarations.push(Declaration { - id: DeclarationId(1579), - name: Some("rust_string".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(227)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("String".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 11311, 11453), - }); - declarations.push(Declaration { - id: DeclarationId(1580), - name: Some("rust_node_id".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(735)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("NodeId".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 11455, 11597), - }); - declarations.push(Declaration { - id: DeclarationId(1581), - name: Some("rust_port_id".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(736)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("PortId".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 11599, 11741), - }); - declarations.push(Declaration { - id: DeclarationId(1582), - name: Some("rust_declaration_id".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(737)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("DeclarationId".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 11743, 11906), - }); - declarations.push(Declaration { - id: DeclarationId(1583), - name: Some("rust_cluster_id".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(738)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("ClusterId".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 11908, 12059), - }); - declarations.push(Declaration { - id: DeclarationId(1584), - name: Some("rust_type_shape".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(789)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("TypeShape".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("declaration".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "declaration".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ])]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 12061, 12306), - }); - declarations.push(Declaration { - id: DeclarationId(1585), - name: Some("rust_port_state".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(791)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("PortState".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 12308, 12460), - }); - declarations.push(Declaration { - id: DeclarationId(1586), - name: Some("rust_port".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(792)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("Port".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("id".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2294), - payload: vec![FieldValue::Literal(LiteralBits::String( - "id".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("state".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2294), - payload: vec![FieldValue::Literal(LiteralBits::String( - "state_value".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "produced_by".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "produced_by".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 12462, 12858), - }); - declarations.push(Declaration { - id: DeclarationId(1587), - name: Some("rust_source_span".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(155)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("SourceSpan".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("file".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "file".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("start".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "byte_start".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("end".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "byte_end".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 12860, 13258), - }); - declarations.push(Declaration { - id: DeclarationId(1588), - name: Some("rust_literal_bits".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(793)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("LiteralBits".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 13260, 13418), - }); - declarations.push(Declaration { - id: DeclarationId(1589), - name: Some("rust_atom_payload".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(794)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("AtomPayload".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 13420, 13578), - }); - declarations.push(Declaration { - id: DeclarationId(1590), - name: Some("rust_cardinality_bound".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(801)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("CardinalityBound".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 13580, 13753), - }); - declarations.push(Declaration { - id: DeclarationId(1591), - name: Some("rust_interval".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(797)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("Interval".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 13755, 13903), - }); - declarations.push(Declaration { - id: DeclarationId(1592), - name: Some("rust_positive_interval_width".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(795)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String( - "PositiveIntervalWidth".to_string(), - )), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 13905, 14094), - }); - declarations.push(Declaration { - id: DeclarationId(1593), - name: Some("rust_interval_width".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(796)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("IntervalWidth".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 14096, 14260), - }); - declarations.push(Declaration { - id: DeclarationId(1594), - name: Some("rust_conj_field".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(802)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("Field".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("label".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "label".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("ty".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "ty".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 14262, 14564), - }); - declarations.push(Declaration { - id: DeclarationId(1595), - name: Some("rust_template_argument".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(803)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("TemplateArgument".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "parameter".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "parameter".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("value".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "value".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 14566, 14907), - }); - declarations.push(Declaration { - id: DeclarationId(1596), - name: Some("rust_phantom_parameter".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(811)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("PhantomParameter".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "parameter".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "parameter".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("algebra".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "algebra".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 14909, 15254), - }); - declarations.push(Declaration { - id: DeclarationId(1597), - name: Some("rust_nominal_opacity".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(812)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("NominalOpacity".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "permitted_accessors".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "permitted_accessors".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ])]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 15256, 15532), - }); - declarations.push(Declaration { - id: DeclarationId(1598), - name: Some("rust_field_entry".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(804)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String( - "(String, FieldValue)".to_string(), - )), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("label".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "0".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("value".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "1".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 15534, 15851), - }); - declarations.push(Declaration { - id: DeclarationId(1599), - name: Some("rust_non_empty_list".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(739)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("NonEmptyList".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("first".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "first".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("rest".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "rest".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 15853, 16173), - }); - declarations.push(Declaration { - id: DeclarationId(1600), - name: Some("rust_non_singleton_list".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(741)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("NonSingletonList".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("first".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "first".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("second".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "second".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("rest".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "rest".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 16175, 16588), - }); - declarations.push(Declaration { - id: DeclarationId(1601), - name: Some("rust_element_ref".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(824)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("ElementRef".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("index".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2294), - payload: vec![FieldValue::Literal(LiteralBits::String( - "index_of".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ])]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 16590, 16831), - }); - declarations.push(Declaration { - id: DeclarationId(1602), - name: Some("rust_param_ref".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(822)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("ParamRef".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("member".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2294), - payload: vec![FieldValue::Literal(LiteralBits::String( - "member_of".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("slot".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2294), - payload: vec![FieldValue::Literal(LiteralBits::String( - "slot_of".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 16833, 17153), - }); - declarations.push(Declaration { - id: DeclarationId(1603), - name: Some("rust_transform_ref".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(823)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("TransformRef".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("node".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2294), - payload: vec![FieldValue::Literal(LiteralBits::String( - "node_id".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ])]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 17155, 17400), - }); - declarations.push(Declaration { - id: DeclarationId(1604), - name: Some("rust_member_descent".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(826)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("MemberDescent".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("param".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "param".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ])]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 17402, 17647), - }); - declarations.push(Declaration { - id: DeclarationId(1605), - name: Some("rust_intra_cluster_call".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(827)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("IntraClusterCall".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("transform".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "transform".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ])]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 17649, 17912), - }); - declarations.push(Declaration { - id: DeclarationId(1606), - name: Some("rust_cluster".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(828)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("Cluster".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("members".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "members".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "intra_cluster_calls".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "intra_cluster_calls".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 17914, 18251), - }); - declarations.push(Declaration { - id: DeclarationId(1607), - name: Some("rust_field_value".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(805)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("FieldValue".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 18253, 18408), - }); - declarations.push(Declaration { - id: DeclarationId(1608), - name: Some("rust_value_body".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(806)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("ValueBody".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 18410, 18562), - }); - declarations.push(Declaration { - id: DeclarationId(1609), - name: Some("rust_arrow_body".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(808)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("ArrowBody".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 18564, 18716), - }); - declarations.push(Declaration { - id: DeclarationId(1610), - name: Some("rust_type_connective".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(809)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("TypeConnective".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 18718, 18885), - }); - declarations.push(Declaration { - id: DeclarationId(1611), - name: Some("rust_declaration".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(810)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("Declaration".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("id".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "id".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("name".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "name".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "connective".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "connective".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "type_params".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "type_params".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "phantom_params".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "phantom_params".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "meta_tag".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "meta_tag".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "inhabits".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "inhabits".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "value_body".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "value_body".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "nominal_opacity".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "nominal_opacity".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("span".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "span".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 18887, 19908), - }); - declarations.push(Declaration { - id: DeclarationId(1612), - name: Some("rust_arithmetic_op".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(813)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("ArithmeticOp".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 19910, 20071), - }); - declarations.push(Declaration { - id: DeclarationId(1613), - name: Some("rust_comparison_op".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(814)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("ComparisonOp".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 20073, 20234), - }); - declarations.push(Declaration { - id: DeclarationId(1614), - name: Some("rust_logical_op".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(816)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("LogicalOp".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 20236, 20388), - }); - declarations.push(Declaration { - id: DeclarationId(1615), - name: Some("rust_operator_kind".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(817)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("OperatorKind".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 20390, 20551), - }); - declarations.push(Declaration { - id: DeclarationId(1616), - name: Some("rust_transform_target".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(818)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("TransformTarget".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 20553, 20723), - }); - declarations.push(Declaration { - id: DeclarationId(1617), - name: Some("rust_branch_pattern".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(819)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("BranchPattern".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 20725, 20889), - }); - declarations.push(Declaration { - id: DeclarationId(1618), - name: Some("rust_payload_binding".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(820)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("PayloadBinding".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "binding_name".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "binding_name".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "payload_port".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "payload_port".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 20891, 21246), - }); - declarations.push(Declaration { - id: DeclarationId(1619), - name: Some("rust_branch_path".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(821)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("Path".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("body".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "body".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "result_port".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2294), - payload: vec![FieldValue::Literal(LiteralBits::String( - "result_port".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("pattern".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "pattern".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("binding".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "binding".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 21248, 21736), - }); - declarations.push(Declaration { - id: DeclarationId(1620), - name: Some("rust_key_source".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(756)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("KeySource".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 21738, 21890), - }); - declarations.push(Declaration { - id: DeclarationId(1621), - name: Some("rust_idempotent_shape".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(750)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("IdempotentShape".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 21892, 22062), - }); - declarations.push(Declaration { - id: DeclarationId(1622), - name: Some("rust_effect_shape".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(752)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("EffectShape".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 22064, 22222), - }); - declarations.push(Declaration { - id: DeclarationId(1623), - name: Some("rust_composition_verdict".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(760)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("CompositionVerdict".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 22224, 22403), - }); - declarations.push(Declaration { - id: DeclarationId(1624), - name: Some("rust_workflow_effect".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(777)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("WorkflowEffect".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 22405, 22572), - }); - declarations.push(Declaration { - id: DeclarationId(1625), - name: Some("rust_parallelism_unsupported_kind".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(781)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String( - "ParallelismUnsupportedKind".to_string(), - )), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 22574, 22777), - }); - declarations.push(Declaration { - id: DeclarationId(1626), - name: Some("rust_workflow_parallelism_report".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(783)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String( - "WorkflowParallelismReport".to_string(), - )), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 22779, 22980), - }); - declarations.push(Declaration { - id: DeclarationId(1627), - name: Some("rust_loop_bound".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(829)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("LoopBound".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 22982, 23134), - }); - declarations.push(Declaration { - id: DeclarationId(1628), - name: Some("rust_value_node".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(831)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("ValueNode".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("id".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "id".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("payload".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "data".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "result_port".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2294), - payload: vec![FieldValue::Literal(LiteralBits::String( - "result_port".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("span".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "span".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "lane2_workflow".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2294), - payload: vec![FieldValue::Literal(LiteralBits::String( - "lane2_workflow".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 23136, 23909), - }); - declarations.push(Declaration { - id: DeclarationId(1629), - name: Some("rust_transform_node".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(832)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("TransformNode".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("id".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "id".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("target".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "target".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("inputs".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "inputs".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "result_port".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2294), - payload: vec![FieldValue::Literal(LiteralBits::String( - "result_port".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("span".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "span".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 23911, 24483), - }); - declarations.push(Declaration { - id: DeclarationId(1630), - name: Some("rust_branch_node".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(834)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("BranchNode".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("id".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "id".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("input".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "input".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("paths".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "paths".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "result_port".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2294), - payload: vec![FieldValue::Literal(LiteralBits::String( - "result_port".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("span".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "span".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "emit_participation".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2294), - payload: vec![FieldValue::Literal(LiteralBits::String( - "emit_participation".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 24485, 25152), - }); - declarations.push(Declaration { - id: DeclarationId(1631), - name: Some("rust_loop_node".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(835)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("LoopNode".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("id".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "id".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("source".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "source".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("init".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "init".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("body".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "body".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("bound".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "bound".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "result_port".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2294), - payload: vec![FieldValue::Literal(LiteralBits::String( - "result_port".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("span".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "span".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 25154, 25863), - }); - declarations.push(Declaration { - id: DeclarationId(1632), - name: Some("rust_bind_node".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(837)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("BindNode".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("id".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "id".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("name".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "name".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "result_port".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2294), - payload: vec![FieldValue::Literal(LiteralBits::String( - "result_port".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("params".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "params".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("span".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "span".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "lane2_workflow".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2294), - payload: vec![FieldValue::Literal(LiteralBits::String( - "lane2_workflow".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "emit_participation".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2294), - payload: vec![FieldValue::Literal(LiteralBits::String( - "emit_participation".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 25865, 26625), - }); - declarations.push(Declaration { - id: DeclarationId(1633), - name: Some("rust_behavior".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(838)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("Behavior".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 26627, 26775), - }); - declarations.push(Declaration { - id: DeclarationId(1634), - name: Some("rust_dag".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(839)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("Dag".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "declarations".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2294), - payload: vec![FieldValue::Literal(LiteralBits::String( - "declarations".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("nodes".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2294), - payload: vec![FieldValue::Literal(LiteralBits::String( - "nodes".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("ports".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2294), - payload: vec![FieldValue::Literal(LiteralBits::String( - "ports".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "clusters".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2294), - payload: vec![FieldValue::Literal(LiteralBits::String( - "clusters".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 26777, 27257), - }); - declarations.push(Declaration { - id: DeclarationId(1635), - name: Some("rust_surface_module".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1116)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String( - "parse_surface::SurfaceModule".to_string(), - )), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("items".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "items".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ])]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 27470, 27730), - }); - declarations.push(Declaration { - id: DeclarationId(1636), - name: Some("rust_surface_item".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1130)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String( - "parse_surface::SurfaceItem".to_string(), - )), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 27732, 27905), - }); - declarations.push(Declaration { - id: DeclarationId(1637), - name: Some("rust_surface_param".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1117)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String( - "parse_surface::SurfaceParam".to_string(), - )), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("name".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "name".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("ty".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "ty".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "refinement".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "refinement".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 27907, 28324), - }); - declarations.push(Declaration { - id: DeclarationId(1638), - name: Some("rust_surface_field".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1118)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String( - "parse_surface::SurfaceField".to_string(), - )), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("name".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "name".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("ty".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "ty".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 28326, 28654), - }); - declarations.push(Declaration { - id: DeclarationId(1639), - name: Some("rust_surface_variant".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1119)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String( - "parse_surface::SurfaceVariant".to_string(), - )), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("name".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "name".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("payload".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "payload".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("span".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "span".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 28656, 29077), - }); - declarations.push(Declaration { - id: DeclarationId(1640), - name: Some("rust_variant_payload".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1120)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String( - "parse_surface::VariantPayload".to_string(), - )), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 29079, 29261), - }); - declarations.push(Declaration { - id: DeclarationId(1641), - name: Some("rust_surface_type".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1122)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String( - "parse_surface::SurfaceType".to_string(), - )), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 29263, 29436), - }); - declarations.push(Declaration { - id: DeclarationId(1642), - name: Some("rust_surface_record_field".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1123)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String( - "parse_surface::SurfaceRecordField".to_string(), - )), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("name".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "name".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("value".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "value".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("span".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "span".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 29438, 29868), - }); - declarations.push(Declaration { - id: DeclarationId(1643), - name: Some("rust_surface_map_entry".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1124)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String( - "parse_surface::SurfaceMapEntry".to_string(), - )), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("key".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "key".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String( - "key_span".to_string(), - )), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "key_span".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("value".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "value".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("span".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "span".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 29870, 30374), - }); - declarations.push(Declaration { - id: DeclarationId(1644), - name: Some("rust_surface_match_arm".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1125)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String( - "parse_surface::SurfaceMatchArm".to_string(), - )), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("pattern".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "pattern".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("body".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "body".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("span".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "span".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 30376, 30801), - }); - declarations.push(Declaration { - id: DeclarationId(1645), - name: Some("rust_surface_pattern_field".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1126)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String( - "parse_surface::SurfacePatternField".to_string(), - )), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "fields".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("name".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "name".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("binding".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "binding".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - FieldValue::Record(vec![ - ( - "dag_name".to_string(), - FieldValue::Literal(LiteralBits::String("span".to_string())), - ), - ( - "access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2293), - payload: vec![FieldValue::Literal(LiteralBits::String( - "span".to_string(), - ))], - }, - ), - ( - "borrowed_read".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 30803, 31240), - }); - declarations.push(Declaration { - id: DeclarationId(1646), - name: Some("rust_surface_pattern".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1127)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String( - "parse_surface::SurfacePattern".to_string(), - )), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 31242, 31424), - }); - declarations.push(Declaration { - id: DeclarationId(1647), - name: Some("rust_surface_literal".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1128)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String( - "parse_surface::SurfaceLiteral".to_string(), - )), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 31426, 31608), - }); - declarations.push(Declaration { - id: DeclarationId(1648), - name: Some("rust_surface_expr".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1129)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String( - "parse_surface::SurfaceExpr".to_string(), - )), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 31610, 31783), - }); - declarations.push(Declaration { - id: DeclarationId(1649), - name: Some("rust_int_add".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(87)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(349))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("({lhs} + {rhs})".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 32638, 32783), - }); - declarations.push(Declaration { - id: DeclarationId(1650), - name: Some("rust_int_sub".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(87)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(350))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("({lhs} - {rhs})".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 32785, 32930), - }); - declarations.push(Declaration { - id: DeclarationId(1651), - name: Some("rust_int_mul".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(87)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(352))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("({lhs} * {rhs})".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 32932, 33077), - }); - declarations.push(Declaration { - id: DeclarationId(1652), - name: Some("rust_int_div".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(87)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(354))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String( - "(__v3_int_div({lhs}, {rhs}))".to_string(), - )), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 33079, 33237), - }); - declarations.push(Declaration { - id: DeclarationId(1653), - name: Some("rust_int_eq".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(87)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(356))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("({lhs} == {rhs})".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 33687, 33831), - }); - declarations.push(Declaration { - id: DeclarationId(1654), - name: Some("rust_node_id_eq".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(735)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(356))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("({lhs} == {rhs})".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 33833, 33984), - }); - declarations.push(Declaration { - id: DeclarationId(1655), - name: Some("rust_port_id_eq".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(736)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(356))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("({lhs} == {rhs})".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 33986, 34137), - }); - declarations.push(Declaration { - id: DeclarationId(1656), - name: Some("rust_declaration_id_eq".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(737)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(356))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("({lhs} == {rhs})".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 34139, 34304), - }); - declarations.push(Declaration { - id: DeclarationId(1657), - name: Some("rust_string_eq".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(227)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(356))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("({lhs} == {rhs})".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 34497, 34647), - }); - declarations.push(Declaration { - id: DeclarationId(1658), - name: Some("rust_free_monoid_eq".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(47)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(356))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("({lhs} == {rhs})".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 34829, 34988), - }); - declarations.push(Declaration { - id: DeclarationId(1659), - name: Some("rust_int_ne".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(87)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(357))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("({lhs} != {rhs})".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 34990, 35134), - }); - declarations.push(Declaration { - id: DeclarationId(1660), - name: Some("rust_node_id_ne".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(735)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(357))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("({lhs} != {rhs})".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 35136, 35287), - }); - declarations.push(Declaration { - id: DeclarationId(1661), - name: Some("rust_port_id_ne".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(736)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(357))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("({lhs} != {rhs})".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 35289, 35440), - }); - declarations.push(Declaration { - id: DeclarationId(1662), - name: Some("rust_declaration_id_ne".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(737)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(357))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("({lhs} != {rhs})".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 35442, 35607), - }); - declarations.push(Declaration { - id: DeclarationId(1663), - name: Some("rust_int_lt".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(87)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(358))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("({lhs} < {rhs})".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 35609, 35752), - }); - declarations.push(Declaration { - id: DeclarationId(1664), - name: Some("rust_int_le".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(87)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(359))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("({lhs} <= {rhs})".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 35754, 35898), - }); - declarations.push(Declaration { - id: DeclarationId(1665), - name: Some("rust_int_gt".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(87)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(360))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("({lhs} > {rhs})".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 35900, 36043), - }); - declarations.push(Declaration { - id: DeclarationId(1666), - name: Some("rust_int_ge".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(87)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(361))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("({lhs} >= {rhs})".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 36045, 36189), - }); - declarations.push(Declaration { - id: DeclarationId(1667), - name: Some("rust_bool_meet".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(124)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(371))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("({lhs} && {rhs})".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 36191, 36344), - }); - declarations.push(Declaration { - id: DeclarationId(1668), - name: Some("rust_bool_join".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(992), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(992)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(124)), - ), - ("op".to_string(), FieldValue::Reference(DeclarationId(372))), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("({lhs} || {rhs})".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 36346, 36499), - }); - declarations.push(Declaration { - id: DeclarationId(1669), - name: Some("rust_let_stmt".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(993), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(993)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1351)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String( - "let {name}: {type} = {value};".to_string(), - )), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("0".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 37249, 37388), - }); - declarations.push(Declaration { - id: DeclarationId(1670), - name: Some("rust_if_expr".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(993), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(993)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1349)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String( - "if {cond} { {then} } else { {else} }".to_string(), - )), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("0".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 37390, 37537), - }); - declarations.push(Declaration { - id: DeclarationId(1671), - name: Some("rust_main_wrap".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(993), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(993)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1352)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String( - "fn main() { {body} println!({quote}{{}}{quote}, {final}); }" - .to_string(), - )), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("0".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 37539, 37709), - }); - declarations.push(Declaration { - id: DeclarationId(1672), - name: Some("rust_empty_callable".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(994), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(994)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(701)), - ), - ( - "strategy".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2306), - payload: vec![], - }, - ), - ("parameters".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 39086, 39228), - }); - declarations.push(Declaration { - id: DeclarationId(1673), - name: Some("rust_singleton_callable".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(994), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(994)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(705)), - ), - ( - "strategy".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2307), - payload: vec![], - }, - ), - ( - "parameters".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "slot".to_string(), - FieldValue::Literal(LiteralBits::Int("0".to_string())), - ), - ( - "disposition".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2297), - payload: vec![], - }, - ), - ])]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 39230, 39426), - }); - declarations.push(Declaration { - id: DeclarationId(1674), - name: Some("rust_cons_callable".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(994), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(994)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(703)), - ), - ( - "strategy".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2308), - payload: vec![], - }, - ), - ( - "parameters".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "slot".to_string(), - FieldValue::Literal(LiteralBits::Int("0".to_string())), - ), - ( - "disposition".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2297), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "slot".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ( - "disposition".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2297), - payload: vec![], - }, - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 39428, 39649), - }); - declarations.push(Declaration { - id: DeclarationId(1675), - name: Some("rust_concat_callable".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(994), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(994)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(713)), - ), - ( - "strategy".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2309), - payload: vec![], - }, - ), - ( - "parameters".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "slot".to_string(), - FieldValue::Literal(LiteralBits::Int("0".to_string())), - ), - ( - "disposition".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2297), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "slot".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ( - "disposition".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2297), - payload: vec![], - }, - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 39651, 39878), - }); - declarations.push(Declaration { - id: DeclarationId(1676), - name: Some("rust_length_callable".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(994), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(994)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(723)), - ), - ( - "strategy".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2310), - payload: vec![], - }, - ), - ( - "parameters".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "slot".to_string(), - FieldValue::Literal(LiteralBits::Int("0".to_string())), - ), - ( - "disposition".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2296), - payload: vec![], - }, - ), - ])]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 39880, 40067), - }); - declarations.push(Declaration { - id: DeclarationId(1677), - name: Some("rust_list_instantiation".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1002), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1002)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(699)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("Vec<{element}>".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 40069, 40212), - }); - declarations.push(Declaration { - id: DeclarationId(1678), - name: Some("rust_non_singleton_list_instantiation".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1002), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1002)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(741)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String( - "NonSingletonList<{element}>".to_string(), - )), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 40474, 40656), - }); - declarations.push(Declaration { - id: DeclarationId(1679), - name: Some("rust_result_instantiation".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1002), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1002)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(11)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String( - "::core::result::Result<{key}, {value}>".to_string(), - )), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 40935, 41106), - }); - declarations.push(Declaration { - id: DeclarationId(1680), - name: Some("rust_lookup_instantiation".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1002), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1002)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(908)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("Lookup<{element}>".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 41108, 41258), - }); - declarations.push(Declaration { - id: DeclarationId(1681), - name: Some("rust_witness_instantiation".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1002), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1002)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1058)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("Witness<{element}>".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 41260, 41413), - }); - declarations.push(Declaration { - id: DeclarationId(1682), - name: Some("rust_lens_instantiation".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1002), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1002)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1097)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("Lens<{element}>".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 41415, 41559), - }); - declarations.push(Declaration { - id: DeclarationId(1683), - name: Some("rust_monoid_instantiation".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1002), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1002)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(19)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("Monoid<{element}>".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 41561, 41711), - }); - declarations.push(Declaration { - id: DeclarationId(1684), - name: Some("rust_lens_enforcement_instantiation".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1002), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1002)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1101)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String( - "LensEnforcement<{key}, {value}, {extra}>".to_string(), - )), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 41713, 41905), - }); - declarations.push(Declaration { - id: DeclarationId(1685), - name: Some("rust_enforceable_lens_instantiation".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1002), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1002)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1105)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String( - "EnforceableLens<{key}, {value}, {extra}>".to_string(), - )), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 41907, 42099), - }); - declarations.push(Declaration { - id: DeclarationId(1686), - name: Some("rust_map_instantiation".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1002), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1002)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(133)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String( - "HashMap<{key}, {value}>".to_string(), - )), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 42101, 42251), - }); - declarations.push(Declaration { - id: DeclarationId(1687), - name: Some("rust_is_empty_callable".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(994), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(994)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(725)), - ), - ( - "strategy".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2311), - payload: vec![], - }, - ), - ( - "parameters".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "slot".to_string(), - FieldValue::Literal(LiteralBits::Int("0".to_string())), - ), - ( - "disposition".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2296), - payload: vec![], - }, - ), - ])]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 42253, 42445), - }); - declarations.push(Declaration { - id: DeclarationId(1688), - name: Some("rust_fold_callable".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(994), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(994)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(707)), - ), - ( - "strategy".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2312), - payload: vec![], - }, - ), - ( - "parameters".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "slot".to_string(), - FieldValue::Literal(LiteralBits::Int("0".to_string())), - ), - ( - "disposition".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2296), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "slot".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ( - "disposition".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2297), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "slot".to_string(), - FieldValue::Literal(LiteralBits::Int("2".to_string())), - ), - ( - "disposition".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2296), - payload: vec![], - }, - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 42447, 42708), - }); - declarations.push(Declaration { - id: DeclarationId(1689), - name: Some("rust_map_callable".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(994), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(994)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(715)), - ), - ( - "strategy".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2313), - payload: vec![], - }, - ), - ( - "parameters".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "slot".to_string(), - FieldValue::Literal(LiteralBits::Int("0".to_string())), - ), - ( - "disposition".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2296), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "slot".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ( - "disposition".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2296), - payload: vec![], - }, - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 42710, 42928), - }); - declarations.push(Declaration { - id: DeclarationId(1690), - name: Some("rust_filter_callable".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(994), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(994)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(718)), - ), - ( - "strategy".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2314), - payload: vec![], - }, - ), - ( - "parameters".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "slot".to_string(), - FieldValue::Literal(LiteralBits::Int("0".to_string())), - ), - ( - "disposition".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2296), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "slot".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ( - "disposition".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2296), - payload: vec![], - }, - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 42930, 43157), - }); - declarations.push(Declaration { - id: DeclarationId(1691), - name: Some("rust_contains_callable".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(994), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(994)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(733)), - ), - ( - "strategy".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2315), - payload: vec![], - }, - ), - ( - "parameters".to_string(), - FieldValue::List(vec![ - FieldValue::Record(vec![ - ( - "slot".to_string(), - FieldValue::Literal(LiteralBits::Int("0".to_string())), - ), - ( - "disposition".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2296), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "slot".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ( - "disposition".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2296), - payload: vec![], - }, - ), - ]), - ]), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 43159, 43392), - }); - declarations.push(Declaration { - id: DeclarationId(1692), - name: Some("rust_list_pattern".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1004), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1004)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(699)), - ), - ( - "strategy".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2317), - payload: vec![], - }, - ), - ( - "empty_variant".to_string(), - FieldValue::Reference(DeclarationId(1870)), - ), - ( - "cons_variant".to_string(), - FieldValue::Reference(DeclarationId(1872)), - ), - ( - "scrutinee".to_string(), - FieldValue::Literal(LiteralBits::String("{expr}".to_string())), - ), - ( - "empty_pattern".to_string(), - FieldValue::Literal(LiteralBits::String("[]".to_string())), - ), - ( - "cons_pattern".to_string(), - FieldValue::Literal(LiteralBits::String( - "[{head}, {tail} @ ..]".to_string(), - )), - ), - ( - "head_expr".to_string(), - FieldValue::Literal(LiteralBits::String("{head}".to_string())), - ), - ( - "tail_expr".to_string(), - FieldValue::Literal(LiteralBits::String("{tail}".to_string())), - ), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 43620, 43924), - }); - declarations.push(Declaration { - id: DeclarationId(1693), - name: Some("rust_statements".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1006), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1006)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "let_binding".to_string(), - FieldValue::Literal(LiteralBits::String( - "let {name}: {type} = {value};".to_string(), - )), - ), - ( - "let_binding_inferred".to_string(), - FieldValue::Literal(LiteralBits::String( - "let {name} = {value};".to_string(), - )), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 43926, 44064), - }); - declarations.push(Declaration { - id: DeclarationId(1694), - name: Some("rust_expressions".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1007), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1007)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "field_access".to_string(), - FieldValue::Literal(LiteralBits::String("({object}).{field}".to_string())), - ), - ( - "function_call".to_string(), - FieldValue::Literal(LiteralBits::String("{func}({args})".to_string())), - ), - ( - "closure".to_string(), - FieldValue::Literal(LiteralBits::String( - "|{params}| {{ {body} }}".to_string(), - )), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 44066, 44219), - }); - declarations.push(Declaration { - id: DeclarationId(1695), - name: Some("rust_control_flow".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1009), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1009)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "if_else".to_string(), - FieldValue::Literal(LiteralBits::String( - "if {cond} { {then} } else { {else} }".to_string(), - )), - ), - ( - "match_arm".to_string(), - FieldValue::Literal(LiteralBits::String( - "{pattern} => {body},".to_string(), - )), - ), - ( - "for_each_syntax".to_string(), - FieldValue::Record(vec![ - ( - "prefix".to_string(), - FieldValue::Literal(LiteralBits::String("for ".to_string())), - ), - ( - "separator".to_string(), - FieldValue::Literal(LiteralBits::String(" in ".to_string())), - ), - ]), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 44221, 44411), - }); - declarations.push(Declaration { - id: DeclarationId(1696), - name: Some("rust_literals".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1010), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1010)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "true_keyword".to_string(), - FieldValue::Literal(LiteralBits::String("true".to_string())), - ), - ( - "false_keyword".to_string(), - FieldValue::Literal(LiteralBits::String("false".to_string())), - ), - ( - "string_delimiter".to_string(), - FieldValue::Literal(LiteralBits::String("%Q".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 44413, 44525), - }); - declarations.push(Declaration { - id: DeclarationId(1697), - name: Some("rust_modules".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1011), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1011)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "path_separator".to_string(), - FieldValue::Literal(LiteralBits::String("::".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 44527, 44587), - }); - declarations.push(Declaration { - id: DeclarationId(1698), - name: Some("rust_functions".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1012), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1012)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "definition".to_string(), - FieldValue::Literal(LiteralBits::String( - "fn {name}({params}) -> {ret} { {body} }".to_string(), - )), - ), - ( - "definition_exported".to_string(), - FieldValue::Literal(LiteralBits::String( - "pub fn {name}({params}) -> {ret} { {body} }".to_string(), - )), - ), - ( - "definition_void".to_string(), - FieldValue::Literal(LiteralBits::String( - "fn {name}({params}) { {body} }".to_string(), - )), - ), - ( - "param_with_type".to_string(), - FieldValue::Literal(LiteralBits::String("{name}: {type}".to_string())), - ), - ( - "param_separator".to_string(), - FieldValue::Literal(LiteralBits::String(", ".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 44589, 44867), - }); - declarations.push(Declaration { - id: DeclarationId(1699), - name: Some("rust_type_applications".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1013), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1013)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "optional".to_string(), - FieldValue::Literal(LiteralBits::String("Option<{element}>".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 44869, 44957), - }); - declarations.push(Declaration { - id: DeclarationId(1700), - name: Some("rust_type_defs".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1014), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1014)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "struct_def".to_string(), - FieldValue::Literal(LiteralBits::String( - "#[derive(Clone, Debug)]\npub struct {name} { {fields} }".to_string(), - )), - ), - ( - "struct_field".to_string(), - FieldValue::Literal(LiteralBits::String("pub {name}: {type},".to_string())), - ), - ( - "enum_def".to_string(), - FieldValue::Literal(LiteralBits::String( - "#[derive(Clone, Debug)]\npub enum {name} { {variants} }".to_string(), - )), - ), - ( - "enum_unit_variant".to_string(), - FieldValue::Literal(LiteralBits::String("{name},".to_string())), - ), - ( - "enum_data_variant".to_string(), - FieldValue::Literal(LiteralBits::String( - "{name} { {fields} },".to_string(), - )), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 44959, 45261), - }); - declarations.push(Declaration { - id: DeclarationId(1701), - name: Some("rust_record_derive_templates".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1015), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1015)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "struct_def_no_debug".to_string(), - FieldValue::Literal(LiteralBits::String( - "#[derive(Clone)]\npub struct {name} { {fields} }".to_string(), - )), - ), - ( - "enum_def_no_debug".to_string(), - FieldValue::Literal(LiteralBits::String( - "#[derive(Clone)]\npub enum {name} { {variants} }".to_string(), - )), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 45263, 45476), - }); - declarations.push(Declaration { - id: DeclarationId(1702), - name: Some("rust_patterns".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1016), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1016)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "match_expr".to_string(), - FieldValue::Literal(LiteralBits::String( - "match {expr} { {arms} }".to_string(), - )), - ), - ( - "match_arm".to_string(), - FieldValue::Literal(LiteralBits::String( - "{pattern} => {body},".to_string(), - )), - ), - ( - "variant_pattern".to_string(), - FieldValue::Literal(LiteralBits::String( - "{name} {{ {bindings} }}".to_string(), - )), - ), - ( - "variant_pattern_positional".to_string(), - FieldValue::Literal(LiteralBits::String("{name}({binding})".to_string())), - ), - ( - "variant_pattern_empty".to_string(), - FieldValue::Literal(LiteralBits::String("{name}".to_string())), - ), - ( - "field_binding".to_string(), - FieldValue::Literal(LiteralBits::String("{field}: {binding}".to_string())), - ), - ( - "field_binding_separator".to_string(), - FieldValue::Literal(LiteralBits::String(", ".to_string())), - ), - ( - "wildcard".to_string(), - FieldValue::Literal(LiteralBits::String("_".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 45478, 45813), - }); - declarations.push(Declaration { - id: DeclarationId(1703), - name: Some("rust_language_spec_free_monoid_concat_contract".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1025), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1025)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(253)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String( - "{ let mut __left = {left}; __left.extend({right}); __left }" - .to_string(), - )), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2324), - payload: vec![FieldValue::Literal(LiteralBits::String( - "{ let mut __left = {left}; __left.extend({right}); __left }" - .to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2323), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 45815, 46185), - }); - declarations.push(Declaration { - id: DeclarationId(1704), - name: Some("rust_language_spec_free_monoid_length_contract".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1025), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1025)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(271)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String( - "({recv}).len() as i64".to_string(), - )), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2324), - payload: vec![FieldValue::Literal(LiteralBits::String( - "({recv}).len() as i64".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2323), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 46187, 46481), - }); - declarations.push(Declaration { - id: DeclarationId(1705), - name: Some("rust_language_spec_free_monoid_emptiness_contract".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1025), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1025)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(267)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String("({recv}).is_empty()".to_string())), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2324), - payload: vec![FieldValue::Literal(LiteralBits::String( - "({recv}).is_empty()".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2323), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 46652, 46947), - }); - declarations.push(Declaration { - id: DeclarationId(1706), - name: Some("rust_language_spec_free_monoid_fold_contract".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1025), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1025)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(263)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String( - "({recv}).iter().fold({init}, {body})".to_string(), - )), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2324), - payload: vec![FieldValue::Literal(LiteralBits::String( - "({recv}).iter().fold({init}, {body})".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2323), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 46949, 47269), - }); - declarations.push(Declaration { - id: DeclarationId(1707), - name: Some("rust_language_spec_map_contract".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1025), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1025)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(274)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String( - "({recv}).iter().map({body}).collect::>()".to_string(), - )), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2324), - payload: vec![FieldValue::Literal(LiteralBits::String( - "({recv}).iter().map({body}).collect::>()".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2323), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 47271, 47599), - }); - declarations.push(Declaration { id: DeclarationId(1708), name: Some("rust_collection_ops".to_string()), connective: TypeConnective::Instantiation { template: DeclarationId(1017), arguments: vec![] }, type_params: vec![], phantom_params: Vec::new(), meta_tag: Some(DeclarationId(1017)), specialization_parent: None, inhabits: None, value_body: Some(ValueBody::Structural { fields: vec![("concat_contract".to_string(), FieldValue::Reference(DeclarationId(1703))), ("length_contract".to_string(), FieldValue::Reference(DeclarationId(1704))), ("is_empty_contract".to_string(), FieldValue::Reference(DeclarationId(1705))), ("fold_contract".to_string(), FieldValue::Reference(DeclarationId(1706))), ("filter_contract".to_string(), FieldValue::Reference(DeclarationId(1152))), ("flat_map_contract".to_string(), FieldValue::Reference(DeclarationId(1155))), ("any_contract".to_string(), FieldValue::Reference(DeclarationId(1153))), ("all_contract".to_string(), FieldValue::Reference(DeclarationId(1154))), ("map_contract".to_string(), FieldValue::Reference(DeclarationId(1707))), ("filter".to_string(), FieldValue::Literal(LiteralBits::String("{ let mut __out = Vec::new(); for {item} in ({recv}).iter() { if {predicate} { __out.push({item_push}); } } __out }".to_string()))), ("contains".to_string(), FieldValue::Literal(LiteralBits::String("({recv}).contains({item})".to_string()))), ("empty_list".to_string(), FieldValue::Literal(LiteralBits::String("Vec::new()".to_string()))), ("list_literal".to_string(), FieldValue::Literal(LiteralBits::String("vec![{elements}]".to_string()))), ("cons".to_string(), FieldValue::Literal(LiteralBits::String("{ let mut __list = {tail}; __list.insert(0, {head}); __list }".to_string())))] }), refinement: None, nominal_opacity: None, span: SourceSpan::new("src/v3/spec/rust.dag", 47601, 48477) }); - declarations.push(Declaration { - id: DeclarationId(1709), - name: Some("rust_value_construction".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1018), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1018)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "struct_literal".to_string(), - FieldValue::Literal(LiteralBits::String( - "{type} {{ {fields} }}".to_string(), - )), - ), - ( - "struct_field_init".to_string(), - FieldValue::Literal(LiteralBits::String("{name}: {value}".to_string())), - ), - ( - "struct_field_separator".to_string(), - FieldValue::Literal(LiteralBits::String(", ".to_string())), - ), - ( - "variant_construction".to_string(), - FieldValue::Literal(LiteralBits::String("{variant}({args})".to_string())), - ), - ( - "variant_named_construction".to_string(), - FieldValue::Literal(LiteralBits::String( - "{variant} {{ {fields} }}".to_string(), - )), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 48479, 48751), - }); - declarations.push(Declaration { - id: DeclarationId(1710), - name: Some("rust_rendering".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1019), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1019)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "read".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2318), - payload: vec![], - }, - ), - ( - "construct".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2320), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 48753, 48834), - }); - declarations.push(Declaration { - id: DeclarationId(1711), - name: Some("rust_language".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1022), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1022)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "statements".to_string(), - FieldValue::Reference(DeclarationId(1693)), - ), - ( - "expressions".to_string(), - FieldValue::Reference(DeclarationId(1694)), - ), - ( - "control_flow".to_string(), - FieldValue::Reference(DeclarationId(1695)), - ), - ( - "literals".to_string(), - FieldValue::Reference(DeclarationId(1696)), - ), - ( - "modules".to_string(), - FieldValue::Reference(DeclarationId(1697)), - ), - ( - "functions".to_string(), - FieldValue::Reference(DeclarationId(1698)), - ), - ( - "type_applications".to_string(), - FieldValue::Reference(DeclarationId(1699)), - ), - ( - "type_definitions".to_string(), - FieldValue::Reference(DeclarationId(1700)), - ), - ( - "record_derive_templates".to_string(), - FieldValue::Reference(DeclarationId(1701)), - ), - ( - "patterns".to_string(), - FieldValue::Reference(DeclarationId(1702)), - ), - ( - "collection_ops".to_string(), - FieldValue::Reference(DeclarationId(1708)), - ), - ( - "values".to_string(), - FieldValue::Reference(DeclarationId(1709)), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 48836, 49281), - }); - declarations.push(Declaration { - id: DeclarationId(1712), - name: Some("rust_correction_style".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1035), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1035)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "indent_unit".to_string(), - FieldValue::Literal(LiteralBits::String(" ".to_string())), - ), - ( - "line_ending".to_string(), - FieldValue::Literal(LiteralBits::String("\n".to_string())), - ), - ( - "string_quote".to_string(), - FieldValue::Literal(LiteralBits::String("%Q".to_string())), - ), - ( - "trailing_semicolon".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 50705, 50844), - }); - declarations.push(Declaration { - id: DeclarationId(1713), - name: Some("rust_clean_emission".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1026), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1026)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "expression_wrapping".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2327), - payload: vec![], - }, - ), - ( - "pattern_bindings".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2330), - payload: vec![], - }, - ), - ( - "variant_payload_field_access".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2334), - payload: vec![], - }, - ), - ( - "imports".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2336), - payload: vec![], - }, - ), - ( - "block_return".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2339), - payload: vec![], - }, - ), - ( - "variable_bindings".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2342), - payload: vec![], - }, - ), - ( - "match_arm_body".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2345), - payload: vec![], - }, - ), - ( - "correction_style".to_string(), - FieldValue::Reference(DeclarationId(1712)), - ), - ( - "post_emit_verifier".to_string(), - FieldValue::Record(vec![ - ( - "command".to_string(), - FieldValue::Literal(LiteralBits::String("rustc".to_string())), - ), - ( - "args".to_string(), - FieldValue::List(vec![ - FieldValue::Literal(LiteralBits::String( - "--edition=2021".to_string(), - )), - FieldValue::Literal(LiteralBits::String("-D".to_string())), - FieldValue::Literal(LiteralBits::String( - "warnings".to_string(), - )), - ]), - ), - ( - "syntax_only".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "expected_exit_code".to_string(), - FieldValue::Literal(LiteralBits::Int("0".to_string())), - ), - ( - "output_policy".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2348), - payload: vec![], - }, - ), - ]), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 50846, 51459), - }); - declarations.push(Declaration { - id: DeclarationId(1714), - name: Some("rust_clean_emission_binding".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1027), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1027)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "clean_emission".to_string(), - FieldValue::Reference(DeclarationId(1713)), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 51461, 51591), - }); - declarations.push(Declaration { - id: DeclarationId(1715), - name: Some("rust_port_accessor".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(840), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(840)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String( - "({p0}).port_opt({p1}).cloned()".to_string(), - )), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 52693, 52796), - }); - declarations.push(Declaration { - id: DeclarationId(1716), - name: Some("rust_node_accessor".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(840), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(840)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String( - "({p0}).node_opt({p1}).cloned()".to_string(), - )), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 52798, 52901), - }); - declarations.push(Declaration { - id: DeclarationId(1717), - name: Some("rust_resolve_producer_accessor".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(840), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(840)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String( - "({p0}).resolve_producer_opt({p1}).cloned()".to_string(), - )), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 52903, 53030), - }); - declarations.push(Declaration { - id: DeclarationId(1718), - name: Some("port_binding_rust".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(841), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(841)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "accessor".to_string(), - FieldValue::Reference(DeclarationId(842)), - ), - ( - "realization".to_string(), - FieldValue::Reference(DeclarationId(1715)), - ), - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 53032, 53163), - }); - declarations.push(Declaration { - id: DeclarationId(1719), - name: Some("node_binding_rust".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(841), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(841)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "accessor".to_string(), - FieldValue::Reference(DeclarationId(843)), - ), - ( - "realization".to_string(), - FieldValue::Reference(DeclarationId(1716)), - ), - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 53165, 53296), - }); - declarations.push(Declaration { - id: DeclarationId(1720), - name: Some("resolve_producer_binding_rust".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(841), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(841)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "accessor".to_string(), - FieldValue::Reference(DeclarationId(844)), - ), - ( - "realization".to_string(), - FieldValue::Reference(DeclarationId(1717)), - ), - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 53298, 53465), - }); - declarations.push(Declaration { - id: DeclarationId(1721), - name: Some("rust_lane2_workflow_accessor".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(840), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(840)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String( - "({p0}).lane2_workflow_effect_at({p1}).cloned()".to_string(), - )), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 53976, 54105), - }); - declarations.push(Declaration { - id: DeclarationId(1722), - name: Some("lane2_workflow_at_binding_rust".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(841), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(841)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "accessor".to_string(), - FieldValue::Reference(DeclarationId(847)), - ), - ( - "realization".to_string(), - FieldValue::Reference(DeclarationId(1721)), - ), - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 54107, 54274), - }); - declarations.push(Declaration { - id: DeclarationId(1723), - name: Some("rust_workflow_root_port_accessor".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(840), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(840)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String( - "({p0}).workflow_root_port()".to_string(), - )), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 54969, 55083), - }); - declarations.push(Declaration { - id: DeclarationId(1724), - name: Some("workflow_root_port_binding_rust".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(841), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(841)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "accessor".to_string(), - FieldValue::Reference(DeclarationId(849)), - ), - ( - "realization".to_string(), - FieldValue::Reference(DeclarationId(1723)), - ), - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 55085, 55258), - }); - declarations.push(Declaration { - id: DeclarationId(1725), - name: Some("rust_workflow_root".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(987), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(987)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(848)), - ), - ( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String("WorkflowRoot".to_string())), - ), - ( - "is_copy".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ("fields".to_string(), FieldValue::List(vec![])), - ( - "cost".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 55670, 55831), - }); - declarations.push(Declaration { - id: DeclarationId(1726), - name: Some("rust_declaration_by_id_accessor".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(840), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(840)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String( - "({p0}).declaration_opt({p1}).cloned()".to_string(), - )), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 56158, 56281), - }); - declarations.push(Declaration { - id: DeclarationId(1727), - name: Some("declaration_by_id_binding_rust".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(841), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(841)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "accessor".to_string(), - FieldValue::Reference(DeclarationId(845)), - ), - ( - "realization".to_string(), - FieldValue::Reference(DeclarationId(1726)), - ), - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 56283, 56453), - }); - declarations.push(Declaration { - id: DeclarationId(1728), - name: Some("rust_declaration_by_name_accessor".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(840), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(840)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String( - "({p0}).declaration_by_name({p1}).cloned()".to_string(), - )), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 56800, 56929), - }); - declarations.push(Declaration { - id: DeclarationId(1729), - name: Some("declaration_by_name_binding_rust".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(841), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(841)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "accessor".to_string(), - FieldValue::Reference(DeclarationId(846)), - ), - ( - "realization".to_string(), - FieldValue::Reference(DeclarationId(1728)), - ), - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 56931, 57107), - }); - declarations.push(Declaration { - id: DeclarationId(1730), - name: Some("rust_per_call_pattern_at_accessor".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(840), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(840)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String( - "per_call_pattern_at({p0}, *{p1})".to_string(), - )), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 57327, 57447), - }); - declarations.push(Declaration { - id: DeclarationId(1731), - name: Some("per_call_pattern_at_binding_rust".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(841), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(841)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "accessor".to_string(), - FieldValue::Reference(DeclarationId(971)), - ), - ( - "realization".to_string(), - FieldValue::Reference(DeclarationId(1730)), - ), - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 57449, 57625), - }); - declarations.push(Declaration { - id: DeclarationId(1732), - name: Some("rust_per_call_descent_operand_port_accessor".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(840), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(840)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "carrier".to_string(), - FieldValue::Literal(LiteralBits::String( - "per_call_descent_operand_port({p0}, *{p1})".to_string(), - )), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 57811, 57951), - }); - declarations.push(Declaration { - id: DeclarationId(1733), - name: Some("per_call_descent_operand_port_binding_rust".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(841), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(841)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "accessor".to_string(), - FieldValue::Reference(DeclarationId(972)), - ), - ( - "realization".to_string(), - FieldValue::Reference(DeclarationId(1732)), - ), - ( - "language".to_string(), - FieldValue::Reference(DeclarationId(1711)), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/rust.dag", 57953, 58159), - }); - declarations.push(Declaration { - id: DeclarationId(1734), - name: Some("CompilerHostRealization".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "symbol".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/pipeline.dag", 453, 502), - }); - declarations.push(Declaration { - id: DeclarationId(1735), - name: Some("PipelineSnapshotKind".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "SnapshotSurface".to_string(), - ty: DeclarationId(2830), - }, - Field { - label: "SnapshotDag".to_string(), - ty: DeclarationId(2831), - }, - Field { - label: "SnapshotText".to_string(), - ty: DeclarationId(2832), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/pipeline.dag", 504, 576), - }); - declarations.push(Declaration { - id: DeclarationId(1736), - name: Some("PipelineStageBinding".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "stage".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "realization".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "snapshot".to_string(), - ty: DeclarationId(1735), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/pipeline.dag", 578, 694), - }); - declarations.push(Declaration { - id: DeclarationId(1737), - name: Some("parse_realization".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "symbol".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1734)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "symbol".to_string(), - FieldValue::Literal(LiteralBits::String("v3_compiler::parse".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/pipeline.dag", 696, 780), - }); - declarations.push(Declaration { - id: DeclarationId(1738), - name: Some("lower_realization".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "symbol".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1734)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "symbol".to_string(), - FieldValue::Literal(LiteralBits::String("v3_compiler::lower".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/pipeline.dag", 782, 866), - }); - declarations.push(Declaration { - id: DeclarationId(1739), - name: Some("infer_realization".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "symbol".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1734)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "symbol".to_string(), - FieldValue::Literal(LiteralBits::String("v3_compiler::infer".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/pipeline.dag", 868, 952), - }); - declarations.push(Declaration { - id: DeclarationId(1740), - name: Some("compute_ownership_realization".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "symbol".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1734)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "symbol".to_string(), - FieldValue::Literal(LiteralBits::String( - "v3_compiler::compute_ownership".to_string(), - )), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/pipeline.dag", 954, 1062), - }); - declarations.push(Declaration { - id: DeclarationId(1741), - name: Some("emit_realization".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "symbol".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1734)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "symbol".to_string(), - FieldValue::Literal(LiteralBits::String("v3_compiler::emit".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/pipeline.dag", 1064, 1146), - }); - declarations.push(Declaration { - id: DeclarationId(1742), - name: Some("lens_complexity_realization".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "symbol".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1734)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "symbol".to_string(), - FieldValue::Literal(LiteralBits::String( - "v3_compiler::lens_complexity".to_string(), - )), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/pipeline.dag", 1148, 1252), - }); - declarations.push(Declaration { - id: DeclarationId(1743), - name: Some("parse_stage_binding".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1736), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1736)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "stage".to_string(), - FieldValue::Reference(DeclarationId(1749)), - ), - ( - "realization".to_string(), - FieldValue::Reference(DeclarationId(1737)), - ), - ( - "snapshot".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2830), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/pipeline.dag", 1254, 1382), - }); - declarations.push(Declaration { - id: DeclarationId(1744), - name: Some("lower_stage_binding".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1736), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1736)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "stage".to_string(), - FieldValue::Reference(DeclarationId(1750)), - ), - ( - "realization".to_string(), - FieldValue::Reference(DeclarationId(1738)), - ), - ( - "snapshot".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2831), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/pipeline.dag", 1384, 1508), - }); - declarations.push(Declaration { - id: DeclarationId(1745), - name: Some("infer_stage_binding".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1736), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1736)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "stage".to_string(), - FieldValue::Reference(DeclarationId(1751)), - ), - ( - "realization".to_string(), - FieldValue::Reference(DeclarationId(1739)), - ), - ( - "snapshot".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2831), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/pipeline.dag", 1510, 1634), - }); - declarations.push(Declaration { - id: DeclarationId(1746), - name: Some("compute_ownership_stage_binding".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1736), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1736)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "stage".to_string(), - FieldValue::Reference(DeclarationId(1752)), - ), - ( - "realization".to_string(), - FieldValue::Reference(DeclarationId(1740)), - ), - ( - "snapshot".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2831), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/pipeline.dag", 1636, 1796), - }); - declarations.push(Declaration { - id: DeclarationId(1747), - name: Some("lens_complexity_stage_binding".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1736), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1736)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "stage".to_string(), - FieldValue::Reference(DeclarationId(1753)), - ), - ( - "realization".to_string(), - FieldValue::Reference(DeclarationId(1742)), - ), - ( - "snapshot".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2831), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/pipeline.dag", 1798, 1952), - }); - declarations.push(Declaration { - id: DeclarationId(1748), - name: Some("emit_stage_binding".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1736), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1736)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "stage".to_string(), - FieldValue::Reference(DeclarationId(1754)), - ), - ( - "realization".to_string(), - FieldValue::Reference(DeclarationId(1741)), - ), - ( - "snapshot".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2832), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/pipeline.dag", 1954, 2076), - }); - declarations.push(Declaration { - id: DeclarationId(1749), - name: Some("parse".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227), DeclarationId(227)], - output: DeclarationId(839), - body: ArrowBody::ExternalRealization(DeclarationId(1737)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/pipeline.dag", 2078, 2140), - }); - declarations.push(Declaration { - id: DeclarationId(1750), - name: Some("lower".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839)], - output: DeclarationId(839), - body: ArrowBody::ExternalRealization(DeclarationId(1738)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/pipeline.dag", 2142, 2184), - }); - declarations.push(Declaration { - id: DeclarationId(1751), - name: Some("infer".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839)], - output: DeclarationId(839), - body: ArrowBody::ExternalRealization(DeclarationId(1739)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/pipeline.dag", 2186, 2228), - }); - declarations.push(Declaration { - id: DeclarationId(1752), - name: Some("compute_ownership".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839)], - output: DeclarationId(839), - body: ArrowBody::ExternalRealization(DeclarationId(1740)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/pipeline.dag", 2230, 2288), - }); - declarations.push(Declaration { - id: DeclarationId(1753), - name: Some("lens_complexity".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839)], - output: DeclarationId(839), - body: ArrowBody::ExternalRealization(DeclarationId(1742)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/pipeline.dag", 2290, 2347), - }); - declarations.push(Declaration { - id: DeclarationId(1754), - name: Some("emit".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![ - DeclarationId(839), - DeclarationId(839), - DeclarationId(839), - DeclarationId(1022), - ], - output: DeclarationId(227), - body: ArrowBody::ExternalRealization(DeclarationId(1741)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/pipeline.dag", 2349, 2460), - }); - declarations.push(Declaration { - id: DeclarationId(1755), - name: Some("compile".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227), DeclarationId(227), DeclarationId(1022)], - output: DeclarationId(227), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/compiler/pipeline.dag", - 2533, - 2605, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/pipeline.dag", 2462, 2605), - }); - declarations.push(Declaration { - id: DeclarationId(1756), - name: Some("from_symbol".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227)], - output: DeclarationId(2833), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/compiler/operators.dag", - 156, - 771, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/operators.dag", 108, 771), - }); - declarations.push(Declaration { - id: DeclarationId(1757), - name: Some("symbol".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(817)], - output: DeclarationId(227), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(1007))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/operators.dag", 773, 1214), - }); - declarations.push(Declaration { - id: DeclarationId(1758), - name: Some("algebra_field_name".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(817)], - output: DeclarationId(227), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(1024))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/operators.dag", 1216, 2017), - }); - declarations.push(Declaration { - id: DeclarationId(1759), - name: Some("LensRegistryEntry".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(147), - }, - Field { - label: "lens_file".to_string(), - ty: DeclarationId(154), - }, - Field { - label: "generated_file".to_string(), - ty: DeclarationId(154), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/regen.dag", 2117, 2212), - }); - declarations.push(Declaration { - id: DeclarationId(1760), - name: Some("lens_cost_entry".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1759), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1759)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("cost".to_string())), - ), - ( - "lens_file".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/lenses/complexity.dag".to_string(), - )), - ), - ( - "generated_file".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/compiler/src/complexity_lens_generated.rs".to_string(), - )), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/regen.dag", 2214, 2387), - }); - declarations.push(Declaration { - id: DeclarationId(1761), - name: Some("lens_cost_symbolic_entry".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1759), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1759)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("cost_symbolic".to_string())), - ), - ( - "lens_file".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/lenses/cost.dag".to_string(), - )), - ), - ( - "generated_file".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/compiler/src/cost_symbolic_lens_generated.rs".to_string(), - )), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/regen.dag", 2389, 2577), - }); - declarations.push(Declaration { - id: DeclarationId(1762), - name: Some("lens_cost_target_realization_entry".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1759), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1759)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String( - "cost_target_realization".to_string(), - )), - ), - ( - "lens_file".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/lenses/cost_target_realization.dag".to_string(), - )), - ), - ( - "generated_file".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/compiler/src/lens_cost_target_realization_generated.rs" - .to_string(), - )), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/regen.dag", 2579, 2816), - }); - declarations.push(Declaration { - id: DeclarationId(1763), - name: Some("lens_effect_enumeration_entry".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1759), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1759)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("effect_enumeration".to_string())), - ), - ( - "lens_file".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/lenses/effect_enumeration.dag".to_string(), - )), - ), - ( - "generated_file".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/compiler/src/lens_effect_enumeration_generated.rs".to_string(), - )), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/regen.dag", 2818, 3035), - }); - declarations.push(Declaration { - id: DeclarationId(1764), - name: Some("lens_parallelism_entry".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1759), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1759)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("parallelism".to_string())), - ), - ( - "lens_file".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/lenses/parallelism.dag".to_string(), - )), - ), - ( - "generated_file".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/compiler/src/lens_parallelism_generated.rs".to_string(), - )), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/regen.dag", 3037, 3226), - }); - declarations.push(Declaration { - id: DeclarationId(1765), - name: Some("lens_idempotency_entry".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1759), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1759)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("idempotency".to_string())), - ), - ( - "lens_file".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/lenses/idempotency.dag".to_string(), - )), - ), - ( - "generated_file".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/compiler/src/lens_idempotency_generated.rs".to_string(), - )), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/regen.dag", 3228, 3417), - }); - declarations.push(Declaration { - id: DeclarationId(1766), - name: Some("lens_provenance_entry".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1759), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1759)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("provenance".to_string())), - ), - ( - "lens_file".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/lenses/provenance.dag".to_string(), - )), - ), - ( - "generated_file".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/compiler/src/lens_provenance_generated.rs".to_string(), - )), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/regen.dag", 3419, 3604), - }); - declarations.push(Declaration { - id: DeclarationId(1767), - name: Some("lens_structural_resolution_entry".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1759), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1759)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String( - "structural_resolution".to_string(), - )), - ), - ( - "lens_file".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/lenses/structural_resolution.dag".to_string(), - )), - ), - ( - "generated_file".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/compiler/src/lens_structural_resolution_generated.rs" - .to_string(), - )), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/regen.dag", 3606, 3835), - }); - declarations.push(Declaration { - id: DeclarationId(1768), - name: Some("lens_unused_parameters_entry".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1759), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1759)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("unused_parameters".to_string())), - ), - ( - "lens_file".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/lenses/unused_parameters.dag".to_string(), - )), - ), - ( - "generated_file".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/compiler/src/lens_unused_parameters_generated.rs".to_string(), - )), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/regen.dag", 3837, 4050), - }); - declarations.push(Declaration { - id: DeclarationId(1769), - name: Some("lens_infer_helpers_entry".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1759), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1759)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("infer_helpers".to_string())), - ), - ( - "lens_file".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/lenses/infer_helpers.dag".to_string(), - )), - ), - ( - "generated_file".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/compiler/src/infer_helpers_generated.rs".to_string(), - )), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/regen.dag", 4677, 4869), - }); - declarations.push(Declaration { - id: DeclarationId(1770), - name: Some("lens_variant_payload_entry".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1759), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1759)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("variant_payload".to_string())), - ), - ( - "lens_file".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/lenses/variant_payload.dag".to_string(), - )), - ), - ( - "generated_file".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/compiler/src/variant_payload_generated.rs".to_string(), - )), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/regen.dag", 4871, 5071), - }); - declarations.push(Declaration { - id: DeclarationId(1771), - name: Some("lens_lower_helpers_entry".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1759), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1759)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("lower_helpers".to_string())), - ), - ( - "lens_file".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/lenses/lower_helpers.dag".to_string(), - )), - ), - ( - "generated_file".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/compiler/src/lower_helpers_generated.rs".to_string(), - )), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/regen.dag", 5321, 5513), - }); - declarations.push(Declaration { - id: DeclarationId(1772), - name: Some("IntegerAlgebra".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "OrderedRingAlgebra".to_string(), - ty: DeclarationId(2834), - }, - Field { - label: "SemiringAlgebra".to_string(), - ty: DeclarationId(2835), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/languages/rust/primitives.dag", 6434, 6496), - }); - declarations.push(Declaration { - id: DeclarationId(1773), - name: Some("NonIntegerAlgebra".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ApproximateFieldAlgebra".to_string(), - ty: DeclarationId(2836), - }, - Field { - label: "BooleanAlgebraAlgebra".to_string(), - ty: DeclarationId(2837), - }, - Field { - label: "TerminalAlgebra".to_string(), - ty: DeclarationId(2838), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/languages/rust/primitives.dag", 6498, 6594), - }); - declarations.push(Declaration { - id: DeclarationId(1774), - name: Some("TargetCarrier".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "BitCarrier".to_string(), - ty: DeclarationId(2839), - }, - Field { - label: "ByteCarrier".to_string(), - ty: DeclarationId(2840), - }, - Field { - label: "Word16Carrier".to_string(), - ty: DeclarationId(2841), - }, - Field { - label: "Word32Carrier".to_string(), - ty: DeclarationId(2842), - }, - Field { - label: "Word64Carrier".to_string(), - ty: DeclarationId(2843), - }, - Field { - label: "Word128Carrier".to_string(), - ty: DeclarationId(2844), - }, - Field { - label: "TerminalCarrier".to_string(), - ty: DeclarationId(2845), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/languages/rust/primitives.dag", 8184, 8326), - }); - declarations.push(Declaration { - id: DeclarationId(1775), - name: Some("IntegerOverflow".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "TwoComplementWrap".to_string(), - ty: DeclarationId(2846), - }, - Field { - label: "Saturating".to_string(), - ty: DeclarationId(2847), - }, - Field { - label: "Trap".to_string(), - ty: DeclarationId(2848), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/languages/rust/primitives.dag", 9043, 9109), - }); - declarations.push(Declaration { - id: DeclarationId(1776), - name: Some("RustPrimitive".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "IntegerPrimitive".to_string(), - ty: DeclarationId(2849), - }, - Field { - label: "NonIntegerPrimitive".to_string(), - ty: DeclarationId(2850), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/languages/rust/primitives.dag", 9864, 10650), - }); - declarations.push(Declaration { - id: DeclarationId(1777), - name: Some("rust_grounding_primitives".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1776), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(2851)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::List(vec![ - FieldValue::Variant { - constructor: DeclarationId(2849), - payload: vec![ - FieldValue::Literal(LiteralBits::String("i8".to_string())), - FieldValue::Variant { - constructor: DeclarationId(2834), - payload: vec![], - }, - FieldValue::Variant { - constructor: DeclarationId(2840), - payload: vec![], - }, - FieldValue::Literal(LiteralBits::String("-128".to_string())), - FieldValue::Literal(LiteralBits::String("127".to_string())), - FieldValue::Literal(LiteralBits::Bool(true)), - FieldValue::Variant { - constructor: DeclarationId(2846), - payload: vec![], - }, - ], - }, - FieldValue::Variant { - constructor: DeclarationId(2849), - payload: vec![ - FieldValue::Literal(LiteralBits::String("i16".to_string())), - FieldValue::Variant { - constructor: DeclarationId(2834), - payload: vec![], - }, - FieldValue::Variant { - constructor: DeclarationId(2841), - payload: vec![], - }, - FieldValue::Literal(LiteralBits::String("-32768".to_string())), - FieldValue::Literal(LiteralBits::String("32767".to_string())), - FieldValue::Literal(LiteralBits::Bool(true)), - FieldValue::Variant { - constructor: DeclarationId(2846), - payload: vec![], - }, - ], - }, - FieldValue::Variant { - constructor: DeclarationId(2849), - payload: vec![ - FieldValue::Literal(LiteralBits::String("i32".to_string())), - FieldValue::Variant { - constructor: DeclarationId(2834), - payload: vec![], - }, - FieldValue::Variant { - constructor: DeclarationId(2842), - payload: vec![], - }, - FieldValue::Literal(LiteralBits::String("-2147483648".to_string())), - FieldValue::Literal(LiteralBits::String("2147483647".to_string())), - FieldValue::Literal(LiteralBits::Bool(true)), - FieldValue::Variant { - constructor: DeclarationId(2846), - payload: vec![], - }, - ], - }, - FieldValue::Variant { - constructor: DeclarationId(2849), - payload: vec![ - FieldValue::Literal(LiteralBits::String("i64".to_string())), - FieldValue::Variant { - constructor: DeclarationId(2834), - payload: vec![], - }, - FieldValue::Variant { - constructor: DeclarationId(2843), - payload: vec![], - }, - FieldValue::Literal(LiteralBits::String( - "-9223372036854775808".to_string(), - )), - FieldValue::Literal(LiteralBits::String("9223372036854775807".to_string())), - FieldValue::Literal(LiteralBits::Bool(true)), - FieldValue::Variant { - constructor: DeclarationId(2846), - payload: vec![], - }, - ], - }, - FieldValue::Variant { - constructor: DeclarationId(2849), - payload: vec![ - FieldValue::Literal(LiteralBits::String("i128".to_string())), - FieldValue::Variant { - constructor: DeclarationId(2834), - payload: vec![], - }, - FieldValue::Variant { - constructor: DeclarationId(2844), - payload: vec![], - }, - FieldValue::Literal(LiteralBits::String( - "-170141183460469231731687303715884105728".to_string(), - )), - FieldValue::Literal(LiteralBits::String( - "170141183460469231731687303715884105727".to_string(), - )), - FieldValue::Literal(LiteralBits::Bool(true)), - FieldValue::Variant { - constructor: DeclarationId(2846), - payload: vec![], - }, - ], - }, - FieldValue::Variant { - constructor: DeclarationId(2849), - payload: vec![ - FieldValue::Literal(LiteralBits::String("u8".to_string())), - FieldValue::Variant { - constructor: DeclarationId(2835), - payload: vec![], - }, - FieldValue::Variant { - constructor: DeclarationId(2840), - payload: vec![], - }, - FieldValue::Literal(LiteralBits::String("0".to_string())), - FieldValue::Literal(LiteralBits::String("255".to_string())), - FieldValue::Literal(LiteralBits::Bool(true)), - FieldValue::Variant { - constructor: DeclarationId(2846), - payload: vec![], - }, - ], - }, - FieldValue::Variant { - constructor: DeclarationId(2849), - payload: vec![ - FieldValue::Literal(LiteralBits::String("u16".to_string())), - FieldValue::Variant { - constructor: DeclarationId(2835), - payload: vec![], - }, - FieldValue::Variant { - constructor: DeclarationId(2841), - payload: vec![], - }, - FieldValue::Literal(LiteralBits::String("0".to_string())), - FieldValue::Literal(LiteralBits::String("65535".to_string())), - FieldValue::Literal(LiteralBits::Bool(true)), - FieldValue::Variant { - constructor: DeclarationId(2846), - payload: vec![], - }, - ], - }, - FieldValue::Variant { - constructor: DeclarationId(2849), - payload: vec![ - FieldValue::Literal(LiteralBits::String("u32".to_string())), - FieldValue::Variant { - constructor: DeclarationId(2835), - payload: vec![], - }, - FieldValue::Variant { - constructor: DeclarationId(2842), - payload: vec![], - }, - FieldValue::Literal(LiteralBits::String("0".to_string())), - FieldValue::Literal(LiteralBits::String("4294967295".to_string())), - FieldValue::Literal(LiteralBits::Bool(true)), - FieldValue::Variant { - constructor: DeclarationId(2846), - payload: vec![], - }, - ], - }, - FieldValue::Variant { - constructor: DeclarationId(2849), - payload: vec![ - FieldValue::Literal(LiteralBits::String("u64".to_string())), - FieldValue::Variant { - constructor: DeclarationId(2835), - payload: vec![], - }, - FieldValue::Variant { - constructor: DeclarationId(2843), - payload: vec![], - }, - FieldValue::Literal(LiteralBits::String("0".to_string())), - FieldValue::Literal(LiteralBits::String( - "18446744073709551615".to_string(), - )), - FieldValue::Literal(LiteralBits::Bool(true)), - FieldValue::Variant { - constructor: DeclarationId(2846), - payload: vec![], - }, - ], - }, - FieldValue::Variant { - constructor: DeclarationId(2849), - payload: vec![ - FieldValue::Literal(LiteralBits::String("u128".to_string())), - FieldValue::Variant { - constructor: DeclarationId(2835), - payload: vec![], - }, - FieldValue::Variant { - constructor: DeclarationId(2844), - payload: vec![], - }, - FieldValue::Literal(LiteralBits::String("0".to_string())), - FieldValue::Literal(LiteralBits::String( - "340282366920938463463374607431768211455".to_string(), - )), - FieldValue::Literal(LiteralBits::Bool(true)), - FieldValue::Variant { - constructor: DeclarationId(2846), - payload: vec![], - }, - ], - }, - FieldValue::Variant { - constructor: DeclarationId(2850), - payload: vec![ - FieldValue::Literal(LiteralBits::String("f32".to_string())), - FieldValue::Variant { - constructor: DeclarationId(2836), - payload: vec![], - }, - FieldValue::Variant { - constructor: DeclarationId(2842), - payload: vec![], - }, - FieldValue::Literal(LiteralBits::Bool(true)), - ], - }, - FieldValue::Variant { - constructor: DeclarationId(2850), - payload: vec![ - FieldValue::Literal(LiteralBits::String("f64".to_string())), - FieldValue::Variant { - constructor: DeclarationId(2836), - payload: vec![], - }, - FieldValue::Variant { - constructor: DeclarationId(2843), - payload: vec![], - }, - FieldValue::Literal(LiteralBits::Bool(true)), - ], - }, - FieldValue::Variant { - constructor: DeclarationId(2850), - payload: vec![ - FieldValue::Literal(LiteralBits::String("bool".to_string())), - FieldValue::Variant { - constructor: DeclarationId(2837), - payload: vec![], - }, - FieldValue::Variant { - constructor: DeclarationId(2839), - payload: vec![], - }, - FieldValue::Literal(LiteralBits::Bool(true)), - ], - }, - FieldValue::Variant { - constructor: DeclarationId(2850), - payload: vec![ - FieldValue::Literal(LiteralBits::String("()".to_string())), - FieldValue::Variant { - constructor: DeclarationId(2838), - payload: vec![], - }, - FieldValue::Variant { - constructor: DeclarationId(2845), - payload: vec![], - }, - FieldValue::Literal(LiteralBits::Bool(true)), - ], - }, - ])), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/languages/rust/primitives.dag", 10996, 15736), - }); - declarations.push(Declaration { - id: DeclarationId(1778), - name: Some("CronField".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Wildcard".to_string(), - ty: DeclarationId(2852), - }, - Field { - label: "Exact".to_string(), - ty: DeclarationId(2853), - }, - Field { - label: "Listed".to_string(), - ty: DeclarationId(2855), - }, - Field { - label: "Ranged".to_string(), - ty: DeclarationId(2856), - }, - Field { - label: "Step".to_string(), - ty: DeclarationId(2857), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/cron/schedule_model.dag", 4224, 4443), - }); - declarations.push(Declaration { - id: DeclarationId(1779), - name: Some("CronSchedule".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "minute".to_string(), - ty: DeclarationId(1778), - }, - Field { - label: "hour".to_string(), - ty: DeclarationId(1778), - }, - Field { - label: "day_of_month".to_string(), - ty: DeclarationId(1778), - }, - Field { - label: "month".to_string(), - ty: DeclarationId(1778), - }, - Field { - label: "day_of_week".to_string(), - ty: DeclarationId(1778), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/cron/schedule_model.dag", 4445, 4574), - }); - declarations.push(Declaration { - id: DeclarationId(1780), - name: Some("CronEntry".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "tag".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "schedule".to_string(), - ty: DeclarationId(1779), - }, - Field { - label: "command".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/cron/schedule_model.dag", 4576, 4651), - }); - declarations.push(Declaration { - id: DeclarationId(1781), - name: Some("render_cron_field".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1778)], - output: DeclarationId(227), - body: ArrowBody::Unparsed(SourceSpan::new( - "dsl/extdeps/cron/schedule_model.dag", - 4698, - 4973, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/cron/schedule_model.dag", 4653, 4973), - }); - declarations.push(Declaration { - id: DeclarationId(1782), - name: Some("render_cron_schedule".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1779)], - output: DeclarationId(227), - body: ArrowBody::Unparsed(SourceSpan::new( - "dsl/extdeps/cron/schedule_model.dag", - 5026, - 5263, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/cron/schedule_model.dag", 4975, 5263), - }); - declarations.push(Declaration { - id: DeclarationId(1783), - name: Some("wire_contract".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(309), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(309)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Unparsed(SourceSpan::new( - "dsl/extdeps/github/github.dag", - 722, - 758, - ))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 684, 758), - }); - declarations.push(Declaration { - id: DeclarationId(1784), - name: Some("UserType".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "User".to_string(), - ty: DeclarationId(2858), - }, - Field { - label: "Bot".to_string(), - ty: DeclarationId(2859), - }, - Field { - label: "Organization".to_string(), - ty: DeclarationId(2860), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 831, 872), - }); - declarations.push(Declaration { - id: DeclarationId(1785), - name: Some("GitHubUser".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "login".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "id".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "type".to_string(), - ty: DeclarationId(1784), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 874, 936), - }); - declarations.push(Declaration { - id: DeclarationId(1786), - name: Some("Repository".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "owner".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "full_name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "private".to_string(), - ty: DeclarationId(124), - }, - Field { - label: "default_branch".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 1009, 1120), - }); - declarations.push(Declaration { - id: DeclarationId(1787), - name: Some("GitHubAuthToken".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "token".to_string(), - ty: DeclarationId(143), - }, - Field { - label: "scopes".to_string(), - ty: DeclarationId(2861), - }, - Field { - label: "expires_at".to_string(), - ty: DeclarationId(2862), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 1193, 1286), - }); - declarations.push(Declaration { - id: DeclarationId(1788), - name: Some("GitHubScope".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ScopeRepo".to_string(), - ty: DeclarationId(2863), - }, - Field { - label: "ScopeGist".to_string(), - ty: DeclarationId(2864), - }, - Field { - label: "ScopeWorkflow".to_string(), - ty: DeclarationId(2865), - }, - Field { - label: "ScopeReadOrg".to_string(), - ty: DeclarationId(2866), - }, - Field { - label: "ScopeReadUser".to_string(), - ty: DeclarationId(2867), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 1288, 1385), - }); - declarations.push(Declaration { - id: DeclarationId(1789), - name: Some("Pagination".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "per_page".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "cursor".to_string(), - ty: DeclarationId(2868), - }, - Field { - label: "has_next".to_string(), - ty: DeclarationId(124), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 1510, 1580), - }); - declarations.push(Declaration { - id: DeclarationId(1790), - name: Some("GitHubPermission".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "PermRead".to_string(), - ty: DeclarationId(2869), - }, - Field { - label: "PermWrite".to_string(), - ty: DeclarationId(2870), - }, - Field { - label: "PermAdmin".to_string(), - ty: DeclarationId(2871), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 1653, 1709), - }); - declarations.push(Declaration { - id: DeclarationId(1791), - name: Some("default_api_base".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(227)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Scalar(LiteralBits::String( - "https://api.github.com".to_string(), - ))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 1782, 1838), - }); - declarations.push(Declaration { - id: DeclarationId(1792), - name: Some("default_per_page".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(87), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(87)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Scalar(LiteralBits::Int("30".to_string()))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 1840, 1871), - }); - declarations.push(Declaration { - id: DeclarationId(1793), - name: Some("max_per_page".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(87), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(87)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Scalar(LiteralBits::Int("100".to_string()))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 1873, 1901), - }); - declarations.push(Declaration { - id: DeclarationId(1794), - name: Some("GitHubActionsRuntime".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "oidc_request_url_env".to_string(), - ty: DeclarationId(147), - }, - Field { - label: "oidc_request_token_env".to_string(), - ty: DeclarationId(147), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 1099, 1202), - }); - declarations.push(Declaration { - id: DeclarationId(1795), - name: Some("github_actions_runtime".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1794), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1794)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "oidc_request_url_env".to_string(), - FieldValue::Literal(LiteralBits::String( - "ACTIONS_ID_TOKEN_REQUEST_URL".to_string(), - )), - ), - ( - "oidc_request_token_env".to_string(), - FieldValue::Literal(LiteralBits::String( - "ACTIONS_ID_TOKEN_REQUEST_TOKEN".to_string(), - )), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 1204, 1373), - }); - declarations.push(Declaration { - id: DeclarationId(1796), - name: Some("Workflow".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "on".to_string(), - ty: DeclarationId(2872), - }, - Field { - label: "concurrency".to_string(), - ty: DeclarationId(2873), - }, - Field { - label: "jobs".to_string(), - ty: DeclarationId(2874), - }, - Field { - label: "env".to_string(), - ty: DeclarationId(2876), - }, - Field { - label: "permissions".to_string(), - ty: DeclarationId(2877), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 1773, 2037), - }); - declarations.push(Declaration { - id: DeclarationId(1797), - name: Some("WorkflowPermissions".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "contents".to_string(), - ty: DeclarationId(1798), - }, - Field { - label: "pull_requests".to_string(), - ty: DeclarationId(1798), - }, - Field { - label: "issues".to_string(), - ty: DeclarationId(1798), - }, - Field { - label: "actions".to_string(), - ty: DeclarationId(1798), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2039, 2181), - }); - declarations.push(Declaration { - id: DeclarationId(1798), - name: Some("PermissionLevel".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "PermRead".to_string(), - ty: DeclarationId(2878), - }, - Field { - label: "PermWrite".to_string(), - ty: DeclarationId(2879), - }, - Field { - label: "PermNone".to_string(), - ty: DeclarationId(2880), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2183, 2237), - }); - declarations.push(Declaration { - id: DeclarationId(1799), - name: Some("WorkflowTrigger".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Push".to_string(), - ty: DeclarationId(2883), - }, - Field { - label: "PullRequest".to_string(), - ty: DeclarationId(2886), - }, - Field { - label: "Schedule".to_string(), - ty: DeclarationId(2887), - }, - Field { - label: "WorkflowDispatch".to_string(), - ty: DeclarationId(2889), - }, - Field { - label: "WorkflowCall".to_string(), - ty: DeclarationId(2891), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2353, 2645), - }); - declarations.push(Declaration { - id: DeclarationId(1800), - name: Some("PullRequestActivity".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Opened".to_string(), - ty: DeclarationId(2892), - }, - Field { - label: "Synchronize".to_string(), - ty: DeclarationId(2893), - }, - Field { - label: "Reopened".to_string(), - ty: DeclarationId(2894), - }, - Field { - label: "ReadyForReview".to_string(), - ty: DeclarationId(2895), - }, - Field { - label: "Closed".to_string(), - ty: DeclarationId(2896), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2647, 2741), - }); - declarations.push(Declaration { - id: DeclarationId(1801), - name: Some("DispatchInput".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "description".to_string(), - ty: DeclarationId(2897), - }, - Field { - label: "required".to_string(), - ty: DeclarationId(124), - }, - Field { - label: "default".to_string(), - ty: DeclarationId(2898), - }, - Field { - label: "type".to_string(), - ty: DeclarationId(1802), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2743, 2865), - }); - declarations.push(Declaration { - id: DeclarationId(1802), - name: Some("DispatchInputType".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "InputString".to_string(), - ty: DeclarationId(2899), - }, - Field { - label: "InputBoolean".to_string(), - ty: DeclarationId(2900), - }, - Field { - label: "InputChoice".to_string(), - ty: DeclarationId(2901), - }, - Field { - label: "InputEnvironment".to_string(), - ty: DeclarationId(2902), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2867, 2951), - }); - declarations.push(Declaration { - id: DeclarationId(1803), - name: Some("SecretScope".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "StepScope".to_string(), - ty: DeclarationId(2903), - }, - Field { - label: "JobScope".to_string(), - ty: DeclarationId(2904), - }, - Field { - label: "WorkflowScope".to_string(), - ty: DeclarationId(2905), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5054, 5109), - }); - declarations.push(Declaration { - id: DeclarationId(1804), - name: Some("WorkflowSecret".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(149), - }, - Field { - label: "scope".to_string(), - ty: DeclarationId(1803), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5384, 5447), - }); - declarations.push(Declaration { - id: DeclarationId(1805), - name: Some("Job".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "id".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "name".to_string(), - ty: DeclarationId(2906), - }, - Field { - label: "runner".to_string(), - ty: DeclarationId(1809), - }, - Field { - label: "steps".to_string(), - ty: DeclarationId(2907), - }, - Field { - label: "needs".to_string(), - ty: DeclarationId(2908), - }, - Field { - label: "env".to_string(), - ty: DeclarationId(2910), - }, - Field { - label: "outputs".to_string(), - ty: DeclarationId(2912), - }, - Field { - label: "if_condition".to_string(), - ty: DeclarationId(2913), - }, - Field { - label: "strategy".to_string(), - ty: DeclarationId(2914), - }, - Field { - label: "timeout_minutes".to_string(), - ty: DeclarationId(2915), - }, - Field { - label: "continue_on_error".to_string(), - ty: DeclarationId(124), - }, - Field { - label: "concurrency".to_string(), - ty: DeclarationId(2916), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5591, 6060), - }); - declarations.push(Declaration { - id: DeclarationId(1806), - name: Some("CancelInProgressSpec".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "CancelInProgressBool".to_string(), - ty: DeclarationId(2917), - }, - Field { - label: "CancelInProgressExpression".to_string(), - ty: DeclarationId(2918), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 6878, 6998), - }); - declarations.push(Declaration { - id: DeclarationId(1807), - name: Some("CancelInProgressWhenQueueMax".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "QueueMaxCancelInProgressFalse".to_string(), - ty: DeclarationId(2919), - }, - Field { - label: "QueueMaxCancelInProgressExpression".to_string(), - ty: DeclarationId(2920), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 7806, 7935), - }); - declarations.push(Declaration { - id: DeclarationId(1808), - name: Some("ConcurrencySpec".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ConcurrencyScalar".to_string(), - ty: DeclarationId(2921), - }, - Field { - label: "ConcurrencyMappingQueueMax".to_string(), - ty: DeclarationId(2923), - }, - Field { - label: "ConcurrencyMappingQueueNotMax".to_string(), - ty: DeclarationId(2926), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 8488, 9134), - }); - declarations.push(Declaration { - id: DeclarationId(1809), - name: Some("RunnerSpec".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "HostedRunner".to_string(), - ty: DeclarationId(2927), - }, - Field { - label: "SelfHosted".to_string(), - ty: DeclarationId(2929), - }, - Field { - label: "RunsOnExpression".to_string(), - ty: DeclarationId(2930), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10306, 10529), - }); - declarations.push(Declaration { - id: DeclarationId(1810), - name: Some("RunnerLabel".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "UbuntuLatest".to_string(), - ty: DeclarationId(2931), - }, - Field { - label: "Ubuntu2404".to_string(), - ty: DeclarationId(2932), - }, - Field { - label: "Ubuntu2204".to_string(), - ty: DeclarationId(2933), - }, - Field { - label: "MacosLatest".to_string(), - ty: DeclarationId(2934), - }, - Field { - label: "Macos14".to_string(), - ty: DeclarationId(2935), - }, - Field { - label: "WindowsLatest".to_string(), - ty: DeclarationId(2936), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10531, 10640), - }); - declarations.push(Declaration { - id: DeclarationId(1811), - name: Some("Step".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "RunStep".to_string(), - ty: DeclarationId(2944), - }, - Field { - label: "UsesStep".to_string(), - ty: DeclarationId(2953), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10785, 11380), - }); - declarations.push(Declaration { - id: DeclarationId(1812), - name: Some("ShellType".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Bash".to_string(), - ty: DeclarationId(2954), - }, - Field { - label: "Sh".to_string(), - ty: DeclarationId(2955), - }, - Field { - label: "Pwsh".to_string(), - ty: DeclarationId(2956), - }, - Field { - label: "Python".to_string(), - ty: DeclarationId(2957), - }, - Field { - label: "Cmd".to_string(), - ty: DeclarationId(2958), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11382, 11430), - }); - declarations.push(Declaration { - id: DeclarationId(1813), - name: Some("ActionRef".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "owner".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "repo".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "ref".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11432, 11495), - }); - declarations.push(Declaration { - id: DeclarationId(1814), - name: Some("LogAnnotation".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "AnnotationError".to_string(), - ty: DeclarationId(2962), - }, - Field { - label: "AnnotationWarning".to_string(), - ty: DeclarationId(2966), - }, - Field { - label: "AnnotationNotice".to_string(), - ty: DeclarationId(2970), - }, - Field { - label: "AnnotationGroup".to_string(), - ty: DeclarationId(2971), - }, - Field { - label: "AnnotationEndGroup".to_string(), - ty: DeclarationId(2972), - }, - Field { - label: "SetOutput".to_string(), - ty: DeclarationId(2973), - }, - Field { - label: "AddMask".to_string(), - ty: DeclarationId(2974), - }, - Field { - label: "StopCommands".to_string(), - ty: DeclarationId(2975), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11729, 12156), - }); - declarations.push(Declaration { - id: DeclarationId(1815), - name: Some("annotation_error_prefix".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(227)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Scalar(LiteralBits::String( - "::error ".to_string(), - ))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 12222, 12271), - }); - declarations.push(Declaration { - id: DeclarationId(1816), - name: Some("annotation_warning_prefix".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(227)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Scalar(LiteralBits::String( - "::warning ".to_string(), - ))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 12272, 12325), - }); - declarations.push(Declaration { - id: DeclarationId(1817), - name: Some("annotation_notice_prefix".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(227)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Scalar(LiteralBits::String( - "::notice ".to_string(), - ))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 12326, 12377), - }); - declarations.push(Declaration { - id: DeclarationId(1818), - name: Some("annotation_group_prefix".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(227)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Scalar(LiteralBits::String( - "::group::".to_string(), - ))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 12378, 12428), - }); - declarations.push(Declaration { - id: DeclarationId(1819), - name: Some("annotation_endgroup".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(227)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Scalar(LiteralBits::String( - "::endgroup::".to_string(), - ))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 12429, 12478), - }); - declarations.push(Declaration { - id: DeclarationId(1820), - name: Some("annotation_set_output_prefix".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(227)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Scalar(LiteralBits::String( - "::set-output name=".to_string(), - ))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 12479, 12543), - }); - declarations.push(Declaration { - id: DeclarationId(1821), - name: Some("annotation_add_mask_prefix".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(227)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Scalar(LiteralBits::String( - "::add-mask::".to_string(), - ))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 12544, 12600), - }); - declarations.push(Declaration { - id: DeclarationId(1822), - name: Some("annotation_stop_commands_prefix".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(227)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Scalar(LiteralBits::String( - "::stop-commands::".to_string(), - ))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 12601, 12667), - }); - declarations.push(Declaration { - id: DeclarationId(1823), - name: Some("ArtifactOp".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Upload".to_string(), - ty: DeclarationId(2977), - }, - Field { - label: "Download".to_string(), - ty: DeclarationId(2979), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 12889, 13054), - }); - declarations.push(Declaration { - id: DeclarationId(1824), - name: Some("MissingFilesBehavior".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Warn".to_string(), - ty: DeclarationId(2980), - }, - Field { - label: "ErrorOut".to_string(), - ty: DeclarationId(2981), - }, - Field { - label: "Ignore".to_string(), - ty: DeclarationId(2982), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13056, 13108), - }); - declarations.push(Declaration { - id: DeclarationId(1825), - name: Some("upload_artifact_action".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1813), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1813)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Unparsed(SourceSpan::new( - "dsl/extdeps/github/actions.dag", - 13200, - 13268, - ))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13159, 13268), - }); - declarations.push(Declaration { - id: DeclarationId(1826), - name: Some("download_artifact_action".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1813), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1813)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Unparsed(SourceSpan::new( - "dsl/extdeps/github/actions.dag", - 13313, - 13383, - ))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13270, 13383), - }); - declarations.push(Declaration { - id: DeclarationId(1827), - name: Some("MatrixStrategy".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "dimensions".to_string(), - ty: DeclarationId(2984), - }, - Field { - label: "include".to_string(), - ty: DeclarationId(2986), - }, - Field { - label: "exclude".to_string(), - ty: DeclarationId(2988), - }, - Field { - label: "fail_fast".to_string(), - ty: DeclarationId(124), - }, - Field { - label: "max_parallel".to_string(), - ty: DeclarationId(2989), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13522, 13698), - }); - declarations.push(Declaration { - id: DeclarationId(1828), - name: Some("CheckConclusion".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Success".to_string(), - ty: DeclarationId(2990), - }, - Field { - label: "Failure".to_string(), - ty: DeclarationId(2991), - }, - Field { - label: "Cancelled".to_string(), - ty: DeclarationId(2992), - }, - Field { - label: "Skipped".to_string(), - ty: DeclarationId(2993), - }, - Field { - label: "TimedOut".to_string(), - ty: DeclarationId(2994), - }, - Field { - label: "ActionRequired".to_string(), - ty: DeclarationId(2995), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13827, 13929), - }); - declarations.push(Declaration { - id: DeclarationId(1829), - name: Some("checkout_action".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1813), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1813)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Unparsed(SourceSpan::new( - "dsl/extdeps/github/actions.dag", - 14089, - 14150, - ))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 14055, 14150), - }); - declarations.push(Declaration { - id: DeclarationId(1830), - name: Some("setup_rust_action".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1813), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1813)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Unparsed(SourceSpan::new( - "dsl/extdeps/github/actions.dag", - 14188, - 14276, - ))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 14152, 14276), - }); - declarations.push(Declaration { - id: DeclarationId(1831), - name: Some("cache_action".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1813), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1813)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Unparsed(SourceSpan::new( - "dsl/extdeps/github/actions.dag", - 14309, - 14367, - ))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 14278, 14367), - }); - declarations.push(Declaration { - id: DeclarationId(1832), - name: Some("max_job_timeout_minutes".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(87), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(87)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Scalar(LiteralBits::Int("360".to_string()))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 14443, 14482), - }); - declarations.push(Declaration { - id: DeclarationId(1833), - name: Some("default_job_timeout_minutes".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(87), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(87)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Scalar(LiteralBits::Int("360".to_string()))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 14484, 14527), - }); - declarations.push(Declaration { - id: DeclarationId(1834), - name: Some("max_matrix_combinations".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(87), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(87)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Scalar(LiteralBits::Int("256".to_string()))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 14529, 14568), - }); - declarations.push(Declaration { - id: DeclarationId(1835), - name: Some("github_actions_workflows_dir".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(227)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Scalar(LiteralBits::String( - ".github/workflows".to_string(), - ))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/ci.dag", 1207, 1270), - }); - declarations.push(Declaration { - id: DeclarationId(1836), - name: Some("GitHubActionsWorkflowExtension".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "GitHubActionsWorkflowYml".to_string(), - ty: DeclarationId(2996), - }, - Field { - label: "GitHubActionsWorkflowYaml".to_string(), - ty: DeclarationId(2997), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/ci.dag", 1895, 1989), - }); - declarations.push(Declaration { - id: DeclarationId(1837), - name: Some("GitHubActionsWorkflowStemSegment".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(147))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(2998)), - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/ci.dag", 2615, 2714), - }); - declarations.push(Declaration { - id: DeclarationId(1838), - name: Some("GitHubActionsWorkflowStem".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "segment".to_string(), - ty: DeclarationId(1837), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/ci.dag", 2916, 2994), - }); - declarations.push(Declaration { - id: DeclarationId(1839), - name: Some("GitHubActionsWorkflowFileRef".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "stem".to_string(), - ty: DeclarationId(1838), - }, - Field { - label: "extension".to_string(), - ty: DeclarationId(1836), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/ci.dag", 3398, 3513), - }); - declarations.push(Declaration { - id: DeclarationId(1840), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(702), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 3259, 3272), - }); - declarations.push(Declaration { - id: DeclarationId(1841), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(704), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 3421, 3434), - }); - declarations.push(Declaration { - id: DeclarationId(1842), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(704), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 3439, 3452), - }); - declarations.push(Declaration { - id: DeclarationId(1843), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(706), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 3556, 3569), - }); - declarations.push(Declaration { - id: DeclarationId(1844), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(708), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 4162, 4169), - }); - declarations.push(Declaration { - id: DeclarationId(1845), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(709), DeclarationId(708)], - output: DeclarationId(709), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 4183, 4196), - }); - declarations.push(Declaration { - id: DeclarationId(1846), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(711), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 4617, 4624), - }); - declarations.push(Declaration { - id: DeclarationId(1847), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(711), DeclarationId(712)], - output: DeclarationId(712), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 4638, 4651), - }); - declarations.push(Declaration { - id: DeclarationId(1848), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(714), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 5336, 5349), - }); - declarations.push(Declaration { - id: DeclarationId(1849), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(714), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 5354, 5367), - }); - declarations.push(Declaration { - id: DeclarationId(1850), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(714), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 5372, 5385), - }); - declarations.push(Declaration { - id: DeclarationId(1851), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(716), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 5686, 5693), - }); - declarations.push(Declaration { - id: DeclarationId(1852), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(716)], - output: DeclarationId(717), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 5698, 5708), - }); - declarations.push(Declaration { - id: DeclarationId(1853), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(717), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 5713, 5720), - }); - declarations.push(Declaration { - id: DeclarationId(1854), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(719), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 5867, 5874), - }); - declarations.push(Declaration { - id: DeclarationId(1855), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(719)], - output: DeclarationId(124), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 5879, 5892), - }); - declarations.push(Declaration { - id: DeclarationId(1856), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(719), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 5897, 5904), - }); - declarations.push(Declaration { - id: DeclarationId(1857), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(721), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 6130, 6137), - }); - declarations.push(Declaration { - id: DeclarationId(1858), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(722), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 6151, 6158), - }); - declarations.push(Declaration { - id: DeclarationId(1859), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(721)], - output: DeclarationId(1858), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 6142, 6158), - }); - declarations.push(Declaration { - id: DeclarationId(1860), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(722), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 6163, 6170), - }); - declarations.push(Declaration { - id: DeclarationId(1861), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(724), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 6356, 6363), - }); - declarations.push(Declaration { - id: DeclarationId(1862), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(726), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 6588, 6595), - }); - declarations.push(Declaration { - id: DeclarationId(1863), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(730), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 7202, 7209), - }); - declarations.push(Declaration { - id: DeclarationId(1864), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(727), - arguments: vec![TemplateArgument { - parameter: DeclarationId(728), - value: DeclarationId(730), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 7219, 7236), - }); - declarations.push(Declaration { - id: DeclarationId(1865), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1864), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 7214, 7237), - }); - declarations.push(Declaration { - id: DeclarationId(1866), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(732), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 7415, 7422), - }); - declarations.push(Declaration { - id: DeclarationId(1867), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(727), - arguments: vec![TemplateArgument { - parameter: DeclarationId(728), - value: DeclarationId(732), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 7444, 7461), - }); - declarations.push(Declaration { - id: DeclarationId(1868), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1867), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 7439, 7462), - }); - declarations.push(Declaration { - id: DeclarationId(1869), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(734), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 8177, 8184), - }); - declarations.push(Declaration { - id: DeclarationId(1870), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 2106, 2111), - }); - declarations.push(Declaration { - id: DeclarationId(1871), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(700), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 2144, 2157), - }); - declarations.push(Declaration { - id: DeclarationId(1872), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "head".to_string(), - ty: DeclarationId(700), - }, - Field { - label: "tail".to_string(), - ty: DeclarationId(1871), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 2116, 2159), - }); - declarations.push(Declaration { - id: DeclarationId(1873), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(740), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate_minimal.dag", 1477, 1490), - }); - declarations.push(Declaration { - id: DeclarationId(1874), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(742), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate_minimal.dag", 1570, 1583), - }); - declarations.push(Declaration { - id: DeclarationId(1875), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 11898, 11905), - }); - declarations.push(Declaration { - id: DeclarationId(1876), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 24553, 24560), - }); - declarations.push(Declaration { - id: DeclarationId(1877), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(824), - arguments: vec![TemplateArgument { - parameter: DeclarationId(825), - value: DeclarationId(966), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 24784, 24805), - }); - declarations.push(Declaration { - id: DeclarationId(1878), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(727), - arguments: vec![TemplateArgument { - parameter: DeclarationId(728), - value: DeclarationId(966), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 24857, 24882), - }); - declarations.push(Declaration { - id: DeclarationId(1879), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(824), - arguments: vec![TemplateArgument { - parameter: DeclarationId(825), - value: DeclarationId(966), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 24887, 24908), - }); - declarations.push(Declaration { - id: DeclarationId(1880), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(1879), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 24887, 24909), - }); - declarations.push(Declaration { - id: DeclarationId(1881), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(966), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 25035, 25050), - }); - declarations.push(Declaration { - id: DeclarationId(1882), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(824), - arguments: vec![TemplateArgument { - parameter: DeclarationId(825), - value: DeclarationId(966), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 25055, 25076), - }); - declarations.push(Declaration { - id: DeclarationId(1883), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(1882), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 25055, 25077), - }); - declarations.push(Declaration { - id: DeclarationId(1884), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(966), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 26100, 26115), - }); - declarations.push(Declaration { - id: DeclarationId(1885), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(966), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 32908, 32923), - }); - declarations.push(Declaration { - id: DeclarationId(1886), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(786), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 32929, 32960), - }); - declarations.push(Declaration { - id: DeclarationId(1887), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "text".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 7677, 7706), - }); - declarations.push(Declaration { - id: DeclarationId(1888), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "name".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 7711, 7740), - }); - declarations.push(Declaration { - id: DeclarationId(1889), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(743), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 7772, 7790), - }); - declarations.push(Declaration { - id: DeclarationId(1890), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(743), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 8211, 8229), - }); - declarations.push(Declaration { - id: DeclarationId(1891), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "tokens".to_string(), - ty: DeclarationId(1890), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 8181, 8231), - }); - declarations.push(Declaration { - id: DeclarationId(1892), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "segment".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "reason".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 8236, 8292), - }); - declarations.push(Declaration { - id: DeclarationId(1893), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "template".to_string(), - ty: DeclarationId(744), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 8655, 8700), - }); - declarations.push(Declaration { - id: DeclarationId(1894), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "raw".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "segment".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "reason".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 8705, 8775), - }); - declarations.push(Declaration { - id: DeclarationId(1895), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 14498, 14508), - }); - declarations.push(Declaration { - id: DeclarationId(1896), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "key_source".to_string(), - ty: DeclarationId(756), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 14513, 14551), - }); - declarations.push(Declaration { - id: DeclarationId(1897), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "key_source".to_string(), - ty: DeclarationId(756), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 14556, 14594), - }); - declarations.push(Declaration { - id: DeclarationId(1898), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "cause".to_string(), - ty: DeclarationId(753), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 14840, 14875), - }); - declarations.push(Declaration { - id: DeclarationId(1899), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 14880, 14892), - }); - declarations.push(Declaration { - id: DeclarationId(1900), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(750), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 15314, 15343), - }); - declarations.push(Declaration { - id: DeclarationId(1901), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(751), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 15348, 15373), - }); - declarations.push(Declaration { - id: DeclarationId(1902), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 15886, 15896), - }); - declarations.push(Declaration { - id: DeclarationId(1903), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "method".to_string(), - ty: DeclarationId(195), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 15901, 15939), - }); - declarations.push(Declaration { - id: DeclarationId(1904), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 15978, 16010), - }); - declarations.push(Declaration { - id: DeclarationId(1905), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "shape".to_string(), - ty: DeclarationId(752), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 16048, 16087), - }); - declarations.push(Declaration { - id: DeclarationId(1906), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "failure".to_string(), - ty: DeclarationId(754), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 16092, 16159), - }); - declarations.push(Declaration { - id: DeclarationId(1907), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "param".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 16809, 16836), - }); - declarations.push(Declaration { - id: DeclarationId(1908), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "field".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 16841, 16869), - }); - declarations.push(Declaration { - id: DeclarationId(1909), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 17546, 17559), - }); - declarations.push(Declaration { - id: DeclarationId(1910), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 17564, 17578), - }); - declarations.push(Declaration { - id: DeclarationId(1911), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "reason".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 17583, 17615), - }); - declarations.push(Declaration { - id: DeclarationId(1912), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 20027, 20048), - }); - declarations.push(Declaration { - id: DeclarationId(1913), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(824), - arguments: vec![TemplateArgument { - parameter: DeclarationId(825), - value: DeclarationId(966), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 20079, 20100), - }); - declarations.push(Declaration { - id: DeclarationId(1914), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "first_breaker".to_string(), - ty: DeclarationId(1913), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 20053, 20102), - }); - declarations.push(Declaration { - id: DeclarationId(1915), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(966), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 28369, 28384), - }); - declarations.push(Declaration { - id: DeclarationId(1916), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "ops".to_string(), - ty: DeclarationId(1915), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 28349, 28386), - }); - declarations.push(Declaration { - id: DeclarationId(1917), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(741), - arguments: vec![TemplateArgument { - parameter: DeclarationId(742), - value: DeclarationId(776), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 28412, 28439), - }); - declarations.push(Declaration { - id: DeclarationId(1918), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "arms".to_string(), - ty: DeclarationId(1917), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 28391, 28441), - }); - declarations.push(Declaration { - id: DeclarationId(1919), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "body".to_string(), - ty: DeclarationId(777), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 28446, 28481), - }); - declarations.push(Declaration { - id: DeclarationId(1920), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(741), - arguments: vec![TemplateArgument { - parameter: DeclarationId(742), - value: DeclarationId(777), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 28513, 28545), - }); - declarations.push(Declaration { - id: DeclarationId(1921), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "branches".to_string(), - ty: DeclarationId(1920), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 28486, 28547), - }); - declarations.push(Declaration { - id: DeclarationId(1922), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(760), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 29184, 29230), - }); - declarations.push(Declaration { - id: DeclarationId(1923), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(778), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 29235, 29287), - }); - declarations.push(Declaration { - id: DeclarationId(1924), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 29784, 29804), - }); - declarations.push(Declaration { - id: DeclarationId(1925), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 29809, 29830), - }); - declarations.push(Declaration { - id: DeclarationId(1926), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 29835, 29858), - }); - declarations.push(Declaration { - id: DeclarationId(1927), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "left".to_string(), - ty: DeclarationId(966), - }, - Field { - label: "right".to_string(), - ty: DeclarationId(966), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 29863, 29919), - }); - declarations.push(Declaration { - id: DeclarationId(1928), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 29924, 29955), - }); - declarations.push(Declaration { - id: DeclarationId(1929), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 29960, 29978), - }); - declarations.push(Declaration { - id: DeclarationId(1930), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(760), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 30295, 30341), - }); - declarations.push(Declaration { - id: DeclarationId(1931), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(782), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 30346, 30398), - }); - declarations.push(Declaration { - id: DeclarationId(1932), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(792), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 22398, 22406), - }); - declarations.push(Declaration { - id: DeclarationId(1933), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(838), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 22455, 22464), - }); - declarations.push(Declaration { - id: DeclarationId(1934), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(838), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 22530, 22539), - }); - declarations.push(Declaration { - id: DeclarationId(1935), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(810), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 22916, 22928), - }); - declarations.push(Declaration { - id: DeclarationId(1936), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(810), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 23791, 23803), - }); - declarations.push(Declaration { - id: DeclarationId(1937), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(777), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 24114, 24129), - }); - declarations.push(Declaration { - id: DeclarationId(1938), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(908), - arguments: vec![TemplateArgument { - parameter: DeclarationId(909), - value: DeclarationId(737), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 28113, 28134), - }); - declarations.push(Declaration { - id: DeclarationId(1939), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(908), - arguments: vec![TemplateArgument { - parameter: DeclarationId(909), - value: DeclarationId(737), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 28198, 28219), - }); - declarations.push(Declaration { - id: DeclarationId(1940), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 754, 764), - }); - declarations.push(Declaration { - id: DeclarationId(1941), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(789), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 769, 788), - }); - declarations.push(Declaration { - id: DeclarationId(1942), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 793, 803), - }); - declarations.push(Declaration { - id: DeclarationId(1943), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(735), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 867, 874), - }); - declarations.push(Declaration { - id: DeclarationId(1944), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 1379, 1393), - }); - declarations.push(Declaration { - id: DeclarationId(1945), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(124), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 1398, 1411), - }); - declarations.push(Declaration { - id: DeclarationId(1946), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 1416, 1433), - }); - declarations.push(Declaration { - id: DeclarationId(1947), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 1526, 1543), - }); - declarations.push(Declaration { - id: DeclarationId(1948), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(793), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 3676, 3696), - }); - declarations.push(Declaration { - id: DeclarationId(1949), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 3701, 3729), - }); - declarations.push(Declaration { - id: DeclarationId(1950), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(737), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 3734, 3768), - }); - declarations.push(Declaration { - id: DeclarationId(1951), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(737), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 3773, 3802), - }); - declarations.push(Declaration { - id: DeclarationId(1952), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 3807, 3824), - }); - declarations.push(Declaration { - id: DeclarationId(1953), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 4448, 4455), - }); - declarations.push(Declaration { - id: DeclarationId(1954), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "previous".to_string(), - ty: DeclarationId(795), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 4460, 4510), - }); - declarations.push(Declaration { - id: DeclarationId(1955), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "units".to_string(), - ty: DeclarationId(76), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 6074, 6098), - }); - declarations.push(Declaration { - id: DeclarationId(1956), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 6123, 6132), - }); - declarations.push(Declaration { - id: DeclarationId(1957), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(795), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 6137, 6173), - }); - declarations.push(Declaration { - id: DeclarationId(1958), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "lower".to_string(), - ty: DeclarationId(798), - }, - Field { - label: "width".to_string(), - ty: DeclarationId(796), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 6485, 6535), - }); - declarations.push(Declaration { - id: DeclarationId(1959), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 6540, 6549), - }); - declarations.push(Declaration { - id: DeclarationId(1960), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(797), - arguments: vec![TemplateArgument { - parameter: DeclarationId(798), - value: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 7125, 7138), - }); - declarations.push(Declaration { - id: DeclarationId(1961), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1960), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 7113, 7139), - }); - declarations.push(Declaration { - id: DeclarationId(1962), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 7144, 7161), - }); - declarations.push(Declaration { - id: DeclarationId(1963), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 7412, 7422), - }); - declarations.push(Declaration { - id: DeclarationId(1964), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 7427, 7436), - }); - declarations.push(Declaration { - id: DeclarationId(1965), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 7441, 7450), - }); - declarations.push(Declaration { - id: DeclarationId(1966), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(793), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 7877, 7897), - }); - declarations.push(Declaration { - id: DeclarationId(1967), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(737), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 7902, 7926), - }); - declarations.push(Declaration { - id: DeclarationId(1968), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(804), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 7938, 7954), - }); - declarations.push(Declaration { - id: DeclarationId(1969), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1968), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 7931, 7955), - }); - declarations.push(Declaration { - id: DeclarationId(1970), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(805), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 7965, 7981), - }); - declarations.push(Declaration { - id: DeclarationId(1971), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1970), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 7960, 7982), - }); - declarations.push(Declaration { - id: DeclarationId(1972), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(804), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 7991, 8007), - }); - declarations.push(Declaration { - id: DeclarationId(1973), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1972), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 7987, 8008), - }); - declarations.push(Declaration { - id: DeclarationId(1974), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(805), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 8071, 8087), - }); - declarations.push(Declaration { - id: DeclarationId(1975), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "constructor".to_string(), - ty: DeclarationId(737), - }, - Field { - label: "payload".to_string(), - ty: DeclarationId(1974), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 8013, 8093), - }); - declarations.push(Declaration { - id: DeclarationId(1976), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(155), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 9706, 9735), - }); - declarations.push(Declaration { - id: DeclarationId(1977), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(804), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 9770, 9786), - }); - declarations.push(Declaration { - id: DeclarationId(1978), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "fields".to_string(), - ty: DeclarationId(1977), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 9740, 9788), - }); - declarations.push(Declaration { - id: DeclarationId(1979), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(793), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 9793, 9821), - }); - declarations.push(Declaration { - id: DeclarationId(1980), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(805), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 9840, 9856), - }); - declarations.push(Declaration { - id: DeclarationId(1981), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1980), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 9826, 9857), - }); - declarations.push(Declaration { - id: DeclarationId(1982), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(804), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 9875, 9891), - }); - declarations.push(Declaration { - id: DeclarationId(1983), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1982), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 9862, 9892), - }); - declarations.push(Declaration { - id: DeclarationId(1984), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(807), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 11146, 11169), - }); - declarations.push(Declaration { - id: DeclarationId(1985), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(737), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 11174, 11208), - }); - declarations.push(Declaration { - id: DeclarationId(1986), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 11213, 11220), - }); - declarations.push(Declaration { - id: DeclarationId(1987), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 11225, 11231), - }); - declarations.push(Declaration { - id: DeclarationId(1988), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(155), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 11236, 11256), - }); - declarations.push(Declaration { - id: DeclarationId(1989), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(794), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 11485, 11502), - }); - declarations.push(Declaration { - id: DeclarationId(1990), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(802), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 11524, 11539), - }); - declarations.push(Declaration { - id: DeclarationId(1991), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "children".to_string(), - ty: DeclarationId(1990), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 11507, 11541), - }); - declarations.push(Declaration { - id: DeclarationId(1992), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(802), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 11563, 11578), - }); - declarations.push(Declaration { - id: DeclarationId(1993), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "variants".to_string(), - ty: DeclarationId(1992), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 11546, 11580), - }); - declarations.push(Declaration { - id: DeclarationId(1994), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(737), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 11607, 11626), - }); - declarations.push(Declaration { - id: DeclarationId(1995), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "inputs".to_string(), - ty: DeclarationId(1994), - }, - Field { - label: "output".to_string(), - ty: DeclarationId(737), - }, - Field { - label: "body".to_string(), - ty: DeclarationId(808), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 11585, 11682), - }); - declarations.push(Declaration { - id: DeclarationId(1996), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "element".to_string(), - ty: DeclarationId(737), - }, - Field { - label: "bound".to_string(), - ty: DeclarationId(801), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 11687, 11765), - }); - declarations.push(Declaration { - id: DeclarationId(1997), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(803), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 11833, 11855), - }); - declarations.push(Declaration { - id: DeclarationId(1998), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "template".to_string(), - ty: DeclarationId(737), - }, - Field { - label: "arguments".to_string(), - ty: DeclarationId(1997), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 11770, 11861), - }); - declarations.push(Declaration { - id: DeclarationId(1999), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 11910, 11917), - }); - declarations.push(Declaration { - id: DeclarationId(2000), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(737), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 11962, 11981), - }); - declarations.push(Declaration { - id: DeclarationId(2001), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(811), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 12000, 12022), - }); - declarations.push(Declaration { - id: DeclarationId(2002), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(737), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 12035, 12049), - }); - declarations.push(Declaration { - id: DeclarationId(2003), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(737), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 12062, 12076), - }); - declarations.push(Declaration { - id: DeclarationId(2004), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(806), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 12091, 12101), - }); - declarations.push(Declaration { - id: DeclarationId(2005), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(812), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 12121, 12136), - }); - declarations.push(Declaration { - id: DeclarationId(2006), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(737), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 13259, 13278), - }); - declarations.push(Declaration { - id: DeclarationId(2007), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 13559, 13562), - }); - declarations.push(Declaration { - id: DeclarationId(2008), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 13567, 13570), - }); - declarations.push(Declaration { - id: DeclarationId(2009), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 13575, 13578), - }); - declarations.push(Declaration { - id: DeclarationId(2010), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 13583, 13586), - }); - declarations.push(Declaration { - id: DeclarationId(2011), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 13710, 13712), - }); - declarations.push(Declaration { - id: DeclarationId(2012), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 13717, 13719), - }); - declarations.push(Declaration { - id: DeclarationId(2013), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 13724, 13726), - }); - declarations.push(Declaration { - id: DeclarationId(2014), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 13731, 13733), - }); - declarations.push(Declaration { - id: DeclarationId(2015), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 13738, 13740), - }); - declarations.push(Declaration { - id: DeclarationId(2016), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 13745, 13747), - }); - declarations.push(Declaration { - id: DeclarationId(2017), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 14524, 14527), - }); - declarations.push(Declaration { - id: DeclarationId(2018), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 14532, 14534), - }); - declarations.push(Declaration { - id: DeclarationId(2019), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(813), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 14770, 14794), - }); - declarations.push(Declaration { - id: DeclarationId(2020), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(814), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 14799, 14823), - }); - declarations.push(Declaration { - id: DeclarationId(2021), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(816), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 14828, 14846), - }); - declarations.push(Declaration { - id: DeclarationId(2022), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(737), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 15033, 15056), - }); - declarations.push(Declaration { - id: DeclarationId(2023), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "field_label".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 15061, 15117), - }); - declarations.push(Declaration { - id: DeclarationId(2024), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "field_label".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 15122, 15176), - }); - declarations.push(Declaration { - id: DeclarationId(2025), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(817), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 15181, 15203), - }); - declarations.push(Declaration { - id: DeclarationId(2026), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 15328, 15380), - }); - declarations.push(Declaration { - id: DeclarationId(2027), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(737), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 15385, 15415), - }); - declarations.push(Declaration { - id: DeclarationId(2028), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(820), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 15579, 15594), - }); - declarations.push(Declaration { - id: DeclarationId(2029), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(741), - arguments: vec![TemplateArgument { - parameter: DeclarationId(742), - value: DeclarationId(826), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 17570, 17601), - }); - declarations.push(Declaration { - id: DeclarationId(2030), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(739), - arguments: vec![TemplateArgument { - parameter: DeclarationId(740), - value: DeclarationId(827), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 17625, 17655), - }); - declarations.push(Declaration { - id: DeclarationId(2031), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "count".to_string(), - ty: DeclarationId(736), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 18278, 18307), - }); - declarations.push(Declaration { - id: DeclarationId(2032), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "cluster".to_string(), - ty: DeclarationId(738), - }, - Field { - label: "measure".to_string(), - ty: DeclarationId(736), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 18312, 18359), - }); - declarations.push(Declaration { - id: DeclarationId(2033), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(777), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 18628, 18643), - }); - declarations.push(Declaration { - id: DeclarationId(2034), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(736), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 18717, 18729), - }); - declarations.push(Declaration { - id: DeclarationId(2035), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 18970, 18979), - }); - declarations.push(Declaration { - id: DeclarationId(2036), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(821), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19037, 19053), - }); - declarations.push(Declaration { - id: DeclarationId(2037), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(833), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19117, 19141), - }); - declarations.push(Declaration { - id: DeclarationId(2038), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19555, 19567), - }); - declarations.push(Declaration { - id: DeclarationId(2039), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(736), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19645, 19657), - }); - declarations.push(Declaration { - id: DeclarationId(2040), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(777), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19695, 19710), - }); - declarations.push(Declaration { - id: DeclarationId(2041), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(836), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19733, 19755), - }); - declarations.push(Declaration { - id: DeclarationId(2042), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(831), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19847, 19863), - }); - declarations.push(Declaration { - id: DeclarationId(2043), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(832), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19868, 19892), - }); - declarations.push(Declaration { - id: DeclarationId(2044), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(834), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19897, 19915), - }); - declarations.push(Declaration { - id: DeclarationId(2045), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(835), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19920, 19934), - }); - declarations.push(Declaration { - id: DeclarationId(2046), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(837), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19939, 19953), - }); - declarations.push(Declaration { - id: DeclarationId(2047), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(810), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19982, 19999), - }); - declarations.push(Declaration { - id: DeclarationId(2048), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(838), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 20009, 20023), - }); - declarations.push(Declaration { - id: DeclarationId(2049), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(792), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 20033, 20046), - }); - declarations.push(Declaration { - id: DeclarationId(2050), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(828), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 20059, 20072), - }); - declarations.push(Declaration { - id: DeclarationId(2051), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(736), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 26155, 26173), - }); - declarations.push(Declaration { - id: DeclarationId(2052), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 26178, 26184), - }); - declarations.push(Declaration { - id: DeclarationId(2053), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(741), - arguments: vec![TemplateArgument { - parameter: DeclarationId(742), - value: DeclarationId(736), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 26217, 26241), - }); - declarations.push(Declaration { - id: DeclarationId(2054), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "candidates".to_string(), - ty: DeclarationId(2053), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 26189, 26243), - }); - declarations.push(Declaration { - id: DeclarationId(2055), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(863), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 2718, 2749), - }); - declarations.push(Declaration { - id: DeclarationId(2056), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "content".to_string(), - ty: DeclarationId(2055), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 2690, 2751), - }); - declarations.push(Declaration { - id: DeclarationId(2057), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(864), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 2784, 2820), - }); - declarations.push(Declaration { - id: DeclarationId(2058), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "content".to_string(), - ty: DeclarationId(2057), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 2756, 2822), - }); - declarations.push(Declaration { - id: DeclarationId(2059), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "media_type".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "base64".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 2999, 3064), - }); - declarations.push(Declaration { - id: DeclarationId(2060), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "url".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 3069, 3093), - }); - declarations.push(Declaration { - id: DeclarationId(2061), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 3788, 3810), - }); - declarations.push(Declaration { - id: DeclarationId(2062), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(861), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 3832, 3862), - }); - declarations.push(Declaration { - id: DeclarationId(2063), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(2062), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 3815, 3863), - }); - declarations.push(Declaration { - id: DeclarationId(2064), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 5072, 5079), - }); - declarations.push(Declaration { - id: DeclarationId(2065), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 5205, 5217), - }); - declarations.push(Declaration { - id: DeclarationId(2066), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "text".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 5435, 5470), - }); - declarations.push(Declaration { - id: DeclarationId(2067), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "source".to_string(), - ty: DeclarationId(854), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 5475, 5518), - }); - declarations.push(Declaration { - id: DeclarationId(2068), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "source".to_string(), - ty: DeclarationId(862), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 5523, 5600), - }); - declarations.push(Declaration { - id: DeclarationId(2069), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(860), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 5690, 5724), - }); - declarations.push(Declaration { - id: DeclarationId(2070), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(856), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 5742, 5779), - }); - declarations.push(Declaration { - id: DeclarationId(2071), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(855), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 5801, 5814), - }); - declarations.push(Declaration { - id: DeclarationId(2072), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "source".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "title".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "content".to_string(), - ty: DeclarationId(2069), - }, - Field { - label: "citations".to_string(), - ty: DeclarationId(2070), - }, - Field { - label: "cache_control".to_string(), - ty: DeclarationId(2071), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 5605, 5820), - }); - declarations.push(Declaration { - id: DeclarationId(2073), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "tool_name".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 5825, 5874), - }); - declarations.push(Declaration { - id: DeclarationId(2074), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "text".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 6382, 6418), - }); - declarations.push(Declaration { - id: DeclarationId(2075), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(857), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 6486, 6513), - }); - declarations.push(Declaration { - id: DeclarationId(2076), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(124), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 6530, 6535), - }); - declarations.push(Declaration { - id: DeclarationId(2077), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "tool_use_id".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "content".to_string(), - ty: DeclarationId(2075), - }, - Field { - label: "is_error".to_string(), - ty: DeclarationId(2076), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 6423, 6541), - }); - declarations.push(Declaration { - id: DeclarationId(2078), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "text".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 6988, 7026), - }); - declarations.push(Declaration { - id: DeclarationId(2079), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "id".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "input".to_string(), - ty: DeclarationId(126), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 7031, 7114), - }); - declarations.push(Declaration { - id: DeclarationId(2080), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 7472, 7479), - }); - declarations.push(Declaration { - id: DeclarationId(2081), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 7484, 7493), - }); - declarations.push(Declaration { - id: DeclarationId(2082), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 7498, 7510), - }); - declarations.push(Declaration { - id: DeclarationId(2083), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 7515, 7522), - }); - declarations.push(Declaration { - id: DeclarationId(2084), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 7527, 7536), - }); - declarations.push(Declaration { - id: DeclarationId(2085), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 7541, 7548), - }); - declarations.push(Declaration { - id: DeclarationId(2086), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 7553, 7579), - }); - declarations.push(Declaration { - id: DeclarationId(2087), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 7891, 7898), - }); - declarations.push(Declaration { - id: DeclarationId(2088), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 7909, 7916), - }); - declarations.push(Declaration { - id: DeclarationId(2089), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "cited_text".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "document_index".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "document_title".to_string(), - ty: DeclarationId(2087), - }, - Field { - label: "file_id".to_string(), - ty: DeclarationId(2088), - }, - Field { - label: "start_char_index".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "end_char_index".to_string(), - ty: DeclarationId(87), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 7819, 7962), - }); - declarations.push(Declaration { - id: DeclarationId(2090), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8039, 8046), - }); - declarations.push(Declaration { - id: DeclarationId(2091), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8057, 8064), - }); - declarations.push(Declaration { - id: DeclarationId(2092), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "cited_text".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "document_index".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "document_title".to_string(), - ty: DeclarationId(2090), - }, - Field { - label: "file_id".to_string(), - ty: DeclarationId(2091), - }, - Field { - label: "start_page_number".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "end_page_number".to_string(), - ty: DeclarationId(87), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 7967, 8112), - }); - declarations.push(Declaration { - id: DeclarationId(2093), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8197, 8204), - }); - declarations.push(Declaration { - id: DeclarationId(2094), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8215, 8222), - }); - declarations.push(Declaration { - id: DeclarationId(2095), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "cited_text".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "document_index".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "document_title".to_string(), - ty: DeclarationId(2093), - }, - Field { - label: "file_id".to_string(), - ty: DeclarationId(2094), - }, - Field { - label: "start_block_index".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "end_block_index".to_string(), - ty: DeclarationId(87), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8117, 8270), - }); - declarations.push(Declaration { - id: DeclarationId(2096), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8353, 8360), - }); - declarations.push(Declaration { - id: DeclarationId(2097), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "cited_text".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "encrypted_index".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "title".to_string(), - ty: DeclarationId(2096), - }, - Field { - label: "url".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8275, 8375), - }); - declarations.push(Declaration { - id: DeclarationId(2098), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8446, 8453), - }); - declarations.push(Declaration { - id: DeclarationId(2099), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "cited_text".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "source".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "title".to_string(), - ty: DeclarationId(2098), - }, - Field { - label: "search_result_index".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "start_block_index".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "end_block_index".to_string(), - ty: DeclarationId(87), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8380, 8527), - }); - declarations.push(Declaration { - id: DeclarationId(2100), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(866), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9151, 9185), - }); - declarations.push(Declaration { - id: DeclarationId(2101), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(2100), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9151, 9186), - }); - declarations.push(Declaration { - id: DeclarationId(2102), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "text".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "citations".to_string(), - ty: DeclarationId(2101), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9106, 9188), - }); - declarations.push(Declaration { - id: DeclarationId(2103), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "thinking".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "signature".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9193, 9254), - }); - declarations.push(Declaration { - id: DeclarationId(2104), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "redacted_data".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9259, 9314), - }); - declarations.push(Declaration { - id: DeclarationId(2105), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(126), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9389, 9394), - }); - declarations.push(Declaration { - id: DeclarationId(2106), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "id".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "input".to_string(), - ty: DeclarationId(126), - }, - Field { - label: "caller".to_string(), - ty: DeclarationId(2105), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9319, 9396), - }); - declarations.push(Declaration { - id: DeclarationId(2107), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(126), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9494, 9499), - }); - declarations.push(Declaration { - id: DeclarationId(2108), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "id".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "name".to_string(), - ty: DeclarationId(868), - }, - Field { - label: "input".to_string(), - ty: DeclarationId(126), - }, - Field { - label: "caller".to_string(), - ty: DeclarationId(2107), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9401, 9501), - }); - declarations.push(Declaration { - id: DeclarationId(2109), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(126), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9585, 9590), - }); - declarations.push(Declaration { - id: DeclarationId(2110), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "tool_use_id".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "content".to_string(), - ty: DeclarationId(126), - }, - Field { - label: "caller".to_string(), - ty: DeclarationId(2109), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9506, 9592), - }); - declarations.push(Declaration { - id: DeclarationId(2111), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9813, 9822), - }); - declarations.push(Declaration { - id: DeclarationId(2112), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9827, 9835), - }); - declarations.push(Declaration { - id: DeclarationId(2113), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9840, 9853), - }); - declarations.push(Declaration { - id: DeclarationId(2114), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9858, 9875), - }); - declarations.push(Declaration { - id: DeclarationId(2115), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9880, 9903), - }); - declarations.push(Declaration { - id: DeclarationId(2116), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9908, 9927), - }); - declarations.push(Declaration { - id: DeclarationId(2117), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9932, 9950), - }); - declarations.push(Declaration { - id: DeclarationId(2118), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9955, 9962), - }); - declarations.push(Declaration { - id: DeclarationId(2119), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 10242, 10250), - }); - declarations.push(Declaration { - id: DeclarationId(2120), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 10255, 10263), - }); - declarations.push(Declaration { - id: DeclarationId(2121), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 10268, 10273), - }); - declarations.push(Declaration { - id: DeclarationId(2122), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(87), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 10523, 10527), - }); - declarations.push(Declaration { - id: DeclarationId(2123), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(87), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 10559, 10563), - }); - declarations.push(Declaration { - id: DeclarationId(2124), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(869), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 10595, 10627), - }); - declarations.push(Declaration { - id: DeclarationId(2125), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 10984, 10993), - }); - declarations.push(Declaration { - id: DeclarationId(2126), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(867), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 11479, 11517), - }); - declarations.push(Declaration { - id: DeclarationId(2127), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 11596, 11603), - }); - declarations.push(Declaration { - id: DeclarationId(2128), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(126), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 11664, 11669), - }); - declarations.push(Declaration { - id: DeclarationId(2129), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(853), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_messages.dag", 4503, 4529), - }); - declarations.push(Declaration { - id: DeclarationId(2130), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(109), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_messages.dag", 4566, 4572), - }); - declarations.push(Declaration { - id: DeclarationId(2131), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_messages.dag", 4589, 4596), - }); - declarations.push(Declaration { - id: DeclarationId(2132), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/bootstrap_authority.dag", 1013, 1025), - }); - declarations.push(Declaration { - id: DeclarationId(2133), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/bootstrap_authority.dag", 1030, 1044), - }); - declarations.push(Declaration { - id: DeclarationId(2134), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/bootstrap_authority.dag", 1049, 1064), - }); - declarations.push(Declaration { - id: DeclarationId(2135), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/bootstrap_authority.dag", 1069, 1086), - }); - declarations.push(Declaration { - id: DeclarationId(2136), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/bootstrap_authority.dag", 1091, 1114), - }); - declarations.push(Declaration { - id: DeclarationId(2137), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/bridge_ledger.dag", 5009, 5016), - }); - declarations.push(Declaration { - id: DeclarationId(2138), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/bridge_ledger.dag", 5021, 5025), - }); - declarations.push(Declaration { - id: DeclarationId(2139), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(880), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/bridge_ledger.dag", 7273, 7294), - }); - declarations.push(Declaration { - id: DeclarationId(2140), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 360, 369), - }); - declarations.push(Declaration { - id: DeclarationId(2141), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 374, 381), - }); - declarations.push(Declaration { - id: DeclarationId(2142), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 614, 618), - }); - declarations.push(Declaration { - id: DeclarationId(2143), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 623, 632), - }); - declarations.push(Declaration { - id: DeclarationId(2144), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 910, 921), - }); - declarations.push(Declaration { - id: DeclarationId(2145), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 926, 935), - }); - declarations.push(Declaration { - id: DeclarationId(2146), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 1166, 1173), - }); - declarations.push(Declaration { - id: DeclarationId(2147), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 1178, 1187), - }); - declarations.push(Declaration { - id: DeclarationId(2148), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 2035, 2044), - }); - declarations.push(Declaration { - id: DeclarationId(2149), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 2049, 2065), - }); - declarations.push(Declaration { - id: DeclarationId(2150), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 2070, 2080), - }); - declarations.push(Declaration { - id: DeclarationId(2151), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 2085, 2099), - }); - declarations.push(Declaration { - id: DeclarationId(2152), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 2385, 2399), - }); - declarations.push(Declaration { - id: DeclarationId(2153), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 2404, 2418), - }); - declarations.push(Declaration { - id: DeclarationId(2154), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 2818, 2830), - }); - declarations.push(Declaration { - id: DeclarationId(2155), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 3210, 3222), - }); - declarations.push(Declaration { - id: DeclarationId(2156), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 3694, 3708), - }); - declarations.push(Declaration { - id: DeclarationId(2157), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 3713, 3729), - }); - declarations.push(Declaration { - id: DeclarationId(2158), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "value".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/coproduct_projection.dag", 6759, 6786), - }); - declarations.push(Declaration { - id: DeclarationId(2159), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/coproduct_projection.dag", 7611, 7616), - }); - declarations.push(Declaration { - id: DeclarationId(2160), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/coproduct_projection.dag", 7621, 7630), - }); - declarations.push(Declaration { - id: DeclarationId(2161), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(895), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(898), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/coproduct_projection.dag", 9513, 9555), - }); - declarations.push(Declaration { - id: DeclarationId(2162), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1353), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/integer_diagnostic_order.dag", 1234, 1254), - }); - declarations.push(Declaration { - id: DeclarationId(2163), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1353), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/integer_diagnostic_order.dag", 1414, 1434), - }); - declarations.push(Declaration { - id: DeclarationId(2164), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(906), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(907), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lookup.dag", 1414, 1429), - }); - declarations.push(Declaration { - id: DeclarationId(2165), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(907), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lookup.dag", 1444, 1450), - }); - declarations.push(Declaration { - id: DeclarationId(2166), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(908), - arguments: vec![TemplateArgument { - parameter: DeclarationId(909), - value: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lookup.dag", 4985, 4996), - }); - declarations.push(Declaration { - id: DeclarationId(2167), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(908), - arguments: vec![TemplateArgument { - parameter: DeclarationId(909), - value: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lookup.dag", 5038, 5049), - }); - declarations.push(Declaration { - id: DeclarationId(2168), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lookup.dag", 4940, 4944), - }); - declarations.push(Declaration { - id: DeclarationId(2169), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(909), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lookup.dag", 4949, 4959), - }); - declarations.push(Declaration { - id: DeclarationId(2170), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(908), - arguments: vec![TemplateArgument { - parameter: DeclarationId(909), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 10942, 10962), - }); - declarations.push(Declaration { - id: DeclarationId(2171), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(908), - arguments: vec![TemplateArgument { - parameter: DeclarationId(909), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 11026, 11046), - }); - declarations.push(Declaration { - id: DeclarationId(2172), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(741), - arguments: vec![TemplateArgument { - parameter: DeclarationId(742), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 11114, 11144), - }); - declarations.push(Declaration { - id: DeclarationId(2173), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 11611, 11629), - }); - declarations.push(Declaration { - id: DeclarationId(2174), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(741), - arguments: vec![TemplateArgument { - parameter: DeclarationId(742), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 11635, 11665), - }); - declarations.push(Declaration { - id: DeclarationId(2175), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 14162, 14180), - }); - declarations.push(Declaration { - id: DeclarationId(2176), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(741), - arguments: vec![TemplateArgument { - parameter: DeclarationId(742), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 22217, 22247), - }); - declarations.push(Declaration { - id: DeclarationId(2177), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 22252, 22270), - }); - declarations.push(Declaration { - id: DeclarationId(2178), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 22530, 22548), - }); - declarations.push(Declaration { - id: DeclarationId(2179), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 22553, 22571), - }); - declarations.push(Declaration { - id: DeclarationId(2180), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 23044, 23062), - }); - declarations.push(Declaration { - id: DeclarationId(2181), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 23067, 23085), - }); - declarations.push(Declaration { - id: DeclarationId(2182), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 23186, 23204), - }); - declarations.push(Declaration { - id: DeclarationId(2183), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 23524, 23542), - }); - declarations.push(Declaration { - id: DeclarationId(2184), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 23547, 23565), - }); - declarations.push(Declaration { - id: DeclarationId(2185), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 25113, 25131), - }); - declarations.push(Declaration { - id: DeclarationId(2186), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 25384, 25402), - }); - declarations.push(Declaration { - id: DeclarationId(2187), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 25850, 25868), - }); - declarations.push(Declaration { - id: DeclarationId(2188), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 27885, 27903), - }); - declarations.push(Declaration { - id: DeclarationId(2189), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 27933, 27951), - }); - declarations.push(Declaration { - id: DeclarationId(2190), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 28238, 28256), - }); - declarations.push(Declaration { - id: DeclarationId(2191), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 28284, 28302), - }); - declarations.push(Declaration { - id: DeclarationId(2192), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 28662, 28680), - }); - declarations.push(Declaration { - id: DeclarationId(2193), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 28685, 28703), - }); - declarations.push(Declaration { - id: DeclarationId(2194), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 4953, 4965), - }); - declarations.push(Declaration { - id: DeclarationId(2195), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 4970, 4986), - }); - declarations.push(Declaration { - id: DeclarationId(2196), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 4991, 5005), - }); - declarations.push(Declaration { - id: DeclarationId(2197), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 5855, 5868), - }); - declarations.push(Declaration { - id: DeclarationId(2198), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 5873, 5888), - }); - declarations.push(Declaration { - id: DeclarationId(2199), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 5893, 5909), - }); - declarations.push(Declaration { - id: DeclarationId(2200), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 5914, 5927), - }); - declarations.push(Declaration { - id: DeclarationId(2201), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(912), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 6780, 6801), - }); - declarations.push(Declaration { - id: DeclarationId(2202), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(913), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 6816, 6826), - }); - declarations.push(Declaration { - id: DeclarationId(2203), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(87), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 6856, 6860), - }); - declarations.push(Declaration { - id: DeclarationId(2204), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 7429, 7436), - }); - declarations.push(Declaration { - id: DeclarationId(2205), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 8405, 8414), - }); - declarations.push(Declaration { - id: DeclarationId(2206), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "previous".to_string(), - ty: DeclarationId(918), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 8419, 8465), - }); - declarations.push(Declaration { - id: DeclarationId(2207), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 9506, 9523), - }); - declarations.push(Declaration { - id: DeclarationId(2208), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(915), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 9528, 9552), - }); - declarations.push(Declaration { - id: DeclarationId(2209), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "var".to_string(), - ty: DeclarationId(915), - }, - Field { - label: "degree".to_string(), - ty: DeclarationId(918), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 9557, 9619), - }); - declarations.push(Declaration { - id: DeclarationId(2210), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(741), - arguments: vec![TemplateArgument { - parameter: DeclarationId(742), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 9636, 9666), - }); - declarations.push(Declaration { - id: DeclarationId(2211), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(2210), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 9624, 9667), - }); - declarations.push(Declaration { - id: DeclarationId(2212), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(741), - arguments: vec![TemplateArgument { - parameter: DeclarationId(742), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 9680, 9710), - }); - declarations.push(Declaration { - id: DeclarationId(2213), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(2212), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 9672, 9711), - }); - declarations.push(Declaration { - id: DeclarationId(2214), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(915), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 9716, 9737), - }); - declarations.push(Declaration { - id: DeclarationId(2215), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 9742, 9761), - }); - declarations.push(Declaration { - id: DeclarationId(2216), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(31), - arguments: vec![TemplateArgument { - parameter: DeclarationId(32), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 9479, 9501), - }); - declarations.push(Declaration { - id: DeclarationId(2217), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 18143, 18156), - }); - declarations.push(Declaration { - id: DeclarationId(2218), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 18161, 18169), - }); - declarations.push(Declaration { - id: DeclarationId(2219), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 18174, 18185), - }); - declarations.push(Declaration { - id: DeclarationId(2220), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 18190, 18207), - }); - declarations.push(Declaration { - id: DeclarationId(2221), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 18212, 18226), - }); - declarations.push(Declaration { - id: DeclarationId(2222), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "degree".to_string(), - ty: DeclarationId(1165), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 18231, 18280), - }); - declarations.push(Declaration { - id: DeclarationId(2223), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 18285, 18301), - }); - declarations.push(Declaration { - id: DeclarationId(2224), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 18306, 18318), - }); - declarations.push(Declaration { - id: DeclarationId(2225), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(43), - arguments: vec![TemplateArgument { - parameter: DeclarationId(44), - value: DeclarationId(935), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 18107, 18138), - }); - declarations.push(Declaration { - id: DeclarationId(2226), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(705), - arguments: vec![TemplateArgument { - parameter: DeclarationId(706), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 11495, 11507), - }); - declarations.push(Declaration { - id: DeclarationId(2227), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(742)], - output: DeclarationId(124), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 5879, 5892), - }); - declarations.push(Declaration { - id: DeclarationId(2228), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(718), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(719), - value: DeclarationId(919), - }, - TemplateArgument { - parameter: DeclarationId(1855), - value: DeclarationId(926), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 11488, 11535), - }); - declarations.push(Declaration { - id: DeclarationId(2229), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(705), - arguments: vec![TemplateArgument { - parameter: DeclarationId(706), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 11795, 11810), - }); - declarations.push(Declaration { - id: DeclarationId(2230), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(919), DeclarationId(919)], - output: DeclarationId(919), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 4183, 4196), - }); - declarations.push(Declaration { - id: DeclarationId(2231), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(707), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(709), - value: DeclarationId(919), - }, - TemplateArgument { - parameter: DeclarationId(708), - value: DeclarationId(919), - }, - TemplateArgument { - parameter: DeclarationId(1845), - value: DeclarationId(930), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 14202, 14245), - }); - declarations.push(Declaration { - id: DeclarationId(2232), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(920), DeclarationId(708)], - output: DeclarationId(920), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 4183, 4196), - }); - declarations.push(Declaration { - id: DeclarationId(2233), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(707), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(709), - value: DeclarationId(920), - }, - TemplateArgument { - parameter: DeclarationId(1845), - value: DeclarationId(956), - }, - TemplateArgument { - parameter: DeclarationId(708), - value: DeclarationId(919), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 16911, 17021), - }); - declarations.push(Declaration { - id: DeclarationId(2234), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(920), DeclarationId(708)], - output: DeclarationId(920), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 4183, 4196), - }); - declarations.push(Declaration { - id: DeclarationId(2235), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(707), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(709), - value: DeclarationId(920), - }, - TemplateArgument { - parameter: DeclarationId(1845), - value: DeclarationId(956), - }, - TemplateArgument { - parameter: DeclarationId(708), - value: DeclarationId(919), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 17076, 17186), - }); - declarations.push(Declaration { - id: DeclarationId(2236), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(703), - arguments: vec![TemplateArgument { - parameter: DeclarationId(704), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 22293, 22323), - }); - declarations.push(Declaration { - id: DeclarationId(2237), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(703), - arguments: vec![TemplateArgument { - parameter: DeclarationId(704), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 22275, 22324), - }); - declarations.push(Declaration { - id: DeclarationId(2238), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(701), - arguments: vec![TemplateArgument { - parameter: DeclarationId(702), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 22603, 22610), - }); - declarations.push(Declaration { - id: DeclarationId(2239), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(703), - arguments: vec![TemplateArgument { - parameter: DeclarationId(704), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 22737, 22789), - }); - declarations.push(Declaration { - id: DeclarationId(2240), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(701), - arguments: vec![TemplateArgument { - parameter: DeclarationId(702), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 23140, 23147), - }); - declarations.push(Declaration { - id: DeclarationId(2241), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(703), - arguments: vec![TemplateArgument { - parameter: DeclarationId(704), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 23118, 23148), - }); - declarations.push(Declaration { - id: DeclarationId(2242), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(701), - arguments: vec![TemplateArgument { - parameter: DeclarationId(702), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 23597, 23604), - }); - declarations.push(Declaration { - id: DeclarationId(2243), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(703), - arguments: vec![TemplateArgument { - parameter: DeclarationId(704), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 23735, 23792), - }); - declarations.push(Declaration { - id: DeclarationId(2244), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(703), - arguments: vec![TemplateArgument { - parameter: DeclarationId(704), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 25317, 25349), - }); - declarations.push(Declaration { - id: DeclarationId(2245), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(701), - arguments: vec![TemplateArgument { - parameter: DeclarationId(702), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 27988, 27995), - }); - declarations.push(Declaration { - id: DeclarationId(2246), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(703), - arguments: vec![TemplateArgument { - parameter: DeclarationId(704), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 28136, 28201), - }); - declarations.push(Declaration { - id: DeclarationId(2247), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(920), DeclarationId(919)], - output: DeclarationId(920), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 4183, 4196), - }); - declarations.push(Declaration { - id: DeclarationId(2248), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(707), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(709), - value: DeclarationId(920), - }, - TemplateArgument { - parameter: DeclarationId(708), - value: DeclarationId(919), - }, - TemplateArgument { - parameter: DeclarationId(1845), - value: DeclarationId(956), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 28319, 28377), - }); - declarations.push(Declaration { - id: DeclarationId(2249), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(703), - arguments: vec![TemplateArgument { - parameter: DeclarationId(704), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 28403, 28449), - }); - declarations.push(Declaration { - id: DeclarationId(2250), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(701), - arguments: vec![TemplateArgument { - parameter: DeclarationId(702), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 28720, 28727), - }); - declarations.push(Declaration { - id: DeclarationId(2251), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(2193), DeclarationId(919)], - output: DeclarationId(2193), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 4183, 4196), - }); - declarations.push(Declaration { - id: DeclarationId(2252), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(707), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(709), - value: DeclarationId(2193), - }, - TemplateArgument { - parameter: DeclarationId(708), - value: DeclarationId(919), - }, - TemplateArgument { - parameter: DeclarationId(1845), - value: DeclarationId(959), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 28708, 28749), - }); - declarations.push(Declaration { - id: DeclarationId(2253), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(963), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/services.dag", 5738, 5761), - }); - declarations.push(Declaration { - id: DeclarationId(2254), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(966), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_operations.dag", 6546, 6561), - }); - declarations.push(Declaration { - id: DeclarationId(2255), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(970), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 2751, 2763), - }); - declarations.push(Declaration { - id: DeclarationId(2256), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(736), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 2961, 2968), - }); - declarations.push(Declaration { - id: DeclarationId(2257), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 5779, 5786), - }); - declarations.push(Declaration { - id: DeclarationId(2258), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(87), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 6710, 6714), - }); - declarations.push(Declaration { - id: DeclarationId(2259), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(981), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 7761, 7780), - }); - declarations.push(Declaration { - id: DeclarationId(2260), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(981), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 8326, 8345), - }); - declarations.push(Declaration { - id: DeclarationId(2261), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "param".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 1430, 1462), - }); - declarations.push(Declaration { - id: DeclarationId(2262), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "witness".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 1467, 1503), - }); - declarations.push(Declaration { - id: DeclarationId(2263), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "element".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 1508, 1545), - }); - declarations.push(Declaration { - id: DeclarationId(2264), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "param".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 1550, 1576), - }); - declarations.push(Declaration { - id: DeclarationId(2265), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "param".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 1581, 1614), - }); - declarations.push(Declaration { - id: DeclarationId(2266), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 1619, 1636), - }); - declarations.push(Declaration { - id: DeclarationId(2267), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "steps".to_string(), - ty: DeclarationId(1165), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 1641, 1695), - }); - declarations.push(Declaration { - id: DeclarationId(2268), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 1700, 1707), - }); - declarations.push(Declaration { - id: DeclarationId(2269), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "accessor".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 2059, 2097), - }); - declarations.push(Declaration { - id: DeclarationId(2270), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "amount".to_string(), - ty: DeclarationId(1165), - }, - Field { - label: "collection".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 2102, 2176), - }); - declarations.push(Declaration { - id: DeclarationId(2271), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "steps".to_string(), - ty: DeclarationId(1165), - }, - Field { - label: "ring_param".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 2181, 2256), - }); - declarations.push(Declaration { - id: DeclarationId(2272), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "divisor".to_string(), - ty: DeclarationId(1167), - }, - Field { - label: "ring_param".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 2261, 2334), - }); - declarations.push(Declaration { - id: DeclarationId(2273), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "witness".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 2339, 2376), - }); - declarations.push(Declaration { - id: DeclarationId(2274), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "element".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 2381, 2418), - }); - declarations.push(Declaration { - id: DeclarationId(2275), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "outer_collection".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 2423, 2464), - }); - declarations.push(Declaration { - id: DeclarationId(2276), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 2469, 2485), - }); - declarations.push(Declaration { - id: DeclarationId(2277), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 3221, 3231), - }); - declarations.push(Declaration { - id: DeclarationId(2278), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "steps".to_string(), - ty: DeclarationId(1165), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 3236, 3283), - }); - declarations.push(Declaration { - id: DeclarationId(2279), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "divisor".to_string(), - ty: DeclarationId(1167), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 3288, 3339), - }); - declarations.push(Declaration { - id: DeclarationId(2280), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 3529, 3533), - }); - declarations.push(Declaration { - id: DeclarationId(2281), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 3538, 3545), - }); - declarations.push(Declaration { - id: DeclarationId(2282), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 3550, 3556), - }); - declarations.push(Declaration { - id: DeclarationId(2283), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(973), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 3859, 3872), - }); - declarations.push(Declaration { - id: DeclarationId(2284), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 7493, 7504), - }); - declarations.push(Declaration { - id: DeclarationId(2285), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 7553, 7567), - }); - declarations.push(Declaration { - id: DeclarationId(2286), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 7632, 7648), - }); - declarations.push(Declaration { - id: DeclarationId(2287), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emission_provenance.dag", 3709, 3721), - }); - declarations.push(Declaration { - id: DeclarationId(2288), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "value".to_string(), - ty: DeclarationId(155), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emission_provenance.dag", 3726, 3762), - }); - declarations.push(Declaration { - id: DeclarationId(2289), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(990), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 855, 873), - }); - declarations.push(Declaration { - id: DeclarationId(2290), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 4373, 4389), - }); - declarations.push(Declaration { - id: DeclarationId(2291), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(799), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 4394, 4422), - }); - declarations.push(Declaration { - id: DeclarationId(2292), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 4665, 4686), - }); - declarations.push(Declaration { - id: DeclarationId(2293), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 5176, 5195), - }); - declarations.push(Declaration { - id: DeclarationId(2294), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 5200, 5222), - }); - declarations.push(Declaration { - id: DeclarationId(2295), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(995), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 5591, 5614), - }); - declarations.push(Declaration { - id: DeclarationId(2296), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 6611, 6619), - }); - declarations.push(Declaration { - id: DeclarationId(2297), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 6624, 6632), - }); - declarations.push(Declaration { - id: DeclarationId(2298), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 7073, 7078), - }); - declarations.push(Declaration { - id: DeclarationId(2299), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 7083, 7091), - }); - declarations.push(Declaration { - id: DeclarationId(2300), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 7427, 7440), - }); - declarations.push(Declaration { - id: DeclarationId(2301), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 7445, 7451), - }); - declarations.push(Declaration { - id: DeclarationId(2302), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 7709, 7717), - }); - declarations.push(Declaration { - id: DeclarationId(2303), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 7722, 7727), - }); - declarations.push(Declaration { - id: DeclarationId(2304), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 7732, 7745), - }); - declarations.push(Declaration { - id: DeclarationId(2305), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 8082, 8100), - }); - declarations.push(Declaration { - id: DeclarationId(2306), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 9475, 9484), - }); - declarations.push(Declaration { - id: DeclarationId(2307), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 9489, 9502), - }); - declarations.push(Declaration { - id: DeclarationId(2308), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 9507, 9515), - }); - declarations.push(Declaration { - id: DeclarationId(2309), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 9520, 9530), - }); - declarations.push(Declaration { - id: DeclarationId(2310), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 9535, 9545), - }); - declarations.push(Declaration { - id: DeclarationId(2311), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 9550, 9561), - }); - declarations.push(Declaration { - id: DeclarationId(2312), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 9566, 9574), - }); - declarations.push(Declaration { - id: DeclarationId(2313), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 9579, 9586), - }); - declarations.push(Declaration { - id: DeclarationId(2314), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 9591, 9601), - }); - declarations.push(Declaration { - id: DeclarationId(2315), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 9606, 9618), - }); - declarations.push(Declaration { - id: DeclarationId(2316), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 12311, 12337), - }); - declarations.push(Declaration { - id: DeclarationId(2317), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 12342, 12352), - }); - declarations.push(Declaration { - id: DeclarationId(2318), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 17117, 17123), - }); - declarations.push(Declaration { - id: DeclarationId(2319), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 17128, 17139), - }); - declarations.push(Declaration { - id: DeclarationId(2320), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 17459, 17470), - }); - declarations.push(Declaration { - id: DeclarationId(2321), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 17475, 17486), - }); - declarations.push(Declaration { - id: DeclarationId(2322), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 19419, 19430), - }); - declarations.push(Declaration { - id: DeclarationId(2323), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 19435, 19443), - }); - declarations.push(Declaration { - id: DeclarationId(2324), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "template".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 20606, 20641), - }); - declarations.push(Declaration { - id: DeclarationId(2325), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "inline_template".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "fn_ref_template".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 20646, 20734), - }); - declarations.push(Declaration { - id: DeclarationId(2326), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 2224, 2238), - }); - declarations.push(Declaration { - id: DeclarationId(2327), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 2243, 2268), - }); - declarations.push(Declaration { - id: DeclarationId(2328), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 2273, 2283), - }); - declarations.push(Declaration { - id: DeclarationId(2329), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 2548, 2565), - }); - declarations.push(Declaration { - id: DeclarationId(2330), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 2570, 2594), - }); - declarations.push(Declaration { - id: DeclarationId(2331), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 2599, 2631), - }); - declarations.push(Declaration { - id: DeclarationId(2332), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 2636, 2663), - }); - declarations.push(Declaration { - id: DeclarationId(2333), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 3369, 3393), - }); - declarations.push(Declaration { - id: DeclarationId(2334), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 3398, 3430), - }); - declarations.push(Declaration { - id: DeclarationId(2335), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 3564, 3588), - }); - declarations.push(Declaration { - id: DeclarationId(2336), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 3593, 3614), - }); - declarations.push(Declaration { - id: DeclarationId(2337), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 3619, 3637), - }); - declarations.push(Declaration { - id: DeclarationId(2338), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 3781, 3796), - }); - declarations.push(Declaration { - id: DeclarationId(2339), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 3801, 3831), - }); - declarations.push(Declaration { - id: DeclarationId(2340), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 3836, 3857), - }); - declarations.push(Declaration { - id: DeclarationId(2341), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 4024, 4044), - }); - declarations.push(Declaration { - id: DeclarationId(2342), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 4049, 4076), - }); - declarations.push(Declaration { - id: DeclarationId(2343), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 4081, 4095), - }); - declarations.push(Declaration { - id: DeclarationId(2344), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 4354, 4362), - }); - declarations.push(Declaration { - id: DeclarationId(2345), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 4367, 4393), - }); - declarations.push(Declaration { - id: DeclarationId(2346), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 4398, 4423), - }); - declarations.push(Declaration { - id: DeclarationId(2347), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 5320, 5332), - }); - declarations.push(Declaration { - id: DeclarationId(2348), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 5693, 5713), - }); - declarations.push(Declaration { - id: DeclarationId(2349), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 5718, 5736), - }); - declarations.push(Declaration { - id: DeclarationId(2350), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 5741, 5759), - }); - declarations.push(Declaration { - id: DeclarationId(2351), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 5764, 5791), - }); - declarations.push(Declaration { - id: DeclarationId(2352), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/cross_target_coverage.dag", 3853, 3857), - }); - declarations.push(Declaration { - id: DeclarationId(2353), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/cross_target_coverage.dag", 3860, 3864), - }); - declarations.push(Declaration { - id: DeclarationId(2354), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/cross_target_coverage.dag", 3867, 3871), - }); - declarations.push(Declaration { - id: DeclarationId(2355), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/cross_target_coverage.dag", 3874, 3879), - }); - declarations.push(Declaration { - id: DeclarationId(2356), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/cross_target_coverage.dag", 3882, 3893), - }); - declarations.push(Declaration { - id: DeclarationId(2357), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/cross_target_coverage.dag", 3896, 3909), - }); - declarations.push(Declaration { - id: DeclarationId(2358), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/cross_target_coverage.dag", 4489, 4494), - }); - declarations.push(Declaration { - id: DeclarationId(2359), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/cross_target_coverage.dag", 4497, 4506), - }); - declarations.push(Declaration { - id: DeclarationId(2360), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/cross_target_coverage.dag", 4509, 4515), - }); - declarations.push(Declaration { - id: DeclarationId(2361), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/cross_target_coverage.dag", 4518, 4522), - }); - declarations.push(Declaration { - id: DeclarationId(2362), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/cross_target_coverage.dag", 4525, 4529), - }); - declarations.push(Declaration { - id: DeclarationId(2363), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1045), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/cross_target_coverage.dag", 5923, 5941), - }); - declarations.push(Declaration { - id: DeclarationId(2364), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1046), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/cross_target_coverage.dag", 6396, 6424), - }); - declarations.push(Declaration { - id: DeclarationId(2365), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 1099, 1113), - }); - declarations.push(Declaration { - id: DeclarationId(2366), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 1118, 1128), - }); - declarations.push(Declaration { - id: DeclarationId(2367), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 1133, 1145), - }); - declarations.push(Declaration { - id: DeclarationId(2368), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 1150, 1163), - }); - declarations.push(Declaration { - id: DeclarationId(2369), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 1168, 1180), - }); - declarations.push(Declaration { - id: DeclarationId(2370), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 1185, 1197), - }); - declarations.push(Declaration { - id: DeclarationId(2371), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 1202, 1224), - }); - declarations.push(Declaration { - id: DeclarationId(2372), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 1229, 1248), - }); - declarations.push(Declaration { - id: DeclarationId(2373), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 1253, 1278), - }); - declarations.push(Declaration { - id: DeclarationId(2374), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 1283, 1306), - }); - declarations.push(Declaration { - id: DeclarationId(2375), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "witness".to_string(), - ty: DeclarationId(1049), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 2916, 2961), - }); - declarations.push(Declaration { - id: DeclarationId(2376), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "reason".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "retirement_plan".to_string(), - ty: DeclarationId(1050), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 2966, 3036), - }); - declarations.push(Declaration { - id: DeclarationId(2377), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1048), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 6777, 6813), - }); - declarations.push(Declaration { - id: DeclarationId(2378), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1053), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 6818, 6859), - }); - declarations.push(Declaration { - id: DeclarationId(2379), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "unspecified_axis".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 10445, 10486), - }); - declarations.push(Declaration { - id: DeclarationId(2380), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 10783, 10795), - }); - declarations.push(Declaration { - id: DeclarationId(2381), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 11065, 11077), - }); - declarations.push(Declaration { - id: DeclarationId(2382), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "binding".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "sites".to_string(), - ty: DeclarationId(2381), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 11022, 11079), - }); - declarations.push(Declaration { - id: DeclarationId(2383), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "construct".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 11389, 11423), - }); - declarations.push(Declaration { - id: DeclarationId(2384), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "detail".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 11826, 11877), - }); - declarations.push(Declaration { - id: DeclarationId(2385), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 12220, 12238), - }); - declarations.push(Declaration { - id: DeclarationId(2386), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "connective".to_string(), - ty: DeclarationId(1042), - }, - Field { - label: "behavior".to_string(), - ty: DeclarationId(1043), - }, - Field { - label: "target".to_string(), - ty: DeclarationId(1038), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 12627, 12739), - }); - declarations.push(Declaration { - id: DeclarationId(2387), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(37), - arguments: vec![TemplateArgument { - parameter: DeclarationId(38), - value: DeclarationId(1077), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 5755, 5775), - }); - declarations.push(Declaration { - id: DeclarationId(2388), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1065), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(1066), - value: DeclarationId(1076), - }, - TemplateArgument { - parameter: DeclarationId(1067), - value: DeclarationId(1077), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 5785, 5809), - }); - declarations.push(Declaration { - id: DeclarationId(2389), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1065), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(1066), - value: DeclarationId(1076), - }, - TemplateArgument { - parameter: DeclarationId(1067), - value: DeclarationId(1077), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 5820, 5844), - }); - declarations.push(Declaration { - id: DeclarationId(2390), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1065), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(1066), - value: DeclarationId(1076), - }, - TemplateArgument { - parameter: DeclarationId(1067), - value: DeclarationId(1077), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 5850, 5874), - }); - declarations.push(Declaration { - id: DeclarationId(2391), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(37), - arguments: vec![TemplateArgument { - parameter: DeclarationId(38), - value: DeclarationId(1080), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 5951, 5971), - }); - declarations.push(Declaration { - id: DeclarationId(2392), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1065), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(1066), - value: DeclarationId(1079), - }, - TemplateArgument { - parameter: DeclarationId(1067), - value: DeclarationId(1080), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 5981, 6005), - }); - declarations.push(Declaration { - id: DeclarationId(2393), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1065), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(1066), - value: DeclarationId(1079), - }, - TemplateArgument { - parameter: DeclarationId(1067), - value: DeclarationId(1080), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 6016, 6040), - }); - declarations.push(Declaration { - id: DeclarationId(2394), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1065), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(1066), - value: DeclarationId(1079), - }, - TemplateArgument { - parameter: DeclarationId(1067), - value: DeclarationId(1080), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 6046, 6070), - }); - declarations.push(Declaration { - id: DeclarationId(2395), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(37), - arguments: vec![TemplateArgument { - parameter: DeclarationId(38), - value: DeclarationId(1083), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 6154, 6174), - }); - declarations.push(Declaration { - id: DeclarationId(2396), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1065), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(1066), - value: DeclarationId(1082), - }, - TemplateArgument { - parameter: DeclarationId(1067), - value: DeclarationId(1083), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 6185, 6209), - }); - declarations.push(Declaration { - id: DeclarationId(2397), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1065), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(1066), - value: DeclarationId(1082), - }, - TemplateArgument { - parameter: DeclarationId(1067), - value: DeclarationId(1083), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 6234, 6258), - }); - declarations.push(Declaration { - id: DeclarationId(2398), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(37), - arguments: vec![TemplateArgument { - parameter: DeclarationId(38), - value: DeclarationId(1086), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 6349, 6369), - }); - declarations.push(Declaration { - id: DeclarationId(2399), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1065), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(1066), - value: DeclarationId(1085), - }, - TemplateArgument { - parameter: DeclarationId(1067), - value: DeclarationId(1086), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 6380, 6404), - }); - declarations.push(Declaration { - id: DeclarationId(2400), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1065), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(1066), - value: DeclarationId(1085), - }, - TemplateArgument { - parameter: DeclarationId(1067), - value: DeclarationId(1086), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 6429, 6453), - }); - declarations.push(Declaration { - id: DeclarationId(2401), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(838), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 2385, 2405), - }); - declarations.push(Declaration { - id: DeclarationId(2402), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "port".to_string(), - ty: DeclarationId(736), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 2410, 2452), - }); - declarations.push(Declaration { - id: DeclarationId(2403), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "producer".to_string(), - ty: DeclarationId(735), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 2457, 2503), - }); - declarations.push(Declaration { - id: DeclarationId(2404), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1059), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 2531, 2548), - }); - declarations.push(Declaration { - id: DeclarationId(2405), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "reason".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "subject".to_string(), - ty: DeclarationId(1057), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 2553, 2606), - }); - declarations.push(Declaration { - id: DeclarationId(2406), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 2788, 2800), - }); - declarations.push(Declaration { - id: DeclarationId(2407), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "value".to_string(), - ty: DeclarationId(1055), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 2805, 2841), - }); - declarations.push(Declaration { - id: DeclarationId(2408), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1058), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1062), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 3323, 3339), - }); - declarations.push(Declaration { - id: DeclarationId(2409), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(2408), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 3318, 3340), - }); - declarations.push(Declaration { - id: DeclarationId(2410), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "dimension_name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "composed".to_string(), - ty: DeclarationId(1062), - }, - Field { - label: "witnesses".to_string(), - ty: DeclarationId(2409), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 3234, 3346), - }); - declarations.push(Declaration { - id: DeclarationId(2411), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1055), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 3414, 3430), - }); - declarations.push(Declaration { - id: DeclarationId(2412), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1058), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1062), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 3453, 3469), - }); - declarations.push(Declaration { - id: DeclarationId(2413), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(2412), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 3448, 3470), - }); - declarations.push(Declaration { - id: DeclarationId(2414), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "dimension_name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "violations".to_string(), - ty: DeclarationId(2411), - }, - Field { - label: "witnesses".to_string(), - ty: DeclarationId(2413), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 3351, 3476), - }); - declarations.push(Declaration { - id: DeclarationId(2415), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1058), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1064), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 4811, 4827), - }); - declarations.push(Declaration { - id: DeclarationId(2416), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839), DeclarationId(838)], - output: DeclarationId(2415), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 4790, 4827), - }); - declarations.push(Declaration { - id: DeclarationId(2417), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(19), - arguments: vec![TemplateArgument { - parameter: DeclarationId(20), - value: DeclarationId(1064), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 4839, 4854), - }); - declarations.push(Declaration { - id: DeclarationId(2418), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(838), DeclarationId(1064)], - output: DeclarationId(1060), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 4875, 4918), - }); - declarations.push(Declaration { - id: DeclarationId(2419), - name: Some("DimensionUnitAbelianGroup".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(25), - arguments: vec![TemplateArgument { - parameter: DeclarationId(26), - value: DeclarationId(1066), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 5561, 5611), - }); - declarations.push(Declaration { - id: DeclarationId(2420), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1025), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/go_method_template_contracts.dag", 6894, 6922), - }); - declarations.push(Declaration { - id: DeclarationId(2421), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1058), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1098), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens.dag", 4180, 4190), - }); - declarations.push(Declaration { - id: DeclarationId(2422), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839), DeclarationId(838)], - output: DeclarationId(2421), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens.dag", 4159, 4190), - }); - declarations.push(Declaration { - id: DeclarationId(2423), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(19), - arguments: vec![TemplateArgument { - parameter: DeclarationId(20), - value: DeclarationId(1098), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens.dag", 4205, 4214), - }); - declarations.push(Declaration { - id: DeclarationId(2424), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1098), DeclarationId(1098)], - output: DeclarationId(1098), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens.dag", 4225, 4238), - }); - declarations.push(Declaration { - id: DeclarationId(2425), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1098), DeclarationId(829)], - output: DeclarationId(1098), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens.dag", 4250, 4271), - }); - declarations.push(Declaration { - id: DeclarationId(2426), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839), DeclarationId(1098)], - output: DeclarationId(1060), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens.dag", 4284, 4316), - }); - declarations.push(Declaration { - id: DeclarationId(2427), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "declaration".to_string(), - ty: DeclarationId(737), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens_application.dag", 3564, 3611), - }); - declarations.push(Declaration { - id: DeclarationId(2428), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "declaration".to_string(), - ty: DeclarationId(737), - }, - Field { - label: "node".to_string(), - ty: DeclarationId(735), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens_application.dag", 3616, 3677), - }); - declarations.push(Declaration { - id: DeclarationId(2429), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens_application.dag", 4556, 4561), - }); - declarations.push(Declaration { - id: DeclarationId(2430), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1102)], - output: DeclarationId(1104), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens_application.dag", 5798, 5821), - }); - declarations.push(Declaration { - id: DeclarationId(2431), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1102), DeclarationId(1103)], - output: DeclarationId(124), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens_application.dag", 5834, 5860), - }); - declarations.push(Declaration { - id: DeclarationId(2432), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1097), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1098), - value: DeclarationId(1106), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens_application.dag", 7871, 7883), - }); - declarations.push(Declaration { - id: DeclarationId(2433), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1101), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(1102), - value: DeclarationId(1106), - }, - TemplateArgument { - parameter: DeclarationId(1103), - value: DeclarationId(1107), - }, - TemplateArgument { - parameter: DeclarationId(1104), - value: DeclarationId(1108), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens_application.dag", 7899, 7941), - }); - declarations.push(Declaration { - id: DeclarationId(2434), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1105), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(1106), - value: DeclarationId(1110), - }, - TemplateArgument { - parameter: DeclarationId(1107), - value: DeclarationId(1111), - }, - TemplateArgument { - parameter: DeclarationId(1108), - value: DeclarationId(1112), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens_application.dag", 9711, 9753), - }); - declarations.push(Declaration { - id: DeclarationId(2435), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1097), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1098), - value: DeclarationId(1114), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens_application.dag", 10773, 10785), - }); - declarations.push(Declaration { - id: DeclarationId(2436), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1130), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 1179, 1196), - }); - declarations.push(Declaration { - id: DeclarationId(2437), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(1129), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 1267, 1279), - }); - declarations.push(Declaration { - id: DeclarationId(2438), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1122), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 1747, 1764), - }); - declarations.push(Declaration { - id: DeclarationId(2439), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(2438), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 1736, 1765), - }); - declarations.push(Declaration { - id: DeclarationId(2440), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1118), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 1777, 1795), - }); - declarations.push(Declaration { - id: DeclarationId(2441), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(2440), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 1770, 1796), - }); - declarations.push(Declaration { - id: DeclarationId(2442), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "ty".to_string(), - ty: DeclarationId(1122), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 2089, 2117), - }); - declarations.push(Declaration { - id: DeclarationId(2443), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "decimal".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 2122, 2175), - }); - declarations.push(Declaration { - id: DeclarationId(2444), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 2452, 2492), - }); - declarations.push(Declaration { - id: DeclarationId(2445), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1121), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 2544, 2562), - }); - declarations.push(Declaration { - id: DeclarationId(2446), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "args".to_string(), - ty: DeclarationId(2445), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 2497, 2591), - }); - declarations.push(Declaration { - id: DeclarationId(2447), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "inner".to_string(), - ty: DeclarationId(1122), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 2596, 2660), - }); - declarations.push(Declaration { - id: DeclarationId(2448), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1122), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 2687, 2704), - }); - declarations.push(Declaration { - id: DeclarationId(2449), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "inputs".to_string(), - ty: DeclarationId(2448), - }, - Field { - label: "output".to_string(), - ty: DeclarationId(1122), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 2665, 2759), - }); - declarations.push(Declaration { - id: DeclarationId(2450), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 4129, 4175), - }); - declarations.push(Declaration { - id: DeclarationId(2451), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "binding".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 4180, 4263), - }); - declarations.push(Declaration { - id: DeclarationId(2452), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1126), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 4317, 4342), - }); - declarations.push(Declaration { - id: DeclarationId(2453), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "fields".to_string(), - ty: DeclarationId(2452), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 4268, 4371), - }); - declarations.push(Declaration { - id: DeclarationId(2454), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 5146, 5157), - }); - declarations.push(Declaration { - id: DeclarationId(2455), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(124), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 5162, 5172), - }); - declarations.push(Declaration { - id: DeclarationId(2456), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 5177, 5191), - }); - declarations.push(Declaration { - id: DeclarationId(2457), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 5196, 5210), - }); - declarations.push(Declaration { - id: DeclarationId(2458), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "value".to_string(), - ty: DeclarationId(1128), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 5324, 5375), - }); - declarations.push(Declaration { - id: DeclarationId(2459), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 5380, 5418), - }); - declarations.push(Declaration { - id: DeclarationId(2460), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 5446, 5458), - }); - declarations.push(Declaration { - id: DeclarationId(2461), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(155), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 5480, 5496), - }); - declarations.push(Declaration { - id: DeclarationId(2462), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "segments".to_string(), - ty: DeclarationId(2460), - }, - Field { - label: "segment_spans".to_string(), - ty: DeclarationId(2461), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 5423, 5525), - }); - declarations.push(Declaration { - id: DeclarationId(2463), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1129), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 5570, 5587), - }); - declarations.push(Declaration { - id: DeclarationId(2464), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "target".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "args".to_string(), - ty: DeclarationId(2463), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 5530, 5616), - }); - declarations.push(Declaration { - id: DeclarationId(2465), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 6187, 6199), - }); - declarations.push(Declaration { - id: DeclarationId(2466), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(155), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 6221, 6237), - }); - declarations.push(Declaration { - id: DeclarationId(2467), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1129), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 6250, 6267), - }); - declarations.push(Declaration { - id: DeclarationId(2468), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "segments".to_string(), - ty: DeclarationId(2465), - }, - Field { - label: "segment_spans".to_string(), - ty: DeclarationId(2466), - }, - Field { - label: "args".to_string(), - ty: DeclarationId(2467), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 6160, 6296), - }); - declarations.push(Declaration { - id: DeclarationId(2469), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1123), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 6352, 6376), - }); - declarations.push(Declaration { - id: DeclarationId(2470), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "target".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "fields".to_string(), - ty: DeclarationId(2469), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 6301, 6405), - }); - declarations.push(Declaration { - id: DeclarationId(2471), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1129), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 6456, 6473), - }); - declarations.push(Declaration { - id: DeclarationId(2472), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "op".to_string(), - ty: DeclarationId(817), - }, - Field { - label: "args".to_string(), - ty: DeclarationId(2471), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 6410, 6502), - }); - declarations.push(Declaration { - id: DeclarationId(2473), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 6530, 6542), - }); - declarations.push(Declaration { - id: DeclarationId(2474), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "params".to_string(), - ty: DeclarationId(2473), - }, - Field { - label: "body".to_string(), - ty: DeclarationId(1129), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 6507, 6595), - }); - declarations.push(Declaration { - id: DeclarationId(2475), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "cond".to_string(), - ty: DeclarationId(1129), - }, - Field { - label: "then_branch".to_string(), - ty: DeclarationId(1129), - }, - Field { - label: "else_branch".to_string(), - ty: DeclarationId(1129), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 6600, 6719), - }); - declarations.push(Declaration { - id: DeclarationId(2476), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1125), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 6773, 6794), - }); - declarations.push(Declaration { - id: DeclarationId(2477), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "scrutinee".to_string(), - ty: DeclarationId(1129), - }, - Field { - label: "arms".to_string(), - ty: DeclarationId(2476), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 6724, 6823), - }); - declarations.push(Declaration { - id: DeclarationId(2478), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1123), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 6851, 6875), - }); - declarations.push(Declaration { - id: DeclarationId(2479), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "fields".to_string(), - ty: DeclarationId(2478), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 6828, 6904), - }); - declarations.push(Declaration { - id: DeclarationId(2480), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1129), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 6932, 6949), - }); - declarations.push(Declaration { - id: DeclarationId(2481), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "elements".to_string(), - ty: DeclarationId(2480), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 6909, 6978), - }); - declarations.push(Declaration { - id: DeclarationId(2482), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1124), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 9072, 9093), - }); - declarations.push(Declaration { - id: DeclarationId(2483), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "entries".to_string(), - ty: DeclarationId(2482), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 9051, 9122), - }); - declarations.push(Declaration { - id: DeclarationId(2484), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(1122), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 10053, 10065), - }); - declarations.push(Declaration { - id: DeclarationId(2485), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "type_ann".to_string(), - ty: DeclarationId(2484), - }, - Field { - label: "expr".to_string(), - ty: DeclarationId(1129), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 10012, 10095), - }); - declarations.push(Declaration { - id: DeclarationId(2486), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 10143, 10155), - }); - declarations.push(Declaration { - id: DeclarationId(2487), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1117), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 10170, 10188), - }); - declarations.push(Declaration { - id: DeclarationId(2488), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "type_params".to_string(), - ty: DeclarationId(2486), - }, - Field { - label: "params".to_string(), - ty: DeclarationId(2487), - }, - Field { - label: "return_type".to_string(), - ty: DeclarationId(1122), - }, - Field { - label: "body".to_string(), - ty: DeclarationId(1129), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 10100, 10272), - }); - declarations.push(Declaration { - id: DeclarationId(2489), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 10332, 10344), - }); - declarations.push(Declaration { - id: DeclarationId(2490), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1117), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 10359, 10377), - }); - declarations.push(Declaration { - id: DeclarationId(2491), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "type_params".to_string(), - ty: DeclarationId(2489), - }, - Field { - label: "params".to_string(), - ty: DeclarationId(2490), - }, - Field { - label: "return_type".to_string(), - ty: DeclarationId(1122), - }, - Field { - label: "body_span".to_string(), - ty: DeclarationId(155), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 10277, 10465), - }); - declarations.push(Declaration { - id: DeclarationId(2492), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(1129), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 10530, 10542), - }); - declarations.push(Declaration { - id: DeclarationId(2493), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "ty".to_string(), - ty: DeclarationId(1122), - }, - Field { - label: "body".to_string(), - ty: DeclarationId(2492), - }, - Field { - label: "body_span".to_string(), - ty: DeclarationId(155), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 10470, 10599), - }); - declarations.push(Declaration { - id: DeclarationId(2494), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 10619, 10631), - }); - declarations.push(Declaration { - id: DeclarationId(2495), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "path".to_string(), - ty: DeclarationId(2494), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 10604, 10651), - }); - declarations.push(Declaration { - id: DeclarationId(2496), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 10677, 10689), - }); - declarations.push(Declaration { - id: DeclarationId(2497), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 10703, 10715), - }); - declarations.push(Declaration { - id: DeclarationId(2498), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "path".to_string(), - ty: DeclarationId(2496), - }, - Field { - label: "names".to_string(), - ty: DeclarationId(2497), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 10656, 10744), - }); - declarations.push(Declaration { - id: DeclarationId(2499), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 10798, 10810), - }); - declarations.push(Declaration { - id: DeclarationId(2500), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "type_params".to_string(), - ty: DeclarationId(2499), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 10749, 10839), - }); - declarations.push(Declaration { - id: DeclarationId(2501), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 10895, 10907), - }); - declarations.push(Declaration { - id: DeclarationId(2502), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1118), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 10922, 10940), - }); - declarations.push(Declaration { - id: DeclarationId(2503), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "type_params".to_string(), - ty: DeclarationId(2501), - }, - Field { - label: "fields".to_string(), - ty: DeclarationId(2502), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 10844, 10969), - }); - declarations.push(Declaration { - id: DeclarationId(2504), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 11022, 11034), - }); - declarations.push(Declaration { - id: DeclarationId(2505), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1119), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 11051, 11071), - }); - declarations.push(Declaration { - id: DeclarationId(2506), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(1122), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 11088, 11100), - }); - declarations.push(Declaration { - id: DeclarationId(2507), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "type_params".to_string(), - ty: DeclarationId(2504), - }, - Field { - label: "variants".to_string(), - ty: DeclarationId(2505), - }, - Field { - label: "inhabits".to_string(), - ty: DeclarationId(2506), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 10974, 11129), - }); - declarations.push(Declaration { - id: DeclarationId(2508), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 11184, 11196), - }); - declarations.push(Declaration { - id: DeclarationId(2509), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(1129), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 11268, 11280), - }); - declarations.push(Declaration { - id: DeclarationId(2510), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "type_params".to_string(), - ty: DeclarationId(2508), - }, - Field { - label: "nominal_opaque".to_string(), - ty: DeclarationId(124), - }, - Field { - label: "target".to_string(), - ty: DeclarationId(1122), - }, - Field { - label: "refinement".to_string(), - ty: DeclarationId(2509), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 11134, 11309), - }); - declarations.push(Declaration { - id: DeclarationId(2511), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1025), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new( - "src/v3/std/python_method_template_contracts.dag", - 6752, - 6780, - ), - }); - declarations.push(Declaration { - id: DeclarationId(2512), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1142), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/runtime.dag", 11238, 11249), - }); - declarations.push(Declaration { - id: DeclarationId(2513), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(793), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/runtime.dag", 2137, 2162), - }); - declarations.push(Declaration { - id: DeclarationId(2514), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1141), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/runtime.dag", 2179, 2195), - }); - declarations.push(Declaration { - id: DeclarationId(2515), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(2514), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/runtime.dag", 2167, 2196), - }); - declarations.push(Declaration { - id: DeclarationId(2516), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "tag".to_string(), - ty: DeclarationId(737), - }, - Field { - label: "payload".to_string(), - ty: DeclarationId(1142), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/runtime.dag", 2201, 2252), - }); - declarations.push(Declaration { - id: DeclarationId(2517), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(735), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/runtime.dag", 2257, 2272), - }); - declarations.push(Declaration { - id: DeclarationId(2518), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(829), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/runtime.dag", 2277, 2304), - }); - declarations.push(Declaration { - id: DeclarationId(2519), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(736), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(1142), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/runtime.dag", 3936, 3954), - }); - declarations.push(Declaration { - id: DeclarationId(2520), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1145), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/runtime.dag", 4542, 4557), - }); - declarations.push(Declaration { - id: DeclarationId(2521), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "input_order".to_string(), - ty: DeclarationId(1149), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/runtime.dag", 5388, 5442), - }); - declarations.push(Declaration { - id: DeclarationId(2522), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/runtime.dag", 5682, 5691), - }); - declarations.push(Declaration { - id: DeclarationId(2523), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/runtime.dag", 5694, 5704), - }); - declarations.push(Declaration { - id: DeclarationId(2524), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1025), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/rust_method_template_contracts.dag", 5769, 5797), - }); - declarations.push(Declaration { - id: DeclarationId(2525), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(1157), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 2429, 2445), - }); - declarations.push(Declaration { - id: DeclarationId(2526), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(1157), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 2450, 2466), - }); - declarations.push(Declaration { - id: DeclarationId(2527), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(1157), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 2471, 2487), - }); - declarations.push(Declaration { - id: DeclarationId(2528), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(1157), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 2732, 2760), - }); - declarations.push(Declaration { - id: DeclarationId(2529), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(1157), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 2804, 2832), - }); - declarations.push(Declaration { - id: DeclarationId(2530), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(1165), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 6397, 6419), - }); - declarations.push(Declaration { - id: DeclarationId(2531), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(1167), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 6839, 6859), - }); - declarations.push(Declaration { - id: DeclarationId(2532), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(11), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(12), - value: DeclarationId(1178), - }, - TemplateArgument { - parameter: DeclarationId(13), - value: DeclarationId(1177), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 12353, 12399), - }); - declarations.push(Declaration { - id: DeclarationId(2533), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 767, 773), - }); - declarations.push(Declaration { - id: DeclarationId(2534), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 778, 791), - }); - declarations.push(Declaration { - id: DeclarationId(2535), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 796, 810), - }); - declarations.push(Declaration { - id: DeclarationId(2536), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "param".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 3332, 3358), - }); - declarations.push(Declaration { - id: DeclarationId(2537), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "param".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 3363, 3391), - }); - declarations.push(Declaration { - id: DeclarationId(2538), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "param".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 3396, 3429), - }); - declarations.push(Declaration { - id: DeclarationId(2539), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "param".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 3434, 3465), - }); - declarations.push(Declaration { - id: DeclarationId(2540), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "param".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 3470, 3502), - }); - declarations.push(Declaration { - id: DeclarationId(2541), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 4509, 4516), - }); - declarations.push(Declaration { - id: DeclarationId(2542), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "previous".to_string(), - ty: DeclarationId(1165), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 4521, 4571), - }); - declarations.push(Declaration { - id: DeclarationId(2543), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 5484, 5495), - }); - declarations.push(Declaration { - id: DeclarationId(2544), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "inner".to_string(), - ty: DeclarationId(1167), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 5500, 5545), - }); - declarations.push(Declaration { - id: DeclarationId(2545), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "accessor".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 7649, 7683), - }); - declarations.push(Declaration { - id: DeclarationId(2546), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "amount".to_string(), - ty: DeclarationId(1165), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 7688, 7732), - }); - declarations.push(Declaration { - id: DeclarationId(2547), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "steps".to_string(), - ty: DeclarationId(1165), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 7737, 7795), - }); - declarations.push(Declaration { - id: DeclarationId(2548), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "divisor".to_string(), - ty: DeclarationId(1167), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 7800, 7856), - }); - declarations.push(Declaration { - id: DeclarationId(2549), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "witness".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 7861, 7894), - }); - declarations.push(Declaration { - id: DeclarationId(2550), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "element".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 7899, 7929), - }); - declarations.push(Declaration { - id: DeclarationId(2551), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 7934, 7947), - }); - declarations.push(Declaration { - id: DeclarationId(2552), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1164), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 7987, 8009), - }); - declarations.push(Declaration { - id: DeclarationId(2553), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1157), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 8219, 8240), - }); - declarations.push(Declaration { - id: DeclarationId(2554), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 8740, 8746), - }); - declarations.push(Declaration { - id: DeclarationId(2555), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 9139, 9152), - }); - declarations.push(Declaration { - id: DeclarationId(2556), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 9157, 9171), - }); - declarations.push(Declaration { - id: DeclarationId(2557), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1176), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 10263, 10297), - }); - declarations.push(Declaration { - id: DeclarationId(2558), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 10302, 10320), - }); - declarations.push(Declaration { - id: DeclarationId(2559), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(1175), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 11234, 11261), - }); - declarations.push(Declaration { - id: DeclarationId(2560), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(970), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 21954, 21966), - }); - declarations.push(Declaration { - id: DeclarationId(2561), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(975), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 23501, 23516), - }); - declarations.push(Declaration { - id: DeclarationId(2562), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1200), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 29819, 29834), - }); - declarations.push(Declaration { - id: DeclarationId(2563), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1199), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 31848, 31864), - }); - declarations.push(Declaration { - id: DeclarationId(2564), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1199), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 31957, 31973), - }); - declarations.push(Declaration { - id: DeclarationId(2565), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1199), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 32071, 32087), - }); - declarations.push(Declaration { - id: DeclarationId(2566), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(2565), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 32066, 32088), - }); - declarations.push(Declaration { - id: DeclarationId(2567), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(87), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 35581, 35585), - }); - declarations.push(Declaration { - id: DeclarationId(2568), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(87), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 35877, 35881), - }); - declarations.push(Declaration { - id: DeclarationId(2569), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(87), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 37126, 37130), - }); - declarations.push(Declaration { - id: DeclarationId(2570), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(87), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 37601, 37605), - }); - declarations.push(Declaration { - id: DeclarationId(2571), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(87), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 38864, 38868), - }); - declarations.push(Declaration { - id: DeclarationId(2572), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(87), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 39136, 39140), - }); - declarations.push(Declaration { - id: DeclarationId(2573), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 5629, 5644), - }); - declarations.push(Declaration { - id: DeclarationId(2574), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 5684, 5697), - }); - declarations.push(Declaration { - id: DeclarationId(2575), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 5745, 5762), - }); - declarations.push(Declaration { - id: DeclarationId(2576), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 5801, 5813), - }); - declarations.push(Declaration { - id: DeclarationId(2577), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 5861, 5878), - }); - declarations.push(Declaration { - id: DeclarationId(2578), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "field".to_string(), - ty: DeclarationId(1181), - }, - Field { - label: "factor".to_string(), - ty: DeclarationId(973), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 10410, 10472), - }); - declarations.push(Declaration { - id: DeclarationId(2579), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "field".to_string(), - ty: DeclarationId(1181), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 10477, 10519), - }); - declarations.push(Declaration { - id: DeclarationId(2580), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "param".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "factor".to_string(), - ty: DeclarationId(973), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 10524, 10581), - }); - declarations.push(Declaration { - id: DeclarationId(2581), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 10586, 10600), - }); - declarations.push(Declaration { - id: DeclarationId(2582), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 10605, 10623), - }); - declarations.push(Declaration { - id: DeclarationId(2583), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 10628, 10644), - }); - declarations.push(Declaration { - id: DeclarationId(2584), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 10649, 10657), - }); - declarations.push(Declaration { - id: DeclarationId(2585), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 10662, 10677), - }); - declarations.push(Declaration { - id: DeclarationId(2586), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 26104, 26118), - }); - declarations.push(Declaration { - id: DeclarationId(2587), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "degree".to_string(), - ty: DeclarationId(1165), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 26123, 26170), - }); - declarations.push(Declaration { - id: DeclarationId(2588), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "numerator".to_string(), - ty: DeclarationId(1165), - }, - Field { - label: "root".to_string(), - ty: DeclarationId(1165), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 26175, 26252), - }); - declarations.push(Declaration { - id: DeclarationId(2589), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "base".to_string(), - ty: DeclarationId(1167), - }, - Field { - label: "argument".to_string(), - ty: DeclarationId(1165), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 26257, 26331), - }); - declarations.push(Declaration { - id: DeclarationId(2590), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "param".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "exponent".to_string(), - ty: DeclarationId(1197), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 26951, 27007), - }); - declarations.push(Declaration { - id: DeclarationId(2591), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "param".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 27023, 27048), - }); - declarations.push(Declaration { - id: DeclarationId(2592), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 28697, 28710), - }); - declarations.push(Declaration { - id: DeclarationId(2593), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "cost".to_string(), - ty: DeclarationId(1199), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 28754, 28786), - }); - declarations.push(Declaration { - id: DeclarationId(2594), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1199), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 28849, 28865), - }); - declarations.push(Declaration { - id: DeclarationId(2595), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "factors".to_string(), - ty: DeclarationId(2594), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 28825, 28867), - }); - declarations.push(Declaration { - id: DeclarationId(2596), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1199), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 28929, 28945), - }); - declarations.push(Declaration { - id: DeclarationId(2597), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(2596), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 28924, 28946), - }); - declarations.push(Declaration { - id: DeclarationId(2598), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "terms".to_string(), - ty: DeclarationId(2597), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 28896, 28948), - }); - declarations.push(Declaration { - id: DeclarationId(2599), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1200), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 29246, 29261), - }); - declarations.push(Declaration { - id: DeclarationId(2600), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "terms".to_string(), - ty: DeclarationId(2599), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 29228, 29263), - }); - declarations.push(Declaration { - id: DeclarationId(2601), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 29346, 29358), - }); - declarations.push(Declaration { - id: DeclarationId(2602), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 29428, 29438), - }); - declarations.push(Declaration { - id: DeclarationId(2603), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 646, 651), - }); - declarations.push(Declaration { - id: DeclarationId(2604), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 656, 660), - }); - declarations.push(Declaration { - id: DeclarationId(2605), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 665, 671), - }); - declarations.push(Declaration { - id: DeclarationId(2606), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 676, 682), - }); - declarations.push(Declaration { - id: DeclarationId(2607), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 687, 691), - }); - declarations.push(Declaration { - id: DeclarationId(2608), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 696, 702), - }); - declarations.push(Declaration { - id: DeclarationId(2609), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 707, 715), - }); - declarations.push(Declaration { - id: DeclarationId(2610), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 720, 728), - }); - declarations.push(Declaration { - id: DeclarationId(2611), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 733, 740), - }); - declarations.push(Declaration { - id: DeclarationId(2612), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 745, 751), - }); - declarations.push(Declaration { - id: DeclarationId(2613), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 756, 763), - }); - declarations.push(Declaration { - id: DeclarationId(2614), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 768, 774), - }); - declarations.push(Declaration { - id: DeclarationId(2615), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 779, 786), - }); - declarations.push(Declaration { - id: DeclarationId(2616), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 791, 804), - }); - declarations.push(Declaration { - id: DeclarationId(2617), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 889, 903), - }); - declarations.push(Declaration { - id: DeclarationId(2618), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 908, 925), - }); - declarations.push(Declaration { - id: DeclarationId(2619), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 930, 932), - }); - declarations.push(Declaration { - id: DeclarationId(2620), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 937, 941), - }); - declarations.push(Declaration { - id: DeclarationId(2621), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 946, 951), - }); - declarations.push(Declaration { - id: DeclarationId(2622), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 956, 958), - }); - declarations.push(Declaration { - id: DeclarationId(2623), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 963, 965), - }); - declarations.push(Declaration { - id: DeclarationId(2624), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 970, 972), - }); - declarations.push(Declaration { - id: DeclarationId(2625), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 977, 979), - }); - declarations.push(Declaration { - id: DeclarationId(2626), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 984, 988), - }); - declarations.push(Declaration { - id: DeclarationId(2627), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 993, 998), - }); - declarations.push(Declaration { - id: DeclarationId(2628), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1003, 1007), - }); - declarations.push(Declaration { - id: DeclarationId(2629), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1012, 1017), - }); - declarations.push(Declaration { - id: DeclarationId(2630), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1022, 1028), - }); - declarations.push(Declaration { - id: DeclarationId(2631), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1033, 1041), - }); - declarations.push(Declaration { - id: DeclarationId(2632), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1046, 1051), - }); - declarations.push(Declaration { - id: DeclarationId(2633), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1056, 1061), - }); - declarations.push(Declaration { - id: DeclarationId(2634), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1066, 1074), - }); - declarations.push(Declaration { - id: DeclarationId(2635), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1079, 1088), - }); - declarations.push(Declaration { - id: DeclarationId(2636), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1093, 1096), - }); - declarations.push(Declaration { - id: DeclarationId(2637), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1101, 1107), - }); - declarations.push(Declaration { - id: DeclarationId(2638), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1112, 1118), - }); - declarations.push(Declaration { - id: DeclarationId(2639), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1123, 1129), - }); - declarations.push(Declaration { - id: DeclarationId(2640), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1134, 1140), - }); - declarations.push(Declaration { - id: DeclarationId(2641), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1145, 1153), - }); - declarations.push(Declaration { - id: DeclarationId(2642), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1158, 1166), - }); - declarations.push(Declaration { - id: DeclarationId(2643), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1171, 1176), - }); - declarations.push(Declaration { - id: DeclarationId(2644), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1181, 1190), - }); - declarations.push(Declaration { - id: DeclarationId(2645), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1195, 1199), - }); - declarations.push(Declaration { - id: DeclarationId(2646), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1204, 1212), - }); - declarations.push(Declaration { - id: DeclarationId(2647), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1217, 1222), - }); - declarations.push(Declaration { - id: DeclarationId(2648), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1227, 1230), - }); - declarations.push(Declaration { - id: DeclarationId(2649), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1801, 1806), - }); - declarations.push(Declaration { - id: DeclarationId(2650), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1811, 1815), - }); - declarations.push(Declaration { - id: DeclarationId(2651), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1820, 1826), - }); - declarations.push(Declaration { - id: DeclarationId(2652), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1831, 1837), - }); - declarations.push(Declaration { - id: DeclarationId(2653), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1842, 1846), - }); - declarations.push(Declaration { - id: DeclarationId(2654), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1851, 1857), - }); - declarations.push(Declaration { - id: DeclarationId(2655), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1862, 1870), - }); - declarations.push(Declaration { - id: DeclarationId(2656), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1875, 1883), - }); - declarations.push(Declaration { - id: DeclarationId(2657), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1888, 1895), - }); - declarations.push(Declaration { - id: DeclarationId(2658), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1900, 1906), - }); - declarations.push(Declaration { - id: DeclarationId(2659), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1911, 1918), - }); - declarations.push(Declaration { - id: DeclarationId(2660), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1923, 1929), - }); - declarations.push(Declaration { - id: DeclarationId(2661), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1934, 1941), - }); - declarations.push(Declaration { - id: DeclarationId(2662), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2381, 2383), - }); - declarations.push(Declaration { - id: DeclarationId(2663), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2388, 2392), - }); - declarations.push(Declaration { - id: DeclarationId(2664), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2397, 2402), - }); - declarations.push(Declaration { - id: DeclarationId(2665), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2407, 2409), - }); - declarations.push(Declaration { - id: DeclarationId(2666), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2414, 2416), - }); - declarations.push(Declaration { - id: DeclarationId(2667), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2421, 2423), - }); - declarations.push(Declaration { - id: DeclarationId(2668), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2428, 2430), - }); - declarations.push(Declaration { - id: DeclarationId(2669), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2435, 2439), - }); - declarations.push(Declaration { - id: DeclarationId(2670), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2444, 2449), - }); - declarations.push(Declaration { - id: DeclarationId(2671), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2454, 2458), - }); - declarations.push(Declaration { - id: DeclarationId(2672), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2463, 2468), - }); - declarations.push(Declaration { - id: DeclarationId(2673), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2473, 2479), - }); - declarations.push(Declaration { - id: DeclarationId(2674), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2484, 2492), - }); - declarations.push(Declaration { - id: DeclarationId(2675), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2497, 2502), - }); - declarations.push(Declaration { - id: DeclarationId(2676), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2507, 2512), - }); - declarations.push(Declaration { - id: DeclarationId(2677), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2517, 2525), - }); - declarations.push(Declaration { - id: DeclarationId(2678), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2530, 2539), - }); - declarations.push(Declaration { - id: DeclarationId(2679), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2544, 2547), - }); - declarations.push(Declaration { - id: DeclarationId(2680), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2552, 2558), - }); - declarations.push(Declaration { - id: DeclarationId(2681), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2563, 2569), - }); - declarations.push(Declaration { - id: DeclarationId(2682), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2574, 2580), - }); - declarations.push(Declaration { - id: DeclarationId(2683), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2585, 2591), - }); - declarations.push(Declaration { - id: DeclarationId(2684), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2596, 2604), - }); - declarations.push(Declaration { - id: DeclarationId(2685), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2609, 2617), - }); - declarations.push(Declaration { - id: DeclarationId(2686), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2622, 2627), - }); - declarations.push(Declaration { - id: DeclarationId(2687), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2632, 2641), - }); - declarations.push(Declaration { - id: DeclarationId(2688), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2646, 2650), - }); - declarations.push(Declaration { - id: DeclarationId(2689), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2655, 2663), - }); - declarations.push(Declaration { - id: DeclarationId(2690), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2668, 2673), - }); - declarations.push(Declaration { - id: DeclarationId(2691), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(838), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/workflows.dag", 986, 1000), - }); - declarations.push(Declaration { - id: DeclarationId(2692), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1058), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1250), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16222, 16248), - }); - declarations.push(Declaration { - id: DeclarationId(2693), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "duration".to_string(), - ty: DeclarationId(1249), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 4146, 4180), - }); - declarations.push(Declaration { - id: DeclarationId(2694), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 4185, 4195), - }); - declarations.push(Declaration { - id: DeclarationId(2695), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 4200, 4209), - }); - declarations.push(Declaration { - id: DeclarationId(2696), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 4214, 4219), - }); - declarations.push(Declaration { - id: DeclarationId(2697), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1255), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 7717, 7745), - }); - declarations.push(Declaration { - id: DeclarationId(2698), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "max".to_string(), - ty: DeclarationId(1249), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 9229, 9260), - }); - declarations.push(Declaration { - id: DeclarationId(2699), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 9265, 9281), - }); - declarations.push(Declaration { - id: DeclarationId(2700), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(19), - arguments: vec![TemplateArgument { - parameter: DeclarationId(20), - value: DeclarationId(1250), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19583, 19608), - }); - declarations.push(Declaration { - id: DeclarationId(2701), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1101), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(1102), - value: DeclarationId(1250), - }, - TemplateArgument { - parameter: DeclarationId(1103), - value: DeclarationId(1256), - }, - TemplateArgument { - parameter: DeclarationId(1104), - value: DeclarationId(1257), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19925, 20001), - }); - declarations.push(Declaration { - id: DeclarationId(2702), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1105), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(1106), - value: DeclarationId(1250), - }, - TemplateArgument { - parameter: DeclarationId(1107), - value: DeclarationId(1256), - }, - TemplateArgument { - parameter: DeclarationId(1108), - value: DeclarationId(1257), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 20112, 20188), - }); - declarations.push(Declaration { - id: DeclarationId(2703), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(2404), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1250), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16222, 16248), - }); - declarations.push(Declaration { - id: DeclarationId(2704), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(2404), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1250), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16222, 16248), - }); - declarations.push(Declaration { - id: DeclarationId(2705), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(2404), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1250), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16222, 16248), - }); - declarations.push(Declaration { - id: DeclarationId(2706), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(2404), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1250), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16222, 16248), - }); - declarations.push(Declaration { - id: DeclarationId(2707), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(2404), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1250), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16222, 16248), - }); - declarations.push(Declaration { - id: DeclarationId(2708), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(2404), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1250), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16222, 16248), - }); - declarations.push(Declaration { - id: DeclarationId(2709), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(2404), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1250), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16222, 16248), - }); - declarations.push(Declaration { - id: DeclarationId(2710), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(2404), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1250), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16222, 16248), - }); - declarations.push(Declaration { - id: DeclarationId(2711), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(2404), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1250), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16222, 16248), - }); - declarations.push(Declaration { - id: DeclarationId(2712), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(2404), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1250), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16222, 16248), - }); - declarations.push(Declaration { - id: DeclarationId(2713), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1058), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1250), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3256, 3282), - }); - declarations.push(Declaration { - id: DeclarationId(2714), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1058), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1250), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 4828, 4854), - }); - declarations.push(Declaration { - id: DeclarationId(2715), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(810), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5122, 5139), - }); - declarations.push(Declaration { - id: DeclarationId(2716), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(838), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5190, 5204), - }); - declarations.push(Declaration { - id: DeclarationId(2717), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(792), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5254, 5267), - }); - declarations.push(Declaration { - id: DeclarationId(2718), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(828), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5317, 5330), - }); - declarations.push(Declaration { - id: DeclarationId(2719), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1055), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5378, 5394), - }); - declarations.push(Declaration { - id: DeclarationId(2720), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1058), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1250), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5447, 5473), - }); - declarations.push(Declaration { - id: DeclarationId(2721), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(2720), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5442, 5474), - }); - declarations.push(Declaration { - id: DeclarationId(2722), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1058), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1250), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5548, 5574), - }); - declarations.push(Declaration { - id: DeclarationId(2723), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(2722), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5543, 5575), - }); - declarations.push(Declaration { - id: DeclarationId(2724), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1055), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5700, 5716), - }); - declarations.push(Declaration { - id: DeclarationId(2725), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1061), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1062), - value: DeclarationId(1250), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5841, 5875), - }); - declarations.push(Declaration { - id: DeclarationId(2726), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1061), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1062), - value: DeclarationId(1250), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 6087, 6121), - }); - declarations.push(Declaration { - id: DeclarationId(2727), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1061), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1062), - value: DeclarationId(1250), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 6606, 6640), - }); - declarations.push(Declaration { - id: DeclarationId(2728), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1061), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1062), - value: DeclarationId(1250), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 6867, 6901), - }); - declarations.push(Declaration { - id: DeclarationId(2729), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1061), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1062), - value: DeclarationId(1250), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7157, 7191), - }); - declarations.push(Declaration { - id: DeclarationId(2730), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1058), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1250), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7371, 7397), - }); - declarations.push(Declaration { - id: DeclarationId(2731), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1061), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1062), - value: DeclarationId(1250), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7402, 7436), - }); - declarations.push(Declaration { - id: DeclarationId(2732), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1061), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1062), - value: DeclarationId(1250), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 9253, 9287), - }); - declarations.push(Declaration { - id: DeclarationId(2733), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1109), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(1110), - value: DeclarationId(1250), - }, - TemplateArgument { - parameter: DeclarationId(1111), - value: DeclarationId(1256), - }, - TemplateArgument { - parameter: DeclarationId(1112), - value: DeclarationId(1257), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 11246, 11326), - }); - declarations.push(Declaration { - id: DeclarationId(2734), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(2404), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1250), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3256, 3282), - }); - declarations.push(Declaration { - id: DeclarationId(2735), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(2404), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1250), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3256, 3282), - }); - declarations.push(Declaration { - id: DeclarationId(2736), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(2404), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1250), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3256, 3282), - }); - declarations.push(Declaration { - id: DeclarationId(2737), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(2404), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1250), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3256, 3282), - }); - declarations.push(Declaration { - id: DeclarationId(2738), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(2404), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1250), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3256, 3282), - }); - declarations.push(Declaration { - id: DeclarationId(2739), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(2404), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1250), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3256, 3282), - }); - declarations.push(Declaration { - id: DeclarationId(2740), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(2404), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1250), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3256, 3282), - }); - declarations.push(Declaration { - id: DeclarationId(2741), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(2404), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1250), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3256, 3282), - }); - declarations.push(Declaration { - id: DeclarationId(2742), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(2404), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1250), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3256, 3282), - }); - declarations.push(Declaration { - id: DeclarationId(2743), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(2404), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1250), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3256, 3282), - }); - declarations.push(Declaration { - id: DeclarationId(2744), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1870), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(810), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5122, 5139), - }); - declarations.push(Declaration { - id: DeclarationId(2745), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1870), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(838), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5190, 5204), - }); - declarations.push(Declaration { - id: DeclarationId(2746), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1870), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(792), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5254, 5267), - }); - declarations.push(Declaration { - id: DeclarationId(2747), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1870), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(828), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5317, 5330), - }); - declarations.push(Declaration { - id: DeclarationId(2748), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1870), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1055), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5378, 5394), - }); - declarations.push(Declaration { - id: DeclarationId(2749), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1870), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(2720), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5442, 5474), - }); - declarations.push(Declaration { - id: DeclarationId(2750), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1872), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(2722), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5543, 5575), - }); - declarations.push(Declaration { - id: DeclarationId(2751), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(2404), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1250), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5548, 5574), - }); - declarations.push(Declaration { - id: DeclarationId(2752), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1872), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1055), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5700, 5716), - }); - declarations.push(Declaration { - id: DeclarationId(2753), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(2410), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1062), - value: DeclarationId(1250), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5841, 5875), - }); - declarations.push(Declaration { - id: DeclarationId(2754), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(2414), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1062), - value: DeclarationId(1250), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 6087, 6121), - }); - declarations.push(Declaration { - id: DeclarationId(2755), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(962), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 30395, 30418), - }); - declarations.push(Declaration { - id: DeclarationId(2756), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1339), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 31487, 31503), - }); - declarations.push(Declaration { - id: DeclarationId(2757), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1341), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 31508, 31528), - }); - declarations.push(Declaration { - id: DeclarationId(2758), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "output_path".to_string(), - ty: DeclarationId(1302), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 2616, 2649), - }); - declarations.push(Declaration { - id: DeclarationId(2759), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "output_path".to_string(), - ty: DeclarationId(1302), - }, - Field { - label: "dag_source".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "source_hash".to_string(), - ty: DeclarationId(147), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 2654, 2762), - }); - declarations.push(Declaration { - id: DeclarationId(2760), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 4198, 4212), - }); - declarations.push(Declaration { - id: DeclarationId(2761), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 4217, 4227), - }); - declarations.push(Declaration { - id: DeclarationId(2762), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 4232, 4244), - }); - declarations.push(Declaration { - id: DeclarationId(2763), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 4249, 4262), - }); - declarations.push(Declaration { - id: DeclarationId(2764), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 4267, 4279), - }); - declarations.push(Declaration { - id: DeclarationId(2765), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 4284, 4296), - }); - declarations.push(Declaration { - id: DeclarationId(2766), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 4301, 4323), - }); - declarations.push(Declaration { - id: DeclarationId(2767), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 4328, 4347), - }); - declarations.push(Declaration { - id: DeclarationId(2768), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 4352, 4377), - }); - declarations.push(Declaration { - id: DeclarationId(2769), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 4382, 4405), - }); - declarations.push(Declaration { - id: DeclarationId(2770), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 4811, 4820), - }); - declarations.push(Declaration { - id: DeclarationId(2771), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 4825, 4841), - }); - declarations.push(Declaration { - id: DeclarationId(2772), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 5500, 5508), - }); - declarations.push(Declaration { - id: DeclarationId(2773), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 5513, 5523), - }); - declarations.push(Declaration { - id: DeclarationId(2774), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 5748, 5760), - }); - declarations.push(Declaration { - id: DeclarationId(2775), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 6575, 6588), - }); - declarations.push(Declaration { - id: DeclarationId(2776), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 6593, 6606), - }); - declarations.push(Declaration { - id: DeclarationId(2777), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 6611, 6619), - }); - declarations.push(Declaration { - id: DeclarationId(2778), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "source".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "file_name".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 7164, 7231), - }); - declarations.push(Declaration { - id: DeclarationId(2779), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "var".to_string(), - ty: DeclarationId(1324), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 7272, 7325), - }); - declarations.push(Declaration { - id: DeclarationId(2780), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 7358, 7387), - }); - declarations.push(Declaration { - id: DeclarationId(2781), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 7989, 8021), - }); - declarations.push(Declaration { - id: DeclarationId(2782), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 8026, 8057), - }); - declarations.push(Declaration { - id: DeclarationId(2783), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 8099, 8131), - }); - declarations.push(Declaration { - id: DeclarationId(2784), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 8136, 8167), - }); - declarations.push(Declaration { - id: DeclarationId(2785), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 8172, 8200), - }); - declarations.push(Declaration { - id: DeclarationId(2786), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 8205, 8231), - }); - declarations.push(Declaration { - id: DeclarationId(2787), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 8270, 8292), - }); - declarations.push(Declaration { - id: DeclarationId(2788), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 8297, 8325), - }); - declarations.push(Declaration { - id: DeclarationId(2789), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 8330, 8359), - }); - declarations.push(Declaration { - id: DeclarationId(2790), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 11171, 11179), - }); - declarations.push(Declaration { - id: DeclarationId(2791), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1317), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 11184, 11224), - }); - declarations.push(Declaration { - id: DeclarationId(2792), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "expected".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 11229, 11262), - }); - declarations.push(Declaration { - id: DeclarationId(2793), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "bind_name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "state".to_string(), - ty: DeclarationId(1318), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 11267, 11345), - }); - declarations.push(Declaration { - id: DeclarationId(2794), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "declaration_name".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 11511, 11574), - }); - declarations.push(Declaration { - id: DeclarationId(2795), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "bind_name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "comparator".to_string(), - ty: DeclarationId(814), - }, - Field { - label: "bound".to_string(), - ty: DeclarationId(87), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 11579, 11670), - }); - declarations.push(Declaration { - id: DeclarationId(2796), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "subject".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "input_sample".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "expected_output".to_string(), - ty: DeclarationId(1353), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 11675, 11807), - }); - declarations.push(Declaration { - id: DeclarationId(2797), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "subject".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "invariant".to_string(), - ty: DeclarationId(1353), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 12022, 12111), - }); - declarations.push(Declaration { - id: DeclarationId(2798), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 12911, 12923), - }); - declarations.push(Declaration { - id: DeclarationId(2799), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "command".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "args".to_string(), - ty: DeclarationId(2798), - }, - Field { - label: "expect_exit_code".to_string(), - ty: DeclarationId(87), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 12860, 12957), - }); - declarations.push(Declaration { - id: DeclarationId(2800), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 13672, 13684), - }); - declarations.push(Declaration { - id: DeclarationId(2801), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "command".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "args".to_string(), - ty: DeclarationId(2800), - }, - Field { - label: "expect_exit_code".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "input_ref".to_string(), - ty: DeclarationId(1353), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 13622, 13750), - }); - declarations.push(Declaration { - id: DeclarationId(2802), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "lens_ref".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "input_ref".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "expected_ref".to_string(), - ty: DeclarationId(1353), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 14048, 14170), - }); - declarations.push(Declaration { - id: DeclarationId(2803), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "subject_ref".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "oracle_ref".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "input_ref".to_string(), - ty: DeclarationId(1353), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 14432, 14557), - }); - declarations.push(Declaration { - id: DeclarationId(2804), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "expected".to_string(), - ty: DeclarationId(1353), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 16610, 16671), - }); - declarations.push(Declaration { - id: DeclarationId(2805), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "expected".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "param".to_string(), - ty: DeclarationId(1325), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 16676, 16775), - }); - declarations.push(Declaration { - id: DeclarationId(2806), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "subject".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "comparator".to_string(), - ty: DeclarationId(1319), - }, - Field { - label: "baseline_ref".to_string(), - ty: DeclarationId(1353), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 17129, 17261), - }); - declarations.push(Declaration { - id: DeclarationId(2807), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "left_report_ref".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "right_report_ref".to_string(), - ty: DeclarationId(1353), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 17828, 17940), - }); - declarations.push(Declaration { - id: DeclarationId(2808), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "law".to_string(), - ty: DeclarationId(1320), - }, - Field { - label: "lens_ref".to_string(), - ty: DeclarationId(1353), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 18637, 18716), - }); - declarations.push(Declaration { - id: DeclarationId(2809), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "authority".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "list_constant".to_string(), - ty: DeclarationId(1305), - }, - Field { - label: "bound".to_string(), - ty: DeclarationId(87), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 18936, 19049), - }); - declarations.push(Declaration { - id: DeclarationId(2810), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "authority".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "list_constant".to_string(), - ty: DeclarationId(1305), - }, - Field { - label: "subset_predicate".to_string(), - ty: DeclarationId(1353), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 19054, 19190), - }); - declarations.push(Declaration { - id: DeclarationId(2811), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "compile_target".to_string(), - ty: DeclarationId(1302), - }, - Field { - label: "expected".to_string(), - ty: DeclarationId(1303), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 19897, 19979), - }); - declarations.push(Declaration { - id: DeclarationId(2812), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "authority".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "ratchet_kind".to_string(), - ty: DeclarationId(1353), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 19984, 20070), - }); - declarations.push(Declaration { - id: DeclarationId(2813), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1304), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 20970, 20998), - }); - declarations.push(Declaration { - id: DeclarationId(2814), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "authority".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "manifest_entries".to_string(), - ty: DeclarationId(2813), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 20895, 21004), - }); - declarations.push(Declaration { - id: DeclarationId(2815), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "capability_register".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "cementing_receipts".to_string(), - ty: DeclarationId(1353), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 22313, 22438), - }); - declarations.push(Declaration { - id: DeclarationId(2816), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "deferred_gate".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "target_lane".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "authority_doc".to_string(), - ty: DeclarationId(1353), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 23380, 23514), - }); - declarations.push(Declaration { - id: DeclarationId(2817), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "deferred_gate".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "target_lane".to_string(), - ty: DeclarationId(1353), - }, - Field { - label: "authority_doc".to_string(), - ty: DeclarationId(1353), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 24153, 24297), - }); - declarations.push(Declaration { - id: DeclarationId(2818), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "ledger".to_string(), - ty: DeclarationId(879), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 25142, 25196), - }); - declarations.push(Declaration { - id: DeclarationId(2819), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(962), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 26240, 26263), - }); - declarations.push(Declaration { - id: DeclarationId(2820), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 26466, 26472), - }); - declarations.push(Declaration { - id: DeclarationId(2821), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 26477, 26483), - }); - declarations.push(Declaration { - id: DeclarationId(2822), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(962), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 26621, 26644), - }); - declarations.push(Declaration { - id: DeclarationId(2823), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1334), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 28648, 28677), - }); - declarations.push(Declaration { - id: DeclarationId(2824), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1336), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 28682, 28721), - }); - declarations.push(Declaration { - id: DeclarationId(2825), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1334), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 29579, 29600), - }); - declarations.push(Declaration { - id: DeclarationId(2826), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1336), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 29605, 29636), - }); - declarations.push(Declaration { - id: DeclarationId(2827), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1339), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 29680, 29696), - }); - declarations.push(Declaration { - id: DeclarationId(2828), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(962), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 29952, 29975), - }); - declarations.push(Declaration { - id: DeclarationId(2829), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1329), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 8593, 8624), - }); - declarations.push(Declaration { - id: DeclarationId(2830), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/pipeline.dag", 532, 547), - }); - declarations.push(Declaration { - id: DeclarationId(2831), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/pipeline.dag", 550, 561), - }); - declarations.push(Declaration { - id: DeclarationId(2832), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/pipeline.dag", 564, 576), - }); - declarations.push(Declaration { - id: DeclarationId(2833), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(817), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/operators.dag", 142, 155), - }); - declarations.push(Declaration { - id: DeclarationId(2834), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/languages/rust/primitives.dag", 6458, 6476), - }); - declarations.push(Declaration { - id: DeclarationId(2835), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/languages/rust/primitives.dag", 6481, 6496), - }); - declarations.push(Declaration { - id: DeclarationId(2836), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/languages/rust/primitives.dag", 6525, 6548), - }); - declarations.push(Declaration { - id: DeclarationId(2837), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/languages/rust/primitives.dag", 6553, 6574), - }); - declarations.push(Declaration { - id: DeclarationId(2838), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/languages/rust/primitives.dag", 6579, 6594), - }); - declarations.push(Declaration { - id: DeclarationId(2839), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/languages/rust/primitives.dag", 8207, 8217), - }); - declarations.push(Declaration { - id: DeclarationId(2840), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/languages/rust/primitives.dag", 8222, 8233), - }); - declarations.push(Declaration { - id: DeclarationId(2841), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/languages/rust/primitives.dag", 8238, 8251), - }); - declarations.push(Declaration { - id: DeclarationId(2842), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/languages/rust/primitives.dag", 8256, 8269), - }); - declarations.push(Declaration { - id: DeclarationId(2843), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/languages/rust/primitives.dag", 8274, 8287), - }); - declarations.push(Declaration { - id: DeclarationId(2844), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/languages/rust/primitives.dag", 8292, 8306), - }); - declarations.push(Declaration { - id: DeclarationId(2845), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/languages/rust/primitives.dag", 8311, 8326), - }); - declarations.push(Declaration { - id: DeclarationId(2846), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/languages/rust/primitives.dag", 9068, 9085), - }); - declarations.push(Declaration { - id: DeclarationId(2847), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/languages/rust/primitives.dag", 9090, 9100), - }); - declarations.push(Declaration { - id: DeclarationId(2848), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/languages/rust/primitives.dag", 9105, 9109), - }); - declarations.push(Declaration { - id: DeclarationId(2849), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "target_name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "algebra".to_string(), - ty: DeclarationId(1772), - }, - Field { - label: "carrier".to_string(), - ty: DeclarationId(1774), - }, - Field { - label: "range_min_inclusive".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "range_max_inclusive".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "is_copy".to_string(), - ty: DeclarationId(124), - }, - Field { - label: "overflow".to_string(), - ty: DeclarationId(1775), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/languages/rust/primitives.dag", 9887, 10463), - }); - declarations.push(Declaration { - id: DeclarationId(2850), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "target_name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "algebra".to_string(), - ty: DeclarationId(1773), - }, - Field { - label: "carrier".to_string(), - ty: DeclarationId(1774), - }, - Field { - label: "is_copy".to_string(), - ty: DeclarationId(124), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/languages/rust/primitives.dag", 10468, 10650), - }); - declarations.push(Declaration { - id: DeclarationId(2851), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1776), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/languages/rust/primitives.dag", 11028, 11047), - }); - declarations.push(Declaration { - id: DeclarationId(2852), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/cron/schedule_model.dag", 4243, 4251), - }); - declarations.push(Declaration { - id: DeclarationId(2853), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "value".to_string(), - ty: DeclarationId(91), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/cron/schedule_model.dag", 4256, 4287), - }); - declarations.push(Declaration { - id: DeclarationId(2854), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(91), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/cron/schedule_model.dag", 4309, 4329), - }); - declarations.push(Declaration { - id: DeclarationId(2855), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "values".to_string(), - ty: DeclarationId(2854), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/cron/schedule_model.dag", 4292, 4331), - }); - declarations.push(Declaration { - id: DeclarationId(2856), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "start".to_string(), - ty: DeclarationId(91), - }, - Field { - label: "end".to_string(), - ty: DeclarationId(91), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/cron/schedule_model.dag", 4336, 4389), - }); - declarations.push(Declaration { - id: DeclarationId(2857), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "start".to_string(), - ty: DeclarationId(91), - }, - Field { - label: "step".to_string(), - ty: DeclarationId(92), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/cron/schedule_model.dag", 4394, 4443), - }); - declarations.push(Declaration { - id: DeclarationId(2858), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 847, 851), - }); - declarations.push(Declaration { - id: DeclarationId(2859), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 854, 857), - }); - declarations.push(Declaration { - id: DeclarationId(2860), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 860, 872), - }); - declarations.push(Declaration { - id: DeclarationId(2861), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1788), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 1242, 1259), - }); - declarations.push(Declaration { - id: DeclarationId(2862), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(156), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 1274, 1284), - }); - declarations.push(Declaration { - id: DeclarationId(2863), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 1309, 1318), - }); - declarations.push(Declaration { - id: DeclarationId(2864), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 1323, 1332), - }); - declarations.push(Declaration { - id: DeclarationId(2865), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 1337, 1350), - }); - declarations.push(Declaration { - id: DeclarationId(2866), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 1355, 1367), - }); - declarations.push(Declaration { - id: DeclarationId(2867), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 1372, 1385), - }); - declarations.push(Declaration { - id: DeclarationId(2868), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 1554, 1561), - }); - declarations.push(Declaration { - id: DeclarationId(2869), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 1677, 1685), - }); - declarations.push(Declaration { - id: DeclarationId(2870), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 1688, 1697), - }); - declarations.push(Declaration { - id: DeclarationId(2871), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 1700, 1709), - }); - declarations.push(Declaration { - id: DeclarationId(2872), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1799), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 1810, 1831), - }); - declarations.push(Declaration { - id: DeclarationId(2873), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(1808), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 1847, 1863), - }); - declarations.push(Declaration { - id: DeclarationId(2874), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1805), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 1872, 1881), - }); - declarations.push(Declaration { - id: DeclarationId(2875), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 1979, 1998), - }); - declarations.push(Declaration { - id: DeclarationId(2876), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(2875), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 1979, 1999), - }); - declarations.push(Declaration { - id: DeclarationId(2877), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(1797), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2015, 2035), - }); - declarations.push(Declaration { - id: DeclarationId(2878), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2206, 2214), - }); - declarations.push(Declaration { - id: DeclarationId(2879), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2217, 2226), - }); - declarations.push(Declaration { - id: DeclarationId(2880), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2229, 2237), - }); - declarations.push(Declaration { - id: DeclarationId(2881), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2395, 2407), - }); - declarations.push(Declaration { - id: DeclarationId(2882), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2416, 2428), - }); - declarations.push(Declaration { - id: DeclarationId(2883), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "branches".to_string(), - ty: DeclarationId(2881), - }, - Field { - label: "paths".to_string(), - ty: DeclarationId(2882), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2378, 2430), - }); - declarations.push(Declaration { - id: DeclarationId(2884), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2459, 2471), - }); - declarations.push(Declaration { - id: DeclarationId(2885), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1800), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2480, 2505), - }); - declarations.push(Declaration { - id: DeclarationId(2886), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "branches".to_string(), - ty: DeclarationId(2884), - }, - Field { - label: "types".to_string(), - ty: DeclarationId(2885), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2435, 2507), - }); - declarations.push(Declaration { - id: DeclarationId(2887), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "cron".to_string(), - ty: DeclarationId(1779), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2512, 2543), - }); - declarations.push(Declaration { - id: DeclarationId(2888), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1801), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2575, 2594), - }); - declarations.push(Declaration { - id: DeclarationId(2889), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "inputs".to_string(), - ty: DeclarationId(2888), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2548, 2596), - }); - declarations.push(Declaration { - id: DeclarationId(2890), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1801), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2624, 2643), - }); - declarations.push(Declaration { - id: DeclarationId(2891), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "inputs".to_string(), - ty: DeclarationId(2890), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2601, 2645), - }); - declarations.push(Declaration { - id: DeclarationId(2892), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2676, 2682), - }); - declarations.push(Declaration { - id: DeclarationId(2893), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2687, 2698), - }); - declarations.push(Declaration { - id: DeclarationId(2894), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2703, 2711), - }); - declarations.push(Declaration { - id: DeclarationId(2895), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2716, 2730), - }); - declarations.push(Declaration { - id: DeclarationId(2896), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2735, 2741), - }); - declarations.push(Declaration { - id: DeclarationId(2897), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2794, 2801), - }); - declarations.push(Declaration { - id: DeclarationId(2898), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2830, 2837), - }); - declarations.push(Declaration { - id: DeclarationId(2899), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2892, 2903), - }); - declarations.push(Declaration { - id: DeclarationId(2900), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2906, 2918), - }); - declarations.push(Declaration { - id: DeclarationId(2901), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2921, 2932), - }); - declarations.push(Declaration { - id: DeclarationId(2902), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2935, 2951), - }); - declarations.push(Declaration { - id: DeclarationId(2903), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5073, 5082), - }); - declarations.push(Declaration { - id: DeclarationId(2904), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5085, 5093), - }); - declarations.push(Declaration { - id: DeclarationId(2905), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5096, 5109), - }); - declarations.push(Declaration { - id: DeclarationId(2906), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5623, 5630), - }); - declarations.push(Declaration { - id: DeclarationId(2907), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1811), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5661, 5671), - }); - declarations.push(Declaration { - id: DeclarationId(2908), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5681, 5693), - }); - declarations.push(Declaration { - id: DeclarationId(2909), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5781, 5800), - }); - declarations.push(Declaration { - id: DeclarationId(2910), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(2909), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5781, 5801), - }); - declarations.push(Declaration { - id: DeclarationId(2911), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5904, 5923), - }); - declarations.push(Declaration { - id: DeclarationId(2912), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(2911), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5904, 5924), - }); - declarations.push(Declaration { - id: DeclarationId(2913), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5941, 5948), - }); - declarations.push(Declaration { - id: DeclarationId(2914), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(1827), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5961, 5976), - }); - declarations.push(Declaration { - id: DeclarationId(2915), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(87), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5996, 6000), - }); - declarations.push(Declaration { - id: DeclarationId(2916), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(1808), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 6042, 6058), - }); - declarations.push(Declaration { - id: DeclarationId(2917), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "value".to_string(), - ty: DeclarationId(124), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 6908, 6944), - }); - declarations.push(Declaration { - id: DeclarationId(2918), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "expression".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 6949, 6998), - }); - declarations.push(Declaration { - id: DeclarationId(2919), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 7844, 7873), - }); - declarations.push(Declaration { - id: DeclarationId(2920), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "expression".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 7878, 7935), - }); - declarations.push(Declaration { - id: DeclarationId(2921), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "group".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 8513, 8548), - }); - declarations.push(Declaration { - id: DeclarationId(2922), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(1807), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 8707, 8736), - }); - declarations.push(Declaration { - id: DeclarationId(2923), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "group".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "cancel_in_progress".to_string(), - ty: DeclarationId(2922), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 8553, 8742), - }); - declarations.push(Declaration { - id: DeclarationId(2924), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(1806), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 8904, 8925), - }); - declarations.push(Declaration { - id: DeclarationId(2925), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(125), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 9123, 9128), - }); - declarations.push(Declaration { - id: DeclarationId(2926), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "group".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "cancel_in_progress".to_string(), - ty: DeclarationId(2924), - }, - Field { - label: "explicit_single".to_string(), - ty: DeclarationId(2925), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 8747, 9134), - }); - declarations.push(Declaration { - id: DeclarationId(2927), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "label".to_string(), - ty: DeclarationId(1810), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10326, 10361), - }); - declarations.push(Declaration { - id: DeclarationId(2928), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10387, 10399), - }); - declarations.push(Declaration { - id: DeclarationId(2929), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "labels".to_string(), - ty: DeclarationId(2928), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10366, 10401), - }); - declarations.push(Declaration { - id: DeclarationId(2930), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "expression".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10490, 10529), - }); - declarations.push(Declaration { - id: DeclarationId(2931), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10552, 10564), - }); - declarations.push(Declaration { - id: DeclarationId(2932), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10569, 10579), - }); - declarations.push(Declaration { - id: DeclarationId(2933), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10584, 10594), - }); - declarations.push(Declaration { - id: DeclarationId(2934), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10599, 10610), - }); - declarations.push(Declaration { - id: DeclarationId(2935), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10615, 10622), - }); - declarations.push(Declaration { - id: DeclarationId(2936), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10627, 10640), - }); - declarations.push(Declaration { - id: DeclarationId(2937), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10821, 10828), - }); - declarations.push(Declaration { - id: DeclarationId(2938), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10840, 10847), - }); - declarations.push(Declaration { - id: DeclarationId(2939), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10903, 10922), - }); - declarations.push(Declaration { - id: DeclarationId(2940), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(2939), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10903, 10923), - }); - declarations.push(Declaration { - id: DeclarationId(2941), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10950, 10957), - }); - declarations.push(Declaration { - id: DeclarationId(2942), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10979, 10986), - }); - declarations.push(Declaration { - id: DeclarationId(2943), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(87), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11042, 11046), - }); - declarations.push(Declaration { - id: DeclarationId(2944), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(2937), - }, - Field { - label: "id".to_string(), - ty: DeclarationId(2938), - }, - Field { - label: "run".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "shell".to_string(), - ty: DeclarationId(1812), - }, - Field { - label: "env".to_string(), - ty: DeclarationId(2940), - }, - Field { - label: "working_directory".to_string(), - ty: DeclarationId(2941), - }, - Field { - label: "if_condition".to_string(), - ty: DeclarationId(2942), - }, - Field { - label: "continue_on_error".to_string(), - ty: DeclarationId(124), - }, - Field { - label: "timeout_minutes".to_string(), - ty: DeclarationId(2943), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10799, 11052), - }); - declarations.push(Declaration { - id: DeclarationId(2945), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11080, 11087), - }); - declarations.push(Declaration { - id: DeclarationId(2946), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11099, 11106), - }); - declarations.push(Declaration { - id: DeclarationId(2947), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11232, 11251), - }); - declarations.push(Declaration { - id: DeclarationId(2948), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(2947), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11232, 11252), - }); - declarations.push(Declaration { - id: DeclarationId(2949), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11265, 11284), - }); - declarations.push(Declaration { - id: DeclarationId(2950), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(2949), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11265, 11285), - }); - declarations.push(Declaration { - id: DeclarationId(2951), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11307, 11314), - }); - declarations.push(Declaration { - id: DeclarationId(2952), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(87), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11370, 11374), - }); - declarations.push(Declaration { - id: DeclarationId(2953), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(2945), - }, - Field { - label: "id".to_string(), - ty: DeclarationId(2946), - }, - Field { - label: "uses".to_string(), - ty: DeclarationId(1813), - }, - Field { - label: "with".to_string(), - ty: DeclarationId(2948), - }, - Field { - label: "env".to_string(), - ty: DeclarationId(2950), - }, - Field { - label: "if_condition".to_string(), - ty: DeclarationId(2951), - }, - Field { - label: "continue_on_error".to_string(), - ty: DeclarationId(124), - }, - Field { - label: "timeout_minutes".to_string(), - ty: DeclarationId(2952), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11057, 11380), - }); - declarations.push(Declaration { - id: DeclarationId(2954), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11399, 11403), - }); - declarations.push(Declaration { - id: DeclarationId(2955), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11406, 11408), - }); - declarations.push(Declaration { - id: DeclarationId(2956), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11411, 11415), - }); - declarations.push(Declaration { - id: DeclarationId(2957), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11418, 11424), - }); - declarations.push(Declaration { - id: DeclarationId(2958), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11427, 11430), - }); - declarations.push(Declaration { - id: DeclarationId(2959), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11793, 11800), - }); - declarations.push(Declaration { - id: DeclarationId(2960), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(87), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11808, 11812), - }); - declarations.push(Declaration { - id: DeclarationId(2961), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(87), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11819, 11823), - }); - declarations.push(Declaration { - id: DeclarationId(2962), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "message".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "file".to_string(), - ty: DeclarationId(2959), - }, - Field { - label: "line".to_string(), - ty: DeclarationId(2960), - }, - Field { - label: "col".to_string(), - ty: DeclarationId(2961), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11752, 11825), - }); - declarations.push(Declaration { - id: DeclarationId(2963), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11873, 11880), - }); - declarations.push(Declaration { - id: DeclarationId(2964), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(87), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11888, 11892), - }); - declarations.push(Declaration { - id: DeclarationId(2965), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(87), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11899, 11903), - }); - declarations.push(Declaration { - id: DeclarationId(2966), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "message".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "file".to_string(), - ty: DeclarationId(2963), - }, - Field { - label: "line".to_string(), - ty: DeclarationId(2964), - }, - Field { - label: "col".to_string(), - ty: DeclarationId(2965), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11830, 11905), - }); - declarations.push(Declaration { - id: DeclarationId(2967), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11952, 11959), - }); - declarations.push(Declaration { - id: DeclarationId(2968), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(87), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11967, 11971), - }); - declarations.push(Declaration { - id: DeclarationId(2969), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(87), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11978, 11982), - }); - declarations.push(Declaration { - id: DeclarationId(2970), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "message".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "file".to_string(), - ty: DeclarationId(2967), - }, - Field { - label: "line".to_string(), - ty: DeclarationId(2968), - }, - Field { - label: "col".to_string(), - ty: DeclarationId(2969), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11910, 11984), - }); - declarations.push(Declaration { - id: DeclarationId(2971), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "title".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11989, 12022), - }); - declarations.push(Declaration { - id: DeclarationId(2972), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 12027, 12045), - }); - declarations.push(Declaration { - id: DeclarationId(2973), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "value".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 12050, 12091), - }); - declarations.push(Declaration { - id: DeclarationId(2974), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "value".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 12096, 12121), - }); - declarations.push(Declaration { - id: DeclarationId(2975), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "token".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 12126, 12156), - }); - declarations.push(Declaration { - id: DeclarationId(2976), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(87), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 12962, 12966), - }); - declarations.push(Declaration { - id: DeclarationId(2977), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "path".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "retention_days".to_string(), - ty: DeclarationId(2976), - }, - Field { - label: "if_no_files_found".to_string(), - ty: DeclarationId(1824), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 12909, 13009), - }); - declarations.push(Declaration { - id: DeclarationId(2978), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13045, 13052), - }); - declarations.push(Declaration { - id: DeclarationId(2979), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "path".to_string(), - ty: DeclarationId(2978), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13014, 13054), - }); - declarations.push(Declaration { - id: DeclarationId(2980), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13084, 13088), - }); - declarations.push(Declaration { - id: DeclarationId(2981), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13091, 13099), - }); - declarations.push(Declaration { - id: DeclarationId(2982), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13102, 13108), - }); - declarations.push(Declaration { - id: DeclarationId(2983), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13570, 13582), - }); - declarations.push(Declaration { - id: DeclarationId(2984), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(2983), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13558, 13583), - }); - declarations.push(Declaration { - id: DeclarationId(2985), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13600, 13619), - }); - declarations.push(Declaration { - id: DeclarationId(2986), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(2985), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13595, 13620), - }); - declarations.push(Declaration { - id: DeclarationId(2987), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13637, 13656), - }); - declarations.push(Declaration { - id: DeclarationId(2988), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(2987), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13632, 13657), - }); - declarations.push(Declaration { - id: DeclarationId(2989), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(87), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13692, 13696), - }); - declarations.push(Declaration { - id: DeclarationId(2990), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13852, 13859), - }); - declarations.push(Declaration { - id: DeclarationId(2991), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13864, 13871), - }); - declarations.push(Declaration { - id: DeclarationId(2992), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13876, 13885), - }); - declarations.push(Declaration { - id: DeclarationId(2993), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13890, 13897), - }); - declarations.push(Declaration { - id: DeclarationId(2994), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13902, 13910), - }); - declarations.push(Declaration { - id: DeclarationId(2995), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13915, 13929), - }); - declarations.push(Declaration { - id: DeclarationId(2996), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/ci.dag", 1935, 1959), - }); - declarations.push(Declaration { - id: DeclarationId(2997), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/ci.dag", 1964, 1989), - }); - declarations.push(Declaration { - id: DeclarationId(2998), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(147)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(1030))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/ci.dag", 2673, 2714), - }); - declarations.push(Declaration { - id: DeclarationId(2999), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(48), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17832, 17834), - }); - declarations.push(Declaration { - id: DeclarationId(3000), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17832, 17834), - }); - declarations.push(Declaration { - id: DeclarationId(3001), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2999), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3000), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17832, 17834), - }); - declarations.push(Declaration { - id: DeclarationId(3002), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(48), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17851, 17853), - }); - declarations.push(Declaration { - id: DeclarationId(3003), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17851, 17853), - }); - declarations.push(Declaration { - id: DeclarationId(3004), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3002), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3003), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17851, 17853), - }); - declarations.push(Declaration { - id: DeclarationId(3005), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(51), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19069, 19071), - }); - declarations.push(Declaration { - id: DeclarationId(3006), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19069, 19071), - }); - declarations.push(Declaration { - id: DeclarationId(3007), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3005), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3006), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19069, 19071), - }); - declarations.push(Declaration { - id: DeclarationId(3008), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(56), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23611, 23632), - }); - declarations.push(Declaration { - id: DeclarationId(3009), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23611, 23632), - }); - declarations.push(Declaration { - id: DeclarationId(3010), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3008), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3009), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23611, 23632), - }); - declarations.push(Declaration { - id: DeclarationId(3011), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(57), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23647, 23657), - }); - declarations.push(Declaration { - id: DeclarationId(3012), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23647, 23657), - }); - declarations.push(Declaration { - id: DeclarationId(3013), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3011), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3012), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23647, 23657), - }); - declarations.push(Declaration { - id: DeclarationId(3014), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23902, 23906), - }); - declarations.push(Declaration { - id: DeclarationId(3015), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23902, 23906), - }); - declarations.push(Declaration { - id: DeclarationId(3016), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3014), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3015), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23902, 23906), - }); - declarations.push(Declaration { - id: DeclarationId(3017), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 3805, 3809), - }); - declarations.push(Declaration { - id: DeclarationId(3018), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 3805, 3809), - }); - declarations.push(Declaration { - id: DeclarationId(3019), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3017), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3018), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 3805, 3809), - }); - declarations.push(Declaration { - id: DeclarationId(3020), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 4356, 4363), - }); - declarations.push(Declaration { - id: DeclarationId(3021), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 4356, 4363), - }); - declarations.push(Declaration { - id: DeclarationId(3022), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3020), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3021), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 4356, 4363), - }); - declarations.push(Declaration { - id: DeclarationId(3023), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 6656, 6663), - }); - declarations.push(Declaration { - id: DeclarationId(3024), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 6656, 6663), - }); - declarations.push(Declaration { - id: DeclarationId(3025), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3023), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3024), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 6656, 6663), - }); - declarations.push(Declaration { - id: DeclarationId(3026), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 6771, 6778), - }); - declarations.push(Declaration { - id: DeclarationId(3027), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 6771, 6778), - }); - declarations.push(Declaration { - id: DeclarationId(3028), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3026), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3027), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 6771, 6778), - }); - declarations.push(Declaration { - id: DeclarationId(3029), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(177), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17906, 17926), - }); - declarations.push(Declaration { - id: DeclarationId(3030), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17906, 17926), - }); - declarations.push(Declaration { - id: DeclarationId(3031), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3029), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3030), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17906, 17926), - }); - declarations.push(Declaration { - id: DeclarationId(3032), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(186), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18562, 18569), - }); - declarations.push(Declaration { - id: DeclarationId(3033), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18562, 18569), - }); - declarations.push(Declaration { - id: DeclarationId(3034), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3032), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3033), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18562, 18569), - }); - declarations.push(Declaration { - id: DeclarationId(3035), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(156), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22322, 22332), - }); - declarations.push(Declaration { - id: DeclarationId(3036), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22322, 22332), - }); - declarations.push(Declaration { - id: DeclarationId(3037), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3035), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3036), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22322, 22332), - }); - declarations.push(Declaration { - id: DeclarationId(3038), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22457, 22464), - }); - declarations.push(Declaration { - id: DeclarationId(3039), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22457, 22464), - }); - declarations.push(Declaration { - id: DeclarationId(3040), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3038), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3039), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22457, 22464), - }); - declarations.push(Declaration { - id: DeclarationId(3041), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22531, 22535), - }); - declarations.push(Declaration { - id: DeclarationId(3042), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22531, 22535), - }); - declarations.push(Declaration { - id: DeclarationId(3043), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3041), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3042), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22531, 22535), - }); - declarations.push(Declaration { - id: DeclarationId(3044), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24302, 24309), - }); - declarations.push(Declaration { - id: DeclarationId(3045), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24302, 24309), - }); - declarations.push(Declaration { - id: DeclarationId(3046), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3044), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3045), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24302, 24309), - }); - declarations.push(Declaration { - id: DeclarationId(3047), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24814, 24821), - }); - declarations.push(Declaration { - id: DeclarationId(3048), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24814, 24821), - }); - declarations.push(Declaration { - id: DeclarationId(3049), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3047), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3048), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24814, 24821), - }); - declarations.push(Declaration { - id: DeclarationId(3050), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24908, 24915), - }); - declarations.push(Declaration { - id: DeclarationId(3051), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24908, 24915), - }); - declarations.push(Declaration { - id: DeclarationId(3052), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3050), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3051), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24908, 24915), - }); - declarations.push(Declaration { - id: DeclarationId(3053), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(222), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25138, 25153), - }); - declarations.push(Declaration { - id: DeclarationId(3054), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25138, 25153), - }); - declarations.push(Declaration { - id: DeclarationId(3055), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3053), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3054), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25138, 25153), - }); - declarations.push(Declaration { - id: DeclarationId(3056), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(188), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25164, 25177), - }); - declarations.push(Declaration { - id: DeclarationId(3057), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25164, 25177), - }); - declarations.push(Declaration { - id: DeclarationId(3058), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3056), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3057), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25164, 25177), - }); - declarations.push(Declaration { - id: DeclarationId(3059), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(187), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25193, 25206), - }); - declarations.push(Declaration { - id: DeclarationId(3060), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25193, 25206), - }); - declarations.push(Declaration { - id: DeclarationId(3061), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3059), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3060), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25193, 25206), - }); - declarations.push(Declaration { - id: DeclarationId(3062), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25316, 25323), - }); - declarations.push(Declaration { - id: DeclarationId(3063), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25316, 25323), - }); - declarations.push(Declaration { - id: DeclarationId(3064), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3062), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3063), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25316, 25323), - }); - declarations.push(Declaration { - id: DeclarationId(3065), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 11898, 11905), - }); - declarations.push(Declaration { - id: DeclarationId(3066), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 11898, 11905), - }); - declarations.push(Declaration { - id: DeclarationId(3067), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3065), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3066), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 11898, 11905), - }); - declarations.push(Declaration { - id: DeclarationId(3068), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 24553, 24560), - }); - declarations.push(Declaration { - id: DeclarationId(3069), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 24553, 24560), - }); - declarations.push(Declaration { - id: DeclarationId(3070), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3068), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3069), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 24553, 24560), - }); - declarations.push(Declaration { - id: DeclarationId(3071), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1879), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 24887, 24909), - }); - declarations.push(Declaration { - id: DeclarationId(3072), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 24887, 24909), - }); - declarations.push(Declaration { - id: DeclarationId(3073), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3071), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3072), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 24887, 24909), - }); - declarations.push(Declaration { - id: DeclarationId(3074), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1882), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 25055, 25077), - }); - declarations.push(Declaration { - id: DeclarationId(3075), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 25055, 25077), - }); - declarations.push(Declaration { - id: DeclarationId(3076), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3074), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3075), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 25055, 25077), - }); - declarations.push(Declaration { - id: DeclarationId(3077), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(792), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 22398, 22406), - }); - declarations.push(Declaration { - id: DeclarationId(3078), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 22398, 22406), - }); - declarations.push(Declaration { - id: DeclarationId(3079), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3077), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3078), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 22398, 22406), - }); - declarations.push(Declaration { - id: DeclarationId(3080), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(838), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 22455, 22464), - }); - declarations.push(Declaration { - id: DeclarationId(3081), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 22455, 22464), - }); - declarations.push(Declaration { - id: DeclarationId(3082), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3080), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3081), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 22455, 22464), - }); - declarations.push(Declaration { - id: DeclarationId(3083), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(838), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 22530, 22539), - }); - declarations.push(Declaration { - id: DeclarationId(3084), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 22530, 22539), - }); - declarations.push(Declaration { - id: DeclarationId(3085), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3083), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3084), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 22530, 22539), - }); - declarations.push(Declaration { - id: DeclarationId(3086), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(810), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 22916, 22928), - }); - declarations.push(Declaration { - id: DeclarationId(3087), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 22916, 22928), - }); - declarations.push(Declaration { - id: DeclarationId(3088), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3086), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3087), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 22916, 22928), - }); - declarations.push(Declaration { - id: DeclarationId(3089), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(810), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 23791, 23803), - }); - declarations.push(Declaration { - id: DeclarationId(3090), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 23791, 23803), - }); - declarations.push(Declaration { - id: DeclarationId(3091), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3089), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3090), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 23791, 23803), - }); - declarations.push(Declaration { - id: DeclarationId(3092), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(777), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 24114, 24129), - }); - declarations.push(Declaration { - id: DeclarationId(3093), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 24114, 24129), - }); - declarations.push(Declaration { - id: DeclarationId(3094), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3092), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3093), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 24114, 24129), - }); - declarations.push(Declaration { - id: DeclarationId(3095), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(735), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 867, 874), - }); - declarations.push(Declaration { - id: DeclarationId(3096), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 867, 874), - }); - declarations.push(Declaration { - id: DeclarationId(3097), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3095), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3096), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 867, 874), - }); - declarations.push(Declaration { - id: DeclarationId(3098), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 11910, 11917), - }); - declarations.push(Declaration { - id: DeclarationId(3099), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 11910, 11917), - }); - declarations.push(Declaration { - id: DeclarationId(3100), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3098), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3099), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 11910, 11917), - }); - declarations.push(Declaration { - id: DeclarationId(3101), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(737), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 12035, 12049), - }); - declarations.push(Declaration { - id: DeclarationId(3102), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 12035, 12049), - }); - declarations.push(Declaration { - id: DeclarationId(3103), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3101), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3102), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 12035, 12049), - }); - declarations.push(Declaration { - id: DeclarationId(3104), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(737), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 12062, 12076), - }); - declarations.push(Declaration { - id: DeclarationId(3105), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 12062, 12076), - }); - declarations.push(Declaration { - id: DeclarationId(3106), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3104), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3105), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 12062, 12076), - }); - declarations.push(Declaration { - id: DeclarationId(3107), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(806), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 12091, 12101), - }); - declarations.push(Declaration { - id: DeclarationId(3108), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 12091, 12101), - }); - declarations.push(Declaration { - id: DeclarationId(3109), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3107), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3108), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 12091, 12101), - }); - declarations.push(Declaration { - id: DeclarationId(3110), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(812), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 12121, 12136), - }); - declarations.push(Declaration { - id: DeclarationId(3111), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 12121, 12136), - }); - declarations.push(Declaration { - id: DeclarationId(3112), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3110), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3111), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 12121, 12136), - }); - declarations.push(Declaration { - id: DeclarationId(3113), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(820), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 15579, 15594), - }); - declarations.push(Declaration { - id: DeclarationId(3114), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 15579, 15594), - }); - declarations.push(Declaration { - id: DeclarationId(3115), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3113), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3114), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 15579, 15594), - }); - declarations.push(Declaration { - id: DeclarationId(3116), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(777), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 18628, 18643), - }); - declarations.push(Declaration { - id: DeclarationId(3117), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 18628, 18643), - }); - declarations.push(Declaration { - id: DeclarationId(3118), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3116), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3117), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 18628, 18643), - }); - declarations.push(Declaration { - id: DeclarationId(3119), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(833), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19117, 19141), - }); - declarations.push(Declaration { - id: DeclarationId(3120), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19117, 19141), - }); - declarations.push(Declaration { - id: DeclarationId(3121), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3119), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3120), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19117, 19141), - }); - declarations.push(Declaration { - id: DeclarationId(3122), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(777), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19695, 19710), - }); - declarations.push(Declaration { - id: DeclarationId(3123), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19695, 19710), - }); - declarations.push(Declaration { - id: DeclarationId(3124), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3122), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3123), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19695, 19710), - }); - declarations.push(Declaration { - id: DeclarationId(3125), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(836), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19733, 19755), - }); - declarations.push(Declaration { - id: DeclarationId(3126), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19733, 19755), - }); - declarations.push(Declaration { - id: DeclarationId(3127), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3125), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3126), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19733, 19755), - }); - declarations.push(Declaration { - id: DeclarationId(3128), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(856), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 5742, 5779), - }); - declarations.push(Declaration { - id: DeclarationId(3129), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 5742, 5779), - }); - declarations.push(Declaration { - id: DeclarationId(3130), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3128), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3129), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 5742, 5779), - }); - declarations.push(Declaration { - id: DeclarationId(3131), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(855), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 5801, 5814), - }); - declarations.push(Declaration { - id: DeclarationId(3132), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 5801, 5814), - }); - declarations.push(Declaration { - id: DeclarationId(3133), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3131), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3132), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 5801, 5814), - }); - declarations.push(Declaration { - id: DeclarationId(3134), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(857), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 6486, 6513), - }); - declarations.push(Declaration { - id: DeclarationId(3135), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 6486, 6513), - }); - declarations.push(Declaration { - id: DeclarationId(3136), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3134), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3135), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 6486, 6513), - }); - declarations.push(Declaration { - id: DeclarationId(3137), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(124), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 6530, 6535), - }); - declarations.push(Declaration { - id: DeclarationId(3138), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 6530, 6535), - }); - declarations.push(Declaration { - id: DeclarationId(3139), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3137), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3138), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 6530, 6535), - }); - declarations.push(Declaration { - id: DeclarationId(3140), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 7891, 7898), - }); - declarations.push(Declaration { - id: DeclarationId(3141), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 7891, 7898), - }); - declarations.push(Declaration { - id: DeclarationId(3142), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3140), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3141), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 7891, 7898), - }); - declarations.push(Declaration { - id: DeclarationId(3143), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 7909, 7916), - }); - declarations.push(Declaration { - id: DeclarationId(3144), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 7909, 7916), - }); - declarations.push(Declaration { - id: DeclarationId(3145), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3143), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3144), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 7909, 7916), - }); - declarations.push(Declaration { - id: DeclarationId(3146), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8039, 8046), - }); - declarations.push(Declaration { - id: DeclarationId(3147), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8039, 8046), - }); - declarations.push(Declaration { - id: DeclarationId(3148), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3146), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3147), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8039, 8046), - }); - declarations.push(Declaration { - id: DeclarationId(3149), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8057, 8064), - }); - declarations.push(Declaration { - id: DeclarationId(3150), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8057, 8064), - }); - declarations.push(Declaration { - id: DeclarationId(3151), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3149), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3150), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8057, 8064), - }); - declarations.push(Declaration { - id: DeclarationId(3152), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8197, 8204), - }); - declarations.push(Declaration { - id: DeclarationId(3153), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8197, 8204), - }); - declarations.push(Declaration { - id: DeclarationId(3154), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3152), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3153), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8197, 8204), - }); - declarations.push(Declaration { - id: DeclarationId(3155), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8215, 8222), - }); - declarations.push(Declaration { - id: DeclarationId(3156), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8215, 8222), - }); - declarations.push(Declaration { - id: DeclarationId(3157), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3155), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3156), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8215, 8222), - }); - declarations.push(Declaration { - id: DeclarationId(3158), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8353, 8360), - }); - declarations.push(Declaration { - id: DeclarationId(3159), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8353, 8360), - }); - declarations.push(Declaration { - id: DeclarationId(3160), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3158), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3159), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8353, 8360), - }); - declarations.push(Declaration { - id: DeclarationId(3161), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8446, 8453), - }); - declarations.push(Declaration { - id: DeclarationId(3162), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8446, 8453), - }); - declarations.push(Declaration { - id: DeclarationId(3163), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3161), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3162), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8446, 8453), - }); - declarations.push(Declaration { - id: DeclarationId(3164), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(2100), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9151, 9186), - }); - declarations.push(Declaration { - id: DeclarationId(3165), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9151, 9186), - }); - declarations.push(Declaration { - id: DeclarationId(3166), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3164), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3165), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9151, 9186), - }); - declarations.push(Declaration { - id: DeclarationId(3167), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(126), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9389, 9394), - }); - declarations.push(Declaration { - id: DeclarationId(3168), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9389, 9394), - }); - declarations.push(Declaration { - id: DeclarationId(3169), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3167), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3168), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9389, 9394), - }); - declarations.push(Declaration { - id: DeclarationId(3170), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(126), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9494, 9499), - }); - declarations.push(Declaration { - id: DeclarationId(3171), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9494, 9499), - }); - declarations.push(Declaration { - id: DeclarationId(3172), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3170), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3171), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9494, 9499), - }); - declarations.push(Declaration { - id: DeclarationId(3173), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(126), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9585, 9590), - }); - declarations.push(Declaration { - id: DeclarationId(3174), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9585, 9590), - }); - declarations.push(Declaration { - id: DeclarationId(3175), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3173), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3174), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9585, 9590), - }); - declarations.push(Declaration { - id: DeclarationId(3176), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 10523, 10527), - }); - declarations.push(Declaration { - id: DeclarationId(3177), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 10523, 10527), - }); - declarations.push(Declaration { - id: DeclarationId(3178), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3176), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3177), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 10523, 10527), - }); - declarations.push(Declaration { - id: DeclarationId(3179), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 10559, 10563), - }); - declarations.push(Declaration { - id: DeclarationId(3180), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 10559, 10563), - }); - declarations.push(Declaration { - id: DeclarationId(3181), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3179), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3180), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 10559, 10563), - }); - declarations.push(Declaration { - id: DeclarationId(3182), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(869), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 10595, 10627), - }); - declarations.push(Declaration { - id: DeclarationId(3183), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 10595, 10627), - }); - declarations.push(Declaration { - id: DeclarationId(3184), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3182), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3183), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 10595, 10627), - }); - declarations.push(Declaration { - id: DeclarationId(3185), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 11596, 11603), - }); - declarations.push(Declaration { - id: DeclarationId(3186), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 11596, 11603), - }); - declarations.push(Declaration { - id: DeclarationId(3187), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3185), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3186), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 11596, 11603), - }); - declarations.push(Declaration { - id: DeclarationId(3188), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(126), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 11664, 11669), - }); - declarations.push(Declaration { - id: DeclarationId(3189), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 11664, 11669), - }); - declarations.push(Declaration { - id: DeclarationId(3190), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3188), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3189), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 11664, 11669), - }); - declarations.push(Declaration { - id: DeclarationId(3191), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(109), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_messages.dag", 4566, 4572), - }); - declarations.push(Declaration { - id: DeclarationId(3192), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_messages.dag", 4566, 4572), - }); - declarations.push(Declaration { - id: DeclarationId(3193), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3191), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3192), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_messages.dag", 4566, 4572), - }); - declarations.push(Declaration { - id: DeclarationId(3194), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_messages.dag", 4589, 4596), - }); - declarations.push(Declaration { - id: DeclarationId(3195), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_messages.dag", 4589, 4596), - }); - declarations.push(Declaration { - id: DeclarationId(3196), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3194), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3195), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_messages.dag", 4589, 4596), - }); - declarations.push(Declaration { - id: DeclarationId(3197), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(907), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lookup.dag", 1444, 1450), - }); - declarations.push(Declaration { - id: DeclarationId(3198), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lookup.dag", 1444, 1450), - }); - declarations.push(Declaration { - id: DeclarationId(3199), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3197), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3198), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lookup.dag", 1444, 1450), - }); - declarations.push(Declaration { - id: DeclarationId(3200), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(912), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 6780, 6801), - }); - declarations.push(Declaration { - id: DeclarationId(3201), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 6780, 6801), - }); - declarations.push(Declaration { - id: DeclarationId(3202), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3200), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3201), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 6780, 6801), - }); - declarations.push(Declaration { - id: DeclarationId(3203), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(913), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 6816, 6826), - }); - declarations.push(Declaration { - id: DeclarationId(3204), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 6816, 6826), - }); - declarations.push(Declaration { - id: DeclarationId(3205), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3203), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3204), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 6816, 6826), - }); - declarations.push(Declaration { - id: DeclarationId(3206), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 6856, 6860), - }); - declarations.push(Declaration { - id: DeclarationId(3207), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 6856, 6860), - }); - declarations.push(Declaration { - id: DeclarationId(3208), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3206), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3207), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 6856, 6860), - }); - declarations.push(Declaration { - id: DeclarationId(3209), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 7429, 7436), - }); - declarations.push(Declaration { - id: DeclarationId(3210), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 7429, 7436), - }); - declarations.push(Declaration { - id: DeclarationId(3211), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3209), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3210), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 7429, 7436), - }); - declarations.push(Declaration { - id: DeclarationId(3212), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(970), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 2751, 2763), - }); - declarations.push(Declaration { - id: DeclarationId(3213), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 2751, 2763), - }); - declarations.push(Declaration { - id: DeclarationId(3214), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3212), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3213), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 2751, 2763), - }); - declarations.push(Declaration { - id: DeclarationId(3215), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(736), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 2961, 2968), - }); - declarations.push(Declaration { - id: DeclarationId(3216), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 2961, 2968), - }); - declarations.push(Declaration { - id: DeclarationId(3217), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3215), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3216), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 2961, 2968), - }); - declarations.push(Declaration { - id: DeclarationId(3218), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 5779, 5786), - }); - declarations.push(Declaration { - id: DeclarationId(3219), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 5779, 5786), - }); - declarations.push(Declaration { - id: DeclarationId(3220), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3218), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3219), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 5779, 5786), - }); - declarations.push(Declaration { - id: DeclarationId(3221), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 6710, 6714), - }); - declarations.push(Declaration { - id: DeclarationId(3222), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 6710, 6714), - }); - declarations.push(Declaration { - id: DeclarationId(3223), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3221), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3222), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 6710, 6714), - }); - declarations.push(Declaration { - id: DeclarationId(3224), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(981), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 7761, 7780), - }); - declarations.push(Declaration { - id: DeclarationId(3225), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 7761, 7780), - }); - declarations.push(Declaration { - id: DeclarationId(3226), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3224), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3225), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 7761, 7780), - }); - declarations.push(Declaration { - id: DeclarationId(3227), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(981), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 8326, 8345), - }); - declarations.push(Declaration { - id: DeclarationId(3228), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 8326, 8345), - }); - declarations.push(Declaration { - id: DeclarationId(3229), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3227), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3228), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 8326, 8345), - }); - declarations.push(Declaration { - id: DeclarationId(3230), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(973), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 3859, 3872), - }); - declarations.push(Declaration { - id: DeclarationId(3231), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 3859, 3872), - }); - declarations.push(Declaration { - id: DeclarationId(3232), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3230), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3231), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 3859, 3872), - }); - declarations.push(Declaration { - id: DeclarationId(3233), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1129), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 1267, 1279), - }); - declarations.push(Declaration { - id: DeclarationId(3234), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 1267, 1279), - }); - declarations.push(Declaration { - id: DeclarationId(3235), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3233), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3234), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 1267, 1279), - }); - declarations.push(Declaration { - id: DeclarationId(3236), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1122), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 10053, 10065), - }); - declarations.push(Declaration { - id: DeclarationId(3237), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 10053, 10065), - }); - declarations.push(Declaration { - id: DeclarationId(3238), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3236), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3237), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 10053, 10065), - }); - declarations.push(Declaration { - id: DeclarationId(3239), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1129), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 10530, 10542), - }); - declarations.push(Declaration { - id: DeclarationId(3240), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 10530, 10542), - }); - declarations.push(Declaration { - id: DeclarationId(3241), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3239), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3240), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 10530, 10542), - }); - declarations.push(Declaration { - id: DeclarationId(3242), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1122), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 11088, 11100), - }); - declarations.push(Declaration { - id: DeclarationId(3243), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 11088, 11100), - }); - declarations.push(Declaration { - id: DeclarationId(3244), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3242), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3243), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 11088, 11100), - }); - declarations.push(Declaration { - id: DeclarationId(3245), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1129), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 11268, 11280), - }); - declarations.push(Declaration { - id: DeclarationId(3246), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 11268, 11280), - }); - declarations.push(Declaration { - id: DeclarationId(3247), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3245), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3246), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/parse_surface.dag", 11268, 11280), - }); - declarations.push(Declaration { - id: DeclarationId(3248), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1157), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 2429, 2445), - }); - declarations.push(Declaration { - id: DeclarationId(3249), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 2429, 2445), - }); - declarations.push(Declaration { - id: DeclarationId(3250), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3248), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3249), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 2429, 2445), - }); - declarations.push(Declaration { - id: DeclarationId(3251), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1157), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 2450, 2466), - }); - declarations.push(Declaration { - id: DeclarationId(3252), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 2450, 2466), - }); - declarations.push(Declaration { - id: DeclarationId(3253), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3251), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3252), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 2450, 2466), - }); - declarations.push(Declaration { - id: DeclarationId(3254), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1157), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 2471, 2487), - }); - declarations.push(Declaration { - id: DeclarationId(3255), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 2471, 2487), - }); - declarations.push(Declaration { - id: DeclarationId(3256), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3254), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3255), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 2471, 2487), - }); - declarations.push(Declaration { - id: DeclarationId(3257), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1165), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 6397, 6419), - }); - declarations.push(Declaration { - id: DeclarationId(3258), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 6397, 6419), - }); - declarations.push(Declaration { - id: DeclarationId(3259), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3257), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3258), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 6397, 6419), - }); - declarations.push(Declaration { - id: DeclarationId(3260), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1167), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 6839, 6859), - }); - declarations.push(Declaration { - id: DeclarationId(3261), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 6839, 6859), - }); - declarations.push(Declaration { - id: DeclarationId(3262), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3260), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3261), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 6839, 6859), - }); - declarations.push(Declaration { - id: DeclarationId(3263), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(970), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 21954, 21966), - }); - declarations.push(Declaration { - id: DeclarationId(3264), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 21954, 21966), - }); - declarations.push(Declaration { - id: DeclarationId(3265), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3263), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3264), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 21954, 21966), - }); - declarations.push(Declaration { - id: DeclarationId(3266), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(975), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 23501, 23516), - }); - declarations.push(Declaration { - id: DeclarationId(3267), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 23501, 23516), - }); - declarations.push(Declaration { - id: DeclarationId(3268), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3266), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3267), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 23501, 23516), - }); - declarations.push(Declaration { - id: DeclarationId(3269), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 35581, 35585), - }); - declarations.push(Declaration { - id: DeclarationId(3270), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 35581, 35585), - }); - declarations.push(Declaration { - id: DeclarationId(3271), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3269), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3270), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 35581, 35585), - }); - declarations.push(Declaration { - id: DeclarationId(3272), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 35877, 35881), - }); - declarations.push(Declaration { - id: DeclarationId(3273), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 35877, 35881), - }); - declarations.push(Declaration { - id: DeclarationId(3274), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3272), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3273), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 35877, 35881), - }); - declarations.push(Declaration { - id: DeclarationId(3275), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 37126, 37130), - }); - declarations.push(Declaration { - id: DeclarationId(3276), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 37126, 37130), - }); - declarations.push(Declaration { - id: DeclarationId(3277), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3275), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3276), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 37126, 37130), - }); - declarations.push(Declaration { - id: DeclarationId(3278), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 37601, 37605), - }); - declarations.push(Declaration { - id: DeclarationId(3279), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 37601, 37605), - }); - declarations.push(Declaration { - id: DeclarationId(3280), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3278), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3279), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 37601, 37605), - }); - declarations.push(Declaration { - id: DeclarationId(3281), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 38864, 38868), - }); - declarations.push(Declaration { - id: DeclarationId(3282), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 38864, 38868), - }); - declarations.push(Declaration { - id: DeclarationId(3283), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3281), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3282), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 38864, 38868), - }); - declarations.push(Declaration { - id: DeclarationId(3284), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 39136, 39140), - }); - declarations.push(Declaration { - id: DeclarationId(3285), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 39136, 39140), - }); - declarations.push(Declaration { - id: DeclarationId(3286), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3284), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3285), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 39136, 39140), - }); - declarations.push(Declaration { - id: DeclarationId(3287), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(817), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/operators.dag", 142, 155), - }); - declarations.push(Declaration { - id: DeclarationId(3288), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/operators.dag", 142, 155), - }); - declarations.push(Declaration { - id: DeclarationId(3289), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3287), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3288), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/operators.dag", 142, 155), - }); - declarations.push(Declaration { - id: DeclarationId(3290), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(156), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 1274, 1284), - }); - declarations.push(Declaration { - id: DeclarationId(3291), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 1274, 1284), - }); - declarations.push(Declaration { - id: DeclarationId(3292), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3290), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3291), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 1274, 1284), - }); - declarations.push(Declaration { - id: DeclarationId(3293), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 1554, 1561), - }); - declarations.push(Declaration { - id: DeclarationId(3294), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 1554, 1561), - }); - declarations.push(Declaration { - id: DeclarationId(3295), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3293), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3294), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 1554, 1561), - }); - declarations.push(Declaration { - id: DeclarationId(3296), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1808), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 1847, 1863), - }); - declarations.push(Declaration { - id: DeclarationId(3297), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 1847, 1863), - }); - declarations.push(Declaration { - id: DeclarationId(3298), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3296), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3297), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 1847, 1863), - }); - declarations.push(Declaration { - id: DeclarationId(3299), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(2875), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 1979, 1999), - }); - declarations.push(Declaration { - id: DeclarationId(3300), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 1979, 1999), - }); - declarations.push(Declaration { - id: DeclarationId(3301), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3299), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3300), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 1979, 1999), - }); - declarations.push(Declaration { - id: DeclarationId(3302), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1797), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2015, 2035), - }); - declarations.push(Declaration { - id: DeclarationId(3303), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2015, 2035), - }); - declarations.push(Declaration { - id: DeclarationId(3304), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3302), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3303), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2015, 2035), - }); - declarations.push(Declaration { - id: DeclarationId(3305), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2794, 2801), - }); - declarations.push(Declaration { - id: DeclarationId(3306), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2794, 2801), - }); - declarations.push(Declaration { - id: DeclarationId(3307), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3305), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3306), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2794, 2801), - }); - declarations.push(Declaration { - id: DeclarationId(3308), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2830, 2837), - }); - declarations.push(Declaration { - id: DeclarationId(3309), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2830, 2837), - }); - declarations.push(Declaration { - id: DeclarationId(3310), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3308), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3309), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2830, 2837), - }); - declarations.push(Declaration { - id: DeclarationId(3311), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5623, 5630), - }); - declarations.push(Declaration { - id: DeclarationId(3312), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5623, 5630), - }); - declarations.push(Declaration { - id: DeclarationId(3313), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3311), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3312), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5623, 5630), - }); - declarations.push(Declaration { - id: DeclarationId(3314), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(2909), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5781, 5801), - }); - declarations.push(Declaration { - id: DeclarationId(3315), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5781, 5801), - }); - declarations.push(Declaration { - id: DeclarationId(3316), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3314), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3315), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5781, 5801), - }); - declarations.push(Declaration { - id: DeclarationId(3317), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(2911), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5904, 5924), - }); - declarations.push(Declaration { - id: DeclarationId(3318), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5904, 5924), - }); - declarations.push(Declaration { - id: DeclarationId(3319), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3317), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3318), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5904, 5924), - }); - declarations.push(Declaration { - id: DeclarationId(3320), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5941, 5948), - }); - declarations.push(Declaration { - id: DeclarationId(3321), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5941, 5948), - }); - declarations.push(Declaration { - id: DeclarationId(3322), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3320), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3321), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5941, 5948), - }); - declarations.push(Declaration { - id: DeclarationId(3323), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1827), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5961, 5976), - }); - declarations.push(Declaration { - id: DeclarationId(3324), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5961, 5976), - }); - declarations.push(Declaration { - id: DeclarationId(3325), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3323), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3324), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5961, 5976), - }); - declarations.push(Declaration { - id: DeclarationId(3326), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5996, 6000), - }); - declarations.push(Declaration { - id: DeclarationId(3327), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5996, 6000), - }); - declarations.push(Declaration { - id: DeclarationId(3328), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3326), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3327), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5996, 6000), - }); - declarations.push(Declaration { - id: DeclarationId(3329), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1808), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 6042, 6058), - }); - declarations.push(Declaration { - id: DeclarationId(3330), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 6042, 6058), - }); - declarations.push(Declaration { - id: DeclarationId(3331), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3329), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3330), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 6042, 6058), - }); - declarations.push(Declaration { - id: DeclarationId(3332), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1807), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 8707, 8736), - }); - declarations.push(Declaration { - id: DeclarationId(3333), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 8707, 8736), - }); - declarations.push(Declaration { - id: DeclarationId(3334), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3332), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3333), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 8707, 8736), - }); - declarations.push(Declaration { - id: DeclarationId(3335), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1806), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 8904, 8925), - }); - declarations.push(Declaration { - id: DeclarationId(3336), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 8904, 8925), - }); - declarations.push(Declaration { - id: DeclarationId(3337), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3335), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3336), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 8904, 8925), - }); - declarations.push(Declaration { - id: DeclarationId(3338), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(125), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 9123, 9128), - }); - declarations.push(Declaration { - id: DeclarationId(3339), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 9123, 9128), - }); - declarations.push(Declaration { - id: DeclarationId(3340), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3338), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3339), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 9123, 9128), - }); - declarations.push(Declaration { - id: DeclarationId(3341), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10821, 10828), - }); - declarations.push(Declaration { - id: DeclarationId(3342), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10821, 10828), - }); - declarations.push(Declaration { - id: DeclarationId(3343), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3341), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3342), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10821, 10828), - }); - declarations.push(Declaration { - id: DeclarationId(3344), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10840, 10847), - }); - declarations.push(Declaration { - id: DeclarationId(3345), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10840, 10847), - }); - declarations.push(Declaration { - id: DeclarationId(3346), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3344), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3345), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10840, 10847), - }); - declarations.push(Declaration { - id: DeclarationId(3347), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(2939), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10903, 10923), - }); - declarations.push(Declaration { - id: DeclarationId(3348), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10903, 10923), - }); - declarations.push(Declaration { - id: DeclarationId(3349), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3347), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3348), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10903, 10923), - }); - declarations.push(Declaration { - id: DeclarationId(3350), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10950, 10957), - }); - declarations.push(Declaration { - id: DeclarationId(3351), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10950, 10957), - }); - declarations.push(Declaration { - id: DeclarationId(3352), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3350), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3351), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10950, 10957), - }); - declarations.push(Declaration { - id: DeclarationId(3353), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10979, 10986), - }); - declarations.push(Declaration { - id: DeclarationId(3354), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10979, 10986), - }); - declarations.push(Declaration { - id: DeclarationId(3355), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3353), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3354), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10979, 10986), - }); - declarations.push(Declaration { - id: DeclarationId(3356), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11042, 11046), - }); - declarations.push(Declaration { - id: DeclarationId(3357), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11042, 11046), - }); - declarations.push(Declaration { - id: DeclarationId(3358), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3356), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3357), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11042, 11046), - }); - declarations.push(Declaration { - id: DeclarationId(3359), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11080, 11087), - }); - declarations.push(Declaration { - id: DeclarationId(3360), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11080, 11087), - }); - declarations.push(Declaration { - id: DeclarationId(3361), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3359), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3360), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11080, 11087), - }); - declarations.push(Declaration { - id: DeclarationId(3362), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11099, 11106), - }); - declarations.push(Declaration { - id: DeclarationId(3363), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11099, 11106), - }); - declarations.push(Declaration { - id: DeclarationId(3364), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3362), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3363), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11099, 11106), - }); - declarations.push(Declaration { - id: DeclarationId(3365), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(2947), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11232, 11252), - }); - declarations.push(Declaration { - id: DeclarationId(3366), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11232, 11252), - }); - declarations.push(Declaration { - id: DeclarationId(3367), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3365), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3366), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11232, 11252), - }); - declarations.push(Declaration { - id: DeclarationId(3368), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(2949), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11265, 11285), - }); - declarations.push(Declaration { - id: DeclarationId(3369), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11265, 11285), - }); - declarations.push(Declaration { - id: DeclarationId(3370), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3368), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3369), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11265, 11285), - }); - declarations.push(Declaration { - id: DeclarationId(3371), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11307, 11314), - }); - declarations.push(Declaration { - id: DeclarationId(3372), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11307, 11314), - }); - declarations.push(Declaration { - id: DeclarationId(3373), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3371), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3372), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11307, 11314), - }); - declarations.push(Declaration { - id: DeclarationId(3374), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11370, 11374), - }); - declarations.push(Declaration { - id: DeclarationId(3375), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11370, 11374), - }); - declarations.push(Declaration { - id: DeclarationId(3376), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3374), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3375), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11370, 11374), - }); - declarations.push(Declaration { - id: DeclarationId(3377), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11793, 11800), - }); - declarations.push(Declaration { - id: DeclarationId(3378), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11793, 11800), - }); - declarations.push(Declaration { - id: DeclarationId(3379), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3377), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3378), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11793, 11800), - }); - declarations.push(Declaration { - id: DeclarationId(3380), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11808, 11812), - }); - declarations.push(Declaration { - id: DeclarationId(3381), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11808, 11812), - }); - declarations.push(Declaration { - id: DeclarationId(3382), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3380), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3381), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11808, 11812), - }); - declarations.push(Declaration { - id: DeclarationId(3383), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11819, 11823), - }); - declarations.push(Declaration { - id: DeclarationId(3384), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11819, 11823), - }); - declarations.push(Declaration { - id: DeclarationId(3385), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3383), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3384), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11819, 11823), - }); - declarations.push(Declaration { - id: DeclarationId(3386), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11873, 11880), - }); - declarations.push(Declaration { - id: DeclarationId(3387), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11873, 11880), - }); - declarations.push(Declaration { - id: DeclarationId(3388), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3386), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3387), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11873, 11880), - }); - declarations.push(Declaration { - id: DeclarationId(3389), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11888, 11892), - }); - declarations.push(Declaration { - id: DeclarationId(3390), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11888, 11892), - }); - declarations.push(Declaration { - id: DeclarationId(3391), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3389), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3390), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11888, 11892), - }); - declarations.push(Declaration { - id: DeclarationId(3392), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11899, 11903), - }); - declarations.push(Declaration { - id: DeclarationId(3393), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11899, 11903), - }); - declarations.push(Declaration { - id: DeclarationId(3394), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3392), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3393), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11899, 11903), - }); - declarations.push(Declaration { - id: DeclarationId(3395), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11952, 11959), - }); - declarations.push(Declaration { - id: DeclarationId(3396), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11952, 11959), - }); - declarations.push(Declaration { - id: DeclarationId(3397), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3395), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3396), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11952, 11959), - }); - declarations.push(Declaration { - id: DeclarationId(3398), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11967, 11971), - }); - declarations.push(Declaration { - id: DeclarationId(3399), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11967, 11971), - }); - declarations.push(Declaration { - id: DeclarationId(3400), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3398), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3399), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11967, 11971), - }); - declarations.push(Declaration { - id: DeclarationId(3401), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11978, 11982), - }); - declarations.push(Declaration { - id: DeclarationId(3402), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11978, 11982), - }); - declarations.push(Declaration { - id: DeclarationId(3403), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3401), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3402), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11978, 11982), - }); - declarations.push(Declaration { - id: DeclarationId(3404), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 12962, 12966), - }); - declarations.push(Declaration { - id: DeclarationId(3405), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 12962, 12966), - }); - declarations.push(Declaration { - id: DeclarationId(3406), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3404), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3405), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 12962, 12966), - }); - declarations.push(Declaration { - id: DeclarationId(3407), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13045, 13052), - }); - declarations.push(Declaration { - id: DeclarationId(3408), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13045, 13052), - }); - declarations.push(Declaration { - id: DeclarationId(3409), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3407), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3408), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13045, 13052), - }); - declarations.push(Declaration { - id: DeclarationId(3410), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13692, 13696), - }); - declarations.push(Declaration { - id: DeclarationId(3411), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13692, 13696), - }); - declarations.push(Declaration { - id: DeclarationId(3412), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(3410), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(3411), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13692, 13696), - }); - declarations - } -} - -fn bootstrapped_fixture_dag_ports() -> HashMap { - { - let mut ports = HashMap::new(); - ports.insert( - PortId(0), - Port { - id: PortId(0), - state: PortState::Resolved(TypeShape::new(DeclarationId(76))), - produced_by: None, - }, - ); - ports.insert( - PortId(1), - Port { - id: PortId(1), - state: PortState::Uninferred, - produced_by: Some(NodeId(0)), - }, - ); - ports.insert( - PortId(2), - Port { - id: PortId(2), - state: PortState::Uninferred, - produced_by: Some(NodeId(1)), - }, - ); - ports.insert( - PortId(3), - Port { - id: PortId(3), - state: PortState::Resolved(TypeShape::new(DeclarationId(87))), - produced_by: None, - }, - ); - ports.insert( - PortId(4), - Port { - id: PortId(4), - state: PortState::Uninferred, - produced_by: Some(NodeId(3)), - }, - ); - ports.insert( - PortId(5), - Port { - id: PortId(5), - state: PortState::Uninferred, - produced_by: Some(NodeId(4)), - }, - ); - ports.insert( - PortId(6), - Port { - id: PortId(6), - state: PortState::Uninferred, - produced_by: Some(NodeId(5)), - }, - ); - ports.insert( - PortId(7), - Port { - id: PortId(7), - state: PortState::Uninferred, - produced_by: Some(NodeId(6)), - }, - ); - ports.insert( - PortId(8), - Port { - id: PortId(8), - state: PortState::Uninferred, - produced_by: Some(NodeId(7)), - }, - ); - ports.insert( - PortId(9), - Port { - id: PortId(9), - state: PortState::Uninferred, - produced_by: Some(NodeId(8)), - }, - ); - ports.insert( - PortId(10), - Port { - id: PortId(10), - state: PortState::Uninferred, - produced_by: Some(NodeId(9)), - }, - ); - ports.insert( - PortId(11), - Port { - id: PortId(11), - state: PortState::Uninferred, - produced_by: Some(NodeId(10)), - }, - ); - ports.insert( - PortId(12), - Port { - id: PortId(12), - state: PortState::Uninferred, - produced_by: Some(NodeId(11)), - }, - ); - ports.insert( - PortId(13), - Port { - id: PortId(13), - state: PortState::Uninferred, - produced_by: Some(NodeId(12)), - }, - ); - ports.insert( - PortId(14), - Port { - id: PortId(14), - state: PortState::Uninferred, - produced_by: Some(NodeId(13)), - }, - ); - ports.insert( - PortId(15), - Port { - id: PortId(15), - state: PortState::Uninferred, - produced_by: Some(NodeId(14)), - }, - ); - ports.insert( - PortId(16), - Port { - id: PortId(16), - state: PortState::Uninferred, - produced_by: Some(NodeId(15)), - }, - ); - ports.insert( - PortId(17), - Port { - id: PortId(17), - state: PortState::Uninferred, - produced_by: Some(NodeId(16)), - }, - ); - ports.insert( - PortId(18), - Port { - id: PortId(18), - state: PortState::Uninferred, - produced_by: Some(NodeId(17)), - }, - ); - ports.insert( - PortId(19), - Port { - id: PortId(19), - state: PortState::Uninferred, - produced_by: Some(NodeId(18)), - }, - ); - ports.insert( - PortId(20), - Port { - id: PortId(20), - state: PortState::Uninferred, - produced_by: Some(NodeId(19)), - }, - ); - ports.insert( - PortId(21), - Port { - id: PortId(21), - state: PortState::Resolved(TypeShape::new(DeclarationId(87))), - produced_by: None, - }, - ); - ports.insert( - PortId(22), - Port { - id: PortId(22), - state: PortState::Uninferred, - produced_by: Some(NodeId(21)), - }, - ); - ports.insert( - PortId(23), - Port { - id: PortId(23), - state: PortState::Uninferred, - produced_by: Some(NodeId(22)), - }, - ); - ports.insert( - PortId(24), - Port { - id: PortId(24), - state: PortState::Uninferred, - produced_by: Some(NodeId(23)), - }, - ); - ports.insert( - PortId(25), - Port { - id: PortId(25), - state: PortState::Uninferred, - produced_by: Some(NodeId(24)), - }, - ); - ports.insert( - PortId(26), - Port { - id: PortId(26), - state: PortState::Uninferred, - produced_by: Some(NodeId(25)), - }, - ); - ports.insert( - PortId(27), - Port { - id: PortId(27), - state: PortState::Resolved(TypeShape::new(DeclarationId(87))), - produced_by: None, - }, - ); - ports.insert( - PortId(28), - Port { - id: PortId(28), - state: PortState::Uninferred, - produced_by: Some(NodeId(27)), - }, - ); - ports.insert( - PortId(29), - Port { - id: PortId(29), - state: PortState::Uninferred, - produced_by: Some(NodeId(28)), - }, - ); - ports.insert( - PortId(30), - Port { - id: PortId(30), - state: PortState::Uninferred, - produced_by: Some(NodeId(29)), - }, - ); - ports.insert( - PortId(31), - Port { - id: PortId(31), - state: PortState::Uninferred, - produced_by: Some(NodeId(30)), - }, - ); - ports.insert( - PortId(32), - Port { - id: PortId(32), - state: PortState::Uninferred, - produced_by: Some(NodeId(31)), - }, - ); - ports.insert( - PortId(33), - Port { - id: PortId(33), - state: PortState::Resolved(TypeShape::new(DeclarationId(87))), - produced_by: None, - }, - ); - ports.insert( - PortId(34), - Port { - id: PortId(34), - state: PortState::Uninferred, - produced_by: Some(NodeId(33)), - }, - ); - ports.insert( - PortId(35), - Port { - id: PortId(35), - state: PortState::Uninferred, - produced_by: Some(NodeId(34)), - }, - ); - ports.insert( - PortId(36), - Port { - id: PortId(36), - state: PortState::Uninferred, - produced_by: Some(NodeId(35)), - }, - ); - ports.insert( - PortId(37), - Port { - id: PortId(37), - state: PortState::Uninferred, - produced_by: Some(NodeId(36)), - }, - ); - ports.insert( - PortId(38), - Port { - id: PortId(38), - state: PortState::Uninferred, - produced_by: Some(NodeId(37)), - }, - ); - ports.insert( - PortId(39), - Port { - id: PortId(39), - state: PortState::Resolved(TypeShape::new(DeclarationId(147))), - produced_by: None, - }, - ); - ports.insert( - PortId(40), - Port { - id: PortId(40), - state: PortState::Uninferred, - produced_by: Some(NodeId(39)), - }, - ); - ports.insert( - PortId(41), - Port { - id: PortId(41), - state: PortState::Uninferred, - produced_by: Some(NodeId(40)), - }, - ); - ports.insert( - PortId(42), - Port { - id: PortId(42), - state: PortState::Uninferred, - produced_by: Some(NodeId(41)), - }, - ); - ports.insert( - PortId(43), - Port { - id: PortId(43), - state: PortState::Uninferred, - produced_by: Some(NodeId(42)), - }, - ); - ports.insert( - PortId(44), - Port { - id: PortId(44), - state: PortState::Uninferred, - produced_by: Some(NodeId(43)), - }, - ); - ports.insert( - PortId(45), - Port { - id: PortId(45), - state: PortState::Resolved(TypeShape::new(DeclarationId(147))), - produced_by: None, - }, - ); - ports.insert( - PortId(46), - Port { - id: PortId(46), - state: PortState::Uninferred, - produced_by: Some(NodeId(45)), - }, - ); - ports.insert( - PortId(47), - Port { - id: PortId(47), - state: PortState::Uninferred, - produced_by: Some(NodeId(46)), - }, - ); - ports.insert( - PortId(48), - Port { - id: PortId(48), - state: PortState::Uninferred, - produced_by: Some(NodeId(47)), - }, - ); - ports.insert( - PortId(49), - Port { - id: PortId(49), - state: PortState::Uninferred, - produced_by: Some(NodeId(48)), - }, - ); - ports.insert( - PortId(50), - Port { - id: PortId(50), - state: PortState::Uninferred, - produced_by: Some(NodeId(49)), - }, - ); - ports.insert( - PortId(51), - Port { - id: PortId(51), - state: PortState::Resolved(TypeShape::new(DeclarationId(87))), - produced_by: None, - }, - ); - ports.insert( - PortId(52), - Port { - id: PortId(52), - state: PortState::Uninferred, - produced_by: Some(NodeId(51)), - }, - ); - ports.insert( - PortId(53), - Port { - id: PortId(53), - state: PortState::Uninferred, - produced_by: Some(NodeId(52)), - }, - ); - ports.insert( - PortId(54), - Port { - id: PortId(54), - state: PortState::Resolved(TypeShape::new(DeclarationId(87))), - produced_by: None, - }, - ); - ports.insert( - PortId(55), - Port { - id: PortId(55), - state: PortState::Uninferred, - produced_by: Some(NodeId(54)), - }, - ); - ports.insert( - PortId(56), - Port { - id: PortId(56), - state: PortState::Uninferred, - produced_by: Some(NodeId(55)), - }, - ); - ports.insert( - PortId(57), - Port { - id: PortId(57), - state: PortState::Resolved(TypeShape::new(DeclarationId(87))), - produced_by: None, - }, - ); - ports.insert( - PortId(58), - Port { - id: PortId(58), - state: PortState::Uninferred, - produced_by: Some(NodeId(57)), - }, - ); - ports.insert( - PortId(59), - Port { - id: PortId(59), - state: PortState::Uninferred, - produced_by: Some(NodeId(58)), - }, - ); - ports.insert( - PortId(60), - Port { - id: PortId(60), - state: PortState::Uninferred, - produced_by: Some(NodeId(59)), - }, - ); - ports.insert( - PortId(61), - Port { - id: PortId(61), - state: PortState::Uninferred, - produced_by: Some(NodeId(60)), - }, - ); - ports.insert( - PortId(62), - Port { - id: PortId(62), - state: PortState::Uninferred, - produced_by: Some(NodeId(61)), - }, - ); - ports.insert( - PortId(63), - Port { - id: PortId(63), - state: PortState::Uninferred, - produced_by: Some(NodeId(62)), - }, - ); - ports.insert( - PortId(64), - Port { - id: PortId(64), - state: PortState::Uninferred, - produced_by: Some(NodeId(63)), - }, - ); - ports.insert( - PortId(65), - Port { - id: PortId(65), - state: PortState::Uninferred, - produced_by: Some(NodeId(64)), - }, - ); - ports.insert( - PortId(66), - Port { - id: PortId(66), - state: PortState::Resolved(TypeShape::new(DeclarationId(87))), - produced_by: None, - }, - ); - ports.insert( - PortId(67), - Port { - id: PortId(67), - state: PortState::Uninferred, - produced_by: Some(NodeId(66)), - }, - ); - ports.insert( - PortId(68), - Port { - id: PortId(68), - state: PortState::Uninferred, - produced_by: Some(NodeId(67)), - }, - ); - ports.insert( - PortId(69), - Port { - id: PortId(69), - state: PortState::Uninferred, - produced_by: Some(NodeId(68)), - }, - ); - ports.insert( - PortId(70), - Port { - id: PortId(70), - state: PortState::Uninferred, - produced_by: Some(NodeId(69)), - }, - ); - ports.insert( - PortId(71), - Port { - id: PortId(71), - state: PortState::Uninferred, - produced_by: Some(NodeId(70)), - }, - ); - ports.insert( - PortId(72), - Port { - id: PortId(72), - state: PortState::Uninferred, - produced_by: Some(NodeId(71)), - }, - ); - ports.insert( - PortId(73), - Port { - id: PortId(73), - state: PortState::Uninferred, - produced_by: Some(NodeId(72)), - }, - ); - ports.insert( - PortId(74), - Port { - id: PortId(74), - state: PortState::Uninferred, - produced_by: Some(NodeId(73)), - }, - ); - ports.insert( - PortId(75), - Port { - id: PortId(75), - state: PortState::Resolved(TypeShape::new(DeclarationId(147))), - produced_by: None, - }, - ); - ports.insert( - PortId(76), - Port { - id: PortId(76), - state: PortState::Uninferred, - produced_by: Some(NodeId(75)), - }, - ); - ports.insert( - PortId(77), - Port { - id: PortId(77), - state: PortState::Uninferred, - produced_by: Some(NodeId(76)), - }, - ); - ports.insert( - PortId(78), - Port { - id: PortId(78), - state: PortState::Uninferred, - produced_by: Some(NodeId(77)), - }, - ); - ports.insert( - PortId(79), - Port { - id: PortId(79), - state: PortState::Uninferred, - produced_by: Some(NodeId(78)), - }, - ); - ports.insert( - PortId(80), - Port { - id: PortId(80), - state: PortState::Uninferred, - produced_by: Some(NodeId(79)), - }, - ); - ports.insert( - PortId(81), - Port { - id: PortId(81), - state: PortState::Resolved(TypeShape::new(DeclarationId(147))), - produced_by: None, - }, - ); - ports.insert( - PortId(82), - Port { - id: PortId(82), - state: PortState::Uninferred, - produced_by: Some(NodeId(81)), - }, - ); - ports.insert( - PortId(83), - Port { - id: PortId(83), - state: PortState::Uninferred, - produced_by: Some(NodeId(82)), - }, - ); - ports.insert( - PortId(84), - Port { - id: PortId(84), - state: PortState::Uninferred, - produced_by: Some(NodeId(83)), - }, - ); - ports.insert( - PortId(85), - Port { - id: PortId(85), - state: PortState::Uninferred, - produced_by: Some(NodeId(84)), - }, - ); - ports.insert( - PortId(86), - Port { - id: PortId(86), - state: PortState::Uninferred, - produced_by: Some(NodeId(85)), - }, - ); - ports.insert( - PortId(87), - Port { - id: PortId(87), - state: PortState::Resolved(TypeShape::new(DeclarationId(147))), - produced_by: None, - }, - ); - ports.insert( - PortId(88), - Port { - id: PortId(88), - state: PortState::Uninferred, - produced_by: Some(NodeId(87)), - }, - ); - ports.insert( - PortId(89), - Port { - id: PortId(89), - state: PortState::Uninferred, - produced_by: Some(NodeId(88)), - }, - ); - ports.insert( - PortId(90), - Port { - id: PortId(90), - state: PortState::Uninferred, - produced_by: Some(NodeId(89)), - }, - ); - ports.insert( - PortId(91), - Port { - id: PortId(91), - state: PortState::Uninferred, - produced_by: Some(NodeId(90)), - }, - ); - ports.insert( - PortId(92), - Port { - id: PortId(92), - state: PortState::Uninferred, - produced_by: Some(NodeId(91)), - }, - ); - ports.insert( - PortId(93), - Port { - id: PortId(93), - state: PortState::Resolved(TypeShape::new(DeclarationId(147))), - produced_by: None, - }, - ); - ports.insert( - PortId(94), - Port { - id: PortId(94), - state: PortState::Uninferred, - produced_by: Some(NodeId(93)), - }, - ); - ports.insert( - PortId(95), - Port { - id: PortId(95), - state: PortState::Uninferred, - produced_by: Some(NodeId(94)), - }, - ); - ports.insert( - PortId(96), - Port { - id: PortId(96), - state: PortState::Uninferred, - produced_by: Some(NodeId(95)), - }, - ); - ports.insert( - PortId(97), - Port { - id: PortId(97), - state: PortState::Uninferred, - produced_by: Some(NodeId(96)), - }, - ); - ports.insert( - PortId(98), - Port { - id: PortId(98), - state: PortState::Uninferred, - produced_by: Some(NodeId(97)), - }, - ); - ports.insert( - PortId(99), - Port { - id: PortId(99), - state: PortState::Resolved(TypeShape::new(DeclarationId(147))), - produced_by: None, - }, - ); - ports.insert( - PortId(100), - Port { - id: PortId(100), - state: PortState::Uninferred, - produced_by: Some(NodeId(99)), - }, - ); - ports.insert( - PortId(101), - Port { - id: PortId(101), - state: PortState::Uninferred, - produced_by: Some(NodeId(100)), - }, - ); - ports.insert( - PortId(102), - Port { - id: PortId(102), - state: PortState::Uninferred, - produced_by: Some(NodeId(101)), - }, - ); - ports.insert( - PortId(103), - Port { - id: PortId(103), - state: PortState::Uninferred, - produced_by: Some(NodeId(102)), - }, - ); - ports.insert( - PortId(104), - Port { - id: PortId(104), - state: PortState::Uninferred, - produced_by: Some(NodeId(103)), - }, - ); - ports.insert( - PortId(105), - Port { - id: PortId(105), - state: PortState::Resolved(TypeShape::new(DeclarationId(147))), - produced_by: None, - }, - ); - ports.insert( - PortId(106), - Port { - id: PortId(106), - state: PortState::Uninferred, - produced_by: Some(NodeId(105)), - }, - ); - ports.insert( - PortId(107), - Port { - id: PortId(107), - state: PortState::Uninferred, - produced_by: Some(NodeId(106)), - }, - ); - ports.insert( - PortId(108), - Port { - id: PortId(108), - state: PortState::Uninferred, - produced_by: Some(NodeId(107)), - }, - ); - ports.insert( - PortId(109), - Port { - id: PortId(109), - state: PortState::Uninferred, - produced_by: Some(NodeId(108)), - }, - ); - ports.insert( - PortId(110), - Port { - id: PortId(110), - state: PortState::Uninferred, - produced_by: Some(NodeId(109)), - }, - ); - ports.insert( - PortId(111), - Port { - id: PortId(111), - state: PortState::Resolved(TypeShape::new(DeclarationId(147))), - produced_by: None, - }, - ); - ports.insert( - PortId(112), - Port { - id: PortId(112), - state: PortState::Uninferred, - produced_by: Some(NodeId(111)), - }, - ); - ports.insert( - PortId(113), - Port { - id: PortId(113), - state: PortState::Uninferred, - produced_by: Some(NodeId(112)), - }, - ); - ports.insert( - PortId(114), - Port { - id: PortId(114), - state: PortState::Uninferred, - produced_by: Some(NodeId(113)), - }, - ); - ports.insert( - PortId(115), - Port { - id: PortId(115), - state: PortState::Uninferred, - produced_by: Some(NodeId(114)), - }, - ); - ports.insert( - PortId(116), - Port { - id: PortId(116), - state: PortState::Uninferred, - produced_by: Some(NodeId(115)), - }, - ); - ports.insert( - PortId(117), - Port { - id: PortId(117), - state: PortState::Resolved(TypeShape::new(DeclarationId(147))), - produced_by: None, - }, - ); - ports.insert( - PortId(118), - Port { - id: PortId(118), - state: PortState::Uninferred, - produced_by: Some(NodeId(117)), - }, - ); - ports.insert( - PortId(119), - Port { - id: PortId(119), - state: PortState::Uninferred, - produced_by: Some(NodeId(118)), - }, - ); - ports.insert( - PortId(120), - Port { - id: PortId(120), - state: PortState::Uninferred, - produced_by: Some(NodeId(119)), - }, - ); - ports.insert( - PortId(121), - Port { - id: PortId(121), - state: PortState::Uninferred, - produced_by: Some(NodeId(120)), - }, - ); - ports.insert( - PortId(122), - Port { - id: PortId(122), - state: PortState::Uninferred, - produced_by: Some(NodeId(121)), - }, - ); - ports.insert( - PortId(123), - Port { - id: PortId(123), - state: PortState::Resolved(TypeShape::new(DeclarationId(147))), - produced_by: None, - }, - ); - ports.insert( - PortId(124), - Port { - id: PortId(124), - state: PortState::Uninferred, - produced_by: Some(NodeId(123)), - }, - ); - ports.insert( - PortId(125), - Port { - id: PortId(125), - state: PortState::Uninferred, - produced_by: Some(NodeId(124)), - }, - ); - ports.insert( - PortId(126), - Port { - id: PortId(126), - state: PortState::Uninferred, - produced_by: Some(NodeId(125)), - }, - ); - ports.insert( - PortId(127), - Port { - id: PortId(127), - state: PortState::Uninferred, - produced_by: Some(NodeId(126)), - }, - ); - ports.insert( - PortId(128), - Port { - id: PortId(128), - state: PortState::Uninferred, - produced_by: Some(NodeId(127)), - }, - ); - ports.insert( - PortId(129), - Port { - id: PortId(129), - state: PortState::Resolved(TypeShape::new(DeclarationId(147))), - produced_by: None, - }, - ); - ports.insert( - PortId(130), - Port { - id: PortId(130), - state: PortState::Uninferred, - produced_by: Some(NodeId(129)), - }, - ); - ports.insert( - PortId(131), - Port { - id: PortId(131), - state: PortState::Uninferred, - produced_by: Some(NodeId(130)), - }, - ); - ports.insert( - PortId(132), - Port { - id: PortId(132), - state: PortState::Uninferred, - produced_by: Some(NodeId(131)), - }, - ); - ports.insert( - PortId(133), - Port { - id: PortId(133), - state: PortState::Uninferred, - produced_by: Some(NodeId(132)), - }, - ); - ports.insert( - PortId(134), - Port { - id: PortId(134), - state: PortState::Uninferred, - produced_by: Some(NodeId(133)), - }, - ); - ports.insert( - PortId(135), - Port { - id: PortId(135), - state: PortState::Resolved(TypeShape::new(DeclarationId(147))), - produced_by: None, - }, - ); - ports.insert( - PortId(136), - Port { - id: PortId(136), - state: PortState::Uninferred, - produced_by: Some(NodeId(135)), - }, - ); - ports.insert( - PortId(137), - Port { - id: PortId(137), - state: PortState::Uninferred, - produced_by: Some(NodeId(136)), - }, - ); - ports.insert( - PortId(138), - Port { - id: PortId(138), - state: PortState::Uninferred, - produced_by: Some(NodeId(137)), - }, - ); - ports.insert( - PortId(139), - Port { - id: PortId(139), - state: PortState::Uninferred, - produced_by: Some(NodeId(138)), - }, - ); - ports.insert( - PortId(140), - Port { - id: PortId(140), - state: PortState::Uninferred, - produced_by: Some(NodeId(139)), - }, - ); - ports.insert( - PortId(141), - Port { - id: PortId(141), - state: PortState::Resolved(TypeShape::new(DeclarationId(147))), - produced_by: None, - }, - ); - ports.insert( - PortId(142), - Port { - id: PortId(142), - state: PortState::Uninferred, - produced_by: Some(NodeId(141)), - }, - ); - ports.insert( - PortId(143), - Port { - id: PortId(143), - state: PortState::Uninferred, - produced_by: Some(NodeId(142)), - }, - ); - ports.insert( - PortId(144), - Port { - id: PortId(144), - state: PortState::Uninferred, - produced_by: Some(NodeId(143)), - }, - ); - ports.insert( - PortId(145), - Port { - id: PortId(145), - state: PortState::Uninferred, - produced_by: Some(NodeId(144)), - }, - ); - ports.insert( - PortId(146), - Port { - id: PortId(146), - state: PortState::Uninferred, - produced_by: Some(NodeId(145)), - }, - ); - ports.insert( - PortId(147), - Port { - id: PortId(147), - state: PortState::Resolved(TypeShape::new(DeclarationId(147))), - produced_by: None, - }, - ); - ports.insert( - PortId(148), - Port { - id: PortId(148), - state: PortState::Uninferred, - produced_by: Some(NodeId(147)), - }, - ); - ports.insert( - PortId(149), - Port { - id: PortId(149), - state: PortState::Uninferred, - produced_by: Some(NodeId(148)), - }, - ); - ports.insert( - PortId(150), - Port { - id: PortId(150), - state: PortState::Uninferred, - produced_by: Some(NodeId(149)), - }, - ); - ports.insert( - PortId(151), - Port { - id: PortId(151), - state: PortState::Uninferred, - produced_by: Some(NodeId(150)), - }, - ); - ports.insert( - PortId(152), - Port { - id: PortId(152), - state: PortState::Uninferred, - produced_by: Some(NodeId(151)), - }, - ); - ports.insert( - PortId(153), - Port { - id: PortId(153), - state: PortState::Resolved(TypeShape::new(DeclarationId(147))), - produced_by: None, - }, - ); - ports.insert( - PortId(154), - Port { - id: PortId(154), - state: PortState::Uninferred, - produced_by: Some(NodeId(153)), - }, - ); - ports.insert( - PortId(155), - Port { - id: PortId(155), - state: PortState::Uninferred, - produced_by: Some(NodeId(154)), - }, - ); - ports.insert( - PortId(156), - Port { - id: PortId(156), - state: PortState::Uninferred, - produced_by: Some(NodeId(155)), - }, - ); - ports.insert( - PortId(157), - Port { - id: PortId(157), - state: PortState::Uninferred, - produced_by: Some(NodeId(156)), - }, - ); - ports.insert( - PortId(158), - Port { - id: PortId(158), - state: PortState::Uninferred, - produced_by: Some(NodeId(157)), - }, - ); - ports.insert( - PortId(159), - Port { - id: PortId(159), - state: PortState::Resolved(TypeShape::new(DeclarationId(154))), - produced_by: None, - }, - ); - ports.insert( - PortId(160), - Port { - id: PortId(160), - state: PortState::Uninferred, - produced_by: Some(NodeId(159)), - }, - ); - ports.insert( - PortId(161), - Port { - id: PortId(161), - state: PortState::Uninferred, - produced_by: Some(NodeId(160)), - }, - ); - ports.insert( - PortId(162), - Port { - id: PortId(162), - state: PortState::Uninferred, - produced_by: Some(NodeId(161)), - }, - ); - ports.insert( - PortId(163), - Port { - id: PortId(163), - state: PortState::Uninferred, - produced_by: Some(NodeId(162)), - }, - ); - ports.insert( - PortId(164), - Port { - id: PortId(164), - state: PortState::Uninferred, - produced_by: Some(NodeId(163)), - }, - ); - ports.insert( - PortId(165), - Port { - id: PortId(165), - state: PortState::Resolved(TypeShape::new(DeclarationId(125))), - produced_by: None, - }, - ); - ports.insert( - PortId(166), - Port { - id: PortId(166), - state: PortState::Uninferred, - produced_by: Some(NodeId(165)), - }, - ); - ports.insert( - PortId(167), - Port { - id: PortId(167), - state: PortState::Uninferred, - produced_by: Some(NodeId(166)), - }, - ); - ports.insert( - PortId(168), - Port { - id: PortId(168), - state: PortState::Uninferred, - produced_by: Some(NodeId(167)), - }, - ); - ports.insert( - PortId(169), - Port { - id: PortId(169), - state: PortState::Uninferred, - produced_by: Some(NodeId(168)), - }, - ); - ports.insert( - PortId(170), - Port { - id: PortId(170), - state: PortState::Uninferred, - produced_by: Some(NodeId(169)), - }, - ); - ports.insert( - PortId(171), - Port { - id: PortId(171), - state: PortState::Resolved(TypeShape::new(DeclarationId(227))), - produced_by: None, - }, - ); - ports.insert( - PortId(172), - Port { - id: PortId(172), - state: PortState::Uninferred, - produced_by: Some(NodeId(171)), - }, - ); - ports.insert( - PortId(173), - Port { - id: PortId(173), - state: PortState::Uninferred, - produced_by: Some(NodeId(172)), - }, - ); - ports.insert( - PortId(174), - Port { - id: PortId(174), - state: PortState::Uninferred, - produced_by: Some(NodeId(173)), - }, - ); - ports.insert( - PortId(175), - Port { - id: PortId(175), - state: PortState::Uninferred, - produced_by: Some(NodeId(174)), - }, - ); - ports.insert( - PortId(176), - Port { - id: PortId(176), - state: PortState::Uninferred, - produced_by: Some(NodeId(175)), - }, - ); - ports.insert( - PortId(177), - Port { - id: PortId(177), - state: PortState::Resolved(TypeShape::new(DeclarationId(128))), - produced_by: None, - }, - ); - ports.insert( - PortId(178), - Port { - id: PortId(178), - state: PortState::Resolved(TypeShape::new(DeclarationId(228))), - produced_by: None, - }, - ); - ports.insert( - PortId(179), - Port { - id: PortId(179), - state: PortState::Uninferred, - produced_by: Some(NodeId(177)), - }, - ); - ports.insert( - PortId(180), - Port { - id: PortId(180), - state: PortState::Uninferred, - produced_by: Some(NodeId(178)), - }, - ); - ports.insert( - PortId(181), - Port { - id: PortId(181), - state: PortState::Uninferred, - produced_by: Some(NodeId(179)), - }, - ); - ports.insert( - PortId(182), - Port { - id: PortId(182), - state: PortState::Uninferred, - produced_by: Some(NodeId(180)), - }, - ); - ports.insert( - PortId(183), - Port { - id: PortId(183), - state: PortState::Uninferred, - produced_by: Some(NodeId(181)), - }, - ); - ports.insert( - PortId(184), - Port { - id: PortId(184), - state: PortState::Uninferred, - produced_by: Some(NodeId(182)), - }, - ); - ports.insert( - PortId(185), - Port { - id: PortId(185), - state: PortState::Uninferred, - produced_by: Some(NodeId(183)), - }, - ); - ports.insert( - PortId(186), - Port { - id: PortId(186), - state: PortState::Uninferred, - produced_by: Some(NodeId(184)), - }, - ); - ports.insert( - PortId(187), - Port { - id: PortId(187), - state: PortState::Uninferred, - produced_by: Some(NodeId(185)), - }, - ); - ports.insert( - PortId(188), - Port { - id: PortId(188), - state: PortState::Uninferred, - produced_by: Some(NodeId(186)), - }, - ); - ports.insert( - PortId(189), - Port { - id: PortId(189), - state: PortState::Uninferred, - produced_by: Some(NodeId(187)), - }, - ); - ports.insert( - PortId(190), - Port { - id: PortId(190), - state: PortState::Uninferred, - produced_by: Some(NodeId(188)), - }, - ); - ports.insert( - PortId(191), - Port { - id: PortId(191), - state: PortState::Uninferred, - produced_by: Some(NodeId(189)), - }, - ); - ports.insert( - PortId(192), - Port { - id: PortId(192), - state: PortState::Uninferred, - produced_by: Some(NodeId(190)), - }, - ); - ports.insert( - PortId(193), - Port { - id: PortId(193), - state: PortState::Uninferred, - produced_by: Some(NodeId(191)), - }, - ); - ports.insert( - PortId(194), - Port { - id: PortId(194), - state: PortState::Uninferred, - produced_by: Some(NodeId(192)), - }, - ); - ports.insert( - PortId(195), - Port { - id: PortId(195), - state: PortState::Uninferred, - produced_by: Some(NodeId(193)), - }, - ); - ports.insert( - PortId(196), - Port { - id: PortId(196), - state: PortState::Uninferred, - produced_by: Some(NodeId(194)), - }, - ); - ports.insert( - PortId(197), - Port { - id: PortId(197), - state: PortState::Uninferred, - produced_by: Some(NodeId(195)), - }, - ); - ports.insert( - PortId(198), - Port { - id: PortId(198), - state: PortState::Uninferred, - produced_by: Some(NodeId(196)), - }, - ); - ports.insert( - PortId(199), - Port { - id: PortId(199), - state: PortState::Uninferred, - produced_by: Some(NodeId(197)), - }, - ); - ports.insert( - PortId(200), - Port { - id: PortId(200), - state: PortState::Uninferred, - produced_by: Some(NodeId(198)), - }, - ); - ports.insert( - PortId(201), - Port { - id: PortId(201), - state: PortState::Uninferred, - produced_by: Some(NodeId(199)), - }, - ); - ports.insert( - PortId(202), - Port { - id: PortId(202), - state: PortState::Uninferred, - produced_by: Some(NodeId(200)), - }, - ); - ports.insert( - PortId(203), - Port { - id: PortId(203), - state: PortState::Uninferred, - produced_by: Some(NodeId(201)), - }, - ); - ports.insert( - PortId(204), - Port { - id: PortId(204), - state: PortState::Uninferred, - produced_by: Some(NodeId(202)), - }, - ); - ports.insert( - PortId(205), - Port { - id: PortId(205), - state: PortState::Uninferred, - produced_by: Some(NodeId(203)), - }, - ); - ports.insert( - PortId(206), - Port { - id: PortId(206), - state: PortState::Uninferred, - produced_by: Some(NodeId(204)), - }, - ); - ports.insert( - PortId(207), - Port { - id: PortId(207), - state: PortState::Uninferred, - produced_by: Some(NodeId(205)), - }, - ); - ports.insert( - PortId(208), - Port { - id: PortId(208), - state: PortState::Uninferred, - produced_by: Some(NodeId(206)), - }, - ); - ports.insert( - PortId(209), - Port { - id: PortId(209), - state: PortState::Uninferred, - produced_by: Some(NodeId(207)), - }, - ); - ports.insert( - PortId(210), - Port { - id: PortId(210), - state: PortState::Uninferred, - produced_by: Some(NodeId(208)), - }, - ); - ports.insert( - PortId(211), - Port { - id: PortId(211), - state: PortState::Uninferred, - produced_by: Some(NodeId(209)), - }, - ); - ports.insert( - PortId(212), - Port { - id: PortId(212), - state: PortState::Uninferred, - produced_by: Some(NodeId(210)), - }, - ); - ports.insert( - PortId(213), - Port { - id: PortId(213), - state: PortState::Uninferred, - produced_by: Some(NodeId(211)), - }, - ); - ports.insert( - PortId(214), - Port { - id: PortId(214), - state: PortState::Uninferred, - produced_by: Some(NodeId(212)), - }, - ); - ports.insert( - PortId(215), - Port { - id: PortId(215), - state: PortState::Uninferred, - produced_by: Some(NodeId(213)), - }, - ); - ports.insert( - PortId(216), - Port { - id: PortId(216), - state: PortState::Uninferred, - produced_by: Some(NodeId(214)), - }, - ); - ports.insert( - PortId(217), - Port { - id: PortId(217), - state: PortState::Uninferred, - produced_by: Some(NodeId(215)), - }, - ); - ports.insert( - PortId(218), - Port { - id: PortId(218), - state: PortState::Uninferred, - produced_by: Some(NodeId(216)), - }, - ); - ports.insert( - PortId(219), - Port { - id: PortId(219), - state: PortState::Uninferred, - produced_by: Some(NodeId(217)), - }, - ); - ports.insert( - PortId(220), - Port { - id: PortId(220), - state: PortState::Uninferred, - produced_by: Some(NodeId(218)), - }, - ); - ports.insert( - PortId(221), - Port { - id: PortId(221), - state: PortState::Uninferred, - produced_by: Some(NodeId(219)), - }, - ); - ports.insert( - PortId(222), - Port { - id: PortId(222), - state: PortState::Uninferred, - produced_by: Some(NodeId(220)), - }, - ); - ports.insert( - PortId(223), - Port { - id: PortId(223), - state: PortState::Uninferred, - produced_by: Some(NodeId(221)), - }, - ); - ports.insert( - PortId(224), - Port { - id: PortId(224), - state: PortState::Uninferred, - produced_by: Some(NodeId(222)), - }, - ); - ports.insert( - PortId(225), - Port { - id: PortId(225), - state: PortState::Uninferred, - produced_by: Some(NodeId(223)), - }, - ); - ports.insert( - PortId(226), - Port { - id: PortId(226), - state: PortState::Uninferred, - produced_by: Some(NodeId(224)), - }, - ); - ports.insert( - PortId(227), - Port { - id: PortId(227), - state: PortState::Uninferred, - produced_by: Some(NodeId(225)), - }, - ); - ports.insert( - PortId(228), - Port { - id: PortId(228), - state: PortState::Uninferred, - produced_by: Some(NodeId(226)), - }, - ); - ports.insert( - PortId(229), - Port { - id: PortId(229), - state: PortState::Uninferred, - produced_by: Some(NodeId(227)), - }, - ); - ports.insert( - PortId(230), - Port { - id: PortId(230), - state: PortState::Uninferred, - produced_by: Some(NodeId(228)), - }, - ); - ports.insert( - PortId(231), - Port { - id: PortId(231), - state: PortState::Uninferred, - produced_by: Some(NodeId(229)), - }, - ); - ports.insert( - PortId(232), - Port { - id: PortId(232), - state: PortState::Uninferred, - produced_by: Some(NodeId(230)), - }, - ); - ports.insert( - PortId(233), - Port { - id: PortId(233), - state: PortState::Uninferred, - produced_by: Some(NodeId(231)), - }, - ); - ports.insert( - PortId(234), - Port { - id: PortId(234), - state: PortState::Uninferred, - produced_by: Some(NodeId(232)), - }, - ); - ports.insert( - PortId(235), - Port { - id: PortId(235), - state: PortState::Uninferred, - produced_by: Some(NodeId(233)), - }, - ); - ports.insert( - PortId(236), - Port { - id: PortId(236), - state: PortState::Uninferred, - produced_by: Some(NodeId(234)), - }, - ); - ports.insert( - PortId(237), - Port { - id: PortId(237), - state: PortState::Uninferred, - produced_by: Some(NodeId(235)), - }, - ); - ports.insert( - PortId(238), - Port { - id: PortId(238), - state: PortState::Uninferred, - produced_by: Some(NodeId(236)), - }, - ); - ports.insert( - PortId(239), - Port { - id: PortId(239), - state: PortState::Uninferred, - produced_by: Some(NodeId(237)), - }, - ); - ports.insert( - PortId(240), - Port { - id: PortId(240), - state: PortState::Uninferred, - produced_by: Some(NodeId(238)), - }, - ); - ports.insert( - PortId(241), - Port { - id: PortId(241), - state: PortState::Uninferred, - produced_by: Some(NodeId(239)), - }, - ); - ports.insert( - PortId(242), - Port { - id: PortId(242), - state: PortState::Uninferred, - produced_by: Some(NodeId(240)), - }, - ); - ports.insert( - PortId(243), - Port { - id: PortId(243), - state: PortState::Uninferred, - produced_by: Some(NodeId(241)), - }, - ); - ports.insert( - PortId(244), - Port { - id: PortId(244), - state: PortState::Uninferred, - produced_by: Some(NodeId(242)), - }, - ); - ports.insert( - PortId(245), - Port { - id: PortId(245), - state: PortState::Uninferred, - produced_by: Some(NodeId(243)), - }, - ); - ports.insert( - PortId(246), - Port { - id: PortId(246), - state: PortState::Uninferred, - produced_by: Some(NodeId(244)), - }, - ); - ports.insert( - PortId(247), - Port { - id: PortId(247), - state: PortState::Uninferred, - produced_by: Some(NodeId(245)), - }, - ); - ports.insert( - PortId(248), - Port { - id: PortId(248), - state: PortState::Uninferred, - produced_by: Some(NodeId(246)), - }, - ); - ports.insert( - PortId(249), - Port { - id: PortId(249), - state: PortState::Uninferred, - produced_by: Some(NodeId(247)), - }, - ); - ports.insert( - PortId(250), - Port { - id: PortId(250), - state: PortState::Uninferred, - produced_by: Some(NodeId(248)), - }, - ); - ports.insert( - PortId(251), - Port { - id: PortId(251), - state: PortState::Resolved(TypeShape::new(DeclarationId(124))), - produced_by: Some(NodeId(249)), - }, - ); - ports.insert( - PortId(252), - Port { - id: PortId(252), - state: PortState::Resolved(TypeShape::new(DeclarationId(128))), - produced_by: None, - }, - ); - ports.insert( - PortId(253), - Port { - id: PortId(253), - state: PortState::Uninferred, - produced_by: Some(NodeId(251)), - }, - ); - ports.insert( - PortId(254), - Port { - id: PortId(254), - state: PortState::Resolved(TypeShape::new(DeclarationId(87))), - produced_by: Some(NodeId(252)), - }, - ); - ports.insert( - PortId(255), - Port { - id: PortId(255), - state: PortState::Resolved(TypeShape::new(DeclarationId(966))), - produced_by: None, - }, - ); - ports.insert( - PortId(256), - Port { - id: PortId(256), - state: PortState::Uninferred, - produced_by: Some(NodeId(254)), - }, - ); - ports.insert( - PortId(257), - Port { - id: PortId(257), - state: PortState::Resolved(TypeShape::new(DeclarationId(124))), - produced_by: Some(NodeId(255)), - }, - ); - ports.insert( - PortId(258), - Port { - id: PortId(258), - state: PortState::Resolved(TypeShape::new(DeclarationId(752))), - produced_by: None, - }, - ); - ports.insert( - PortId(259), - Port { - id: PortId(259), - state: PortState::Uninferred, - produced_by: Some(NodeId(257)), - }, - ); - ports.insert( - PortId(260), - Port { - id: PortId(260), - state: PortState::Uninferred, - produced_by: Some(NodeId(258)), - }, - ); - ports.insert( - PortId(261), - Port { - id: PortId(261), - state: PortState::Resolved(TypeShape::new(DeclarationId(124))), - produced_by: Some(NodeId(259)), - }, - ); - ports.insert( - PortId(262), - Port { - id: PortId(262), - state: PortState::Resolved(TypeShape::new(DeclarationId(195))), - produced_by: None, - }, - ); - ports.insert( - PortId(263), - Port { - id: PortId(263), - state: PortState::Uninferred, - produced_by: Some(NodeId(261)), - }, - ); - ports.insert( - PortId(264), - Port { - id: PortId(264), - state: PortState::Uninferred, - produced_by: Some(NodeId(262)), - }, - ); - ports.insert( - PortId(265), - Port { - id: PortId(265), - state: PortState::Uninferred, - produced_by: Some(NodeId(263)), - }, - ); - ports.insert( - PortId(266), - Port { - id: PortId(266), - state: PortState::Uninferred, - produced_by: Some(NodeId(264)), - }, - ); - ports.insert( - PortId(267), - Port { - id: PortId(267), - state: PortState::Uninferred, - produced_by: Some(NodeId(265)), - }, - ); - ports.insert( - PortId(268), - Port { - id: PortId(268), - state: PortState::Uninferred, - produced_by: Some(NodeId(266)), - }, - ); - ports.insert( - PortId(269), - Port { - id: PortId(269), - state: PortState::Uninferred, - produced_by: Some(NodeId(267)), - }, - ); - ports.insert( - PortId(270), - Port { - id: PortId(270), - state: PortState::Resolved(TypeShape::new(DeclarationId(124))), - produced_by: Some(NodeId(268)), - }, - ); - ports.insert( - PortId(271), - Port { - id: PortId(271), - state: PortState::Resolved(TypeShape::new(DeclarationId(195))), - produced_by: None, - }, - ); - ports.insert( - PortId(272), - Port { - id: PortId(272), - state: PortState::Uninferred, - produced_by: Some(NodeId(270)), - }, - ); - ports.insert( - PortId(273), - Port { - id: PortId(273), - state: PortState::Uninferred, - produced_by: Some(NodeId(271)), - }, - ); - ports.insert( - PortId(274), - Port { - id: PortId(274), - state: PortState::Uninferred, - produced_by: Some(NodeId(272)), - }, - ); - ports.insert( - PortId(275), - Port { - id: PortId(275), - state: PortState::Uninferred, - produced_by: Some(NodeId(273)), - }, - ); - ports.insert( - PortId(276), - Port { - id: PortId(276), - state: PortState::Uninferred, - produced_by: Some(NodeId(274)), - }, - ); - ports.insert( - PortId(277), - Port { - id: PortId(277), - state: PortState::Uninferred, - produced_by: Some(NodeId(275)), - }, - ); - ports.insert( - PortId(278), - Port { - id: PortId(278), - state: PortState::Uninferred, - produced_by: Some(NodeId(276)), - }, - ); - ports.insert( - PortId(279), - Port { - id: PortId(279), - state: PortState::Resolved(TypeShape::new(DeclarationId(124))), - produced_by: Some(NodeId(277)), - }, - ); - ports.insert( - PortId(280), - Port { - id: PortId(280), - state: PortState::Resolved(TypeShape::new(DeclarationId(195))), - produced_by: None, - }, - ); - ports.insert( - PortId(281), - Port { - id: PortId(281), - state: PortState::Uninferred, - produced_by: Some(NodeId(279)), - }, - ); - ports.insert( - PortId(282), - Port { - id: PortId(282), - state: PortState::Uninferred, - produced_by: Some(NodeId(280)), - }, - ); - ports.insert( - PortId(283), - Port { - id: PortId(283), - state: PortState::Uninferred, - produced_by: Some(NodeId(281)), - }, - ); - ports.insert( - PortId(284), - Port { - id: PortId(284), - state: PortState::Uninferred, - produced_by: Some(NodeId(282)), - }, - ); - ports.insert( - PortId(285), - Port { - id: PortId(285), - state: PortState::Uninferred, - produced_by: Some(NodeId(283)), - }, - ); - ports.insert( - PortId(286), - Port { - id: PortId(286), - state: PortState::Uninferred, - produced_by: Some(NodeId(284)), - }, - ); - ports.insert( - PortId(287), - Port { - id: PortId(287), - state: PortState::Uninferred, - produced_by: Some(NodeId(285)), - }, - ); - ports.insert( - PortId(288), - Port { - id: PortId(288), - state: PortState::Resolved(TypeShape::new(DeclarationId(124))), - produced_by: Some(NodeId(286)), - }, - ); - ports.insert( - PortId(289), - Port { - id: PortId(289), - state: PortState::Resolved(TypeShape::new(DeclarationId(195))), - produced_by: None, - }, - ); - ports.insert( - PortId(290), - Port { - id: PortId(290), - state: PortState::Uninferred, - produced_by: Some(NodeId(288)), - }, - ); - ports.insert( - PortId(291), - Port { - id: PortId(291), - state: PortState::Uninferred, - produced_by: Some(NodeId(289)), - }, - ); - ports.insert( - PortId(292), - Port { - id: PortId(292), - state: PortState::Uninferred, - produced_by: Some(NodeId(290)), - }, - ); - ports.insert( - PortId(293), - Port { - id: PortId(293), - state: PortState::Uninferred, - produced_by: Some(NodeId(291)), - }, - ); - ports.insert( - PortId(294), - Port { - id: PortId(294), - state: PortState::Uninferred, - produced_by: Some(NodeId(292)), - }, - ); - ports.insert( - PortId(295), - Port { - id: PortId(295), - state: PortState::Uninferred, - produced_by: Some(NodeId(293)), - }, - ); - ports.insert( - PortId(296), - Port { - id: PortId(296), - state: PortState::Uninferred, - produced_by: Some(NodeId(294)), - }, - ); - ports.insert( - PortId(297), - Port { - id: PortId(297), - state: PortState::Resolved(TypeShape::new(DeclarationId(124))), - produced_by: Some(NodeId(295)), - }, - ); - ports.insert( - PortId(298), - Port { - id: PortId(298), - state: PortState::Resolved(TypeShape::new(DeclarationId(829))), - produced_by: None, - }, - ); - ports.insert( - PortId(299), - Port { - id: PortId(299), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(300), - Port { - id: PortId(300), - state: PortState::Uninferred, - produced_by: Some(NodeId(297)), - }, - ); - ports.insert( - PortId(301), - Port { - id: PortId(301), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(302), - Port { - id: PortId(302), - state: PortState::Uninferred, - produced_by: Some(NodeId(298)), - }, - ); - ports.insert( - PortId(303), - Port { - id: PortId(303), - state: PortState::Resolved(TypeShape::new(DeclarationId(736))), - produced_by: Some(NodeId(299)), - }, - ); - ports.insert( - PortId(304), - Port { - id: PortId(304), - state: PortState::Resolved(TypeShape::new(DeclarationId(915))), - produced_by: None, - }, - ); - ports.insert( - PortId(305), - Port { - id: PortId(305), - state: PortState::Resolved(TypeShape::new(DeclarationId(915))), - produced_by: None, - }, - ); - ports.insert( - PortId(306), - Port { - id: PortId(306), - state: PortState::Resolved(TypeShape::new(DeclarationId(736))), - produced_by: Some(NodeId(301)), - }, - ); - ports.insert( - PortId(307), - Port { - id: PortId(307), - state: PortState::Resolved(TypeShape::new(DeclarationId(736))), - produced_by: Some(NodeId(302)), - }, - ); - ports.insert( - PortId(308), - Port { - id: PortId(308), - state: PortState::Resolved(TypeShape::new(DeclarationId(124))), - produced_by: Some(NodeId(303)), - }, - ); - ports.insert( - PortId(309), - Port { - id: PortId(309), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(310), - Port { - id: PortId(310), - state: PortState::Uninferred, - produced_by: Some(NodeId(305)), - }, - ); - ports.insert( - PortId(311), - Port { - id: PortId(311), - state: PortState::Resolved(TypeShape::new(DeclarationId(920))), - produced_by: Some(NodeId(306)), - }, - ); - ports.insert( - PortId(312), - Port { - id: PortId(312), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(313), - Port { - id: PortId(313), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(314), - Port { - id: PortId(314), - state: PortState::Uninferred, - produced_by: Some(NodeId(308)), - }, - ); - ports.insert( - PortId(315), - Port { - id: PortId(315), - state: PortState::Uninferred, - produced_by: Some(NodeId(309)), - }, - ); - ports.insert( - PortId(316), - Port { - id: PortId(316), - state: PortState::Resolved(TypeShape::new(DeclarationId(2172))), - produced_by: Some(NodeId(310)), - }, - ); - ports.insert( - PortId(317), - Port { - id: PortId(317), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(318), - Port { - id: PortId(318), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(319), - Port { - id: PortId(319), - state: PortState::Resolved(TypeShape::new(DeclarationId(2173))), - produced_by: None, - }, - ); - ports.insert( - PortId(320), - Port { - id: PortId(320), - state: PortState::Resolved(TypeShape::new(DeclarationId(2174))), - produced_by: Some(NodeId(312)), - }, - ); - ports.insert( - PortId(321), - Port { - id: PortId(321), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(322), - Port { - id: PortId(322), - state: PortState::Uninferred, - produced_by: Some(NodeId(314)), - }, - ); - ports.insert( - PortId(323), - Port { - id: PortId(323), - state: PortState::Uninferred, - produced_by: Some(NodeId(315)), - }, - ); - ports.insert( - PortId(324), - Port { - id: PortId(324), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(325), - Port { - id: PortId(325), - state: PortState::Uninferred, - produced_by: Some(NodeId(316)), - }, - ); - ports.insert( - PortId(326), - Port { - id: PortId(326), - state: PortState::Resolved(TypeShape::new(DeclarationId(124))), - produced_by: Some(NodeId(317)), - }, - ); - ports.insert( - PortId(327), - Port { - id: PortId(327), - state: PortState::Resolved(TypeShape::new(DeclarationId(918))), - produced_by: None, - }, - ); - ports.insert( - PortId(328), - Port { - id: PortId(328), - state: PortState::Uninferred, - produced_by: Some(NodeId(319)), - }, - ); - ports.insert( - PortId(329), - Port { - id: PortId(329), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(330), - Port { - id: PortId(330), - state: PortState::Uninferred, - produced_by: Some(NodeId(320)), - }, - ); - ports.insert( - PortId(331), - Port { - id: PortId(331), - state: PortState::Uninferred, - produced_by: Some(NodeId(321)), - }, - ); - ports.insert( - PortId(332), - Port { - id: PortId(332), - state: PortState::Uninferred, - produced_by: Some(NodeId(322)), - }, - ); - ports.insert( - PortId(333), - Port { - id: PortId(333), - state: PortState::Uninferred, - produced_by: Some(NodeId(323)), - }, - ); - ports.insert( - PortId(334), - Port { - id: PortId(334), - state: PortState::Uninferred, - produced_by: Some(NodeId(324)), - }, - ); - ports.insert( - PortId(335), - Port { - id: PortId(335), - state: PortState::Resolved(TypeShape::new(DeclarationId(87))), - produced_by: Some(NodeId(325)), - }, - ); - ports.insert( - PortId(336), - Port { - id: PortId(336), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(337), - Port { - id: PortId(337), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(338), - Port { - id: PortId(338), - state: PortState::Uninferred, - produced_by: Some(NodeId(327)), - }, - ); - ports.insert( - PortId(339), - Port { - id: PortId(339), - state: PortState::Uninferred, - produced_by: Some(NodeId(328)), - }, - ); - ports.insert( - PortId(340), - Port { - id: PortId(340), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: Some(NodeId(329)), - }, - ); - ports.insert( - PortId(341), - Port { - id: PortId(341), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(342), - Port { - id: PortId(342), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(343), - Port { - id: PortId(343), - state: PortState::Uninferred, - produced_by: Some(NodeId(331)), - }, - ); - ports.insert( - PortId(344), - Port { - id: PortId(344), - state: PortState::Uninferred, - produced_by: Some(NodeId(332)), - }, - ); - ports.insert( - PortId(345), - Port { - id: PortId(345), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: Some(NodeId(333)), - }, - ); - ports.insert( - PortId(346), - Port { - id: PortId(346), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(347), - Port { - id: PortId(347), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(348), - Port { - id: PortId(348), - state: PortState::Uninferred, - produced_by: Some(NodeId(335)), - }, - ); - ports.insert( - PortId(349), - Port { - id: PortId(349), - state: PortState::Uninferred, - produced_by: Some(NodeId(336)), - }, - ); - ports.insert( - PortId(350), - Port { - id: PortId(350), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: Some(NodeId(337)), - }, - ); - ports.insert( - PortId(351), - Port { - id: PortId(351), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(352), - Port { - id: PortId(352), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(353), - Port { - id: PortId(353), - state: PortState::Uninferred, - produced_by: Some(NodeId(339)), - }, - ); - ports.insert( - PortId(354), - Port { - id: PortId(354), - state: PortState::Uninferred, - produced_by: Some(NodeId(340)), - }, - ); - ports.insert( - PortId(355), - Port { - id: PortId(355), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: Some(NodeId(341)), - }, - ); - ports.insert( - PortId(356), - Port { - id: PortId(356), - state: PortState::Resolved(TypeShape::new(DeclarationId(2175))), - produced_by: None, - }, - ); - ports.insert( - PortId(357), - Port { - id: PortId(357), - state: PortState::Uninferred, - produced_by: Some(NodeId(343)), - }, - ); - ports.insert( - PortId(358), - Port { - id: PortId(358), - state: PortState::Uninferred, - produced_by: Some(NodeId(344)), - }, - ); - ports.insert( - PortId(359), - Port { - id: PortId(359), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: Some(NodeId(345)), - }, - ); - ports.insert( - PortId(360), - Port { - id: PortId(360), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(361), - Port { - id: PortId(361), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(362), - Port { - id: PortId(362), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(363), - Port { - id: PortId(363), - state: PortState::Uninferred, - produced_by: Some(NodeId(347)), - }, - ); - ports.insert( - PortId(364), - Port { - id: PortId(364), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(365), - Port { - id: PortId(365), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(366), - Port { - id: PortId(366), - state: PortState::Uninferred, - produced_by: Some(NodeId(348)), - }, - ); - ports.insert( - PortId(367), - Port { - id: PortId(367), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(368), - Port { - id: PortId(368), - state: PortState::Uninferred, - produced_by: Some(NodeId(349)), - }, - ); - ports.insert( - PortId(369), - Port { - id: PortId(369), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(370), - Port { - id: PortId(370), - state: PortState::Uninferred, - produced_by: Some(NodeId(350)), - }, - ); - ports.insert( - PortId(371), - Port { - id: PortId(371), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(372), - Port { - id: PortId(372), - state: PortState::Uninferred, - produced_by: Some(NodeId(351)), - }, - ); - ports.insert( - PortId(373), - Port { - id: PortId(373), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(374), - Port { - id: PortId(374), - state: PortState::Uninferred, - produced_by: Some(NodeId(352)), - }, - ); - ports.insert( - PortId(375), - Port { - id: PortId(375), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(376), - Port { - id: PortId(376), - state: PortState::Uninferred, - produced_by: Some(NodeId(353)), - }, - ); - ports.insert( - PortId(377), - Port { - id: PortId(377), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(378), - Port { - id: PortId(378), - state: PortState::Uninferred, - produced_by: Some(NodeId(354)), - }, - ); - ports.insert( - PortId(379), - Port { - id: PortId(379), - state: PortState::Uninferred, - produced_by: Some(NodeId(355)), - }, - ); - ports.insert( - PortId(380), - Port { - id: PortId(380), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(381), - Port { - id: PortId(381), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(382), - Port { - id: PortId(382), - state: PortState::Uninferred, - produced_by: Some(NodeId(356)), - }, - ); - ports.insert( - PortId(383), - Port { - id: PortId(383), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(384), - Port { - id: PortId(384), - state: PortState::Uninferred, - produced_by: Some(NodeId(357)), - }, - ); - ports.insert( - PortId(385), - Port { - id: PortId(385), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(386), - Port { - id: PortId(386), - state: PortState::Uninferred, - produced_by: Some(NodeId(358)), - }, - ); - ports.insert( - PortId(387), - Port { - id: PortId(387), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(388), - Port { - id: PortId(388), - state: PortState::Uninferred, - produced_by: Some(NodeId(359)), - }, - ); - ports.insert( - PortId(389), - Port { - id: PortId(389), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(390), - Port { - id: PortId(390), - state: PortState::Uninferred, - produced_by: Some(NodeId(360)), - }, - ); - ports.insert( - PortId(391), - Port { - id: PortId(391), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(392), - Port { - id: PortId(392), - state: PortState::Uninferred, - produced_by: Some(NodeId(361)), - }, - ); - ports.insert( - PortId(393), - Port { - id: PortId(393), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(394), - Port { - id: PortId(394), - state: PortState::Uninferred, - produced_by: Some(NodeId(362)), - }, - ); - ports.insert( - PortId(395), - Port { - id: PortId(395), - state: PortState::Uninferred, - produced_by: Some(NodeId(363)), - }, - ); - ports.insert( - PortId(396), - Port { - id: PortId(396), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(397), - Port { - id: PortId(397), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(398), - Port { - id: PortId(398), - state: PortState::Uninferred, - produced_by: Some(NodeId(364)), - }, - ); - ports.insert( - PortId(399), - Port { - id: PortId(399), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(400), - Port { - id: PortId(400), - state: PortState::Uninferred, - produced_by: Some(NodeId(365)), - }, - ); - ports.insert( - PortId(401), - Port { - id: PortId(401), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(402), - Port { - id: PortId(402), - state: PortState::Uninferred, - produced_by: Some(NodeId(366)), - }, - ); - ports.insert( - PortId(403), - Port { - id: PortId(403), - state: PortState::Uninferred, - produced_by: Some(NodeId(367)), - }, - ); - ports.insert( - PortId(404), - Port { - id: PortId(404), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(405), - Port { - id: PortId(405), - state: PortState::Uninferred, - produced_by: Some(NodeId(368)), - }, - ); - ports.insert( - PortId(406), - Port { - id: PortId(406), - state: PortState::Uninferred, - produced_by: Some(NodeId(369)), - }, - ); - ports.insert( - PortId(407), - Port { - id: PortId(407), - state: PortState::Uninferred, - produced_by: Some(NodeId(370)), - }, - ); - ports.insert( - PortId(408), - Port { - id: PortId(408), - state: PortState::Uninferred, - produced_by: Some(NodeId(371)), - }, - ); - ports.insert( - PortId(409), - Port { - id: PortId(409), - state: PortState::Uninferred, - produced_by: Some(NodeId(372)), - }, - ); - ports.insert( - PortId(410), - Port { - id: PortId(410), - state: PortState::Uninferred, - produced_by: Some(NodeId(373)), - }, - ); - ports.insert( - PortId(411), - Port { - id: PortId(411), - state: PortState::Uninferred, - produced_by: Some(NodeId(374)), - }, - ); - ports.insert( - PortId(412), - Port { - id: PortId(412), - state: PortState::Uninferred, - produced_by: Some(NodeId(375)), - }, - ); - ports.insert( - PortId(413), - Port { - id: PortId(413), - state: PortState::Uninferred, - produced_by: Some(NodeId(376)), - }, - ); - ports.insert( - PortId(414), - Port { - id: PortId(414), - state: PortState::Uninferred, - produced_by: Some(NodeId(377)), - }, - ); - ports.insert( - PortId(415), - Port { - id: PortId(415), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(416), - Port { - id: PortId(416), - state: PortState::Uninferred, - produced_by: Some(NodeId(378)), - }, - ); - ports.insert( - PortId(417), - Port { - id: PortId(417), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(418), - Port { - id: PortId(418), - state: PortState::Uninferred, - produced_by: Some(NodeId(379)), - }, - ); - ports.insert( - PortId(419), - Port { - id: PortId(419), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(420), - Port { - id: PortId(420), - state: PortState::Uninferred, - produced_by: Some(NodeId(380)), - }, - ); - ports.insert( - PortId(421), - Port { - id: PortId(421), - state: PortState::Uninferred, - produced_by: Some(NodeId(381)), - }, - ); - ports.insert( - PortId(422), - Port { - id: PortId(422), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(423), - Port { - id: PortId(423), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(424), - Port { - id: PortId(424), - state: PortState::Uninferred, - produced_by: Some(NodeId(382)), - }, - ); - ports.insert( - PortId(425), - Port { - id: PortId(425), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(426), - Port { - id: PortId(426), - state: PortState::Uninferred, - produced_by: Some(NodeId(383)), - }, - ); - ports.insert( - PortId(427), - Port { - id: PortId(427), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(428), - Port { - id: PortId(428), - state: PortState::Uninferred, - produced_by: Some(NodeId(384)), - }, - ); - ports.insert( - PortId(429), - Port { - id: PortId(429), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(430), - Port { - id: PortId(430), - state: PortState::Uninferred, - produced_by: Some(NodeId(385)), - }, - ); - ports.insert( - PortId(431), - Port { - id: PortId(431), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(432), - Port { - id: PortId(432), - state: PortState::Uninferred, - produced_by: Some(NodeId(386)), - }, - ); - ports.insert( - PortId(433), - Port { - id: PortId(433), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(434), - Port { - id: PortId(434), - state: PortState::Uninferred, - produced_by: Some(NodeId(387)), - }, - ); - ports.insert( - PortId(435), - Port { - id: PortId(435), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(436), - Port { - id: PortId(436), - state: PortState::Uninferred, - produced_by: Some(NodeId(388)), - }, - ); - ports.insert( - PortId(437), - Port { - id: PortId(437), - state: PortState::Uninferred, - produced_by: Some(NodeId(389)), - }, - ); - ports.insert( - PortId(438), - Port { - id: PortId(438), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(439), - Port { - id: PortId(439), - state: PortState::Uninferred, - produced_by: Some(NodeId(390)), - }, - ); - ports.insert( - PortId(440), - Port { - id: PortId(440), - state: PortState::Uninferred, - produced_by: Some(NodeId(391)), - }, - ); - ports.insert( - PortId(441), - Port { - id: PortId(441), - state: PortState::Uninferred, - produced_by: Some(NodeId(392)), - }, - ); - ports.insert( - PortId(442), - Port { - id: PortId(442), - state: PortState::Uninferred, - produced_by: Some(NodeId(393)), - }, - ); - ports.insert( - PortId(443), - Port { - id: PortId(443), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(444), - Port { - id: PortId(444), - state: PortState::Uninferred, - produced_by: Some(NodeId(394)), - }, - ); - ports.insert( - PortId(445), - Port { - id: PortId(445), - state: PortState::Uninferred, - produced_by: Some(NodeId(395)), - }, - ); - ports.insert( - PortId(446), - Port { - id: PortId(446), - state: PortState::Uninferred, - produced_by: Some(NodeId(396)), - }, - ); - ports.insert( - PortId(447), - Port { - id: PortId(447), - state: PortState::Uninferred, - produced_by: Some(NodeId(397)), - }, - ); - ports.insert( - PortId(448), - Port { - id: PortId(448), - state: PortState::Resolved(TypeShape::new(DeclarationId(124))), - produced_by: Some(NodeId(398)), - }, - ); - ports.insert( - PortId(449), - Port { - id: PortId(449), - state: PortState::Resolved(TypeShape::new(DeclarationId(915))), - produced_by: None, - }, - ); - ports.insert( - PortId(450), - Port { - id: PortId(450), - state: PortState::Resolved(TypeShape::new(DeclarationId(915))), - produced_by: None, - }, - ); - ports.insert( - PortId(451), - Port { - id: PortId(451), - state: PortState::Resolved(TypeShape::new(DeclarationId(124))), - produced_by: Some(NodeId(400)), - }, - ); - ports.insert( - PortId(452), - Port { - id: PortId(452), - state: PortState::Resolved(TypeShape::new(DeclarationId(935))), - produced_by: None, - }, - ); - ports.insert( - PortId(453), - Port { - id: PortId(453), - state: PortState::Resolved(TypeShape::new(DeclarationId(935))), - produced_by: None, - }, - ); - ports.insert( - PortId(454), - Port { - id: PortId(454), - state: PortState::Uninferred, - produced_by: Some(NodeId(402)), - }, - ); - ports.insert( - PortId(455), - Port { - id: PortId(455), - state: PortState::Uninferred, - produced_by: Some(NodeId(403)), - }, - ); - ports.insert( - PortId(456), - Port { - id: PortId(456), - state: PortState::Uninferred, - produced_by: Some(NodeId(404)), - }, - ); - ports.insert( - PortId(457), - Port { - id: PortId(457), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(458), - Port { - id: PortId(458), - state: PortState::Uninferred, - produced_by: Some(NodeId(405)), - }, - ); - ports.insert( - PortId(459), - Port { - id: PortId(459), - state: PortState::Uninferred, - produced_by: Some(NodeId(406)), - }, - ); - ports.insert( - PortId(460), - Port { - id: PortId(460), - state: PortState::Uninferred, - produced_by: Some(NodeId(407)), - }, - ); - ports.insert( - PortId(461), - Port { - id: PortId(461), - state: PortState::Uninferred, - produced_by: Some(NodeId(408)), - }, - ); - ports.insert( - PortId(462), - Port { - id: PortId(462), - state: PortState::Uninferred, - produced_by: Some(NodeId(409)), - }, - ); - ports.insert( - PortId(463), - Port { - id: PortId(463), - state: PortState::Uninferred, - produced_by: Some(NodeId(410)), - }, - ); - ports.insert( - PortId(464), - Port { - id: PortId(464), - state: PortState::Uninferred, - produced_by: Some(NodeId(411)), - }, - ); - ports.insert( - PortId(465), - Port { - id: PortId(465), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(466), - Port { - id: PortId(466), - state: PortState::Uninferred, - produced_by: Some(NodeId(412)), - }, - ); - ports.insert( - PortId(467), - Port { - id: PortId(467), - state: PortState::Uninferred, - produced_by: Some(NodeId(413)), - }, - ); - ports.insert( - PortId(468), - Port { - id: PortId(468), - state: PortState::Uninferred, - produced_by: Some(NodeId(414)), - }, - ); - ports.insert( - PortId(469), - Port { - id: PortId(469), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(470), - Port { - id: PortId(470), - state: PortState::Uninferred, - produced_by: Some(NodeId(415)), - }, - ); - ports.insert( - PortId(471), - Port { - id: PortId(471), - state: PortState::Uninferred, - produced_by: Some(NodeId(416)), - }, - ); - ports.insert( - PortId(472), - Port { - id: PortId(472), - state: PortState::Uninferred, - produced_by: Some(NodeId(417)), - }, - ); - ports.insert( - PortId(473), - Port { - id: PortId(473), - state: PortState::Uninferred, - produced_by: Some(NodeId(418)), - }, - ); - ports.insert( - PortId(474), - Port { - id: PortId(474), - state: PortState::Uninferred, - produced_by: Some(NodeId(419)), - }, - ); - ports.insert( - PortId(475), - Port { - id: PortId(475), - state: PortState::Uninferred, - produced_by: Some(NodeId(420)), - }, - ); - ports.insert( - PortId(476), - Port { - id: PortId(476), - state: PortState::Uninferred, - produced_by: Some(NodeId(421)), - }, - ); - ports.insert( - PortId(477), - Port { - id: PortId(477), - state: PortState::Uninferred, - produced_by: Some(NodeId(422)), - }, - ); - ports.insert( - PortId(478), - Port { - id: PortId(478), - state: PortState::Uninferred, - produced_by: Some(NodeId(423)), - }, - ); - ports.insert( - PortId(479), - Port { - id: PortId(479), - state: PortState::Uninferred, - produced_by: Some(NodeId(424)), - }, - ); - ports.insert( - PortId(480), - Port { - id: PortId(480), - state: PortState::Uninferred, - produced_by: Some(NodeId(425)), - }, - ); - ports.insert( - PortId(481), - Port { - id: PortId(481), - state: PortState::Uninferred, - produced_by: Some(NodeId(426)), - }, - ); - ports.insert( - PortId(482), - Port { - id: PortId(482), - state: PortState::Uninferred, - produced_by: Some(NodeId(427)), - }, - ); - ports.insert( - PortId(483), - Port { - id: PortId(483), - state: PortState::Uninferred, - produced_by: Some(NodeId(428)), - }, - ); - ports.insert( - PortId(484), - Port { - id: PortId(484), - state: PortState::Uninferred, - produced_by: Some(NodeId(429)), - }, - ); - ports.insert( - PortId(485), - Port { - id: PortId(485), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(486), - Port { - id: PortId(486), - state: PortState::Uninferred, - produced_by: Some(NodeId(430)), - }, - ); - ports.insert( - PortId(487), - Port { - id: PortId(487), - state: PortState::Uninferred, - produced_by: Some(NodeId(431)), - }, - ); - ports.insert( - PortId(488), - Port { - id: PortId(488), - state: PortState::Uninferred, - produced_by: Some(NodeId(432)), - }, - ); - ports.insert( - PortId(489), - Port { - id: PortId(489), - state: PortState::Uninferred, - produced_by: Some(NodeId(433)), - }, - ); - ports.insert( - PortId(490), - Port { - id: PortId(490), - state: PortState::Uninferred, - produced_by: Some(NodeId(434)), - }, - ); - ports.insert( - PortId(491), - Port { - id: PortId(491), - state: PortState::Uninferred, - produced_by: Some(NodeId(435)), - }, - ); - ports.insert( - PortId(492), - Port { - id: PortId(492), - state: PortState::Uninferred, - produced_by: Some(NodeId(436)), - }, - ); - ports.insert( - PortId(493), - Port { - id: PortId(493), - state: PortState::Uninferred, - produced_by: Some(NodeId(437)), - }, - ); - ports.insert( - PortId(494), - Port { - id: PortId(494), - state: PortState::Uninferred, - produced_by: Some(NodeId(438)), - }, - ); - ports.insert( - PortId(495), - Port { - id: PortId(495), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(496), - Port { - id: PortId(496), - state: PortState::Uninferred, - produced_by: Some(NodeId(439)), - }, - ); - ports.insert( - PortId(497), - Port { - id: PortId(497), - state: PortState::Uninferred, - produced_by: Some(NodeId(440)), - }, - ); - ports.insert( - PortId(498), - Port { - id: PortId(498), - state: PortState::Uninferred, - produced_by: Some(NodeId(441)), - }, - ); - ports.insert( - PortId(499), - Port { - id: PortId(499), - state: PortState::Uninferred, - produced_by: Some(NodeId(442)), - }, - ); - ports.insert( - PortId(500), - Port { - id: PortId(500), - state: PortState::Uninferred, - produced_by: Some(NodeId(443)), - }, - ); - ports.insert( - PortId(501), - Port { - id: PortId(501), - state: PortState::Uninferred, - produced_by: Some(NodeId(444)), - }, - ); - ports.insert( - PortId(502), - Port { - id: PortId(502), - state: PortState::Uninferred, - produced_by: Some(NodeId(445)), - }, - ); - ports.insert( - PortId(503), - Port { - id: PortId(503), - state: PortState::Uninferred, - produced_by: Some(NodeId(446)), - }, - ); - ports.insert( - PortId(504), - Port { - id: PortId(504), - state: PortState::Uninferred, - produced_by: Some(NodeId(447)), - }, - ); - ports.insert( - PortId(505), - Port { - id: PortId(505), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(506), - Port { - id: PortId(506), - state: PortState::Uninferred, - produced_by: Some(NodeId(448)), - }, - ); - ports.insert( - PortId(507), - Port { - id: PortId(507), - state: PortState::Uninferred, - produced_by: Some(NodeId(449)), - }, - ); - ports.insert( - PortId(508), - Port { - id: PortId(508), - state: PortState::Uninferred, - produced_by: Some(NodeId(450)), - }, - ); - ports.insert( - PortId(509), - Port { - id: PortId(509), - state: PortState::Uninferred, - produced_by: Some(NodeId(451)), - }, - ); - ports.insert( - PortId(510), - Port { - id: PortId(510), - state: PortState::Uninferred, - produced_by: Some(NodeId(452)), - }, - ); - ports.insert( - PortId(511), - Port { - id: PortId(511), - state: PortState::Uninferred, - produced_by: Some(NodeId(453)), - }, - ); - ports.insert( - PortId(512), - Port { - id: PortId(512), - state: PortState::Uninferred, - produced_by: Some(NodeId(454)), - }, - ); - ports.insert( - PortId(513), - Port { - id: PortId(513), - state: PortState::Uninferred, - produced_by: Some(NodeId(455)), - }, - ); - ports.insert( - PortId(514), - Port { - id: PortId(514), - state: PortState::Uninferred, - produced_by: Some(NodeId(456)), - }, - ); - ports.insert( - PortId(515), - Port { - id: PortId(515), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(516), - Port { - id: PortId(516), - state: PortState::Uninferred, - produced_by: Some(NodeId(457)), - }, - ); - ports.insert( - PortId(517), - Port { - id: PortId(517), - state: PortState::Uninferred, - produced_by: Some(NodeId(458)), - }, - ); - ports.insert( - PortId(518), - Port { - id: PortId(518), - state: PortState::Uninferred, - produced_by: Some(NodeId(459)), - }, - ); - ports.insert( - PortId(519), - Port { - id: PortId(519), - state: PortState::Uninferred, - produced_by: Some(NodeId(460)), - }, - ); - ports.insert( - PortId(520), - Port { - id: PortId(520), - state: PortState::Uninferred, - produced_by: Some(NodeId(461)), - }, - ); - ports.insert( - PortId(521), - Port { - id: PortId(521), - state: PortState::Uninferred, - produced_by: Some(NodeId(462)), - }, - ); - ports.insert( - PortId(522), - Port { - id: PortId(522), - state: PortState::Uninferred, - produced_by: Some(NodeId(463)), - }, - ); - ports.insert( - PortId(523), - Port { - id: PortId(523), - state: PortState::Uninferred, - produced_by: Some(NodeId(464)), - }, - ); - ports.insert( - PortId(524), - Port { - id: PortId(524), - state: PortState::Uninferred, - produced_by: Some(NodeId(465)), - }, - ); - ports.insert( - PortId(525), - Port { - id: PortId(525), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(526), - Port { - id: PortId(526), - state: PortState::Uninferred, - produced_by: Some(NodeId(466)), - }, - ); - ports.insert( - PortId(527), - Port { - id: PortId(527), - state: PortState::Uninferred, - produced_by: Some(NodeId(467)), - }, - ); - ports.insert( - PortId(528), - Port { - id: PortId(528), - state: PortState::Uninferred, - produced_by: Some(NodeId(468)), - }, - ); - ports.insert( - PortId(529), - Port { - id: PortId(529), - state: PortState::Uninferred, - produced_by: Some(NodeId(469)), - }, - ); - ports.insert( - PortId(530), - Port { - id: PortId(530), - state: PortState::Resolved(TypeShape::new(DeclarationId(124))), - produced_by: Some(NodeId(470)), - }, - ); - ports.insert( - PortId(531), - Port { - id: PortId(531), - state: PortState::Resolved(TypeShape::new(DeclarationId(935))), - produced_by: None, - }, - ); - ports.insert( - PortId(532), - Port { - id: PortId(532), - state: PortState::Resolved(TypeShape::new(DeclarationId(935))), - produced_by: None, - }, - ); - ports.insert( - PortId(533), - Port { - id: PortId(533), - state: PortState::Uninferred, - produced_by: Some(NodeId(472)), - }, - ); - ports.insert( - PortId(534), - Port { - id: PortId(534), - state: PortState::Resolved(TypeShape::new(DeclarationId(935))), - produced_by: Some(NodeId(473)), - }, - ); - ports.insert( - PortId(535), - Port { - id: PortId(535), - state: PortState::Resolved(TypeShape::new(DeclarationId(935))), - produced_by: None, - }, - ); - ports.insert( - PortId(536), - Port { - id: PortId(536), - state: PortState::Resolved(TypeShape::new(DeclarationId(935))), - produced_by: None, - }, - ); - ports.insert( - PortId(537), - Port { - id: PortId(537), - state: PortState::Uninferred, - produced_by: Some(NodeId(475)), - }, - ); - ports.insert( - PortId(538), - Port { - id: PortId(538), - state: PortState::Resolved(TypeShape::new(DeclarationId(935))), - produced_by: Some(NodeId(476)), - }, - ); - ports.insert( - PortId(539), - Port { - id: PortId(539), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(540), - Port { - id: PortId(540), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(541), - Port { - id: PortId(541), - state: PortState::Uninferred, - produced_by: Some(NodeId(478)), - }, - ); - ports.insert( - PortId(542), - Port { - id: PortId(542), - state: PortState::Uninferred, - produced_by: Some(NodeId(479)), - }, - ); - ports.insert( - PortId(543), - Port { - id: PortId(543), - state: PortState::Uninferred, - produced_by: Some(NodeId(480)), - }, - ); - ports.insert( - PortId(544), - Port { - id: PortId(544), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(545), - Port { - id: PortId(545), - state: PortState::Uninferred, - produced_by: Some(NodeId(481)), - }, - ); - ports.insert( - PortId(546), - Port { - id: PortId(546), - state: PortState::Uninferred, - produced_by: Some(NodeId(482)), - }, - ); - ports.insert( - PortId(547), - Port { - id: PortId(547), - state: PortState::Uninferred, - produced_by: Some(NodeId(483)), - }, - ); - ports.insert( - PortId(548), - Port { - id: PortId(548), - state: PortState::Uninferred, - produced_by: Some(NodeId(484)), - }, - ); - ports.insert( - PortId(549), - Port { - id: PortId(549), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: Some(NodeId(485)), - }, - ); - ports.insert( - PortId(550), - Port { - id: PortId(550), - state: PortState::Resolved(TypeShape::new(DeclarationId(2176))), - produced_by: None, - }, - ); - ports.insert( - PortId(551), - Port { - id: PortId(551), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: Some(NodeId(487)), - }, - ); - ports.insert( - PortId(552), - Port { - id: PortId(552), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: Some(NodeId(488)), - }, - ); - ports.insert( - PortId(553), - Port { - id: PortId(553), - state: PortState::Resolved(TypeShape::new(DeclarationId(2173))), - produced_by: Some(NodeId(489)), - }, - ); - ports.insert( - PortId(554), - Port { - id: PortId(554), - state: PortState::Uninferred, - produced_by: Some(NodeId(490)), - }, - ); - ports.insert( - PortId(555), - Port { - id: PortId(555), - state: PortState::Resolved(TypeShape::new(DeclarationId(2177))), - produced_by: Some(NodeId(491)), - }, - ); - ports.insert( - PortId(556), - Port { - id: PortId(556), - state: PortState::Resolved(TypeShape::new(DeclarationId(2178))), - produced_by: None, - }, - ); - ports.insert( - PortId(557), - Port { - id: PortId(557), - state: PortState::Uninferred, - produced_by: Some(NodeId(493)), - }, - ); - ports.insert( - PortId(558), - Port { - id: PortId(558), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(559), - Port { - id: PortId(559), - state: PortState::Uninferred, - produced_by: Some(NodeId(494)), - }, - ); - ports.insert( - PortId(560), - Port { - id: PortId(560), - state: PortState::Uninferred, - produced_by: Some(NodeId(495)), - }, - ); - ports.insert( - PortId(561), - Port { - id: PortId(561), - state: PortState::Uninferred, - produced_by: Some(NodeId(496)), - }, - ); - ports.insert( - PortId(562), - Port { - id: PortId(562), - state: PortState::Uninferred, - produced_by: Some(NodeId(497)), - }, - ); - ports.insert( - PortId(563), - Port { - id: PortId(563), - state: PortState::Uninferred, - produced_by: Some(NodeId(498)), - }, - ); - ports.insert( - PortId(564), - Port { - id: PortId(564), - state: PortState::Uninferred, - produced_by: Some(NodeId(499)), - }, - ); - ports.insert( - PortId(565), - Port { - id: PortId(565), - state: PortState::Uninferred, - produced_by: Some(NodeId(500)), - }, - ); - ports.insert( - PortId(566), - Port { - id: PortId(566), - state: PortState::Uninferred, - produced_by: Some(NodeId(501)), - }, - ); - ports.insert( - PortId(567), - Port { - id: PortId(567), - state: PortState::Uninferred, - produced_by: Some(NodeId(502)), - }, - ); - ports.insert( - PortId(568), - Port { - id: PortId(568), - state: PortState::Uninferred, - produced_by: Some(NodeId(503)), - }, - ); - ports.insert( - PortId(569), - Port { - id: PortId(569), - state: PortState::Resolved(TypeShape::new(DeclarationId(2179))), - produced_by: Some(NodeId(504)), - }, - ); - ports.insert( - PortId(570), - Port { - id: PortId(570), - state: PortState::Resolved(TypeShape::new(DeclarationId(2180))), - produced_by: None, - }, - ); - ports.insert( - PortId(571), - Port { - id: PortId(571), - state: PortState::Uninferred, - produced_by: Some(NodeId(506)), - }, - ); - ports.insert( - PortId(572), - Port { - id: PortId(572), - state: PortState::Uninferred, - produced_by: Some(NodeId(507)), - }, - ); - ports.insert( - PortId(573), - Port { - id: PortId(573), - state: PortState::Uninferred, - produced_by: Some(NodeId(508)), - }, - ); - ports.insert( - PortId(574), - Port { - id: PortId(574), - state: PortState::Uninferred, - produced_by: Some(NodeId(509)), - }, - ); - ports.insert( - PortId(575), - Port { - id: PortId(575), - state: PortState::Uninferred, - produced_by: Some(NodeId(510)), - }, - ); - ports.insert( - PortId(576), - Port { - id: PortId(576), - state: PortState::Resolved(TypeShape::new(DeclarationId(2181))), - produced_by: Some(NodeId(511)), - }, - ); - ports.insert( - PortId(577), - Port { - id: PortId(577), - state: PortState::Resolved(TypeShape::new(DeclarationId(2182))), - produced_by: None, - }, - ); - ports.insert( - PortId(578), - Port { - id: PortId(578), - state: PortState::Uninferred, - produced_by: Some(NodeId(513)), - }, - ); - ports.insert( - PortId(579), - Port { - id: PortId(579), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(580), - Port { - id: PortId(580), - state: PortState::Uninferred, - produced_by: Some(NodeId(514)), - }, - ); - ports.insert( - PortId(581), - Port { - id: PortId(581), - state: PortState::Uninferred, - produced_by: Some(NodeId(515)), - }, - ); - ports.insert( - PortId(582), - Port { - id: PortId(582), - state: PortState::Uninferred, - produced_by: Some(NodeId(516)), - }, - ); - ports.insert( - PortId(583), - Port { - id: PortId(583), - state: PortState::Uninferred, - produced_by: Some(NodeId(517)), - }, - ); - ports.insert( - PortId(584), - Port { - id: PortId(584), - state: PortState::Uninferred, - produced_by: Some(NodeId(518)), - }, - ); - ports.insert( - PortId(585), - Port { - id: PortId(585), - state: PortState::Uninferred, - produced_by: Some(NodeId(519)), - }, - ); - ports.insert( - PortId(586), - Port { - id: PortId(586), - state: PortState::Resolved(TypeShape::new(DeclarationId(124))), - produced_by: Some(NodeId(520)), - }, - ); - ports.insert( - PortId(587), - Port { - id: PortId(587), - state: PortState::Resolved(TypeShape::new(DeclarationId(2183))), - produced_by: None, - }, - ); - ports.insert( - PortId(588), - Port { - id: PortId(588), - state: PortState::Uninferred, - produced_by: Some(NodeId(522)), - }, - ); - ports.insert( - PortId(589), - Port { - id: PortId(589), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(590), - Port { - id: PortId(590), - state: PortState::Uninferred, - produced_by: Some(NodeId(523)), - }, - ); - ports.insert( - PortId(591), - Port { - id: PortId(591), - state: PortState::Uninferred, - produced_by: Some(NodeId(524)), - }, - ); - ports.insert( - PortId(592), - Port { - id: PortId(592), - state: PortState::Uninferred, - produced_by: Some(NodeId(525)), - }, - ); - ports.insert( - PortId(593), - Port { - id: PortId(593), - state: PortState::Uninferred, - produced_by: Some(NodeId(526)), - }, - ); - ports.insert( - PortId(594), - Port { - id: PortId(594), - state: PortState::Uninferred, - produced_by: Some(NodeId(527)), - }, - ); - ports.insert( - PortId(595), - Port { - id: PortId(595), - state: PortState::Uninferred, - produced_by: Some(NodeId(528)), - }, - ); - ports.insert( - PortId(596), - Port { - id: PortId(596), - state: PortState::Uninferred, - produced_by: Some(NodeId(529)), - }, - ); - ports.insert( - PortId(597), - Port { - id: PortId(597), - state: PortState::Uninferred, - produced_by: Some(NodeId(530)), - }, - ); - ports.insert( - PortId(598), - Port { - id: PortId(598), - state: PortState::Uninferred, - produced_by: Some(NodeId(531)), - }, - ); - ports.insert( - PortId(599), - Port { - id: PortId(599), - state: PortState::Uninferred, - produced_by: Some(NodeId(532)), - }, - ); - ports.insert( - PortId(600), - Port { - id: PortId(600), - state: PortState::Resolved(TypeShape::new(DeclarationId(2184))), - produced_by: Some(NodeId(533)), - }, - ); - ports.insert( - PortId(601), - Port { - id: PortId(601), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(602), - Port { - id: PortId(602), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(603), - Port { - id: PortId(603), - state: PortState::Uninferred, - produced_by: Some(NodeId(535)), - }, - ); - ports.insert( - PortId(604), - Port { - id: PortId(604), - state: PortState::Uninferred, - produced_by: Some(NodeId(536)), - }, - ); - ports.insert( - PortId(605), - Port { - id: PortId(605), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(606), - Port { - id: PortId(606), - state: PortState::Uninferred, - produced_by: Some(NodeId(537)), - }, - ); - ports.insert( - PortId(607), - Port { - id: PortId(607), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(608), - Port { - id: PortId(608), - state: PortState::Uninferred, - produced_by: Some(NodeId(538)), - }, - ); - ports.insert( - PortId(609), - Port { - id: PortId(609), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(610), - Port { - id: PortId(610), - state: PortState::Uninferred, - produced_by: Some(NodeId(539)), - }, - ); - ports.insert( - PortId(611), - Port { - id: PortId(611), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(612), - Port { - id: PortId(612), - state: PortState::Uninferred, - produced_by: Some(NodeId(540)), - }, - ); - ports.insert( - PortId(613), - Port { - id: PortId(613), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(614), - Port { - id: PortId(614), - state: PortState::Uninferred, - produced_by: Some(NodeId(541)), - }, - ); - ports.insert( - PortId(615), - Port { - id: PortId(615), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(616), - Port { - id: PortId(616), - state: PortState::Uninferred, - produced_by: Some(NodeId(542)), - }, - ); - ports.insert( - PortId(617), - Port { - id: PortId(617), - state: PortState::Resolved(TypeShape::new(DeclarationId(124))), - produced_by: Some(NodeId(543)), - }, - ); - ports.insert( - PortId(618), - Port { - id: PortId(618), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(619), - Port { - id: PortId(619), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(620), - Port { - id: PortId(620), - state: PortState::Uninferred, - produced_by: Some(NodeId(545)), - }, - ); - ports.insert( - PortId(621), - Port { - id: PortId(621), - state: PortState::Uninferred, - produced_by: Some(NodeId(546)), - }, - ); - ports.insert( - PortId(622), - Port { - id: PortId(622), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(623), - Port { - id: PortId(623), - state: PortState::Uninferred, - produced_by: Some(NodeId(547)), - }, - ); - ports.insert( - PortId(624), - Port { - id: PortId(624), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(625), - Port { - id: PortId(625), - state: PortState::Uninferred, - produced_by: Some(NodeId(548)), - }, - ); - ports.insert( - PortId(626), - Port { - id: PortId(626), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(627), - Port { - id: PortId(627), - state: PortState::Uninferred, - produced_by: Some(NodeId(549)), - }, - ); - ports.insert( - PortId(628), - Port { - id: PortId(628), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(629), - Port { - id: PortId(629), - state: PortState::Uninferred, - produced_by: Some(NodeId(550)), - }, - ); - ports.insert( - PortId(630), - Port { - id: PortId(630), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(631), - Port { - id: PortId(631), - state: PortState::Uninferred, - produced_by: Some(NodeId(551)), - }, - ); - ports.insert( - PortId(632), - Port { - id: PortId(632), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(633), - Port { - id: PortId(633), - state: PortState::Uninferred, - produced_by: Some(NodeId(552)), - }, - ); - ports.insert( - PortId(634), - Port { - id: PortId(634), - state: PortState::Resolved(TypeShape::new(DeclarationId(124))), - produced_by: Some(NodeId(553)), - }, - ); - ports.insert( - PortId(635), - Port { - id: PortId(635), - state: PortState::Resolved(TypeShape::new(DeclarationId(2185))), - produced_by: None, - }, - ); - ports.insert( - PortId(636), - Port { - id: PortId(636), - state: PortState::Uninferred, - produced_by: Some(NodeId(555)), - }, - ); - ports.insert( - PortId(637), - Port { - id: PortId(637), - state: PortState::Uninferred, - produced_by: Some(NodeId(556)), - }, - ); - ports.insert( - PortId(638), - Port { - id: PortId(638), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(639), - Port { - id: PortId(639), - state: PortState::Uninferred, - produced_by: Some(NodeId(557)), - }, - ); - ports.insert( - PortId(640), - Port { - id: PortId(640), - state: PortState::Uninferred, - produced_by: Some(NodeId(558)), - }, - ); - ports.insert( - PortId(641), - Port { - id: PortId(641), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(642), - Port { - id: PortId(642), - state: PortState::Uninferred, - produced_by: Some(NodeId(559)), - }, - ); - ports.insert( - PortId(643), - Port { - id: PortId(643), - state: PortState::Uninferred, - produced_by: Some(NodeId(560)), - }, - ); - ports.insert( - PortId(644), - Port { - id: PortId(644), - state: PortState::Uninferred, - produced_by: Some(NodeId(561)), - }, - ); - ports.insert( - PortId(645), - Port { - id: PortId(645), - state: PortState::Uninferred, - produced_by: Some(NodeId(562)), - }, - ); - ports.insert( - PortId(646), - Port { - id: PortId(646), - state: PortState::Uninferred, - produced_by: Some(NodeId(563)), - }, - ); - ports.insert( - PortId(647), - Port { - id: PortId(647), - state: PortState::Uninferred, - produced_by: Some(NodeId(564)), - }, - ); - ports.insert( - PortId(648), - Port { - id: PortId(648), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: Some(NodeId(565)), - }, - ); - ports.insert( - PortId(649), - Port { - id: PortId(649), - state: PortState::Resolved(TypeShape::new(DeclarationId(2186))), - produced_by: None, - }, - ); - ports.insert( - PortId(650), - Port { - id: PortId(650), - state: PortState::Uninferred, - produced_by: Some(NodeId(567)), - }, - ); - ports.insert( - PortId(651), - Port { - id: PortId(651), - state: PortState::Uninferred, - produced_by: Some(NodeId(568)), - }, - ); - ports.insert( - PortId(652), - Port { - id: PortId(652), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(653), - Port { - id: PortId(653), - state: PortState::Uninferred, - produced_by: Some(NodeId(569)), - }, - ); - ports.insert( - PortId(654), - Port { - id: PortId(654), - state: PortState::Uninferred, - produced_by: Some(NodeId(570)), - }, - ); - ports.insert( - PortId(655), - Port { - id: PortId(655), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(656), - Port { - id: PortId(656), - state: PortState::Uninferred, - produced_by: Some(NodeId(571)), - }, - ); - ports.insert( - PortId(657), - Port { - id: PortId(657), - state: PortState::Uninferred, - produced_by: Some(NodeId(572)), - }, - ); - ports.insert( - PortId(658), - Port { - id: PortId(658), - state: PortState::Uninferred, - produced_by: Some(NodeId(573)), - }, - ); - ports.insert( - PortId(659), - Port { - id: PortId(659), - state: PortState::Uninferred, - produced_by: Some(NodeId(574)), - }, - ); - ports.insert( - PortId(660), - Port { - id: PortId(660), - state: PortState::Uninferred, - produced_by: Some(NodeId(575)), - }, - ); - ports.insert( - PortId(661), - Port { - id: PortId(661), - state: PortState::Uninferred, - produced_by: Some(NodeId(576)), - }, - ); - ports.insert( - PortId(662), - Port { - id: PortId(662), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: Some(NodeId(577)), - }, - ); - ports.insert( - PortId(663), - Port { - id: PortId(663), - state: PortState::Resolved(TypeShape::new(DeclarationId(2187))), - produced_by: None, - }, - ); - ports.insert( - PortId(664), - Port { - id: PortId(664), - state: PortState::Uninferred, - produced_by: Some(NodeId(579)), - }, - ); - ports.insert( - PortId(665), - Port { - id: PortId(665), - state: PortState::Uninferred, - produced_by: Some(NodeId(580)), - }, - ); - ports.insert( - PortId(666), - Port { - id: PortId(666), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(667), - Port { - id: PortId(667), - state: PortState::Uninferred, - produced_by: Some(NodeId(581)), - }, - ); - ports.insert( - PortId(668), - Port { - id: PortId(668), - state: PortState::Uninferred, - produced_by: Some(NodeId(582)), - }, - ); - ports.insert( - PortId(669), - Port { - id: PortId(669), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(670), - Port { - id: PortId(670), - state: PortState::Uninferred, - produced_by: Some(NodeId(583)), - }, - ); - ports.insert( - PortId(671), - Port { - id: PortId(671), - state: PortState::Uninferred, - produced_by: Some(NodeId(584)), - }, - ); - ports.insert( - PortId(672), - Port { - id: PortId(672), - state: PortState::Uninferred, - produced_by: Some(NodeId(585)), - }, - ); - ports.insert( - PortId(673), - Port { - id: PortId(673), - state: PortState::Uninferred, - produced_by: Some(NodeId(586)), - }, - ); - ports.insert( - PortId(674), - Port { - id: PortId(674), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(675), - Port { - id: PortId(675), - state: PortState::Uninferred, - produced_by: Some(NodeId(587)), - }, - ); - ports.insert( - PortId(676), - Port { - id: PortId(676), - state: PortState::Uninferred, - produced_by: Some(NodeId(588)), - }, - ); - ports.insert( - PortId(677), - Port { - id: PortId(677), - state: PortState::Uninferred, - produced_by: Some(NodeId(589)), - }, - ); - ports.insert( - PortId(678), - Port { - id: PortId(678), - state: PortState::Uninferred, - produced_by: Some(NodeId(590)), - }, - ); - ports.insert( - PortId(679), - Port { - id: PortId(679), - state: PortState::Uninferred, - produced_by: Some(NodeId(591)), - }, - ); - ports.insert( - PortId(680), - Port { - id: PortId(680), - state: PortState::Uninferred, - produced_by: Some(NodeId(592)), - }, - ); - ports.insert( - PortId(681), - Port { - id: PortId(681), - state: PortState::Uninferred, - produced_by: Some(NodeId(593)), - }, - ); - ports.insert( - PortId(682), - Port { - id: PortId(682), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: Some(NodeId(594)), - }, - ); - ports.insert( - PortId(683), - Port { - id: PortId(683), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(684), - Port { - id: PortId(684), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(685), - Port { - id: PortId(685), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(686), - Port { - id: PortId(686), - state: PortState::Uninferred, - produced_by: Some(NodeId(596)), - }, - ); - ports.insert( - PortId(687), - Port { - id: PortId(687), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(688), - Port { - id: PortId(688), - state: PortState::Uninferred, - produced_by: Some(NodeId(597)), - }, - ); - ports.insert( - PortId(689), - Port { - id: PortId(689), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(690), - Port { - id: PortId(690), - state: PortState::Uninferred, - produced_by: Some(NodeId(598)), - }, - ); - ports.insert( - PortId(691), - Port { - id: PortId(691), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(692), - Port { - id: PortId(692), - state: PortState::Uninferred, - produced_by: Some(NodeId(599)), - }, - ); - ports.insert( - PortId(693), - Port { - id: PortId(693), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(694), - Port { - id: PortId(694), - state: PortState::Uninferred, - produced_by: Some(NodeId(600)), - }, - ); - ports.insert( - PortId(695), - Port { - id: PortId(695), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(696), - Port { - id: PortId(696), - state: PortState::Uninferred, - produced_by: Some(NodeId(601)), - }, - ); - ports.insert( - PortId(697), - Port { - id: PortId(697), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(698), - Port { - id: PortId(698), - state: PortState::Uninferred, - produced_by: Some(NodeId(602)), - }, - ); - ports.insert( - PortId(699), - Port { - id: PortId(699), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: Some(NodeId(603)), - }, - ); - ports.insert( - PortId(700), - Port { - id: PortId(700), - state: PortState::Resolved(TypeShape::new(DeclarationId(915))), - produced_by: None, - }, - ); - ports.insert( - PortId(701), - Port { - id: PortId(701), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(702), - Port { - id: PortId(702), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(703), - Port { - id: PortId(703), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(704), - Port { - id: PortId(704), - state: PortState::Uninferred, - produced_by: Some(NodeId(605)), - }, - ); - ports.insert( - PortId(705), - Port { - id: PortId(705), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(706), - Port { - id: PortId(706), - state: PortState::Uninferred, - produced_by: Some(NodeId(606)), - }, - ); - ports.insert( - PortId(707), - Port { - id: PortId(707), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(708), - Port { - id: PortId(708), - state: PortState::Uninferred, - produced_by: Some(NodeId(607)), - }, - ); - ports.insert( - PortId(709), - Port { - id: PortId(709), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(710), - Port { - id: PortId(710), - state: PortState::Uninferred, - produced_by: Some(NodeId(608)), - }, - ); - ports.insert( - PortId(711), - Port { - id: PortId(711), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(712), - Port { - id: PortId(712), - state: PortState::Uninferred, - produced_by: Some(NodeId(609)), - }, - ); - ports.insert( - PortId(713), - Port { - id: PortId(713), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(714), - Port { - id: PortId(714), - state: PortState::Uninferred, - produced_by: Some(NodeId(610)), - }, - ); - ports.insert( - PortId(715), - Port { - id: PortId(715), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(716), - Port { - id: PortId(716), - state: PortState::Uninferred, - produced_by: Some(NodeId(611)), - }, - ); - ports.insert( - PortId(717), - Port { - id: PortId(717), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: Some(NodeId(612)), - }, - ); - ports.insert( - PortId(718), - Port { - id: PortId(718), - state: PortState::Resolved(TypeShape::new(DeclarationId(915))), - produced_by: None, - }, - ); - ports.insert( - PortId(719), - Port { - id: PortId(719), - state: PortState::Resolved(TypeShape::new(DeclarationId(915))), - produced_by: None, - }, - ); - ports.insert( - PortId(720), - Port { - id: PortId(720), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(721), - Port { - id: PortId(721), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(722), - Port { - id: PortId(722), - state: PortState::Uninferred, - produced_by: Some(NodeId(614)), - }, - ); - ports.insert( - PortId(723), - Port { - id: PortId(723), - state: PortState::Uninferred, - produced_by: Some(NodeId(615)), - }, - ); - ports.insert( - PortId(724), - Port { - id: PortId(724), - state: PortState::Uninferred, - produced_by: Some(NodeId(616)), - }, - ); - ports.insert( - PortId(725), - Port { - id: PortId(725), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: Some(NodeId(617)), - }, - ); - ports.insert( - PortId(726), - Port { - id: PortId(726), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(727), - Port { - id: PortId(727), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(728), - Port { - id: PortId(728), - state: PortState::Uninferred, - produced_by: Some(NodeId(619)), - }, - ); - ports.insert( - PortId(729), - Port { - id: PortId(729), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: Some(NodeId(620)), - }, - ); - ports.insert( - PortId(730), - Port { - id: PortId(730), - state: PortState::Resolved(TypeShape::new(DeclarationId(920))), - produced_by: None, - }, - ); - ports.insert( - PortId(731), - Port { - id: PortId(731), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(732), - Port { - id: PortId(732), - state: PortState::Resolved(TypeShape::new(DeclarationId(124))), - produced_by: Some(NodeId(622)), - }, - ); - ports.insert( - PortId(733), - Port { - id: PortId(733), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: Some(NodeId(623)), - }, - ); - ports.insert( - PortId(734), - Port { - id: PortId(734), - state: PortState::Uninferred, - produced_by: Some(NodeId(624)), - }, - ); - ports.insert( - PortId(735), - Port { - id: PortId(735), - state: PortState::Uninferred, - produced_by: Some(NodeId(625)), - }, - ); - ports.insert( - PortId(736), - Port { - id: PortId(736), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: Some(NodeId(626)), - }, - ); - ports.insert( - PortId(737), - Port { - id: PortId(737), - state: PortState::Resolved(TypeShape::new(DeclarationId(920))), - produced_by: Some(NodeId(627)), - }, - ); - ports.insert( - PortId(738), - Port { - id: PortId(738), - state: PortState::Resolved(TypeShape::new(DeclarationId(920))), - produced_by: None, - }, - ); - ports.insert( - PortId(739), - Port { - id: PortId(739), - state: PortState::Resolved(TypeShape::new(DeclarationId(124))), - produced_by: Some(NodeId(629)), - }, - ); - ports.insert( - PortId(740), - Port { - id: PortId(740), - state: PortState::Resolved(TypeShape::new(DeclarationId(2188))), - produced_by: None, - }, - ); - ports.insert( - PortId(741), - Port { - id: PortId(741), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(742), - Port { - id: PortId(742), - state: PortState::Uninferred, - produced_by: Some(NodeId(631)), - }, - ); - ports.insert( - PortId(743), - Port { - id: PortId(743), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(744), - Port { - id: PortId(744), - state: PortState::Uninferred, - produced_by: Some(NodeId(632)), - }, - ); - ports.insert( - PortId(745), - Port { - id: PortId(745), - state: PortState::Uninferred, - produced_by: Some(NodeId(633)), - }, - ); - ports.insert( - PortId(746), - Port { - id: PortId(746), - state: PortState::Uninferred, - produced_by: Some(NodeId(634)), - }, - ); - ports.insert( - PortId(747), - Port { - id: PortId(747), - state: PortState::Uninferred, - produced_by: Some(NodeId(635)), - }, - ); - ports.insert( - PortId(748), - Port { - id: PortId(748), - state: PortState::Uninferred, - produced_by: Some(NodeId(636)), - }, - ); - ports.insert( - PortId(749), - Port { - id: PortId(749), - state: PortState::Uninferred, - produced_by: Some(NodeId(637)), - }, - ); - ports.insert( - PortId(750), - Port { - id: PortId(750), - state: PortState::Uninferred, - produced_by: Some(NodeId(638)), - }, - ); - ports.insert( - PortId(751), - Port { - id: PortId(751), - state: PortState::Uninferred, - produced_by: Some(NodeId(639)), - }, - ); - ports.insert( - PortId(752), - Port { - id: PortId(752), - state: PortState::Uninferred, - produced_by: Some(NodeId(640)), - }, - ); - ports.insert( - PortId(753), - Port { - id: PortId(753), - state: PortState::Uninferred, - produced_by: Some(NodeId(641)), - }, - ); - ports.insert( - PortId(754), - Port { - id: PortId(754), - state: PortState::Resolved(TypeShape::new(DeclarationId(2189))), - produced_by: Some(NodeId(642)), - }, - ); - ports.insert( - PortId(755), - Port { - id: PortId(755), - state: PortState::Resolved(TypeShape::new(DeclarationId(2190))), - produced_by: None, - }, - ); - ports.insert( - PortId(756), - Port { - id: PortId(756), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(757), - Port { - id: PortId(757), - state: PortState::Uninferred, - produced_by: Some(NodeId(644)), - }, - ); - ports.insert( - PortId(758), - Port { - id: PortId(758), - state: PortState::Uninferred, - produced_by: Some(NodeId(645)), - }, - ); - ports.insert( - PortId(759), - Port { - id: PortId(759), - state: PortState::Uninferred, - produced_by: Some(NodeId(646)), - }, - ); - ports.insert( - PortId(760), - Port { - id: PortId(760), - state: PortState::Uninferred, - produced_by: Some(NodeId(647)), - }, - ); - ports.insert( - PortId(761), - Port { - id: PortId(761), - state: PortState::Uninferred, - produced_by: Some(NodeId(648)), - }, - ); - ports.insert( - PortId(762), - Port { - id: PortId(762), - state: PortState::Resolved(TypeShape::new(DeclarationId(2191))), - produced_by: Some(NodeId(649)), - }, - ); - ports.insert( - PortId(763), - Port { - id: PortId(763), - state: PortState::Resolved(TypeShape::new(DeclarationId(2192))), - produced_by: None, - }, - ); - ports.insert( - PortId(764), - Port { - id: PortId(764), - state: PortState::Uninferred, - produced_by: Some(NodeId(651)), - }, - ); - ports.insert( - PortId(765), - Port { - id: PortId(765), - state: PortState::Resolved(TypeShape::new(DeclarationId(2193))), - produced_by: Some(NodeId(652)), - }, - ); - ports.insert( - PortId(766), - Port { - id: PortId(766), - state: PortState::Resolved(TypeShape::new(DeclarationId(1200))), - produced_by: None, - }, - ); - ports.insert( - PortId(767), - Port { - id: PortId(767), - state: PortState::Uninferred, - produced_by: Some(NodeId(654)), - }, - ); - ports.insert( - PortId(768), - Port { - id: PortId(768), - state: PortState::Uninferred, - produced_by: Some(NodeId(655)), - }, - ); - ports.insert( - PortId(769), - Port { - id: PortId(769), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(770), - Port { - id: PortId(770), - state: PortState::Uninferred, - produced_by: Some(NodeId(656)), - }, - ); - ports.insert( - PortId(771), - Port { - id: PortId(771), - state: PortState::Uninferred, - produced_by: Some(NodeId(657)), - }, - ); - ports.insert( - PortId(772), - Port { - id: PortId(772), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(773), - Port { - id: PortId(773), - state: PortState::Uninferred, - produced_by: Some(NodeId(658)), - }, - ); - ports.insert( - PortId(774), - Port { - id: PortId(774), - state: PortState::Uninferred, - produced_by: Some(NodeId(659)), - }, - ); - ports.insert( - PortId(775), - Port { - id: PortId(775), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(776), - Port { - id: PortId(776), - state: PortState::Uninferred, - produced_by: Some(NodeId(660)), - }, - ); - ports.insert( - PortId(777), - Port { - id: PortId(777), - state: PortState::Uninferred, - produced_by: Some(NodeId(661)), - }, - ); - ports.insert( - PortId(778), - Port { - id: PortId(778), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(779), - Port { - id: PortId(779), - state: PortState::Uninferred, - produced_by: Some(NodeId(662)), - }, - ); - ports.insert( - PortId(780), - Port { - id: PortId(780), - state: PortState::Uninferred, - produced_by: Some(NodeId(663)), - }, - ); - ports.insert( - PortId(781), - Port { - id: PortId(781), - state: PortState::Uninferred, - produced_by: Some(NodeId(664)), - }, - ); - ports.insert( - PortId(782), - Port { - id: PortId(782), - state: PortState::Uninferred, - produced_by: Some(NodeId(665)), - }, - ); - ports.insert( - PortId(783), - Port { - id: PortId(783), - state: PortState::Uninferred, - produced_by: Some(NodeId(666)), - }, - ); - ports.insert( - PortId(784), - Port { - id: PortId(784), - state: PortState::Uninferred, - produced_by: Some(NodeId(667)), - }, - ); - ports.insert( - PortId(785), - Port { - id: PortId(785), - state: PortState::Uninferred, - produced_by: Some(NodeId(668)), - }, - ); - ports.insert( - PortId(786), - Port { - id: PortId(786), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: Some(NodeId(669)), - }, - ); - ports.insert( - PortId(787), - Port { - id: PortId(787), - state: PortState::Resolved(TypeShape::new(DeclarationId(1199))), - produced_by: None, - }, - ); - ports.insert( - PortId(788), - Port { - id: PortId(788), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(789), - Port { - id: PortId(789), - state: PortState::Uninferred, - produced_by: Some(NodeId(671)), - }, - ); - ports.insert( - PortId(790), - Port { - id: PortId(790), - state: PortState::Uninferred, - produced_by: Some(NodeId(672)), - }, - ); - ports.insert( - PortId(791), - Port { - id: PortId(791), - state: PortState::Uninferred, - produced_by: Some(NodeId(673)), - }, - ); - ports.insert( - PortId(792), - Port { - id: PortId(792), - state: PortState::Uninferred, - produced_by: Some(NodeId(674)), - }, - ); - ports.insert( - PortId(793), - Port { - id: PortId(793), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(794), - Port { - id: PortId(794), - state: PortState::Uninferred, - produced_by: Some(NodeId(675)), - }, - ); - ports.insert( - PortId(795), - Port { - id: PortId(795), - state: PortState::Uninferred, - produced_by: Some(NodeId(676)), - }, - ); - ports.insert( - PortId(796), - Port { - id: PortId(796), - state: PortState::Uninferred, - produced_by: Some(NodeId(677)), - }, - ); - ports.insert( - PortId(797), - Port { - id: PortId(797), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: Some(NodeId(678)), - }, - ); - ports.insert( - PortId(798), - Port { - id: PortId(798), - state: PortState::Resolved(TypeShape::new(DeclarationId(2564))), - produced_by: None, - }, - ); - ports.insert( - PortId(799), - Port { - id: PortId(799), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: Some(NodeId(680)), - }, - ); - ports.insert( - PortId(800), - Port { - id: PortId(800), - state: PortState::Resolved(TypeShape::new(DeclarationId(839))), - produced_by: None, - }, - ); - ports.insert( - PortId(801), - Port { - id: PortId(801), - state: PortState::Resolved(TypeShape::new(DeclarationId(2691))), - produced_by: Some(NodeId(682)), - }, - ); - ports.insert( - PortId(802), - Port { - id: PortId(802), - state: PortState::Resolved(TypeShape::new(DeclarationId(154))), - produced_by: Some(NodeId(684)), - }, - ); - ports.insert( - PortId(803), - Port { - id: PortId(803), - state: PortState::Resolved(TypeShape::new(DeclarationId(735))), - produced_by: None, - }, - ); - ports.insert( - PortId(804), - Port { - id: PortId(804), - state: PortState::Resolved(TypeShape::new(DeclarationId(170))), - produced_by: None, - }, - ); - ports.insert( - PortId(805), - Port { - id: PortId(805), - state: PortState::Resolved(TypeShape::new(DeclarationId(171))), - produced_by: None, - }, - ); - ports.insert( - PortId(806), - Port { - id: PortId(806), - state: PortState::Resolved(TypeShape::new(DeclarationId(174))), - produced_by: None, - }, - ); - ports.insert( - PortId(807), - Port { - id: PortId(807), - state: PortState::Resolved(TypeShape::new(DeclarationId(1249))), - produced_by: None, - }, - ); - ports.insert( - PortId(808), - Port { - id: PortId(808), - state: PortState::Resolved(TypeShape::new(DeclarationId(1252))), - produced_by: Some(NodeId(686)), - }, - ); - ports.insert( - PortId(809), - Port { - id: PortId(809), - state: PortState::Resolved(TypeShape::new(DeclarationId(1250))), - produced_by: Some(NodeId(688)), - }, - ); - ports.insert( - PortId(810), - Port { - id: PortId(810), - state: PortState::Resolved(TypeShape::new(DeclarationId(1250))), - produced_by: None, - }, - ); - ports.insert( - PortId(811), - Port { - id: PortId(811), - state: PortState::Resolved(TypeShape::new(DeclarationId(1250))), - produced_by: None, - }, - ); - ports.insert( - PortId(812), - Port { - id: PortId(812), - state: PortState::Resolved(TypeShape::new(DeclarationId(124))), - produced_by: None, - }, - ); - ports.insert( - PortId(813), - Port { - id: PortId(813), - state: PortState::Uninferred, - produced_by: Some(NodeId(690)), - }, - ); - ports.insert( - PortId(814), - Port { - id: PortId(814), - state: PortState::Uninferred, - produced_by: Some(NodeId(691)), - }, - ); - ports.insert( - PortId(815), - Port { - id: PortId(815), - state: PortState::Uninferred, - produced_by: Some(NodeId(692)), - }, - ); - ports.insert( - PortId(816), - Port { - id: PortId(816), - state: PortState::Uninferred, - produced_by: Some(NodeId(693)), - }, - ); - ports.insert( - PortId(817), - Port { - id: PortId(817), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(818), - Port { - id: PortId(818), - state: PortState::Uninferred, - produced_by: Some(NodeId(694)), - }, - ); - ports.insert( - PortId(819), - Port { - id: PortId(819), - state: PortState::Uninferred, - produced_by: Some(NodeId(695)), - }, - ); - ports.insert( - PortId(820), - Port { - id: PortId(820), - state: PortState::Uninferred, - produced_by: Some(NodeId(696)), - }, - ); - ports.insert( - PortId(821), - Port { - id: PortId(821), - state: PortState::Uninferred, - produced_by: Some(NodeId(697)), - }, - ); - ports.insert( - PortId(822), - Port { - id: PortId(822), - state: PortState::Uninferred, - produced_by: Some(NodeId(698)), - }, - ); - ports.insert( - PortId(823), - Port { - id: PortId(823), - state: PortState::Uninferred, - produced_by: Some(NodeId(699)), - }, - ); - ports.insert( - PortId(824), - Port { - id: PortId(824), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(825), - Port { - id: PortId(825), - state: PortState::Uninferred, - produced_by: Some(NodeId(700)), - }, - ); - ports.insert( - PortId(826), - Port { - id: PortId(826), - state: PortState::Uninferred, - produced_by: Some(NodeId(701)), - }, - ); - ports.insert( - PortId(827), - Port { - id: PortId(827), - state: PortState::Uninferred, - produced_by: Some(NodeId(702)), - }, - ); - ports.insert( - PortId(828), - Port { - id: PortId(828), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(829), - Port { - id: PortId(829), - state: PortState::Uninferred, - produced_by: Some(NodeId(703)), - }, - ); - ports.insert( - PortId(830), - Port { - id: PortId(830), - state: PortState::Uninferred, - produced_by: Some(NodeId(704)), - }, - ); - ports.insert( - PortId(831), - Port { - id: PortId(831), - state: PortState::Uninferred, - produced_by: Some(NodeId(705)), - }, - ); - ports.insert( - PortId(832), - Port { - id: PortId(832), - state: PortState::Uninferred, - produced_by: Some(NodeId(706)), - }, - ); - ports.insert( - PortId(833), - Port { - id: PortId(833), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(834), - Port { - id: PortId(834), - state: PortState::Uninferred, - produced_by: Some(NodeId(707)), - }, - ); - ports.insert( - PortId(835), - Port { - id: PortId(835), - state: PortState::Uninferred, - produced_by: Some(NodeId(708)), - }, - ); - ports.insert( - PortId(836), - Port { - id: PortId(836), - state: PortState::Uninferred, - produced_by: Some(NodeId(709)), - }, - ); - ports.insert( - PortId(837), - Port { - id: PortId(837), - state: PortState::Uninferred, - produced_by: Some(NodeId(710)), - }, - ); - ports.insert( - PortId(838), - Port { - id: PortId(838), - state: PortState::Uninferred, - produced_by: Some(NodeId(711)), - }, - ); - ports.insert( - PortId(839), - Port { - id: PortId(839), - state: PortState::Uninferred, - produced_by: Some(NodeId(712)), - }, - ); - ports.insert( - PortId(840), - Port { - id: PortId(840), - state: PortState::Uninferred, - produced_by: Some(NodeId(713)), - }, - ); - ports.insert( - PortId(841), - Port { - id: PortId(841), - state: PortState::Uninferred, - produced_by: Some(NodeId(714)), - }, - ); - ports.insert( - PortId(842), - Port { - id: PortId(842), - state: PortState::Uninferred, - produced_by: Some(NodeId(715)), - }, - ); - ports.insert( - PortId(843), - Port { - id: PortId(843), - state: PortState::Uninferred, - produced_by: Some(NodeId(716)), - }, - ); - ports.insert( - PortId(844), - Port { - id: PortId(844), - state: PortState::Uninferred, - produced_by: Some(NodeId(717)), - }, - ); - ports.insert( - PortId(845), - Port { - id: PortId(845), - state: PortState::Uninferred, - produced_by: Some(NodeId(718)), - }, - ); - ports.insert( - PortId(846), - Port { - id: PortId(846), - state: PortState::Uninferred, - produced_by: Some(NodeId(719)), - }, - ); - ports.insert( - PortId(847), - Port { - id: PortId(847), - state: PortState::Resolved(TypeShape::new(DeclarationId(1250))), - produced_by: Some(NodeId(720)), - }, - ); - ports.insert( - PortId(848), - Port { - id: PortId(848), - state: PortState::Resolved(TypeShape::new(DeclarationId(1250))), - produced_by: None, - }, - ); - ports.insert( - PortId(849), - Port { - id: PortId(849), - state: PortState::Resolved(TypeShape::new(DeclarationId(1250))), - produced_by: None, - }, - ); - ports.insert( - PortId(850), - Port { - id: PortId(850), - state: PortState::Uninferred, - produced_by: Some(NodeId(722)), - }, - ); - ports.insert( - PortId(851), - Port { - id: PortId(851), - state: PortState::Resolved(TypeShape::new(DeclarationId(1250))), - produced_by: Some(NodeId(723)), - }, - ); - ports.insert( - PortId(852), - Port { - id: PortId(852), - state: PortState::Uninferred, - produced_by: Some(NodeId(725)), - }, - ); - ports.insert( - PortId(853), - Port { - id: PortId(853), - state: PortState::Resolved(TypeShape::new(DeclarationId(1249))), - produced_by: Some(NodeId(726)), - }, - ); - ports.insert( - PortId(854), - Port { - id: PortId(854), - state: PortState::Uninferred, - produced_by: Some(NodeId(728)), - }, - ); - ports.insert( - PortId(855), - Port { - id: PortId(855), - state: PortState::Resolved(TypeShape::new(DeclarationId(1250))), - produced_by: Some(NodeId(729)), - }, - ); - ports.insert( - PortId(856), - Port { - id: PortId(856), - state: PortState::Resolved(TypeShape::new(DeclarationId(1250))), - produced_by: None, - }, - ); - ports.insert( - PortId(857), - Port { - id: PortId(857), - state: PortState::Resolved(TypeShape::new(DeclarationId(1250))), - produced_by: None, - }, - ); - ports.insert( - PortId(858), - Port { - id: PortId(858), - state: PortState::Uninferred, - produced_by: Some(NodeId(731)), - }, - ); - ports.insert( - PortId(859), - Port { - id: PortId(859), - state: PortState::Resolved(TypeShape::new(DeclarationId(1250))), - produced_by: Some(NodeId(732)), - }, - ); - ports.insert( - PortId(860), - Port { - id: PortId(860), - state: PortState::Uninferred, - produced_by: Some(NodeId(734)), - }, - ); - ports.insert( - PortId(861), - Port { - id: PortId(861), - state: PortState::Uninferred, - produced_by: Some(NodeId(735)), - }, - ); - ports.insert( - PortId(862), - Port { - id: PortId(862), - state: PortState::Resolved(TypeShape::new(DeclarationId(1050))), - produced_by: Some(NodeId(736)), - }, - ); - ports.insert( - PortId(863), - Port { - id: PortId(863), - state: PortState::Uninferred, - produced_by: Some(NodeId(738)), - }, - ); - ports.insert( - PortId(864), - Port { - id: PortId(864), - state: PortState::Uninferred, - produced_by: Some(NodeId(739)), - }, - ); - ports.insert( - PortId(865), - Port { - id: PortId(865), - state: PortState::Resolved(TypeShape::new(DeclarationId(1051))), - produced_by: Some(NodeId(740)), - }, - ); - ports.insert( - PortId(866), - Port { - id: PortId(866), - state: PortState::Resolved(TypeShape::new(DeclarationId(838))), - produced_by: None, - }, - ); - ports.insert( - PortId(867), - Port { - id: PortId(867), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(868), - Port { - id: PortId(868), - state: PortState::Uninferred, - produced_by: Some(NodeId(742)), - }, - ); - ports.insert( - PortId(869), - Port { - id: PortId(869), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(870), - Port { - id: PortId(870), - state: PortState::Uninferred, - produced_by: Some(NodeId(743)), - }, - ); - ports.insert( - PortId(871), - Port { - id: PortId(871), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(872), - Port { - id: PortId(872), - state: PortState::Uninferred, - produced_by: Some(NodeId(744)), - }, - ); - ports.insert( - PortId(873), - Port { - id: PortId(873), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(874), - Port { - id: PortId(874), - state: PortState::Uninferred, - produced_by: Some(NodeId(745)), - }, - ); - ports.insert( - PortId(875), - Port { - id: PortId(875), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(876), - Port { - id: PortId(876), - state: PortState::Uninferred, - produced_by: Some(NodeId(746)), - }, - ); - ports.insert( - PortId(877), - Port { - id: PortId(877), - state: PortState::Resolved(TypeShape::new(DeclarationId(155))), - produced_by: Some(NodeId(747)), - }, - ); - ports.insert( - PortId(878), - Port { - id: PortId(878), - state: PortState::Resolved(TypeShape::new(DeclarationId(227))), - produced_by: None, - }, - ); - ports.insert( - PortId(879), - Port { - id: PortId(879), - state: PortState::Resolved(TypeShape::new(DeclarationId(155))), - produced_by: None, - }, - ); - ports.insert( - PortId(880), - Port { - id: PortId(880), - state: PortState::Uninferred, - produced_by: Some(NodeId(749)), - }, - ); - ports.insert( - PortId(881), - Port { - id: PortId(881), - state: PortState::Uninferred, - produced_by: Some(NodeId(750)), - }, - ); - ports.insert( - PortId(882), - Port { - id: PortId(882), - state: PortState::Uninferred, - produced_by: Some(NodeId(751)), - }, - ); - ports.insert( - PortId(883), - Port { - id: PortId(883), - state: PortState::Resolved(TypeShape::new(DeclarationId(1055))), - produced_by: Some(NodeId(752)), - }, - ); - ports.insert( - PortId(884), - Port { - id: PortId(884), - state: PortState::Uninferred, - produced_by: Some(NodeId(754)), - }, - ); - ports.insert( - PortId(885), - Port { - id: PortId(885), - state: PortState::Uninferred, - produced_by: Some(NodeId(755)), - }, - ); - ports.insert( - PortId(886), - Port { - id: PortId(886), - state: PortState::Uninferred, - produced_by: Some(NodeId(756)), - }, - ); - ports.insert( - PortId(887), - Port { - id: PortId(887), - state: PortState::Resolved(TypeShape::new(DeclarationId(155))), - produced_by: Some(NodeId(757)), - }, - ); - ports.insert( - PortId(888), - Port { - id: PortId(888), - state: PortState::Resolved(TypeShape::new(DeclarationId(839))), - produced_by: None, - }, - ); - ports.insert( - PortId(889), - Port { - id: PortId(889), - state: PortState::Resolved(TypeShape::new(DeclarationId(227))), - produced_by: None, - }, - ); - ports.insert( - PortId(890), - Port { - id: PortId(890), - state: PortState::Uninferred, - produced_by: Some(NodeId(759)), - }, - ); - ports.insert( - PortId(891), - Port { - id: PortId(891), - state: PortState::Resolved(TypeShape::new(DeclarationId(2047))), - produced_by: Some(NodeId(760)), - }, - ); - ports.insert( - PortId(892), - Port { - id: PortId(892), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(893), - Port { - id: PortId(893), - state: PortState::Uninferred, - produced_by: Some(NodeId(761)), - }, - ); - ports.insert( - PortId(894), - Port { - id: PortId(894), - state: PortState::Uninferred, - produced_by: Some(NodeId(762)), - }, - ); - ports.insert( - PortId(895), - Port { - id: PortId(895), - state: PortState::Uninferred, - produced_by: Some(NodeId(763)), - }, - ); - ports.insert( - PortId(896), - Port { - id: PortId(896), - state: PortState::Uninferred, - produced_by: Some(NodeId(764)), - }, - ); - ports.insert( - PortId(897), - Port { - id: PortId(897), - state: PortState::Uninferred, - produced_by: Some(NodeId(765)), - }, - ); - ports.insert( - PortId(898), - Port { - id: PortId(898), - state: PortState::Uninferred, - produced_by: Some(NodeId(766)), - }, - ); - ports.insert( - PortId(899), - Port { - id: PortId(899), - state: PortState::Uninferred, - produced_by: Some(NodeId(767)), - }, - ); - ports.insert( - PortId(900), - Port { - id: PortId(900), - state: PortState::Uninferred, - produced_by: Some(NodeId(768)), - }, - ); - ports.insert( - PortId(901), - Port { - id: PortId(901), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(902), - Port { - id: PortId(902), - state: PortState::Uninferred, - produced_by: Some(NodeId(769)), - }, - ); - ports.insert( - PortId(903), - Port { - id: PortId(903), - state: PortState::Uninferred, - produced_by: Some(NodeId(770)), - }, - ); - ports.insert( - PortId(904), - Port { - id: PortId(904), - state: PortState::Uninferred, - produced_by: Some(NodeId(771)), - }, - ); - ports.insert( - PortId(905), - Port { - id: PortId(905), - state: PortState::Uninferred, - produced_by: Some(NodeId(772)), - }, - ); - ports.insert( - PortId(906), - Port { - id: PortId(906), - state: PortState::Resolved(TypeShape::new(DeclarationId(1060))), - produced_by: Some(NodeId(773)), - }, - ); - ports.insert( - PortId(907), - Port { - id: PortId(907), - state: PortState::Resolved(TypeShape::new(DeclarationId(1250))), - produced_by: None, - }, - ); - ports.insert( - PortId(908), - Port { - id: PortId(908), - state: PortState::Resolved(TypeShape::new(DeclarationId(829))), - produced_by: None, - }, - ); - ports.insert( - PortId(909), - Port { - id: PortId(909), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(910), - Port { - id: PortId(910), - state: PortState::Uninferred, - produced_by: Some(NodeId(775)), - }, - ); - ports.insert( - PortId(911), - Port { - id: PortId(911), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(912), - Port { - id: PortId(912), - state: PortState::Uninferred, - produced_by: Some(NodeId(776)), - }, - ); - ports.insert( - PortId(913), - Port { - id: PortId(913), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(914), - Port { - id: PortId(914), - state: PortState::Uninferred, - produced_by: Some(NodeId(777)), - }, - ); - ports.insert( - PortId(915), - Port { - id: PortId(915), - state: PortState::Uninferred, - produced_by: Some(NodeId(778)), - }, - ); - ports.insert( - PortId(916), - Port { - id: PortId(916), - state: PortState::Uninferred, - produced_by: Some(NodeId(779)), - }, - ); - ports.insert( - PortId(917), - Port { - id: PortId(917), - state: PortState::Uninferred, - produced_by: Some(NodeId(780)), - }, - ); - ports.insert( - PortId(918), - Port { - id: PortId(918), - state: PortState::Uninferred, - produced_by: Some(NodeId(781)), - }, - ); - ports.insert( - PortId(919), - Port { - id: PortId(919), - state: PortState::Resolved(TypeShape::new(DeclarationId(1250))), - produced_by: Some(NodeId(782)), - }, - ); - ports.insert( - PortId(920), - Port { - id: PortId(920), - state: PortState::Resolved(TypeShape::new(DeclarationId(839))), - produced_by: None, - }, - ); - ports.insert( - PortId(921), - Port { - id: PortId(921), - state: PortState::Resolved(TypeShape::new(DeclarationId(838))), - produced_by: None, - }, - ); - ports.insert( - PortId(922), - Port { - id: PortId(922), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(923), - Port { - id: PortId(923), - state: PortState::Uninferred, - produced_by: Some(NodeId(784)), - }, - ); - ports.insert( - PortId(924), - Port { - id: PortId(924), - state: PortState::Uninferred, - produced_by: Some(NodeId(785)), - }, - ); - ports.insert( - PortId(925), - Port { - id: PortId(925), - state: PortState::Uninferred, - produced_by: Some(NodeId(786)), - }, - ); - ports.insert( - PortId(926), - Port { - id: PortId(926), - state: PortState::Uninferred, - produced_by: Some(NodeId(787)), - }, - ); - ports.insert( - PortId(927), - Port { - id: PortId(927), - state: PortState::Uninferred, - produced_by: Some(NodeId(788)), - }, - ); - ports.insert( - PortId(928), - Port { - id: PortId(928), - state: PortState::Uninferred, - produced_by: Some(NodeId(789)), - }, - ); - ports.insert( - PortId(929), - Port { - id: PortId(929), - state: PortState::Uninferred, - produced_by: Some(NodeId(790)), - }, - ); - ports.insert( - PortId(930), - Port { - id: PortId(930), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(931), - Port { - id: PortId(931), - state: PortState::Uninferred, - produced_by: Some(NodeId(791)), - }, - ); - ports.insert( - PortId(932), - Port { - id: PortId(932), - state: PortState::Uninferred, - produced_by: Some(NodeId(792)), - }, - ); - ports.insert( - PortId(933), - Port { - id: PortId(933), - state: PortState::Uninferred, - produced_by: Some(NodeId(793)), - }, - ); - ports.insert( - PortId(934), - Port { - id: PortId(934), - state: PortState::Uninferred, - produced_by: Some(NodeId(794)), - }, - ); - ports.insert( - PortId(935), - Port { - id: PortId(935), - state: PortState::Uninferred, - produced_by: Some(NodeId(795)), - }, - ); - ports.insert( - PortId(936), - Port { - id: PortId(936), - state: PortState::Uninferred, - produced_by: Some(NodeId(796)), - }, - ); - ports.insert( - PortId(937), - Port { - id: PortId(937), - state: PortState::Uninferred, - produced_by: Some(NodeId(797)), - }, - ); - ports.insert( - PortId(938), - Port { - id: PortId(938), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(939), - Port { - id: PortId(939), - state: PortState::Uninferred, - produced_by: Some(NodeId(798)), - }, - ); - ports.insert( - PortId(940), - Port { - id: PortId(940), - state: PortState::Uninferred, - produced_by: Some(NodeId(799)), - }, - ); - ports.insert( - PortId(941), - Port { - id: PortId(941), - state: PortState::Uninferred, - produced_by: Some(NodeId(800)), - }, - ); - ports.insert( - PortId(942), - Port { - id: PortId(942), - state: PortState::Uninferred, - produced_by: Some(NodeId(801)), - }, - ); - ports.insert( - PortId(943), - Port { - id: PortId(943), - state: PortState::Uninferred, - produced_by: Some(NodeId(802)), - }, - ); - ports.insert( - PortId(944), - Port { - id: PortId(944), - state: PortState::Uninferred, - produced_by: Some(NodeId(803)), - }, - ); - ports.insert( - PortId(945), - Port { - id: PortId(945), - state: PortState::Uninferred, - produced_by: Some(NodeId(804)), - }, - ); - ports.insert( - PortId(946), - Port { - id: PortId(946), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(947), - Port { - id: PortId(947), - state: PortState::Uninferred, - produced_by: Some(NodeId(805)), - }, - ); - ports.insert( - PortId(948), - Port { - id: PortId(948), - state: PortState::Uninferred, - produced_by: Some(NodeId(806)), - }, - ); - ports.insert( - PortId(949), - Port { - id: PortId(949), - state: PortState::Uninferred, - produced_by: Some(NodeId(807)), - }, - ); - ports.insert( - PortId(950), - Port { - id: PortId(950), - state: PortState::Uninferred, - produced_by: Some(NodeId(808)), - }, - ); - ports.insert( - PortId(951), - Port { - id: PortId(951), - state: PortState::Uninferred, - produced_by: Some(NodeId(809)), - }, - ); - ports.insert( - PortId(952), - Port { - id: PortId(952), - state: PortState::Uninferred, - produced_by: Some(NodeId(810)), - }, - ); - ports.insert( - PortId(953), - Port { - id: PortId(953), - state: PortState::Uninferred, - produced_by: Some(NodeId(811)), - }, - ); - ports.insert( - PortId(954), - Port { - id: PortId(954), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(955), - Port { - id: PortId(955), - state: PortState::Uninferred, - produced_by: Some(NodeId(812)), - }, - ); - ports.insert( - PortId(956), - Port { - id: PortId(956), - state: PortState::Uninferred, - produced_by: Some(NodeId(813)), - }, - ); - ports.insert( - PortId(957), - Port { - id: PortId(957), - state: PortState::Uninferred, - produced_by: Some(NodeId(814)), - }, - ); - ports.insert( - PortId(958), - Port { - id: PortId(958), - state: PortState::Uninferred, - produced_by: Some(NodeId(815)), - }, - ); - ports.insert( - PortId(959), - Port { - id: PortId(959), - state: PortState::Uninferred, - produced_by: Some(NodeId(816)), - }, - ); - ports.insert( - PortId(960), - Port { - id: PortId(960), - state: PortState::Uninferred, - produced_by: Some(NodeId(817)), - }, - ); - ports.insert( - PortId(961), - Port { - id: PortId(961), - state: PortState::Uninferred, - produced_by: Some(NodeId(818)), - }, - ); - ports.insert( - PortId(962), - Port { - id: PortId(962), - state: PortState::Resolved(TypeShape::new(DeclarationId(2692))), - produced_by: Some(NodeId(819)), - }, - ); - ports.insert( - PortId(963), - Port { - id: PortId(963), - state: PortState::Resolved(TypeShape::new(DeclarationId(839))), - produced_by: None, - }, - ); - ports.insert( - PortId(964), - Port { - id: PortId(964), - state: PortState::Resolved(TypeShape::new(DeclarationId(1250))), - produced_by: None, - }, - ); - ports.insert( - PortId(965), - Port { - id: PortId(965), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(966), - Port { - id: PortId(966), - state: PortState::Uninferred, - produced_by: Some(NodeId(821)), - }, - ); - ports.insert( - PortId(967), - Port { - id: PortId(967), - state: PortState::Uninferred, - produced_by: Some(NodeId(822)), - }, - ); - ports.insert( - PortId(968), - Port { - id: PortId(968), - state: PortState::Uninferred, - produced_by: Some(NodeId(823)), - }, - ); - ports.insert( - PortId(969), - Port { - id: PortId(969), - state: PortState::Uninferred, - produced_by: Some(NodeId(824)), - }, - ); - ports.insert( - PortId(970), - Port { - id: PortId(970), - state: PortState::Uninferred, - produced_by: Some(NodeId(825)), - }, - ); - ports.insert( - PortId(971), - Port { - id: PortId(971), - state: PortState::Uninferred, - produced_by: Some(NodeId(826)), - }, - ); - ports.insert( - PortId(972), - Port { - id: PortId(972), - state: PortState::Uninferred, - produced_by: Some(NodeId(827)), - }, - ); - ports.insert( - PortId(973), - Port { - id: PortId(973), - state: PortState::Uninferred, - produced_by: Some(NodeId(828)), - }, - ); - ports.insert( - PortId(974), - Port { - id: PortId(974), - state: PortState::Uninferred, - produced_by: Some(NodeId(829)), - }, - ); - ports.insert( - PortId(975), - Port { - id: PortId(975), - state: PortState::Uninferred, - produced_by: Some(NodeId(830)), - }, - ); - ports.insert( - PortId(976), - Port { - id: PortId(976), - state: PortState::Uninferred, - produced_by: Some(NodeId(831)), - }, - ); - ports.insert( - PortId(977), - Port { - id: PortId(977), - state: PortState::Uninferred, - produced_by: Some(NodeId(832)), - }, - ); - ports.insert( - PortId(978), - Port { - id: PortId(978), - state: PortState::Resolved(TypeShape::new(DeclarationId(1060))), - produced_by: Some(NodeId(833)), - }, - ); - ports.insert( - PortId(979), - Port { - id: PortId(979), - state: PortState::Resolved(TypeShape::new(DeclarationId(76))), - produced_by: Some(NodeId(835)), - }, - ); - ports.insert( - PortId(980), - Port { - id: PortId(980), - state: PortState::Resolved(TypeShape::new(DeclarationId(1250))), - produced_by: None, - }, - ); - ports.insert( - PortId(981), - Port { - id: PortId(981), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(982), - Port { - id: PortId(982), - state: PortState::Uninferred, - produced_by: Some(NodeId(837)), - }, - ); - ports.insert( - PortId(983), - Port { - id: PortId(983), - state: PortState::Uninferred, - produced_by: Some(NodeId(838)), - }, - ); - ports.insert( - PortId(984), - Port { - id: PortId(984), - state: PortState::Uninferred, - produced_by: Some(NodeId(839)), - }, - ); - ports.insert( - PortId(985), - Port { - id: PortId(985), - state: PortState::Uninferred, - produced_by: Some(NodeId(840)), - }, - ); - ports.insert( - PortId(986), - Port { - id: PortId(986), - state: PortState::Uninferred, - produced_by: Some(NodeId(841)), - }, - ); - ports.insert( - PortId(987), - Port { - id: PortId(987), - state: PortState::Resolved(TypeShape::new(DeclarationId(1257))), - produced_by: Some(NodeId(842)), - }, - ); - ports.insert( - PortId(988), - Port { - id: PortId(988), - state: PortState::Resolved(TypeShape::new(DeclarationId(1250))), - produced_by: None, - }, - ); - ports.insert( - PortId(989), - Port { - id: PortId(989), - state: PortState::Resolved(TypeShape::new(DeclarationId(1256))), - produced_by: None, - }, - ); - ports.insert( - PortId(990), - Port { - id: PortId(990), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(991), - Port { - id: PortId(991), - state: PortState::Uninferred, - produced_by: Some(NodeId(844)), - }, - ); - ports.insert( - PortId(992), - Port { - id: PortId(992), - state: PortState::Uninferred, - produced_by: Some(NodeId(845)), - }, - ); - ports.insert( - PortId(993), - Port { - id: PortId(993), - state: PortState::Resolved(TypeShape::new(DeclarationId(1249))), - produced_by: Some(NodeId(846)), - }, - ); - ports.insert( - PortId(994), - Port { - id: PortId(994), - state: PortState::Resolved(TypeShape::new(DeclarationId(76))), - produced_by: Some(NodeId(847)), - }, - ); - ports.insert( - PortId(995), - Port { - id: PortId(995), - state: PortState::Uninferred, - produced_by: Some(NodeId(848)), - }, - ); - ports.insert( - PortId(996), - Port { - id: PortId(996), - state: PortState::Uninferred, - produced_by: Some(NodeId(849)), - }, - ); - ports.insert( - PortId(997), - Port { - id: PortId(997), - state: PortState::Uninferred, - produced_by: Some(NodeId(850)), - }, - ); - ports.insert( - PortId(998), - Port { - id: PortId(998), - state: PortState::Uninferred, - produced_by: Some(NodeId(851)), - }, - ); - ports.insert( - PortId(999), - Port { - id: PortId(999), - state: PortState::Uninferred, - produced_by: Some(NodeId(852)), - }, - ); - ports.insert( - PortId(1000), - Port { - id: PortId(1000), - state: PortState::Uninferred, - produced_by: Some(NodeId(853)), - }, - ); - ports.insert( - PortId(1001), - Port { - id: PortId(1001), - state: PortState::Uninferred, - produced_by: Some(NodeId(854)), - }, - ); - ports.insert( - PortId(1002), - Port { - id: PortId(1002), - state: PortState::Uninferred, - produced_by: Some(NodeId(855)), - }, - ); - ports.insert( - PortId(1003), - Port { - id: PortId(1003), - state: PortState::Uninferred, - produced_by: Some(NodeId(856)), - }, - ); - ports.insert( - PortId(1004), - Port { - id: PortId(1004), - state: PortState::Uninferred, - produced_by: Some(NodeId(857)), - }, - ); - ports.insert( - PortId(1005), - Port { - id: PortId(1005), - state: PortState::Uninferred, - produced_by: Some(NodeId(858)), - }, - ); - ports.insert( - PortId(1006), - Port { - id: PortId(1006), - state: PortState::Uninferred, - produced_by: Some(NodeId(859)), - }, - ); - ports.insert( - PortId(1007), - Port { - id: PortId(1007), - state: PortState::Uninferred, - produced_by: Some(NodeId(860)), - }, - ); - ports.insert( - PortId(1008), - Port { - id: PortId(1008), - state: PortState::Uninferred, - produced_by: Some(NodeId(861)), - }, - ); - ports.insert( - PortId(1009), - Port { - id: PortId(1009), - state: PortState::Uninferred, - produced_by: Some(NodeId(862)), - }, - ); - ports.insert( - PortId(1010), - Port { - id: PortId(1010), - state: PortState::Uninferred, - produced_by: Some(NodeId(863)), - }, - ); - ports.insert( - PortId(1011), - Port { - id: PortId(1011), - state: PortState::Uninferred, - produced_by: Some(NodeId(864)), - }, - ); - ports.insert( - PortId(1012), - Port { - id: PortId(1012), - state: PortState::Resolved(TypeShape::new(DeclarationId(124))), - produced_by: Some(NodeId(865)), - }, - ); - ports.insert( - PortId(1013), - Port { - id: PortId(1013), - state: PortState::Resolved(TypeShape::new(DeclarationId(839))), - produced_by: None, - }, - ); - ports.insert( - PortId(1014), - Port { - id: PortId(1014), - state: PortState::Resolved(TypeShape::new(DeclarationId(838))), - produced_by: None, - }, - ); - ports.insert( - PortId(1015), - Port { - id: PortId(1015), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1016), - Port { - id: PortId(1016), - state: PortState::Uninferred, - produced_by: Some(NodeId(867)), - }, - ); - ports.insert( - PortId(1017), - Port { - id: PortId(1017), - state: PortState::Uninferred, - produced_by: Some(NodeId(868)), - }, - ); - ports.insert( - PortId(1018), - Port { - id: PortId(1018), - state: PortState::Uninferred, - produced_by: Some(NodeId(869)), - }, - ); - ports.insert( - PortId(1019), - Port { - id: PortId(1019), - state: PortState::Uninferred, - produced_by: Some(NodeId(870)), - }, - ); - ports.insert( - PortId(1020), - Port { - id: PortId(1020), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1021), - Port { - id: PortId(1021), - state: PortState::Uninferred, - produced_by: Some(NodeId(871)), - }, - ); - ports.insert( - PortId(1022), - Port { - id: PortId(1022), - state: PortState::Uninferred, - produced_by: Some(NodeId(872)), - }, - ); - ports.insert( - PortId(1023), - Port { - id: PortId(1023), - state: PortState::Uninferred, - produced_by: Some(NodeId(873)), - }, - ); - ports.insert( - PortId(1024), - Port { - id: PortId(1024), - state: PortState::Uninferred, - produced_by: Some(NodeId(874)), - }, - ); - ports.insert( - PortId(1025), - Port { - id: PortId(1025), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1026), - Port { - id: PortId(1026), - state: PortState::Uninferred, - produced_by: Some(NodeId(875)), - }, - ); - ports.insert( - PortId(1027), - Port { - id: PortId(1027), - state: PortState::Uninferred, - produced_by: Some(NodeId(876)), - }, - ); - ports.insert( - PortId(1028), - Port { - id: PortId(1028), - state: PortState::Uninferred, - produced_by: Some(NodeId(877)), - }, - ); - ports.insert( - PortId(1029), - Port { - id: PortId(1029), - state: PortState::Uninferred, - produced_by: Some(NodeId(878)), - }, - ); - ports.insert( - PortId(1030), - Port { - id: PortId(1030), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1031), - Port { - id: PortId(1031), - state: PortState::Uninferred, - produced_by: Some(NodeId(879)), - }, - ); - ports.insert( - PortId(1032), - Port { - id: PortId(1032), - state: PortState::Uninferred, - produced_by: Some(NodeId(880)), - }, - ); - ports.insert( - PortId(1033), - Port { - id: PortId(1033), - state: PortState::Uninferred, - produced_by: Some(NodeId(881)), - }, - ); - ports.insert( - PortId(1034), - Port { - id: PortId(1034), - state: PortState::Uninferred, - produced_by: Some(NodeId(882)), - }, - ); - ports.insert( - PortId(1035), - Port { - id: PortId(1035), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1036), - Port { - id: PortId(1036), - state: PortState::Uninferred, - produced_by: Some(NodeId(883)), - }, - ); - ports.insert( - PortId(1037), - Port { - id: PortId(1037), - state: PortState::Uninferred, - produced_by: Some(NodeId(884)), - }, - ); - ports.insert( - PortId(1038), - Port { - id: PortId(1038), - state: PortState::Uninferred, - produced_by: Some(NodeId(885)), - }, - ); - ports.insert( - PortId(1039), - Port { - id: PortId(1039), - state: PortState::Uninferred, - produced_by: Some(NodeId(886)), - }, - ); - ports.insert( - PortId(1040), - Port { - id: PortId(1040), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1041), - Port { - id: PortId(1041), - state: PortState::Uninferred, - produced_by: Some(NodeId(887)), - }, - ); - ports.insert( - PortId(1042), - Port { - id: PortId(1042), - state: PortState::Uninferred, - produced_by: Some(NodeId(888)), - }, - ); - ports.insert( - PortId(1043), - Port { - id: PortId(1043), - state: PortState::Uninferred, - produced_by: Some(NodeId(889)), - }, - ); - ports.insert( - PortId(1044), - Port { - id: PortId(1044), - state: PortState::Uninferred, - produced_by: Some(NodeId(890)), - }, - ); - ports.insert( - PortId(1045), - Port { - id: PortId(1045), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1046), - Port { - id: PortId(1046), - state: PortState::Uninferred, - produced_by: Some(NodeId(891)), - }, - ); - ports.insert( - PortId(1047), - Port { - id: PortId(1047), - state: PortState::Uninferred, - produced_by: Some(NodeId(892)), - }, - ); - ports.insert( - PortId(1048), - Port { - id: PortId(1048), - state: PortState::Uninferred, - produced_by: Some(NodeId(893)), - }, - ); - ports.insert( - PortId(1049), - Port { - id: PortId(1049), - state: PortState::Uninferred, - produced_by: Some(NodeId(894)), - }, - ); - ports.insert( - PortId(1050), - Port { - id: PortId(1050), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1051), - Port { - id: PortId(1051), - state: PortState::Uninferred, - produced_by: Some(NodeId(895)), - }, - ); - ports.insert( - PortId(1052), - Port { - id: PortId(1052), - state: PortState::Uninferred, - produced_by: Some(NodeId(896)), - }, - ); - ports.insert( - PortId(1053), - Port { - id: PortId(1053), - state: PortState::Uninferred, - produced_by: Some(NodeId(897)), - }, - ); - ports.insert( - PortId(1054), - Port { - id: PortId(1054), - state: PortState::Uninferred, - produced_by: Some(NodeId(898)), - }, - ); - ports.insert( - PortId(1055), - Port { - id: PortId(1055), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1056), - Port { - id: PortId(1056), - state: PortState::Uninferred, - produced_by: Some(NodeId(899)), - }, - ); - ports.insert( - PortId(1057), - Port { - id: PortId(1057), - state: PortState::Uninferred, - produced_by: Some(NodeId(900)), - }, - ); - ports.insert( - PortId(1058), - Port { - id: PortId(1058), - state: PortState::Uninferred, - produced_by: Some(NodeId(901)), - }, - ); - ports.insert( - PortId(1059), - Port { - id: PortId(1059), - state: PortState::Uninferred, - produced_by: Some(NodeId(902)), - }, - ); - ports.insert( - PortId(1060), - Port { - id: PortId(1060), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1061), - Port { - id: PortId(1061), - state: PortState::Uninferred, - produced_by: Some(NodeId(903)), - }, - ); - ports.insert( - PortId(1062), - Port { - id: PortId(1062), - state: PortState::Uninferred, - produced_by: Some(NodeId(904)), - }, - ); - ports.insert( - PortId(1063), - Port { - id: PortId(1063), - state: PortState::Uninferred, - produced_by: Some(NodeId(905)), - }, - ); - ports.insert( - PortId(1064), - Port { - id: PortId(1064), - state: PortState::Uninferred, - produced_by: Some(NodeId(906)), - }, - ); - ports.insert( - PortId(1065), - Port { - id: PortId(1065), - state: PortState::Resolved(TypeShape::new(DeclarationId(2713))), - produced_by: Some(NodeId(907)), - }, - ); - ports.insert( - PortId(1066), - Port { - id: PortId(1066), - state: PortState::Resolved(TypeShape::new(DeclarationId(839))), - produced_by: None, - }, - ); - ports.insert( - PortId(1067), - Port { - id: PortId(1067), - state: PortState::Resolved(TypeShape::new(DeclarationId(838))), - produced_by: None, - }, - ); - ports.insert( - PortId(1068), - Port { - id: PortId(1068), - state: PortState::Resolved(TypeShape::new(DeclarationId(2714))), - produced_by: Some(NodeId(909)), - }, - ); - ports.insert( - PortId(1069), - Port { - id: PortId(1069), - state: PortState::Resolved(TypeShape::new(DeclarationId(2715))), - produced_by: Some(NodeId(911)), - }, - ); - ports.insert( - PortId(1070), - Port { - id: PortId(1070), - state: PortState::Resolved(TypeShape::new(DeclarationId(2716))), - produced_by: Some(NodeId(913)), - }, - ); - ports.insert( - PortId(1071), - Port { - id: PortId(1071), - state: PortState::Resolved(TypeShape::new(DeclarationId(2717))), - produced_by: Some(NodeId(915)), - }, - ); - ports.insert( - PortId(1072), - Port { - id: PortId(1072), - state: PortState::Resolved(TypeShape::new(DeclarationId(2718))), - produced_by: Some(NodeId(917)), - }, - ); - ports.insert( - PortId(1073), - Port { - id: PortId(1073), - state: PortState::Resolved(TypeShape::new(DeclarationId(2719))), - produced_by: Some(NodeId(919)), - }, - ); - ports.insert( - PortId(1074), - Port { - id: PortId(1074), - state: PortState::Resolved(TypeShape::new(DeclarationId(2721))), - produced_by: Some(NodeId(921)), - }, - ); - ports.insert( - PortId(1075), - Port { - id: PortId(1075), - state: PortState::Resolved(TypeShape::new(DeclarationId(1250))), - produced_by: None, - }, - ); - ports.insert( - PortId(1076), - Port { - id: PortId(1076), - state: PortState::Uninferred, - produced_by: Some(NodeId(923)), - }, - ); - ports.insert( - PortId(1077), - Port { - id: PortId(1077), - state: PortState::Uninferred, - produced_by: Some(NodeId(924)), - }, - ); - ports.insert( - PortId(1078), - Port { - id: PortId(1078), - state: PortState::Resolved(TypeShape::new(DeclarationId(2723))), - produced_by: Some(NodeId(925)), - }, - ); - ports.insert( - PortId(1079), - Port { - id: PortId(1079), - state: PortState::Resolved(TypeShape::new(DeclarationId(1055))), - produced_by: None, - }, - ); - ports.insert( - PortId(1080), - Port { - id: PortId(1080), - state: PortState::Uninferred, - produced_by: Some(NodeId(927)), - }, - ); - ports.insert( - PortId(1081), - Port { - id: PortId(1081), - state: PortState::Resolved(TypeShape::new(DeclarationId(2724))), - produced_by: Some(NodeId(928)), - }, - ); - ports.insert( - PortId(1082), - Port { - id: PortId(1082), - state: PortState::Resolved(TypeShape::new(DeclarationId(1250))), - produced_by: None, - }, - ); - ports.insert( - PortId(1083), - Port { - id: PortId(1083), - state: PortState::Uninferred, - produced_by: Some(NodeId(930)), - }, - ); - ports.insert( - PortId(1084), - Port { - id: PortId(1084), - state: PortState::Uninferred, - produced_by: Some(NodeId(931)), - }, - ); - ports.insert( - PortId(1085), - Port { - id: PortId(1085), - state: PortState::Resolved(TypeShape::new(DeclarationId(2725))), - produced_by: Some(NodeId(932)), - }, - ); - ports.insert( - PortId(1086), - Port { - id: PortId(1086), - state: PortState::Resolved(TypeShape::new(DeclarationId(1250))), - produced_by: None, - }, - ); - ports.insert( - PortId(1087), - Port { - id: PortId(1087), - state: PortState::Resolved(TypeShape::new(DeclarationId(1055))), - produced_by: None, - }, - ); - ports.insert( - PortId(1088), - Port { - id: PortId(1088), - state: PortState::Uninferred, - produced_by: Some(NodeId(934)), - }, - ); - ports.insert( - PortId(1089), - Port { - id: PortId(1089), - state: PortState::Uninferred, - produced_by: Some(NodeId(935)), - }, - ); - ports.insert( - PortId(1090), - Port { - id: PortId(1090), - state: PortState::Uninferred, - produced_by: Some(NodeId(936)), - }, - ); - ports.insert( - PortId(1091), - Port { - id: PortId(1091), - state: PortState::Resolved(TypeShape::new(DeclarationId(2726))), - produced_by: Some(NodeId(937)), - }, - ); - ports.insert( - PortId(1092), - Port { - id: PortId(1092), - state: PortState::Resolved(TypeShape::new(DeclarationId(839))), - produced_by: None, - }, - ); - ports.insert( - PortId(1093), - Port { - id: PortId(1093), - state: PortState::Resolved(TypeShape::new(DeclarationId(1250))), - produced_by: None, - }, - ); - ports.insert( - PortId(1094), - Port { - id: PortId(1094), - state: PortState::Uninferred, - produced_by: Some(NodeId(939)), - }, - ); - ports.insert( - PortId(1095), - Port { - id: PortId(1095), - state: PortState::Uninferred, - produced_by: Some(NodeId(940)), - }, - ); - ports.insert( - PortId(1096), - Port { - id: PortId(1096), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1097), - Port { - id: PortId(1097), - state: PortState::Uninferred, - produced_by: Some(NodeId(941)), - }, - ); - ports.insert( - PortId(1098), - Port { - id: PortId(1098), - state: PortState::Uninferred, - produced_by: Some(NodeId(942)), - }, - ); - ports.insert( - PortId(1099), - Port { - id: PortId(1099), - state: PortState::Uninferred, - produced_by: Some(NodeId(943)), - }, - ); - ports.insert( - PortId(1100), - Port { - id: PortId(1100), - state: PortState::Resolved(TypeShape::new(DeclarationId(2727))), - produced_by: Some(NodeId(944)), - }, - ); - ports.insert( - PortId(1101), - Port { - id: PortId(1101), - state: PortState::Resolved(TypeShape::new(DeclarationId(839))), - produced_by: None, - }, - ); - ports.insert( - PortId(1102), - Port { - id: PortId(1102), - state: PortState::Resolved(TypeShape::new(DeclarationId(1250))), - produced_by: None, - }, - ); - ports.insert( - PortId(1103), - Port { - id: PortId(1103), - state: PortState::Resolved(TypeShape::new(DeclarationId(1055))), - produced_by: None, - }, - ); - ports.insert( - PortId(1104), - Port { - id: PortId(1104), - state: PortState::Uninferred, - produced_by: Some(NodeId(946)), - }, - ); - ports.insert( - PortId(1105), - Port { - id: PortId(1105), - state: PortState::Uninferred, - produced_by: Some(NodeId(947)), - }, - ); - ports.insert( - PortId(1106), - Port { - id: PortId(1106), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1107), - Port { - id: PortId(1107), - state: PortState::Uninferred, - produced_by: Some(NodeId(948)), - }, - ); - ports.insert( - PortId(1108), - Port { - id: PortId(1108), - state: PortState::Uninferred, - produced_by: Some(NodeId(949)), - }, - ); - ports.insert( - PortId(1109), - Port { - id: PortId(1109), - state: PortState::Uninferred, - produced_by: Some(NodeId(950)), - }, - ); - ports.insert( - PortId(1110), - Port { - id: PortId(1110), - state: PortState::Resolved(TypeShape::new(DeclarationId(2728))), - produced_by: Some(NodeId(951)), - }, - ); - ports.insert( - PortId(1111), - Port { - id: PortId(1111), - state: PortState::Resolved(TypeShape::new(DeclarationId(839))), - produced_by: None, - }, - ); - ports.insert( - PortId(1112), - Port { - id: PortId(1112), - state: PortState::Resolved(TypeShape::new(DeclarationId(1250))), - produced_by: None, - }, - ); - ports.insert( - PortId(1113), - Port { - id: PortId(1113), - state: PortState::Resolved(TypeShape::new(DeclarationId(1060))), - produced_by: None, - }, - ); - ports.insert( - PortId(1114), - Port { - id: PortId(1114), - state: PortState::Uninferred, - produced_by: Some(NodeId(953)), - }, - ); - ports.insert( - PortId(1115), - Port { - id: PortId(1115), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1116), - Port { - id: PortId(1116), - state: PortState::Uninferred, - produced_by: Some(NodeId(954)), - }, - ); - ports.insert( - PortId(1117), - Port { - id: PortId(1117), - state: PortState::Uninferred, - produced_by: Some(NodeId(955)), - }, - ); - ports.insert( - PortId(1118), - Port { - id: PortId(1118), - state: PortState::Resolved(TypeShape::new(DeclarationId(2729))), - produced_by: Some(NodeId(956)), - }, - ); - ports.insert( - PortId(1119), - Port { - id: PortId(1119), - state: PortState::Resolved(TypeShape::new(DeclarationId(839))), - produced_by: None, - }, - ); - ports.insert( - PortId(1120), - Port { - id: PortId(1120), - state: PortState::Resolved(TypeShape::new(DeclarationId(2730))), - produced_by: None, - }, - ); - ports.insert( - PortId(1121), - Port { - id: PortId(1121), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1122), - Port { - id: PortId(1122), - state: PortState::Uninferred, - produced_by: Some(NodeId(958)), - }, - ); - ports.insert( - PortId(1123), - Port { - id: PortId(1123), - state: PortState::Uninferred, - produced_by: Some(NodeId(959)), - }, - ); - ports.insert( - PortId(1124), - Port { - id: PortId(1124), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1125), - Port { - id: PortId(1125), - state: PortState::Uninferred, - produced_by: Some(NodeId(960)), - }, - ); - ports.insert( - PortId(1126), - Port { - id: PortId(1126), - state: PortState::Uninferred, - produced_by: Some(NodeId(961)), - }, - ); - ports.insert( - PortId(1127), - Port { - id: PortId(1127), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1128), - Port { - id: PortId(1128), - state: PortState::Uninferred, - produced_by: Some(NodeId(962)), - }, - ); - ports.insert( - PortId(1129), - Port { - id: PortId(1129), - state: PortState::Uninferred, - produced_by: Some(NodeId(963)), - }, - ); - ports.insert( - PortId(1130), - Port { - id: PortId(1130), - state: PortState::Uninferred, - produced_by: Some(NodeId(964)), - }, - ); - ports.insert( - PortId(1131), - Port { - id: PortId(1131), - state: PortState::Uninferred, - produced_by: Some(NodeId(965)), - }, - ); - ports.insert( - PortId(1132), - Port { - id: PortId(1132), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1133), - Port { - id: PortId(1133), - state: PortState::Uninferred, - produced_by: Some(NodeId(966)), - }, - ); - ports.insert( - PortId(1134), - Port { - id: PortId(1134), - state: PortState::Uninferred, - produced_by: Some(NodeId(967)), - }, - ); - ports.insert( - PortId(1135), - Port { - id: PortId(1135), - state: PortState::Uninferred, - produced_by: Some(NodeId(968)), - }, - ); - ports.insert( - PortId(1136), - Port { - id: PortId(1136), - state: PortState::Uninferred, - produced_by: Some(NodeId(969)), - }, - ); - ports.insert( - PortId(1137), - Port { - id: PortId(1137), - state: PortState::Uninferred, - produced_by: Some(NodeId(970)), - }, - ); - ports.insert( - PortId(1138), - Port { - id: PortId(1138), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1139), - Port { - id: PortId(1139), - state: PortState::Uninferred, - produced_by: Some(NodeId(971)), - }, - ); - ports.insert( - PortId(1140), - Port { - id: PortId(1140), - state: PortState::Uninferred, - produced_by: Some(NodeId(972)), - }, - ); - ports.insert( - PortId(1141), - Port { - id: PortId(1141), - state: PortState::Uninferred, - produced_by: Some(NodeId(973)), - }, - ); - ports.insert( - PortId(1142), - Port { - id: PortId(1142), - state: PortState::Uninferred, - produced_by: Some(NodeId(974)), - }, - ); - ports.insert( - PortId(1143), - Port { - id: PortId(1143), - state: PortState::Uninferred, - produced_by: Some(NodeId(975)), - }, - ); - ports.insert( - PortId(1144), - Port { - id: PortId(1144), - state: PortState::Uninferred, - produced_by: Some(NodeId(976)), - }, - ); - ports.insert( - PortId(1145), - Port { - id: PortId(1145), - state: PortState::Resolved(TypeShape::new(DeclarationId(2731))), - produced_by: Some(NodeId(977)), - }, - ); - ports.insert( - PortId(1146), - Port { - id: PortId(1146), - state: PortState::Resolved(TypeShape::new(DeclarationId(839))), - produced_by: None, - }, - ); - ports.insert( - PortId(1147), - Port { - id: PortId(1147), - state: PortState::Resolved(TypeShape::new(DeclarationId(838))), - produced_by: None, - }, - ); - ports.insert( - PortId(1148), - Port { - id: PortId(1148), - state: PortState::Uninferred, - produced_by: Some(NodeId(979)), - }, - ); - ports.insert( - PortId(1149), - Port { - id: PortId(1149), - state: PortState::Uninferred, - produced_by: Some(NodeId(980)), - }, - ); - ports.insert( - PortId(1150), - Port { - id: PortId(1150), - state: PortState::Uninferred, - produced_by: Some(NodeId(981)), - }, - ); - ports.insert( - PortId(1151), - Port { - id: PortId(1151), - state: PortState::Uninferred, - produced_by: Some(NodeId(982)), - }, - ); - ports.insert( - PortId(1152), - Port { - id: PortId(1152), - state: PortState::Uninferred, - produced_by: Some(NodeId(983)), - }, - ); - ports.insert( - PortId(1153), - Port { - id: PortId(1153), - state: PortState::Uninferred, - produced_by: Some(NodeId(984)), - }, - ); - ports.insert( - PortId(1154), - Port { - id: PortId(1154), - state: PortState::Resolved(TypeShape::new(DeclarationId(2732))), - produced_by: Some(NodeId(985)), - }, - ); - ports.insert( - PortId(1155), - Port { - id: PortId(1155), - state: PortState::Resolved(TypeShape::new(DeclarationId(1339))), - produced_by: None, - }, - ); - ports.insert( - PortId(1156), - Port { - id: PortId(1156), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1157), - Port { - id: PortId(1157), - state: PortState::Uninferred, - produced_by: Some(NodeId(987)), - }, - ); - ports.insert( - PortId(1158), - Port { - id: PortId(1158), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1159), - Port { - id: PortId(1159), - state: PortState::Uninferred, - produced_by: Some(NodeId(988)), - }, - ); - ports.insert( - PortId(1160), - Port { - id: PortId(1160), - state: PortState::Resolved(TypeShape::new(DeclarationId(1341))), - produced_by: Some(NodeId(989)), - }, - ); - ports.insert( - PortId(1161), - Port { - id: PortId(1161), - state: PortState::Resolved(TypeShape::new(DeclarationId(817))), - produced_by: None, - }, - ); - ports.insert( - PortId(1162), - Port { - id: PortId(1162), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1163), - Port { - id: PortId(1163), - state: PortState::Uninferred, - produced_by: Some(NodeId(991)), - }, - ); - ports.insert( - PortId(1164), - Port { - id: PortId(1164), - state: PortState::Uninferred, - produced_by: Some(NodeId(992)), - }, - ); - ports.insert( - PortId(1165), - Port { - id: PortId(1165), - state: PortState::Uninferred, - produced_by: Some(NodeId(993)), - }, - ); - ports.insert( - PortId(1166), - Port { - id: PortId(1166), - state: PortState::Uninferred, - produced_by: Some(NodeId(994)), - }, - ); - ports.insert( - PortId(1167), - Port { - id: PortId(1167), - state: PortState::Uninferred, - produced_by: Some(NodeId(995)), - }, - ); - ports.insert( - PortId(1168), - Port { - id: PortId(1168), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1169), - Port { - id: PortId(1169), - state: PortState::Uninferred, - produced_by: Some(NodeId(996)), - }, - ); - ports.insert( - PortId(1170), - Port { - id: PortId(1170), - state: PortState::Uninferred, - produced_by: Some(NodeId(997)), - }, - ); - ports.insert( - PortId(1171), - Port { - id: PortId(1171), - state: PortState::Uninferred, - produced_by: Some(NodeId(998)), - }, - ); - ports.insert( - PortId(1172), - Port { - id: PortId(1172), - state: PortState::Uninferred, - produced_by: Some(NodeId(999)), - }, - ); - ports.insert( - PortId(1173), - Port { - id: PortId(1173), - state: PortState::Uninferred, - produced_by: Some(NodeId(1000)), - }, - ); - ports.insert( - PortId(1174), - Port { - id: PortId(1174), - state: PortState::Uninferred, - produced_by: Some(NodeId(1001)), - }, - ); - ports.insert( - PortId(1175), - Port { - id: PortId(1175), - state: PortState::Uninferred, - produced_by: Some(NodeId(1002)), - }, - ); - ports.insert( - PortId(1176), - Port { - id: PortId(1176), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1177), - Port { - id: PortId(1177), - state: PortState::Uninferred, - produced_by: Some(NodeId(1003)), - }, - ); - ports.insert( - PortId(1178), - Port { - id: PortId(1178), - state: PortState::Uninferred, - produced_by: Some(NodeId(1004)), - }, - ); - ports.insert( - PortId(1179), - Port { - id: PortId(1179), - state: PortState::Uninferred, - produced_by: Some(NodeId(1005)), - }, - ); - ports.insert( - PortId(1180), - Port { - id: PortId(1180), - state: PortState::Resolved(TypeShape::new(DeclarationId(227))), - produced_by: Some(NodeId(1006)), - }, - ); - ports.insert( - PortId(1181), - Port { - id: PortId(1181), - state: PortState::Resolved(TypeShape::new(DeclarationId(817))), - produced_by: None, - }, - ); - ports.insert( - PortId(1182), - Port { - id: PortId(1182), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1183), - Port { - id: PortId(1183), - state: PortState::Uninferred, - produced_by: Some(NodeId(1008)), - }, - ); - ports.insert( - PortId(1184), - Port { - id: PortId(1184), - state: PortState::Uninferred, - produced_by: Some(NodeId(1009)), - }, - ); - ports.insert( - PortId(1185), - Port { - id: PortId(1185), - state: PortState::Uninferred, - produced_by: Some(NodeId(1010)), - }, - ); - ports.insert( - PortId(1186), - Port { - id: PortId(1186), - state: PortState::Uninferred, - produced_by: Some(NodeId(1011)), - }, - ); - ports.insert( - PortId(1187), - Port { - id: PortId(1187), - state: PortState::Uninferred, - produced_by: Some(NodeId(1012)), - }, - ); - ports.insert( - PortId(1188), - Port { - id: PortId(1188), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1189), - Port { - id: PortId(1189), - state: PortState::Uninferred, - produced_by: Some(NodeId(1013)), - }, - ); - ports.insert( - PortId(1190), - Port { - id: PortId(1190), - state: PortState::Uninferred, - produced_by: Some(NodeId(1014)), - }, - ); - ports.insert( - PortId(1191), - Port { - id: PortId(1191), - state: PortState::Uninferred, - produced_by: Some(NodeId(1015)), - }, - ); - ports.insert( - PortId(1192), - Port { - id: PortId(1192), - state: PortState::Uninferred, - produced_by: Some(NodeId(1016)), - }, - ); - ports.insert( - PortId(1193), - Port { - id: PortId(1193), - state: PortState::Uninferred, - produced_by: Some(NodeId(1017)), - }, - ); - ports.insert( - PortId(1194), - Port { - id: PortId(1194), - state: PortState::Uninferred, - produced_by: Some(NodeId(1018)), - }, - ); - ports.insert( - PortId(1195), - Port { - id: PortId(1195), - state: PortState::Uninferred, - produced_by: Some(NodeId(1019)), - }, - ); - ports.insert( - PortId(1196), - Port { - id: PortId(1196), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1197), - Port { - id: PortId(1197), - state: PortState::Uninferred, - produced_by: Some(NodeId(1020)), - }, - ); - ports.insert( - PortId(1198), - Port { - id: PortId(1198), - state: PortState::Uninferred, - produced_by: Some(NodeId(1021)), - }, - ); - ports.insert( - PortId(1199), - Port { - id: PortId(1199), - state: PortState::Uninferred, - produced_by: Some(NodeId(1022)), - }, - ); - ports.insert( - PortId(1200), - Port { - id: PortId(1200), - state: PortState::Resolved(TypeShape::new(DeclarationId(227))), - produced_by: Some(NodeId(1023)), - }, - ); - ports.insert( - PortId(1201), - Port { - id: PortId(1201), - state: PortState::Resolved(TypeShape::new(DeclarationId(147))), - produced_by: None, - }, - ); - ports.insert( - PortId(1202), - Port { - id: PortId(1202), - state: PortState::Uninferred, - produced_by: Some(NodeId(1025)), - }, - ); - ports.insert( - PortId(1203), - Port { - id: PortId(1203), - state: PortState::Uninferred, - produced_by: Some(NodeId(1026)), - }, - ); - ports.insert( - PortId(1204), - Port { - id: PortId(1204), - state: PortState::Uninferred, - produced_by: Some(NodeId(1027)), - }, - ); - ports.insert( - PortId(1205), - Port { - id: PortId(1205), - state: PortState::Uninferred, - produced_by: Some(NodeId(1028)), - }, - ); - ports.insert( - PortId(1206), - Port { - id: PortId(1206), - state: PortState::Uninferred, - produced_by: Some(NodeId(1029)), - }, - ); - ports - } -} - -fn bootstrapped_fixture_dag_diagnostics() -> DiagnosticTable { - DiagnosticTable::new() -} - -fn bootstrapped_fixture_dag_clusters() -> Vec { - vec![] -} - -fn bootstrapped_fixture_dag_optional_match_disjs() -> HashMap { - { - let mut map = HashMap::new(); - map.insert(DeclarationId(386), DeclarationId(3001)); - map.insert(DeclarationId(388), DeclarationId(3004)); - map.insert(DeclarationId(424), DeclarationId(3007)); - map.insert(DeclarationId(470), DeclarationId(3010)); - map.insert(DeclarationId(471), DeclarationId(3013)); - map.insert(DeclarationId(472), DeclarationId(3016)); - map.insert(DeclarationId(524), DeclarationId(3019)); - map.insert(DeclarationId(526), DeclarationId(3022)); - map.insert(DeclarationId(527), DeclarationId(3025)); - map.insert(DeclarationId(528), DeclarationId(3028)); - map.insert(DeclarationId(552), DeclarationId(3031)); - map.insert(DeclarationId(595), DeclarationId(3034)); - map.insert(DeclarationId(615), DeclarationId(3037)); - map.insert(DeclarationId(616), DeclarationId(3040)); - map.insert(DeclarationId(618), DeclarationId(3043)); - map.insert(DeclarationId(621), DeclarationId(3046)); - map.insert(DeclarationId(626), DeclarationId(3049)); - map.insert(DeclarationId(627), DeclarationId(3052)); - map.insert(DeclarationId(631), DeclarationId(3055)); - map.insert(DeclarationId(632), DeclarationId(3058)); - map.insert(DeclarationId(633), DeclarationId(3061)); - map.insert(DeclarationId(638), DeclarationId(3064)); - map.insert(DeclarationId(1875), DeclarationId(3067)); - map.insert(DeclarationId(1876), DeclarationId(3070)); - map.insert(DeclarationId(1880), DeclarationId(3073)); - map.insert(DeclarationId(1883), DeclarationId(3076)); - map.insert(DeclarationId(1932), DeclarationId(3079)); - map.insert(DeclarationId(1933), DeclarationId(3082)); - map.insert(DeclarationId(1934), DeclarationId(3085)); - map.insert(DeclarationId(1935), DeclarationId(3088)); - map.insert(DeclarationId(1936), DeclarationId(3091)); - map.insert(DeclarationId(1937), DeclarationId(3094)); - map.insert(DeclarationId(1943), DeclarationId(3097)); - map.insert(DeclarationId(1999), DeclarationId(3100)); - map.insert(DeclarationId(2002), DeclarationId(3103)); - map.insert(DeclarationId(2003), DeclarationId(3106)); - map.insert(DeclarationId(2004), DeclarationId(3109)); - map.insert(DeclarationId(2005), DeclarationId(3112)); - map.insert(DeclarationId(2028), DeclarationId(3115)); - map.insert(DeclarationId(2033), DeclarationId(3118)); - map.insert(DeclarationId(2037), DeclarationId(3121)); - map.insert(DeclarationId(2040), DeclarationId(3124)); - map.insert(DeclarationId(2041), DeclarationId(3127)); - map.insert(DeclarationId(2070), DeclarationId(3130)); - map.insert(DeclarationId(2071), DeclarationId(3133)); - map.insert(DeclarationId(2075), DeclarationId(3136)); - map.insert(DeclarationId(2076), DeclarationId(3139)); - map.insert(DeclarationId(2087), DeclarationId(3142)); - map.insert(DeclarationId(2088), DeclarationId(3145)); - map.insert(DeclarationId(2090), DeclarationId(3148)); - map.insert(DeclarationId(2091), DeclarationId(3151)); - map.insert(DeclarationId(2093), DeclarationId(3154)); - map.insert(DeclarationId(2094), DeclarationId(3157)); - map.insert(DeclarationId(2096), DeclarationId(3160)); - map.insert(DeclarationId(2098), DeclarationId(3163)); - map.insert(DeclarationId(2101), DeclarationId(3166)); - map.insert(DeclarationId(2105), DeclarationId(3169)); - map.insert(DeclarationId(2107), DeclarationId(3172)); - map.insert(DeclarationId(2109), DeclarationId(3175)); - map.insert(DeclarationId(2122), DeclarationId(3178)); - map.insert(DeclarationId(2123), DeclarationId(3181)); - map.insert(DeclarationId(2124), DeclarationId(3184)); - map.insert(DeclarationId(2127), DeclarationId(3187)); - map.insert(DeclarationId(2128), DeclarationId(3190)); - map.insert(DeclarationId(2130), DeclarationId(3193)); - map.insert(DeclarationId(2131), DeclarationId(3196)); - map.insert(DeclarationId(2165), DeclarationId(3199)); - map.insert(DeclarationId(2201), DeclarationId(3202)); - map.insert(DeclarationId(2202), DeclarationId(3205)); - map.insert(DeclarationId(2203), DeclarationId(3208)); - map.insert(DeclarationId(2204), DeclarationId(3211)); - map.insert(DeclarationId(2255), DeclarationId(3214)); - map.insert(DeclarationId(2256), DeclarationId(3217)); - map.insert(DeclarationId(2257), DeclarationId(3220)); - map.insert(DeclarationId(2258), DeclarationId(3223)); - map.insert(DeclarationId(2259), DeclarationId(3226)); - map.insert(DeclarationId(2260), DeclarationId(3229)); - map.insert(DeclarationId(2283), DeclarationId(3232)); - map.insert(DeclarationId(2437), DeclarationId(3235)); - map.insert(DeclarationId(2484), DeclarationId(3238)); - map.insert(DeclarationId(2492), DeclarationId(3241)); - map.insert(DeclarationId(2506), DeclarationId(3244)); - map.insert(DeclarationId(2509), DeclarationId(3247)); - map.insert(DeclarationId(2525), DeclarationId(3250)); - map.insert(DeclarationId(2526), DeclarationId(3253)); - map.insert(DeclarationId(2527), DeclarationId(3256)); - map.insert(DeclarationId(2530), DeclarationId(3259)); - map.insert(DeclarationId(2531), DeclarationId(3262)); - map.insert(DeclarationId(2560), DeclarationId(3265)); - map.insert(DeclarationId(2561), DeclarationId(3268)); - map.insert(DeclarationId(2567), DeclarationId(3271)); - map.insert(DeclarationId(2568), DeclarationId(3274)); - map.insert(DeclarationId(2569), DeclarationId(3277)); - map.insert(DeclarationId(2570), DeclarationId(3280)); - map.insert(DeclarationId(2571), DeclarationId(3283)); - map.insert(DeclarationId(2572), DeclarationId(3286)); - map.insert(DeclarationId(2833), DeclarationId(3289)); - map.insert(DeclarationId(2862), DeclarationId(3292)); - map.insert(DeclarationId(2868), DeclarationId(3295)); - map.insert(DeclarationId(2873), DeclarationId(3298)); - map.insert(DeclarationId(2876), DeclarationId(3301)); - map.insert(DeclarationId(2877), DeclarationId(3304)); - map.insert(DeclarationId(2897), DeclarationId(3307)); - map.insert(DeclarationId(2898), DeclarationId(3310)); - map.insert(DeclarationId(2906), DeclarationId(3313)); - map.insert(DeclarationId(2910), DeclarationId(3316)); - map.insert(DeclarationId(2912), DeclarationId(3319)); - map.insert(DeclarationId(2913), DeclarationId(3322)); - map.insert(DeclarationId(2914), DeclarationId(3325)); - map.insert(DeclarationId(2915), DeclarationId(3328)); - map.insert(DeclarationId(2916), DeclarationId(3331)); - map.insert(DeclarationId(2922), DeclarationId(3334)); - map.insert(DeclarationId(2924), DeclarationId(3337)); - map.insert(DeclarationId(2925), DeclarationId(3340)); - map.insert(DeclarationId(2937), DeclarationId(3343)); - map.insert(DeclarationId(2938), DeclarationId(3346)); - map.insert(DeclarationId(2940), DeclarationId(3349)); - map.insert(DeclarationId(2941), DeclarationId(3352)); - map.insert(DeclarationId(2942), DeclarationId(3355)); - map.insert(DeclarationId(2943), DeclarationId(3358)); - map.insert(DeclarationId(2945), DeclarationId(3361)); - map.insert(DeclarationId(2946), DeclarationId(3364)); - map.insert(DeclarationId(2948), DeclarationId(3367)); - map.insert(DeclarationId(2950), DeclarationId(3370)); - map.insert(DeclarationId(2951), DeclarationId(3373)); - map.insert(DeclarationId(2952), DeclarationId(3376)); - map.insert(DeclarationId(2959), DeclarationId(3379)); - map.insert(DeclarationId(2960), DeclarationId(3382)); - map.insert(DeclarationId(2961), DeclarationId(3385)); - map.insert(DeclarationId(2963), DeclarationId(3388)); - map.insert(DeclarationId(2964), DeclarationId(3391)); - map.insert(DeclarationId(2965), DeclarationId(3394)); - map.insert(DeclarationId(2967), DeclarationId(3397)); - map.insert(DeclarationId(2968), DeclarationId(3400)); - map.insert(DeclarationId(2969), DeclarationId(3403)); - map.insert(DeclarationId(2976), DeclarationId(3406)); - map.insert(DeclarationId(2978), DeclarationId(3409)); - map.insert(DeclarationId(2989), DeclarationId(3412)); - map - } -} diff --git a/src/v3/compiler/src/bootstrap_generated_without_parse_surface.rs b/src/v3/compiler/src/bootstrap_generated_without_parse_surface.rs deleted file mode 100644 index 59c7a2cecfe..00000000000 --- a/src/v3/compiler/src/bootstrap_generated_without_parse_surface.rs +++ /dev/null @@ -1,85951 +0,0 @@ -// AUTO-GENERATED from `dsl/std/*.dag + src/v3/std/*.dag + src/v3/spec/*.dag + src/v3/compiler/*.dag minus tokenize.dag, src/v3/std/parse_surface.dag, src/v3/spec/{rust,go,python}.dag + dsl/extdeps/languages/rust/primitives.dag` via `regen_bootstrap`. -// Regenerate instead of hand-editing. - -pub(crate) fn bootstrapped_fixture_without_parse_surface_dag() -> Dag { - Dag { - nodes: bootstrapped_fixture_without_parse_surface_dag_nodes(), - declarations: bootstrapped_fixture_without_parse_surface_dag_declarations(), - ports: bootstrapped_fixture_without_parse_surface_dag_ports(), - diagnostics: bootstrapped_fixture_without_parse_surface_dag_diagnostics(), - next_node_id: 1031, - next_declaration_id: 2927, - next_port_id: 1207, - primitives: PrimitiveCache::default(), - substrate_markers: SubstrateMarkers::default(), - realization_metas: RealizationMetaCache::default(), - target_syntax: TargetSyntaxCache::default(), - stdlib_types: StdlibTypeCache::default(), - emit_anchors: EmitAnchorCache::default(), - pattern_binding_rule_variants: PatternBindingRuleVariants::default(), - variant_payload_field_access_rule_variants: VariantPayloadFieldAccessRuleVariants::default( - ), - verifier_output_policy_variants: VerifierOutputPolicyVariants::default(), - callable_strategy_variants: CallableStrategyVariants::default(), - emit_model_variants: EmitModelVariants::default(), - clusters: bootstrapped_fixture_without_parse_surface_dag_clusters(), - optional_match_disjs: bootstrapped_fixture_without_parse_surface_dag_optional_match_disjs(), - declaration_append_begin_after_bootstrap: 2927, - } -} - -#[allow(clippy::vec_init_then_push)] -fn bootstrapped_fixture_without_parse_surface_dag_nodes() -> Vec { - { - let mut nodes = Vec::with_capacity(1031); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(0), - data: LiteralBits::Int("0".to_string()), - output: PortId(1), - span: SourceSpan::new("dsl/std/integer.dag", 9242, 9249), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(1), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Gt)), - inputs: vec![PortId(0), PortId(1)], - output: PortId(2), - span: SourceSpan::new("dsl/std/integer.dag", 9242, 9249), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(2), - name: "".to_string(), - value: PortId(2), - params: vec![PortId(0)], - span: SourceSpan::new("dsl/std/integer.dag", 9242, 9249), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(3), - data: LiteralBits::Int("0".to_string()), - output: PortId(4), - span: SourceSpan::new("dsl/std/types.dag", 9194, 9208), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(4), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Ge)), - inputs: vec![PortId(3), PortId(4)], - output: PortId(5), - span: SourceSpan::new("dsl/std/types.dag", 9194, 9208), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(5), - data: LiteralBits::Int("55295".to_string()), - output: PortId(6), - span: SourceSpan::new("dsl/std/types.dag", 9194, 9208), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(6), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Le)), - inputs: vec![PortId(3), PortId(6)], - output: PortId(7), - span: SourceSpan::new("dsl/std/types.dag", 9194, 9208), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(7), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(5), PortId(7)], - output: PortId(8), - span: SourceSpan::new("dsl/std/types.dag", 9194, 9208), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(8), - data: LiteralBits::Int("57344".to_string()), - output: PortId(9), - span: SourceSpan::new("dsl/std/types.dag", 9194, 9208), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(9), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Ge)), - inputs: vec![PortId(3), PortId(9)], - output: PortId(10), - span: SourceSpan::new("dsl/std/types.dag", 9194, 9208), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(10), - data: LiteralBits::Int("1114111".to_string()), - output: PortId(11), - span: SourceSpan::new("dsl/std/types.dag", 9194, 9208), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(11), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Le)), - inputs: vec![PortId(3), PortId(11)], - output: PortId(12), - span: SourceSpan::new("dsl/std/types.dag", 9194, 9208), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(12), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(10), PortId(12)], - output: PortId(13), - span: SourceSpan::new("dsl/std/types.dag", 9194, 9208), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(13), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::Or)), - inputs: vec![PortId(8), PortId(13)], - output: PortId(14), - span: SourceSpan::new("dsl/std/types.dag", 9194, 9208), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(14), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(3), PortId(3)], - output: PortId(15), - span: SourceSpan::new("dsl/std/types.dag", 9210, 9223), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(15), - data: LiteralBits::String("Char".to_string()), - output: PortId(16), - span: SourceSpan::new("dsl/std/types.dag", 9210, 9223), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(16), - data: LiteralBits::String("Char".to_string()), - output: PortId(17), - span: SourceSpan::new("dsl/std/types.dag", 9210, 9223), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(17), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(16), PortId(17)], - output: PortId(18), - span: SourceSpan::new("dsl/std/types.dag", 9210, 9223), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(18), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(15), PortId(18)], - output: PortId(19), - span: SourceSpan::new("dsl/std/types.dag", 9210, 9223), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(19), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(14), PortId(19)], - output: PortId(20), - span: SourceSpan::new("dsl/std/types.dag", 9194, 9223), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(20), - name: "".to_string(), - value: PortId(20), - params: vec![PortId(3)], - span: SourceSpan::new("dsl/std/types.dag", 9194, 9223), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(21), - data: LiteralBits::Int("1".to_string()), - output: PortId(22), - span: SourceSpan::new("dsl/std/types.dag", 11619, 11640), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(22), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Ge)), - inputs: vec![PortId(21), PortId(22)], - output: PortId(23), - span: SourceSpan::new("dsl/std/types.dag", 11619, 11640), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(23), - data: LiteralBits::Int("5".to_string()), - output: PortId(24), - span: SourceSpan::new("dsl/std/types.dag", 11619, 11640), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(24), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Le)), - inputs: vec![PortId(21), PortId(24)], - output: PortId(25), - span: SourceSpan::new("dsl/std/types.dag", 11619, 11640), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(25), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(23), PortId(25)], - output: PortId(26), - span: SourceSpan::new("dsl/std/types.dag", 11619, 11640), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(26), - name: "".to_string(), - value: PortId(26), - params: vec![PortId(21)], - span: SourceSpan::new("dsl/std/types.dag", 11619, 11640), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(27), - data: LiteralBits::Int("100".to_string()), - output: PortId(28), - span: SourceSpan::new("dsl/std/types.dag", 11671, 11696), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(28), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Ge)), - inputs: vec![PortId(27), PortId(28)], - output: PortId(29), - span: SourceSpan::new("dsl/std/types.dag", 11671, 11696), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(29), - data: LiteralBits::Int("599".to_string()), - output: PortId(30), - span: SourceSpan::new("dsl/std/types.dag", 11671, 11696), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(30), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Le)), - inputs: vec![PortId(27), PortId(30)], - output: PortId(31), - span: SourceSpan::new("dsl/std/types.dag", 11671, 11696), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(31), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(29), PortId(31)], - output: PortId(32), - span: SourceSpan::new("dsl/std/types.dag", 11671, 11696), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(32), - name: "".to_string(), - value: PortId(32), - params: vec![PortId(27)], - span: SourceSpan::new("dsl/std/types.dag", 11671, 11696), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(33), - data: LiteralBits::Int("1".to_string()), - output: PortId(34), - span: SourceSpan::new("dsl/std/types.dag", 11827, 11852), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(34), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Ge)), - inputs: vec![PortId(33), PortId(34)], - output: PortId(35), - span: SourceSpan::new("dsl/std/types.dag", 11827, 11852), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(35), - data: LiteralBits::Int("65535".to_string()), - output: PortId(36), - span: SourceSpan::new("dsl/std/types.dag", 11827, 11852), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(36), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Le)), - inputs: vec![PortId(33), PortId(36)], - output: PortId(37), - span: SourceSpan::new("dsl/std/types.dag", 11827, 11852), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(37), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(35), PortId(37)], - output: PortId(38), - span: SourceSpan::new("dsl/std/types.dag", 11827, 11852), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(38), - name: "".to_string(), - value: PortId(38), - params: vec![PortId(33)], - span: SourceSpan::new("dsl/std/types.dag", 11827, 11852), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(39), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(39), PortId(39)], - output: PortId(40), - span: SourceSpan::new("dsl/std/types.dag", 13050, 13070), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(40), - data: LiteralBits::String("PathSegment".to_string()), - output: PortId(41), - span: SourceSpan::new("dsl/std/types.dag", 13050, 13070), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(41), - data: LiteralBits::String("PathSegment".to_string()), - output: PortId(42), - span: SourceSpan::new("dsl/std/types.dag", 13050, 13070), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(42), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(41), PortId(42)], - output: PortId(43), - span: SourceSpan::new("dsl/std/types.dag", 13050, 13070), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(43), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(40), PortId(43)], - output: PortId(44), - span: SourceSpan::new("dsl/std/types.dag", 13050, 13070), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(44), - name: "".to_string(), - value: PortId(44), - params: vec![PortId(39)], - span: SourceSpan::new("dsl/std/types.dag", 13050, 13070), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(45), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(45), PortId(45)], - output: PortId(46), - span: SourceSpan::new("dsl/std/types.dag", 13110, 13130), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(46), - data: LiteralBits::String("GlobSegment".to_string()), - output: PortId(47), - span: SourceSpan::new("dsl/std/types.dag", 13110, 13130), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(47), - data: LiteralBits::String("GlobSegment".to_string()), - output: PortId(48), - span: SourceSpan::new("dsl/std/types.dag", 13110, 13130), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(48), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(47), PortId(48)], - output: PortId(49), - span: SourceSpan::new("dsl/std/types.dag", 13110, 13130), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(49), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(46), PortId(49)], - output: PortId(50), - span: SourceSpan::new("dsl/std/types.dag", 13110, 13130), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(50), - name: "".to_string(), - value: PortId(50), - params: vec![PortId(45)], - span: SourceSpan::new("dsl/std/types.dag", 13110, 13130), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(51), - data: LiteralBits::Int("0".to_string()), - output: PortId(52), - span: SourceSpan::new("dsl/std/types.dag", 14114, 14127), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(52), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Ge)), - inputs: vec![PortId(51), PortId(52)], - output: PortId(53), - span: SourceSpan::new("dsl/std/types.dag", 14114, 14127), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(53), - name: "".to_string(), - value: PortId(53), - params: vec![PortId(51)], - span: SourceSpan::new("dsl/std/types.dag", 14114, 14127), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(54), - data: LiteralBits::Int("0".to_string()), - output: PortId(55), - span: SourceSpan::new("dsl/std/types.dag", 14159, 14172), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(55), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Ge)), - inputs: vec![PortId(54), PortId(55)], - output: PortId(56), - span: SourceSpan::new("dsl/std/types.dag", 14159, 14172), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(56), - name: "".to_string(), - value: PortId(56), - params: vec![PortId(54)], - span: SourceSpan::new("dsl/std/types.dag", 14159, 14172), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(57), - data: LiteralBits::Int("0".to_string()), - output: PortId(58), - span: SourceSpan::new("dsl/std/types.dag", 14204, 14217), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(58), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Ge)), - inputs: vec![PortId(57), PortId(58)], - output: PortId(59), - span: SourceSpan::new("dsl/std/types.dag", 14204, 14217), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(59), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(57), PortId(57)], - output: PortId(60), - span: SourceSpan::new("dsl/std/types.dag", 14219, 14240), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(60), - data: LiteralBits::String("Milliseconds".to_string()), - output: PortId(61), - span: SourceSpan::new("dsl/std/types.dag", 14219, 14240), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(61), - data: LiteralBits::String("Milliseconds".to_string()), - output: PortId(62), - span: SourceSpan::new("dsl/std/types.dag", 14219, 14240), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(62), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(61), PortId(62)], - output: PortId(63), - span: SourceSpan::new("dsl/std/types.dag", 14219, 14240), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(63), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(60), PortId(63)], - output: PortId(64), - span: SourceSpan::new("dsl/std/types.dag", 14219, 14240), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(64), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(59), PortId(64)], - output: PortId(65), - span: SourceSpan::new("dsl/std/types.dag", 14204, 14240), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(65), - name: "".to_string(), - value: PortId(65), - params: vec![PortId(57)], - span: SourceSpan::new("dsl/std/types.dag", 14204, 14240), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(66), - data: LiteralBits::Int("0".to_string()), - output: PortId(67), - span: SourceSpan::new("dsl/std/types.dag", 14272, 14285), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(67), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Ge)), - inputs: vec![PortId(66), PortId(67)], - output: PortId(68), - span: SourceSpan::new("dsl/std/types.dag", 14272, 14285), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(68), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(66), PortId(66)], - output: PortId(69), - span: SourceSpan::new("dsl/std/types.dag", 14287, 14303), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(69), - data: LiteralBits::String("Seconds".to_string()), - output: PortId(70), - span: SourceSpan::new("dsl/std/types.dag", 14287, 14303), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(70), - data: LiteralBits::String("Seconds".to_string()), - output: PortId(71), - span: SourceSpan::new("dsl/std/types.dag", 14287, 14303), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(71), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(70), PortId(71)], - output: PortId(72), - span: SourceSpan::new("dsl/std/types.dag", 14287, 14303), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(72), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(69), PortId(72)], - output: PortId(73), - span: SourceSpan::new("dsl/std/types.dag", 14287, 14303), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(73), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(68), PortId(73)], - output: PortId(74), - span: SourceSpan::new("dsl/std/types.dag", 14272, 14303), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(74), - name: "".to_string(), - value: PortId(74), - params: vec![PortId(66)], - span: SourceSpan::new("dsl/std/types.dag", 14272, 14303), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(75), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(75), PortId(75)], - output: PortId(76), - span: SourceSpan::new("dsl/std/types.dag", 14509, 14529), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(76), - data: LiteralBits::String("LogicalTime".to_string()), - output: PortId(77), - span: SourceSpan::new("dsl/std/types.dag", 14509, 14529), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(77), - data: LiteralBits::String("LogicalTime".to_string()), - output: PortId(78), - span: SourceSpan::new("dsl/std/types.dag", 14509, 14529), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(78), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(77), PortId(78)], - output: PortId(79), - span: SourceSpan::new("dsl/std/types.dag", 14509, 14529), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(79), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(76), PortId(79)], - output: PortId(80), - span: SourceSpan::new("dsl/std/types.dag", 14509, 14529), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(80), - name: "".to_string(), - value: PortId(80), - params: vec![PortId(75)], - span: SourceSpan::new("dsl/std/types.dag", 14509, 14529), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(81), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(81), PortId(81)], - output: PortId(82), - span: SourceSpan::new("dsl/std/types.dag", 15091, 15108), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(82), - data: LiteralBits::String("IntentId".to_string()), - output: PortId(83), - span: SourceSpan::new("dsl/std/types.dag", 15091, 15108), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(83), - data: LiteralBits::String("IntentId".to_string()), - output: PortId(84), - span: SourceSpan::new("dsl/std/types.dag", 15091, 15108), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(84), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(83), PortId(84)], - output: PortId(85), - span: SourceSpan::new("dsl/std/types.dag", 15091, 15108), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(85), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(82), PortId(85)], - output: PortId(86), - span: SourceSpan::new("dsl/std/types.dag", 15091, 15108), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(86), - name: "".to_string(), - value: PortId(86), - params: vec![PortId(81)], - span: SourceSpan::new("dsl/std/types.dag", 15091, 15108), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(87), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(87), PortId(87)], - output: PortId(88), - span: SourceSpan::new("dsl/std/types.dag", 15147, 15163), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(88), - data: LiteralBits::String("IssueId".to_string()), - output: PortId(89), - span: SourceSpan::new("dsl/std/types.dag", 15147, 15163), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(89), - data: LiteralBits::String("IssueId".to_string()), - output: PortId(90), - span: SourceSpan::new("dsl/std/types.dag", 15147, 15163), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(90), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(89), PortId(90)], - output: PortId(91), - span: SourceSpan::new("dsl/std/types.dag", 15147, 15163), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(91), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(88), PortId(91)], - output: PortId(92), - span: SourceSpan::new("dsl/std/types.dag", 15147, 15163), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(92), - name: "".to_string(), - value: PortId(92), - params: vec![PortId(87)], - span: SourceSpan::new("dsl/std/types.dag", 15147, 15163), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(93), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(93), PortId(93)], - output: PortId(94), - span: SourceSpan::new("dsl/std/types.dag", 15202, 15217), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(94), - data: LiteralBits::String("RunKey".to_string()), - output: PortId(95), - span: SourceSpan::new("dsl/std/types.dag", 15202, 15217), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(95), - data: LiteralBits::String("RunKey".to_string()), - output: PortId(96), - span: SourceSpan::new("dsl/std/types.dag", 15202, 15217), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(96), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(95), PortId(96)], - output: PortId(97), - span: SourceSpan::new("dsl/std/types.dag", 15202, 15217), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(97), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(94), PortId(97)], - output: PortId(98), - span: SourceSpan::new("dsl/std/types.dag", 15202, 15217), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(98), - name: "".to_string(), - value: PortId(98), - params: vec![PortId(93)], - span: SourceSpan::new("dsl/std/types.dag", 15202, 15217), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(99), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(99), PortId(99)], - output: PortId(100), - span: SourceSpan::new("dsl/std/types.dag", 15256, 15275), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(100), - data: LiteralBits::String("ArtifactId".to_string()), - output: PortId(101), - span: SourceSpan::new("dsl/std/types.dag", 15256, 15275), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(101), - data: LiteralBits::String("ArtifactId".to_string()), - output: PortId(102), - span: SourceSpan::new("dsl/std/types.dag", 15256, 15275), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(102), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(101), PortId(102)], - output: PortId(103), - span: SourceSpan::new("dsl/std/types.dag", 15256, 15275), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(103), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(100), PortId(103)], - output: PortId(104), - span: SourceSpan::new("dsl/std/types.dag", 15256, 15275), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(104), - name: "".to_string(), - value: PortId(104), - params: vec![PortId(99)], - span: SourceSpan::new("dsl/std/types.dag", 15256, 15275), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(105), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(105), PortId(105)], - output: PortId(106), - span: SourceSpan::new("dsl/std/types.dag", 15314, 15333), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(106), - data: LiteralBits::String("LeaseToken".to_string()), - output: PortId(107), - span: SourceSpan::new("dsl/std/types.dag", 15314, 15333), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(107), - data: LiteralBits::String("LeaseToken".to_string()), - output: PortId(108), - span: SourceSpan::new("dsl/std/types.dag", 15314, 15333), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(108), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(107), PortId(108)], - output: PortId(109), - span: SourceSpan::new("dsl/std/types.dag", 15314, 15333), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(109), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(106), PortId(109)], - output: PortId(110), - span: SourceSpan::new("dsl/std/types.dag", 15314, 15333), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(110), - name: "".to_string(), - value: PortId(110), - params: vec![PortId(105)], - span: SourceSpan::new("dsl/std/types.dag", 15314, 15333), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(111), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(111), PortId(111)], - output: PortId(112), - span: SourceSpan::new("dsl/std/types.dag", 15372, 15389), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(112), - data: LiteralBits::String("WorkerId".to_string()), - output: PortId(113), - span: SourceSpan::new("dsl/std/types.dag", 15372, 15389), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(113), - data: LiteralBits::String("WorkerId".to_string()), - output: PortId(114), - span: SourceSpan::new("dsl/std/types.dag", 15372, 15389), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(114), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(113), PortId(114)], - output: PortId(115), - span: SourceSpan::new("dsl/std/types.dag", 15372, 15389), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(115), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(112), PortId(115)], - output: PortId(116), - span: SourceSpan::new("dsl/std/types.dag", 15372, 15389), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(116), - name: "".to_string(), - value: PortId(116), - params: vec![PortId(111)], - span: SourceSpan::new("dsl/std/types.dag", 15372, 15389), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(117), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(117), PortId(117)], - output: PortId(118), - span: SourceSpan::new("dsl/std/types.dag", 15428, 15446), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(118), - data: LiteralBits::String("CommentId".to_string()), - output: PortId(119), - span: SourceSpan::new("dsl/std/types.dag", 15428, 15446), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(119), - data: LiteralBits::String("CommentId".to_string()), - output: PortId(120), - span: SourceSpan::new("dsl/std/types.dag", 15428, 15446), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(120), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(119), PortId(120)], - output: PortId(121), - span: SourceSpan::new("dsl/std/types.dag", 15428, 15446), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(121), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(118), PortId(121)], - output: PortId(122), - span: SourceSpan::new("dsl/std/types.dag", 15428, 15446), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(122), - name: "".to_string(), - value: PortId(122), - params: vec![PortId(117)], - span: SourceSpan::new("dsl/std/types.dag", 15428, 15446), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(123), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(123), PortId(123)], - output: PortId(124), - span: SourceSpan::new("dsl/std/types.dag", 15485, 15503), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(124), - data: LiteralBits::String("SignalKey".to_string()), - output: PortId(125), - span: SourceSpan::new("dsl/std/types.dag", 15485, 15503), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(125), - data: LiteralBits::String("SignalKey".to_string()), - output: PortId(126), - span: SourceSpan::new("dsl/std/types.dag", 15485, 15503), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(126), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(125), PortId(126)], - output: PortId(127), - span: SourceSpan::new("dsl/std/types.dag", 15485, 15503), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(127), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(124), PortId(127)], - output: PortId(128), - span: SourceSpan::new("dsl/std/types.dag", 15485, 15503), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(128), - name: "".to_string(), - value: PortId(128), - params: vec![PortId(123)], - span: SourceSpan::new("dsl/std/types.dag", 15485, 15503), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(129), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(129), PortId(129)], - output: PortId(130), - span: SourceSpan::new("dsl/std/types.dag", 15542, 15562), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(130), - data: LiteralBits::String("ContentHash".to_string()), - output: PortId(131), - span: SourceSpan::new("dsl/std/types.dag", 15542, 15562), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(131), - data: LiteralBits::String("ContentHash".to_string()), - output: PortId(132), - span: SourceSpan::new("dsl/std/types.dag", 15542, 15562), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(132), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(131), PortId(132)], - output: PortId(133), - span: SourceSpan::new("dsl/std/types.dag", 15542, 15562), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(133), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(130), PortId(133)], - output: PortId(134), - span: SourceSpan::new("dsl/std/types.dag", 15542, 15562), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(134), - name: "".to_string(), - value: PortId(134), - params: vec![PortId(129)], - span: SourceSpan::new("dsl/std/types.dag", 15542, 15562), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(135), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(135), PortId(135)], - output: PortId(136), - span: SourceSpan::new("dsl/std/types.dag", 15837, 15864), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(136), - data: LiteralBits::String("WorkflowProducerId".to_string()), - output: PortId(137), - span: SourceSpan::new("dsl/std/types.dag", 15837, 15864), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(137), - data: LiteralBits::String("WorkflowProducerId".to_string()), - output: PortId(138), - span: SourceSpan::new("dsl/std/types.dag", 15837, 15864), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(138), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(137), PortId(138)], - output: PortId(139), - span: SourceSpan::new("dsl/std/types.dag", 15837, 15864), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(139), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(136), PortId(139)], - output: PortId(140), - span: SourceSpan::new("dsl/std/types.dag", 15837, 15864), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(140), - name: "".to_string(), - value: PortId(140), - params: vec![PortId(135)], - span: SourceSpan::new("dsl/std/types.dag", 15837, 15864), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(141), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(141), PortId(141)], - output: PortId(142), - span: SourceSpan::new("dsl/std/types.dag", 15909, 15936), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(142), - data: LiteralBits::String("WorkflowObserverId".to_string()), - output: PortId(143), - span: SourceSpan::new("dsl/std/types.dag", 15909, 15936), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(143), - data: LiteralBits::String("WorkflowObserverId".to_string()), - output: PortId(144), - span: SourceSpan::new("dsl/std/types.dag", 15909, 15936), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(144), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(143), PortId(144)], - output: PortId(145), - span: SourceSpan::new("dsl/std/types.dag", 15909, 15936), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(145), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(142), PortId(145)], - output: PortId(146), - span: SourceSpan::new("dsl/std/types.dag", 15909, 15936), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(146), - name: "".to_string(), - value: PortId(146), - params: vec![PortId(141)], - span: SourceSpan::new("dsl/std/types.dag", 15909, 15936), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(147), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(147), PortId(147)], - output: PortId(148), - span: SourceSpan::new("dsl/std/types.dag", 15979, 16004), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(148), - data: LiteralBits::String("WorkflowProverId".to_string()), - output: PortId(149), - span: SourceSpan::new("dsl/std/types.dag", 15979, 16004), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(149), - data: LiteralBits::String("WorkflowProverId".to_string()), - output: PortId(150), - span: SourceSpan::new("dsl/std/types.dag", 15979, 16004), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(150), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(149), PortId(150)], - output: PortId(151), - span: SourceSpan::new("dsl/std/types.dag", 15979, 16004), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(151), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(148), PortId(151)], - output: PortId(152), - span: SourceSpan::new("dsl/std/types.dag", 15979, 16004), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(152), - name: "".to_string(), - value: PortId(152), - params: vec![PortId(147)], - span: SourceSpan::new("dsl/std/types.dag", 15979, 16004), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(153), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(153), PortId(153)], - output: PortId(154), - span: SourceSpan::new("dsl/std/types.dag", 16044, 16066), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(154), - data: LiteralBits::String("WorkflowRunId".to_string()), - output: PortId(155), - span: SourceSpan::new("dsl/std/types.dag", 16044, 16066), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(155), - data: LiteralBits::String("WorkflowRunId".to_string()), - output: PortId(156), - span: SourceSpan::new("dsl/std/types.dag", 16044, 16066), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(156), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(155), PortId(156)], - output: PortId(157), - span: SourceSpan::new("dsl/std/types.dag", 16044, 16066), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(157), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(154), PortId(157)], - output: PortId(158), - span: SourceSpan::new("dsl/std/types.dag", 16044, 16066), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(158), - name: "".to_string(), - value: PortId(158), - params: vec![PortId(153)], - span: SourceSpan::new("dsl/std/types.dag", 16044, 16066), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(159), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(159), PortId(159)], - output: PortId(160), - span: SourceSpan::new("dsl/std/types.dag", 22653, 22678), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(160), - data: LiteralBits::String("FilesystemHandle".to_string()), - output: PortId(161), - span: SourceSpan::new("dsl/std/types.dag", 22653, 22678), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(161), - data: LiteralBits::String("FilesystemHandle".to_string()), - output: PortId(162), - span: SourceSpan::new("dsl/std/types.dag", 22653, 22678), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(162), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(161), PortId(162)], - output: PortId(163), - span: SourceSpan::new("dsl/std/types.dag", 22653, 22678), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(163), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(160), PortId(163)], - output: PortId(164), - span: SourceSpan::new("dsl/std/types.dag", 22653, 22678), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(164), - name: "".to_string(), - value: PortId(164), - params: vec![PortId(159)], - span: SourceSpan::new("dsl/std/types.dag", 22653, 22678), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(165), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(165), PortId(165)], - output: PortId(166), - span: SourceSpan::new("dsl/std/types.dag", 22714, 22736), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(166), - data: LiteralBits::String("NetworkHandle".to_string()), - output: PortId(167), - span: SourceSpan::new("dsl/std/types.dag", 22714, 22736), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(167), - data: LiteralBits::String("NetworkHandle".to_string()), - output: PortId(168), - span: SourceSpan::new("dsl/std/types.dag", 22714, 22736), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(168), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(167), PortId(168)], - output: PortId(169), - span: SourceSpan::new("dsl/std/types.dag", 22714, 22736), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(169), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(166), PortId(169)], - output: PortId(170), - span: SourceSpan::new("dsl/std/types.dag", 22714, 22736), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(170), - name: "".to_string(), - value: PortId(170), - params: vec![PortId(165)], - span: SourceSpan::new("dsl/std/types.dag", 22714, 22736), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(171), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(171), PortId(171)], - output: PortId(172), - span: SourceSpan::new("dsl/std/types.dag", 22774, 22793), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(172), - data: LiteralBits::String("ToolHandle".to_string()), - output: PortId(173), - span: SourceSpan::new("dsl/std/types.dag", 22774, 22793), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(173), - data: LiteralBits::String("ToolHandle".to_string()), - output: PortId(174), - span: SourceSpan::new("dsl/std/types.dag", 22774, 22793), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(174), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(173), PortId(174)], - output: PortId(175), - span: SourceSpan::new("dsl/std/types.dag", 22774, 22793), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(175), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(172), PortId(175)], - output: PortId(176), - span: SourceSpan::new("dsl/std/types.dag", 22774, 22793), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(176), - name: "".to_string(), - value: PortId(176), - params: vec![PortId(171)], - span: SourceSpan::new("dsl/std/types.dag", 22774, 22793), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(177), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(179), - span: SourceSpan::new("dsl/std/unicode.dag", 4240, 4253), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(178), - data: LiteralBits::Int("9".to_string()), - output: PortId(180), - span: SourceSpan::new("dsl/std/unicode.dag", 4257, 4258), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(179), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(179), PortId(180)], - output: PortId(181), - span: SourceSpan::new("dsl/std/unicode.dag", 4240, 4258), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(180), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(182), - span: SourceSpan::new("dsl/std/unicode.dag", 4262, 4275), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(181), - data: LiteralBits::Int("10".to_string()), - output: PortId(183), - span: SourceSpan::new("dsl/std/unicode.dag", 4279, 4281), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(182), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(182), PortId(183)], - output: PortId(184), - span: SourceSpan::new("dsl/std/unicode.dag", 4262, 4281), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(183), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::Or)), - inputs: vec![PortId(181), PortId(184)], - output: PortId(185), - span: SourceSpan::new("dsl/std/unicode.dag", 4240, 4281), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(184), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(186), - span: SourceSpan::new("dsl/std/unicode.dag", 4285, 4298), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(185), - data: LiteralBits::Int("12".to_string()), - output: PortId(187), - span: SourceSpan::new("dsl/std/unicode.dag", 4302, 4304), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(186), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(186), PortId(187)], - output: PortId(188), - span: SourceSpan::new("dsl/std/unicode.dag", 4285, 4304), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(187), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::Or)), - inputs: vec![PortId(185), PortId(188)], - output: PortId(189), - span: SourceSpan::new("dsl/std/unicode.dag", 4240, 4304), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(188), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(190), - span: SourceSpan::new("dsl/std/unicode.dag", 4314, 4327), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(189), - data: LiteralBits::Int("13".to_string()), - output: PortId(191), - span: SourceSpan::new("dsl/std/unicode.dag", 4331, 4333), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(190), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(190), PortId(191)], - output: PortId(192), - span: SourceSpan::new("dsl/std/unicode.dag", 4314, 4333), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(191), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::Or)), - inputs: vec![PortId(189), PortId(192)], - output: PortId(193), - span: SourceSpan::new("dsl/std/unicode.dag", 4240, 4333), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(192), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(194), - span: SourceSpan::new("dsl/std/unicode.dag", 4337, 4350), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(193), - data: LiteralBits::Int("32".to_string()), - output: PortId(195), - span: SourceSpan::new("dsl/std/unicode.dag", 4354, 4356), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(194), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(194), PortId(195)], - output: PortId(196), - span: SourceSpan::new("dsl/std/unicode.dag", 4337, 4356), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(195), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::Or)), - inputs: vec![PortId(193), PortId(196)], - output: PortId(197), - span: SourceSpan::new("dsl/std/unicode.dag", 4240, 4356), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(196), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(198), - span: SourceSpan::new("dsl/std/unicode.dag", 4370, 4383), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(197), - data: LiteralBits::Int("48".to_string()), - output: PortId(199), - span: SourceSpan::new("dsl/std/unicode.dag", 4387, 4389), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(198), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Ge)), - inputs: vec![PortId(198), PortId(199)], - output: PortId(200), - span: SourceSpan::new("dsl/std/unicode.dag", 4370, 4389), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(199), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(201), - span: SourceSpan::new("dsl/std/unicode.dag", 4393, 4406), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(200), - data: LiteralBits::Int("57".to_string()), - output: PortId(202), - span: SourceSpan::new("dsl/std/unicode.dag", 4410, 4412), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(201), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Le)), - inputs: vec![PortId(201), PortId(202)], - output: PortId(203), - span: SourceSpan::new("dsl/std/unicode.dag", 4393, 4412), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(202), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(200), PortId(203)], - output: PortId(204), - span: SourceSpan::new("dsl/std/unicode.dag", 4370, 4412), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(203), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(205), - span: SourceSpan::new("dsl/std/unicode.dag", 4437, 4450), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(204), - data: LiteralBits::Int("65".to_string()), - output: PortId(206), - span: SourceSpan::new("dsl/std/unicode.dag", 4454, 4456), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(205), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Ge)), - inputs: vec![PortId(205), PortId(206)], - output: PortId(207), - span: SourceSpan::new("dsl/std/unicode.dag", 4437, 4456), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(206), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(208), - span: SourceSpan::new("dsl/std/unicode.dag", 4460, 4473), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(207), - data: LiteralBits::Int("90".to_string()), - output: PortId(209), - span: SourceSpan::new("dsl/std/unicode.dag", 4477, 4479), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(208), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Le)), - inputs: vec![PortId(208), PortId(209)], - output: PortId(210), - span: SourceSpan::new("dsl/std/unicode.dag", 4460, 4479), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(209), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(207), PortId(210)], - output: PortId(211), - span: SourceSpan::new("dsl/std/unicode.dag", 4437, 4479), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(210), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(212), - span: SourceSpan::new("dsl/std/unicode.dag", 4489, 4502), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(211), - data: LiteralBits::Int("97".to_string()), - output: PortId(213), - span: SourceSpan::new("dsl/std/unicode.dag", 4506, 4508), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(212), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Ge)), - inputs: vec![PortId(212), PortId(213)], - output: PortId(214), - span: SourceSpan::new("dsl/std/unicode.dag", 4489, 4508), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(213), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(215), - span: SourceSpan::new("dsl/std/unicode.dag", 4512, 4525), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(214), - data: LiteralBits::Int("122".to_string()), - output: PortId(216), - span: SourceSpan::new("dsl/std/unicode.dag", 4529, 4532), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(215), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Le)), - inputs: vec![PortId(215), PortId(216)], - output: PortId(217), - span: SourceSpan::new("dsl/std/unicode.dag", 4512, 4532), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(216), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(214), PortId(217)], - output: PortId(218), - span: SourceSpan::new("dsl/std/unicode.dag", 4489, 4532), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(217), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::Or)), - inputs: vec![PortId(211), PortId(218)], - output: PortId(219), - span: SourceSpan::new("dsl/std/unicode.dag", 4437, 4532), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(218), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(220), - span: SourceSpan::new("dsl/std/unicode.dag", 4542, 4555), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(219), - data: LiteralBits::Int("95".to_string()), - output: PortId(221), - span: SourceSpan::new("dsl/std/unicode.dag", 4559, 4561), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(220), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(220), PortId(221)], - output: PortId(222), - span: SourceSpan::new("dsl/std/unicode.dag", 4542, 4561), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(221), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::Or)), - inputs: vec![PortId(219), PortId(222)], - output: PortId(223), - span: SourceSpan::new("dsl/std/unicode.dag", 4437, 4561), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(222), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(224), - span: SourceSpan::new("dsl/std/unicode.dag", 4746, 4759), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(223), - data: LiteralBits::Int("48".to_string()), - output: PortId(225), - span: SourceSpan::new("dsl/std/unicode.dag", 4763, 4765), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(224), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Ge)), - inputs: vec![PortId(224), PortId(225)], - output: PortId(226), - span: SourceSpan::new("dsl/std/unicode.dag", 4746, 4765), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(225), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(227), - span: SourceSpan::new("dsl/std/unicode.dag", 4769, 4782), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(226), - data: LiteralBits::Int("57".to_string()), - output: PortId(228), - span: SourceSpan::new("dsl/std/unicode.dag", 4786, 4788), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(227), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Le)), - inputs: vec![PortId(227), PortId(228)], - output: PortId(229), - span: SourceSpan::new("dsl/std/unicode.dag", 4769, 4788), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(228), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(226), PortId(229)], - output: PortId(230), - span: SourceSpan::new("dsl/std/unicode.dag", 4746, 4788), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(229), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(231), - span: SourceSpan::new("dsl/std/unicode.dag", 4798, 4811), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(230), - data: LiteralBits::Int("65".to_string()), - output: PortId(232), - span: SourceSpan::new("dsl/std/unicode.dag", 4815, 4817), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(231), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Ge)), - inputs: vec![PortId(231), PortId(232)], - output: PortId(233), - span: SourceSpan::new("dsl/std/unicode.dag", 4798, 4817), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(232), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(234), - span: SourceSpan::new("dsl/std/unicode.dag", 4821, 4834), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(233), - data: LiteralBits::Int("90".to_string()), - output: PortId(235), - span: SourceSpan::new("dsl/std/unicode.dag", 4838, 4840), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(234), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Le)), - inputs: vec![PortId(234), PortId(235)], - output: PortId(236), - span: SourceSpan::new("dsl/std/unicode.dag", 4821, 4840), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(235), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(233), PortId(236)], - output: PortId(237), - span: SourceSpan::new("dsl/std/unicode.dag", 4798, 4840), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(236), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::Or)), - inputs: vec![PortId(230), PortId(237)], - output: PortId(238), - span: SourceSpan::new("dsl/std/unicode.dag", 4746, 4840), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(237), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(239), - span: SourceSpan::new("dsl/std/unicode.dag", 4850, 4863), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(238), - data: LiteralBits::Int("97".to_string()), - output: PortId(240), - span: SourceSpan::new("dsl/std/unicode.dag", 4867, 4869), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(239), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Ge)), - inputs: vec![PortId(239), PortId(240)], - output: PortId(241), - span: SourceSpan::new("dsl/std/unicode.dag", 4850, 4869), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(240), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(242), - span: SourceSpan::new("dsl/std/unicode.dag", 4873, 4886), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(241), - data: LiteralBits::Int("122".to_string()), - output: PortId(243), - span: SourceSpan::new("dsl/std/unicode.dag", 4890, 4893), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(242), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Le)), - inputs: vec![PortId(242), PortId(243)], - output: PortId(244), - span: SourceSpan::new("dsl/std/unicode.dag", 4873, 4893), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(243), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(241), PortId(244)], - output: PortId(245), - span: SourceSpan::new("dsl/std/unicode.dag", 4850, 4893), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(244), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::Or)), - inputs: vec![PortId(238), PortId(245)], - output: PortId(246), - span: SourceSpan::new("dsl/std/unicode.dag", 4746, 4893), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(245), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(247), - span: SourceSpan::new("dsl/std/unicode.dag", 4903, 4916), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(246), - data: LiteralBits::Int("95".to_string()), - output: PortId(248), - span: SourceSpan::new("dsl/std/unicode.dag", 4920, 4922), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(247), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(247), PortId(248)], - output: PortId(249), - span: SourceSpan::new("dsl/std/unicode.dag", 4903, 4922), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(248), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::Or)), - inputs: vec![PortId(246), PortId(249)], - output: PortId(250), - span: SourceSpan::new("dsl/std/unicode.dag", 4746, 4922), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(249), - input: PortId(178), - paths: vec![ - Path { - body: NodeId(195), - output: PortId(197), - pattern: BranchPattern::UnresolvedVariant { - name: "Whitespace".to_string(), - span: SourceSpan::new("dsl/std/unicode.dag", 4220, 4230), - }, - binding: None, - }, - Path { - body: NodeId(202), - output: PortId(204), - pattern: BranchPattern::UnresolvedVariant { - name: "Digit".to_string(), - span: SourceSpan::new("dsl/std/unicode.dag", 4361, 4366), - }, - binding: None, - }, - Path { - body: NodeId(221), - output: PortId(223), - pattern: BranchPattern::UnresolvedVariant { - name: "IdentStart".to_string(), - span: SourceSpan::new("dsl/std/unicode.dag", 4417, 4427), - }, - binding: None, - }, - Path { - body: NodeId(248), - output: PortId(250), - pattern: BranchPattern::UnresolvedVariant { - name: "IdentContinue".to_string(), - span: SourceSpan::new("dsl/std/unicode.dag", 4723, 4736), - }, - binding: None, - }, - ], - output: PortId(251), - span: SourceSpan::new("dsl/std/unicode.dag", 4115, 4926), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(250), - name: "char_in_class".to_string(), - value: PortId(251), - params: vec![PortId(177), PortId(178)], - span: SourceSpan::new("dsl/std/unicode.dag", 4115, 4926), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(251), - data: LiteralBits::Int("0".to_string()), - output: PortId(253), - span: SourceSpan::new("dsl/std/unicode.dag", 8909, 8910), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(252), - target: TransformTarget::Operator(OperatorKind::Arithmetic(ArithmeticOp::Add)), - inputs: vec![PortId(252), PortId(253)], - output: PortId(254), - span: SourceSpan::new("dsl/std/unicode.dag", 8905, 8910), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(253), - name: "code_point".to_string(), - value: PortId(254), - params: vec![PortId(252)], - span: SourceSpan::new("dsl/std/unicode.dag", 8905, 8910), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(254), - target: TransformTarget::Callable(DeclarationId(763)), - inputs: vec![PortId(255)], - output: PortId(256), - span: SourceSpan::new("src/v3/std/effects.dag", 20290, 20316), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(255), - target: TransformTarget::Callable(DeclarationId(762)), - inputs: vec![PortId(256)], - output: PortId(257), - span: SourceSpan::new("src/v3/std/effects.dag", 20290, 20344), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(256), - name: "operation_is_breaking".to_string(), - value: PortId(257), - params: vec![PortId(255)], - span: SourceSpan::new("src/v3/std/effects.dag", 20290, 20344), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(257), - data: LiteralBits::Bool(false), - output: PortId(259), - span: SourceSpan::new("src/v3/std/effects.dag", 20440, 20445), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(258), - data: LiteralBits::Bool(true), - output: PortId(260), - span: SourceSpan::new("src/v3/std/effects.dag", 20464, 20468), - lane2_workflow: None, - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(259), - input: PortId(258), - paths: vec![ - Path { - body: NodeId(257), - output: PortId(259), - pattern: BranchPattern::UnresolvedVariant { - name: "IsIdempotent".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 20424, 20436), - }, - binding: None, - }, - Path { - body: NodeId(258), - output: PortId(260), - pattern: BranchPattern::UnresolvedVariant { - name: "IsBreaking".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 20450, 20460), - }, - binding: None, - }, - ], - output: PortId(261), - span: SourceSpan::new("src/v3/std/effects.dag", 20406, 20472), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(260), - name: "effect_shape_is_breaking".to_string(), - value: PortId(261), - params: vec![PortId(258)], - span: SourceSpan::new("src/v3/std/effects.dag", 20406, 20472), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(261), - data: LiteralBits::Bool(true), - output: PortId(263), - span: SourceSpan::new("src/v3/std/effects.dag", 23788, 23792), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(262), - data: LiteralBits::Bool(true), - output: PortId(264), - span: SourceSpan::new("src/v3/std/effects.dag", 23805, 23809), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(263), - data: LiteralBits::Bool(true), - output: PortId(265), - span: SourceSpan::new("src/v3/std/effects.dag", 23825, 23829), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(264), - data: LiteralBits::Bool(false), - output: PortId(266), - span: SourceSpan::new("src/v3/std/effects.dag", 23842, 23847), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(265), - data: LiteralBits::Bool(false), - output: PortId(267), - span: SourceSpan::new("src/v3/std/effects.dag", 23859, 23864), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(266), - data: LiteralBits::Bool(false), - output: PortId(268), - span: SourceSpan::new("src/v3/std/effects.dag", 23878, 23883), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(267), - data: LiteralBits::Bool(false), - output: PortId(269), - span: SourceSpan::new("src/v3/std/effects.dag", 23898, 23903), - lane2_workflow: None, - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(268), - input: PortId(262), - paths: vec![ - Path { - body: NodeId(261), - output: PortId(263), - pattern: BranchPattern::UnresolvedVariant { - name: "GET".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 23781, 23784), - }, - binding: None, - }, - Path { - body: NodeId(262), - output: PortId(264), - pattern: BranchPattern::UnresolvedVariant { - name: "HEAD".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 23797, 23801), - }, - binding: None, - }, - Path { - body: NodeId(263), - output: PortId(265), - pattern: BranchPattern::UnresolvedVariant { - name: "OPTIONS".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 23814, 23821), - }, - binding: None, - }, - Path { - body: NodeId(264), - output: PortId(266), - pattern: BranchPattern::UnresolvedVariant { - name: "POST".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 23834, 23838), - }, - binding: None, - }, - Path { - body: NodeId(265), - output: PortId(267), - pattern: BranchPattern::UnresolvedVariant { - name: "PUT".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 23852, 23855), - }, - binding: None, - }, - Path { - body: NodeId(266), - output: PortId(268), - pattern: BranchPattern::UnresolvedVariant { - name: "PATCH".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 23869, 23874), - }, - binding: None, - }, - Path { - body: NodeId(267), - output: PortId(269), - pattern: BranchPattern::UnresolvedVariant { - name: "DELETE".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 23888, 23894), - }, - binding: None, - }, - ], - output: PortId(270), - span: SourceSpan::new("src/v3/std/effects.dag", 23762, 23907), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(269), - name: "method_is_read".to_string(), - value: PortId(270), - params: vec![PortId(262)], - span: SourceSpan::new("src/v3/std/effects.dag", 23762, 23907), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(270), - data: LiteralBits::Bool(true), - output: PortId(272), - span: SourceSpan::new("src/v3/std/effects.dag", 23987, 23991), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(271), - data: LiteralBits::Bool(true), - output: PortId(273), - span: SourceSpan::new("src/v3/std/effects.dag", 24005, 24009), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(272), - data: LiteralBits::Bool(false), - output: PortId(274), - span: SourceSpan::new("src/v3/std/effects.dag", 24021, 24026), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(273), - data: LiteralBits::Bool(false), - output: PortId(275), - span: SourceSpan::new("src/v3/std/effects.dag", 24039, 24044), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(274), - data: LiteralBits::Bool(false), - output: PortId(276), - span: SourceSpan::new("src/v3/std/effects.dag", 24059, 24064), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(275), - data: LiteralBits::Bool(false), - output: PortId(277), - span: SourceSpan::new("src/v3/std/effects.dag", 24077, 24082), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(276), - data: LiteralBits::Bool(false), - output: PortId(278), - span: SourceSpan::new("src/v3/std/effects.dag", 24098, 24103), - lane2_workflow: None, - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(277), - input: PortId(271), - paths: vec![ - Path { - body: NodeId(270), - output: PortId(272), - pattern: BranchPattern::UnresolvedVariant { - name: "PUT".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 23980, 23983), - }, - binding: None, - }, - Path { - body: NodeId(271), - output: PortId(273), - pattern: BranchPattern::UnresolvedVariant { - name: "PATCH".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 23996, 24001), - }, - binding: None, - }, - Path { - body: NodeId(272), - output: PortId(274), - pattern: BranchPattern::UnresolvedVariant { - name: "GET".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 24014, 24017), - }, - binding: None, - }, - Path { - body: NodeId(273), - output: PortId(275), - pattern: BranchPattern::UnresolvedVariant { - name: "POST".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 24031, 24035), - }, - binding: None, - }, - Path { - body: NodeId(274), - output: PortId(276), - pattern: BranchPattern::UnresolvedVariant { - name: "DELETE".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 24049, 24055), - }, - binding: None, - }, - Path { - body: NodeId(275), - output: PortId(277), - pattern: BranchPattern::UnresolvedVariant { - name: "HEAD".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 24069, 24073), - }, - binding: None, - }, - Path { - body: NodeId(276), - output: PortId(278), - pattern: BranchPattern::UnresolvedVariant { - name: "OPTIONS".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 24087, 24094), - }, - binding: None, - }, - ], - output: PortId(279), - span: SourceSpan::new("src/v3/std/effects.dag", 23961, 24107), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(278), - name: "method_is_upsert".to_string(), - value: PortId(279), - params: vec![PortId(271)], - span: SourceSpan::new("src/v3/std/effects.dag", 23961, 24107), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(279), - data: LiteralBits::Bool(true), - output: PortId(281), - span: SourceSpan::new("src/v3/std/effects.dag", 24186, 24190), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(280), - data: LiteralBits::Bool(false), - output: PortId(282), - span: SourceSpan::new("src/v3/std/effects.dag", 24202, 24207), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(281), - data: LiteralBits::Bool(false), - output: PortId(283), - span: SourceSpan::new("src/v3/std/effects.dag", 24219, 24224), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(282), - data: LiteralBits::Bool(false), - output: PortId(284), - span: SourceSpan::new("src/v3/std/effects.dag", 24238, 24243), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(283), - data: LiteralBits::Bool(false), - output: PortId(285), - span: SourceSpan::new("src/v3/std/effects.dag", 24258, 24263), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(284), - data: LiteralBits::Bool(false), - output: PortId(286), - span: SourceSpan::new("src/v3/std/effects.dag", 24276, 24281), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(285), - data: LiteralBits::Bool(false), - output: PortId(287), - span: SourceSpan::new("src/v3/std/effects.dag", 24297, 24302), - lane2_workflow: None, - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(286), - input: PortId(280), - paths: vec![ - Path { - body: NodeId(279), - output: PortId(281), - pattern: BranchPattern::UnresolvedVariant { - name: "POST".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 24178, 24182), - }, - binding: None, - }, - Path { - body: NodeId(280), - output: PortId(282), - pattern: BranchPattern::UnresolvedVariant { - name: "GET".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 24195, 24198), - }, - binding: None, - }, - Path { - body: NodeId(281), - output: PortId(283), - pattern: BranchPattern::UnresolvedVariant { - name: "PUT".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 24212, 24215), - }, - binding: None, - }, - Path { - body: NodeId(282), - output: PortId(284), - pattern: BranchPattern::UnresolvedVariant { - name: "PATCH".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 24229, 24234), - }, - binding: None, - }, - Path { - body: NodeId(283), - output: PortId(285), - pattern: BranchPattern::UnresolvedVariant { - name: "DELETE".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 24248, 24254), - }, - binding: None, - }, - Path { - body: NodeId(284), - output: PortId(286), - pattern: BranchPattern::UnresolvedVariant { - name: "HEAD".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 24268, 24272), - }, - binding: None, - }, - Path { - body: NodeId(285), - output: PortId(287), - pattern: BranchPattern::UnresolvedVariant { - name: "OPTIONS".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 24286, 24293), - }, - binding: None, - }, - ], - output: PortId(288), - span: SourceSpan::new("src/v3/std/effects.dag", 24159, 24306), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(287), - name: "method_is_post".to_string(), - value: PortId(288), - params: vec![PortId(280)], - span: SourceSpan::new("src/v3/std/effects.dag", 24159, 24306), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(288), - data: LiteralBits::Bool(true), - output: PortId(290), - span: SourceSpan::new("src/v3/std/effects.dag", 24389, 24393), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(289), - data: LiteralBits::Bool(false), - output: PortId(291), - span: SourceSpan::new("src/v3/std/effects.dag", 24405, 24410), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(290), - data: LiteralBits::Bool(false), - output: PortId(292), - span: SourceSpan::new("src/v3/std/effects.dag", 24423, 24428), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(291), - data: LiteralBits::Bool(false), - output: PortId(293), - span: SourceSpan::new("src/v3/std/effects.dag", 24440, 24445), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(292), - data: LiteralBits::Bool(false), - output: PortId(294), - span: SourceSpan::new("src/v3/std/effects.dag", 24459, 24464), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(293), - data: LiteralBits::Bool(false), - output: PortId(295), - span: SourceSpan::new("src/v3/std/effects.dag", 24477, 24482), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(294), - data: LiteralBits::Bool(false), - output: PortId(296), - span: SourceSpan::new("src/v3/std/effects.dag", 24498, 24503), - lane2_workflow: None, - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(295), - input: PortId(289), - paths: vec![ - Path { - body: NodeId(288), - output: PortId(290), - pattern: BranchPattern::UnresolvedVariant { - name: "DELETE".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 24379, 24385), - }, - binding: None, - }, - Path { - body: NodeId(289), - output: PortId(291), - pattern: BranchPattern::UnresolvedVariant { - name: "GET".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 24398, 24401), - }, - binding: None, - }, - Path { - body: NodeId(290), - output: PortId(292), - pattern: BranchPattern::UnresolvedVariant { - name: "POST".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 24415, 24419), - }, - binding: None, - }, - Path { - body: NodeId(291), - output: PortId(293), - pattern: BranchPattern::UnresolvedVariant { - name: "PUT".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 24433, 24436), - }, - binding: None, - }, - Path { - body: NodeId(292), - output: PortId(294), - pattern: BranchPattern::UnresolvedVariant { - name: "PATCH".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 24450, 24455), - }, - binding: None, - }, - Path { - body: NodeId(293), - output: PortId(295), - pattern: BranchPattern::UnresolvedVariant { - name: "HEAD".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 24469, 24473), - }, - binding: None, - }, - Path { - body: NodeId(294), - output: PortId(296), - pattern: BranchPattern::UnresolvedVariant { - name: "OPTIONS".to_string(), - span: SourceSpan::new("src/v3/std/effects.dag", 24487, 24494), - }, - binding: None, - }, - ], - output: PortId(297), - span: SourceSpan::new("src/v3/std/effects.dag", 24360, 24507), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(296), - name: "method_is_delete".to_string(), - value: PortId(297), - params: vec![PortId(289)], - span: SourceSpan::new("src/v3/std/effects.dag", 24360, 24507), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(297), - target: TransformTarget::UnresolvedFieldProject { - field_label: "count".to_string(), - }, - inputs: vec![PortId(299)], - output: PortId(300), - span: SourceSpan::new("src/v3/std/substrate.dag", 18465, 18470), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(298), - target: TransformTarget::UnresolvedFieldProject { - field_label: "measure".to_string(), - }, - inputs: vec![PortId(301)], - output: PortId(302), - span: SourceSpan::new("src/v3/std/substrate.dag", 18503, 18510), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(299), - input: PortId(298), - paths: vec![ - Path { - body: NodeId(297), - output: PortId(300), - pattern: BranchPattern::UnresolvedVariant { - name: "Cardinality".to_string(), - span: SourceSpan::new("src/v3/std/substrate.dag", 18433, 18453), - }, - binding: Some(PayloadBinding { - binding_name: "payload".to_string(), - payload_port: PortId(299), - }), - }, - Path { - body: NodeId(298), - output: PortId(302), - pattern: BranchPattern::UnresolvedVariant { - name: "Descent".to_string(), - span: SourceSpan::new("src/v3/std/substrate.dag", 18475, 18491), - }, - binding: Some(PayloadBinding { - binding_name: "payload".to_string(), - payload_port: PortId(301), - }), - }, - ], - output: PortId(303), - span: SourceSpan::new("src/v3/std/substrate.dag", 18415, 18514), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(300), - name: "loop_bound_measure".to_string(), - value: PortId(303), - params: vec![PortId(298)], - span: SourceSpan::new("src/v3/std/substrate.dag", 18415, 18514), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(301), - target: TransformTarget::ResolvedFieldProject { - field_label: "source_port".to_string(), - }, - inputs: vec![PortId(304)], - output: PortId(306), - span: SourceSpan::new("src/v3/std/algebra.dag", 7604, 7615), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(302), - target: TransformTarget::ResolvedFieldProject { - field_label: "source_port".to_string(), - }, - inputs: vec![PortId(305)], - output: PortId(307), - span: SourceSpan::new("src/v3/std/algebra.dag", 7621, 7632), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(303), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(306), PortId(307)], - output: PortId(308), - span: SourceSpan::new("src/v3/std/algebra.dag", 7602, 7632), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(304), - name: "size_variable_eq".to_string(), - value: PortId(308), - params: vec![PortId(304), PortId(305)], - span: SourceSpan::new("src/v3/std/algebra.dag", 7602, 7632), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(305), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(310), - span: SourceSpan::new("src/v3/std/algebra.dag", 10300, 10305), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(306), - target: TransformTarget::Callable(DeclarationId(920)), - inputs: vec![PortId(310), PortId(309)], - output: PortId(311), - span: SourceSpan::new("src/v3/std/algebra.dag", 10291, 10322), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(307), - name: "dominate_scan_init".to_string(), - value: PortId(311), - params: vec![PortId(309)], - span: SourceSpan::new("src/v3/std/algebra.dag", 10291, 10322), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(308), - target: TransformTarget::Callable(DeclarationId(1830)), - inputs: vec![PortId(312)], - output: PortId(314), - span: SourceSpan::new("src/v3/std/algebra.dag", 11495, 11507), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(309), - target: TransformTarget::Callable(DeclarationId(1832)), - inputs: vec![PortId(314)], - output: PortId(315), - span: SourceSpan::new("src/v3/std/algebra.dag", 11488, 11535), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(310), - target: TransformTarget::Callable(DeclarationId(1776)), - inputs: vec![PortId(312), PortId(313), PortId(315)], - output: PortId(316), - span: SourceSpan::new("src/v3/std/algebra.dag", 11149, 11539), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(311), - name: "two_terms".to_string(), - value: PortId(316), - params: vec![PortId(312), PortId(313)], - span: SourceSpan::new("src/v3/std/algebra.dag", 11149, 11539), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(312), - target: TransformTarget::Callable(DeclarationId(1778)), - inputs: vec![PortId(317), PortId(318), PortId(319)], - output: PortId(320), - span: SourceSpan::new("src/v3/std/algebra.dag", 11670, 11726), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(313), - name: "many_terms".to_string(), - value: PortId(320), - params: vec![PortId(317), PortId(318), PortId(319)], - span: SourceSpan::new("src/v3/std/algebra.dag", 11670, 11726), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(314), - target: TransformTarget::Callable(DeclarationId(1833)), - inputs: vec![PortId(321)], - output: PortId(322), - span: SourceSpan::new("src/v3/std/algebra.dag", 11795, 11810), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(315), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(323), - span: SourceSpan::new("src/v3/std/algebra.dag", 11826, 11831), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(316), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(325), - span: SourceSpan::new("src/v3/std/algebra.dag", 11847, 11852), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(317), - input: PortId(322), - paths: vec![ - Path { - body: NodeId(315), - output: PortId(323), - pattern: BranchPattern::UnresolvedVariant { - name: "Empty".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 11817, 11822), - }, - binding: None, - }, - Path { - body: NodeId(316), - output: PortId(325), - pattern: BranchPattern::UnresolvedVariant { - name: "Cons".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 11836, 11843), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(324), - }), - }, - ], - output: PortId(326), - span: SourceSpan::new("src/v3/std/algebra.dag", 11789, 11856), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(318), - name: "reject_all_symbolic_costs".to_string(), - value: PortId(326), - params: vec![PortId(321)], - span: SourceSpan::new("src/v3/std/algebra.dag", 11789, 11856), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(319), - data: LiteralBits::Int("2".to_string()), - output: PortId(328), - span: SourceSpan::new("src/v3/std/algebra.dag", 11941, 11942), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(320), - target: TransformTarget::UnresolvedFieldProject { - field_label: "previous".to_string(), - }, - inputs: vec![PortId(329)], - output: PortId(330), - span: SourceSpan::new("src/v3/std/algebra.dag", 11994, 12002), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(321), - target: TransformTarget::Callable(DeclarationId(927)), - inputs: vec![PortId(330)], - output: PortId(331), - span: SourceSpan::new("src/v3/std/algebra.dag", 11975, 12003), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(322), - data: LiteralBits::Int("1".to_string()), - output: PortId(332), - span: SourceSpan::new("src/v3/std/algebra.dag", 12006, 12007), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(323), - target: TransformTarget::Operator(OperatorKind::Arithmetic(ArithmeticOp::Add)), - inputs: vec![PortId(331), PortId(332)], - output: PortId(333), - span: SourceSpan::new("src/v3/std/algebra.dag", 11975, 12007), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(324), - input: PortId(327), - paths: vec![ - Path { - body: NodeId(319), - output: PortId(328), - pattern: BranchPattern::UnresolvedVariant { - name: "DegreeTwo".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 11928, 11937), - }, - binding: None, - }, - Path { - body: NodeId(323), - output: PortId(333), - pattern: BranchPattern::UnresolvedVariant { - name: "DegreeSuccessor".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 11947, 11971), - }, - binding: Some(PayloadBinding { - binding_name: "payload".to_string(), - payload_port: PortId(329), - }), - }, - ], - output: PortId(334), - span: SourceSpan::new("src/v3/std/algebra.dag", 11909, 12011), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Loop(LoopNode { - id: NodeId(325), - source: PortId(327), - init: PortId(327), - body: NodeId(324), - bound: LoopBound::Cardinality { count: PortId(327) }, - output: PortId(335), - span: SourceSpan::new("src/v3/std/algebra.dag", 11909, 12011), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(326), - name: "degree_raw".to_string(), - value: PortId(335), - params: vec![PortId(327)], - span: SourceSpan::new("src/v3/std/algebra.dag", 11909, 12011), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(327), - target: TransformTarget::Callable(DeclarationId(924)), - inputs: vec![PortId(336), PortId(337)], - output: PortId(338), - span: SourceSpan::new("src/v3/std/algebra.dag", 12333, 12348), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(328), - target: TransformTarget::Callable(DeclarationId(1817)), - inputs: vec![PortId(338)], - output: PortId(339), - span: SourceSpan::new("src/v3/std/algebra.dag", 12325, 12349), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(329), - target: TransformTarget::Callable(DeclarationId(940)), - inputs: vec![PortId(339)], - output: PortId(340), - span: SourceSpan::new("src/v3/std/algebra.dag", 12315, 12350), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(330), - name: "sequential".to_string(), - value: PortId(340), - params: vec![PortId(336), PortId(337)], - span: SourceSpan::new("src/v3/std/algebra.dag", 12315, 12350), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(331), - target: TransformTarget::Callable(DeclarationId(924)), - inputs: vec![PortId(341), PortId(342)], - output: PortId(343), - span: SourceSpan::new("src/v3/std/algebra.dag", 12630, 12652), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(332), - target: TransformTarget::Callable(DeclarationId(1815)), - inputs: vec![PortId(343)], - output: PortId(344), - span: SourceSpan::new("src/v3/std/algebra.dag", 12618, 12653), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(333), - target: TransformTarget::Callable(DeclarationId(940)), - inputs: vec![PortId(344)], - output: PortId(345), - span: SourceSpan::new("src/v3/std/algebra.dag", 12608, 12654), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(334), - name: "iterate".to_string(), - value: PortId(345), - params: vec![PortId(341), PortId(342)], - span: SourceSpan::new("src/v3/std/algebra.dag", 12608, 12654), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(335), - target: TransformTarget::Callable(DeclarationId(933)), - inputs: vec![PortId(347), PortId(346)], - output: PortId(348), - span: SourceSpan::new("src/v3/std/algebra.dag", 13598, 13623), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(336), - target: TransformTarget::Callable(DeclarationId(931)), - inputs: vec![PortId(346), PortId(347)], - output: PortId(349), - span: SourceSpan::new("src/v3/std/algebra.dag", 13654, 13681), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(337), - input: PortId(348), - paths: vec![ - Path { - body: NodeId(337), - output: PortId(347), - pattern: BranchPattern::UnresolvedVariant { - name: "True".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 13633, 13642), - }, - binding: None, - }, - Path { - body: NodeId(336), - output: PortId(349), - pattern: BranchPattern::UnresolvedVariant { - name: "False".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 13654, 13681), - }, - binding: None, - }, - ], - output: PortId(350), - span: SourceSpan::new("src/v3/std/algebra.dag", 13595, 13681), - emit_participation: None, - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(338), - name: "max_path_step".to_string(), - value: PortId(350), - params: vec![PortId(346), PortId(347)], - span: SourceSpan::new("src/v3/std/algebra.dag", 13595, 13681), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(339), - target: TransformTarget::Callable(DeclarationId(933)), - inputs: vec![PortId(351), PortId(352)], - output: PortId(353), - span: SourceSpan::new("src/v3/std/algebra.dag", 13765, 13790), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(340), - target: TransformTarget::Callable(DeclarationId(928)), - inputs: vec![PortId(351), PortId(352)], - output: PortId(354), - span: SourceSpan::new("src/v3/std/algebra.dag", 13815, 13841), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(341), - input: PortId(353), - paths: vec![ - Path { - body: NodeId(341), - output: PortId(351), - pattern: BranchPattern::UnresolvedVariant { - name: "True".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 13800, 13803), - }, - binding: None, - }, - Path { - body: NodeId(340), - output: PortId(354), - pattern: BranchPattern::UnresolvedVariant { - name: "False".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 13815, 13841), - }, - binding: None, - }, - ], - output: PortId(355), - span: SourceSpan::new("src/v3/std/algebra.dag", 13762, 13841), - emit_participation: None, - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(342), - name: "keep_or_sum".to_string(), - value: PortId(355), - params: vec![PortId(351), PortId(352)], - span: SourceSpan::new("src/v3/std/algebra.dag", 13762, 13841), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(343), - data: LiteralBits::Int("0".to_string()), - output: PortId(357), - span: SourceSpan::new("src/v3/std/algebra.dag", 14227, 14228), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(344), - target: TransformTarget::Callable(DeclarationId(1811)), - inputs: vec![PortId(357)], - output: PortId(358), - span: SourceSpan::new("src/v3/std/algebra.dag", 14214, 14229), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(345), - target: TransformTarget::Callable(DeclarationId(1835)), - inputs: vec![PortId(356), PortId(358)], - output: PortId(359), - span: SourceSpan::new("src/v3/std/algebra.dag", 14202, 14245), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(346), - name: "max_path".to_string(), - value: PortId(359), - params: vec![PortId(356)], - span: SourceSpan::new("src/v3/std/algebra.dag", 14202, 14245), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(347), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(363), - span: SourceSpan::new("src/v3/std/algebra.dag", 15204, 15208), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(348), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(366), - span: SourceSpan::new("src/v3/std/algebra.dag", 15275, 15279), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(349), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(368), - span: SourceSpan::new("src/v3/std/algebra.dag", 15306, 15311), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(350), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(370), - span: SourceSpan::new("src/v3/std/algebra.dag", 15337, 15342), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(351), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(372), - span: SourceSpan::new("src/v3/std/algebra.dag", 15372, 15377), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(352), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(374), - span: SourceSpan::new("src/v3/std/algebra.dag", 15404, 15409), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(353), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(376), - span: SourceSpan::new("src/v3/std/algebra.dag", 15432, 15437), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(354), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(378), - span: SourceSpan::new("src/v3/std/algebra.dag", 15460, 15465), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(355), - input: PortId(361), - paths: vec![ - Path { - body: NodeId(348), - output: PortId(366), - pattern: BranchPattern::UnresolvedVariant { - name: "ConstantCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 15256, 15271), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(365), - }), - }, - Path { - body: NodeId(349), - output: PortId(368), - pattern: BranchPattern::UnresolvedVariant { - name: "UnknownCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 15288, 15302), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(367), - }), - }, - Path { - body: NodeId(350), - output: PortId(370), - pattern: BranchPattern::UnresolvedVariant { - name: "LinearCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 15320, 15333), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(369), - }), - }, - Path { - body: NodeId(351), - output: PortId(372), - pattern: BranchPattern::UnresolvedVariant { - name: "PolynomialCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 15351, 15368), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(371), - }), - }, - Path { - body: NodeId(352), - output: PortId(374), - pattern: BranchPattern::UnresolvedVariant { - name: "ProductCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 15386, 15400), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(373), - }), - }, - Path { - body: NodeId(353), - output: PortId(376), - pattern: BranchPattern::UnresolvedVariant { - name: "SumCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 15418, 15428), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(375), - }), - }, - Path { - body: NodeId(354), - output: PortId(378), - pattern: BranchPattern::UnresolvedVariant { - name: "LogCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 15446, 15456), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(377), - }), - }, - ], - output: PortId(379), - span: SourceSpan::new("src/v3/std/algebra.dag", 15238, 15473), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(356), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(382), - span: SourceSpan::new("src/v3/std/algebra.dag", 15539, 15543), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(357), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(384), - span: SourceSpan::new("src/v3/std/algebra.dag", 15566, 15570), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(358), - target: TransformTarget::Callable(DeclarationId(934)), - inputs: vec![PortId(380), PortId(385)], - output: PortId(386), - span: SourceSpan::new("src/v3/std/algebra.dag", 15597, 15623), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(359), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(388), - span: SourceSpan::new("src/v3/std/algebra.dag", 15669, 15674), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(360), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(390), - span: SourceSpan::new("src/v3/std/algebra.dag", 15701, 15706), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(361), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(392), - span: SourceSpan::new("src/v3/std/algebra.dag", 15733, 15738), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(362), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(394), - span: SourceSpan::new("src/v3/std/algebra.dag", 15761, 15766), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(363), - input: PortId(361), - paths: vec![ - Path { - body: NodeId(356), - output: PortId(382), - pattern: BranchPattern::UnresolvedVariant { - name: "ConstantCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 15520, 15535), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(381), - }), - }, - Path { - body: NodeId(357), - output: PortId(384), - pattern: BranchPattern::UnresolvedVariant { - name: "LogCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 15552, 15562), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(383), - }), - }, - Path { - body: NodeId(358), - output: PortId(386), - pattern: BranchPattern::UnresolvedVariant { - name: "LinearCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 15579, 15593), - }, - binding: Some(PayloadBinding { - binding_name: "vb".to_string(), - payload_port: PortId(385), - }), - }, - Path { - body: NodeId(359), - output: PortId(388), - pattern: BranchPattern::UnresolvedVariant { - name: "PolynomialCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 15632, 15655), - }, - binding: Some(PayloadBinding { - binding_name: "payload".to_string(), - payload_port: PortId(387), - }), - }, - Path { - body: NodeId(360), - output: PortId(390), - pattern: BranchPattern::UnresolvedVariant { - name: "UnknownCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 15683, 15697), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(389), - }), - }, - Path { - body: NodeId(361), - output: PortId(392), - pattern: BranchPattern::UnresolvedVariant { - name: "ProductCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 15715, 15729), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(391), - }), - }, - Path { - body: NodeId(362), - output: PortId(394), - pattern: BranchPattern::UnresolvedVariant { - name: "SumCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 15747, 15757), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(393), - }), - }, - ], - output: PortId(395), - span: SourceSpan::new("src/v3/std/algebra.dag", 15502, 15774), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(364), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(398), - span: SourceSpan::new("src/v3/std/algebra.dag", 15844, 15848), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(365), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(400), - span: SourceSpan::new("src/v3/std/algebra.dag", 15871, 15875), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(366), - target: TransformTarget::UnresolvedFieldProject { - field_label: "var".to_string(), - }, - inputs: vec![PortId(396)], - output: PortId(402), - span: SourceSpan::new("src/v3/std/algebra.dag", 15934, 15937), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(367), - target: TransformTarget::Callable(DeclarationId(934)), - inputs: vec![PortId(402), PortId(401)], - output: PortId(403), - span: SourceSpan::new("src/v3/std/algebra.dag", 15912, 15942), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(368), - target: TransformTarget::UnresolvedFieldProject { - field_label: "var".to_string(), - }, - inputs: vec![PortId(396)], - output: PortId(405), - span: SourceSpan::new("src/v3/std/algebra.dag", 16008, 16011), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(369), - target: TransformTarget::UnresolvedFieldProject { - field_label: "var".to_string(), - }, - inputs: vec![PortId(404)], - output: PortId(406), - span: SourceSpan::new("src/v3/std/algebra.dag", 16016, 16019), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(370), - target: TransformTarget::Callable(DeclarationId(934)), - inputs: vec![PortId(405), PortId(406)], - output: PortId(407), - span: SourceSpan::new("src/v3/std/algebra.dag", 15986, 16020), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(371), - target: TransformTarget::UnresolvedFieldProject { - field_label: "degree".to_string(), - }, - inputs: vec![PortId(396)], - output: PortId(408), - span: SourceSpan::new("src/v3/std/algebra.dag", 16052, 16058), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(372), - target: TransformTarget::Callable(DeclarationId(927)), - inputs: vec![PortId(408)], - output: PortId(409), - span: SourceSpan::new("src/v3/std/algebra.dag", 16038, 16059), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(373), - target: TransformTarget::UnresolvedFieldProject { - field_label: "degree".to_string(), - }, - inputs: vec![PortId(404)], - output: PortId(410), - span: SourceSpan::new("src/v3/std/algebra.dag", 16077, 16083), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(374), - target: TransformTarget::Callable(DeclarationId(927)), - inputs: vec![PortId(410)], - output: PortId(411), - span: SourceSpan::new("src/v3/std/algebra.dag", 16063, 16084), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(375), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Ge)), - inputs: vec![PortId(409), PortId(411)], - output: PortId(412), - span: SourceSpan::new("src/v3/std/algebra.dag", 16038, 16084), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(376), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(413), - span: SourceSpan::new("src/v3/std/algebra.dag", 16112, 16117), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(377), - input: PortId(407), - paths: vec![ - Path { - body: NodeId(375), - output: PortId(412), - pattern: BranchPattern::UnresolvedVariant { - name: "True".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 16038, 16084), - }, - binding: None, - }, - Path { - body: NodeId(376), - output: PortId(413), - pattern: BranchPattern::UnresolvedVariant { - name: "False".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 16112, 16117), - }, - binding: None, - }, - ], - output: PortId(414), - span: SourceSpan::new("src/v3/std/algebra.dag", 15983, 16117), - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(378), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(416), - span: SourceSpan::new("src/v3/std/algebra.dag", 16144, 16149), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(379), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(418), - span: SourceSpan::new("src/v3/std/algebra.dag", 16176, 16181), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(380), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(420), - span: SourceSpan::new("src/v3/std/algebra.dag", 16204, 16209), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(381), - input: PortId(361), - paths: vec![ - Path { - body: NodeId(364), - output: PortId(398), - pattern: BranchPattern::UnresolvedVariant { - name: "ConstantCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 15825, 15840), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(397), - }), - }, - Path { - body: NodeId(365), - output: PortId(400), - pattern: BranchPattern::UnresolvedVariant { - name: "LogCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 15857, 15867), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(399), - }), - }, - Path { - body: NodeId(367), - output: PortId(403), - pattern: BranchPattern::UnresolvedVariant { - name: "LinearCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 15884, 15898), - }, - binding: Some(PayloadBinding { - binding_name: "vb".to_string(), - payload_port: PortId(401), - }), - }, - Path { - body: NodeId(377), - output: PortId(414), - pattern: BranchPattern::UnresolvedVariant { - name: "PolynomialCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 15951, 15969), - }, - binding: Some(PayloadBinding { - binding_name: "pb".to_string(), - payload_port: PortId(404), - }), - }, - Path { - body: NodeId(378), - output: PortId(416), - pattern: BranchPattern::UnresolvedVariant { - name: "UnknownCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 16126, 16140), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(415), - }), - }, - Path { - body: NodeId(379), - output: PortId(418), - pattern: BranchPattern::UnresolvedVariant { - name: "ProductCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 16158, 16172), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(417), - }), - }, - Path { - body: NodeId(380), - output: PortId(420), - pattern: BranchPattern::UnresolvedVariant { - name: "SumCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 16190, 16200), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(419), - }), - }, - ], - output: PortId(421), - span: SourceSpan::new("src/v3/std/algebra.dag", 15807, 16217), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(382), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(424), - span: SourceSpan::new("src/v3/std/algebra.dag", 16280, 16284), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(383), - target: TransformTarget::Callable(DeclarationId(934)), - inputs: vec![PortId(422), PortId(425)], - output: PortId(426), - span: SourceSpan::new("src/v3/std/algebra.dag", 16308, 16334), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(384), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(428), - span: SourceSpan::new("src/v3/std/algebra.dag", 16360, 16365), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(385), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(430), - span: SourceSpan::new("src/v3/std/algebra.dag", 16395, 16400), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(386), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(432), - span: SourceSpan::new("src/v3/std/algebra.dag", 16427, 16432), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(387), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(434), - span: SourceSpan::new("src/v3/std/algebra.dag", 16455, 16460), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(388), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(436), - span: SourceSpan::new("src/v3/std/algebra.dag", 16487, 16492), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(389), - input: PortId(361), - paths: vec![ - Path { - body: NodeId(382), - output: PortId(424), - pattern: BranchPattern::UnresolvedVariant { - name: "ConstantCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 16261, 16276), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(423), - }), - }, - Path { - body: NodeId(383), - output: PortId(426), - pattern: BranchPattern::UnresolvedVariant { - name: "LogCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 16293, 16304), - }, - binding: Some(PayloadBinding { - binding_name: "vb".to_string(), - payload_port: PortId(425), - }), - }, - Path { - body: NodeId(384), - output: PortId(428), - pattern: BranchPattern::UnresolvedVariant { - name: "LinearCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 16343, 16356), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(427), - }), - }, - Path { - body: NodeId(385), - output: PortId(430), - pattern: BranchPattern::UnresolvedVariant { - name: "PolynomialCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 16374, 16391), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(429), - }), - }, - Path { - body: NodeId(386), - output: PortId(432), - pattern: BranchPattern::UnresolvedVariant { - name: "ProductCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 16409, 16423), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(431), - }), - }, - Path { - body: NodeId(387), - output: PortId(434), - pattern: BranchPattern::UnresolvedVariant { - name: "SumCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 16441, 16451), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(433), - }), - }, - Path { - body: NodeId(388), - output: PortId(436), - pattern: BranchPattern::UnresolvedVariant { - name: "UnknownCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 16469, 16483), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(435), - }), - }, - ], - output: PortId(437), - span: SourceSpan::new("src/v3/std/algebra.dag", 16243, 16500), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(390), - target: TransformTarget::Callable(DeclarationId(941)), - inputs: vec![PortId(438)], - output: PortId(439), - span: SourceSpan::new("src/v3/std/algebra.dag", 16927, 16945), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(391), - target: TransformTarget::Callable(DeclarationId(921)), - inputs: vec![PortId(361)], - output: PortId(440), - span: SourceSpan::new("src/v3/std/algebra.dag", 16957, 16978), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(392), - target: TransformTarget::Callable(DeclarationId(1837)), - inputs: vec![PortId(439), PortId(440)], - output: PortId(441), - span: SourceSpan::new("src/v3/std/algebra.dag", 16911, 17021), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(393), - target: TransformTarget::Callable(DeclarationId(957)), - inputs: vec![PortId(441)], - output: PortId(442), - span: SourceSpan::new("src/v3/std/algebra.dag", 16893, 17029), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(394), - target: TransformTarget::Callable(DeclarationId(941)), - inputs: vec![PortId(443)], - output: PortId(444), - span: SourceSpan::new("src/v3/std/algebra.dag", 17092, 17110), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(395), - target: TransformTarget::Callable(DeclarationId(921)), - inputs: vec![PortId(361)], - output: PortId(445), - span: SourceSpan::new("src/v3/std/algebra.dag", 17122, 17143), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(396), - target: TransformTarget::Callable(DeclarationId(1839)), - inputs: vec![PortId(444), PortId(445)], - output: PortId(446), - span: SourceSpan::new("src/v3/std/algebra.dag", 17076, 17186), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(397), - target: TransformTarget::Callable(DeclarationId(957)), - inputs: vec![PortId(446)], - output: PortId(447), - span: SourceSpan::new("src/v3/std/algebra.dag", 17058, 17194), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(398), - input: PortId(360), - paths: vec![ - Path { - body: NodeId(347), - output: PortId(363), - pattern: BranchPattern::UnresolvedVariant { - name: "UnknownCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 15186, 15200), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(362), - }), - }, - Path { - body: NodeId(355), - output: PortId(379), - pattern: BranchPattern::UnresolvedVariant { - name: "ConstantCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 15213, 15228), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(364), - }), - }, - Path { - body: NodeId(363), - output: PortId(395), - pattern: BranchPattern::UnresolvedVariant { - name: "LinearCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 15478, 15492), - }, - binding: Some(PayloadBinding { - binding_name: "va".to_string(), - payload_port: PortId(380), - }), - }, - Path { - body: NodeId(381), - output: PortId(421), - pattern: BranchPattern::UnresolvedVariant { - name: "PolynomialCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 15779, 15797), - }, - binding: Some(PayloadBinding { - binding_name: "pa".to_string(), - payload_port: PortId(396), - }), - }, - Path { - body: NodeId(389), - output: PortId(437), - pattern: BranchPattern::UnresolvedVariant { - name: "LogCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 16222, 16233), - }, - binding: Some(PayloadBinding { - binding_name: "va".to_string(), - payload_port: PortId(422), - }), - }, - Path { - body: NodeId(393), - output: PortId(442), - pattern: BranchPattern::UnresolvedVariant { - name: "ProductCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 16865, 16883), - }, - binding: Some(PayloadBinding { - binding_name: "terms".to_string(), - payload_port: PortId(438), - }), - }, - Path { - body: NodeId(397), - output: PortId(447), - pattern: BranchPattern::UnresolvedVariant { - name: "SumCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 17034, 17048), - }, - binding: Some(PayloadBinding { - binding_name: "terms".to_string(), - payload_port: PortId(443), - }), - }, - ], - output: PortId(448), - span: SourceSpan::new("src/v3/std/algebra.dag", 15172, 17198), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(399), - name: "dominates".to_string(), - value: PortId(448), - params: vec![PortId(360), PortId(361)], - span: SourceSpan::new("src/v3/std/algebra.dag", 15172, 17198), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(400), - target: TransformTarget::Callable(DeclarationId(917)), - inputs: vec![PortId(449), PortId(450)], - output: PortId(451), - span: SourceSpan::new("src/v3/std/algebra.dag", 17268, 17290), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(401), - name: "same_size_variable".to_string(), - value: PortId(451), - params: vec![PortId(449), PortId(450)], - span: SourceSpan::new("src/v3/std/algebra.dag", 17268, 17290), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(402), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(454), - span: SourceSpan::new("src/v3/std/algebra.dag", 18426, 18430), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(403), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(455), - span: SourceSpan::new("src/v3/std/algebra.dag", 18495, 18500), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(404), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(456), - span: SourceSpan::new("src/v3/std/algebra.dag", 18529, 18533), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(405), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(458), - span: SourceSpan::new("src/v3/std/algebra.dag", 18564, 18568), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(406), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(459), - span: SourceSpan::new("src/v3/std/algebra.dag", 18595, 18599), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(407), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(460), - span: SourceSpan::new("src/v3/std/algebra.dag", 18629, 18633), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(408), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(461), - span: SourceSpan::new("src/v3/std/algebra.dag", 18657, 18661), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(409), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(462), - span: SourceSpan::new("src/v3/std/algebra.dag", 18682, 18686), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(410), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(463), - span: SourceSpan::new("src/v3/std/algebra.dag", 18712, 18716), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(411), - input: PortId(453), - paths: vec![ - Path { - body: NodeId(403), - output: PortId(455), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassUnknown".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 18479, 18491), - }, - binding: None, - }, - Path { - body: NodeId(404), - output: PortId(456), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassExponential".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 18509, 18525), - }, - binding: None, - }, - Path { - body: NodeId(405), - output: PortId(458), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassPolynomial".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 18542, 18560), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(457), - }), - }, - Path { - body: NodeId(406), - output: PortId(459), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassQuadratic".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 18577, 18591), - }, - binding: None, - }, - Path { - body: NodeId(407), - output: PortId(460), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassLinearithmic".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 18608, 18625), - }, - binding: None, - }, - Path { - body: NodeId(408), - output: PortId(461), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassLinear".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 18642, 18653), - }, - binding: None, - }, - Path { - body: NodeId(409), - output: PortId(462), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassLog".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 18670, 18678), - }, - binding: None, - }, - Path { - body: NodeId(410), - output: PortId(463), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassConstant".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 18695, 18708), - }, - binding: None, - }, - ], - output: PortId(464), - span: SourceSpan::new("src/v3/std/algebra.dag", 18461, 18724), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(412), - target: TransformTarget::UnresolvedFieldProject { - field_label: "degree".to_string(), - }, - inputs: vec![PortId(465)], - output: PortId(466), - span: SourceSpan::new("src/v3/std/algebra.dag", 18747, 18758), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(413), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(467), - span: SourceSpan::new("src/v3/std/algebra.dag", 18804, 18809), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(414), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(468), - span: SourceSpan::new("src/v3/std/algebra.dag", 18838, 18843), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(415), - target: TransformTarget::UnresolvedFieldProject { - field_label: "degree".to_string(), - }, - inputs: vec![PortId(469)], - output: PortId(470), - span: SourceSpan::new("src/v3/std/algebra.dag", 18870, 18881), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(416), - target: TransformTarget::Callable(DeclarationId(1150)), - inputs: vec![PortId(466)], - output: PortId(471), - span: SourceSpan::new("src/v3/std/algebra.dag", 18897, 18924), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(417), - target: TransformTarget::Callable(DeclarationId(1150)), - inputs: vec![PortId(470)], - output: PortId(472), - span: SourceSpan::new("src/v3/std/algebra.dag", 18928, 18955), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(418), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Ge)), - inputs: vec![PortId(471), PortId(472)], - output: PortId(473), - span: SourceSpan::new("src/v3/std/algebra.dag", 18897, 18955), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(419), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(474), - span: SourceSpan::new("src/v3/std/algebra.dag", 18982, 18986), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(420), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(475), - span: SourceSpan::new("src/v3/std/algebra.dag", 19016, 19020), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(421), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(476), - span: SourceSpan::new("src/v3/std/algebra.dag", 19044, 19048), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(422), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(477), - span: SourceSpan::new("src/v3/std/algebra.dag", 19069, 19073), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(423), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(478), - span: SourceSpan::new("src/v3/std/algebra.dag", 19099, 19103), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(424), - input: PortId(453), - paths: vec![ - Path { - body: NodeId(413), - output: PortId(467), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassUnknown".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 18788, 18800), - }, - binding: None, - }, - Path { - body: NodeId(414), - output: PortId(468), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassExponential".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 18818, 18834), - }, - binding: None, - }, - Path { - body: NodeId(418), - output: PortId(473), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassPolynomial".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 18852, 18883), - }, - binding: Some(PayloadBinding { - binding_name: "d_b".to_string(), - payload_port: PortId(469), - }), - }, - Path { - body: NodeId(419), - output: PortId(474), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassQuadratic".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 18964, 18978), - }, - binding: None, - }, - Path { - body: NodeId(420), - output: PortId(475), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassLinearithmic".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 18995, 19012), - }, - binding: None, - }, - Path { - body: NodeId(421), - output: PortId(476), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassLinear".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19029, 19040), - }, - binding: None, - }, - Path { - body: NodeId(422), - output: PortId(477), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassLog".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19057, 19065), - }, - binding: None, - }, - Path { - body: NodeId(423), - output: PortId(478), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassConstant".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19082, 19095), - }, - binding: None, - }, - ], - output: PortId(479), - span: SourceSpan::new("src/v3/std/algebra.dag", 18770, 19111), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(425), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(480), - span: SourceSpan::new("src/v3/std/algebra.dag", 19175, 19179), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(426), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(481), - span: SourceSpan::new("src/v3/std/algebra.dag", 19200, 19204), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(427), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(482), - span: SourceSpan::new("src/v3/std/algebra.dag", 19228, 19232), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(428), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(483), - span: SourceSpan::new("src/v3/std/algebra.dag", 19262, 19266), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(429), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(484), - span: SourceSpan::new("src/v3/std/algebra.dag", 19293, 19297), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(430), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(486), - span: SourceSpan::new("src/v3/std/algebra.dag", 19328, 19333), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(431), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(487), - span: SourceSpan::new("src/v3/std/algebra.dag", 19362, 19367), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(432), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(488), - span: SourceSpan::new("src/v3/std/algebra.dag", 19392, 19397), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(433), - input: PortId(453), - paths: vec![ - Path { - body: NodeId(425), - output: PortId(480), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassConstant".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19158, 19171), - }, - binding: None, - }, - Path { - body: NodeId(426), - output: PortId(481), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassLog".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19188, 19196), - }, - binding: None, - }, - Path { - body: NodeId(427), - output: PortId(482), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassLinear".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19213, 19224), - }, - binding: None, - }, - Path { - body: NodeId(428), - output: PortId(483), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassLinearithmic".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19241, 19258), - }, - binding: None, - }, - Path { - body: NodeId(429), - output: PortId(484), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassQuadratic".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19275, 19289), - }, - binding: None, - }, - Path { - body: NodeId(430), - output: PortId(486), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassPolynomial".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19306, 19324), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(485), - }), - }, - Path { - body: NodeId(431), - output: PortId(487), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassExponential".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19342, 19358), - }, - binding: None, - }, - Path { - body: NodeId(432), - output: PortId(488), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassUnknown".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19376, 19388), - }, - binding: None, - }, - ], - output: PortId(489), - span: SourceSpan::new("src/v3/std/algebra.dag", 19140, 19405), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(434), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(490), - span: SourceSpan::new("src/v3/std/algebra.dag", 19472, 19476), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(435), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(491), - span: SourceSpan::new("src/v3/std/algebra.dag", 19497, 19501), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(436), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(492), - span: SourceSpan::new("src/v3/std/algebra.dag", 19525, 19529), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(437), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(493), - span: SourceSpan::new("src/v3/std/algebra.dag", 19559, 19563), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(438), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(494), - span: SourceSpan::new("src/v3/std/algebra.dag", 19590, 19595), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(439), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(496), - span: SourceSpan::new("src/v3/std/algebra.dag", 19626, 19631), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(440), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(497), - span: SourceSpan::new("src/v3/std/algebra.dag", 19660, 19665), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(441), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(498), - span: SourceSpan::new("src/v3/std/algebra.dag", 19690, 19695), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(442), - input: PortId(453), - paths: vec![ - Path { - body: NodeId(434), - output: PortId(490), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassConstant".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19455, 19468), - }, - binding: None, - }, - Path { - body: NodeId(435), - output: PortId(491), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassLog".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19485, 19493), - }, - binding: None, - }, - Path { - body: NodeId(436), - output: PortId(492), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassLinear".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19510, 19521), - }, - binding: None, - }, - Path { - body: NodeId(437), - output: PortId(493), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassLinearithmic".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19538, 19555), - }, - binding: None, - }, - Path { - body: NodeId(438), - output: PortId(494), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassQuadratic".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19572, 19586), - }, - binding: None, - }, - Path { - body: NodeId(439), - output: PortId(496), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassPolynomial".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19604, 19622), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(495), - }), - }, - Path { - body: NodeId(440), - output: PortId(497), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassExponential".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19640, 19656), - }, - binding: None, - }, - Path { - body: NodeId(441), - output: PortId(498), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassUnknown".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19674, 19686), - }, - binding: None, - }, - ], - output: PortId(499), - span: SourceSpan::new("src/v3/std/algebra.dag", 19437, 19703), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(443), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(500), - span: SourceSpan::new("src/v3/std/algebra.dag", 19764, 19768), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(444), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(501), - span: SourceSpan::new("src/v3/std/algebra.dag", 19789, 19793), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(445), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(502), - span: SourceSpan::new("src/v3/std/algebra.dag", 19817, 19821), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(446), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(503), - span: SourceSpan::new("src/v3/std/algebra.dag", 19851, 19856), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(447), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(504), - span: SourceSpan::new("src/v3/std/algebra.dag", 19883, 19888), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(448), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(506), - span: SourceSpan::new("src/v3/std/algebra.dag", 19919, 19924), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(449), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(507), - span: SourceSpan::new("src/v3/std/algebra.dag", 19953, 19958), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(450), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(508), - span: SourceSpan::new("src/v3/std/algebra.dag", 19983, 19988), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(451), - input: PortId(453), - paths: vec![ - Path { - body: NodeId(443), - output: PortId(500), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassConstant".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19747, 19760), - }, - binding: None, - }, - Path { - body: NodeId(444), - output: PortId(501), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassLog".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19777, 19785), - }, - binding: None, - }, - Path { - body: NodeId(445), - output: PortId(502), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassLinear".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19802, 19813), - }, - binding: None, - }, - Path { - body: NodeId(446), - output: PortId(503), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassLinearithmic".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19830, 19847), - }, - binding: None, - }, - Path { - body: NodeId(447), - output: PortId(504), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassQuadratic".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19865, 19879), - }, - binding: None, - }, - Path { - body: NodeId(448), - output: PortId(506), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassPolynomial".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19897, 19915), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(505), - }), - }, - Path { - body: NodeId(449), - output: PortId(507), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassExponential".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19933, 19949), - }, - binding: None, - }, - Path { - body: NodeId(450), - output: PortId(508), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassUnknown".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19967, 19979), - }, - binding: None, - }, - ], - output: PortId(509), - span: SourceSpan::new("src/v3/std/algebra.dag", 19729, 19996), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(452), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(510), - span: SourceSpan::new("src/v3/std/algebra.dag", 20054, 20058), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(453), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(511), - span: SourceSpan::new("src/v3/std/algebra.dag", 20079, 20083), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(454), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(512), - span: SourceSpan::new("src/v3/std/algebra.dag", 20107, 20112), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(455), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(513), - span: SourceSpan::new("src/v3/std/algebra.dag", 20142, 20147), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(456), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(514), - span: SourceSpan::new("src/v3/std/algebra.dag", 20174, 20179), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(457), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(516), - span: SourceSpan::new("src/v3/std/algebra.dag", 20210, 20215), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(458), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(517), - span: SourceSpan::new("src/v3/std/algebra.dag", 20244, 20249), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(459), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(518), - span: SourceSpan::new("src/v3/std/algebra.dag", 20274, 20279), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(460), - input: PortId(453), - paths: vec![ - Path { - body: NodeId(452), - output: PortId(510), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassConstant".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 20037, 20050), - }, - binding: None, - }, - Path { - body: NodeId(453), - output: PortId(511), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassLog".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 20067, 20075), - }, - binding: None, - }, - Path { - body: NodeId(454), - output: PortId(512), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassLinear".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 20092, 20103), - }, - binding: None, - }, - Path { - body: NodeId(455), - output: PortId(513), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassLinearithmic".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 20121, 20138), - }, - binding: None, - }, - Path { - body: NodeId(456), - output: PortId(514), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassQuadratic".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 20156, 20170), - }, - binding: None, - }, - Path { - body: NodeId(457), - output: PortId(516), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassPolynomial".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 20188, 20206), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(515), - }), - }, - Path { - body: NodeId(458), - output: PortId(517), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassExponential".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 20224, 20240), - }, - binding: None, - }, - Path { - body: NodeId(459), - output: PortId(518), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassUnknown".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 20258, 20270), - }, - binding: None, - }, - ], - output: PortId(519), - span: SourceSpan::new("src/v3/std/algebra.dag", 20019, 20287), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(461), - target: TransformTarget::Callable(DeclarationId(530)), - inputs: vec![], - output: PortId(520), - span: SourceSpan::new("src/v3/std/algebra.dag", 20350, 20354), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(462), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(521), - span: SourceSpan::new("src/v3/std/algebra.dag", 20375, 20380), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(463), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(522), - span: SourceSpan::new("src/v3/std/algebra.dag", 20404, 20409), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(464), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(523), - span: SourceSpan::new("src/v3/std/algebra.dag", 20439, 20444), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(465), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(524), - span: SourceSpan::new("src/v3/std/algebra.dag", 20471, 20476), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(466), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(526), - span: SourceSpan::new("src/v3/std/algebra.dag", 20507, 20512), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(467), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(527), - span: SourceSpan::new("src/v3/std/algebra.dag", 20541, 20546), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(468), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(528), - span: SourceSpan::new("src/v3/std/algebra.dag", 20571, 20576), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(469), - input: PortId(453), - paths: vec![ - Path { - body: NodeId(461), - output: PortId(520), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassConstant".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 20333, 20346), - }, - binding: None, - }, - Path { - body: NodeId(462), - output: PortId(521), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassLog".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 20363, 20371), - }, - binding: None, - }, - Path { - body: NodeId(463), - output: PortId(522), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassLinear".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 20389, 20400), - }, - binding: None, - }, - Path { - body: NodeId(464), - output: PortId(523), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassLinearithmic".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 20418, 20435), - }, - binding: None, - }, - Path { - body: NodeId(465), - output: PortId(524), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassQuadratic".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 20453, 20467), - }, - binding: None, - }, - Path { - body: NodeId(466), - output: PortId(526), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassPolynomial".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 20485, 20503), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(525), - }), - }, - Path { - body: NodeId(467), - output: PortId(527), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassExponential".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 20521, 20537), - }, - binding: None, - }, - Path { - body: NodeId(468), - output: PortId(528), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassUnknown".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 20555, 20567), - }, - binding: None, - }, - ], - output: PortId(529), - span: SourceSpan::new("src/v3/std/algebra.dag", 20315, 20584), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(470), - input: PortId(452), - paths: vec![ - Path { - body: NodeId(402), - output: PortId(454), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassUnknown".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 18410, 18422), - }, - binding: None, - }, - Path { - body: NodeId(411), - output: PortId(464), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassExponential".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 18435, 18451), - }, - binding: None, - }, - Path { - body: NodeId(424), - output: PortId(479), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassPolynomial".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 18729, 18760), - }, - binding: Some(PayloadBinding { - binding_name: "d_a".to_string(), - payload_port: PortId(465), - }), - }, - Path { - body: NodeId(433), - output: PortId(489), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassQuadratic".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19116, 19130), - }, - binding: None, - }, - Path { - body: NodeId(442), - output: PortId(499), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassLinearithmic".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19410, 19427), - }, - binding: None, - }, - Path { - body: NodeId(451), - output: PortId(509), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassLinear".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 19708, 19719), - }, - binding: None, - }, - Path { - body: NodeId(460), - output: PortId(519), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassLog".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 20001, 20009), - }, - binding: None, - }, - Path { - body: NodeId(469), - output: PortId(529), - pattern: BranchPattern::UnresolvedVariant { - name: "ClassConstant".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 20292, 20305), - }, - binding: None, - }, - ], - output: PortId(530), - span: SourceSpan::new("src/v3/std/algebra.dag", 18396, 20588), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(471), - name: "asymptotic_dominates".to_string(), - value: PortId(530), - params: vec![PortId(452), PortId(453)], - span: SourceSpan::new("src/v3/std/algebra.dag", 18396, 20588), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(472), - target: TransformTarget::Callable(DeclarationId(936)), - inputs: vec![PortId(531), PortId(532)], - output: PortId(533), - span: SourceSpan::new("src/v3/std/algebra.dag", 20681, 20707), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(473), - input: PortId(533), - paths: vec![ - Path { - body: NodeId(473), - output: PortId(532), - pattern: BranchPattern::UnresolvedVariant { - name: "True".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 20713, 20714), - }, - binding: None, - }, - Path { - body: NodeId(473), - output: PortId(531), - pattern: BranchPattern::UnresolvedVariant { - name: "False".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 20720, 20721), - }, - binding: None, - }, - ], - output: PortId(534), - span: SourceSpan::new("src/v3/std/algebra.dag", 20678, 20721), - emit_participation: None, - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(474), - name: "meet_asymptotic_class".to_string(), - value: PortId(534), - params: vec![PortId(531), PortId(532)], - span: SourceSpan::new("src/v3/std/algebra.dag", 20678, 20721), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(475), - target: TransformTarget::Callable(DeclarationId(936)), - inputs: vec![PortId(535), PortId(536)], - output: PortId(537), - span: SourceSpan::new("src/v3/std/algebra.dag", 20814, 20840), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(476), - input: PortId(537), - paths: vec![ - Path { - body: NodeId(476), - output: PortId(535), - pattern: BranchPattern::UnresolvedVariant { - name: "True".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 20846, 20847), - }, - binding: None, - }, - Path { - body: NodeId(476), - output: PortId(536), - pattern: BranchPattern::UnresolvedVariant { - name: "False".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 20853, 20854), - }, - binding: None, - }, - ], - output: PortId(538), - span: SourceSpan::new("src/v3/std/algebra.dag", 20811, 20854), - emit_participation: None, - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(477), - name: "join_asymptotic_class".to_string(), - value: PortId(538), - params: vec![PortId(535), PortId(536)], - span: SourceSpan::new("src/v3/std/algebra.dag", 20811, 20854), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(478), - target: TransformTarget::Callable(DeclarationId(941)), - inputs: vec![PortId(540)], - output: PortId(541), - span: SourceSpan::new("src/v3/std/algebra.dag", 22044, 22062), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(479), - target: TransformTarget::Callable(DeclarationId(942)), - inputs: vec![PortId(541)], - output: PortId(542), - span: SourceSpan::new("src/v3/std/algebra.dag", 22025, 22063), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(480), - target: TransformTarget::Callable(DeclarationId(948)), - inputs: vec![PortId(542)], - output: PortId(543), - span: SourceSpan::new("src/v3/std/algebra.dag", 22014, 22064), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(481), - target: TransformTarget::Callable(DeclarationId(941)), - inputs: vec![PortId(544)], - output: PortId(545), - span: SourceSpan::new("src/v3/std/algebra.dag", 22168, 22186), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(482), - target: TransformTarget::Callable(DeclarationId(943)), - inputs: vec![PortId(545)], - output: PortId(546), - span: SourceSpan::new("src/v3/std/algebra.dag", 22136, 22187), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(483), - target: TransformTarget::Callable(DeclarationId(945)), - inputs: vec![PortId(546)], - output: PortId(547), - span: SourceSpan::new("src/v3/std/algebra.dag", 22112, 22188), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(484), - target: TransformTarget::Callable(DeclarationId(950)), - inputs: vec![PortId(547)], - output: PortId(548), - span: SourceSpan::new("src/v3/std/algebra.dag", 22097, 22189), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(485), - input: PortId(539), - paths: vec![ - Path { - body: NodeId(485), - output: PortId(539), - pattern: BranchPattern::UnresolvedVariant { - name: "ConstantCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 21892, 21904), - }, - binding: None, - }, - Path { - body: NodeId(485), - output: PortId(539), - pattern: BranchPattern::UnresolvedVariant { - name: "LinearCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 21914, 21924), - }, - binding: None, - }, - Path { - body: NodeId(485), - output: PortId(539), - pattern: BranchPattern::UnresolvedVariant { - name: "PolynomialCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 21934, 21948), - }, - binding: None, - }, - Path { - body: NodeId(485), - output: PortId(539), - pattern: BranchPattern::UnresolvedVariant { - name: "LogCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 21958, 21965), - }, - binding: None, - }, - Path { - body: NodeId(485), - output: PortId(539), - pattern: BranchPattern::UnresolvedVariant { - name: "UnknownCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 21975, 21986), - }, - binding: None, - }, - Path { - body: NodeId(480), - output: PortId(543), - pattern: BranchPattern::UnresolvedVariant { - name: "SumCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 21996, 22010), - }, - binding: Some(PayloadBinding { - binding_name: "terms".to_string(), - payload_port: PortId(540), - }), - }, - Path { - body: NodeId(484), - output: PortId(548), - pattern: BranchPattern::UnresolvedVariant { - name: "ProductCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 22069, 22087), - }, - binding: Some(PayloadBinding { - binding_name: "terms".to_string(), - payload_port: PortId(544), - }), - }, - ], - output: PortId(549), - span: SourceSpan::new("src/v3/std/algebra.dag", 21878, 22193), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(486), - name: "normalize".to_string(), - value: PortId(549), - params: vec![PortId(539)], - span: SourceSpan::new("src/v3/std/algebra.dag", 21878, 22193), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(487), - target: TransformTarget::ResolvedFieldProject { - field_label: "first".to_string(), - }, - inputs: vec![PortId(550)], - output: PortId(551), - span: SourceSpan::new("src/v3/std/algebra.dag", 22286, 22291), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(488), - target: TransformTarget::ResolvedFieldProject { - field_label: "second".to_string(), - }, - inputs: vec![PortId(550)], - output: PortId(552), - span: SourceSpan::new("src/v3/std/algebra.dag", 22304, 22310), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(489), - target: TransformTarget::ResolvedFieldProject { - field_label: "rest".to_string(), - }, - inputs: vec![PortId(550)], - output: PortId(553), - span: SourceSpan::new("src/v3/std/algebra.dag", 22318, 22322), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(490), - target: TransformTarget::Callable(DeclarationId(1840)), - inputs: vec![PortId(552), PortId(553)], - output: PortId(554), - span: SourceSpan::new("src/v3/std/algebra.dag", 22293, 22323), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(491), - target: TransformTarget::Callable(DeclarationId(1841)), - inputs: vec![PortId(551), PortId(554)], - output: PortId(555), - span: SourceSpan::new("src/v3/std/algebra.dag", 22275, 22324), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(492), - name: "nsl_to_list".to_string(), - value: PortId(555), - params: vec![PortId(550)], - span: SourceSpan::new("src/v3/std/algebra.dag", 22275, 22324), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(493), - target: TransformTarget::Callable(DeclarationId(1842)), - inputs: vec![], - output: PortId(557), - span: SourceSpan::new("src/v3/std/algebra.dag", 22603, 22610), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(494), - target: TransformTarget::UnresolvedFieldProject { - field_label: "head".to_string(), - }, - inputs: vec![PortId(558)], - output: PortId(559), - span: SourceSpan::new("src/v3/std/algebra.dag", 22666, 22670), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(495), - target: TransformTarget::Callable(DeclarationId(946)), - inputs: vec![PortId(559)], - output: PortId(560), - span: SourceSpan::new("src/v3/std/algebra.dag", 22641, 22671), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(496), - target: TransformTarget::UnresolvedFieldProject { - field_label: "tail".to_string(), - }, - inputs: vec![PortId(558)], - output: PortId(561), - span: SourceSpan::new("src/v3/std/algebra.dag", 22712, 22716), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(497), - target: TransformTarget::Callable(DeclarationId(942)), - inputs: vec![PortId(561)], - output: PortId(562), - span: SourceSpan::new("src/v3/std/algebra.dag", 22685, 22717), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(498), - target: TransformTarget::UnresolvedFieldProject { - field_label: "head".to_string(), - }, - inputs: vec![PortId(558)], - output: PortId(563), - span: SourceSpan::new("src/v3/std/algebra.dag", 22750, 22754), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(499), - target: TransformTarget::UnresolvedFieldProject { - field_label: "tail".to_string(), - }, - inputs: vec![PortId(558)], - output: PortId(564), - span: SourceSpan::new("src/v3/std/algebra.dag", 22783, 22787), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(500), - target: TransformTarget::Callable(DeclarationId(942)), - inputs: vec![PortId(564)], - output: PortId(565), - span: SourceSpan::new("src/v3/std/algebra.dag", 22756, 22788), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(501), - target: TransformTarget::Callable(DeclarationId(1843)), - inputs: vec![PortId(563), PortId(565)], - output: PortId(566), - span: SourceSpan::new("src/v3/std/algebra.dag", 22737, 22789), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(502), - input: PortId(560), - paths: vec![ - Path { - body: NodeId(497), - output: PortId(562), - pattern: BranchPattern::UnresolvedVariant { - name: "True".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 22685, 22717), - }, - binding: None, - }, - Path { - body: NodeId(501), - output: PortId(566), - pattern: BranchPattern::UnresolvedVariant { - name: "False".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 22737, 22789), - }, - binding: None, - }, - ], - output: PortId(567), - span: SourceSpan::new("src/v3/std/algebra.dag", 22638, 22789), - emit_participation: None, - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(503), - input: PortId(556), - paths: vec![ - Path { - body: NodeId(493), - output: PortId(557), - pattern: BranchPattern::UnresolvedVariant { - name: "Empty".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 22594, 22599), - }, - binding: None, - }, - Path { - body: NodeId(502), - output: PortId(567), - pattern: BranchPattern::UnresolvedVariant { - name: "Cons".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 22615, 22628), - }, - binding: Some(PayloadBinding { - binding_name: "payload".to_string(), - payload_port: PortId(558), - }), - }, - ], - output: PortId(568), - span: SourceSpan::new("src/v3/std/algebra.dag", 22576, 22793), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Loop(LoopNode { - id: NodeId(504), - source: PortId(556), - init: PortId(556), - body: NodeId(503), - bound: LoopBound::Cardinality { count: PortId(556) }, - output: PortId(569), - span: SourceSpan::new("src/v3/std/algebra.dag", 22576, 22793), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(505), - name: "drop_additive_zero".to_string(), - value: PortId(569), - params: vec![PortId(556)], - span: SourceSpan::new("src/v3/std/algebra.dag", 22576, 22793), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(506), - target: TransformTarget::Callable(DeclarationId(944)), - inputs: vec![PortId(570)], - output: PortId(571), - span: SourceSpan::new("src/v3/std/algebra.dag", 23093, 23108), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(507), - data: LiteralBits::Int("0".to_string()), - output: PortId(572), - span: SourceSpan::new("src/v3/std/algebra.dag", 23136, 23137), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(508), - target: TransformTarget::Callable(DeclarationId(1811)), - inputs: vec![PortId(572)], - output: PortId(573), - span: SourceSpan::new("src/v3/std/algebra.dag", 23123, 23138), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(509), - target: TransformTarget::Callable(DeclarationId(1844)), - inputs: vec![], - output: PortId(574), - span: SourceSpan::new("src/v3/std/algebra.dag", 23140, 23147), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(510), - target: TransformTarget::Callable(DeclarationId(1845)), - inputs: vec![PortId(573), PortId(574)], - output: PortId(575), - span: SourceSpan::new("src/v3/std/algebra.dag", 23118, 23148), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(511), - input: PortId(571), - paths: vec![ - Path { - body: NodeId(510), - output: PortId(575), - pattern: BranchPattern::UnresolvedVariant { - name: "True".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 23118, 23148), - }, - binding: None, - }, - Path { - body: NodeId(511), - output: PortId(570), - pattern: BranchPattern::UnresolvedVariant { - name: "False".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 23160, 23165), - }, - binding: None, - }, - ], - output: PortId(576), - span: SourceSpan::new("src/v3/std/algebra.dag", 23090, 23165), - emit_participation: None, - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(512), - name: "collapse_on_multiplicative_zero".to_string(), - value: PortId(576), - params: vec![PortId(570)], - span: SourceSpan::new("src/v3/std/algebra.dag", 23090, 23165), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(513), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(578), - span: SourceSpan::new("src/v3/std/algebra.dag", 23245, 23250), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(514), - target: TransformTarget::UnresolvedFieldProject { - field_label: "head".to_string(), - }, - inputs: vec![PortId(579)], - output: PortId(580), - span: SourceSpan::new("src/v3/std/algebra.dag", 23297, 23301), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(515), - target: TransformTarget::Callable(DeclarationId(946)), - inputs: vec![PortId(580)], - output: PortId(581), - span: SourceSpan::new("src/v3/std/algebra.dag", 23272, 23302), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(516), - target: TransformTarget::UnresolvedFieldProject { - field_label: "tail".to_string(), - }, - inputs: vec![PortId(579)], - output: PortId(582), - span: SourceSpan::new("src/v3/std/algebra.dag", 23323, 23327), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(517), - target: TransformTarget::Callable(DeclarationId(944)), - inputs: vec![PortId(582)], - output: PortId(583), - span: SourceSpan::new("src/v3/std/algebra.dag", 23306, 23328), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(518), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::Or)), - inputs: vec![PortId(581), PortId(583)], - output: PortId(584), - span: SourceSpan::new("src/v3/std/algebra.dag", 23272, 23328), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(519), - input: PortId(577), - paths: vec![ - Path { - body: NodeId(513), - output: PortId(578), - pattern: BranchPattern::UnresolvedVariant { - name: "Empty".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 23236, 23241), - }, - binding: None, - }, - Path { - body: NodeId(518), - output: PortId(584), - pattern: BranchPattern::UnresolvedVariant { - name: "Cons".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 23255, 23268), - }, - binding: Some(PayloadBinding { - binding_name: "payload".to_string(), - payload_port: PortId(579), - }), - }, - ], - output: PortId(585), - span: SourceSpan::new("src/v3/std/algebra.dag", 23218, 23332), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Loop(LoopNode { - id: NodeId(520), - source: PortId(577), - init: PortId(577), - body: NodeId(519), - bound: LoopBound::Cardinality { count: PortId(577) }, - output: PortId(586), - span: SourceSpan::new("src/v3/std/algebra.dag", 23218, 23332), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(521), - name: "any_zero".to_string(), - value: PortId(586), - params: vec![PortId(577)], - span: SourceSpan::new("src/v3/std/algebra.dag", 23218, 23332), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(522), - target: TransformTarget::Callable(DeclarationId(1846)), - inputs: vec![], - output: PortId(588), - span: SourceSpan::new("src/v3/std/algebra.dag", 23597, 23604), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(523), - target: TransformTarget::UnresolvedFieldProject { - field_label: "head".to_string(), - }, - inputs: vec![PortId(589)], - output: PortId(590), - span: SourceSpan::new("src/v3/std/algebra.dag", 23659, 23663), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(524), - target: TransformTarget::Callable(DeclarationId(947)), - inputs: vec![PortId(590)], - output: PortId(591), - span: SourceSpan::new("src/v3/std/algebra.dag", 23635, 23664), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(525), - target: TransformTarget::UnresolvedFieldProject { - field_label: "tail".to_string(), - }, - inputs: vec![PortId(589)], - output: PortId(592), - span: SourceSpan::new("src/v3/std/algebra.dag", 23710, 23714), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(526), - target: TransformTarget::Callable(DeclarationId(945)), - inputs: vec![PortId(592)], - output: PortId(593), - span: SourceSpan::new("src/v3/std/algebra.dag", 23678, 23715), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(527), - target: TransformTarget::UnresolvedFieldProject { - field_label: "head".to_string(), - }, - inputs: vec![PortId(589)], - output: PortId(594), - span: SourceSpan::new("src/v3/std/algebra.dag", 23748, 23752), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(528), - target: TransformTarget::UnresolvedFieldProject { - field_label: "tail".to_string(), - }, - inputs: vec![PortId(589)], - output: PortId(595), - span: SourceSpan::new("src/v3/std/algebra.dag", 23786, 23790), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(529), - target: TransformTarget::Callable(DeclarationId(945)), - inputs: vec![PortId(595)], - output: PortId(596), - span: SourceSpan::new("src/v3/std/algebra.dag", 23754, 23791), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(530), - target: TransformTarget::Callable(DeclarationId(1847)), - inputs: vec![PortId(594), PortId(596)], - output: PortId(597), - span: SourceSpan::new("src/v3/std/algebra.dag", 23735, 23792), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(531), - input: PortId(591), - paths: vec![ - Path { - body: NodeId(526), - output: PortId(593), - pattern: BranchPattern::UnresolvedVariant { - name: "True".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 23678, 23715), - }, - binding: None, - }, - Path { - body: NodeId(530), - output: PortId(597), - pattern: BranchPattern::UnresolvedVariant { - name: "False".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 23735, 23792), - }, - binding: None, - }, - ], - output: PortId(598), - span: SourceSpan::new("src/v3/std/algebra.dag", 23632, 23792), - emit_participation: None, - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(532), - input: PortId(587), - paths: vec![ - Path { - body: NodeId(522), - output: PortId(588), - pattern: BranchPattern::UnresolvedVariant { - name: "Empty".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 23588, 23593), - }, - binding: None, - }, - Path { - body: NodeId(531), - output: PortId(598), - pattern: BranchPattern::UnresolvedVariant { - name: "Cons".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 23609, 23622), - }, - binding: Some(PayloadBinding { - binding_name: "payload".to_string(), - payload_port: PortId(589), - }), - }, - ], - output: PortId(599), - span: SourceSpan::new("src/v3/std/algebra.dag", 23570, 23796), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Loop(LoopNode { - id: NodeId(533), - source: PortId(587), - init: PortId(587), - body: NodeId(532), - bound: LoopBound::Cardinality { count: PortId(587) }, - output: PortId(600), - span: SourceSpan::new("src/v3/std/algebra.dag", 23570, 23796), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(534), - name: "drop_multiplicative_one".to_string(), - value: PortId(600), - params: vec![PortId(587)], - span: SourceSpan::new("src/v3/std/algebra.dag", 23570, 23796), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(535), - data: LiteralBits::Int("0".to_string()), - output: PortId(603), - span: SourceSpan::new("src/v3/std/algebra.dag", 23885, 23886), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(536), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(602), PortId(603)], - output: PortId(604), - span: SourceSpan::new("src/v3/std/algebra.dag", 23880, 23886), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(537), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(606), - span: SourceSpan::new("src/v3/std/algebra.dag", 23908, 23913), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(538), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(608), - span: SourceSpan::new("src/v3/std/algebra.dag", 23939, 23944), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(539), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(610), - span: SourceSpan::new("src/v3/std/algebra.dag", 23967, 23972), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(540), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(612), - span: SourceSpan::new("src/v3/std/algebra.dag", 23991, 23996), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(541), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(614), - span: SourceSpan::new("src/v3/std/algebra.dag", 24015, 24020), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(542), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(616), - span: SourceSpan::new("src/v3/std/algebra.dag", 24043, 24048), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(543), - input: PortId(601), - paths: vec![ - Path { - body: NodeId(536), - output: PortId(604), - pattern: BranchPattern::UnresolvedVariant { - name: "ConstantCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 23861, 23876), - }, - binding: Some(PayloadBinding { - binding_name: "n".to_string(), - payload_port: PortId(602), - }), - }, - Path { - body: NodeId(537), - output: PortId(606), - pattern: BranchPattern::UnresolvedVariant { - name: "LinearCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 23891, 23904), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(605), - }), - }, - Path { - body: NodeId(538), - output: PortId(608), - pattern: BranchPattern::UnresolvedVariant { - name: "PolynomialCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 23918, 23935), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(607), - }), - }, - Path { - body: NodeId(539), - output: PortId(610), - pattern: BranchPattern::UnresolvedVariant { - name: "ProductCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 23949, 23963), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(609), - }), - }, - Path { - body: NodeId(540), - output: PortId(612), - pattern: BranchPattern::UnresolvedVariant { - name: "SumCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 23977, 23987), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(611), - }), - }, - Path { - body: NodeId(541), - output: PortId(614), - pattern: BranchPattern::UnresolvedVariant { - name: "LogCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 24001, 24011), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(613), - }), - }, - Path { - body: NodeId(542), - output: PortId(616), - pattern: BranchPattern::UnresolvedVariant { - name: "UnknownCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 24025, 24039), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(615), - }), - }, - ], - output: PortId(617), - span: SourceSpan::new("src/v3/std/algebra.dag", 23847, 24052), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(544), - name: "is_zero_constant".to_string(), - value: PortId(617), - params: vec![PortId(601)], - span: SourceSpan::new("src/v3/std/algebra.dag", 23847, 24052), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(545), - data: LiteralBits::Int("1".to_string()), - output: PortId(620), - span: SourceSpan::new("src/v3/std/algebra.dag", 24140, 24141), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(546), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(619), PortId(620)], - output: PortId(621), - span: SourceSpan::new("src/v3/std/algebra.dag", 24135, 24141), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(547), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(623), - span: SourceSpan::new("src/v3/std/algebra.dag", 24163, 24168), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(548), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(625), - span: SourceSpan::new("src/v3/std/algebra.dag", 24194, 24199), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(549), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(627), - span: SourceSpan::new("src/v3/std/algebra.dag", 24222, 24227), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(550), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(629), - span: SourceSpan::new("src/v3/std/algebra.dag", 24246, 24251), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(551), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(631), - span: SourceSpan::new("src/v3/std/algebra.dag", 24270, 24275), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(552), - target: TransformTarget::Callable(DeclarationId(531)), - inputs: vec![], - output: PortId(633), - span: SourceSpan::new("src/v3/std/algebra.dag", 24298, 24303), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(553), - input: PortId(618), - paths: vec![ - Path { - body: NodeId(546), - output: PortId(621), - pattern: BranchPattern::UnresolvedVariant { - name: "ConstantCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 24116, 24131), - }, - binding: Some(PayloadBinding { - binding_name: "n".to_string(), - payload_port: PortId(619), - }), - }, - Path { - body: NodeId(547), - output: PortId(623), - pattern: BranchPattern::UnresolvedVariant { - name: "LinearCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 24146, 24159), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(622), - }), - }, - Path { - body: NodeId(548), - output: PortId(625), - pattern: BranchPattern::UnresolvedVariant { - name: "PolynomialCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 24173, 24190), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(624), - }), - }, - Path { - body: NodeId(549), - output: PortId(627), - pattern: BranchPattern::UnresolvedVariant { - name: "ProductCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 24204, 24218), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(626), - }), - }, - Path { - body: NodeId(550), - output: PortId(629), - pattern: BranchPattern::UnresolvedVariant { - name: "SumCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 24232, 24242), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(628), - }), - }, - Path { - body: NodeId(551), - output: PortId(631), - pattern: BranchPattern::UnresolvedVariant { - name: "LogCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 24256, 24266), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(630), - }), - }, - Path { - body: NodeId(552), - output: PortId(633), - pattern: BranchPattern::UnresolvedVariant { - name: "UnknownCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 24280, 24294), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(632), - }), - }, - ], - output: PortId(634), - span: SourceSpan::new("src/v3/std/algebra.dag", 24102, 24307), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(554), - name: "is_one_constant".to_string(), - value: PortId(634), - params: vec![PortId(618)], - span: SourceSpan::new("src/v3/std/algebra.dag", 24102, 24307), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(555), - data: LiteralBits::Int("0".to_string()), - output: PortId(636), - span: SourceSpan::new("src/v3/std/algebra.dag", 25193, 25194), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(556), - target: TransformTarget::Callable(DeclarationId(1811)), - inputs: vec![PortId(636)], - output: PortId(637), - span: SourceSpan::new("src/v3/std/algebra.dag", 25180, 25195), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(557), - target: TransformTarget::UnresolvedFieldProject { - field_label: "tail".to_string(), - }, - inputs: vec![PortId(638)], - output: PortId(639), - span: SourceSpan::new("src/v3/std/algebra.dag", 25237, 25241), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(558), - target: TransformTarget::UnresolvedFieldProject { - field_label: "head".to_string(), - }, - inputs: vec![PortId(638)], - output: PortId(640), - span: SourceSpan::new("src/v3/std/algebra.dag", 25269, 25273), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(559), - target: TransformTarget::UnresolvedFieldProject { - field_label: "head".to_string(), - }, - inputs: vec![PortId(638)], - output: PortId(642), - span: SourceSpan::new("src/v3/std/algebra.dag", 25330, 25334), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(560), - target: TransformTarget::UnresolvedFieldProject { - field_label: "tail".to_string(), - }, - inputs: vec![PortId(638)], - output: PortId(643), - span: SourceSpan::new("src/v3/std/algebra.dag", 25344, 25348), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(561), - target: TransformTarget::Callable(DeclarationId(1848)), - inputs: vec![PortId(642), PortId(643)], - output: PortId(644), - span: SourceSpan::new("src/v3/std/algebra.dag", 25317, 25349), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(562), - target: TransformTarget::Callable(DeclarationId(960)), - inputs: vec![PortId(644)], - output: PortId(645), - span: SourceSpan::new("src/v3/std/algebra.dag", 25302, 25350), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(563), - target: TransformTarget::Callable(DeclarationId(949)), - inputs: vec![PortId(645)], - output: PortId(646), - span: SourceSpan::new("src/v3/std/algebra.dag", 25293, 25351), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(564), - input: PortId(639), - paths: vec![ - Path { - body: NodeId(558), - output: PortId(640), - pattern: BranchPattern::UnresolvedVariant { - name: "Empty".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 25252, 25257), - }, - binding: None, - }, - Path { - body: NodeId(563), - output: PortId(646), - pattern: BranchPattern::UnresolvedVariant { - name: "Cons".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 25282, 25289), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(641), - }), - }, - ], - output: PortId(647), - span: SourceSpan::new("src/v3/std/algebra.dag", 25223, 25359), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(565), - input: PortId(635), - paths: vec![ - Path { - body: NodeId(556), - output: PortId(637), - pattern: BranchPattern::UnresolvedVariant { - name: "Empty".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 25171, 25176), - }, - binding: None, - }, - Path { - body: NodeId(564), - output: PortId(647), - pattern: BranchPattern::UnresolvedVariant { - name: "Cons".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 25200, 25213), - }, - binding: Some(PayloadBinding { - binding_name: "payload".to_string(), - payload_port: PortId(638), - }), - }, - ], - output: PortId(648), - span: SourceSpan::new("src/v3/std/algebra.dag", 25153, 25363), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(566), - name: "reduce_sum".to_string(), - value: PortId(648), - params: vec![PortId(635)], - span: SourceSpan::new("src/v3/std/algebra.dag", 25153, 25363), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(567), - data: LiteralBits::Int("0".to_string()), - output: PortId(650), - span: SourceSpan::new("src/v3/std/algebra.dag", 25464, 25465), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(568), - target: TransformTarget::Callable(DeclarationId(1811)), - inputs: vec![PortId(650)], - output: PortId(651), - span: SourceSpan::new("src/v3/std/algebra.dag", 25451, 25466), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(569), - target: TransformTarget::UnresolvedFieldProject { - field_label: "tail".to_string(), - }, - inputs: vec![PortId(652)], - output: PortId(653), - span: SourceSpan::new("src/v3/std/algebra.dag", 25508, 25512), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(570), - target: TransformTarget::UnresolvedFieldProject { - field_label: "head".to_string(), - }, - inputs: vec![PortId(652)], - output: PortId(654), - span: SourceSpan::new("src/v3/std/algebra.dag", 25540, 25544), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(571), - target: TransformTarget::UnresolvedFieldProject { - field_label: "head".to_string(), - }, - inputs: vec![PortId(652)], - output: PortId(656), - span: SourceSpan::new("src/v3/std/algebra.dag", 25596, 25600), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(572), - target: TransformTarget::UnresolvedFieldProject { - field_label: "head".to_string(), - }, - inputs: vec![PortId(655)], - output: PortId(657), - span: SourceSpan::new("src/v3/std/algebra.dag", 25609, 25613), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(573), - target: TransformTarget::UnresolvedFieldProject { - field_label: "tail".to_string(), - }, - inputs: vec![PortId(655)], - output: PortId(658), - span: SourceSpan::new("src/v3/std/algebra.dag", 25622, 25626), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(574), - target: TransformTarget::Callable(DeclarationId(925)), - inputs: vec![PortId(656), PortId(657), PortId(658)], - output: PortId(659), - span: SourceSpan::new("src/v3/std/algebra.dag", 25577, 25627), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(575), - target: TransformTarget::Callable(DeclarationId(1817)), - inputs: vec![PortId(659)], - output: PortId(660), - span: SourceSpan::new("src/v3/std/algebra.dag", 25569, 25628), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(576), - input: PortId(653), - paths: vec![ - Path { - body: NodeId(570), - output: PortId(654), - pattern: BranchPattern::UnresolvedVariant { - name: "Empty".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 25523, 25528), - }, - binding: None, - }, - Path { - body: NodeId(575), - output: PortId(660), - pattern: BranchPattern::UnresolvedVariant { - name: "Cons".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 25553, 25565), - }, - binding: Some(PayloadBinding { - binding_name: "second".to_string(), - payload_port: PortId(655), - }), - }, - ], - output: PortId(661), - span: SourceSpan::new("src/v3/std/algebra.dag", 25494, 25636), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(577), - input: PortId(649), - paths: vec![ - Path { - body: NodeId(568), - output: PortId(651), - pattern: BranchPattern::UnresolvedVariant { - name: "Empty".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 25442, 25447), - }, - binding: None, - }, - Path { - body: NodeId(576), - output: PortId(661), - pattern: BranchPattern::UnresolvedVariant { - name: "Cons".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 25471, 25484), - }, - binding: Some(PayloadBinding { - binding_name: "payload".to_string(), - payload_port: PortId(652), - }), - }, - ], - output: PortId(662), - span: SourceSpan::new("src/v3/std/algebra.dag", 25424, 25640), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(578), - name: "wrap_sum".to_string(), - value: PortId(662), - params: vec![PortId(649)], - span: SourceSpan::new("src/v3/std/algebra.dag", 25424, 25640), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(579), - data: LiteralBits::Int("1".to_string()), - output: PortId(664), - span: SourceSpan::new("src/v3/std/algebra.dag", 25930, 25931), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(580), - target: TransformTarget::Callable(DeclarationId(1811)), - inputs: vec![PortId(664)], - output: PortId(665), - span: SourceSpan::new("src/v3/std/algebra.dag", 25917, 25932), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(581), - target: TransformTarget::UnresolvedFieldProject { - field_label: "tail".to_string(), - }, - inputs: vec![PortId(666)], - output: PortId(667), - span: SourceSpan::new("src/v3/std/algebra.dag", 25974, 25978), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(582), - target: TransformTarget::UnresolvedFieldProject { - field_label: "head".to_string(), - }, - inputs: vec![PortId(666)], - output: PortId(668), - span: SourceSpan::new("src/v3/std/algebra.dag", 26006, 26010), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(583), - target: TransformTarget::UnresolvedFieldProject { - field_label: "tail".to_string(), - }, - inputs: vec![PortId(669)], - output: PortId(670), - span: SourceSpan::new("src/v3/std/algebra.dag", 26058, 26062), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(584), - target: TransformTarget::UnresolvedFieldProject { - field_label: "head".to_string(), - }, - inputs: vec![PortId(666)], - output: PortId(671), - span: SourceSpan::new("src/v3/std/algebra.dag", 26117, 26121), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(585), - target: TransformTarget::UnresolvedFieldProject { - field_label: "head".to_string(), - }, - inputs: vec![PortId(669)], - output: PortId(672), - span: SourceSpan::new("src/v3/std/algebra.dag", 26130, 26134), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(586), - target: TransformTarget::Callable(DeclarationId(951)), - inputs: vec![PortId(671), PortId(672)], - output: PortId(673), - span: SourceSpan::new("src/v3/std/algebra.dag", 26086, 26135), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(587), - target: TransformTarget::UnresolvedFieldProject { - field_label: "head".to_string(), - }, - inputs: vec![PortId(666)], - output: PortId(675), - span: SourceSpan::new("src/v3/std/algebra.dag", 26190, 26194), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(588), - target: TransformTarget::UnresolvedFieldProject { - field_label: "head".to_string(), - }, - inputs: vec![PortId(669)], - output: PortId(676), - span: SourceSpan::new("src/v3/std/algebra.dag", 26203, 26207), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(589), - target: TransformTarget::UnresolvedFieldProject { - field_label: "tail".to_string(), - }, - inputs: vec![PortId(669)], - output: PortId(677), - span: SourceSpan::new("src/v3/std/algebra.dag", 26216, 26220), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(590), - target: TransformTarget::Callable(DeclarationId(925)), - inputs: vec![PortId(675), PortId(676), PortId(677)], - output: PortId(678), - span: SourceSpan::new("src/v3/std/algebra.dag", 26171, 26221), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(591), - target: TransformTarget::Callable(DeclarationId(1815)), - inputs: vec![PortId(678)], - output: PortId(679), - span: SourceSpan::new("src/v3/std/algebra.dag", 26159, 26222), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(592), - input: PortId(670), - paths: vec![ - Path { - body: NodeId(586), - output: PortId(673), - pattern: BranchPattern::UnresolvedVariant { - name: "Empty".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 26077, 26082), - }, - binding: None, - }, - Path { - body: NodeId(591), - output: PortId(679), - pattern: BranchPattern::UnresolvedVariant { - name: "Cons".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 26148, 26155), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(674), - }), - }, - ], - output: PortId(680), - span: SourceSpan::new("src/v3/std/algebra.dag", 26045, 26234), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(593), - input: PortId(667), - paths: vec![ - Path { - body: NodeId(582), - output: PortId(668), - pattern: BranchPattern::UnresolvedVariant { - name: "Empty".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 25989, 25994), - }, - binding: None, - }, - Path { - body: NodeId(592), - output: PortId(680), - pattern: BranchPattern::UnresolvedVariant { - name: "Cons".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 26019, 26031), - }, - binding: Some(PayloadBinding { - binding_name: "second".to_string(), - payload_port: PortId(669), - }), - }, - ], - output: PortId(681), - span: SourceSpan::new("src/v3/std/algebra.dag", 25960, 26242), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(594), - input: PortId(663), - paths: vec![ - Path { - body: NodeId(580), - output: PortId(665), - pattern: BranchPattern::UnresolvedVariant { - name: "Empty".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 25908, 25913), - }, - binding: None, - }, - Path { - body: NodeId(593), - output: PortId(681), - pattern: BranchPattern::UnresolvedVariant { - name: "Cons".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 25937, 25950), - }, - binding: Some(PayloadBinding { - binding_name: "payload".to_string(), - payload_port: PortId(666), - }), - }, - ], - output: PortId(682), - span: SourceSpan::new("src/v3/std/algebra.dag", 25890, 26246), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(595), - name: "reduce_product".to_string(), - value: PortId(682), - params: vec![PortId(663)], - span: SourceSpan::new("src/v3/std/algebra.dag", 25890, 26246), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(596), - target: TransformTarget::Callable(DeclarationId(952)), - inputs: vec![PortId(685), PortId(683), PortId(684)], - output: PortId(686), - span: SourceSpan::new("src/v3/std/algebra.dag", 26523, 26552), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(597), - target: TransformTarget::Callable(DeclarationId(955)), - inputs: vec![PortId(683), PortId(684)], - output: PortId(688), - span: SourceSpan::new("src/v3/std/algebra.dag", 26576, 26594), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(598), - target: TransformTarget::Callable(DeclarationId(955)), - inputs: vec![PortId(683), PortId(684)], - output: PortId(690), - span: SourceSpan::new("src/v3/std/algebra.dag", 26620, 26638), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(599), - target: TransformTarget::Callable(DeclarationId(955)), - inputs: vec![PortId(683), PortId(684)], - output: PortId(692), - span: SourceSpan::new("src/v3/std/algebra.dag", 26657, 26675), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(600), - target: TransformTarget::Callable(DeclarationId(955)), - inputs: vec![PortId(683), PortId(684)], - output: PortId(694), - span: SourceSpan::new("src/v3/std/algebra.dag", 26694, 26712), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(601), - target: TransformTarget::Callable(DeclarationId(955)), - inputs: vec![PortId(683), PortId(684)], - output: PortId(696), - span: SourceSpan::new("src/v3/std/algebra.dag", 26735, 26753), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(602), - target: TransformTarget::Callable(DeclarationId(955)), - inputs: vec![PortId(683), PortId(684)], - output: PortId(698), - span: SourceSpan::new("src/v3/std/algebra.dag", 26776, 26794), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(603), - input: PortId(683), - paths: vec![ - Path { - body: NodeId(596), - output: PortId(686), - pattern: BranchPattern::UnresolvedVariant { - name: "LinearCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 26505, 26519), - }, - binding: Some(PayloadBinding { - binding_name: "va".to_string(), - payload_port: PortId(685), - }), - }, - Path { - body: NodeId(597), - output: PortId(688), - pattern: BranchPattern::UnresolvedVariant { - name: "ConstantCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 26557, 26572), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(687), - }), - }, - Path { - body: NodeId(598), - output: PortId(690), - pattern: BranchPattern::UnresolvedVariant { - name: "PolynomialCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 26599, 26616), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(689), - }), - }, - Path { - body: NodeId(599), - output: PortId(692), - pattern: BranchPattern::UnresolvedVariant { - name: "LogCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 26643, 26653), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(691), - }), - }, - Path { - body: NodeId(600), - output: PortId(694), - pattern: BranchPattern::UnresolvedVariant { - name: "SumCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 26680, 26690), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(693), - }), - }, - Path { - body: NodeId(601), - output: PortId(696), - pattern: BranchPattern::UnresolvedVariant { - name: "ProductCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 26717, 26731), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(695), - }), - }, - Path { - body: NodeId(602), - output: PortId(698), - pattern: BranchPattern::UnresolvedVariant { - name: "UnknownCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 26758, 26772), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(697), - }), - }, - ], - output: PortId(699), - span: SourceSpan::new("src/v3/std/algebra.dag", 26491, 26798), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(604), - name: "combine_binary_product".to_string(), - value: PortId(699), - params: vec![PortId(683), PortId(684)], - span: SourceSpan::new("src/v3/std/algebra.dag", 26491, 26798), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(605), - target: TransformTarget::Callable(DeclarationId(953)), - inputs: vec![PortId(700), PortId(703), PortId(701), PortId(702)], - output: PortId(704), - span: SourceSpan::new("src/v3/std/algebra.dag", 26927, 26963), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(606), - target: TransformTarget::Callable(DeclarationId(955)), - inputs: vec![PortId(701), PortId(702)], - output: PortId(706), - span: SourceSpan::new("src/v3/std/algebra.dag", 26987, 27005), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(607), - target: TransformTarget::Callable(DeclarationId(955)), - inputs: vec![PortId(701), PortId(702)], - output: PortId(708), - span: SourceSpan::new("src/v3/std/algebra.dag", 27031, 27049), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(608), - target: TransformTarget::Callable(DeclarationId(955)), - inputs: vec![PortId(701), PortId(702)], - output: PortId(710), - span: SourceSpan::new("src/v3/std/algebra.dag", 27068, 27086), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(609), - target: TransformTarget::Callable(DeclarationId(955)), - inputs: vec![PortId(701), PortId(702)], - output: PortId(712), - span: SourceSpan::new("src/v3/std/algebra.dag", 27105, 27123), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(610), - target: TransformTarget::Callable(DeclarationId(955)), - inputs: vec![PortId(701), PortId(702)], - output: PortId(714), - span: SourceSpan::new("src/v3/std/algebra.dag", 27146, 27164), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(611), - target: TransformTarget::Callable(DeclarationId(955)), - inputs: vec![PortId(701), PortId(702)], - output: PortId(716), - span: SourceSpan::new("src/v3/std/algebra.dag", 27187, 27205), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(612), - input: PortId(702), - paths: vec![ - Path { - body: NodeId(605), - output: PortId(704), - pattern: BranchPattern::UnresolvedVariant { - name: "LinearCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 26909, 26923), - }, - binding: Some(PayloadBinding { - binding_name: "vb".to_string(), - payload_port: PortId(703), - }), - }, - Path { - body: NodeId(606), - output: PortId(706), - pattern: BranchPattern::UnresolvedVariant { - name: "ConstantCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 26968, 26983), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(705), - }), - }, - Path { - body: NodeId(607), - output: PortId(708), - pattern: BranchPattern::UnresolvedVariant { - name: "PolynomialCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 27010, 27027), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(707), - }), - }, - Path { - body: NodeId(608), - output: PortId(710), - pattern: BranchPattern::UnresolvedVariant { - name: "LogCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 27054, 27064), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(709), - }), - }, - Path { - body: NodeId(609), - output: PortId(712), - pattern: BranchPattern::UnresolvedVariant { - name: "SumCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 27091, 27101), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(711), - }), - }, - Path { - body: NodeId(610), - output: PortId(714), - pattern: BranchPattern::UnresolvedVariant { - name: "ProductCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 27128, 27142), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(713), - }), - }, - Path { - body: NodeId(611), - output: PortId(716), - pattern: BranchPattern::UnresolvedVariant { - name: "UnknownCost".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 27169, 27183), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(715), - }), - }, - ], - output: PortId(717), - span: SourceSpan::new("src/v3/std/algebra.dag", 26895, 27209), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(613), - name: "combine_linear_with".to_string(), - value: PortId(717), - params: vec![PortId(700), PortId(701), PortId(702)], - span: SourceSpan::new("src/v3/std/algebra.dag", 26895, 27209), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(614), - target: TransformTarget::Callable(DeclarationId(934)), - inputs: vec![PortId(718), PortId(719)], - output: PortId(722), - span: SourceSpan::new("src/v3/std/algebra.dag", 27340, 27366), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(615), - target: TransformTarget::Callable(DeclarationId(954)), - inputs: vec![PortId(718)], - output: PortId(723), - span: SourceSpan::new("src/v3/std/algebra.dag", 27376, 27397), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(616), - target: TransformTarget::Callable(DeclarationId(955)), - inputs: vec![PortId(720), PortId(721)], - output: PortId(724), - span: SourceSpan::new("src/v3/std/algebra.dag", 27409, 27427), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(617), - input: PortId(722), - paths: vec![ - Path { - body: NodeId(615), - output: PortId(723), - pattern: BranchPattern::UnresolvedVariant { - name: "True".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 27376, 27397), - }, - binding: None, - }, - Path { - body: NodeId(616), - output: PortId(724), - pattern: BranchPattern::UnresolvedVariant { - name: "False".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 27409, 27427), - }, - binding: None, - }, - ], - output: PortId(725), - span: SourceSpan::new("src/v3/std/algebra.dag", 27337, 27427), - emit_participation: None, - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(618), - name: "collapse_linear_square".to_string(), - value: PortId(725), - params: vec![PortId(718), PortId(719), PortId(720), PortId(721)], - span: SourceSpan::new("src/v3/std/algebra.dag", 27337, 27427), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(619), - target: TransformTarget::Callable(DeclarationId(924)), - inputs: vec![PortId(726), PortId(727)], - output: PortId(728), - span: SourceSpan::new("src/v3/std/algebra.dag", 27617, 27632), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(620), - target: TransformTarget::Callable(DeclarationId(1815)), - inputs: vec![PortId(728)], - output: PortId(729), - span: SourceSpan::new("src/v3/std/algebra.dag", 27605, 27633), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(621), - name: "product_pair".to_string(), - value: PortId(729), - params: vec![PortId(726), PortId(727)], - span: SourceSpan::new("src/v3/std/algebra.dag", 27605, 27633), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(622), - target: TransformTarget::ResolvedFieldProject { - field_label: "any".to_string(), - }, - inputs: vec![PortId(730)], - output: PortId(732), - span: SourceSpan::new("src/v3/std/algebra.dag", 27733, 27736), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(623), - target: TransformTarget::ResolvedFieldProject { - field_label: "pivot".to_string(), - }, - inputs: vec![PortId(730)], - output: PortId(733), - span: SourceSpan::new("src/v3/std/algebra.dag", 27757, 27762), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(624), - target: TransformTarget::Callable(DeclarationId(933)), - inputs: vec![PortId(731), PortId(733)], - output: PortId(734), - span: SourceSpan::new("src/v3/std/algebra.dag", 27740, 27763), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(625), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::Or)), - inputs: vec![PortId(732), PortId(734)], - output: PortId(735), - span: SourceSpan::new("src/v3/std/algebra.dag", 27729, 27763), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(626), - target: TransformTarget::ResolvedFieldProject { - field_label: "pivot".to_string(), - }, - inputs: vec![PortId(730)], - output: PortId(736), - span: SourceSpan::new("src/v3/std/algebra.dag", 27777, 27782), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(627), - target: TransformTarget::Callable(DeclarationId(920)), - inputs: vec![PortId(735), PortId(736)], - output: PortId(737), - span: SourceSpan::new("src/v3/std/algebra.dag", 27720, 27784), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(628), - name: "fold_or_dominate_scan".to_string(), - value: PortId(737), - params: vec![PortId(730), PortId(731)], - span: SourceSpan::new("src/v3/std/algebra.dag", 27720, 27784), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(629), - target: TransformTarget::ResolvedFieldProject { - field_label: "any".to_string(), - }, - inputs: vec![PortId(738)], - output: PortId(739), - span: SourceSpan::new("src/v3/std/algebra.dag", 27838, 27841), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(630), - name: "scan_hit".to_string(), - value: PortId(739), - params: vec![PortId(738)], - span: SourceSpan::new("src/v3/std/algebra.dag", 27833, 27841), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(631), - target: TransformTarget::Callable(DeclarationId(1849)), - inputs: vec![], - output: PortId(742), - span: SourceSpan::new("src/v3/std/algebra.dag", 27988, 27995), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(632), - target: TransformTarget::UnresolvedFieldProject { - field_label: "head".to_string(), - }, - inputs: vec![PortId(743)], - output: PortId(744), - span: SourceSpan::new("src/v3/std/algebra.dag", 28052, 28056), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(633), - target: TransformTarget::Callable(DeclarationId(933)), - inputs: vec![PortId(741), PortId(744)], - output: PortId(745), - span: SourceSpan::new("src/v3/std/algebra.dag", 28026, 28057), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(634), - target: TransformTarget::UnresolvedFieldProject { - field_label: "tail".to_string(), - }, - inputs: vec![PortId(743)], - output: PortId(746), - span: SourceSpan::new("src/v3/std/algebra.dag", 28103, 28107), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(635), - target: TransformTarget::Callable(DeclarationId(958)), - inputs: vec![PortId(746), PortId(741)], - output: PortId(747), - span: SourceSpan::new("src/v3/std/algebra.dag", 28071, 28116), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(636), - target: TransformTarget::UnresolvedFieldProject { - field_label: "head".to_string(), - }, - inputs: vec![PortId(743)], - output: PortId(748), - span: SourceSpan::new("src/v3/std/algebra.dag", 28149, 28153), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(637), - target: TransformTarget::UnresolvedFieldProject { - field_label: "tail".to_string(), - }, - inputs: vec![PortId(743)], - output: PortId(749), - span: SourceSpan::new("src/v3/std/algebra.dag", 28187, 28191), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(638), - target: TransformTarget::Callable(DeclarationId(958)), - inputs: vec![PortId(749), PortId(741)], - output: PortId(750), - span: SourceSpan::new("src/v3/std/algebra.dag", 28155, 28200), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(639), - target: TransformTarget::Callable(DeclarationId(1850)), - inputs: vec![PortId(748), PortId(750)], - output: PortId(751), - span: SourceSpan::new("src/v3/std/algebra.dag", 28136, 28201), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(640), - input: PortId(745), - paths: vec![ - Path { - body: NodeId(635), - output: PortId(747), - pattern: BranchPattern::UnresolvedVariant { - name: "True".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 28071, 28116), - }, - binding: None, - }, - Path { - body: NodeId(639), - output: PortId(751), - pattern: BranchPattern::UnresolvedVariant { - name: "False".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 28136, 28201), - }, - binding: None, - }, - ], - output: PortId(752), - span: SourceSpan::new("src/v3/std/algebra.dag", 28023, 28201), - emit_participation: None, - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(641), - input: PortId(740), - paths: vec![ - Path { - body: NodeId(631), - output: PortId(742), - pattern: BranchPattern::UnresolvedVariant { - name: "Empty".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 27979, 27984), - }, - binding: None, - }, - Path { - body: NodeId(640), - output: PortId(752), - pattern: BranchPattern::UnresolvedVariant { - name: "Cons".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 28000, 28013), - }, - binding: Some(PayloadBinding { - binding_name: "payload".to_string(), - payload_port: PortId(743), - }), - }, - ], - output: PortId(753), - span: SourceSpan::new("src/v3/std/algebra.dag", 27956, 28205), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Loop(LoopNode { - id: NodeId(642), - source: PortId(740), - init: PortId(740), - body: NodeId(641), - bound: LoopBound::Cardinality { count: PortId(740) }, - output: PortId(754), - span: SourceSpan::new("src/v3/std/algebra.dag", 27956, 28205), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(643), - name: "filter_not_dominated_by".to_string(), - value: PortId(754), - params: vec![PortId(740), PortId(741)], - span: SourceSpan::new("src/v3/std/algebra.dag", 27956, 28205), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(644), - target: TransformTarget::Callable(DeclarationId(921)), - inputs: vec![PortId(756)], - output: PortId(757), - span: SourceSpan::new("src/v3/std/algebra.dag", 28329, 28353), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(645), - target: TransformTarget::Callable(DeclarationId(1852)), - inputs: vec![PortId(755), PortId(757)], - output: PortId(758), - span: SourceSpan::new("src/v3/std/algebra.dag", 28319, 28377), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(646), - target: TransformTarget::Callable(DeclarationId(957)), - inputs: vec![PortId(758)], - output: PortId(759), - span: SourceSpan::new("src/v3/std/algebra.dag", 28310, 28378), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(647), - target: TransformTarget::Callable(DeclarationId(958)), - inputs: vec![PortId(755), PortId(756)], - output: PortId(760), - span: SourceSpan::new("src/v3/std/algebra.dag", 28414, 28448), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(648), - target: TransformTarget::Callable(DeclarationId(1853)), - inputs: vec![PortId(756), PortId(760)], - output: PortId(761), - span: SourceSpan::new("src/v3/std/algebra.dag", 28403, 28449), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(649), - input: PortId(759), - paths: vec![ - Path { - body: NodeId(649), - output: PortId(755), - pattern: BranchPattern::UnresolvedVariant { - name: "True".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 28388, 28391), - }, - binding: None, - }, - Path { - body: NodeId(648), - output: PortId(761), - pattern: BranchPattern::UnresolvedVariant { - name: "False".to_string(), - span: SourceSpan::new("src/v3/std/algebra.dag", 28403, 28449), - }, - binding: None, - }, - ], - output: PortId(762), - span: SourceSpan::new("src/v3/std/algebra.dag", 28307, 28449), - emit_participation: None, - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(650), - name: "drop_dominated_step".to_string(), - value: PortId(762), - params: vec![PortId(755), PortId(756)], - span: SourceSpan::new("src/v3/std/algebra.dag", 28307, 28449), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(651), - target: TransformTarget::Callable(DeclarationId(1854)), - inputs: vec![], - output: PortId(764), - span: SourceSpan::new("src/v3/std/algebra.dag", 28720, 28727), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(652), - target: TransformTarget::Callable(DeclarationId(1856)), - inputs: vec![PortId(763), PortId(764)], - output: PortId(765), - span: SourceSpan::new("src/v3/std/algebra.dag", 28708, 28749), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(653), - name: "drop_dominated".to_string(), - value: PortId(765), - params: vec![PortId(763)], - span: SourceSpan::new("src/v3/std/algebra.dag", 28708, 28749), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(654), - data: LiteralBits::Int("0".to_string()), - output: PortId(767), - span: SourceSpan::new("src/v3/std/induction.dag", 31081, 31082), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(655), - target: TransformTarget::Callable(DeclarationId(1811)), - inputs: vec![PortId(767)], - output: PortId(768), - span: SourceSpan::new("src/v3/std/induction.dag", 31068, 31083), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(656), - target: TransformTarget::UnresolvedFieldProject { - field_label: "cost".to_string(), - }, - inputs: vec![PortId(769)], - output: PortId(770), - span: SourceSpan::new("src/v3/std/induction.dag", 31102, 31109), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(657), - target: TransformTarget::Callable(DeclarationId(1188)), - inputs: vec![PortId(770)], - output: PortId(771), - span: SourceSpan::new("src/v3/std/induction.dag", 31115, 31141), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(658), - target: TransformTarget::UnresolvedFieldProject { - field_label: "factors".to_string(), - }, - inputs: vec![PortId(772)], - output: PortId(773), - span: SourceSpan::new("src/v3/std/induction.dag", 31161, 31172), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(659), - target: TransformTarget::Callable(DeclarationId(1189)), - inputs: vec![PortId(773)], - output: PortId(774), - span: SourceSpan::new("src/v3/std/induction.dag", 31178, 31207), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(660), - target: TransformTarget::UnresolvedFieldProject { - field_label: "terms".to_string(), - }, - inputs: vec![PortId(775)], - output: PortId(776), - span: SourceSpan::new("src/v3/std/induction.dag", 31233, 31242), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(661), - target: TransformTarget::Callable(DeclarationId(1191)), - inputs: vec![PortId(776)], - output: PortId(777), - span: SourceSpan::new("src/v3/std/induction.dag", 31248, 31276), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(662), - target: TransformTarget::UnresolvedFieldProject { - field_label: "terms".to_string(), - }, - inputs: vec![PortId(778)], - output: PortId(779), - span: SourceSpan::new("src/v3/std/induction.dag", 31292, 31301), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(663), - data: LiteralBits::String( - "CostBound SumBound awaits non-recursive projection lowering".to_string(), - ), - output: PortId(780), - span: SourceSpan::new("src/v3/std/induction.dag", 31319, 31380), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(664), - target: TransformTarget::Callable(DeclarationId(1819)), - inputs: vec![PortId(780)], - output: PortId(781), - span: SourceSpan::new("src/v3/std/induction.dag", 31307, 31381), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(665), - data: LiteralBits::String("forever bound".to_string()), - output: PortId(782), - span: SourceSpan::new("src/v3/std/induction.dag", 31414, 31429), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(666), - target: TransformTarget::Callable(DeclarationId(1819)), - inputs: vec![PortId(782)], - output: PortId(783), - span: SourceSpan::new("src/v3/std/induction.dag", 31402, 31430), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(667), - data: LiteralBits::String("invalid cost bound".to_string()), - output: PortId(784), - span: SourceSpan::new("src/v3/std/induction.dag", 31461, 31481), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(668), - target: TransformTarget::Callable(DeclarationId(1819)), - inputs: vec![PortId(784)], - output: PortId(785), - span: SourceSpan::new("src/v3/std/induction.dag", 31449, 31482), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(669), - input: PortId(766), - paths: vec![ - Path { - body: NodeId(655), - output: PortId(768), - pattern: BranchPattern::UnresolvedVariant { - name: "ConstantBound".to_string(), - span: SourceSpan::new("src/v3/std/induction.dag", 31051, 31064), - }, - binding: None, - }, - Path { - body: NodeId(657), - output: PortId(771), - pattern: BranchPattern::UnresolvedVariant { - name: "AtomicBound".to_string(), - span: SourceSpan::new("src/v3/std/induction.dag", 31088, 31111), - }, - binding: Some(PayloadBinding { - binding_name: "c".to_string(), - payload_port: PortId(769), - }), - }, - Path { - body: NodeId(659), - output: PortId(774), - pattern: BranchPattern::UnresolvedVariant { - name: "ProductBound".to_string(), - span: SourceSpan::new("src/v3/std/induction.dag", 31146, 31174), - }, - binding: Some(PayloadBinding { - binding_name: "fs".to_string(), - payload_port: PortId(772), - }), - }, - Path { - body: NodeId(661), - output: PortId(777), - pattern: BranchPattern::UnresolvedVariant { - name: "SumOfProductsBound".to_string(), - span: SourceSpan::new("src/v3/std/induction.dag", 31212, 31244), - }, - binding: Some(PayloadBinding { - binding_name: "ts".to_string(), - payload_port: PortId(775), - }), - }, - Path { - body: NodeId(664), - output: PortId(781), - pattern: BranchPattern::UnresolvedVariant { - name: "SumBound".to_string(), - span: SourceSpan::new("src/v3/std/induction.dag", 31281, 31303), - }, - binding: Some(PayloadBinding { - binding_name: "ts".to_string(), - payload_port: PortId(778), - }), - }, - Path { - body: NodeId(666), - output: PortId(783), - pattern: BranchPattern::UnresolvedVariant { - name: "ForeverBound".to_string(), - span: SourceSpan::new("src/v3/std/induction.dag", 31386, 31398), - }, - binding: None, - }, - Path { - body: NodeId(668), - output: PortId(785), - pattern: BranchPattern::UnresolvedVariant { - name: "ErrorBound".to_string(), - span: SourceSpan::new("src/v3/std/induction.dag", 31435, 31445), - }, - binding: None, - }, - ], - output: PortId(786), - span: SourceSpan::new("src/v3/std/induction.dag", 31033, 31486), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(670), - name: "cost_bound_to_symbolic".to_string(), - value: PortId(786), - params: vec![PortId(766)], - span: SourceSpan::new("src/v3/std/induction.dag", 31033, 31486), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(671), - target: TransformTarget::UnresolvedFieldProject { - field_label: "param".to_string(), - }, - inputs: vec![PortId(788)], - output: PortId(789), - span: SourceSpan::new("src/v3/std/induction.dag", 31581, 31589), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(672), - target: TransformTarget::UnresolvedFieldProject { - field_label: "exponent".to_string(), - }, - inputs: vec![PortId(788)], - output: PortId(790), - span: SourceSpan::new("src/v3/std/induction.dag", 31591, 31602), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(673), - data: LiteralBits::String( - "CostBound named polynomial atom lacks structural SizeVariable port".to_string(), - ), - output: PortId(791), - span: SourceSpan::new("src/v3/std/induction.dag", 31626, 31694), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(674), - target: TransformTarget::Callable(DeclarationId(1819)), - inputs: vec![PortId(791)], - output: PortId(792), - span: SourceSpan::new("src/v3/std/induction.dag", 31614, 31695), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(675), - target: TransformTarget::UnresolvedFieldProject { - field_label: "param".to_string(), - }, - inputs: vec![PortId(793)], - output: PortId(794), - span: SourceSpan::new("src/v3/std/induction.dag", 31710, 31718), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(676), - data: LiteralBits::String( - "CostBound named log atom lacks structural SizeVariable port".to_string(), - ), - output: PortId(795), - span: SourceSpan::new("src/v3/std/induction.dag", 31742, 31803), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(677), - target: TransformTarget::Callable(DeclarationId(1819)), - inputs: vec![PortId(795)], - output: PortId(796), - span: SourceSpan::new("src/v3/std/induction.dag", 31730, 31804), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(678), - input: PortId(787), - paths: vec![ - Path { - body: NodeId(674), - output: PortId(792), - pattern: BranchPattern::UnresolvedVariant { - name: "PolyCost".to_string(), - span: SourceSpan::new("src/v3/std/induction.dag", 31570, 31604), - }, - binding: Some(PayloadBinding { - binding_name: "__payload_31570_31604".to_string(), - payload_port: PortId(788), - }), - }, - Path { - body: NodeId(677), - output: PortId(796), - pattern: BranchPattern::UnresolvedVariant { - name: "LogCost".to_string(), - span: SourceSpan::new("src/v3/std/induction.dag", 31700, 31720), - }, - binding: Some(PayloadBinding { - binding_name: "p".to_string(), - payload_port: PortId(793), - }), - }, - ], - output: PortId(797), - span: SourceSpan::new("src/v3/std/induction.dag", 31553, 31808), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(679), - name: "atomic_cost_to_symbolic".to_string(), - value: PortId(797), - params: vec![PortId(787)], - span: SourceSpan::new("src/v3/std/induction.dag", 31553, 31808), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(680), - target: TransformTarget::Callable(DeclarationId(1189)), - inputs: vec![PortId(798)], - output: PortId(799), - span: SourceSpan::new("src/v3/std/induction.dag", 31995, 32029), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(681), - name: "product_term_to_symbolic".to_string(), - value: PortId(799), - params: vec![PortId(798)], - span: SourceSpan::new("src/v3/std/induction.dag", 31995, 32029), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(682), - target: TransformTarget::ResolvedFieldProject { - field_label: "nodes".to_string(), - }, - inputs: vec![PortId(800)], - output: PortId(801), - span: SourceSpan::new("src/v3/std/workflows.dag", 1007, 1012), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(683), - name: "behavior_spine".to_string(), - value: PortId(801), - params: vec![PortId(800)], - span: SourceSpan::new("src/v3/std/workflows.dag", 1005, 1012), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(684), - data: LiteralBits::String("src/v3/std/timing_lens.dag".to_string()), - output: PortId(802), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 1586, 1614), - lane2_workflow: None, - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(685), - name: "timing_lens_module_path_witness".to_string(), - value: PortId(802), - params: vec![], - span: SourceSpan::new("src/v3/std/timing_lens.dag", 1586, 1614), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(686), - target: TransformTarget::Callable(DeclarationId(1236)), - inputs: vec![ - PortId(803), - PortId(804), - PortId(805), - PortId(806), - PortId(807), - ], - output: PortId(808), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 7446, 7589), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(687), - name: "gate_62_file_attachment_demo_record".to_string(), - value: PortId(808), - params: vec![ - PortId(803), - PortId(804), - PortId(805), - PortId(806), - PortId(807), - ], - span: SourceSpan::new("src/v3/std/timing_lens.dag", 7446, 7589), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(688), - target: TransformTarget::Callable(DeclarationId(2223)), - inputs: vec![], - output: PortId(809), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 9640, 9650), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(689), - name: "timing_measurement_unobserved".to_string(), - value: PortId(809), - params: vec![], - span: SourceSpan::new("src/v3/std/timing_lens.dag", 9640, 9650), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(690), - target: TransformTarget::Callable(DeclarationId(2223)), - inputs: vec![], - output: PortId(813), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 9958, 9968), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(691), - target: TransformTarget::Callable(DeclarationId(2223)), - inputs: vec![], - output: PortId(814), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10020, 10030), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(692), - target: TransformTarget::Callable(DeclarationId(2225)), - inputs: vec![], - output: PortId(815), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10048, 10053), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(693), - target: TransformTarget::Callable(DeclarationId(2225)), - inputs: vec![], - output: PortId(816), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10075, 10080), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(694), - target: TransformTarget::UnresolvedFieldProject { - field_label: "duration".to_string(), - }, - inputs: vec![PortId(817)], - output: PortId(818), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10100, 10111), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(695), - target: TransformTarget::Callable(DeclarationId(2225)), - inputs: vec![], - output: PortId(819), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10117, 10122), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(696), - input: PortId(811), - paths: vec![ - Path { - body: NodeId(691), - output: PortId(814), - pattern: BranchPattern::UnresolvedVariant { - name: "Unobserved".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10006, 10016), - }, - binding: None, - }, - Path { - body: NodeId(692), - output: PortId(815), - pattern: BranchPattern::UnresolvedVariant { - name: "Stale".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10039, 10044), - }, - binding: None, - }, - Path { - body: NodeId(693), - output: PortId(816), - pattern: BranchPattern::UnresolvedVariant { - name: "Ambiguous".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10062, 10071), - }, - binding: None, - }, - Path { - body: NodeId(695), - output: PortId(819), - pattern: BranchPattern::UnresolvedVariant { - name: "Observed".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10089, 10113), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(817), - }), - }, - ], - output: PortId(820), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 9988, 10130), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(697), - target: TransformTarget::Callable(DeclarationId(2223)), - inputs: vec![], - output: PortId(821), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10186, 10196), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(698), - target: TransformTarget::Callable(DeclarationId(2225)), - inputs: vec![], - output: PortId(822), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10214, 10219), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(699), - target: TransformTarget::Callable(DeclarationId(2224)), - inputs: vec![], - output: PortId(823), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10241, 10250), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(700), - target: TransformTarget::UnresolvedFieldProject { - field_label: "duration".to_string(), - }, - inputs: vec![PortId(824)], - output: PortId(825), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10270, 10281), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(701), - target: TransformTarget::Callable(DeclarationId(2224)), - inputs: vec![], - output: PortId(826), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10287, 10296), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(702), - input: PortId(811), - paths: vec![ - Path { - body: NodeId(697), - output: PortId(821), - pattern: BranchPattern::UnresolvedVariant { - name: "Unobserved".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10172, 10182), - }, - binding: None, - }, - Path { - body: NodeId(698), - output: PortId(822), - pattern: BranchPattern::UnresolvedVariant { - name: "Stale".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10205, 10210), - }, - binding: None, - }, - Path { - body: NodeId(699), - output: PortId(823), - pattern: BranchPattern::UnresolvedVariant { - name: "Ambiguous".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10228, 10237), - }, - binding: None, - }, - Path { - body: NodeId(701), - output: PortId(826), - pattern: BranchPattern::UnresolvedVariant { - name: "Observed".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10259, 10283), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(824), - }), - }, - ], - output: PortId(827), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10154, 10304), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(703), - target: TransformTarget::UnresolvedFieldProject { - field_label: "duration".to_string(), - }, - inputs: vec![PortId(828)], - output: PortId(829), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10320, 10332), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(704), - target: TransformTarget::Callable(DeclarationId(2223)), - inputs: vec![], - output: PortId(830), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10376, 10386), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(705), - target: TransformTarget::Callable(DeclarationId(2225)), - inputs: vec![], - output: PortId(831), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10404, 10409), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(706), - target: TransformTarget::Callable(DeclarationId(2224)), - inputs: vec![], - output: PortId(832), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10431, 10440), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(707), - target: TransformTarget::UnresolvedFieldProject { - field_label: "duration".to_string(), - }, - inputs: vec![PortId(833)], - output: PortId(834), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10460, 10472), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(708), - target: TransformTarget::UnresolvedFieldProject { - field_label: "count".to_string(), - }, - inputs: vec![PortId(829)], - output: PortId(835), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10552, 10557), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(709), - target: TransformTarget::UnresolvedFieldProject { - field_label: "count".to_string(), - }, - inputs: vec![PortId(834)], - output: PortId(836), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10563, 10568), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(710), - target: TransformTarget::Operator(OperatorKind::Arithmetic(ArithmeticOp::Add)), - inputs: vec![PortId(835), PortId(836)], - output: PortId(837), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10549, 10568), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(711), - target: TransformTarget::Callable(DeclarationId(1233)), - inputs: vec![PortId(837)], - output: PortId(838), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10540, 10570), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(712), - target: TransformTarget::Callable(DeclarationId(2222)), - inputs: vec![PortId(838)], - output: PortId(839), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10519, 10572), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(713), - target: TransformTarget::UnresolvedFieldProject { - field_label: "count".to_string(), - }, - inputs: vec![PortId(829)], - output: PortId(840), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10641, 10646), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(714), - target: TransformTarget::UnresolvedFieldProject { - field_label: "count".to_string(), - }, - inputs: vec![PortId(834)], - output: PortId(841), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10652, 10657), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(715), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Gt)), - inputs: vec![PortId(840), PortId(841)], - output: PortId(842), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10638, 10657), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(716), - input: PortId(842), - paths: vec![ - Path { - body: NodeId(703), - output: PortId(829), - pattern: BranchPattern::UnresolvedVariant { - name: "True".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10663, 10665), - }, - binding: None, - }, - Path { - body: NodeId(707), - output: PortId(834), - pattern: BranchPattern::UnresolvedVariant { - name: "False".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10671, 10673), - }, - binding: None, - }, - ], - output: PortId(843), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10635, 10673), - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(717), - target: TransformTarget::Callable(DeclarationId(2222)), - inputs: vec![PortId(843)], - output: PortId(844), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10600, 10688), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(718), - input: PortId(812), - paths: vec![ - Path { - body: NodeId(712), - output: PortId(839), - pattern: BranchPattern::UnresolvedVariant { - name: "True".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10519, 10572), - }, - binding: None, - }, - Path { - body: NodeId(717), - output: PortId(844), - pattern: BranchPattern::UnresolvedVariant { - name: "False".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10600, 10688), - }, - binding: None, - }, - ], - output: PortId(845), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10488, 10688), - emit_participation: None, - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(719), - input: PortId(811), - paths: vec![ - Path { - body: NodeId(704), - output: PortId(830), - pattern: BranchPattern::UnresolvedVariant { - name: "Unobserved".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10362, 10372), - }, - binding: None, - }, - Path { - body: NodeId(705), - output: PortId(831), - pattern: BranchPattern::UnresolvedVariant { - name: "Stale".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10395, 10400), - }, - binding: None, - }, - Path { - body: NodeId(706), - output: PortId(832), - pattern: BranchPattern::UnresolvedVariant { - name: "Ambiguous".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10418, 10427), - }, - binding: None, - }, - Path { - body: NodeId(718), - output: PortId(845), - pattern: BranchPattern::UnresolvedVariant { - name: "Observed".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10449, 10474), - }, - binding: Some(PayloadBinding { - binding_name: "bx".to_string(), - payload_port: PortId(833), - }), - }, - ], - output: PortId(846), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10344, 10696), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(720), - input: PortId(810), - paths: vec![ - Path { - body: NodeId(690), - output: PortId(813), - pattern: BranchPattern::UnresolvedVariant { - name: "Unobserved".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 9944, 9954), - }, - binding: None, - }, - Path { - body: NodeId(696), - output: PortId(820), - pattern: BranchPattern::UnresolvedVariant { - name: "Stale".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 9973, 9978), - }, - binding: None, - }, - Path { - body: NodeId(702), - output: PortId(827), - pattern: BranchPattern::UnresolvedVariant { - name: "Ambiguous".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10135, 10144), - }, - binding: None, - }, - Path { - body: NodeId(719), - output: PortId(846), - pattern: BranchPattern::UnresolvedVariant { - name: "Observed".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10309, 10334), - }, - binding: Some(PayloadBinding { - binding_name: "ax".to_string(), - payload_port: PortId(828), - }), - }, - ], - output: PortId(847), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 9930, 10700), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(721), - name: "timing_measurement_lens_combine".to_string(), - value: PortId(847), - params: vec![PortId(810), PortId(811), PortId(812)], - span: SourceSpan::new("src/v3/std/timing_lens.dag", 9930, 10700), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(722), - data: LiteralBits::Bool(true), - output: PortId(850), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10906, 10910), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(723), - target: TransformTarget::Callable(DeclarationId(1244)), - inputs: vec![PortId(848), PortId(849), PortId(850)], - output: PortId(851), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10868, 10911), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(724), - name: "timing_sequential_op".to_string(), - value: PortId(851), - params: vec![PortId(848), PortId(849)], - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10868, 10911), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(725), - data: LiteralBits::Int("0".to_string()), - output: PortId(852), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10963, 10964), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(726), - target: TransformTarget::Callable(DeclarationId(1233)), - inputs: vec![PortId(852)], - output: PortId(853), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10954, 10966), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(727), - name: "nanoseconds_zero".to_string(), - value: PortId(853), - params: vec![], - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10954, 10966), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(728), - target: TransformTarget::Callable(DeclarationId(1246)), - inputs: vec![], - output: PortId(854), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 11046, 11064), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(729), - target: TransformTarget::Callable(DeclarationId(2222)), - inputs: vec![PortId(854)], - output: PortId(855), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 11025, 11066), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(730), - name: "timing_sequential_identity".to_string(), - value: PortId(855), - params: vec![], - span: SourceSpan::new("src/v3/std/timing_lens.dag", 11025, 11066), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(731), - data: LiteralBits::Bool(false), - output: PortId(858), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 11253, 11258), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(732), - target: TransformTarget::Callable(DeclarationId(1244)), - inputs: vec![PortId(856), PortId(857), PortId(858)], - output: PortId(859), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 11215, 11259), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(733), - name: "timing_branch_op".to_string(), - value: PortId(859), - params: vec![PortId(856), PortId(857)], - span: SourceSpan::new("src/v3/std/timing_lens.dag", 11215, 11259), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(734), - data: LiteralBits::String( - "R3 Gap 9 row #106 timing-lens diagnostic roundtrip".to_string(), - ), - output: PortId(860), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 11877, 11929), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { id: NodeId(735), data: LiteralBits::String("thread timing measurement/budget source spans through gate #58 enforcement and replace this scaffold diagnostic with a generated/data-backed LiveCorrection".to_string()), output: PortId(861), span: SourceSpan::new("src/v3/std/timing_lens.dag", 11950, 12107), lane2_workflow: None })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(736), - target: TransformTarget::Callable(DeclarationId(1050)), - inputs: vec![PortId(860), PortId(861)], - output: PortId(862), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 11864, 12111), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(737), - name: "timing_lens_correction_retirement_plan".to_string(), - value: PortId(862), - params: vec![], - span: SourceSpan::new("src/v3/std/timing_lens.dag", 11864, 12111), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Value(ValueNode { id: NodeId(738), data: LiteralBits::String("TimingLensScaffoldDiagnostic does not yet compute a source-level live correction witness".to_string()), output: PortId(863), span: SourceSpan::new("src/v3/std/timing_lens.dag", 12192, 12282), lane2_workflow: None })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(739), - target: TransformTarget::Callable(DeclarationId(1249)), - inputs: vec![], - output: PortId(864), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 12288, 12328), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(740), - target: TransformTarget::Callable(DeclarationId(1980)), - inputs: vec![PortId(863), PortId(864)], - output: PortId(865), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 12168, 12332), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(741), - name: "timing_lens_deferred_correction".to_string(), - value: PortId(865), - params: vec![], - span: SourceSpan::new("src/v3/std/timing_lens.dag", 12168, 12332), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(742), - target: TransformTarget::UnresolvedFieldProject { - field_label: "span".to_string(), - }, - inputs: vec![PortId(867)], - output: PortId(868), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 12603, 12607), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(743), - target: TransformTarget::UnresolvedFieldProject { - field_label: "span".to_string(), - }, - inputs: vec![PortId(869)], - output: PortId(870), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 12630, 12634), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(744), - target: TransformTarget::UnresolvedFieldProject { - field_label: "span".to_string(), - }, - inputs: vec![PortId(871)], - output: PortId(872), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 12656, 12660), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(745), - target: TransformTarget::UnresolvedFieldProject { - field_label: "span".to_string(), - }, - inputs: vec![PortId(873)], - output: PortId(874), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 12678, 12682), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(746), - target: TransformTarget::UnresolvedFieldProject { - field_label: "span".to_string(), - }, - inputs: vec![PortId(875)], - output: PortId(876), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 12706, 12710), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(747), - input: PortId(866), - paths: vec![ - Path { - body: NodeId(742), - output: PortId(868), - pattern: BranchPattern::UnresolvedVariant { - name: "Value".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 12589, 12597), - }, - binding: Some(PayloadBinding { - binding_name: "v".to_string(), - payload_port: PortId(867), - }), - }, - Path { - body: NodeId(743), - output: PortId(870), - pattern: BranchPattern::UnresolvedVariant { - name: "Transform".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 12612, 12624), - }, - binding: Some(PayloadBinding { - binding_name: "t".to_string(), - payload_port: PortId(869), - }), - }, - Path { - body: NodeId(744), - output: PortId(872), - pattern: BranchPattern::UnresolvedVariant { - name: "Branch".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 12639, 12649), - }, - binding: Some(PayloadBinding { - binding_name: "br".to_string(), - payload_port: PortId(871), - }), - }, - Path { - body: NodeId(745), - output: PortId(874), - pattern: BranchPattern::UnresolvedVariant { - name: "Loop".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 12665, 12672), - }, - binding: Some(PayloadBinding { - binding_name: "l".to_string(), - payload_port: PortId(873), - }), - }, - Path { - body: NodeId(746), - output: PortId(876), - pattern: BranchPattern::UnresolvedVariant { - name: "Bind".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 12687, 12697), - }, - binding: Some(PayloadBinding { - binding_name: "bind".to_string(), - payload_port: PortId(875), - }), - }, - ], - output: PortId(877), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 12575, 12714), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(748), - name: "timing_lens_behavior_span".to_string(), - value: PortId(877), - params: vec![PortId(866)], - span: SourceSpan::new("src/v3/std/timing_lens.dag", 12575, 12714), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(749), - target: TransformTarget::Callable(DeclarationId(1973)), - inputs: vec![], - output: PortId(880), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 13082, 13094), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(750), - target: TransformTarget::Callable(DeclarationId(1981)), - inputs: vec![PortId(880)], - output: PortId(881), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 13069, 13095), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(751), - target: TransformTarget::Callable(DeclarationId(1250)), - inputs: vec![], - output: PortId(882), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 13143, 13176), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(752), - target: TransformTarget::Callable(DeclarationId(1055)), - inputs: vec![PortId(881), PortId(879), PortId(878), PortId(882)], - output: PortId(883), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 13057, 13180), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(753), - name: "timing_lens_scaffold_non_evidence_diagnostic".to_string(), - value: PortId(883), - params: vec![PortId(878), PortId(879)], - span: SourceSpan::new("src/v3/std/timing_lens.dag", 13057, 13180), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(754), - target: TransformTarget::Callable(DeclarationId(1232)), - inputs: vec![], - output: PortId(884), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 13487, 13520), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(755), - data: LiteralBits::Int("0".to_string()), - output: PortId(885), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 13532, 13533), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(756), - data: LiteralBits::Int("0".to_string()), - output: PortId(886), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 13543, 13544), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(757), - target: TransformTarget::Callable(DeclarationId(155)), - inputs: vec![PortId(884), PortId(885), PortId(886)], - output: PortId(887), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 13475, 13548), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(758), - name: "timing_lens_degenerate_empty_dag_span".to_string(), - value: PortId(887), - params: vec![], - span: SourceSpan::new("src/v3/std/timing_lens.dag", 13475, 13548), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(759), - target: TransformTarget::Callable(DeclarationId(1231)), - inputs: vec![PortId(888)], - output: PortId(890), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 14101, 14118), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(760), - target: TransformTarget::ResolvedFieldProject { - field_label: "declarations".to_string(), - }, - inputs: vec![PortId(888)], - output: PortId(891), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 14148, 14160), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(761), - target: TransformTarget::UnresolvedFieldProject { - field_label: "head".to_string(), - }, - inputs: vec![PortId(892)], - output: PortId(893), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 14283, 14287), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(762), - target: TransformTarget::UnresolvedFieldProject { - field_label: "span".to_string(), - }, - inputs: vec![PortId(893)], - output: PortId(894), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 14288, 14292), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(763), - target: TransformTarget::Callable(DeclarationId(1252)), - inputs: vec![PortId(889), PortId(894)], - output: PortId(895), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 14229, 14293), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(764), - target: TransformTarget::Callable(DeclarationId(2011)), - inputs: vec![PortId(895)], - output: PortId(896), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 14193, 14305), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(765), - target: TransformTarget::Callable(DeclarationId(1253)), - inputs: vec![], - output: PortId(897), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 14449, 14488), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(766), - target: TransformTarget::Callable(DeclarationId(1252)), - inputs: vec![PortId(889), PortId(897)], - output: PortId(898), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 14369, 14502), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(767), - target: TransformTarget::Callable(DeclarationId(2011)), - inputs: vec![PortId(898)], - output: PortId(899), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 14333, 14514), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(768), - input: PortId(891), - paths: vec![ - Path { - body: NodeId(764), - output: PortId(896), - pattern: BranchPattern::UnresolvedVariant { - name: "Cons".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 14171, 14179), - }, - binding: Some(PayloadBinding { - binding_name: "dd".to_string(), - payload_port: PortId(892), - }), - }, - Path { - body: NodeId(767), - output: PortId(899), - pattern: BranchPattern::UnresolvedVariant { - name: "Empty".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 14314, 14319), - }, - binding: None, - }, - ], - output: PortId(900), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 14140, 14522), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(769), - target: TransformTarget::UnresolvedFieldProject { - field_label: "head".to_string(), - }, - inputs: vec![PortId(901)], - output: PortId(902), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 14688, 14692), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(770), - target: TransformTarget::Callable(DeclarationId(1251)), - inputs: vec![PortId(902)], - output: PortId(903), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 14654, 14693), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(771), - target: TransformTarget::Callable(DeclarationId(1252)), - inputs: vec![PortId(889), PortId(903)], - output: PortId(904), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 14582, 14703), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(772), - target: TransformTarget::Callable(DeclarationId(2011)), - inputs: vec![PortId(904)], - output: PortId(905), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 14550, 14711), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(773), - input: PortId(890), - paths: vec![ - Path { - body: NodeId(768), - output: PortId(900), - pattern: BranchPattern::UnresolvedVariant { - name: "Empty".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 14125, 14130), - }, - binding: None, - }, - Path { - body: NodeId(772), - output: PortId(905), - pattern: BranchPattern::UnresolvedVariant { - name: "Cons".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 14527, 14540), - }, - binding: Some(PayloadBinding { - binding_name: "payload".to_string(), - payload_port: PortId(901), - }), - }, - ], - output: PortId(906), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 14095, 14715), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(774), - name: "timing_lens_validate_non_observed".to_string(), - value: PortId(906), - params: vec![PortId(888), PortId(889)], - span: SourceSpan::new("src/v3/std/timing_lens.dag", 14095, 14715), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(775), - target: TransformTarget::UnresolvedFieldProject { - field_label: "duration".to_string(), - }, - inputs: vec![PortId(909)], - output: PortId(910), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 15166, 15177), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(776), - target: TransformTarget::Callable(DeclarationId(1243)), - inputs: vec![], - output: PortId(912), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 15229, 15260), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(777), - target: TransformTarget::Callable(DeclarationId(1243)), - inputs: vec![], - output: PortId(914), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 15283, 15314), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(778), - input: PortId(908), - paths: vec![ - Path { - body: NodeId(776), - output: PortId(912), - pattern: BranchPattern::UnresolvedVariant { - name: "Cardinality".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 15211, 15225), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(911), - }), - }, - Path { - body: NodeId(777), - output: PortId(914), - pattern: BranchPattern::UnresolvedVariant { - name: "Descent".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 15269, 15279), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(913), - }), - }, - ], - output: PortId(915), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 15189, 15322), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(779), - target: TransformTarget::Callable(DeclarationId(2223)), - inputs: vec![], - output: PortId(916), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 15341, 15351), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(780), - target: TransformTarget::Callable(DeclarationId(2224)), - inputs: vec![], - output: PortId(917), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 15369, 15378), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(781), - target: TransformTarget::Callable(DeclarationId(2225)), - inputs: vec![], - output: PortId(918), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 15392, 15397), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(782), - input: PortId(907), - paths: vec![ - Path { - body: NodeId(778), - output: PortId(915), - pattern: BranchPattern::UnresolvedVariant { - name: "Observed".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 15155, 15179), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(909), - }), - }, - Path { - body: NodeId(779), - output: PortId(916), - pattern: BranchPattern::UnresolvedVariant { - name: "Unobserved".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 15327, 15337), - }, - binding: None, - }, - Path { - body: NodeId(780), - output: PortId(917), - pattern: BranchPattern::UnresolvedVariant { - name: "Ambiguous".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 15356, 15365), - }, - binding: None, - }, - Path { - body: NodeId(781), - output: PortId(918), - pattern: BranchPattern::UnresolvedVariant { - name: "Stale".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 15383, 15388), - }, - binding: None, - }, - ], - output: PortId(919), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 15138, 15401), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(783), - name: "timing_measurement_iterate".to_string(), - value: PortId(919), - params: vec![PortId(907), PortId(908)], - span: SourceSpan::new("src/v3/std/timing_lens.dag", 15138, 15401), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(784), - target: TransformTarget::Callable(DeclarationId(1231)), - inputs: vec![PortId(920)], - output: PortId(923), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16297, 16314), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(785), - target: TransformTarget::Callable(DeclarationId(725)), - inputs: vec![PortId(923)], - output: PortId(924), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16288, 16315), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(786), - target: TransformTarget::Callable(DeclarationId(1243)), - inputs: vec![], - output: PortId(925), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16330, 16361), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(787), - target: TransformTarget::Callable(DeclarationId(2232)), - inputs: vec![PortId(925)], - output: PortId(926), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16321, 16362), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(788), - target: TransformTarget::Callable(DeclarationId(1243)), - inputs: vec![], - output: PortId(927), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16377, 16408), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(789), - target: TransformTarget::Callable(DeclarationId(2233)), - inputs: vec![PortId(927)], - output: PortId(928), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16368, 16409), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(790), - input: PortId(924), - paths: vec![ - Path { - body: NodeId(787), - output: PortId(926), - pattern: BranchPattern::UnresolvedVariant { - name: "True".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16321, 16362), - }, - binding: None, - }, - Path { - body: NodeId(789), - output: PortId(928), - pattern: BranchPattern::UnresolvedVariant { - name: "False".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16368, 16409), - }, - binding: None, - }, - ], - output: PortId(929), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16285, 16409), - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(791), - target: TransformTarget::Callable(DeclarationId(1231)), - inputs: vec![PortId(920)], - output: PortId(931), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16448, 16465), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(792), - target: TransformTarget::Callable(DeclarationId(725)), - inputs: vec![PortId(931)], - output: PortId(932), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16439, 16466), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(793), - target: TransformTarget::Callable(DeclarationId(1243)), - inputs: vec![], - output: PortId(933), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16481, 16512), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(794), - target: TransformTarget::Callable(DeclarationId(2234)), - inputs: vec![PortId(933)], - output: PortId(934), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16472, 16513), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(795), - target: TransformTarget::Callable(DeclarationId(1243)), - inputs: vec![], - output: PortId(935), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16528, 16559), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(796), - target: TransformTarget::Callable(DeclarationId(2235)), - inputs: vec![PortId(935)], - output: PortId(936), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16519, 16560), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(797), - input: PortId(932), - paths: vec![ - Path { - body: NodeId(794), - output: PortId(934), - pattern: BranchPattern::UnresolvedVariant { - name: "True".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16472, 16513), - }, - binding: None, - }, - Path { - body: NodeId(796), - output: PortId(936), - pattern: BranchPattern::UnresolvedVariant { - name: "False".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16519, 16560), - }, - binding: None, - }, - ], - output: PortId(937), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16436, 16560), - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(798), - target: TransformTarget::Callable(DeclarationId(1231)), - inputs: vec![PortId(920)], - output: PortId(939), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16596, 16613), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(799), - target: TransformTarget::Callable(DeclarationId(725)), - inputs: vec![PortId(939)], - output: PortId(940), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16587, 16614), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(800), - target: TransformTarget::Callable(DeclarationId(1243)), - inputs: vec![], - output: PortId(941), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16629, 16660), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(801), - target: TransformTarget::Callable(DeclarationId(2236)), - inputs: vec![PortId(941)], - output: PortId(942), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16620, 16661), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(802), - target: TransformTarget::Callable(DeclarationId(1243)), - inputs: vec![], - output: PortId(943), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16676, 16707), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(803), - target: TransformTarget::Callable(DeclarationId(2237)), - inputs: vec![PortId(943)], - output: PortId(944), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16667, 16708), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(804), - input: PortId(940), - paths: vec![ - Path { - body: NodeId(801), - output: PortId(942), - pattern: BranchPattern::UnresolvedVariant { - name: "True".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16620, 16661), - }, - binding: None, - }, - Path { - body: NodeId(803), - output: PortId(944), - pattern: BranchPattern::UnresolvedVariant { - name: "False".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16667, 16708), - }, - binding: None, - }, - ], - output: PortId(945), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16584, 16708), - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(805), - target: TransformTarget::Callable(DeclarationId(1231)), - inputs: vec![PortId(920)], - output: PortId(947), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16742, 16759), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(806), - target: TransformTarget::Callable(DeclarationId(725)), - inputs: vec![PortId(947)], - output: PortId(948), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16733, 16760), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(807), - target: TransformTarget::Callable(DeclarationId(1243)), - inputs: vec![], - output: PortId(949), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16775, 16806), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(808), - target: TransformTarget::Callable(DeclarationId(2238)), - inputs: vec![PortId(949)], - output: PortId(950), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16766, 16807), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(809), - target: TransformTarget::Callable(DeclarationId(1243)), - inputs: vec![], - output: PortId(951), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16822, 16853), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(810), - target: TransformTarget::Callable(DeclarationId(2239)), - inputs: vec![PortId(951)], - output: PortId(952), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16813, 16854), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(811), - input: PortId(948), - paths: vec![ - Path { - body: NodeId(808), - output: PortId(950), - pattern: BranchPattern::UnresolvedVariant { - name: "True".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16766, 16807), - }, - binding: None, - }, - Path { - body: NodeId(810), - output: PortId(952), - pattern: BranchPattern::UnresolvedVariant { - name: "False".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16813, 16854), - }, - binding: None, - }, - ], - output: PortId(953), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16730, 16854), - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(812), - target: TransformTarget::Callable(DeclarationId(1231)), - inputs: vec![PortId(920)], - output: PortId(955), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16888, 16905), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(813), - target: TransformTarget::Callable(DeclarationId(725)), - inputs: vec![PortId(955)], - output: PortId(956), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16879, 16906), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(814), - target: TransformTarget::Callable(DeclarationId(1243)), - inputs: vec![], - output: PortId(957), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16921, 16952), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(815), - target: TransformTarget::Callable(DeclarationId(2240)), - inputs: vec![PortId(957)], - output: PortId(958), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16912, 16953), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(816), - target: TransformTarget::Callable(DeclarationId(1243)), - inputs: vec![], - output: PortId(959), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16968, 16999), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(817), - target: TransformTarget::Callable(DeclarationId(2241)), - inputs: vec![PortId(959)], - output: PortId(960), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16959, 17000), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(818), - input: PortId(956), - paths: vec![ - Path { - body: NodeId(815), - output: PortId(958), - pattern: BranchPattern::UnresolvedVariant { - name: "True".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16912, 16953), - }, - binding: None, - }, - Path { - body: NodeId(817), - output: PortId(960), - pattern: BranchPattern::UnresolvedVariant { - name: "False".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16959, 17000), - }, - binding: None, - }, - ], - output: PortId(961), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16876, 17000), - emit_participation: None, - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(819), - input: PortId(921), - paths: vec![ - Path { - body: NodeId(790), - output: PortId(929), - pattern: BranchPattern::UnresolvedVariant { - name: "Value".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16267, 16275), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(922), - }), - }, - Path { - body: NodeId(797), - output: PortId(937), - pattern: BranchPattern::UnresolvedVariant { - name: "Transform".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16414, 16426), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(930), - }), - }, - Path { - body: NodeId(804), - output: PortId(945), - pattern: BranchPattern::UnresolvedVariant { - name: "Branch".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16565, 16574), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(938), - }), - }, - Path { - body: NodeId(811), - output: PortId(953), - pattern: BranchPattern::UnresolvedVariant { - name: "Loop".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16713, 16720), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(946), - }), - }, - Path { - body: NodeId(818), - output: PortId(961), - pattern: BranchPattern::UnresolvedVariant { - name: "Bind".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16859, 16866), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(954), - }), - }, - ], - output: PortId(962), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16253, 17004), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(820), - name: "timing_lens_read".to_string(), - value: PortId(962), - params: vec![PortId(920), PortId(921)], - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16253, 17004), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(821), - target: TransformTarget::UnresolvedFieldProject { - field_label: "duration".to_string(), - }, - inputs: vec![PortId(965)], - output: PortId(966), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 17125, 17136), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(822), - target: TransformTarget::Callable(DeclarationId(1231)), - inputs: vec![PortId(963)], - output: PortId(967), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 17160, 17177), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(823), - target: TransformTarget::Callable(DeclarationId(725)), - inputs: vec![PortId(967)], - output: PortId(968), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 17151, 17178), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(824), - target: TransformTarget::Callable(DeclarationId(2010)), - inputs: vec![], - output: PortId(969), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 17184, 17196), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(825), - target: TransformTarget::Callable(DeclarationId(2010)), - inputs: vec![], - output: PortId(970), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 17202, 17214), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(826), - input: PortId(968), - paths: vec![ - Path { - body: NodeId(824), - output: PortId(969), - pattern: BranchPattern::UnresolvedVariant { - name: "True".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 17184, 17196), - }, - binding: None, - }, - Path { - body: NodeId(825), - output: PortId(970), - pattern: BranchPattern::UnresolvedVariant { - name: "False".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 17202, 17214), - }, - binding: None, - }, - ], - output: PortId(971), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 17148, 17214), - emit_participation: None, - })); - nodes.push(Behavior::Value(ValueNode { id: NodeId(827), data: LiteralBits::String("timing_lens_validate: TimingMeasurement.Unobserved is not admissible evidence at this scaffold (missing external timing row).".to_string()), output: PortId(972), span: SourceSpan::new("src/v3/std/timing_lens.dag", 17293, 17420), lane2_workflow: None })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(828), - target: TransformTarget::Callable(DeclarationId(1254)), - inputs: vec![PortId(963), PortId(972)], - output: PortId(973), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 17239, 17428), - })); - nodes.push(Behavior::Value(ValueNode { id: NodeId(829), data: LiteralBits::String("timing_lens_validate: TimingMeasurement.Ambiguous is not admissible evidence at this scaffold (conflicting timing facts).".to_string()), output: PortId(974), span: SourceSpan::new("src/v3/std/timing_lens.dag", 17506, 17629), lane2_workflow: None })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(830), - target: TransformTarget::Callable(DeclarationId(1254)), - inputs: vec![PortId(963), PortId(974)], - output: PortId(975), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 17452, 17637), - })); - nodes.push(Behavior::Value(ValueNode { id: NodeId(831), data: LiteralBits::String("timing_lens_validate: TimingMeasurement.Stale is not admissible evidence at this scaffold (digest/run mismatch vs attachment).".to_string()), output: PortId(976), span: SourceSpan::new("src/v3/std/timing_lens.dag", 17711, 17839), lane2_workflow: None })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(832), - target: TransformTarget::Callable(DeclarationId(1254)), - inputs: vec![PortId(963), PortId(976)], - output: PortId(977), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 17657, 17847), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(833), - input: PortId(964), - paths: vec![ - Path { - body: NodeId(826), - output: PortId(971), - pattern: BranchPattern::UnresolvedVariant { - name: "Observed".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 17114, 17138), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(965), - }), - }, - Path { - body: NodeId(828), - output: PortId(973), - pattern: BranchPattern::UnresolvedVariant { - name: "Unobserved".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 17219, 17229), - }, - binding: None, - }, - Path { - body: NodeId(830), - output: PortId(975), - pattern: BranchPattern::UnresolvedVariant { - name: "Ambiguous".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 17433, 17442), - }, - binding: None, - }, - Path { - body: NodeId(832), - output: PortId(977), - pattern: BranchPattern::UnresolvedVariant { - name: "Stale".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 17642, 17647), - }, - binding: None, - }, - ], - output: PortId(978), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 17093, 17851), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(834), - name: "timing_lens_validate".to_string(), - value: PortId(978), - params: vec![PortId(963), PortId(964)], - span: SourceSpan::new("src/v3/std/timing_lens.dag", 17093, 17851), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(835), - data: LiteralBits::Int("999999999999999999".to_string()), - output: PortId(979), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19017, 19035), - lane2_workflow: None, - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(836), - name: "timing_enforcement_fault_sentinel_count".to_string(), - value: PortId(979), - params: vec![], - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19017, 19035), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(837), - target: TransformTarget::UnresolvedFieldProject { - field_label: "duration".to_string(), - }, - inputs: vec![PortId(981)], - output: PortId(982), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19148, 19159), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(838), - target: TransformTarget::Callable(DeclarationId(2227)), - inputs: vec![PortId(982)], - output: PortId(983), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19165, 19186), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(839), - target: TransformTarget::Callable(DeclarationId(2228)), - inputs: vec![], - output: PortId(984), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19205, 19221), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(840), - target: TransformTarget::Callable(DeclarationId(2228)), - inputs: vec![], - output: PortId(985), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19239, 19255), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(841), - target: TransformTarget::Callable(DeclarationId(2228)), - inputs: vec![], - output: PortId(986), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19269, 19285), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(842), - input: PortId(980), - paths: vec![ - Path { - body: NodeId(838), - output: PortId(983), - pattern: BranchPattern::UnresolvedVariant { - name: "Observed".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19137, 19161), - }, - binding: Some(PayloadBinding { - binding_name: "d".to_string(), - payload_port: PortId(981), - }), - }, - Path { - body: NodeId(839), - output: PortId(984), - pattern: BranchPattern::UnresolvedVariant { - name: "Unobserved".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19191, 19201), - }, - binding: None, - }, - Path { - body: NodeId(840), - output: PortId(985), - pattern: BranchPattern::UnresolvedVariant { - name: "Ambiguous".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19226, 19235), - }, - binding: None, - }, - Path { - body: NodeId(841), - output: PortId(986), - pattern: BranchPattern::UnresolvedVariant { - name: "Stale".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19260, 19265), - }, - binding: None, - }, - ], - output: PortId(987), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19123, 19289), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(843), - name: "timing_enforcement_project".to_string(), - value: PortId(987), - params: vec![PortId(980)], - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19123, 19289), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(844), - target: TransformTarget::UnresolvedFieldProject { - field_label: "duration".to_string(), - }, - inputs: vec![PortId(990)], - output: PortId(991), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19405, 19416), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(845), - target: TransformTarget::UnresolvedFieldProject { - field_label: "count".to_string(), - }, - inputs: vec![PortId(991)], - output: PortId(992), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19433, 19438), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(846), - target: TransformTarget::ResolvedFieldProject { - field_label: "max".to_string(), - }, - inputs: vec![PortId(989)], - output: PortId(993), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19450, 19453), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(847), - target: TransformTarget::ResolvedFieldProject { - field_label: "count".to_string(), - }, - inputs: vec![PortId(993)], - output: PortId(994), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19454, 19459), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(848), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Gt)), - inputs: vec![PortId(992), PortId(994)], - output: PortId(995), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19431, 19459), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(849), - data: LiteralBits::Int("0".to_string()), - output: PortId(996), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19465, 19466), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(850), - data: LiteralBits::Int("0".to_string()), - output: PortId(997), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19470, 19471), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(851), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(996), PortId(997)], - output: PortId(998), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19465, 19471), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(852), - data: LiteralBits::Int("0".to_string()), - output: PortId(999), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19477, 19478), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(853), - data: LiteralBits::Int("1".to_string()), - output: PortId(1000), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19482, 19483), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(854), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(999), PortId(1000)], - output: PortId(1001), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19477, 19483), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(855), - input: PortId(995), - paths: vec![ - Path { - body: NodeId(851), - output: PortId(998), - pattern: BranchPattern::UnresolvedVariant { - name: "True".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19465, 19471), - }, - binding: None, - }, - Path { - body: NodeId(854), - output: PortId(1001), - pattern: BranchPattern::UnresolvedVariant { - name: "False".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19477, 19483), - }, - binding: None, - }, - ], - output: PortId(1002), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19428, 19483), - emit_participation: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(856), - data: LiteralBits::Int("0".to_string()), - output: PortId(1003), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19502, 19503), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(857), - data: LiteralBits::Int("0".to_string()), - output: PortId(1004), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19507, 19508), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(858), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(1003), PortId(1004)], - output: PortId(1005), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19502, 19508), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(859), - data: LiteralBits::Int("0".to_string()), - output: PortId(1006), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19526, 19527), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(860), - data: LiteralBits::Int("0".to_string()), - output: PortId(1007), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19531, 19532), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(861), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(1006), PortId(1007)], - output: PortId(1008), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19526, 19532), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(862), - data: LiteralBits::Int("0".to_string()), - output: PortId(1009), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19546, 19547), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(863), - data: LiteralBits::Int("0".to_string()), - output: PortId(1010), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19551, 19552), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(864), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(1009), PortId(1010)], - output: PortId(1011), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19546, 19552), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(865), - input: PortId(988), - paths: vec![ - Path { - body: NodeId(855), - output: PortId(1002), - pattern: BranchPattern::UnresolvedVariant { - name: "Observed".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19394, 19418), - }, - binding: Some(PayloadBinding { - binding_name: "d".to_string(), - payload_port: PortId(990), - }), - }, - Path { - body: NodeId(858), - output: PortId(1005), - pattern: BranchPattern::UnresolvedVariant { - name: "Unobserved".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19488, 19498), - }, - binding: None, - }, - Path { - body: NodeId(861), - output: PortId(1008), - pattern: BranchPattern::UnresolvedVariant { - name: "Ambiguous".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19513, 19522), - }, - binding: None, - }, - Path { - body: NodeId(864), - output: PortId(1011), - pattern: BranchPattern::UnresolvedVariant { - name: "Stale".to_string(), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19537, 19542), - }, - binding: None, - }, - ], - output: PortId(1012), - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19380, 19556), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(866), - name: "timing_enforcement_violates".to_string(), - value: PortId(1012), - params: vec![PortId(988), PortId(989)], - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19380, 19556), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(867), - target: TransformTarget::Callable(DeclarationId(1247)), - inputs: vec![], - output: PortId(1016), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3349, 3377), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(868), - target: TransformTarget::Callable(DeclarationId(1257)), - inputs: vec![PortId(1013), PortId(1016)], - output: PortId(1017), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3325, 3378), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(869), - target: TransformTarget::Callable(DeclarationId(1247)), - inputs: vec![], - output: PortId(1018), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3414, 3442), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(870), - target: TransformTarget::Callable(DeclarationId(2263)), - inputs: vec![PortId(1018)], - output: PortId(1019), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3405, 3443), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(871), - target: TransformTarget::UnresolvedFieldProject { - field_label: "value".to_string(), - }, - inputs: vec![PortId(1020)], - output: PortId(1021), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3469, 3477), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(872), - target: TransformTarget::Callable(DeclarationId(1247)), - inputs: vec![], - output: PortId(1022), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3492, 3520), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(873), - target: TransformTarget::Callable(DeclarationId(2264)), - inputs: vec![PortId(1022)], - output: PortId(1023), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3483, 3521), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(874), - input: PortId(1017), - paths: vec![ - Path { - body: NodeId(870), - output: PortId(1019), - pattern: BranchPattern::UnresolvedVariant { - name: "NoDiagnostic".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 3389, - 3401, - ), - }, - binding: None, - }, - Path { - body: NodeId(873), - output: PortId(1023), - pattern: BranchPattern::UnresolvedVariant { - name: "SomeDiagnostic".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 3452, - 3479, - ), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(1020), - }), - }, - ], - output: PortId(1024), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3319, 3529), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(875), - target: TransformTarget::Callable(DeclarationId(1247)), - inputs: vec![], - output: PortId(1026), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3586, 3614), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(876), - target: TransformTarget::Callable(DeclarationId(1257)), - inputs: vec![PortId(1013), PortId(1026)], - output: PortId(1027), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3562, 3615), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(877), - target: TransformTarget::Callable(DeclarationId(1247)), - inputs: vec![], - output: PortId(1028), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3651, 3679), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(878), - target: TransformTarget::Callable(DeclarationId(2265)), - inputs: vec![PortId(1028)], - output: PortId(1029), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3642, 3680), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(879), - target: TransformTarget::UnresolvedFieldProject { - field_label: "value".to_string(), - }, - inputs: vec![PortId(1030)], - output: PortId(1031), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3706, 3714), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(880), - target: TransformTarget::Callable(DeclarationId(1247)), - inputs: vec![], - output: PortId(1032), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3729, 3757), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(881), - target: TransformTarget::Callable(DeclarationId(2266)), - inputs: vec![PortId(1032)], - output: PortId(1033), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3720, 3758), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(882), - input: PortId(1027), - paths: vec![ - Path { - body: NodeId(878), - output: PortId(1029), - pattern: BranchPattern::UnresolvedVariant { - name: "NoDiagnostic".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 3626, - 3638, - ), - }, - binding: None, - }, - Path { - body: NodeId(881), - output: PortId(1033), - pattern: BranchPattern::UnresolvedVariant { - name: "SomeDiagnostic".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 3689, - 3716, - ), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(1030), - }), - }, - ], - output: PortId(1034), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3556, 3766), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(883), - target: TransformTarget::Callable(DeclarationId(1247)), - inputs: vec![], - output: PortId(1036), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3820, 3848), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(884), - target: TransformTarget::Callable(DeclarationId(1257)), - inputs: vec![PortId(1013), PortId(1036)], - output: PortId(1037), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3796, 3849), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(885), - target: TransformTarget::Callable(DeclarationId(1247)), - inputs: vec![], - output: PortId(1038), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3885, 3913), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(886), - target: TransformTarget::Callable(DeclarationId(2267)), - inputs: vec![PortId(1038)], - output: PortId(1039), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3876, 3914), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(887), - target: TransformTarget::UnresolvedFieldProject { - field_label: "value".to_string(), - }, - inputs: vec![PortId(1040)], - output: PortId(1041), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3940, 3948), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(888), - target: TransformTarget::Callable(DeclarationId(1247)), - inputs: vec![], - output: PortId(1042), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3963, 3991), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(889), - target: TransformTarget::Callable(DeclarationId(2268)), - inputs: vec![PortId(1042)], - output: PortId(1043), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3954, 3992), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(890), - input: PortId(1037), - paths: vec![ - Path { - body: NodeId(886), - output: PortId(1039), - pattern: BranchPattern::UnresolvedVariant { - name: "NoDiagnostic".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 3860, - 3872, - ), - }, - binding: None, - }, - Path { - body: NodeId(889), - output: PortId(1043), - pattern: BranchPattern::UnresolvedVariant { - name: "SomeDiagnostic".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 3923, - 3950, - ), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(1040), - }), - }, - ], - output: PortId(1044), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3790, 4000), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(891), - target: TransformTarget::Callable(DeclarationId(1247)), - inputs: vec![], - output: PortId(1046), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 4052, 4080), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(892), - target: TransformTarget::Callable(DeclarationId(1257)), - inputs: vec![PortId(1013), PortId(1046)], - output: PortId(1047), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 4028, 4081), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(893), - target: TransformTarget::Callable(DeclarationId(1247)), - inputs: vec![], - output: PortId(1048), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 4117, 4145), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(894), - target: TransformTarget::Callable(DeclarationId(2269)), - inputs: vec![PortId(1048)], - output: PortId(1049), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 4108, 4146), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(895), - target: TransformTarget::UnresolvedFieldProject { - field_label: "value".to_string(), - }, - inputs: vec![PortId(1050)], - output: PortId(1051), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 4172, 4180), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(896), - target: TransformTarget::Callable(DeclarationId(1247)), - inputs: vec![], - output: PortId(1052), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 4195, 4223), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(897), - target: TransformTarget::Callable(DeclarationId(2270)), - inputs: vec![PortId(1052)], - output: PortId(1053), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 4186, 4224), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(898), - input: PortId(1047), - paths: vec![ - Path { - body: NodeId(894), - output: PortId(1049), - pattern: BranchPattern::UnresolvedVariant { - name: "NoDiagnostic".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 4092, - 4104, - ), - }, - binding: None, - }, - Path { - body: NodeId(897), - output: PortId(1053), - pattern: BranchPattern::UnresolvedVariant { - name: "SomeDiagnostic".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 4155, - 4182, - ), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(1050), - }), - }, - ], - output: PortId(1054), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 4022, 4232), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(899), - target: TransformTarget::Callable(DeclarationId(1247)), - inputs: vec![], - output: PortId(1056), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 4284, 4312), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(900), - target: TransformTarget::Callable(DeclarationId(1257)), - inputs: vec![PortId(1013), PortId(1056)], - output: PortId(1057), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 4260, 4313), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(901), - target: TransformTarget::Callable(DeclarationId(1247)), - inputs: vec![], - output: PortId(1058), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 4349, 4377), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(902), - target: TransformTarget::Callable(DeclarationId(2271)), - inputs: vec![PortId(1058)], - output: PortId(1059), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 4340, 4378), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(903), - target: TransformTarget::UnresolvedFieldProject { - field_label: "value".to_string(), - }, - inputs: vec![PortId(1060)], - output: PortId(1061), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 4404, 4412), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(904), - target: TransformTarget::Callable(DeclarationId(1247)), - inputs: vec![], - output: PortId(1062), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 4427, 4455), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(905), - target: TransformTarget::Callable(DeclarationId(2272)), - inputs: vec![PortId(1062)], - output: PortId(1063), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 4418, 4456), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(906), - input: PortId(1057), - paths: vec![ - Path { - body: NodeId(902), - output: PortId(1059), - pattern: BranchPattern::UnresolvedVariant { - name: "NoDiagnostic".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 4324, - 4336, - ), - }, - binding: None, - }, - Path { - body: NodeId(905), - output: PortId(1063), - pattern: BranchPattern::UnresolvedVariant { - name: "SomeDiagnostic".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 4387, - 4414, - ), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(1060), - }), - }, - ], - output: PortId(1064), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 4254, 4464), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(907), - input: PortId(1014), - paths: vec![ - Path { - body: NodeId(874), - output: PortId(1024), - pattern: BranchPattern::UnresolvedVariant { - name: "Value".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 3301, - 3309, - ), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(1015), - }), - }, - Path { - body: NodeId(882), - output: PortId(1034), - pattern: BranchPattern::UnresolvedVariant { - name: "Transform".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 3534, - 3546, - ), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(1025), - }), - }, - Path { - body: NodeId(890), - output: PortId(1044), - pattern: BranchPattern::UnresolvedVariant { - name: "Branch".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 3771, - 3780, - ), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(1035), - }), - }, - Path { - body: NodeId(898), - output: PortId(1054), - pattern: BranchPattern::UnresolvedVariant { - name: "Loop".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 4005, - 4012, - ), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(1045), - }), - }, - Path { - body: NodeId(906), - output: PortId(1064), - pattern: BranchPattern::UnresolvedVariant { - name: "Bind".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 4237, - 4244, - ), - }, - binding: Some(PayloadBinding { - binding_name: "_".to_string(), - payload_port: PortId(1055), - }), - }, - ], - output: PortId(1065), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3287, 4468), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(908), - name: "ci_demo_timing_read".to_string(), - value: PortId(1065), - params: vec![PortId(1013), PortId(1014)], - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3287, 4468), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(909), - target: TransformTarget::Callable(DeclarationId(1266)), - inputs: vec![PortId(1066), PortId(1067)], - output: PortId(1068), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 4859, 4884), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(910), - name: "ci_wad_modeled_workflow_timing_witness".to_string(), - value: PortId(1068), - params: vec![PortId(1066), PortId(1067)], - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 4859, 4884), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(911), - target: TransformTarget::Callable(DeclarationId(2273)), - inputs: vec![], - output: PortId(1069), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5142, 5147), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(912), - name: "_ci_wad_seed_list_declaration_empty".to_string(), - value: PortId(1069), - params: vec![], - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5142, 5147), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(913), - target: TransformTarget::Callable(DeclarationId(2274)), - inputs: vec![], - output: PortId(1070), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5207, 5212), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(914), - name: "_ci_wad_seed_list_behavior_empty".to_string(), - value: PortId(1070), - params: vec![], - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5207, 5212), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(915), - target: TransformTarget::Callable(DeclarationId(2275)), - inputs: vec![], - output: PortId(1071), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5270, 5275), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(916), - name: "_ci_wad_seed_list_dagport_empty".to_string(), - value: PortId(1071), - params: vec![], - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5270, 5275), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(917), - target: TransformTarget::Callable(DeclarationId(2276)), - inputs: vec![], - output: PortId(1072), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5333, 5338), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(918), - name: "_ci_wad_seed_list_cluster_empty".to_string(), - value: PortId(1072), - params: vec![], - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5333, 5338), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(919), - target: TransformTarget::Callable(DeclarationId(2277)), - inputs: vec![], - output: PortId(1073), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5397, 5402), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(920), - name: "_ci_wad_empty_list_diagnostic".to_string(), - value: PortId(1073), - params: vec![], - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5397, 5402), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(921), - target: TransformTarget::Callable(DeclarationId(2278)), - inputs: vec![], - output: PortId(1074), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5477, 5482), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(922), - name: "_ci_wad_empty_list_witness_tm".to_string(), - value: PortId(1074), - params: vec![], - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5477, 5482), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(923), - target: TransformTarget::Callable(DeclarationId(2280)), - inputs: vec![PortId(1075)], - output: PortId(1076), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5593, 5604), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(924), - target: TransformTarget::Callable(DeclarationId(1273)), - inputs: vec![], - output: PortId(1077), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5612, 5643), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(925), - target: TransformTarget::Callable(DeclarationId(2279)), - inputs: vec![PortId(1076), PortId(1077)], - output: PortId(1078), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5580, 5645), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(926), - name: "_ci_wad_witnesses_singleton_tm".to_string(), - value: PortId(1078), - params: vec![PortId(1075)], - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5580, 5645), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(927), - target: TransformTarget::Callable(DeclarationId(1272)), - inputs: vec![], - output: PortId(1080), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5746, 5777), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(928), - target: TransformTarget::Callable(DeclarationId(2281)), - inputs: vec![PortId(1079), PortId(1080)], - output: PortId(1081), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5721, 5779), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(929), - name: "_ci_wad_violations_singleton".to_string(), - value: PortId(1081), - params: vec![PortId(1079)], - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5721, 5779), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(930), - data: LiteralBits::String("ci_modeled_timing".to_string()), - output: PortId(1083), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5914, 5933), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(931), - target: TransformTarget::Callable(DeclarationId(1274)), - inputs: vec![PortId(1082)], - output: PortId(1084), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5967, 6000), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(932), - target: TransformTarget::Callable(DeclarationId(2282)), - inputs: vec![PortId(1083), PortId(1082), PortId(1084)], - output: PortId(1085), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5880, 6005), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(933), - name: "_ci_wad_dimension_ok_tm_payload".to_string(), - value: PortId(1085), - params: vec![PortId(1082)], - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5880, 6005), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(934), - data: LiteralBits::String("ci_modeled_timing".to_string()), - output: PortId(1088), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 6162, 6181), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(935), - target: TransformTarget::Callable(DeclarationId(1275)), - inputs: vec![PortId(1087)], - output: PortId(1089), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 6199, 6233), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(936), - target: TransformTarget::Callable(DeclarationId(1274)), - inputs: vec![PortId(1086)], - output: PortId(1090), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 6250, 6283), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(937), - target: TransformTarget::Callable(DeclarationId(2283)), - inputs: vec![PortId(1088), PortId(1089), PortId(1090)], - output: PortId(1091), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 6126, 6288), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(938), - name: "_ci_wad_dimension_fail_tm_payload".to_string(), - value: PortId(1091), - params: vec![PortId(1086), PortId(1087)], - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 6126, 6288), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(939), - target: TransformTarget::Callable(DeclarationId(1231)), - inputs: vec![PortId(1092)], - output: PortId(1094), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 6651, 6668), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(940), - target: TransformTarget::Callable(DeclarationId(1276)), - inputs: vec![PortId(1093)], - output: PortId(1095), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 6684, 6718), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(941), - target: TransformTarget::UnresolvedFieldProject { - field_label: "head".to_string(), - }, - inputs: vec![PortId(1096)], - output: PortId(1097), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 6730, 6738), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(942), - target: TransformTarget::UnresolvedFieldProject { - field_label: "tail".to_string(), - }, - inputs: vec![PortId(1096)], - output: PortId(1098), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 6740, 6748), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(943), - target: TransformTarget::Callable(DeclarationId(1276)), - inputs: vec![PortId(1093)], - output: PortId(1099), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 6754, 6788), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(944), - input: PortId(1094), - paths: vec![ - Path { - body: NodeId(940), - output: PortId(1095), - pattern: BranchPattern::UnresolvedVariant { - name: "Empty".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 6675, - 6680, - ), - }, - binding: None, - }, - Path { - body: NodeId(943), - output: PortId(1099), - pattern: BranchPattern::UnresolvedVariant { - name: "Cons".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 6723, - 6750, - ), - }, - binding: Some(PayloadBinding { - binding_name: "__payload_6723_6750".to_string(), - payload_port: PortId(1096), - }), - }, - ], - output: PortId(1100), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 6645, 6792), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(945), - name: "report_dim_ok_tm".to_string(), - value: PortId(1100), - params: vec![PortId(1092), PortId(1093)], - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 6645, 6792), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(946), - target: TransformTarget::Callable(DeclarationId(1231)), - inputs: vec![PortId(1101)], - output: PortId(1104), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 6912, 6929), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(947), - target: TransformTarget::Callable(DeclarationId(1277)), - inputs: vec![PortId(1102), PortId(1103)], - output: PortId(1105), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 6945, 6987), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(948), - target: TransformTarget::UnresolvedFieldProject { - field_label: "head".to_string(), - }, - inputs: vec![PortId(1106)], - output: PortId(1107), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 6999, 7007), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(949), - target: TransformTarget::UnresolvedFieldProject { - field_label: "tail".to_string(), - }, - inputs: vec![PortId(1106)], - output: PortId(1108), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7009, 7017), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(950), - target: TransformTarget::Callable(DeclarationId(1277)), - inputs: vec![PortId(1102), PortId(1103)], - output: PortId(1109), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7023, 7065), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(951), - input: PortId(1104), - paths: vec![ - Path { - body: NodeId(947), - output: PortId(1105), - pattern: BranchPattern::UnresolvedVariant { - name: "Empty".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 6936, - 6941, - ), - }, - binding: None, - }, - Path { - body: NodeId(950), - output: PortId(1109), - pattern: BranchPattern::UnresolvedVariant { - name: "Cons".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 6992, - 7019, - ), - }, - binding: Some(PayloadBinding { - binding_name: "__payload_6992_7019".to_string(), - payload_port: PortId(1106), - }), - }, - ], - output: PortId(1110), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 6906, 7069), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(952), - name: "report_dim_fail_tm".to_string(), - value: PortId(1110), - params: vec![PortId(1101), PortId(1102), PortId(1103)], - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 6906, 7069), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(953), - target: TransformTarget::Callable(DeclarationId(1278)), - inputs: vec![PortId(1111), PortId(1112)], - output: PortId(1114), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7227, 7249), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(954), - target: TransformTarget::UnresolvedFieldProject { - field_label: "value".to_string(), - }, - inputs: vec![PortId(1115)], - output: PortId(1116), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7271, 7282), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(955), - target: TransformTarget::Callable(DeclarationId(1279)), - inputs: vec![PortId(1111), PortId(1112), PortId(1116)], - output: PortId(1117), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7288, 7318), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(956), - input: PortId(1113), - paths: vec![ - Path { - body: NodeId(953), - output: PortId(1114), - pattern: BranchPattern::UnresolvedVariant { - name: "NoDiagnostic".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 7211, - 7223, - ), - }, - binding: None, - }, - Path { - body: NodeId(955), - output: PortId(1117), - pattern: BranchPattern::UnresolvedVariant { - name: "SomeDiagnostic".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 7254, - 7284, - ), - }, - binding: Some(PayloadBinding { - binding_name: "diag".to_string(), - payload_port: PortId(1115), - }), - }, - ], - output: PortId(1118), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7196, 7322), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(957), - name: "report_inhabits_branch_tm".to_string(), - value: PortId(1118), - params: vec![PortId(1111), PortId(1112), PortId(1113)], - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7196, 7322), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(958), - target: TransformTarget::Callable(DeclarationId(1257)), - inputs: vec![PortId(1119), PortId(1121)], - output: PortId(1122), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7502, 7528), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(959), - target: TransformTarget::Callable(DeclarationId(1280)), - inputs: vec![PortId(1119), PortId(1121), PortId(1122)], - output: PortId(1123), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7470, 7529), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(960), - target: TransformTarget::UnresolvedFieldProject { - field_label: "reason".to_string(), - }, - inputs: vec![PortId(1124)], - output: PortId(1125), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7545, 7554), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(961), - target: TransformTarget::UnresolvedFieldProject { - field_label: "subject".to_string(), - }, - inputs: vec![PortId(1124)], - output: PortId(1126), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7556, 7568), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(962), - target: TransformTarget::Callable(DeclarationId(1247)), - inputs: vec![], - output: PortId(1128), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7676, 7704), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(963), - target: TransformTarget::Callable(DeclarationId(1251)), - inputs: vec![PortId(1127)], - output: PortId(1129), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7766, 7796), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(964), - target: TransformTarget::Callable(DeclarationId(1252)), - inputs: vec![PortId(1125), PortId(1129)], - output: PortId(1130), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7718, 7797), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(965), - target: TransformTarget::Callable(DeclarationId(1279)), - inputs: vec![PortId(1119), PortId(1128), PortId(1130)], - output: PortId(1131), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7629, 7809), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(966), - target: TransformTarget::UnresolvedFieldProject { - field_label: "port".to_string(), - }, - inputs: vec![PortId(1132)], - output: PortId(1133), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7846, 7854), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(967), - target: TransformTarget::Callable(DeclarationId(1247)), - inputs: vec![], - output: PortId(1134), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7917, 7945), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(968), - target: TransformTarget::Callable(DeclarationId(1253)), - inputs: vec![], - output: PortId(1135), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 8007, 8046), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(969), - target: TransformTarget::Callable(DeclarationId(1252)), - inputs: vec![PortId(1125), PortId(1135)], - output: PortId(1136), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7959, 8047), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(970), - target: TransformTarget::Callable(DeclarationId(1279)), - inputs: vec![PortId(1119), PortId(1134), PortId(1136)], - output: PortId(1137), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7870, 8059), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(971), - target: TransformTarget::UnresolvedFieldProject { - field_label: "producer".to_string(), - }, - inputs: vec![PortId(1138)], - output: PortId(1139), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 8096, 8108), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(972), - target: TransformTarget::Callable(DeclarationId(1247)), - inputs: vec![], - output: PortId(1140), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 8171, 8199), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(973), - target: TransformTarget::Callable(DeclarationId(1253)), - inputs: vec![], - output: PortId(1141), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 8261, 8300), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(974), - target: TransformTarget::Callable(DeclarationId(1252)), - inputs: vec![PortId(1125), PortId(1141)], - output: PortId(1142), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 8213, 8301), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(975), - target: TransformTarget::Callable(DeclarationId(1279)), - inputs: vec![PortId(1119), PortId(1140), PortId(1142)], - output: PortId(1143), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 8124, 8313), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(976), - input: PortId(1126), - paths: vec![ - Path { - body: NodeId(965), - output: PortId(1131), - pattern: BranchPattern::UnresolvedVariant { - name: "AtBehavior".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 7600, - 7615, - ), - }, - binding: Some(PayloadBinding { - binding_name: "beh".to_string(), - payload_port: PortId(1127), - }), - }, - Path { - body: NodeId(970), - output: PortId(1137), - pattern: BranchPattern::UnresolvedVariant { - name: "ProducerLookupMissingPort".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 7818, - 7856, - ), - }, - binding: Some(PayloadBinding { - binding_name: "_p".to_string(), - payload_port: PortId(1132), - }), - }, - Path { - body: NodeId(975), - output: PortId(1143), - pattern: BranchPattern::UnresolvedVariant { - name: "ProducerLookupMissingNode".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 8068, - 8110, - ), - }, - binding: Some(PayloadBinding { - binding_name: "_q".to_string(), - payload_port: PortId(1138), - }), - }, - ], - output: PortId(1144), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7580, 8321), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(977), - input: PortId(1120), - paths: vec![ - Path { - body: NodeId(959), - output: PortId(1123), - pattern: BranchPattern::UnresolvedVariant { - name: "Inhabits".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 7455, - 7466, - ), - }, - binding: Some(PayloadBinding { - binding_name: "c".to_string(), - payload_port: PortId(1121), - }), - }, - Path { - body: NodeId(976), - output: PortId(1144), - pattern: BranchPattern::UnresolvedVariant { - name: "Violates".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 7534, - 7570, - ), - }, - binding: Some(PayloadBinding { - binding_name: "__payload_7534_7570".to_string(), - payload_port: PortId(1124), - }), - }, - ], - output: PortId(1145), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7441, 8325), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(978), - name: "dimension_report_tm_from_witness".to_string(), - value: PortId(1145), - params: vec![PortId(1119), PortId(1120)], - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7441, 8325), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(979), - target: TransformTarget::Callable(DeclarationId(1231)), - inputs: vec![PortId(1146)], - output: PortId(1148), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 9304, 9321), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(980), - target: TransformTarget::Callable(DeclarationId(725)), - inputs: vec![PortId(1148)], - output: PortId(1149), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 9295, 9322), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(981), - target: TransformTarget::Callable(DeclarationId(1266)), - inputs: vec![PortId(1146), PortId(1147)], - output: PortId(1150), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 9368, 9393), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(982), - target: TransformTarget::Callable(DeclarationId(1281)), - inputs: vec![PortId(1146), PortId(1150)], - output: PortId(1151), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 9332, 9394), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(983), - target: TransformTarget::Callable(DeclarationId(1267)), - inputs: vec![PortId(1146), PortId(1147)], - output: PortId(1152), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 9442, 9486), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(984), - target: TransformTarget::Callable(DeclarationId(1281)), - inputs: vec![PortId(1146), PortId(1152)], - output: PortId(1153), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 9406, 9487), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(985), - input: PortId(1149), - paths: vec![ - Path { - body: NodeId(982), - output: PortId(1151), - pattern: BranchPattern::UnresolvedVariant { - name: "True".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 9332, - 9394, - ), - }, - binding: None, - }, - Path { - body: NodeId(984), - output: PortId(1153), - pattern: BranchPattern::UnresolvedVariant { - name: "False".to_string(), - span: SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 9406, - 9487, - ), - }, - binding: None, - }, - ], - output: PortId(1154), - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 9292, 9487), - emit_participation: None, - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(986), - name: "demo_ci_modeled_timing_dimension_report".to_string(), - value: PortId(1154), - params: vec![PortId(1146), PortId(1147)], - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 9292, 9487), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(987), - target: TransformTarget::Callable(DeclarationId(1327)), - inputs: vec![PortId(1156)], - output: PortId(1157), - span: SourceSpan::new("src/v3/std/verification.dag", 31362, 31385), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(988), - target: TransformTarget::Callable(DeclarationId(1328)), - inputs: vec![PortId(1158)], - output: PortId(1159), - span: SourceSpan::new("src/v3/std/verification.dag", 31407, 31441), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(989), - input: PortId(1155), - paths: vec![ - Path { - body: NodeId(987), - output: PortId(1157), - pattern: BranchPattern::UnresolvedVariant { - name: "Enumerated".to_string(), - span: SourceSpan::new("src/v3/std/verification.dag", 31345, 31358), - }, - binding: Some(PayloadBinding { - binding_name: "c".to_string(), - payload_port: PortId(1156), - }), - }, - Path { - body: NodeId(988), - output: PortId(1159), - pattern: BranchPattern::UnresolvedVariant { - name: "Quantified".to_string(), - span: SourceSpan::new("src/v3/std/verification.dag", 31390, 31403), - }, - binding: Some(PayloadBinding { - binding_name: "q".to_string(), - payload_port: PortId(1158), - }), - }, - ], - output: PortId(1160), - span: SourceSpan::new("src/v3/std/verification.dag", 31327, 31445), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(990), - name: "obligation_for_suite_claim".to_string(), - value: PortId(1160), - params: vec![PortId(1155)], - span: SourceSpan::new("src/v3/std/verification.dag", 31327, 31445), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(991), - data: LiteralBits::String("+".to_string()), - output: PortId(1163), - span: SourceSpan::new("src/v3/compiler/operators.dag", 886, 889), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(992), - data: LiteralBits::String("-".to_string()), - output: PortId(1164), - span: SourceSpan::new("src/v3/compiler/operators.dag", 905, 908), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(993), - data: LiteralBits::String("*".to_string()), - output: PortId(1165), - span: SourceSpan::new("src/v3/compiler/operators.dag", 924, 927), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(994), - data: LiteralBits::String("/".to_string()), - output: PortId(1166), - span: SourceSpan::new("src/v3/compiler/operators.dag", 943, 946), - lane2_workflow: None, - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(995), - input: PortId(1162), - paths: vec![ - Path { - body: NodeId(991), - output: PortId(1163), - pattern: BranchPattern::UnresolvedVariant { - name: "Add".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 879, 882), - }, - binding: None, - }, - Path { - body: NodeId(992), - output: PortId(1164), - pattern: BranchPattern::UnresolvedVariant { - name: "Sub".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 898, 901), - }, - binding: None, - }, - Path { - body: NodeId(993), - output: PortId(1165), - pattern: BranchPattern::UnresolvedVariant { - name: "Mul".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 917, 920), - }, - binding: None, - }, - Path { - body: NodeId(994), - output: PortId(1166), - pattern: BranchPattern::UnresolvedVariant { - name: "Div".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 936, 939), - }, - binding: None, - }, - ], - output: PortId(1167), - span: SourceSpan::new("src/v3/compiler/operators.dag", 857, 954), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(996), - data: LiteralBits::String("==".to_string()), - output: PortId(1169), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1012, 1016), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(997), - data: LiteralBits::String("!=".to_string()), - output: PortId(1170), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1031, 1035), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(998), - data: LiteralBits::String("<".to_string()), - output: PortId(1171), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1050, 1053), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(999), - data: LiteralBits::String("<=".to_string()), - output: PortId(1172), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1068, 1072), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(1000), - data: LiteralBits::String(">".to_string()), - output: PortId(1173), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1087, 1090), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(1001), - data: LiteralBits::String(">=".to_string()), - output: PortId(1174), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1105, 1109), - lane2_workflow: None, - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(1002), - input: PortId(1168), - paths: vec![ - Path { - body: NodeId(996), - output: PortId(1169), - pattern: BranchPattern::UnresolvedVariant { - name: "Eq".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1006, 1008), - }, - binding: None, - }, - Path { - body: NodeId(997), - output: PortId(1170), - pattern: BranchPattern::UnresolvedVariant { - name: "Ne".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1025, 1027), - }, - binding: None, - }, - Path { - body: NodeId(998), - output: PortId(1171), - pattern: BranchPattern::UnresolvedVariant { - name: "Lt".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1044, 1046), - }, - binding: None, - }, - Path { - body: NodeId(999), - output: PortId(1172), - pattern: BranchPattern::UnresolvedVariant { - name: "Le".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1062, 1064), - }, - binding: None, - }, - Path { - body: NodeId(1000), - output: PortId(1173), - pattern: BranchPattern::UnresolvedVariant { - name: "Gt".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1081, 1083), - }, - binding: None, - }, - Path { - body: NodeId(1001), - output: PortId(1174), - pattern: BranchPattern::UnresolvedVariant { - name: "Ge".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1099, 1101), - }, - binding: None, - }, - ], - output: PortId(1175), - span: SourceSpan::new("src/v3/compiler/operators.dag", 985, 1117), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(1003), - data: LiteralBits::String("&&".to_string()), - output: PortId(1177), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1179, 1183), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(1004), - data: LiteralBits::String("||".to_string()), - output: PortId(1178), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1198, 1202), - lane2_workflow: None, - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(1005), - input: PortId(1176), - paths: vec![ - Path { - body: NodeId(1003), - output: PortId(1177), - pattern: BranchPattern::UnresolvedVariant { - name: "And".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1172, 1175), - }, - binding: None, - }, - Path { - body: NodeId(1004), - output: PortId(1178), - pattern: BranchPattern::UnresolvedVariant { - name: "Or".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1192, 1194), - }, - binding: None, - }, - ], - output: PortId(1179), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1148, 1210), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(1006), - input: PortId(1161), - paths: vec![ - Path { - body: NodeId(995), - output: PortId(1167), - pattern: BranchPattern::UnresolvedVariant { - name: "Arithmetic".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 830, 847), - }, - binding: Some(PayloadBinding { - binding_name: "arith".to_string(), - payload_port: PortId(1162), - }), - }, - Path { - body: NodeId(1002), - output: PortId(1175), - pattern: BranchPattern::UnresolvedVariant { - name: "Comparison".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 959, 975), - }, - binding: Some(PayloadBinding { - binding_name: "comp".to_string(), - payload_port: PortId(1168), - }), - }, - Path { - body: NodeId(1005), - output: PortId(1179), - pattern: BranchPattern::UnresolvedVariant { - name: "Logical".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1122, 1138), - }, - binding: Some(PayloadBinding { - binding_name: "logical".to_string(), - payload_port: PortId(1176), - }), - }, - ], - output: PortId(1180), - span: SourceSpan::new("src/v3/compiler/operators.dag", 815, 1214), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(1007), - name: "symbol".to_string(), - value: PortId(1180), - params: vec![PortId(1161)], - span: SourceSpan::new("src/v3/compiler/operators.dag", 815, 1214), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(1008), - data: LiteralBits::String("add".to_string()), - output: PortId(1183), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1341, 1346), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(1009), - data: LiteralBits::String("sub".to_string()), - output: PortId(1184), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1362, 1367), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(1010), - data: LiteralBits::String("mul".to_string()), - output: PortId(1185), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1383, 1388), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(1011), - data: LiteralBits::String("div".to_string()), - output: PortId(1186), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1404, 1409), - lane2_workflow: None, - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(1012), - input: PortId(1182), - paths: vec![ - Path { - body: NodeId(1008), - output: PortId(1183), - pattern: BranchPattern::UnresolvedVariant { - name: "Add".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1334, 1337), - }, - binding: None, - }, - Path { - body: NodeId(1009), - output: PortId(1184), - pattern: BranchPattern::UnresolvedVariant { - name: "Sub".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1355, 1358), - }, - binding: None, - }, - Path { - body: NodeId(1010), - output: PortId(1185), - pattern: BranchPattern::UnresolvedVariant { - name: "Mul".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1376, 1379), - }, - binding: None, - }, - Path { - body: NodeId(1011), - output: PortId(1186), - pattern: BranchPattern::UnresolvedVariant { - name: "Div".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1397, 1400), - }, - binding: None, - }, - ], - output: PortId(1187), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1312, 1417), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(1013), - data: LiteralBits::String("eq".to_string()), - output: PortId(1189), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1475, 1479), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(1014), - data: LiteralBits::String("ne".to_string()), - output: PortId(1190), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1494, 1498), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(1015), - data: LiteralBits::String("lt".to_string()), - output: PortId(1191), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1513, 1517), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(1016), - data: LiteralBits::String("le".to_string()), - output: PortId(1192), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1532, 1536), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(1017), - data: LiteralBits::String("gt".to_string()), - output: PortId(1193), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1551, 1555), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(1018), - data: LiteralBits::String("ge".to_string()), - output: PortId(1194), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1570, 1574), - lane2_workflow: None, - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(1019), - input: PortId(1188), - paths: vec![ - Path { - body: NodeId(1013), - output: PortId(1189), - pattern: BranchPattern::UnresolvedVariant { - name: "Eq".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1469, 1471), - }, - binding: None, - }, - Path { - body: NodeId(1014), - output: PortId(1190), - pattern: BranchPattern::UnresolvedVariant { - name: "Ne".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1488, 1490), - }, - binding: None, - }, - Path { - body: NodeId(1015), - output: PortId(1191), - pattern: BranchPattern::UnresolvedVariant { - name: "Lt".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1507, 1509), - }, - binding: None, - }, - Path { - body: NodeId(1016), - output: PortId(1192), - pattern: BranchPattern::UnresolvedVariant { - name: "Le".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1526, 1528), - }, - binding: None, - }, - Path { - body: NodeId(1017), - output: PortId(1193), - pattern: BranchPattern::UnresolvedVariant { - name: "Gt".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1545, 1547), - }, - binding: None, - }, - Path { - body: NodeId(1018), - output: PortId(1194), - pattern: BranchPattern::UnresolvedVariant { - name: "Ge".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1564, 1566), - }, - binding: None, - }, - ], - output: PortId(1195), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1448, 1582), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(1020), - data: LiteralBits::String("meet".to_string()), - output: PortId(1197), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1978, 1984), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(1021), - data: LiteralBits::String("join".to_string()), - output: PortId(1198), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1999, 2005), - lane2_workflow: None, - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(1022), - input: PortId(1196), - paths: vec![ - Path { - body: NodeId(1020), - output: PortId(1197), - pattern: BranchPattern::UnresolvedVariant { - name: "And".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1971, 1974), - }, - binding: None, - }, - Path { - body: NodeId(1021), - output: PortId(1198), - pattern: BranchPattern::UnresolvedVariant { - name: "Or".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1993, 1995), - }, - binding: None, - }, - ], - output: PortId(1199), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1947, 2013), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(1023), - input: PortId(1181), - paths: vec![ - Path { - body: NodeId(1012), - output: PortId(1187), - pattern: BranchPattern::UnresolvedVariant { - name: "Arithmetic".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1285, 1302), - }, - binding: Some(PayloadBinding { - binding_name: "arith".to_string(), - payload_port: PortId(1182), - }), - }, - Path { - body: NodeId(1019), - output: PortId(1195), - pattern: BranchPattern::UnresolvedVariant { - name: "Comparison".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1422, 1438), - }, - binding: Some(PayloadBinding { - binding_name: "comp".to_string(), - payload_port: PortId(1188), - }), - }, - Path { - body: NodeId(1022), - output: PortId(1199), - pattern: BranchPattern::UnresolvedVariant { - name: "Logical".to_string(), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1921, 1937), - }, - binding: Some(PayloadBinding { - binding_name: "logical".to_string(), - payload_port: PortId(1196), - }), - }, - ], - output: PortId(1200), - span: SourceSpan::new("src/v3/compiler/operators.dag", 1270, 2017), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(1024), - name: "algebra_field_name".to_string(), - value: PortId(1200), - params: vec![PortId(1181)], - span: SourceSpan::new("src/v3/compiler/operators.dag", 1270, 2017), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(1025), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(1201), PortId(1201)], - output: PortId(1202), - span: SourceSpan::new("dsl/extdeps/github/ci.dag", 2673, 2714), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(1026), - data: LiteralBits::String("GitHubActionsWorkflowStemSegment".to_string()), - output: PortId(1203), - span: SourceSpan::new("dsl/extdeps/github/ci.dag", 2673, 2714), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(1027), - data: LiteralBits::String("GitHubActionsWorkflowStemSegment".to_string()), - output: PortId(1204), - span: SourceSpan::new("dsl/extdeps/github/ci.dag", 2673, 2714), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(1028), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(1203), PortId(1204)], - output: PortId(1205), - span: SourceSpan::new("dsl/extdeps/github/ci.dag", 2673, 2714), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(1029), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(1202), PortId(1205)], - output: PortId(1206), - span: SourceSpan::new("dsl/extdeps/github/ci.dag", 2673, 2714), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(1030), - name: "".to_string(), - value: PortId(1206), - params: vec![PortId(1201)], - span: SourceSpan::new("dsl/extdeps/github/ci.dag", 2673, 2714), - lane2_workflow: None, - emit_participation: None, - })); - nodes - } -} - -#[allow(clippy::vec_init_then_push)] -fn bootstrapped_fixture_without_parse_surface_dag_declarations() -> Vec { - { - let mut declarations = Vec::with_capacity(2927); - declarations.push(Declaration { - id: DeclarationId(0), - name: Some("Classical".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "True".to_string(), - ty: DeclarationId(313), - }, - Field { - label: "False".to_string(), - ty: DeclarationId(314), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/logic.dag", 287, 316), - }); - declarations.push(Declaration { - id: DeclarationId(1), - name: Some("classical_not".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(0)], - output: DeclarationId(0), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/logic.dag", 362, 429)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/logic.dag", 318, 429), - }); - declarations.push(Declaration { - id: DeclarationId(2), - name: Some("classical_and".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(0), DeclarationId(0)], - output: DeclarationId(0), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/logic.dag", 489, 553)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/logic.dag", 431, 553), - }); - declarations.push(Declaration { - id: DeclarationId(3), - name: Some("classical_or".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(0), DeclarationId(0)], - output: DeclarationId(0), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/logic.dag", 612, 675)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/logic.dag", 555, 675), - }); - declarations.push(Declaration { - id: DeclarationId(4), - name: Some("Bit".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(0), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/bit.dag", 897, 917), - }); - declarations.push(Declaration { - id: DeclarationId(5), - name: Some("Nibble".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "bits".to_string(), - ty: DeclarationId(315), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/bit.dag", 1003, 1034), - }); - declarations.push(Declaration { - id: DeclarationId(6), - name: Some("Byte".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "bits".to_string(), - ty: DeclarationId(316), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/bit.dag", 1118, 1147), - }); - declarations.push(Declaration { - id: DeclarationId(7), - name: Some("Word16".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "bytes".to_string(), - ty: DeclarationId(317), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/bit.dag", 1251, 1284), - }); - declarations.push(Declaration { - id: DeclarationId(8), - name: Some("Word32".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "bytes".to_string(), - ty: DeclarationId(318), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/bit.dag", 1285, 1318), - }); - declarations.push(Declaration { - id: DeclarationId(9), - name: Some("Word64".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "bytes".to_string(), - ty: DeclarationId(319), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/bit.dag", 1319, 1352), - }); - declarations.push(Declaration { - id: DeclarationId(10), - name: Some("Word128".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "bytes".to_string(), - ty: DeclarationId(320), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/bit.dag", 1353, 1387), - }); - declarations.push(Declaration { - id: DeclarationId(11), - name: Some("Result".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Ok".to_string(), - ty: DeclarationId(321), - }, - Field { - label: "Err".to_string(), - ty: DeclarationId(322), - }, - ], - }, - type_params: vec![DeclarationId(12), DeclarationId(13)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/error_primitives.dag", 597, 657), - }); - declarations.push(Declaration { - id: DeclarationId(12), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("ok".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/error_primitives.dag", 597, 657), - }); - declarations.push(Declaration { - id: DeclarationId(13), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("err".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/error_primitives.dag", 597, 657), - }); - declarations.push(Declaration { - id: DeclarationId(14), - name: Some("DivError".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "DivideByZero".to_string(), - ty: DeclarationId(323), - }, - Field { - label: "Overflow".to_string(), - ty: DeclarationId(324), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/error_primitives.dag", 920, 959), - }); - declarations.push(Declaration { - id: DeclarationId(15), - name: Some("Magma".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "op".to_string(), - ty: DeclarationId(334), - }], - }, - type_params: vec![DeclarationId(16)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 4702, 4739), - }); - declarations.push(Declaration { - id: DeclarationId(16), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 4702, 4739), - }); - declarations.push(Declaration { - id: DeclarationId(17), - name: Some("Semigroup".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "op".to_string(), - ty: DeclarationId(335), - }], - }, - type_params: vec![DeclarationId(18)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 4817, 4939), - }); - declarations.push(Declaration { - id: DeclarationId(18), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 4817, 4939), - }); - declarations.push(Declaration { - id: DeclarationId(19), - name: Some("Monoid".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "op".to_string(), - ty: DeclarationId(336), - }, - Field { - label: "identity".to_string(), - ty: DeclarationId(20), - }, - ], - }, - type_params: vec![DeclarationId(20)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 5037, 5089), - }); - declarations.push(Declaration { - id: DeclarationId(20), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 5037, 5089), - }); - declarations.push(Declaration { - id: DeclarationId(21), - name: Some("CommutativeMonoid".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "op".to_string(), - ty: DeclarationId(337), - }, - Field { - label: "identity".to_string(), - ty: DeclarationId(22), - }, - ], - }, - type_params: vec![DeclarationId(22)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 5148, 5239), - }); - declarations.push(Declaration { - id: DeclarationId(22), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 5148, 5239), - }); - declarations.push(Declaration { - id: DeclarationId(23), - name: Some("Group".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "op".to_string(), - ty: DeclarationId(338), - }, - Field { - label: "identity".to_string(), - ty: DeclarationId(24), - }, - Field { - label: "inverse".to_string(), - ty: DeclarationId(339), - }, - ], - }, - type_params: vec![DeclarationId(24)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 5311, 5384), - }); - declarations.push(Declaration { - id: DeclarationId(24), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 5311, 5384), - }); - declarations.push(Declaration { - id: DeclarationId(25), - name: Some("AbelianGroup".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "op".to_string(), - ty: DeclarationId(340), - }, - Field { - label: "identity".to_string(), - ty: DeclarationId(26), - }, - Field { - label: "inverse".to_string(), - ty: DeclarationId(341), - }, - ], - }, - type_params: vec![DeclarationId(26)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 5422, 5530), - }); - declarations.push(Declaration { - id: DeclarationId(26), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 5422, 5530), - }); - declarations.push(Declaration { - id: DeclarationId(27), - name: Some("GroupCompletion".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![DeclarationId(28)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 7957, 7977), - }); - declarations.push(Declaration { - id: DeclarationId(28), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("M".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 7957, 7977), - }); - declarations.push(Declaration { - id: DeclarationId(29), - name: Some("FieldOfFractions".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![DeclarationId(30)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 10044, 10065), - }); - declarations.push(Declaration { - id: DeclarationId(30), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("R".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 10044, 10065), - }); - declarations.push(Declaration { - id: DeclarationId(31), - name: Some("Semiring".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "add".to_string(), - ty: DeclarationId(342), - }, - Field { - label: "zero".to_string(), - ty: DeclarationId(32), - }, - Field { - label: "mul".to_string(), - ty: DeclarationId(343), - }, - Field { - label: "one".to_string(), - ty: DeclarationId(32), - }, - ], - }, - type_params: vec![DeclarationId(32)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 10502, 10583), - }); - declarations.push(Declaration { - id: DeclarationId(32), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 10502, 10583), - }); - declarations.push(Declaration { - id: DeclarationId(33), - name: Some("CommutativeSemiring".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "add".to_string(), - ty: DeclarationId(344), - }, - Field { - label: "zero".to_string(), - ty: DeclarationId(34), - }, - Field { - label: "mul".to_string(), - ty: DeclarationId(345), - }, - Field { - label: "one".to_string(), - ty: DeclarationId(34), - }, - ], - }, - type_params: vec![DeclarationId(34)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 10977, 11069), - }); - declarations.push(Declaration { - id: DeclarationId(34), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 10977, 11069), - }); - declarations.push(Declaration { - id: DeclarationId(35), - name: Some("Ring".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "add".to_string(), - ty: DeclarationId(346), - }, - Field { - label: "zero".to_string(), - ty: DeclarationId(36), - }, - Field { - label: "negate".to_string(), - ty: DeclarationId(347), - }, - Field { - label: "mul".to_string(), - ty: DeclarationId(348), - }, - Field { - label: "one".to_string(), - ty: DeclarationId(36), - }, - ], - }, - type_params: vec![DeclarationId(36)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 11196, 11294), - }); - declarations.push(Declaration { - id: DeclarationId(36), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 11196, 11294), - }); - declarations.push(Declaration { - id: DeclarationId(37), - name: Some("OrderedRing".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "add".to_string(), - ty: DeclarationId(349), - }, - Field { - label: "sub".to_string(), - ty: DeclarationId(350), - }, - Field { - label: "zero".to_string(), - ty: DeclarationId(38), - }, - Field { - label: "negate".to_string(), - ty: DeclarationId(351), - }, - Field { - label: "mul".to_string(), - ty: DeclarationId(352), - }, - Field { - label: "div".to_string(), - ty: DeclarationId(354), - }, - Field { - label: "one".to_string(), - ty: DeclarationId(38), - }, - Field { - label: "compare".to_string(), - ty: DeclarationId(355), - }, - Field { - label: "eq".to_string(), - ty: DeclarationId(356), - }, - Field { - label: "ne".to_string(), - ty: DeclarationId(357), - }, - Field { - label: "lt".to_string(), - ty: DeclarationId(358), - }, - Field { - label: "le".to_string(), - ty: DeclarationId(359), - }, - Field { - label: "gt".to_string(), - ty: DeclarationId(360), - }, - Field { - label: "ge".to_string(), - ty: DeclarationId(361), - }, - ], - }, - type_params: vec![DeclarationId(38)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12055, 12390), - }); - declarations.push(Declaration { - id: DeclarationId(38), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12055, 12390), - }); - declarations.push(Declaration { - id: DeclarationId(39), - name: Some("Field".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "add".to_string(), - ty: DeclarationId(362), - }, - Field { - label: "zero".to_string(), - ty: DeclarationId(40), - }, - Field { - label: "negate".to_string(), - ty: DeclarationId(363), - }, - Field { - label: "mul".to_string(), - ty: DeclarationId(364), - }, - Field { - label: "one".to_string(), - ty: DeclarationId(40), - }, - Field { - label: "reciprocal".to_string(), - ty: DeclarationId(365), - }, - Field { - label: "compare".to_string(), - ty: DeclarationId(366), - }, - ], - }, - type_params: vec![DeclarationId(40)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12528, 12684), - }); - declarations.push(Declaration { - id: DeclarationId(40), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12528, 12684), - }); - declarations.push(Declaration { - id: DeclarationId(41), - name: Some("Lattice".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "meet".to_string(), - ty: DeclarationId(367), - }, - Field { - label: "join".to_string(), - ty: DeclarationId(368), - }, - ], - }, - type_params: vec![DeclarationId(42)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 13004, 13067), - }); - declarations.push(Declaration { - id: DeclarationId(42), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 13004, 13067), - }); - declarations.push(Declaration { - id: DeclarationId(43), - name: Some("BoundedLattice".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "meet".to_string(), - ty: DeclarationId(369), - }, - Field { - label: "join".to_string(), - ty: DeclarationId(370), - }, - Field { - label: "top".to_string(), - ty: DeclarationId(44), - }, - Field { - label: "bottom".to_string(), - ty: DeclarationId(44), - }, - ], - }, - type_params: vec![DeclarationId(44)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 13175, 13266), - }); - declarations.push(Declaration { - id: DeclarationId(44), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 13175, 13266), - }); - declarations.push(Declaration { - id: DeclarationId(45), - name: Some("BooleanAlgebra".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "meet".to_string(), - ty: DeclarationId(371), - }, - Field { - label: "join".to_string(), - ty: DeclarationId(372), - }, - Field { - label: "complement".to_string(), - ty: DeclarationId(373), - }, - Field { - label: "top".to_string(), - ty: DeclarationId(46), - }, - Field { - label: "bottom".to_string(), - ty: DeclarationId(46), - }, - ], - }, - type_params: vec![DeclarationId(46)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 13464, 13580), - }); - declarations.push(Declaration { - id: DeclarationId(46), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 13464, 13580), - }); - declarations.push(Declaration { - id: DeclarationId(47), - name: Some("FreeMonoid".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "concat".to_string(), - ty: DeclarationId(377), - }, - Field { - label: "empty".to_string(), - ty: DeclarationId(378), - }, - Field { - label: "append".to_string(), - ty: DeclarationId(380), - }, - Field { - label: "slice".to_string(), - ty: DeclarationId(382), - }, - Field { - label: "length".to_string(), - ty: DeclarationId(383), - }, - Field { - label: "is_empty".to_string(), - ty: DeclarationId(384), - }, - Field { - label: "count".to_string(), - ty: DeclarationId(385), - }, - Field { - label: "first".to_string(), - ty: DeclarationId(387), - }, - Field { - label: "last".to_string(), - ty: DeclarationId(389), - }, - Field { - label: "map".to_string(), - ty: DeclarationId(392), - }, - Field { - label: "filter".to_string(), - ty: DeclarationId(395), - }, - Field { - label: "fold".to_string(), - ty: DeclarationId(397), - }, - Field { - label: "flat_map".to_string(), - ty: DeclarationId(401), - }, - Field { - label: "any".to_string(), - ty: DeclarationId(403), - }, - Field { - label: "all".to_string(), - ty: DeclarationId(405), - }, - Field { - label: "enumerate".to_string(), - ty: DeclarationId(409), - }, - Field { - label: "reverse".to_string(), - ty: DeclarationId(411), - }, - Field { - label: "skip".to_string(), - ty: DeclarationId(413), - }, - Field { - label: "take".to_string(), - ty: DeclarationId(415), - }, - Field { - label: "sort_by".to_string(), - ty: DeclarationId(418), - }, - Field { - label: "contains".to_string(), - ty: DeclarationId(419), - }, - ], - }, - type_params: vec![DeclarationId(48)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17472, 18434), - }); - declarations.push(Declaration { - id: DeclarationId(48), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17472, 18434), - }); - declarations.push(Declaration { - id: DeclarationId(49), - name: Some("PartialFunction".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "lookup".to_string(), - ty: DeclarationId(422), - }, - Field { - label: "empty".to_string(), - ty: DeclarationId(423), - }, - Field { - label: "get".to_string(), - ty: DeclarationId(425), - }, - Field { - label: "insert".to_string(), - ty: DeclarationId(427), - }, - Field { - label: "merge".to_string(), - ty: DeclarationId(430), - }, - Field { - label: "keys".to_string(), - ty: DeclarationId(432), - }, - Field { - label: "values".to_string(), - ty: DeclarationId(434), - }, - Field { - label: "has".to_string(), - ty: DeclarationId(435), - }, - Field { - label: "contains_key".to_string(), - ty: DeclarationId(436), - }, - Field { - label: "size".to_string(), - ty: DeclarationId(437), - }, - ], - }, - type_params: vec![DeclarationId(50), DeclarationId(51)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18963, 19310), - }); - declarations.push(Declaration { - id: DeclarationId(50), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("K".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18963, 19310), - }); - declarations.push(Declaration { - id: DeclarationId(51), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("V".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18963, 19310), - }); - declarations.push(Declaration { - id: DeclarationId(52), - name: Some("Ordering".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Less".to_string(), - ty: DeclarationId(438), - }, - Field { - label: "Equal".to_string(), - ty: DeclarationId(439), - }, - Field { - label: "Greater".to_string(), - ty: DeclarationId(440), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19511, 19549), - }); - declarations.push(Declaration { - id: DeclarationId(53), - name: Some("AlgebraProfile".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "OrderedRingProfile".to_string(), - ty: DeclarationId(441), - }, - Field { - label: "ApproximateFieldProfile".to_string(), - ty: DeclarationId(442), - }, - Field { - label: "BooleanAlgebraProfile".to_string(), - ty: DeclarationId(443), - }, - Field { - label: "BooleanAlgebraCollectionProfile".to_string(), - ty: DeclarationId(444), - }, - Field { - label: "FreeMonoidScalarProfile".to_string(), - ty: DeclarationId(445), - }, - Field { - label: "FreeMonoidCollectionProfile".to_string(), - ty: DeclarationId(446), - }, - Field { - label: "PartialFunctionProfile".to_string(), - ty: DeclarationId(447), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 21634, 21853), - }); - declarations.push(Declaration { - id: DeclarationId(54), - name: Some("ContainerSource".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "SameAsReceiver".to_string(), - ty: DeclarationId(448), - }, - Field { - label: "Named".to_string(), - ty: DeclarationId(449), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 21855, 21921), - }); - declarations.push(Declaration { - id: DeclarationId(55), - name: Some("AlgebraTypeTemplate".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ReceiverSelf".to_string(), - ty: DeclarationId(450), - }, - Field { - label: "ReceiverElement".to_string(), - ty: DeclarationId(451), - }, - Field { - label: "ReceiverKey".to_string(), - ty: DeclarationId(452), - }, - Field { - label: "ReceiverValue".to_string(), - ty: DeclarationId(453), - }, - Field { - label: "NamedTemplate".to_string(), - ty: DeclarationId(454), - }, - Field { - label: "ContainerOf".to_string(), - ty: DeclarationId(455), - }, - Field { - label: "OptionalOf".to_string(), - ty: DeclarationId(456), - }, - Field { - label: "WitnessOf".to_string(), - ty: DeclarationId(457), - }, - Field { - label: "TupleOf".to_string(), - ty: DeclarationId(458), - }, - Field { - label: "CallableOf".to_string(), - ty: DeclarationId(460), - }, - Field { - label: "AlgebraTypeVariable".to_string(), - ty: DeclarationId(461), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 21923, 22416), - }); - declarations.push(Declaration { - id: DeclarationId(56), - name: Some("CollectionSizeEffect".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ShrinkEffect".to_string(), - ty: DeclarationId(462), - }, - Field { - label: "ProjectionEffect".to_string(), - ty: DeclarationId(463), - }, - Field { - label: "IdentityEffect".to_string(), - ty: DeclarationId(464), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 22632, 22809), - }); - declarations.push(Declaration { - id: DeclarationId(57), - name: Some("CostShape".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ShapeConstant".to_string(), - ty: DeclarationId(465), - }, - Field { - label: "ShapeLinearScan".to_string(), - ty: DeclarationId(466), - }, - Field { - label: "ShapeIterateBody".to_string(), - ty: DeclarationId(467), - }, - Field { - label: "ShapeSortBody".to_string(), - ty: DeclarationId(468), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23267, 23452), - }); - declarations.push(Declaration { - id: DeclarationId(58), - name: Some("AlgebraFieldTemplate".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "param_types".to_string(), - ty: DeclarationId(469), - }, - Field { - label: "return_type".to_string(), - ty: DeclarationId(55), - }, - Field { - label: "size_effect".to_string(), - ty: DeclarationId(470), - }, - Field { - label: "cost_shape".to_string(), - ty: DeclarationId(471), - }, - Field { - label: "callback_element_position".to_string(), - ty: DeclarationId(472), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23477, 23908), - }); - declarations.push(Declaration { - id: DeclarationId(59), - name: Some("kernel_algebra_profile".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(53), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(473)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Map( - FieldMap::from_entries(vec![ - ( - "Int".to_string(), - FieldValue::Variant { - constructor: DeclarationId(441), - payload: vec![], - }, - ), - ( - "Float".to_string(), - FieldValue::Variant { - constructor: DeclarationId(442), - payload: vec![], - }, - ), - ( - "Bool".to_string(), - FieldValue::Variant { - constructor: DeclarationId(443), - payload: vec![], - }, - ), - ( - "String".to_string(), - FieldValue::Variant { - constructor: DeclarationId(445), - payload: vec![], - }, - ), - ( - "List".to_string(), - FieldValue::Variant { - constructor: DeclarationId(446), - payload: vec![], - }, - ), - ( - "Set".to_string(), - FieldValue::Variant { - constructor: DeclarationId(444), - payload: vec![], - }, - ), - ( - "Map".to_string(), - FieldValue::Variant { - constructor: DeclarationId(447), - payload: vec![], - }, - ), - ]) - .expect("ValueBody::Map"), - )), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23910, 24220), - }); - declarations.push(Declaration { - id: DeclarationId(60), - name: Some("ordered_ring_templates".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(325), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/algebra.dag", 24280, 25425)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 24222, 25425), - }); - declarations.push(Declaration { - id: DeclarationId(61), - name: Some("approximate_field_templates".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(326), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/algebra.dag", 25490, 26584)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 25427, 26584), - }); - declarations.push(Declaration { - id: DeclarationId(62), - name: Some("boolean_algebra_templates".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(327), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/algebra.dag", 26647, 27408)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 26586, 27408), - }); - declarations.push(Declaration { - id: DeclarationId(63), - name: Some("boolean_algebra_collection_templates".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(328), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/algebra.dag", 27773, 31163)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 27701, 31163), - }); - declarations.push(Declaration { - id: DeclarationId(64), - name: Some("free_monoid_scalar_templates".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(329), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/algebra.dag", 31229, 34472)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 31165, 34472), - }); - declarations.push(Declaration { - id: DeclarationId(65), - name: Some("free_monoid_collection_templates".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(330), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/algebra.dag", 34542, 39903)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 34474, 39903), - }); - declarations.push(Declaration { - id: DeclarationId(66), - name: Some("partial_function_templates".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(331), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/algebra.dag", 39967, 42790)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 39905, 42790), - }); - declarations.push(Declaration { - id: DeclarationId(67), - name: Some("algebra_templates_for_profile".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(53)], - output: DeclarationId(332), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/algebra.dag", 42880, 43343)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 42792, 43343), - }); - declarations.push(Declaration { - id: DeclarationId(68), - name: Some("algebra_type_param_names".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(53)], - output: DeclarationId(333), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/algebra.dag", 43685, 43966)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 43616, 43966), - }); - declarations.push(Declaration { - id: DeclarationId(69), - name: Some("Magnitude".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/magnitude.dag", 1464, 1478), - }); - declarations.push(Declaration { - id: DeclarationId(70), - name: Some("MachineWidth".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![DeclarationId(71)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/machine_constraints.dag", 3296, 3313), - }); - declarations.push(Declaration { - id: DeclarationId(71), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("bits".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/machine_constraints.dag", 3296, 3313), - }); - declarations.push(Declaration { - id: DeclarationId(72), - name: Some("PointerWidth".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/machine_constraints.dag", 6208, 6225), - }); - declarations.push(Declaration { - id: DeclarationId(73), - name: Some("Compose".to_string()), - connective: TypeConnective::Disj { - variants: vec![Field { - label: "Phantom".to_string(), - ty: DeclarationId(474), - }], - }, - type_params: vec![DeclarationId(74), DeclarationId(75)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/machine_constraints.dag", 7292, 7342), - }); - declarations.push(Declaration { - id: DeclarationId(74), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Algebra".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/machine_constraints.dag", 7292, 7342), - }); - declarations.push(Declaration { - id: DeclarationId(75), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam( - "MachineConstraint".to_string(), - )), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/machine_constraints.dag", 7292, 7342), - }); - declarations.push(Declaration { - id: DeclarationId(76), - name: Some("Nat".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(33), - arguments: vec![TemplateArgument { - parameter: DeclarationId(34), - value: DeclarationId(69), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/nat.dag", 2186, 2227), - }); - declarations.push(Declaration { - id: DeclarationId(77), - name: Some("Int8".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(73), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(74), - value: DeclarationId(87), - }, - TemplateArgument { - parameter: DeclarationId(75), - value: DeclarationId(476), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2549, 2590), - }); - declarations.push(Declaration { - id: DeclarationId(78), - name: Some("Int16".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(73), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(74), - value: DeclarationId(87), - }, - TemplateArgument { - parameter: DeclarationId(75), - value: DeclarationId(478), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2591, 2634), - }); - declarations.push(Declaration { - id: DeclarationId(79), - name: Some("Int32".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(73), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(74), - value: DeclarationId(87), - }, - TemplateArgument { - parameter: DeclarationId(75), - value: DeclarationId(480), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2635, 2678), - }); - declarations.push(Declaration { - id: DeclarationId(80), - name: Some("Int64".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(73), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(74), - value: DeclarationId(87), - }, - TemplateArgument { - parameter: DeclarationId(75), - value: DeclarationId(482), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2679, 2722), - }); - declarations.push(Declaration { - id: DeclarationId(81), - name: Some("Int128".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(73), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(74), - value: DeclarationId(87), - }, - TemplateArgument { - parameter: DeclarationId(75), - value: DeclarationId(484), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2723, 2768), - }); - declarations.push(Declaration { - id: DeclarationId(82), - name: Some("UInt8".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(73), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(74), - value: DeclarationId(88), - }, - TemplateArgument { - parameter: DeclarationId(75), - value: DeclarationId(486), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2834, 2877), - }); - declarations.push(Declaration { - id: DeclarationId(83), - name: Some("UInt16".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(73), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(74), - value: DeclarationId(88), - }, - TemplateArgument { - parameter: DeclarationId(75), - value: DeclarationId(488), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2878, 2923), - }); - declarations.push(Declaration { - id: DeclarationId(84), - name: Some("UInt32".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(73), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(74), - value: DeclarationId(88), - }, - TemplateArgument { - parameter: DeclarationId(75), - value: DeclarationId(490), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2924, 2969), - }); - declarations.push(Declaration { - id: DeclarationId(85), - name: Some("UInt64".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(73), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(74), - value: DeclarationId(88), - }, - TemplateArgument { - parameter: DeclarationId(75), - value: DeclarationId(492), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2970, 3015), - }); - declarations.push(Declaration { - id: DeclarationId(86), - name: Some("UInt128".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(73), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(74), - value: DeclarationId(88), - }, - TemplateArgument { - parameter: DeclarationId(75), - value: DeclarationId(494), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 3016, 3063), - }); - declarations.push(Declaration { - id: DeclarationId(87), - name: Some("Int".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(25), - arguments: vec![TemplateArgument { - parameter: DeclarationId(26), - value: DeclarationId(495), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 5921, 5966), - }); - declarations.push(Declaration { - id: DeclarationId(88), - name: Some("UInt".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(76), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 5967, 5982), - }); - declarations.push(Declaration { - id: DeclarationId(89), - name: Some("IntPlatform".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(73), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(74), - value: DeclarationId(87), - }, - TemplateArgument { - parameter: DeclarationId(75), - value: DeclarationId(496), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 7619, 7680), - }); - declarations.push(Declaration { - id: DeclarationId(90), - name: Some("UIntPlatform".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(73), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(74), - value: DeclarationId(88), - }, - TemplateArgument { - parameter: DeclarationId(75), - value: DeclarationId(497), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 7681, 7742), - }); - declarations.push(Declaration { - id: DeclarationId(91), - name: Some("NonNegativeInt".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(76), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 9184, 9209), - }); - declarations.push(Declaration { - id: DeclarationId(92), - name: Some("PositiveInt".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(76))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(498)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 9210, 9249), - }); - declarations.push(Declaration { - id: DeclarationId(93), - name: Some("Rational".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(39), - arguments: vec![TemplateArgument { - parameter: DeclarationId(40), - value: DeclarationId(499), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/rational.dag", 1245, 1289), - }); - declarations.push(Declaration { - id: DeclarationId(94), - name: Some("RoundingMode".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ToNearestEven".to_string(), - ty: DeclarationId(500), - }, - Field { - label: "ToZero".to_string(), - ty: DeclarationId(501), - }, - Field { - label: "ToPositiveInfinity".to_string(), - ty: DeclarationId(502), - }, - Field { - label: "ToNegativeInfinity".to_string(), - ty: DeclarationId(503), - }, - Field { - label: "ToAwayFromZero".to_string(), - ty: DeclarationId(504), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 1030, 1141), - }); - declarations.push(Declaration { - id: DeclarationId(95), - name: Some("Precision".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Unbounded".to_string(), - ty: DeclarationId(505), - }, - Field { - label: "BinaryPrecision".to_string(), - ty: DeclarationId(506), - }, - Field { - label: "DecimalPrecision".to_string(), - ty: DeclarationId(507), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 1404, 1589), - }); - declarations.push(Declaration { - id: DeclarationId(96), - name: Some("NanPolicy".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "NoNaN".to_string(), - ty: DeclarationId(508), - }, - Field { - label: "QuietNaN".to_string(), - ty: DeclarationId(509), - }, - Field { - label: "QuietAndSignalingNaN".to_string(), - ty: DeclarationId(510), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 1812, 1868), - }); - declarations.push(Declaration { - id: DeclarationId(97), - name: Some("InfinityPolicy".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "NoInfinity".to_string(), - ty: DeclarationId(511), - }, - Field { - label: "SignedInfinity".to_string(), - ty: DeclarationId(512), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 2096, 2145), - }); - declarations.push(Declaration { - id: DeclarationId(98), - name: Some("SignedZeroPolicy".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "NoSignedZero".to_string(), - ty: DeclarationId(513), - }, - Field { - label: "SignedZero".to_string(), - ty: DeclarationId(514), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 2376, 2425), - }); - declarations.push(Declaration { - id: DeclarationId(99), - name: Some("SubnormalPolicy".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "NoSubnormals".to_string(), - ty: DeclarationId(515), - }, - Field { - label: "GradualUnderflow".to_string(), - ty: DeclarationId(516), - }, - Field { - label: "FlushToZero".to_string(), - ty: DeclarationId(517), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 2720, 2788), - }); - declarations.push(Declaration { - id: DeclarationId(100), - name: Some("SpecialValues".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "nan".to_string(), - ty: DeclarationId(96), - }, - Field { - label: "infinity".to_string(), - ty: DeclarationId(97), - }, - Field { - label: "signed_zero".to_string(), - ty: DeclarationId(98), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 3064, 3162), - }); - declarations.push(Declaration { - id: DeclarationId(101), - name: Some("ApproximateField".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "base".to_string(), - ty: DeclarationId(518), - }, - Field { - label: "rounding".to_string(), - ty: DeclarationId(94), - }, - Field { - label: "precision".to_string(), - ty: DeclarationId(95), - }, - Field { - label: "special_values".to_string(), - ty: DeclarationId(100), - }, - Field { - label: "subnormal_policy".to_string(), - ty: DeclarationId(99), - }, - ], - }, - type_params: vec![DeclarationId(102)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 3398, 3559), - }); - declarations.push(Declaration { - id: DeclarationId(102), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("F".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 3398, 3559), - }); - declarations.push(Declaration { - id: DeclarationId(103), - name: Some("Ieee754Float".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/float.dag", 1255, 1272), - }); - declarations.push(Declaration { - id: DeclarationId(104), - name: Some("Real".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(101), - arguments: vec![TemplateArgument { - parameter: DeclarationId(102), - value: DeclarationId(519), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/float.dag", 1453, 1504), - }); - declarations.push(Declaration { - id: DeclarationId(105), - name: Some("Real32".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(73), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(74), - value: DeclarationId(104), - }, - TemplateArgument { - parameter: DeclarationId(75), - value: DeclarationId(521), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/float.dag", 1726, 1771), - }); - declarations.push(Declaration { - id: DeclarationId(106), - name: Some("Real64".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(73), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(74), - value: DeclarationId(104), - }, - TemplateArgument { - parameter: DeclarationId(75), - value: DeclarationId(523), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/float.dag", 1772, 1817), - }); - declarations.push(Declaration { - id: DeclarationId(107), - name: Some("Float32".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(105), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/float.dag", 1819, 1840), - }); - declarations.push(Declaration { - id: DeclarationId(108), - name: Some("Float64".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(106), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/float.dag", 1841, 1862), - }); - declarations.push(Declaration { - id: DeclarationId(109), - name: Some("Float".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(108), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/float.dag", 1881, 1901), - }); - declarations.push(Declaration { - id: DeclarationId(110), - name: Some("kernel_type_set".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(124), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(639)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Map( - FieldMap::from_entries(vec![ - ( - "String".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ( - "Int".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ( - "Bool".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ( - "Float".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ( - "Secret".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ( - "Json".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ( - "Unit".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ( - "Bytes".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ]) - .expect("ValueBody::Map"), - )), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 3041, 3206), - }); - declarations.push(Declaration { - id: DeclarationId(111), - name: Some("is_kernel_type".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227)], - output: DeclarationId(124), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/types.dag", 3248, 3349)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 3208, 3349), - }); - declarations.push(Declaration { - id: DeclarationId(112), - name: Some("container_type_arity".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(87), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(640)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Map( - FieldMap::from_entries(vec![ - ( - "List".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ( - "Set".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ( - "Map".to_string(), - FieldValue::Literal(LiteralBits::Int("2".to_string())), - ), - ( - "Witness".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ]) - .expect("ValueBody::Map"), - )), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 3511, 3606), - }); - declarations.push(Declaration { - id: DeclarationId(113), - name: Some("is_container_type".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227)], - output: DeclarationId(124), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/types.dag", 3651, 3758)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 3608, 3758), - }); - declarations.push(Declaration { - id: DeclarationId(114), - name: Some("container_expected_arity".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227)], - output: DeclarationId(524), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/types.dag", 3810, 3851)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 3760, 3851), - }); - declarations.push(Declaration { - id: DeclarationId(115), - name: Some("container_param_names_for".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227)], - output: DeclarationId(525), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/types.dag", 4091, 4296)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 4027, 4296), - }); - declarations.push(Declaration { - id: DeclarationId(116), - name: Some("container_param_name".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227), DeclarationId(87)], - output: DeclarationId(526), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/types.dag", 4364, 4612)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 4298, 4612), - }); - declarations.push(Declaration { - id: DeclarationId(117), - name: Some("ordered_element_collections".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(124), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(641)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Map( - FieldMap::from_entries(vec![( - "List".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - )]) - .expect("ValueBody::Map"), - )), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 4806, 4878), - }); - declarations.push(Declaration { - id: DeclarationId(118), - name: Some("is_ordered_element_collection".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227)], - output: DeclarationId(124), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/types.dag", 4935, 4992)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 4880, 4992), - }); - declarations.push(Declaration { - id: DeclarationId(119), - name: Some("container_template_algebra_rows".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(642)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Map( - FieldMap::from_entries(vec![ - ( - "List".to_string(), - FieldValue::Literal(LiteralBits::String("FreeMonoid".to_string())), - ), - ( - "list".to_string(), - FieldValue::Literal(LiteralBits::String("FreeMonoid".to_string())), - ), - ( - "Set".to_string(), - FieldValue::Literal(LiteralBits::String("BooleanAlgebra".to_string())), - ), - ( - "set".to_string(), - FieldValue::Literal(LiteralBits::String("BooleanAlgebra".to_string())), - ), - ( - "Map".to_string(), - FieldValue::Literal(LiteralBits::String("PartialFunction".to_string())), - ), - ( - "map".to_string(), - FieldValue::Literal(LiteralBits::String("PartialFunction".to_string())), - ), - ( - "FreeMonoid".to_string(), - FieldValue::Literal(LiteralBits::String("FreeMonoid".to_string())), - ), - ( - "free_monoid".to_string(), - FieldValue::Literal(LiteralBits::String("FreeMonoid".to_string())), - ), - ( - "BooleanAlgebra".to_string(), - FieldValue::Literal(LiteralBits::String("BooleanAlgebra".to_string())), - ), - ( - "boolean_algebra".to_string(), - FieldValue::Literal(LiteralBits::String("BooleanAlgebra".to_string())), - ), - ( - "PartialFunction".to_string(), - FieldValue::Literal(LiteralBits::String("PartialFunction".to_string())), - ), - ( - "partial_function".to_string(), - FieldValue::Literal(LiteralBits::String("PartialFunction".to_string())), - ), - ]) - .expect("ValueBody::Map"), - )), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 5784, 6223), - }); - declarations.push(Declaration { - id: DeclarationId(120), - name: Some("container_template_alias_rows".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(643)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Map( - FieldMap::from_entries(vec![ - ( - "List".to_string(), - FieldValue::Literal(LiteralBits::String("FreeMonoid".to_string())), - ), - ( - "list".to_string(), - FieldValue::Literal(LiteralBits::String("FreeMonoid".to_string())), - ), - ( - "Set".to_string(), - FieldValue::Literal(LiteralBits::String("BooleanAlgebra".to_string())), - ), - ( - "set".to_string(), - FieldValue::Literal(LiteralBits::String("BooleanAlgebra".to_string())), - ), - ( - "Map".to_string(), - FieldValue::Literal(LiteralBits::String("PartialFunction".to_string())), - ), - ( - "map".to_string(), - FieldValue::Literal(LiteralBits::String("PartialFunction".to_string())), - ), - ]) - .expect("ValueBody::Map"), - )), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 6389, 6607), - }); - declarations.push(Declaration { - id: DeclarationId(121), - name: Some("container_template_algebra".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227)], - output: DeclarationId(527), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/types.dag", 6664, 6716)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 6609, 6716), - }); - declarations.push(Declaration { - id: DeclarationId(122), - name: Some("container_template_alias_algebra".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227)], - output: DeclarationId(528), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/types.dag", 6779, 6829)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 6718, 6829), - }); - declarations.push(Declaration { - id: DeclarationId(123), - name: Some("canonical_container_names".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(529), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/types.dag", 7242, 7332)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 7195, 7332), - }); - declarations.push(Declaration { - id: DeclarationId(124), - name: Some("Bool".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "True".to_string(), - ty: DeclarationId(530), - }, - Field { - label: "False".to_string(), - ty: DeclarationId(531), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: Some(DeclarationId(532)), - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 8306, 8330), - }); - declarations.push(Declaration { - id: DeclarationId(125), - name: Some("Unit".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 8398, 8407), - }); - declarations.push(Declaration { - id: DeclarationId(126), - name: Some("Json".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 8524, 8533), - }); - declarations.push(Declaration { - id: DeclarationId(127), - name: Some("Bytes".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 8534, 8544), - }); - declarations.push(Declaration { - id: DeclarationId(128), - name: Some("Char".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(87))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(644)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 9172, 9223), - }); - declarations.push(Declaration { - id: DeclarationId(129), - name: Some("List".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(130), - }], - }, - type_params: vec![DeclarationId(130)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 9987, 10027), - }); - declarations.push(Declaration { - id: DeclarationId(130), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("element".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 9987, 10027), - }); - declarations.push(Declaration { - id: DeclarationId(131), - name: Some("Set".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(45), - arguments: vec![TemplateArgument { - parameter: DeclarationId(46), - value: DeclarationId(132), - }], - }, - type_params: vec![DeclarationId(132)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 10028, 10071), - }); - declarations.push(Declaration { - id: DeclarationId(132), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("element".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 10028, 10071), - }); - declarations.push(Declaration { - id: DeclarationId(133), - name: Some("Map".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(49), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(50), - value: DeclarationId(134), - }, - TemplateArgument { - parameter: DeclarationId(51), - value: DeclarationId(135), - }, - ], - }, - type_params: vec![DeclarationId(134), DeclarationId(135)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 10072, 10122), - }); - declarations.push(Declaration { - id: DeclarationId(134), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("key".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 10072, 10122), - }); - declarations.push(Declaration { - id: DeclarationId(135), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("value".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 10072, 10122), - }); - declarations.push(Declaration { - id: DeclarationId(136), - name: Some("CommitSha".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 11468, 11494), - }); - declarations.push(Declaration { - id: DeclarationId(137), - name: Some("Sha256".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 11562, 11588), - }); - declarations.push(Declaration { - id: DeclarationId(138), - name: Some("RetryCount".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(87))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(645)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 11589, 11640), - }); - declarations.push(Declaration { - id: DeclarationId(139), - name: Some("HttpStatus".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(87))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(646)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 11641, 11696), - }); - declarations.push(Declaration { - id: DeclarationId(140), - name: Some("Email".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 11770, 11796), - }); - declarations.push(Declaration { - id: DeclarationId(141), - name: Some("Port".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(87))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(647)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 11797, 11852), - }); - declarations.push(Declaration { - id: DeclarationId(142), - name: Some("GistId".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 11941, 11967), - }); - declarations.push(Declaration { - id: DeclarationId(143), - name: Some("Secret".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: Some(NominalOpacity { - permitted_accessors: vec![], - }), - span: SourceSpan::new("dsl/std/types.dag", 11968, 12009), - }); - declarations.push(Declaration { - id: DeclarationId(144), - name: Some("SecretValue".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(143))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(648)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 12010, 12052), - }); - declarations.push(Declaration { - id: DeclarationId(145), - name: Some("Url".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 12113, 12139), - }); - declarations.push(Declaration { - id: DeclarationId(146), - name: Some("SemVer".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 12212, 12238), - }); - declarations.push(Declaration { - id: DeclarationId(147), - name: Some("NonEmptyStr".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(227))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(649)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 12239, 12284), - }); - declarations.push(Declaration { - id: DeclarationId(148), - name: Some("LanguageId".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(227))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(650)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 12285, 12330), - }); - declarations.push(Declaration { - id: DeclarationId(149), - name: Some("SecretName".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(227))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(651)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 12331, 12376), - }); - declarations.push(Declaration { - id: DeclarationId(150), - name: Some("PathSegment".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(147))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(652)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 13011, 13070), - }); - declarations.push(Declaration { - id: DeclarationId(151), - name: Some("GlobSegment".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(147))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(653)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 13071, 13130), - }); - declarations.push(Declaration { - id: DeclarationId(152), - name: Some("FilePathParts".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "segments".to_string(), - ty: DeclarationId(533), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 13131, 13183), - }); - declarations.push(Declaration { - id: DeclarationId(153), - name: Some("GlobPattern".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "segments".to_string(), - ty: DeclarationId(534), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 13184, 13234), - }); - declarations.push(Declaration { - id: DeclarationId(154), - name: Some("FilePath".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(227))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(654)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 13235, 13278), - }); - declarations.push(Declaration { - id: DeclarationId(155), - name: Some("SourceSpan".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "file".to_string(), - ty: DeclarationId(154), - }, - Field { - label: "start".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "end".to_string(), - ty: DeclarationId(87), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 13896, 13956), - }); - declarations.push(Declaration { - id: DeclarationId(156), - name: Some("Timestamp".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 14056, 14082), - }); - declarations.push(Declaration { - id: DeclarationId(157), - name: Some("EpochMs".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(87))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(655)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 14083, 14127), - }); - declarations.push(Declaration { - id: DeclarationId(158), - name: Some("Duration".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(87))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(656)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 14128, 14172), - }); - declarations.push(Declaration { - id: DeclarationId(159), - name: Some("Milliseconds".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(87))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(657)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 14173, 14240), - }); - declarations.push(Declaration { - id: DeclarationId(160), - name: Some("Seconds".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(87))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(658)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 14241, 14303), - }); - declarations.push(Declaration { - id: DeclarationId(161), - name: Some("LogicalTime".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(147))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(659)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 14470, 14529), - }); - declarations.push(Declaration { - id: DeclarationId(162), - name: Some("IntentId".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(147))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(660)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15053, 15108), - }); - declarations.push(Declaration { - id: DeclarationId(163), - name: Some("IssueId".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(147))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(661)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15109, 15163), - }); - declarations.push(Declaration { - id: DeclarationId(164), - name: Some("RunKey".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(147))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(662)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15164, 15217), - }); - declarations.push(Declaration { - id: DeclarationId(165), - name: Some("ArtifactId".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(147))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(663)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15218, 15275), - }); - declarations.push(Declaration { - id: DeclarationId(166), - name: Some("LeaseToken".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(147))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(664)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15276, 15333), - }); - declarations.push(Declaration { - id: DeclarationId(167), - name: Some("WorkerId".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(147))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(665)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15334, 15389), - }); - declarations.push(Declaration { - id: DeclarationId(168), - name: Some("CommentId".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(147))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(666)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15390, 15446), - }); - declarations.push(Declaration { - id: DeclarationId(169), - name: Some("SignalKey".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(147))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(667)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15447, 15503), - }); - declarations.push(Declaration { - id: DeclarationId(170), - name: Some("ContentHash".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(147))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(668)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15504, 15562), - }); - declarations.push(Declaration { - id: DeclarationId(171), - name: Some("WorkflowProducerId".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(147))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(669)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15793, 15864), - }); - declarations.push(Declaration { - id: DeclarationId(172), - name: Some("WorkflowObserverId".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(147))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(670)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15865, 15936), - }); - declarations.push(Declaration { - id: DeclarationId(173), - name: Some("WorkflowProverId".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(147))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(671)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15937, 16004), - }); - declarations.push(Declaration { - id: DeclarationId(174), - name: Some("WorkflowRunId".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(147))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(672)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 16005, 16066), - }); - declarations.push(Declaration { - id: DeclarationId(175), - name: Some("GitRef".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(227))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(673)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 16146, 16188), - }); - declarations.push(Declaration { - id: DeclarationId(176), - name: Some("GcpProjectId".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(227))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(674)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 16573, 16615), - }); - declarations.push(Declaration { - id: DeclarationId(177), - name: Some("ServiceAccountEmail".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 16740, 16773), - }); - declarations.push(Declaration { - id: DeclarationId(178), - name: Some("Platform".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Linux".to_string(), - ty: DeclarationId(535), - }, - Field { - label: "Macos".to_string(), - ty: DeclarationId(536), - }, - Field { - label: "Windows".to_string(), - ty: DeclarationId(537), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17159, 17202), - }); - declarations.push(Declaration { - id: DeclarationId(179), - name: Some("TopologyNodeKind".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Pure".to_string(), - ty: DeclarationId(538), - }, - Field { - label: "Transport".to_string(), - ty: DeclarationId(539), - }, - Field { - label: "SubDag".to_string(), - ty: DeclarationId(540), - }, - Field { - label: "Env".to_string(), - ty: DeclarationId(541), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17330, 17385), - }); - declarations.push(Declaration { - id: DeclarationId(180), - name: Some("DocSourceKind".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Template".to_string(), - ty: DeclarationId(542), - }, - Field { - label: "Generated".to_string(), - ty: DeclarationId(543), - }, - Field { - label: "Static".to_string(), - ty: DeclarationId(544), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17386, 17439), - }); - declarations.push(Declaration { - id: DeclarationId(181), - name: Some("FermiDepth".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Xs".to_string(), - ty: DeclarationId(545), - }, - Field { - label: "S".to_string(), - ty: DeclarationId(546), - }, - Field { - label: "M".to_string(), - ty: DeclarationId(547), - }, - Field { - label: "L".to_string(), - ty: DeclarationId(548), - }, - Field { - label: "Xl".to_string(), - ty: DeclarationId(549), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17441, 17478), - }); - declarations.push(Declaration { - id: DeclarationId(182), - name: Some("CredentialFlow".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Stored".to_string(), - ty: DeclarationId(550), - }, - Field { - label: "PlatformInjected".to_string(), - ty: DeclarationId(551), - }, - Field { - label: "WorkloadIdentity".to_string(), - ty: DeclarationId(554), - }, - Field { - label: "InteractiveAuth".to_string(), - ty: DeclarationId(556), - }, - Field { - label: "Chained".to_string(), - ty: DeclarationId(558), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17726, 18048), - }); - declarations.push(Declaration { - id: DeclarationId(183), - name: Some("Arch".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "X86_64".to_string(), - ty: DeclarationId(559), - }, - Field { - label: "X86".to_string(), - ty: DeclarationId(560), - }, - Field { - label: "Aarch64".to_string(), - ty: DeclarationId(561), - }, - Field { - label: "Arm".to_string(), - ty: DeclarationId(562), - }, - Field { - label: "Armv7".to_string(), - ty: DeclarationId(563), - }, - Field { - label: "Mips".to_string(), - ty: DeclarationId(564), - }, - Field { - label: "Mipsel".to_string(), - ty: DeclarationId(565), - }, - Field { - label: "Mips64".to_string(), - ty: DeclarationId(566), - }, - Field { - label: "Mips64el".to_string(), - ty: DeclarationId(567), - }, - Field { - label: "Riscv64".to_string(), - ty: DeclarationId(568), - }, - Field { - label: "Wasm32".to_string(), - ty: DeclarationId(569), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18123, 18226), - }); - declarations.push(Declaration { - id: DeclarationId(184), - name: Some("Vendor".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "UnknownVendor".to_string(), - ty: DeclarationId(570), - }, - Field { - label: "Pc".to_string(), - ty: DeclarationId(571), - }, - Field { - label: "Apple".to_string(), - ty: DeclarationId(572), - }, - Field { - label: "W64".to_string(), - ty: DeclarationId(573), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18227, 18273), - }); - declarations.push(Declaration { - id: DeclarationId(185), - name: Some("Os".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Linux".to_string(), - ty: DeclarationId(574), - }, - Field { - label: "Macos".to_string(), - ty: DeclarationId(575), - }, - Field { - label: "Windows".to_string(), - ty: DeclarationId(576), - }, - Field { - label: "Freebsd".to_string(), - ty: DeclarationId(577), - }, - Field { - label: "Android".to_string(), - ty: DeclarationId(578), - }, - Field { - label: "Ios".to_string(), - ty: DeclarationId(579), - }, - Field { - label: "Wasi".to_string(), - ty: DeclarationId(580), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18274, 18340), - }); - declarations.push(Declaration { - id: DeclarationId(186), - name: Some("AbiEnv".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "NoneAbi".to_string(), - ty: DeclarationId(581), - }, - Field { - label: "Gnu".to_string(), - ty: DeclarationId(582), - }, - Field { - label: "GnuEabi".to_string(), - ty: DeclarationId(583), - }, - Field { - label: "GnuEabihf".to_string(), - ty: DeclarationId(584), - }, - Field { - label: "Musl".to_string(), - ty: DeclarationId(585), - }, - Field { - label: "Msvc".to_string(), - ty: DeclarationId(586), - }, - Field { - label: "AndroidAbi".to_string(), - ty: DeclarationId(587), - }, - Field { - label: "Eabi".to_string(), - ty: DeclarationId(588), - }, - Field { - label: "Eabihf".to_string(), - ty: DeclarationId(589), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18341, 18433), - }); - declarations.push(Declaration { - id: DeclarationId(187), - name: Some("ExecutionEnv".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Native".to_string(), - ty: DeclarationId(590), - }, - Field { - label: "Wsl".to_string(), - ty: DeclarationId(591), - }, - Field { - label: "Container".to_string(), - ty: DeclarationId(592), - }, - Field { - label: "Ci".to_string(), - ty: DeclarationId(593), - }, - Field { - label: "Emulator".to_string(), - ty: DeclarationId(594), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18434, 18494), - }); - declarations.push(Declaration { - id: DeclarationId(188), - name: Some("TargetTriple".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "arch".to_string(), - ty: DeclarationId(183), - }, - Field { - label: "vendor".to_string(), - ty: DeclarationId(184), - }, - Field { - label: "os".to_string(), - ty: DeclarationId(185), - }, - Field { - label: "env".to_string(), - ty: DeclarationId(595), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18496, 18571), - }); - declarations.push(Declaration { - id: DeclarationId(189), - name: Some("RuntimePlatform".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "host".to_string(), - ty: DeclarationId(188), - }, - Field { - label: "env".to_string(), - ty: DeclarationId(187), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18573, 18638), - }); - declarations.push(Declaration { - id: DeclarationId(190), - name: Some("EntryKind".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "RegularFile".to_string(), - ty: DeclarationId(596), - }, - Field { - label: "Directory".to_string(), - ty: DeclarationId(597), - }, - Field { - label: "Symlink".to_string(), - ty: DeclarationId(598), - }, - Field { - label: "Missing".to_string(), - ty: DeclarationId(599), - }, - Field { - label: "Other".to_string(), - ty: DeclarationId(600), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18947, 19025), - }); - declarations.push(Declaration { - id: DeclarationId(191), - name: Some("SymlinkTarget".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "TargetFile".to_string(), - ty: DeclarationId(601), - }, - Field { - label: "TargetDir".to_string(), - ty: DeclarationId(602), - }, - Field { - label: "Broken".to_string(), - ty: DeclarationId(603), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 19155, 19213), - }); - declarations.push(Declaration { - id: DeclarationId(192), - name: Some("TextFilePath".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(154), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 20374, 20404), - }); - declarations.push(Declaration { - id: DeclarationId(193), - name: Some("BinaryFilePath".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(154), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 20485, 20515), - }); - declarations.push(Declaration { - id: DeclarationId(194), - name: Some("MimeType".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 20732, 20754), - }); - declarations.push(Declaration { - id: DeclarationId(195), - name: Some("HttpMethod".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "GET".to_string(), - ty: DeclarationId(604), - }, - Field { - label: "POST".to_string(), - ty: DeclarationId(605), - }, - Field { - label: "PUT".to_string(), - ty: DeclarationId(606), - }, - Field { - label: "PATCH".to_string(), - ty: DeclarationId(607), - }, - Field { - label: "DELETE".to_string(), - ty: DeclarationId(608), - }, - Field { - label: "HEAD".to_string(), - ty: DeclarationId(609), - }, - Field { - label: "OPTIONS".to_string(), - ty: DeclarationId(610), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 21498, 21566), - }); - declarations.push(Declaration { - id: DeclarationId(196), - name: Some("AuthScheme".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Bearer".to_string(), - ty: DeclarationId(611), - }, - Field { - label: "Header".to_string(), - ty: DeclarationId(612), - }, - Field { - label: "Basic".to_string(), - ty: DeclarationId(613), - }, - Field { - label: "ApiKey".to_string(), - ty: DeclarationId(614), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22034, 22130), - }); - declarations.push(Declaration { - id: DeclarationId(197), - name: Some("AccessToken".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "token".to_string(), - ty: DeclarationId(143), - }, - Field { - label: "scheme".to_string(), - ty: DeclarationId(196), - }, - Field { - label: "expires_at".to_string(), - ty: DeclarationId(615), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22252, 22385), - }); - declarations.push(Declaration { - id: DeclarationId(198), - name: Some("Credential".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "token".to_string(), - ty: DeclarationId(143), - }, - Field { - label: "scheme".to_string(), - ty: DeclarationId(196), - }, - Field { - label: "header_name".to_string(), - ty: DeclarationId(616), - }, - Field { - label: "source_id".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "required_scopes".to_string(), - ty: DeclarationId(617), - }, - Field { - label: "expires_in".to_string(), - ty: DeclarationId(618), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22387, 22537), - }); - declarations.push(Declaration { - id: DeclarationId(199), - name: Some("FilesystemHandle".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(154))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(675)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22614, 22678), - }); - declarations.push(Declaration { - id: DeclarationId(200), - name: Some("NetworkHandle".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(125))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(676)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22679, 22736), - }); - declarations.push(Declaration { - id: DeclarationId(201), - name: Some("ToolHandle".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(227))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(677)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22737, 22793), - }); - declarations.push(Declaration { - id: DeclarationId(202), - name: Some("TransportRequest".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "method".to_string(), - ty: DeclarationId(195), - }, - Field { - label: "url".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "headers".to_string(), - ty: DeclarationId(126), - }, - Field { - label: "body".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22870, 22961), - }); - declarations.push(Declaration { - id: DeclarationId(203), - name: Some("TransportResponse".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "status".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "headers".to_string(), - ty: DeclarationId(126), - }, - Field { - label: "body".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22963, 23034), - }); - declarations.push(Declaration { - id: DeclarationId(204), - name: Some("FileResponse".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "path".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "success".to_string(), - ty: DeclarationId(124), - }, - Field { - label: "content".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 23036, 23106), - }); - declarations.push(Declaration { - id: DeclarationId(205), - name: Some("ShellResponse".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "exit_code".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "stdout".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "stderr".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 23108, 23181), - }); - declarations.push(Declaration { - id: DeclarationId(206), - name: Some("RestResponse".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "status".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "headers".to_string(), - ty: DeclarationId(126), - }, - Field { - label: "body".to_string(), - ty: DeclarationId(126), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 23183, 23247), - }); - declarations.push(Declaration { - id: DeclarationId(207), - name: Some("TestResult".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "ok".to_string(), - ty: DeclarationId(124), - }, - Field { - label: "stdout".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "stderr".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "duration_ms".to_string(), - ty: DeclarationId(159), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 23324, 23431), - }); - declarations.push(Declaration { - id: DeclarationId(208), - name: Some("Summary".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "total".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "passed".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "failed".to_string(), - ty: DeclarationId(87), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 23433, 23490), - }); - declarations.push(Declaration { - id: DeclarationId(209), - name: Some("StageResult".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "success".to_string(), - ty: DeclarationId(124), - }, - Field { - label: "stdout".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "stderr".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "skipped".to_string(), - ty: DeclarationId(124), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 23492, 23593), - }); - declarations.push(Declaration { - id: DeclarationId(210), - name: Some("DocumentLine".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "text".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "is_comment".to_string(), - ty: DeclarationId(124), - }, - Field { - label: "is_blank".to_string(), - ty: DeclarationId(124), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 23746, 23818), - }); - declarations.push(Declaration { - id: DeclarationId(211), - name: Some("DocumentSection".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "title".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "has_title".to_string(), - ty: DeclarationId(124), - }, - Field { - label: "lines".to_string(), - ty: DeclarationId(619), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 23820, 23906), - }); - declarations.push(Declaration { - id: DeclarationId(212), - name: Some("Document".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "header".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "has_header".to_string(), - ty: DeclarationId(124), - }, - Field { - label: "comment_prefix".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "sections".to_string(), - ty: DeclarationId(620), - }, - Field { - label: "trailing_newline".to_string(), - ty: DeclarationId(124), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 23908, 24045), - }); - declarations.push(Declaration { - id: DeclarationId(213), - name: Some("TextFile".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "path".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "document".to_string(), - ty: DeclarationId(212), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24047, 24100), - }); - declarations.push(Declaration { - id: DeclarationId(214), - name: Some("RenderedTextFile".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "path".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "content".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24102, 24160), - }); - declarations.push(Declaration { - id: DeclarationId(215), - name: Some("ToolEntry".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "command".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "description".to_string(), - ty: DeclarationId(621), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24237, 24311), - }); - declarations.push(Declaration { - id: DeclarationId(216), - name: Some("ToolRegistry".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "tools".to_string(), - ty: DeclarationId(622), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24313, 24359), - }); - declarations.push(Declaration { - id: DeclarationId(217), - name: Some("DagTopology".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "nodes".to_string(), - ty: DeclarationId(623), - }, - Field { - label: "edges".to_string(), - ty: DeclarationId(624), - }, - Field { - label: "subdag_boundaries".to_string(), - ty: DeclarationId(625), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24618, 24728), - }); - declarations.push(Declaration { - id: DeclarationId(218), - name: Some("TopologyNode".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "id".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "label".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "kind".to_string(), - ty: DeclarationId(179), - }, - Field { - label: "parent".to_string(), - ty: DeclarationId(626), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24730, 24850), - }); - declarations.push(Declaration { - id: DeclarationId(219), - name: Some("TopologyEdge".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "from".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "to".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "port".to_string(), - ty: DeclarationId(627), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24852, 24917), - }); - declarations.push(Declaration { - id: DeclarationId(220), - name: Some("DagDiff".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "added".to_string(), - ty: DeclarationId(628), - }, - Field { - label: "removed".to_string(), - ty: DeclarationId(629), - }, - Field { - label: "changed".to_string(), - ty: DeclarationId(630), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24919, 25005), - }); - declarations.push(Declaration { - id: DeclarationId(221), - name: Some("CodegenTarget".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "path".to_string(), - ty: DeclarationId(154), - }, - Field { - label: "backend".to_string(), - ty: DeclarationId(631), - }, - Field { - label: "target".to_string(), - ty: DeclarationId(632), - }, - Field { - label: "runtime_env".to_string(), - ty: DeclarationId(633), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25074, 25208), - }); - declarations.push(Declaration { - id: DeclarationId(222), - name: Some("CodegenBackend".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Rust".to_string(), - ty: DeclarationId(634), - }, - Field { - label: "Go".to_string(), - ty: DeclarationId(635), - }, - Field { - label: "C".to_string(), - ty: DeclarationId(636), - }, - Field { - label: "Mips".to_string(), - ty: DeclarationId(637), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25210, 25252), - }); - declarations.push(Declaration { - id: DeclarationId(223), - name: Some("PragmaDirective".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "key".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "value".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "scope".to_string(), - ty: DeclarationId(638), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25254, 25325), - }); - declarations.push(Declaration { - id: DeclarationId(224), - name: Some("DocSource".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "path".to_string(), - ty: DeclarationId(154), - }, - Field { - label: "kind".to_string(), - ty: DeclarationId(180), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25466, 25523), - }); - declarations.push(Declaration { - id: DeclarationId(225), - name: Some("ReferenceModel".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![DeclarationId(226)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 27457, 27476), - }); - declarations.push(Declaration { - id: DeclarationId(226), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 27457, 27476), - }); - declarations.push(Declaration { - id: DeclarationId(227), - name: Some("String".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(128), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/string_type.dag", 606, 636), - }); - declarations.push(Declaration { - id: DeclarationId(228), - name: Some("CharClass".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Whitespace".to_string(), - ty: DeclarationId(678), - }, - Field { - label: "Digit".to_string(), - ty: DeclarationId(679), - }, - Field { - label: "IdentStart".to_string(), - ty: DeclarationId(680), - }, - Field { - label: "IdentContinue".to_string(), - ty: DeclarationId(681), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 3662, 3726), - }); - declarations.push(Declaration { - id: DeclarationId(229), - name: Some("char_in_class".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(128), DeclarationId(228)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(250))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 4059, 4926), - }); - declarations.push(Declaration { - id: DeclarationId(230), - name: Some("DisplayWidth".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ZeroWidth".to_string(), - ty: DeclarationId(682), - }, - Field { - label: "Narrow".to_string(), - ty: DeclarationId(683), - }, - Field { - label: "Wide".to_string(), - ty: DeclarationId(684), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 5290, 5335), - }); - declarations.push(Declaration { - id: DeclarationId(231), - name: Some("display_width_columns".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(230)], - output: DeclarationId(87), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/unicode.dag", 5386, 5462)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 5337, 5462), - }); - declarations.push(Declaration { - id: DeclarationId(232), - name: Some("UnicodeBlock".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "start".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "end_inclusive".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "default_width".to_string(), - ty: DeclarationId(230), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 5697, 5797), - }); - declarations.push(Declaration { - id: DeclarationId(233), - name: Some("zero_width_blocks".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(232), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(685)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::List(vec![ - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String( - "Combining Diacritical Marks".to_string(), - )), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("768".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("879".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(682), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String( - "Combining Diacritical Marks Extended".to_string(), - )), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("6832".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("6911".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(682), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String( - "Combining Diacritical Marks Supplement".to_string(), - )), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("7616".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("7679".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(682), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String( - "Combining Marks for Symbols".to_string(), - )), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("8400".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("8447".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(682), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("Variation Selectors".to_string())), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("65024".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("65039".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(682), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String( - "Combining Half Marks".to_string(), - )), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("65056".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("65071".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(682), - payload: vec![], - }, - ), - ]), - ])), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 5859, 6608), - }); - declarations.push(Declaration { - id: DeclarationId(234), - name: Some("zero_width_codepoints".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(686)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::List(vec![ - FieldValue::Literal(LiteralBits::Int("8203".to_string())), - FieldValue::Literal(LiteralBits::Int("8204".to_string())), - FieldValue::Literal(LiteralBits::Int("8205".to_string())), - FieldValue::Literal(LiteralBits::Int("65279".to_string())), - ])), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 6675, 6887), - }); - declarations.push(Declaration { - id: DeclarationId(235), - name: Some("wide_blocks".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(232), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(687)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::List(vec![ - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("Hangul Jamo".to_string())), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("4352".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("4447".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(684), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String( - "CJK Radicals and Symbols".to_string(), - )), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("11904".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("12350".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(684), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String( - "Hiragana / Katakana / CJK Compat".to_string(), - )), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("12353".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("13247".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(684), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("CJK Extension A".to_string())), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("13312".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("19903".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(684), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String( - "CJK Unified Ideographs".to_string(), - )), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("19968".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("40959".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(684), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String( - "Yi Syllables and Radicals".to_string(), - )), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("40960".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("42191".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(684), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("Hangul Syllables".to_string())), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("44032".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("55215".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(684), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String( - "CJK Compatibility Ideographs".to_string(), - )), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("63744".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("64255".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(684), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String( - "CJK Compatibility Forms".to_string(), - )), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("65072".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("65135".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(684), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("Fullwidth ASCII".to_string())), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("65281".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("65376".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(684), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("Fullwidth Signs".to_string())), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("65504".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("65510".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(684), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("CJK Extension B+".to_string())), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("131072".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("196607".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(684), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("CJK Extension G+".to_string())), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("196608".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("262143".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(684), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String( - "Misc Symbols and Dingbats".to_string(), - )), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("9728".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("10175".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(684), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String( - "Symbols / Pictographs / Emoticons".to_string(), - )), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("127744".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("129535".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(684), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("Symbols Extended".to_string())), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("129536".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("131071".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(684), - payload: vec![], - }, - ), - ]), - ])), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 6934, 8723), - }); - declarations.push(Declaration { - id: DeclarationId(236), - name: Some("code_point".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(128)], - output: DeclarationId(87), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(253))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 8873, 8910), - }); - declarations.push(Declaration { - id: DeclarationId(237), - name: Some("in_block".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87), DeclarationId(232)], - output: DeclarationId(124), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/unicode.dag", 8962, 9014)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 8912, 9014), - }); - declarations.push(Declaration { - id: DeclarationId(238), - name: Some("char_display_width".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(128)], - output: DeclarationId(230), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/unicode.dag", 9063, 9366)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 9016, 9366), - }); - declarations.push(Declaration { - id: DeclarationId(239), - name: Some("char_width".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(128)], - output: DeclarationId(87), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/unicode.dag", 9398, 9454)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 9368, 9454), - }); - declarations.push(Declaration { - id: DeclarationId(240), - name: Some("string_display_width".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227)], - output: DeclarationId(87), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/unicode.dag", 9498, 9636)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 9456, 9636), - }); - declarations.push(Declaration { - id: DeclarationId(241), - name: Some("repeat_string_loop".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227), DeclarationId(227), DeclarationId(87)], - output: DeclarationId(227), - body: ArrowBody::Unparsed(SourceSpan::new( - "dsl/std/render_repeat_string_bootstrap.dag", - 598, - 717, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/render_repeat_string_bootstrap.dag", 526, 717), - }); - declarations.push(Declaration { - id: DeclarationId(242), - name: Some("repeat_string".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227), DeclarationId(87)], - output: DeclarationId(227), - body: ArrowBody::Unparsed(SourceSpan::new( - "dsl/std/render_repeat_string_bootstrap.dag", - 765, - 818, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/render_repeat_string_bootstrap.dag", 719, 818), - }); - declarations.push(Declaration { - id: DeclarationId(243), - name: Some("MethodDeclaration".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "name".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 4779, 4820), - }); - declarations.push(Declaration { - id: DeclarationId(244), - name: Some("add_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("add".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 5269, 5321), - }); - declarations.push(Declaration { - id: DeclarationId(245), - name: Some("all_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("all".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 5322, 5374), - }); - declarations.push(Declaration { - id: DeclarationId(246), - name: Some("any_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("any".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 5375, 5427), - }); - declarations.push(Declaration { - id: DeclarationId(247), - name: Some("append_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("append".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 5428, 5486), - }); - declarations.push(Declaration { - id: DeclarationId(248), - name: Some("bottom_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("bottom".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 5487, 5545), - }); - declarations.push(Declaration { - id: DeclarationId(249), - name: Some("chars_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("chars".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 5546, 5602), - }); - declarations.push(Declaration { - id: DeclarationId(250), - name: Some("clamp_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("clamp".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 5603, 5659), - }); - declarations.push(Declaration { - id: DeclarationId(251), - name: Some("compare_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("compare".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 5660, 5720), - }); - declarations.push(Declaration { - id: DeclarationId(252), - name: Some("complement_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("complement".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 5721, 5787), - }); - declarations.push(Declaration { - id: DeclarationId(253), - name: Some("concat_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("concat".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 5788, 5846), - }); - declarations.push(Declaration { - id: DeclarationId(254), - name: Some("contains_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("contains".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 5847, 5909), - }); - declarations.push(Declaration { - id: DeclarationId(255), - name: Some("count_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("count".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 5910, 5966), - }); - declarations.push(Declaration { - id: DeclarationId(256), - name: Some("diff_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("diff".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 5967, 6021), - }); - declarations.push(Declaration { - id: DeclarationId(257), - name: Some("empty_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("empty".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 6022, 6078), - }); - declarations.push(Declaration { - id: DeclarationId(258), - name: Some("ends_with_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("ends_with".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 6079, 6143), - }); - declarations.push(Declaration { - id: DeclarationId(259), - name: Some("enumerate_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("enumerate".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 6144, 6208), - }); - declarations.push(Declaration { - id: DeclarationId(260), - name: Some("filter_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("filter".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 6209, 6267), - }); - declarations.push(Declaration { - id: DeclarationId(261), - name: Some("first_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("first".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 6268, 6324), - }); - declarations.push(Declaration { - id: DeclarationId(262), - name: Some("flat_map_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("flat_map".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 6325, 6387), - }); - declarations.push(Declaration { - id: DeclarationId(263), - name: Some("fold_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("fold".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 6388, 6442), - }); - declarations.push(Declaration { - id: DeclarationId(264), - name: Some("get_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("get".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 6443, 6495), - }); - declarations.push(Declaration { - id: DeclarationId(265), - name: Some("has_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("has".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 6496, 6548), - }); - declarations.push(Declaration { - id: DeclarationId(266), - name: Some("intersect_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("intersect".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 6549, 6613), - }); - declarations.push(Declaration { - id: DeclarationId(267), - name: Some("is_empty_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("is_empty".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 6614, 6676), - }); - declarations.push(Declaration { - id: DeclarationId(268), - name: Some("join_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("join".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 6677, 6731), - }); - declarations.push(Declaration { - id: DeclarationId(269), - name: Some("keys_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("keys".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 6732, 6786), - }); - declarations.push(Declaration { - id: DeclarationId(270), - name: Some("last_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("last".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 6787, 6841), - }); - declarations.push(Declaration { - id: DeclarationId(271), - name: Some("length_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("length".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 6842, 6900), - }); - declarations.push(Declaration { - id: DeclarationId(272), - name: Some("list_push_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("list_push".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 6901, 6965), - }); - declarations.push(Declaration { - id: DeclarationId(273), - name: Some("lookup_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("lookup".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 6966, 7024), - }); - declarations.push(Declaration { - id: DeclarationId(274), - name: Some("map_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("map".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 7025, 7077), - }); - declarations.push(Declaration { - id: DeclarationId(275), - name: Some("map_contains_key_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("map_contains_key".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 7078, 7156), - }); - declarations.push(Declaration { - id: DeclarationId(276), - name: Some("map_get_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("map_get".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 7157, 7217), - }); - declarations.push(Declaration { - id: DeclarationId(277), - name: Some("map_has_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("map_has".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 7218, 7278), - }); - declarations.push(Declaration { - id: DeclarationId(278), - name: Some("map_insert_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("map_insert".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 7279, 7345), - }); - declarations.push(Declaration { - id: DeclarationId(279), - name: Some("map_keys_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("map_keys".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 7346, 7408), - }); - declarations.push(Declaration { - id: DeclarationId(280), - name: Some("map_merge_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("map_merge".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 7409, 7473), - }); - declarations.push(Declaration { - id: DeclarationId(281), - name: Some("map_values_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("map_values".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 7474, 7540), - }); - declarations.push(Declaration { - id: DeclarationId(282), - name: Some("meet_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("meet".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 7541, 7595), - }); - declarations.push(Declaration { - id: DeclarationId(283), - name: Some("member_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("member".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 7596, 7654), - }); - declarations.push(Declaration { - id: DeclarationId(284), - name: Some("mul_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("mul".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 7655, 7707), - }); - declarations.push(Declaration { - id: DeclarationId(285), - name: Some("negate_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("negate".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 7708, 7766), - }); - declarations.push(Declaration { - id: DeclarationId(286), - name: Some("one_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("one".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 7767, 7819), - }); - declarations.push(Declaration { - id: DeclarationId(287), - name: Some("reciprocal_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("reciprocal".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 7820, 7886), - }); - declarations.push(Declaration { - id: DeclarationId(288), - name: Some("replace_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("replace".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 7887, 7947), - }); - declarations.push(Declaration { - id: DeclarationId(289), - name: Some("reverse_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("reverse".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 7948, 8008), - }); - declarations.push(Declaration { - id: DeclarationId(290), - name: Some("skip_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("skip".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 8009, 8063), - }); - declarations.push(Declaration { - id: DeclarationId(291), - name: Some("sort_by_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("sort_by".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 8064, 8124), - }); - declarations.push(Declaration { - id: DeclarationId(292), - name: Some("split_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("split".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 8125, 8181), - }); - declarations.push(Declaration { - id: DeclarationId(293), - name: Some("starts_with_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("starts_with".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 8182, 8250), - }); - declarations.push(Declaration { - id: DeclarationId(294), - name: Some("string_contains_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("string_contains".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 8251, 8327), - }); - declarations.push(Declaration { - id: DeclarationId(295), - name: Some("substring_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("substring".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 8328, 8392), - }); - declarations.push(Declaration { - id: DeclarationId(296), - name: Some("take_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("take".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 8393, 8447), - }); - declarations.push(Declaration { - id: DeclarationId(297), - name: Some("to_int_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("to_int".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 8448, 8506), - }); - declarations.push(Declaration { - id: DeclarationId(298), - name: Some("to_lower_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("to_lower".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 8507, 8569), - }); - declarations.push(Declaration { - id: DeclarationId(299), - name: Some("to_string_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("to_string".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 8570, 8634), - }); - declarations.push(Declaration { - id: DeclarationId(300), - name: Some("to_upper_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("to_upper".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 8635, 8697), - }); - declarations.push(Declaration { - id: DeclarationId(301), - name: Some("top_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("top".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 8698, 8750), - }); - declarations.push(Declaration { - id: DeclarationId(302), - name: Some("trim_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("trim".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 8751, 8805), - }); - declarations.push(Declaration { - id: DeclarationId(303), - name: Some("union_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("union".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 8806, 8862), - }); - declarations.push(Declaration { - id: DeclarationId(304), - name: Some("values_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("values".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 8863, 8921), - }); - declarations.push(Declaration { - id: DeclarationId(305), - name: Some("with_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("with".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 8922, 8976), - }); - declarations.push(Declaration { - id: DeclarationId(306), - name: Some("zero_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("zero".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 8977, 9031), - }); - declarations.push(Declaration { - id: DeclarationId(307), - name: Some("DeclarationRef".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/serialization.dag", 692, 720), - }); - declarations.push(Declaration { - id: DeclarationId(308), - name: Some("VariantNaming".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "AsAuthored".to_string(), - ty: DeclarationId(688), - }, - Field { - label: "SnakeCase".to_string(), - ty: DeclarationId(689), - }, - Field { - label: "StripPrefixAndSnakeCase".to_string(), - ty: DeclarationId(690), - }, - Field { - label: "StripSuffixAndSnakeCase".to_string(), - ty: DeclarationId(691), - }, - Field { - label: "StripPrefixSuffixAndSnakeCase".to_string(), - ty: DeclarationId(692), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/serialization.dag", 1850, 2060), - }); - declarations.push(Declaration { - id: DeclarationId(309), - name: Some("VariantEncoding".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "StringVariant".to_string(), - ty: DeclarationId(693), - }, - Field { - label: "InternallyTaggedObject".to_string(), - ty: DeclarationId(694), - }, - Field { - label: "UntaggedVariant".to_string(), - ty: DeclarationId(695), - }, - Field { - label: "TaggedVariant".to_string(), - ty: DeclarationId(696), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/serialization.dag", 2606, 2780), - }); - declarations.push(Declaration { - id: DeclarationId(310), - name: Some("CoproductWireContract".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "coproduct".to_string(), - ty: DeclarationId(307), - }, - Field { - label: "encoding".to_string(), - ty: DeclarationId(309), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/serialization.dag", 3002, 3088), - }); - declarations.push(Declaration { - id: DeclarationId(311), - name: Some("WireContract".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "variant_encoding".to_string(), - ty: DeclarationId(309), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/serialization.dag", 3233, 3290), - }); - declarations.push(Declaration { - id: DeclarationId(312), - name: Some("WireFormat".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Json".to_string(), - ty: DeclarationId(697), - }, - Field { - label: "Text".to_string(), - ty: DeclarationId(698), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/serialization.dag", 3481, 3510), - }); - declarations.push(Declaration { - id: DeclarationId(313), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/logic.dag", 304, 308), - }); - declarations.push(Declaration { - id: DeclarationId(314), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/logic.dag", 311, 316), - }); - declarations.push(Declaration { - id: DeclarationId(315), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(4), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/bit.dag", 1023, 1032), - }); - declarations.push(Declaration { - id: DeclarationId(316), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(4), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/bit.dag", 1136, 1145), - }); - declarations.push(Declaration { - id: DeclarationId(317), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(6), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/bit.dag", 1272, 1282), - }); - declarations.push(Declaration { - id: DeclarationId(318), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(6), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/bit.dag", 1306, 1316), - }); - declarations.push(Declaration { - id: DeclarationId(319), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(6), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/bit.dag", 1340, 1350), - }); - declarations.push(Declaration { - id: DeclarationId(320), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(6), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/bit.dag", 1375, 1385), - }); - declarations.push(Declaration { - id: DeclarationId(321), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "value".to_string(), - ty: DeclarationId(12), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/error_primitives.dag", 620, 636), - }); - declarations.push(Declaration { - id: DeclarationId(322), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "value".to_string(), - ty: DeclarationId(13), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/error_primitives.dag", 639, 657), - }); - declarations.push(Declaration { - id: DeclarationId(323), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/error_primitives.dag", 936, 948), - }); - declarations.push(Declaration { - id: DeclarationId(324), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/error_primitives.dag", 951, 959), - }); - declarations.push(Declaration { - id: DeclarationId(325), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(58), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 24253, 24279), - }); - declarations.push(Declaration { - id: DeclarationId(326), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(58), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 25463, 25489), - }); - declarations.push(Declaration { - id: DeclarationId(327), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(58), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 26620, 26646), - }); - declarations.push(Declaration { - id: DeclarationId(328), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(58), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 27746, 27772), - }); - declarations.push(Declaration { - id: DeclarationId(329), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(58), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 31202, 31228), - }); - declarations.push(Declaration { - id: DeclarationId(330), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(58), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 34515, 34541), - }); - declarations.push(Declaration { - id: DeclarationId(331), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(58), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 39940, 39966), - }); - declarations.push(Declaration { - id: DeclarationId(332), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(58), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 42853, 42879), - }); - declarations.push(Declaration { - id: DeclarationId(333), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 43672, 43684), - }); - declarations.push(Declaration { - id: DeclarationId(334), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(16), DeclarationId(16)], - output: DeclarationId(16), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 4724, 4737), - }); - declarations.push(Declaration { - id: DeclarationId(335), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(18), DeclarationId(18)], - output: DeclarationId(18), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 4843, 4856), - }); - declarations.push(Declaration { - id: DeclarationId(336), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(20), DeclarationId(20)], - output: DeclarationId(20), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 5060, 5073), - }); - declarations.push(Declaration { - id: DeclarationId(337), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(22), DeclarationId(22)], - output: DeclarationId(22), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 5182, 5195), - }); - declarations.push(Declaration { - id: DeclarationId(338), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(24), DeclarationId(24)], - output: DeclarationId(24), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 5333, 5346), - }); - declarations.push(Declaration { - id: DeclarationId(339), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(24)], - output: DeclarationId(24), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 5372, 5382), - }); - declarations.push(Declaration { - id: DeclarationId(340), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(26), DeclarationId(26)], - output: DeclarationId(26), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 5451, 5464), - }); - declarations.push(Declaration { - id: DeclarationId(341), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(26)], - output: DeclarationId(26), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 5490, 5500), - }); - declarations.push(Declaration { - id: DeclarationId(342), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(32), DeclarationId(32)], - output: DeclarationId(32), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 10528, 10541), - }); - declarations.push(Declaration { - id: DeclarationId(343), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(32), DeclarationId(32)], - output: DeclarationId(32), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 10559, 10572), - }); - declarations.push(Declaration { - id: DeclarationId(344), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(34), DeclarationId(34)], - output: DeclarationId(34), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 11014, 11027), - }); - declarations.push(Declaration { - id: DeclarationId(345), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(34), DeclarationId(34)], - output: DeclarationId(34), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 11045, 11058), - }); - declarations.push(Declaration { - id: DeclarationId(346), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(36), DeclarationId(36)], - output: DeclarationId(36), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 11218, 11231), - }); - declarations.push(Declaration { - id: DeclarationId(347), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(36)], - output: DeclarationId(36), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 11252, 11262), - }); - declarations.push(Declaration { - id: DeclarationId(348), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(36), DeclarationId(36)], - output: DeclarationId(36), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 11270, 11283), - }); - declarations.push(Declaration { - id: DeclarationId(349), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(38), DeclarationId(38)], - output: DeclarationId(38), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12084, 12097), - }); - declarations.push(Declaration { - id: DeclarationId(350), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(38), DeclarationId(38)], - output: DeclarationId(38), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12105, 12118), - }); - declarations.push(Declaration { - id: DeclarationId(351), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(38)], - output: DeclarationId(38), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12139, 12149), - }); - declarations.push(Declaration { - id: DeclarationId(352), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(38), DeclarationId(38)], - output: DeclarationId(38), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12157, 12170), - }); - declarations.push(Declaration { - id: DeclarationId(353), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(11), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(12), - value: DeclarationId(38), - }, - TemplateArgument { - parameter: DeclarationId(13), - value: DeclarationId(14), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12190, 12209), - }); - declarations.push(Declaration { - id: DeclarationId(354), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(38), DeclarationId(38)], - output: DeclarationId(353), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12178, 12209), - }); - declarations.push(Declaration { - id: DeclarationId(355), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(38), DeclarationId(38)], - output: DeclarationId(52), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12230, 12250), - }); - declarations.push(Declaration { - id: DeclarationId(356), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(38), DeclarationId(38)], - output: DeclarationId(124), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12257, 12273), - }); - declarations.push(Declaration { - id: DeclarationId(357), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(38), DeclarationId(38)], - output: DeclarationId(124), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12280, 12296), - }); - declarations.push(Declaration { - id: DeclarationId(358), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(38), DeclarationId(38)], - output: DeclarationId(124), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12303, 12319), - }); - declarations.push(Declaration { - id: DeclarationId(359), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(38), DeclarationId(38)], - output: DeclarationId(124), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12326, 12342), - }); - declarations.push(Declaration { - id: DeclarationId(360), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(38), DeclarationId(38)], - output: DeclarationId(124), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12349, 12365), - }); - declarations.push(Declaration { - id: DeclarationId(361), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(38), DeclarationId(38)], - output: DeclarationId(124), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12372, 12388), - }); - declarations.push(Declaration { - id: DeclarationId(362), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(40), DeclarationId(40)], - output: DeclarationId(40), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12551, 12564), - }); - declarations.push(Declaration { - id: DeclarationId(363), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(40)], - output: DeclarationId(40), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12585, 12595), - }); - declarations.push(Declaration { - id: DeclarationId(364), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(40), DeclarationId(40)], - output: DeclarationId(40), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12603, 12616), - }); - declarations.push(Declaration { - id: DeclarationId(365), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(40)], - output: DeclarationId(40), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12640, 12650), - }); - declarations.push(Declaration { - id: DeclarationId(366), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(40), DeclarationId(40)], - output: DeclarationId(52), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12662, 12682), - }); - declarations.push(Declaration { - id: DeclarationId(367), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(42), DeclarationId(42)], - output: DeclarationId(42), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 13030, 13043), - }); - declarations.push(Declaration { - id: DeclarationId(368), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(42), DeclarationId(42)], - output: DeclarationId(42), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 13052, 13065), - }); - declarations.push(Declaration { - id: DeclarationId(369), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(44), DeclarationId(44)], - output: DeclarationId(44), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 13208, 13221), - }); - declarations.push(Declaration { - id: DeclarationId(370), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(44), DeclarationId(44)], - output: DeclarationId(44), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 13230, 13243), - }); - declarations.push(Declaration { - id: DeclarationId(371), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(46), DeclarationId(46)], - output: DeclarationId(46), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 13497, 13510), - }); - declarations.push(Declaration { - id: DeclarationId(372), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(46), DeclarationId(46)], - output: DeclarationId(46), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 13519, 13532), - }); - declarations.push(Declaration { - id: DeclarationId(373), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(46)], - output: DeclarationId(46), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 13547, 13557), - }); - declarations.push(Declaration { - id: DeclarationId(374), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(48), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17529, 17542), - }); - declarations.push(Declaration { - id: DeclarationId(375), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(48), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17544, 17557), - }); - declarations.push(Declaration { - id: DeclarationId(376), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(48), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17562, 17575), - }); - declarations.push(Declaration { - id: DeclarationId(377), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(374), DeclarationId(375)], - output: DeclarationId(376), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17526, 17575), - }); - declarations.push(Declaration { - id: DeclarationId(378), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(48), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17585, 17598), - }); - declarations.push(Declaration { - id: DeclarationId(379), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(48), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17618, 17631), - }); - declarations.push(Declaration { - id: DeclarationId(380), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(48)], - output: DeclarationId(379), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17609, 17631), - }); - declarations.push(Declaration { - id: DeclarationId(381), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(48), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17733, 17746), - }); - declarations.push(Declaration { - id: DeclarationId(382), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87), DeclarationId(87)], - output: DeclarationId(381), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17717, 17746), - }); - declarations.push(Declaration { - id: DeclarationId(383), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(87), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17757, 17768), - }); - declarations.push(Declaration { - id: DeclarationId(384), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(124), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17781, 17793), - }); - declarations.push(Declaration { - id: DeclarationId(385), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(87), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17803, 17814), - }); - declarations.push(Declaration { - id: DeclarationId(386), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(48), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17832, 17834), - }); - declarations.push(Declaration { - id: DeclarationId(387), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(386), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17824, 17834), - }); - declarations.push(Declaration { - id: DeclarationId(388), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(48), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17851, 17853), - }); - declarations.push(Declaration { - id: DeclarationId(389), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(388), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17843, 17853), - }); - declarations.push(Declaration { - id: DeclarationId(390), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(48)], - output: DeclarationId(48), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17951, 17961), - }); - declarations.push(Declaration { - id: DeclarationId(391), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(48), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17966, 17979), - }); - declarations.push(Declaration { - id: DeclarationId(392), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(390)], - output: DeclarationId(391), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17948, 17979), - }); - declarations.push(Declaration { - id: DeclarationId(393), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(48)], - output: DeclarationId(124), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17993, 18006), - }); - declarations.push(Declaration { - id: DeclarationId(394), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(48), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18011, 18024), - }); - declarations.push(Declaration { - id: DeclarationId(395), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(393)], - output: DeclarationId(394), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17990, 18024), - }); - declarations.push(Declaration { - id: DeclarationId(396), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(48), DeclarationId(48)], - output: DeclarationId(48), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18039, 18052), - }); - declarations.push(Declaration { - id: DeclarationId(397), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(48), DeclarationId(396)], - output: DeclarationId(48), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18033, 18058), - }); - declarations.push(Declaration { - id: DeclarationId(398), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(48), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18083, 18096), - }); - declarations.push(Declaration { - id: DeclarationId(399), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(48)], - output: DeclarationId(398), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18074, 18096), - }); - declarations.push(Declaration { - id: DeclarationId(400), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(48), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18101, 18114), - }); - declarations.push(Declaration { - id: DeclarationId(401), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(399)], - output: DeclarationId(400), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18071, 18114), - }); - declarations.push(Declaration { - id: DeclarationId(402), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(48)], - output: DeclarationId(124), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18125, 18138), - }); - declarations.push(Declaration { - id: DeclarationId(403), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(402)], - output: DeclarationId(124), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18122, 18147), - }); - declarations.push(Declaration { - id: DeclarationId(404), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(48)], - output: DeclarationId(124), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18158, 18171), - }); - declarations.push(Declaration { - id: DeclarationId(405), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(404)], - output: DeclarationId(124), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18155, 18180), - }); - declarations.push(Declaration { - id: DeclarationId(406), - name: None, - connective: TypeConnective::Atom(AtomPayload::UnresolvedIdentifier( - "Tuple".to_string(), - )), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18245, 18258), - }); - declarations.push(Declaration { - id: DeclarationId(407), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(406), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18245, 18258), - }); - declarations.push(Declaration { - id: DeclarationId(408), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(407), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18234, 18259), - }); - declarations.push(Declaration { - id: DeclarationId(409), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(408), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18226, 18259), - }); - declarations.push(Declaration { - id: DeclarationId(410), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(48), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18279, 18292), - }); - declarations.push(Declaration { - id: DeclarationId(411), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(410), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18271, 18292), - }); - declarations.push(Declaration { - id: DeclarationId(412), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(48), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18312, 18325), - }); - declarations.push(Declaration { - id: DeclarationId(413), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87)], - output: DeclarationId(412), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18301, 18325), - }); - declarations.push(Declaration { - id: DeclarationId(414), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(48), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18345, 18358), - }); - declarations.push(Declaration { - id: DeclarationId(415), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87)], - output: DeclarationId(414), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18334, 18358), - }); - declarations.push(Declaration { - id: DeclarationId(416), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(48), DeclarationId(48)], - output: DeclarationId(87), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18373, 18388), - }); - declarations.push(Declaration { - id: DeclarationId(417), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(48), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18393, 18406), - }); - declarations.push(Declaration { - id: DeclarationId(418), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(416)], - output: DeclarationId(417), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18370, 18406), - }); - declarations.push(Declaration { - id: DeclarationId(419), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(48)], - output: DeclarationId(124), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18419, 18432), - }); - declarations.push(Declaration { - id: DeclarationId(420), - name: None, - connective: TypeConnective::Atom(AtomPayload::ResolvedByName(DeclarationId(1058))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19011, 19021), - }); - declarations.push(Declaration { - id: DeclarationId(421), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(420), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19011, 19021), - }); - declarations.push(Declaration { - id: DeclarationId(422), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(50)], - output: DeclarationId(421), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19002, 19021), - }); - declarations.push(Declaration { - id: DeclarationId(423), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(49), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(50), - value: DeclarationId(50), - }, - TemplateArgument { - parameter: DeclarationId(51), - value: DeclarationId(51), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19031, 19052), - }); - declarations.push(Declaration { - id: DeclarationId(424), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(51), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19069, 19071), - }); - declarations.push(Declaration { - id: DeclarationId(425), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(50)], - output: DeclarationId(424), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19060, 19071), - }); - declarations.push(Declaration { - id: DeclarationId(426), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(49), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(50), - value: DeclarationId(50), - }, - TemplateArgument { - parameter: DeclarationId(51), - value: DeclarationId(51), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19094, 19115), - }); - declarations.push(Declaration { - id: DeclarationId(427), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(50), DeclarationId(51)], - output: DeclarationId(426), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19082, 19115), - }); - declarations.push(Declaration { - id: DeclarationId(428), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(49), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(50), - value: DeclarationId(50), - }, - TemplateArgument { - parameter: DeclarationId(51), - value: DeclarationId(51), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19128, 19149), - }); - declarations.push(Declaration { - id: DeclarationId(429), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(49), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(50), - value: DeclarationId(50), - }, - TemplateArgument { - parameter: DeclarationId(51), - value: DeclarationId(51), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19154, 19175), - }); - declarations.push(Declaration { - id: DeclarationId(430), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(428)], - output: DeclarationId(429), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19125, 19175), - }); - declarations.push(Declaration { - id: DeclarationId(431), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(50), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19192, 19205), - }); - declarations.push(Declaration { - id: DeclarationId(432), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(431), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19184, 19205), - }); - declarations.push(Declaration { - id: DeclarationId(433), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(51), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19224, 19237), - }); - declarations.push(Declaration { - id: DeclarationId(434), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(433), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19216, 19237), - }); - declarations.push(Declaration { - id: DeclarationId(435), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(50)], - output: DeclarationId(124), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19245, 19258), - }); - declarations.push(Declaration { - id: DeclarationId(436), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(50)], - output: DeclarationId(124), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19275, 19288), - }); - declarations.push(Declaration { - id: DeclarationId(437), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(87), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19297, 19308), - }); - declarations.push(Declaration { - id: DeclarationId(438), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19527, 19531), - }); - declarations.push(Declaration { - id: DeclarationId(439), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19534, 19539), - }); - declarations.push(Declaration { - id: DeclarationId(440), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19542, 19549), - }); - declarations.push(Declaration { - id: DeclarationId(441), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 21658, 21676), - }); - declarations.push(Declaration { - id: DeclarationId(442), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 21681, 21704), - }); - declarations.push(Declaration { - id: DeclarationId(443), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 21709, 21730), - }); - declarations.push(Declaration { - id: DeclarationId(444), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 21735, 21766), - }); - declarations.push(Declaration { - id: DeclarationId(445), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 21771, 21794), - }); - declarations.push(Declaration { - id: DeclarationId(446), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 21799, 21826), - }); - declarations.push(Declaration { - id: DeclarationId(447), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 21831, 21853), - }); - declarations.push(Declaration { - id: DeclarationId(448), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 21880, 21894), - }); - declarations.push(Declaration { - id: DeclarationId(449), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "name".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 21899, 21921), - }); - declarations.push(Declaration { - id: DeclarationId(450), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 21952, 21964), - }); - declarations.push(Declaration { - id: DeclarationId(451), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 21969, 21984), - }); - declarations.push(Declaration { - id: DeclarationId(452), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 21989, 22000), - }); - declarations.push(Declaration { - id: DeclarationId(453), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 22005, 22018), - }); - declarations.push(Declaration { - id: DeclarationId(454), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "name".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 22023, 22053), - }); - declarations.push(Declaration { - id: DeclarationId(455), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "source".to_string(), - ty: DeclarationId(54), - }, - Field { - label: "element".to_string(), - ty: DeclarationId(55), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 22058, 22127), - }); - declarations.push(Declaration { - id: DeclarationId(456), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "inner".to_string(), - ty: DeclarationId(55), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 22132, 22173), - }); - declarations.push(Declaration { - id: DeclarationId(457), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "inner".to_string(), - ty: DeclarationId(55), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 22178, 22218), - }); - declarations.push(Declaration { - id: DeclarationId(458), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "first".to_string(), - ty: DeclarationId(55), - }, - Field { - label: "second".to_string(), - ty: DeclarationId(55), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 22223, 22290), - }); - declarations.push(Declaration { - id: DeclarationId(459), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(55), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 22316, 22341), - }); - declarations.push(Declaration { - id: DeclarationId(460), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "params".to_string(), - ty: DeclarationId(459), - }, - Field { - label: "return_type".to_string(), - ty: DeclarationId(55), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 22295, 22377), - }); - declarations.push(Declaration { - id: DeclarationId(461), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "id".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 22382, 22416), - }); - declarations.push(Declaration { - id: DeclarationId(462), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 22662, 22674), - }); - declarations.push(Declaration { - id: DeclarationId(463), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 22732, 22748), - }); - declarations.push(Declaration { - id: DeclarationId(464), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 22795, 22809), - }); - declarations.push(Declaration { - id: DeclarationId(465), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23286, 23299), - }); - declarations.push(Declaration { - id: DeclarationId(466), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23315, 23330), - }); - declarations.push(Declaration { - id: DeclarationId(467), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23376, 23392), - }); - declarations.push(Declaration { - id: DeclarationId(468), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23439, 23452), - }); - declarations.push(Declaration { - id: DeclarationId(469), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(55), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23535, 23560), - }); - declarations.push(Declaration { - id: DeclarationId(470), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(56), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23611, 23632), - }); - declarations.push(Declaration { - id: DeclarationId(471), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(57), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23647, 23657), - }); - declarations.push(Declaration { - id: DeclarationId(472), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(87), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23902, 23906), - }); - declarations.push(Declaration { - id: DeclarationId(473), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(53), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23939, 23966), - }); - declarations.push(Declaration { - id: DeclarationId(474), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/machine_constraints.dag", 7335, 7342), - }); - declarations.push(Declaration { - id: DeclarationId(475), - name: None, - connective: TypeConnective::Atom(AtomPayload::Literal(LiteralBits::Int( - "8".to_string(), - ))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2587, 2588), - }); - declarations.push(Declaration { - id: DeclarationId(476), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(70), - arguments: vec![TemplateArgument { - parameter: DeclarationId(71), - value: DeclarationId(475), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2574, 2589), - }); - declarations.push(Declaration { - id: DeclarationId(477), - name: None, - connective: TypeConnective::Atom(AtomPayload::Literal(LiteralBits::Int( - "16".to_string(), - ))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2630, 2632), - }); - declarations.push(Declaration { - id: DeclarationId(478), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(70), - arguments: vec![TemplateArgument { - parameter: DeclarationId(71), - value: DeclarationId(477), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2617, 2633), - }); - declarations.push(Declaration { - id: DeclarationId(479), - name: None, - connective: TypeConnective::Atom(AtomPayload::Literal(LiteralBits::Int( - "32".to_string(), - ))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2674, 2676), - }); - declarations.push(Declaration { - id: DeclarationId(480), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(70), - arguments: vec![TemplateArgument { - parameter: DeclarationId(71), - value: DeclarationId(479), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2661, 2677), - }); - declarations.push(Declaration { - id: DeclarationId(481), - name: None, - connective: TypeConnective::Atom(AtomPayload::Literal(LiteralBits::Int( - "64".to_string(), - ))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2718, 2720), - }); - declarations.push(Declaration { - id: DeclarationId(482), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(70), - arguments: vec![TemplateArgument { - parameter: DeclarationId(71), - value: DeclarationId(481), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2705, 2721), - }); - declarations.push(Declaration { - id: DeclarationId(483), - name: None, - connective: TypeConnective::Atom(AtomPayload::Literal(LiteralBits::Int( - "128".to_string(), - ))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2763, 2766), - }); - declarations.push(Declaration { - id: DeclarationId(484), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(70), - arguments: vec![TemplateArgument { - parameter: DeclarationId(71), - value: DeclarationId(483), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2750, 2767), - }); - declarations.push(Declaration { - id: DeclarationId(485), - name: None, - connective: TypeConnective::Atom(AtomPayload::Literal(LiteralBits::Int( - "8".to_string(), - ))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2874, 2875), - }); - declarations.push(Declaration { - id: DeclarationId(486), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(70), - arguments: vec![TemplateArgument { - parameter: DeclarationId(71), - value: DeclarationId(485), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2861, 2876), - }); - declarations.push(Declaration { - id: DeclarationId(487), - name: None, - connective: TypeConnective::Atom(AtomPayload::Literal(LiteralBits::Int( - "16".to_string(), - ))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2919, 2921), - }); - declarations.push(Declaration { - id: DeclarationId(488), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(70), - arguments: vec![TemplateArgument { - parameter: DeclarationId(71), - value: DeclarationId(487), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2906, 2922), - }); - declarations.push(Declaration { - id: DeclarationId(489), - name: None, - connective: TypeConnective::Atom(AtomPayload::Literal(LiteralBits::Int( - "32".to_string(), - ))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2965, 2967), - }); - declarations.push(Declaration { - id: DeclarationId(490), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(70), - arguments: vec![TemplateArgument { - parameter: DeclarationId(71), - value: DeclarationId(489), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2952, 2968), - }); - declarations.push(Declaration { - id: DeclarationId(491), - name: None, - connective: TypeConnective::Atom(AtomPayload::Literal(LiteralBits::Int( - "64".to_string(), - ))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 3011, 3013), - }); - declarations.push(Declaration { - id: DeclarationId(492), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(70), - arguments: vec![TemplateArgument { - parameter: DeclarationId(71), - value: DeclarationId(491), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2998, 3014), - }); - declarations.push(Declaration { - id: DeclarationId(493), - name: None, - connective: TypeConnective::Atom(AtomPayload::Literal(LiteralBits::Int( - "128".to_string(), - ))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 3058, 3061), - }); - declarations.push(Declaration { - id: DeclarationId(494), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(70), - arguments: vec![TemplateArgument { - parameter: DeclarationId(71), - value: DeclarationId(493), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 3045, 3062), - }); - declarations.push(Declaration { - id: DeclarationId(495), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(27), - arguments: vec![TemplateArgument { - parameter: DeclarationId(28), - value: DeclarationId(76), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 5945, 5965), - }); - declarations.push(Declaration { - id: DeclarationId(496), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(70), - arguments: vec![TemplateArgument { - parameter: DeclarationId(71), - value: DeclarationId(72), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 7653, 7679), - }); - declarations.push(Declaration { - id: DeclarationId(497), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(70), - arguments: vec![TemplateArgument { - parameter: DeclarationId(71), - value: DeclarationId(72), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 7715, 7741), - }); - declarations.push(Declaration { - id: DeclarationId(498), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(76)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(2))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 9242, 9249), - }); - declarations.push(Declaration { - id: DeclarationId(499), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(29), - arguments: vec![TemplateArgument { - parameter: DeclarationId(30), - value: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/rational.dag", 1267, 1288), - }); - declarations.push(Declaration { - id: DeclarationId(500), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 1052, 1065), - }); - declarations.push(Declaration { - id: DeclarationId(501), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 1070, 1076), - }); - declarations.push(Declaration { - id: DeclarationId(502), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 1081, 1099), - }); - declarations.push(Declaration { - id: DeclarationId(503), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 1104, 1122), - }); - declarations.push(Declaration { - id: DeclarationId(504), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 1127, 1141), - }); - declarations.push(Declaration { - id: DeclarationId(505), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 1423, 1432), - }); - declarations.push(Declaration { - id: DeclarationId(506), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "significand_bits".to_string(), - ty: DeclarationId(92), - }, - Field { - label: "exponent_bits".to_string(), - ty: DeclarationId(92), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 1437, 1514), - }); - declarations.push(Declaration { - id: DeclarationId(507), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "digits".to_string(), - ty: DeclarationId(92), - }, - Field { - label: "exponent_digits".to_string(), - ty: DeclarationId(92), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 1519, 1589), - }); - declarations.push(Declaration { - id: DeclarationId(508), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 1829, 1834), - }); - declarations.push(Declaration { - id: DeclarationId(509), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 1837, 1845), - }); - declarations.push(Declaration { - id: DeclarationId(510), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 1848, 1868), - }); - declarations.push(Declaration { - id: DeclarationId(511), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 2118, 2128), - }); - declarations.push(Declaration { - id: DeclarationId(512), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 2131, 2145), - }); - declarations.push(Declaration { - id: DeclarationId(513), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 2400, 2412), - }); - declarations.push(Declaration { - id: DeclarationId(514), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 2415, 2425), - }); - declarations.push(Declaration { - id: DeclarationId(515), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 2743, 2755), - }); - declarations.push(Declaration { - id: DeclarationId(516), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 2758, 2774), - }); - declarations.push(Declaration { - id: DeclarationId(517), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 2777, 2788), - }); - declarations.push(Declaration { - id: DeclarationId(518), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(39), - arguments: vec![TemplateArgument { - parameter: DeclarationId(40), - value: DeclarationId(102), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 3433, 3441), - }); - declarations.push(Declaration { - id: DeclarationId(519), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(29), - arguments: vec![TemplateArgument { - parameter: DeclarationId(30), - value: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/float.dag", 1482, 1503), - }); - declarations.push(Declaration { - id: DeclarationId(520), - name: None, - connective: TypeConnective::Atom(AtomPayload::Literal(LiteralBits::Int( - "32".to_string(), - ))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/float.dag", 1767, 1769), - }); - declarations.push(Declaration { - id: DeclarationId(521), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(70), - arguments: vec![TemplateArgument { - parameter: DeclarationId(71), - value: DeclarationId(520), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/float.dag", 1754, 1770), - }); - declarations.push(Declaration { - id: DeclarationId(522), - name: None, - connective: TypeConnective::Atom(AtomPayload::Literal(LiteralBits::Int( - "64".to_string(), - ))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/float.dag", 1813, 1815), - }); - declarations.push(Declaration { - id: DeclarationId(523), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(70), - arguments: vec![TemplateArgument { - parameter: DeclarationId(71), - value: DeclarationId(522), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/float.dag", 1800, 1816), - }); - declarations.push(Declaration { - id: DeclarationId(524), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(87), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 3805, 3809), - }); - declarations.push(Declaration { - id: DeclarationId(525), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 4078, 4090), - }); - declarations.push(Declaration { - id: DeclarationId(526), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 4356, 4363), - }); - declarations.push(Declaration { - id: DeclarationId(527), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 6656, 6663), - }); - declarations.push(Declaration { - id: DeclarationId(528), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 6771, 6778), - }); - declarations.push(Declaration { - id: DeclarationId(529), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 7229, 7241), - }); - declarations.push(Declaration { - id: DeclarationId(530), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 8318, 8322), - }); - declarations.push(Declaration { - id: DeclarationId(531), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 8325, 8330), - }); - declarations.push(Declaration { - id: DeclarationId(532), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(45), - arguments: vec![TemplateArgument { - parameter: DeclarationId(46), - value: DeclarationId(124), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 8306, 8330), - }); - declarations.push(Declaration { - id: DeclarationId(533), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(150), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 13164, 13181), - }); - declarations.push(Declaration { - id: DeclarationId(534), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(151), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 13215, 13232), - }); - declarations.push(Declaration { - id: DeclarationId(535), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17179, 17184), - }); - declarations.push(Declaration { - id: DeclarationId(536), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17187, 17192), - }); - declarations.push(Declaration { - id: DeclarationId(537), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17195, 17202), - }); - declarations.push(Declaration { - id: DeclarationId(538), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17354, 17358), - }); - declarations.push(Declaration { - id: DeclarationId(539), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17361, 17370), - }); - declarations.push(Declaration { - id: DeclarationId(540), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17373, 17379), - }); - declarations.push(Declaration { - id: DeclarationId(541), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17382, 17385), - }); - declarations.push(Declaration { - id: DeclarationId(542), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17410, 17418), - }); - declarations.push(Declaration { - id: DeclarationId(543), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17421, 17430), - }); - declarations.push(Declaration { - id: DeclarationId(544), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17433, 17439), - }); - declarations.push(Declaration { - id: DeclarationId(545), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17459, 17461), - }); - declarations.push(Declaration { - id: DeclarationId(546), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17464, 17465), - }); - declarations.push(Declaration { - id: DeclarationId(547), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17468, 17469), - }); - declarations.push(Declaration { - id: DeclarationId(548), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17472, 17473), - }); - declarations.push(Declaration { - id: DeclarationId(549), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17476, 17478), - }); - declarations.push(Declaration { - id: DeclarationId(550), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "secret_name".to_string(), - ty: DeclarationId(147), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17750, 17785), - }); - declarations.push(Declaration { - id: DeclarationId(551), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "env_var".to_string(), - ty: DeclarationId(147), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17790, 17831), - }); - declarations.push(Declaration { - id: DeclarationId(552), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(177), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17906, 17926), - }); - declarations.push(Declaration { - id: DeclarationId(553), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17941, 17953), - }); - declarations.push(Declaration { - id: DeclarationId(554), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "audience".to_string(), - ty: DeclarationId(147), - }, - Field { - label: "service_account".to_string(), - ty: DeclarationId(552), - }, - Field { - label: "scopes".to_string(), - ty: DeclarationId(553), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17836, 17959), - }); - declarations.push(Declaration { - id: DeclarationId(555), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17990, 18002), - }); - declarations.push(Declaration { - id: DeclarationId(556), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "scopes".to_string(), - ty: DeclarationId(555), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17964, 18004), - }); - declarations.push(Declaration { - id: DeclarationId(557), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(182), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18026, 18046), - }); - declarations.push(Declaration { - id: DeclarationId(558), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "steps".to_string(), - ty: DeclarationId(557), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18009, 18048), - }); - declarations.push(Declaration { - id: DeclarationId(559), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18135, 18141), - }); - declarations.push(Declaration { - id: DeclarationId(560), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18144, 18147), - }); - declarations.push(Declaration { - id: DeclarationId(561), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18150, 18157), - }); - declarations.push(Declaration { - id: DeclarationId(562), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18160, 18163), - }); - declarations.push(Declaration { - id: DeclarationId(563), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18166, 18171), - }); - declarations.push(Declaration { - id: DeclarationId(564), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18174, 18178), - }); - declarations.push(Declaration { - id: DeclarationId(565), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18181, 18187), - }); - declarations.push(Declaration { - id: DeclarationId(566), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18190, 18196), - }); - declarations.push(Declaration { - id: DeclarationId(567), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18199, 18207), - }); - declarations.push(Declaration { - id: DeclarationId(568), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18210, 18217), - }); - declarations.push(Declaration { - id: DeclarationId(569), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18220, 18226), - }); - declarations.push(Declaration { - id: DeclarationId(570), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18241, 18254), - }); - declarations.push(Declaration { - id: DeclarationId(571), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18257, 18259), - }); - declarations.push(Declaration { - id: DeclarationId(572), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18262, 18267), - }); - declarations.push(Declaration { - id: DeclarationId(573), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18270, 18273), - }); - declarations.push(Declaration { - id: DeclarationId(574), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18284, 18289), - }); - declarations.push(Declaration { - id: DeclarationId(575), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18292, 18297), - }); - declarations.push(Declaration { - id: DeclarationId(576), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18300, 18307), - }); - declarations.push(Declaration { - id: DeclarationId(577), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18310, 18317), - }); - declarations.push(Declaration { - id: DeclarationId(578), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18320, 18327), - }); - declarations.push(Declaration { - id: DeclarationId(579), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18330, 18333), - }); - declarations.push(Declaration { - id: DeclarationId(580), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18336, 18340), - }); - declarations.push(Declaration { - id: DeclarationId(581), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18355, 18362), - }); - declarations.push(Declaration { - id: DeclarationId(582), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18365, 18368), - }); - declarations.push(Declaration { - id: DeclarationId(583), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18371, 18378), - }); - declarations.push(Declaration { - id: DeclarationId(584), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18381, 18390), - }); - declarations.push(Declaration { - id: DeclarationId(585), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18393, 18397), - }); - declarations.push(Declaration { - id: DeclarationId(586), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18400, 18404), - }); - declarations.push(Declaration { - id: DeclarationId(587), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18407, 18417), - }); - declarations.push(Declaration { - id: DeclarationId(588), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18420, 18424), - }); - declarations.push(Declaration { - id: DeclarationId(589), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18427, 18433), - }); - declarations.push(Declaration { - id: DeclarationId(590), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18454, 18460), - }); - declarations.push(Declaration { - id: DeclarationId(591), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18463, 18466), - }); - declarations.push(Declaration { - id: DeclarationId(592), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18469, 18478), - }); - declarations.push(Declaration { - id: DeclarationId(593), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18481, 18483), - }); - declarations.push(Declaration { - id: DeclarationId(594), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18486, 18494), - }); - declarations.push(Declaration { - id: DeclarationId(595), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(186), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18562, 18569), - }); - declarations.push(Declaration { - id: DeclarationId(596), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18966, 18977), - }); - declarations.push(Declaration { - id: DeclarationId(597), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18982, 18991), - }); - declarations.push(Declaration { - id: DeclarationId(598), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18996, 19003), - }); - declarations.push(Declaration { - id: DeclarationId(599), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 19008, 19015), - }); - declarations.push(Declaration { - id: DeclarationId(600), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 19020, 19025), - }); - declarations.push(Declaration { - id: DeclarationId(601), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 19178, 19188), - }); - declarations.push(Declaration { - id: DeclarationId(602), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 19193, 19202), - }); - declarations.push(Declaration { - id: DeclarationId(603), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 19207, 19213), - }); - declarations.push(Declaration { - id: DeclarationId(604), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 21516, 21519), - }); - declarations.push(Declaration { - id: DeclarationId(605), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 21522, 21526), - }); - declarations.push(Declaration { - id: DeclarationId(606), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 21529, 21532), - }); - declarations.push(Declaration { - id: DeclarationId(607), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 21535, 21540), - }); - declarations.push(Declaration { - id: DeclarationId(608), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 21543, 21549), - }); - declarations.push(Declaration { - id: DeclarationId(609), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 21552, 21556), - }); - declarations.push(Declaration { - id: DeclarationId(610), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 21559, 21566), - }); - declarations.push(Declaration { - id: DeclarationId(611), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22054, 22060), - }); - declarations.push(Declaration { - id: DeclarationId(612), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "name".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22065, 22088), - }); - declarations.push(Declaration { - id: DeclarationId(613), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "username".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22093, 22119), - }); - declarations.push(Declaration { - id: DeclarationId(614), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22124, 22130), - }); - declarations.push(Declaration { - id: DeclarationId(615), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(156), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22322, 22332), - }); - declarations.push(Declaration { - id: DeclarationId(616), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22457, 22464), - }); - declarations.push(Declaration { - id: DeclarationId(617), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22504, 22516), - }); - declarations.push(Declaration { - id: DeclarationId(618), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(87), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22531, 22535), - }); - declarations.push(Declaration { - id: DeclarationId(619), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(210), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 23886, 23904), - }); - declarations.push(Declaration { - id: DeclarationId(620), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(211), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 23997, 24018), - }); - declarations.push(Declaration { - id: DeclarationId(621), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24302, 24309), - }); - declarations.push(Declaration { - id: DeclarationId(622), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(215), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24342, 24357), - }); - declarations.push(Declaration { - id: DeclarationId(623), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(218), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24646, 24664), - }); - declarations.push(Declaration { - id: DeclarationId(624), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(219), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24674, 24692), - }); - declarations.push(Declaration { - id: DeclarationId(625), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24714, 24726), - }); - declarations.push(Declaration { - id: DeclarationId(626), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24814, 24821), - }); - declarations.push(Declaration { - id: DeclarationId(627), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24908, 24915), - }); - declarations.push(Declaration { - id: DeclarationId(628), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24943, 24955), - }); - declarations.push(Declaration { - id: DeclarationId(629), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24967, 24979), - }); - declarations.push(Declaration { - id: DeclarationId(630), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24991, 25003), - }); - declarations.push(Declaration { - id: DeclarationId(631), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(222), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25138, 25153), - }); - declarations.push(Declaration { - id: DeclarationId(632), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(188), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25164, 25177), - }); - declarations.push(Declaration { - id: DeclarationId(633), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(187), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25193, 25206), - }); - declarations.push(Declaration { - id: DeclarationId(634), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25232, 25236), - }); - declarations.push(Declaration { - id: DeclarationId(635), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25239, 25241), - }); - declarations.push(Declaration { - id: DeclarationId(636), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25244, 25245), - }); - declarations.push(Declaration { - id: DeclarationId(637), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25248, 25252), - }); - declarations.push(Declaration { - id: DeclarationId(638), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25316, 25323), - }); - declarations.push(Declaration { - id: DeclarationId(639), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(124), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 3063, 3080), - }); - declarations.push(Declaration { - id: DeclarationId(640), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(87), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 3538, 3554), - }); - declarations.push(Declaration { - id: DeclarationId(641), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(124), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 4840, 4857), - }); - declarations.push(Declaration { - id: DeclarationId(642), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 5822, 5841), - }); - declarations.push(Declaration { - id: DeclarationId(643), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 6425, 6444), - }); - declarations.push(Declaration { - id: DeclarationId(644), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(20))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 9194, 9223), - }); - declarations.push(Declaration { - id: DeclarationId(645), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(26))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 11619, 11640), - }); - declarations.push(Declaration { - id: DeclarationId(646), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(32))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 11671, 11696), - }); - declarations.push(Declaration { - id: DeclarationId(647), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(38))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 11827, 11852), - }); - declarations.push(Declaration { - id: DeclarationId(648), - name: Some("".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 12010, 12052), - }); - declarations.push(Declaration { - id: DeclarationId(649), - name: Some("".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 12239, 12284), - }); - declarations.push(Declaration { - id: DeclarationId(650), - name: Some("".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 12285, 12330), - }); - declarations.push(Declaration { - id: DeclarationId(651), - name: Some("".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 12331, 12376), - }); - declarations.push(Declaration { - id: DeclarationId(652), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(147)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(44))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 13050, 13070), - }); - declarations.push(Declaration { - id: DeclarationId(653), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(147)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(50))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 13110, 13130), - }); - declarations.push(Declaration { - id: DeclarationId(654), - name: Some("".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 13235, 13278), - }); - declarations.push(Declaration { - id: DeclarationId(655), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(53))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 14114, 14127), - }); - declarations.push(Declaration { - id: DeclarationId(656), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(56))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 14159, 14172), - }); - declarations.push(Declaration { - id: DeclarationId(657), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(65))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 14204, 14240), - }); - declarations.push(Declaration { - id: DeclarationId(658), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(74))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 14272, 14303), - }); - declarations.push(Declaration { - id: DeclarationId(659), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(147)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(80))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 14509, 14529), - }); - declarations.push(Declaration { - id: DeclarationId(660), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(147)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(86))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15091, 15108), - }); - declarations.push(Declaration { - id: DeclarationId(661), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(147)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(92))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15147, 15163), - }); - declarations.push(Declaration { - id: DeclarationId(662), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(147)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(98))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15202, 15217), - }); - declarations.push(Declaration { - id: DeclarationId(663), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(147)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(104))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15256, 15275), - }); - declarations.push(Declaration { - id: DeclarationId(664), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(147)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(110))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15314, 15333), - }); - declarations.push(Declaration { - id: DeclarationId(665), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(147)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(116))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15372, 15389), - }); - declarations.push(Declaration { - id: DeclarationId(666), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(147)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(122))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15428, 15446), - }); - declarations.push(Declaration { - id: DeclarationId(667), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(147)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(128))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15485, 15503), - }); - declarations.push(Declaration { - id: DeclarationId(668), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(147)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(134))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15542, 15562), - }); - declarations.push(Declaration { - id: DeclarationId(669), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(147)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(140))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15837, 15864), - }); - declarations.push(Declaration { - id: DeclarationId(670), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(147)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(146))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15909, 15936), - }); - declarations.push(Declaration { - id: DeclarationId(671), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(147)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(152))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15979, 16004), - }); - declarations.push(Declaration { - id: DeclarationId(672), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(147)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(158))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 16044, 16066), - }); - declarations.push(Declaration { - id: DeclarationId(673), - name: Some("".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 16146, 16188), - }); - declarations.push(Declaration { - id: DeclarationId(674), - name: Some("".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 16573, 16615), - }); - declarations.push(Declaration { - id: DeclarationId(675), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(154)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(164))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22653, 22678), - }); - declarations.push(Declaration { - id: DeclarationId(676), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(125)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(170))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22714, 22736), - }); - declarations.push(Declaration { - id: DeclarationId(677), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(176))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22774, 22793), - }); - declarations.push(Declaration { - id: DeclarationId(678), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 3679, 3689), - }); - declarations.push(Declaration { - id: DeclarationId(679), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 3692, 3697), - }); - declarations.push(Declaration { - id: DeclarationId(680), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 3700, 3710), - }); - declarations.push(Declaration { - id: DeclarationId(681), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 3713, 3726), - }); - declarations.push(Declaration { - id: DeclarationId(682), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 5310, 5319), - }); - declarations.push(Declaration { - id: DeclarationId(683), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 5322, 5328), - }); - declarations.push(Declaration { - id: DeclarationId(684), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 5331, 5335), - }); - declarations.push(Declaration { - id: DeclarationId(685), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(232), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 5883, 5901), - }); - declarations.push(Declaration { - id: DeclarationId(686), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 6703, 6712), - }); - declarations.push(Declaration { - id: DeclarationId(687), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(232), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 6952, 6970), - }); - declarations.push(Declaration { - id: DeclarationId(688), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/serialization.dag", 1873, 1883), - }); - declarations.push(Declaration { - id: DeclarationId(689), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/serialization.dag", 1888, 1897), - }); - declarations.push(Declaration { - id: DeclarationId(690), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "prefix".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/serialization.dag", 1902, 1944), - }); - declarations.push(Declaration { - id: DeclarationId(691), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "suffix".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/serialization.dag", 1949, 1991), - }); - declarations.push(Declaration { - id: DeclarationId(692), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "prefix".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "suffix".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/serialization.dag", 1996, 2060), - }); - declarations.push(Declaration { - id: DeclarationId(693), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "naming".to_string(), - ty: DeclarationId(308), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/serialization.dag", 2631, 2670), - }); - declarations.push(Declaration { - id: DeclarationId(694), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "tag_field".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "naming".to_string(), - ty: DeclarationId(308), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/serialization.dag", 2675, 2742), - }); - declarations.push(Declaration { - id: DeclarationId(695), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/serialization.dag", 2747, 2762), - }); - declarations.push(Declaration { - id: DeclarationId(696), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/serialization.dag", 2767, 2780), - }); - declarations.push(Declaration { - id: DeclarationId(697), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/serialization.dag", 3499, 3503), - }); - declarations.push(Declaration { - id: DeclarationId(698), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/serialization.dag", 3506, 3510), - }); - declarations.push(Declaration { - id: DeclarationId(699), - name: Some("List".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Empty".to_string(), - ty: DeclarationId(1474), - }, - Field { - label: "Cons".to_string(), - ty: DeclarationId(1476), - }, - ], - }, - type_params: vec![DeclarationId(700)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 2083, 2159), - }); - declarations.push(Declaration { - id: DeclarationId(700), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("element".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 2083, 2159), - }); - declarations.push(Declaration { - id: DeclarationId(701), - name: Some("empty".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(1444), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/list.dag", 3273, 3284)), - }, - type_params: vec![DeclarationId(702)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 3236, 3284), - }); - declarations.push(Declaration { - id: DeclarationId(702), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("element".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 3236, 3284), - }); - declarations.push(Declaration { - id: DeclarationId(703), - name: Some("cons".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(704), DeclarationId(1445)], - output: DeclarationId(1446), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/list.dag", 3453, 3475)), - }, - type_params: vec![DeclarationId(704)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 3383, 3475), - }); - declarations.push(Declaration { - id: DeclarationId(704), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("element".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 3383, 3475), - }); - declarations.push(Declaration { - id: DeclarationId(705), - name: Some("singleton".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(706)], - output: DeclarationId(1447), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/list.dag", 3570, 3590)), - }, - type_params: vec![DeclarationId(706)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 3519, 3590), - }); - declarations.push(Declaration { - id: DeclarationId(706), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("element".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 3519, 3590), - }); - declarations.push(Declaration { - id: DeclarationId(707), - name: Some("fold".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1448), DeclarationId(709), DeclarationId(1449)], - output: DeclarationId(709), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/list.dag", 4203, 4307)), - }, - type_params: vec![DeclarationId(708), DeclarationId(709)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 4142, 4307), - }); - declarations.push(Declaration { - id: DeclarationId(708), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 4142, 4307), - }); - declarations.push(Declaration { - id: DeclarationId(709), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("U".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 4142, 4307), - }); - declarations.push(Declaration { - id: DeclarationId(710), - name: Some("fold_right".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1450), DeclarationId(712), DeclarationId(1451)], - output: DeclarationId(712), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/list.dag", 4658, 4768)), - }, - type_params: vec![DeclarationId(711), DeclarationId(712)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 4591, 4768), - }); - declarations.push(Declaration { - id: DeclarationId(711), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 4591, 4768), - }); - declarations.push(Declaration { - id: DeclarationId(712), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("U".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 4591, 4768), - }); - declarations.push(Declaration { - id: DeclarationId(713), - name: Some("concat".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1452), DeclarationId(1453)], - output: DeclarationId(1454), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/list.dag", 5386, 5414)), - }, - type_params: vec![DeclarationId(714)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 5314, 5414), - }); - declarations.push(Declaration { - id: DeclarationId(714), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("element".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 5314, 5414), - }); - declarations.push(Declaration { - id: DeclarationId(715), - name: Some("map".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1455), DeclarationId(1456)], - output: DeclarationId(1457), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/list.dag", 5721, 5778)), - }, - type_params: vec![DeclarationId(716), DeclarationId(717)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 5667, 5778), - }); - declarations.push(Declaration { - id: DeclarationId(716), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("A".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 5667, 5778), - }); - declarations.push(Declaration { - id: DeclarationId(717), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("B".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 5667, 5778), - }); - declarations.push(Declaration { - id: DeclarationId(718), - name: Some("filter".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1458), DeclarationId(1459)], - output: DeclarationId(1460), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/list.dag", 5905, 5988)), - }, - type_params: vec![DeclarationId(719)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 5848, 5988), - }); - declarations.push(Declaration { - id: DeclarationId(719), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 5848, 5988), - }); - declarations.push(Declaration { - id: DeclarationId(720), - name: Some("flat_map".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1461), DeclarationId(1463)], - output: DeclarationId(1464), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/list.dag", 6171, 6230)), - }, - type_params: vec![DeclarationId(721), DeclarationId(722)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 6106, 6230), - }); - declarations.push(Declaration { - id: DeclarationId(721), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("A".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 6106, 6230), - }); - declarations.push(Declaration { - id: DeclarationId(722), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("B".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 6106, 6230), - }); - declarations.push(Declaration { - id: DeclarationId(723), - name: Some("length".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1465)], - output: DeclarationId(87), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/list.dag", 6372, 6409)), - }, - type_params: vec![DeclarationId(724)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 6337, 6409), - }); - declarations.push(Declaration { - id: DeclarationId(724), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 6337, 6409), - }); - declarations.push(Declaration { - id: DeclarationId(725), - name: Some("is_empty".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1466)], - output: DeclarationId(124), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/list.dag", 6605, 6671)), - }, - type_params: vec![DeclarationId(726)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 6567, 6671), - }); - declarations.push(Declaration { - id: DeclarationId(726), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 6567, 6671), - }); - declarations.push(Declaration { - id: DeclarationId(727), - name: Some("IndexedElement".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "index".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "value".to_string(), - ty: DeclarationId(728), - }, - ], - }, - type_params: vec![DeclarationId(728)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 6993, 7055), - }); - declarations.push(Declaration { - id: DeclarationId(728), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("element".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 6993, 7055), - }); - declarations.push(Declaration { - id: DeclarationId(729), - name: Some("enumerate".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1467)], - output: DeclarationId(1469), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/list.dag", 7238, 7269)), - }, - type_params: vec![DeclarationId(730)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 7180, 7269), - }); - declarations.push(Declaration { - id: DeclarationId(730), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 7180, 7269), - }); - declarations.push(Declaration { - id: DeclarationId(731), - name: Some("enumerate_helper".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1470), DeclarationId(87)], - output: DeclarationId(1472), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/list.dag", 7463, 7644)), - }, - type_params: vec![DeclarationId(732)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 7386, 7644), - }); - declarations.push(Declaration { - id: DeclarationId(732), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 7386, 7644), - }); - declarations.push(Declaration { - id: DeclarationId(733), - name: Some("contains".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1473), DeclarationId(734)], - output: DeclarationId(124), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/list.dag", 8205, 8332)), - }, - type_params: vec![DeclarationId(734)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 8156, 8332), - }); - declarations.push(Declaration { - id: DeclarationId(734), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 8156, 8332), - }); - declarations.push(Declaration { - id: DeclarationId(735), - name: Some("NodeId".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate_minimal.dag", 1364, 1375), - }); - declarations.push(Declaration { - id: DeclarationId(736), - name: Some("PortId".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate_minimal.dag", 1376, 1387), - }); - declarations.push(Declaration { - id: DeclarationId(737), - name: Some("DeclarationId".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate_minimal.dag", 1388, 1406), - }); - declarations.push(Declaration { - id: DeclarationId(738), - name: Some("ClusterId".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate_minimal.dag", 1407, 1421), - }); - declarations.push(Declaration { - id: DeclarationId(739), - name: Some("NonEmptyList".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "first".to_string(), - ty: DeclarationId(740), - }, - Field { - label: "rest".to_string(), - ty: DeclarationId(1477), - }, - ], - }, - type_params: vec![DeclarationId(740)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate_minimal.dag", 1423, 1492), - }); - declarations.push(Declaration { - id: DeclarationId(740), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("element".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate_minimal.dag", 1423, 1492), - }); - declarations.push(Declaration { - id: DeclarationId(741), - name: Some("NonSingletonList".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "first".to_string(), - ty: DeclarationId(742), - }, - Field { - label: "second".to_string(), - ty: DeclarationId(742), - }, - Field { - label: "rest".to_string(), - ty: DeclarationId(1478), - }, - ], - }, - type_params: vec![DeclarationId(742)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate_minimal.dag", 1494, 1585), - }); - declarations.push(Declaration { - id: DeclarationId(742), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("element".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate_minimal.dag", 1494, 1585), - }); - declarations.push(Declaration { - id: DeclarationId(743), - name: Some("UrlPathToken".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "LiteralToken".to_string(), - ty: DeclarationId(1491), - }, - Field { - label: "ParamToken".to_string(), - ty: DeclarationId(1492), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 7655, 7740), - }); - declarations.push(Declaration { - id: DeclarationId(744), - name: Some("PathTemplate".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "tokens".to_string(), - ty: DeclarationId(1493), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 7742, 7792), - }); - declarations.push(Declaration { - id: DeclarationId(745), - name: Some("PathSegmentTokensResult".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ParsedSegmentTokens".to_string(), - ty: DeclarationId(1495), - }, - Field { - label: "MalformedPathSegment".to_string(), - ty: DeclarationId(1496), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 8148, 8292), - }); - declarations.push(Declaration { - id: DeclarationId(746), - name: Some("PathTemplateParseResult".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ParsedPathTemplate".to_string(), - ty: DeclarationId(1497), - }, - Field { - label: "MalformedPathTemplate".to_string(), - ty: DeclarationId(1498), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 8622, 8775), - }); - declarations.push(Declaration { - id: DeclarationId(747), - name: Some("parse_path_template".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227)], - output: DeclarationId(746), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/effects.dag", 8840, 10145)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 8777, 10145), - }); - declarations.push(Declaration { - id: DeclarationId(748), - name: Some("parse_segment_tokens".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227)], - output: DeclarationId(745), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/effects.dag", 10211, 11850)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 10147, 11850), - }); - declarations.push(Declaration { - id: DeclarationId(749), - name: Some("last_path_param".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(744)], - output: DeclarationId(1479), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/effects.dag", 11906, 12189)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 11852, 12189), - }); - declarations.push(Declaration { - id: DeclarationId(750), - name: Some("IdempotentShape".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ReadEffect".to_string(), - ty: DeclarationId(1499), - }, - Field { - label: "UpsertEffect".to_string(), - ty: DeclarationId(1500), - }, - Field { - label: "DeleteEffect".to_string(), - ty: DeclarationId(1501), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 14473, 14594), - }); - declarations.push(Declaration { - id: DeclarationId(751), - name: Some("BreakingShape".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "CreateEffect".to_string(), - ty: DeclarationId(1502), - }, - Field { - label: "AppendEffect".to_string(), - ty: DeclarationId(1503), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 14817, 14892), - }); - declarations.push(Declaration { - id: DeclarationId(752), - name: Some("EffectShape".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "IsIdempotent".to_string(), - ty: DeclarationId(1504), - }, - Field { - label: "IsBreaking".to_string(), - ty: DeclarationId(1505), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 15293, 15373), - }); - declarations.push(Declaration { - id: DeclarationId(753), - name: Some("CreateCause".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "PostAlways".to_string(), - ty: DeclarationId(1506), - }, - Field { - label: "KeylessFallback".to_string(), - ty: DeclarationId(1507), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 15865, 15939), - }); - declarations.push(Declaration { - id: DeclarationId(754), - name: Some("EffectClassificationFailure".to_string()), - connective: TypeConnective::Disj { - variants: vec![Field { - label: "ClassifierAnchorResolutionFailed".to_string(), - ty: DeclarationId(1508), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 15941, 16010), - }); - declarations.push(Declaration { - id: DeclarationId(755), - name: Some("EffectClassificationResult".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "EffectClassified".to_string(), - ty: DeclarationId(1509), - }, - Field { - label: "EffectClassificationFailed".to_string(), - ty: DeclarationId(1510), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 16012, 16159), - }); - declarations.push(Declaration { - id: DeclarationId(756), - name: Some("KeySource".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "PathParam".to_string(), - ty: DeclarationId(1511), - }, - Field { - label: "InputField".to_string(), - ty: DeclarationId(1512), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 16790, 16869), - }); - declarations.push(Declaration { - id: DeclarationId(757), - name: Some("IdempotencyEvidence".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "LatticeEffect".to_string(), - ty: DeclarationId(1513), - }, - Field { - label: "IdentityEffect".to_string(), - ty: DeclarationId(1514), - }, - Field { - label: "NonIdempotent".to_string(), - ty: DeclarationId(1515), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 17517, 17615), - }); - declarations.push(Declaration { - id: DeclarationId(758), - name: Some("is_idempotent_effect".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(752)], - output: DeclarationId(124), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/effects.dag", 17842, 17914)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 17790, 17914), - }); - declarations.push(Declaration { - id: DeclarationId(759), - name: Some("derive_idempotency_evidence".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(752)], - output: DeclarationId(757), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/effects.dag", 18127, 18647)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 18053, 18647), - }); - declarations.push(Declaration { - id: DeclarationId(760), - name: Some("CompositionVerdict".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "IdempotentComposition".to_string(), - ty: DeclarationId(1516), - }, - Field { - label: "BrokenBy".to_string(), - ty: DeclarationId(1518), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 19999, 20102), - }); - declarations.push(Declaration { - id: DeclarationId(761), - name: Some("operation_is_breaking".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(966)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(256))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 20238, 20344), - }); - declarations.push(Declaration { - id: DeclarationId(762), - name: Some("effect_shape_is_breaking".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(752)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(260))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 20346, 20472), - }); - declarations.push(Declaration { - id: DeclarationId(763), - name: Some("operation_effect_shape".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(966)], - output: DeclarationId(752), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/effects.dag", 20530, 22460)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 20474, 22460), - }); - declarations.push(Declaration { - id: DeclarationId(764), - name: Some("classify_operation_effect".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(966)], - output: DeclarationId(755), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/effects.dag", 22536, 22596)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 22462, 22596), - }); - declarations.push(Declaration { - id: DeclarationId(765), - name: Some("transport_effect_shape".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(966)], - output: DeclarationId(752), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/effects.dag", 22654, 23710)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 22598, 23710), - }); - declarations.push(Declaration { - id: DeclarationId(766), - name: Some("method_is_read".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(195)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(269))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 23712, 23907), - }); - declarations.push(Declaration { - id: DeclarationId(767), - name: Some("method_is_upsert".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(195)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(278))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 23909, 24107), - }); - declarations.push(Declaration { - id: DeclarationId(768), - name: Some("method_is_post".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(195)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(287))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 24109, 24306), - }); - declarations.push(Declaration { - id: DeclarationId(769), - name: Some("method_is_delete".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(195)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(296))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 24308, 24507), - }); - declarations.push(Declaration { - id: DeclarationId(770), - name: Some("operation_resource_key".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(966)], - output: DeclarationId(1480), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/effects.dag", 24561, 24752)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 24509, 24752), - }); - declarations.push(Declaration { - id: DeclarationId(771), - name: Some("breaker_ref".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87)], - output: DeclarationId(1481), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/effects.dag", 24806, 24828)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 24754, 24828), - }); - declarations.push(Declaration { - id: DeclarationId(772), - name: Some("indexed_breaker_ref".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1482)], - output: DeclarationId(1484), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/effects.dag", 24910, 25003)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 24830, 25003), - }); - declarations.push(Declaration { - id: DeclarationId(773), - name: Some("first_breaker_ref".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1485)], - output: DeclarationId(1487), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/effects.dag", 25078, 25261)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 25005, 25261), - }); - declarations.push(Declaration { - id: DeclarationId(774), - name: Some("compose_effects".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1488)], - output: DeclarationId(760), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/effects.dag", 26139, 26262)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 26072, 26262), - }); - declarations.push(Declaration { - id: DeclarationId(775), - name: Some("BoolPortRef".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "port".to_string(), - ty: DeclarationId(736), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 27463, 27498), - }); - declarations.push(Declaration { - id: DeclarationId(776), - name: Some("BranchArm".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "condition".to_string(), - ty: DeclarationId(775), - }, - Field { - label: "body".to_string(), - ty: DeclarationId(777), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 27583, 27649), - }); - declarations.push(Declaration { - id: DeclarationId(777), - name: Some("WorkflowEffect".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "LinearEffect".to_string(), - ty: DeclarationId(1520), - }, - Field { - label: "BranchEffect".to_string(), - ty: DeclarationId(1522), - }, - Field { - label: "LoopEffect".to_string(), - ty: DeclarationId(1523), - }, - Field { - label: "ParallelEffect".to_string(), - ty: DeclarationId(1525), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 28325, 28547), - }); - declarations.push(Declaration { - id: DeclarationId(778), - name: Some("IdempotencyUnsupportedDetail".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "variant_name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "downstream_stage".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "reason".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 28906, 29010), - }); - declarations.push(Declaration { - id: DeclarationId(779), - name: Some("WorkflowIdempotencyReport".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "WorkflowCompositionVerdict".to_string(), - ty: DeclarationId(1526), - }, - Field { - label: "IdempotencyUnsupported".to_string(), - ty: DeclarationId(1527), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 29149, 29287), - }); - declarations.push(Declaration { - id: DeclarationId(780), - name: Some("report_unsupported_workflow_variant".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227), DeclarationId(227), DeclarationId(227)], - output: DeclarationId(779), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/effects.dag", 29429, 29585)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 29289, 29585), - }); - declarations.push(Declaration { - id: DeclarationId(781), - name: Some("ParallelismUnsupportedKind".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "NoWorkflowProjection".to_string(), - ty: DeclarationId(1528), - }, - Field { - label: "NotParallelEffectRoot".to_string(), - ty: DeclarationId(1529), - }, - Field { - label: "NonLinearParallelBranch".to_string(), - ty: DeclarationId(1530), - }, - Field { - label: "PairwiseNonCommute".to_string(), - ty: DeclarationId(1531), - }, - Field { - label: "EffectClassificationUnavailable".to_string(), - ty: DeclarationId(1532), - }, - Field { - label: "LensSurfacePending".to_string(), - ty: DeclarationId(1533), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 29748, 29978), - }); - declarations.push(Declaration { - id: DeclarationId(782), - name: Some("ParallelismUnsupportedDetail".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "kind".to_string(), - ty: DeclarationId(781), - }, - Field { - label: "downstream_stage".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "reason".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 29980, 30096), - }); - declarations.push(Declaration { - id: DeclarationId(783), - name: Some("WorkflowParallelismReport".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ParallelCompositionVerdict".to_string(), - ty: DeclarationId(1534), - }, - Field { - label: "ParallelismUnsupported".to_string(), - ty: DeclarationId(1535), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 30260, 30398), - }); - declarations.push(Declaration { - id: DeclarationId(784), - name: Some("report_parallelism_unsupported".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(781), DeclarationId(227)], - output: DeclarationId(783), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/effects.dag", 30519, 30674)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 30400, 30674), - }); - declarations.push(Declaration { - id: DeclarationId(785), - name: Some("lane2_workflow_idempotency_report".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839), DeclarationId(777)], - output: DeclarationId(779), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/effects.dag", 31148, 31978)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 31054, 31978), - }); - declarations.push(Declaration { - id: DeclarationId(786), - name: Some("IdempotencyTestObligation".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "callable".to_string(), - ty: DeclarationId(965), - }, - Field { - label: "effect_shape".to_string(), - ty: DeclarationId(752), - }, - Field { - label: "claim".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "witness_required".to_string(), - ty: DeclarationId(124), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 32735, 32862), - }); - declarations.push(Declaration { - id: DeclarationId(787), - name: Some("generate_idempotency_obligations".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1489)], - output: DeclarationId(1490), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/effects.dag", 32961, 33255)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 32864, 33255), - }); - declarations.push(Declaration { - id: DeclarationId(788), - name: Some("WorkflowEffectConcern".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "workflow_name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "create_op".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "reason".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 33572, 33663), - }); - declarations.push(Declaration { - id: DeclarationId(789), - name: Some("TypeShape".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "declaration".to_string(), - ty: DeclarationId(737), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 270, 317), - }); - declarations.push(Declaration { - id: DeclarationId(790), - name: Some("SourceByteSpan".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "byte_start".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "byte_end".to_string(), - ty: DeclarationId(87), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 535, 592), - }); - declarations.push(Declaration { - id: DeclarationId(791), - name: Some("PortState".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Uninferred".to_string(), - ty: DeclarationId(1544), - }, - Field { - label: "Resolved".to_string(), - ty: DeclarationId(1545), - }, - Field { - label: "Unresolved".to_string(), - ty: DeclarationId(1546), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 735, 803), - }); - declarations.push(Declaration { - id: DeclarationId(792), - name: Some("DagPort".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "id".to_string(), - ty: DeclarationId(736), - }, - Field { - label: "state".to_string(), - ty: DeclarationId(791), - }, - Field { - label: "produced_by".to_string(), - ty: DeclarationId(1547), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 805, 876), - }); - declarations.push(Declaration { - id: DeclarationId(793), - name: Some("LiteralBits".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "LitInt".to_string(), - ty: DeclarationId(1548), - }, - Field { - label: "LitBool".to_string(), - ty: DeclarationId(1549), - }, - Field { - label: "LitString".to_string(), - ty: DeclarationId(1550), - }, - Field { - label: "LitSymbol".to_string(), - ty: DeclarationId(1551), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 1358, 1543), - }); - declarations.push(Declaration { - id: DeclarationId(794), - name: Some("AtomPayload".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Literal".to_string(), - ty: DeclarationId(1552), - }, - Field { - label: "UnresolvedIdentifier".to_string(), - ty: DeclarationId(1553), - }, - Field { - label: "ResolvedByStructure".to_string(), - ty: DeclarationId(1554), - }, - Field { - label: "ResolvedByName".to_string(), - ty: DeclarationId(1555), - }, - Field { - label: "TypeParam".to_string(), - ty: DeclarationId(1556), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 3655, 3824), - }); - declarations.push(Declaration { - id: DeclarationId(795), - name: Some("PositiveIntervalWidth".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "OneUnit".to_string(), - ty: DeclarationId(1557), - }, - Field { - label: "AdditionalUnit".to_string(), - ty: DeclarationId(1558), - }, - Field { - label: "UnitCount".to_string(), - ty: DeclarationId(1559), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 4417, 6098), - }); - declarations.push(Declaration { - id: DeclarationId(796), - name: Some("IntervalWidth".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ZeroWidth".to_string(), - ty: DeclarationId(1560), - }, - Field { - label: "PositiveWidth".to_string(), - ty: DeclarationId(1561), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 6100, 6173), - }); - declarations.push(Declaration { - id: DeclarationId(797), - name: Some("Interval".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "BoundedInterval".to_string(), - ty: DeclarationId(1562), - }, - Field { - label: "Unbounded".to_string(), - ty: DeclarationId(1563), - }, - ], - }, - type_params: vec![DeclarationId(798)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 6464, 6549), - }); - declarations.push(Declaration { - id: DeclarationId(798), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("D".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 6464, 6549), - }); - declarations.push(Declaration { - id: DeclarationId(799), - name: Some("IntInterval".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(797), - arguments: vec![TemplateArgument { - parameter: DeclarationId(798), - value: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 6699, 6731), - }); - declarations.push(Declaration { - id: DeclarationId(800), - name: Some("BoundDeclaration".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "StaticBound".to_string(), - ty: DeclarationId(1565), - }, - Field { - label: "PlatformDependent".to_string(), - ty: DeclarationId(1566), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 7087, 7161), - }); - declarations.push(Declaration { - id: DeclarationId(801), - name: Some("CardinalityBound".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Exact".to_string(), - ty: DeclarationId(1567), - }, - Field { - label: "AtMostOne".to_string(), - ty: DeclarationId(1568), - }, - Field { - label: "Unbounded".to_string(), - ty: DeclarationId(1569), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 7386, 7450), - }); - declarations.push(Declaration { - id: DeclarationId(802), - name: Some("ConjField".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "label".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "ty".to_string(), - ty: DeclarationId(737), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 7452, 7506), - }); - declarations.push(Declaration { - id: DeclarationId(803), - name: Some("TemplateArgument".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "parameter".to_string(), - ty: DeclarationId(737), - }, - Field { - label: "value".to_string(), - ty: DeclarationId(737), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 7508, 7583), - }); - declarations.push(Declaration { - id: DeclarationId(804), - name: Some("FieldEntry".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "label".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "value".to_string(), - ty: DeclarationId(805), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 7585, 7640), - }); - declarations.push(Declaration { - id: DeclarationId(805), - name: Some("FieldValue".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Literal".to_string(), - ty: DeclarationId(1570), - }, - Field { - label: "Reference".to_string(), - ty: DeclarationId(1571), - }, - Field { - label: "Record".to_string(), - ty: DeclarationId(1573), - }, - Field { - label: "List".to_string(), - ty: DeclarationId(1575), - }, - Field { - label: "Map".to_string(), - ty: DeclarationId(1577), - }, - Field { - label: "Variant".to_string(), - ty: DeclarationId(1579), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 7857, 8093), - }); - declarations.push(Declaration { - id: DeclarationId(806), - name: Some("ValueBody".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ValueBodyUnparsed".to_string(), - ty: DeclarationId(1580), - }, - Field { - label: "ValueBodyStructural".to_string(), - ty: DeclarationId(1582), - }, - Field { - label: "ValueBodyScalar".to_string(), - ty: DeclarationId(1583), - }, - Field { - label: "ValueBodyList".to_string(), - ty: DeclarationId(1585), - }, - Field { - label: "ValueBodyMap".to_string(), - ty: DeclarationId(1587), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 9687, 9892), - }); - declarations.push(Declaration { - id: DeclarationId(807), - name: Some("BindNodeId".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "node".to_string(), - ty: DeclarationId(735), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 10796, 10830), - }); - declarations.push(Declaration { - id: DeclarationId(808), - name: Some("ArrowBody".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "UserDefined".to_string(), - ty: DeclarationId(1588), - }, - Field { - label: "ExternalRealization".to_string(), - ty: DeclarationId(1589), - }, - Field { - label: "Pending".to_string(), - ty: DeclarationId(1590), - }, - Field { - label: "NoBody".to_string(), - ty: DeclarationId(1591), - }, - Field { - label: "Unparsed".to_string(), - ty: DeclarationId(1592), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 11127, 11256), - }); - declarations.push(Declaration { - id: DeclarationId(809), - name: Some("TypeConnective".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Atom".to_string(), - ty: DeclarationId(1593), - }, - Field { - label: "Conj".to_string(), - ty: DeclarationId(1595), - }, - Field { - label: "Disj".to_string(), - ty: DeclarationId(1597), - }, - Field { - label: "Arrow".to_string(), - ty: DeclarationId(1599), - }, - Field { - label: "Cardinality".to_string(), - ty: DeclarationId(1600), - }, - Field { - label: "Instantiation".to_string(), - ty: DeclarationId(1602), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 11461, 11861), - }); - declarations.push(Declaration { - id: DeclarationId(810), - name: Some("Declaration".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "id".to_string(), - ty: DeclarationId(737), - }, - Field { - label: "name".to_string(), - ty: DeclarationId(1603), - }, - Field { - label: "connective".to_string(), - ty: DeclarationId(809), - }, - Field { - label: "type_params".to_string(), - ty: DeclarationId(1604), - }, - Field { - label: "phantom_params".to_string(), - ty: DeclarationId(1605), - }, - Field { - label: "meta_tag".to_string(), - ty: DeclarationId(1606), - }, - Field { - label: "inhabits".to_string(), - ty: DeclarationId(1607), - }, - Field { - label: "value_body".to_string(), - ty: DeclarationId(1608), - }, - Field { - label: "nominal_opacity".to_string(), - ty: DeclarationId(1609), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 11863, 12157), - }); - declarations.push(Declaration { - id: DeclarationId(811), - name: Some("PhantomParameter".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "parameter".to_string(), - ty: DeclarationId(737), - }, - Field { - label: "algebra".to_string(), - ty: DeclarationId(737), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 12630, 12707), - }); - declarations.push(Declaration { - id: DeclarationId(812), - name: Some("NominalOpacity".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "permitted_accessors".to_string(), - ty: DeclarationId(1610), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 13214, 13280), - }); - declarations.push(Declaration { - id: DeclarationId(813), - name: Some("ArithmeticOp".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Add".to_string(), - ty: DeclarationId(1611), - }, - Field { - label: "Sub".to_string(), - ty: DeclarationId(1612), - }, - Field { - label: "Mul".to_string(), - ty: DeclarationId(1613), - }, - Field { - label: "Div".to_string(), - ty: DeclarationId(1614), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 13537, 13586), - }); - declarations.push(Declaration { - id: DeclarationId(814), - name: Some("ComparisonOp".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Eq".to_string(), - ty: DeclarationId(1615), - }, - Field { - label: "Ne".to_string(), - ty: DeclarationId(1616), - }, - Field { - label: "Lt".to_string(), - ty: DeclarationId(1617), - }, - Field { - label: "Le".to_string(), - ty: DeclarationId(1618), - }, - Field { - label: "Gt".to_string(), - ty: DeclarationId(1619), - }, - Field { - label: "Ge".to_string(), - ty: DeclarationId(1620), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 13688, 13747), - }); - declarations.push(Declaration { - id: DeclarationId(815), - name: Some("PerfBaselineMeasurement".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "median_ns".to_string(), - ty: DeclarationId(76), - }, - Field { - label: "p99_delta_ns".to_string(), - ty: DeclarationId(76), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 14202, 14271), - }); - declarations.push(Declaration { - id: DeclarationId(816), - name: Some("LogicalOp".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "And".to_string(), - ty: DeclarationId(1621), - }, - Field { - label: "Or".to_string(), - ty: DeclarationId(1622), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 14505, 14534), - }); - declarations.push(Declaration { - id: DeclarationId(817), - name: Some("OperatorKind".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Arithmetic".to_string(), - ty: DeclarationId(1623), - }, - Field { - label: "Comparison".to_string(), - ty: DeclarationId(1624), - }, - Field { - label: "Logical".to_string(), - ty: DeclarationId(1625), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 14748, 14846), - }); - declarations.push(Declaration { - id: DeclarationId(818), - name: Some("TransformTarget".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Callable".to_string(), - ty: DeclarationId(1626), - }, - Field { - label: "UnresolvedFieldProject".to_string(), - ty: DeclarationId(1627), - }, - Field { - label: "ResolvedFieldProject".to_string(), - ty: DeclarationId(1628), - }, - Field { - label: "Operator".to_string(), - ty: DeclarationId(1629), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 15008, 15203), - }); - declarations.push(Declaration { - id: DeclarationId(819), - name: Some("BranchPattern".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "UnresolvedVariant".to_string(), - ty: DeclarationId(1630), - }, - Field { - label: "ResolvedVariant".to_string(), - ty: DeclarationId(1631), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 15305, 15415), - }); - declarations.push(Declaration { - id: DeclarationId(820), - name: Some("PayloadBinding".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "binding_name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "payload_port".to_string(), - ty: DeclarationId(736), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 15417, 15486), - }); - declarations.push(Declaration { - id: DeclarationId(821), - name: Some("BranchPath".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "body".to_string(), - ty: DeclarationId(735), - }, - Field { - label: "result_port".to_string(), - ty: DeclarationId(736), - }, - Field { - label: "pattern".to_string(), - ty: DeclarationId(819), - }, - Field { - label: "binding".to_string(), - ty: DeclarationId(1632), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 15488, 15596), - }); - declarations.push(Declaration { - id: DeclarationId(822), - name: Some("ParamRef".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "member".to_string(), - ty: DeclarationId(735), - }, - Field { - label: "slot".to_string(), - ty: DeclarationId(87), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 16195, 16241), - }); - declarations.push(Declaration { - id: DeclarationId(823), - name: Some("TransformRef".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "node".to_string(), - ty: DeclarationId(735), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 16753, 16789), - }); - declarations.push(Declaration { - id: DeclarationId(824), - name: Some("ElementRef".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "index".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![DeclarationId(825)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 17406, 17447), - }); - declarations.push(Declaration { - id: DeclarationId(825), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("element".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 17406, 17447), - }); - declarations.push(Declaration { - id: DeclarationId(826), - name: Some("MemberDescent".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "param".to_string(), - ty: DeclarationId(822), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 17449, 17489), - }); - declarations.push(Declaration { - id: DeclarationId(827), - name: Some("IntraClusterCall".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "transform".to_string(), - ty: DeclarationId(823), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 17491, 17542), - }); - declarations.push(Declaration { - id: DeclarationId(828), - name: Some("Cluster".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "members".to_string(), - ty: DeclarationId(1633), - }, - Field { - label: "intra_cluster_calls".to_string(), - ty: DeclarationId(1634), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 17544, 17657), - }); - declarations.push(Declaration { - id: DeclarationId(829), - name: Some("LoopBound".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Cardinality".to_string(), - ty: DeclarationId(1635), - }, - Field { - label: "Descent".to_string(), - ty: DeclarationId(1636), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 18259, 18359), - }); - declarations.push(Declaration { - id: DeclarationId(830), - name: Some("loop_bound_measure".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(829)], - output: DeclarationId(736), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(300))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 18361, 18514), - }); - declarations.push(Declaration { - id: DeclarationId(831), - name: Some("ValueNode".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "id".to_string(), - ty: DeclarationId(735), - }, - Field { - label: "payload".to_string(), - ty: DeclarationId(793), - }, - Field { - label: "result_port".to_string(), - ty: DeclarationId(736), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - Field { - label: "lane2_workflow".to_string(), - ty: DeclarationId(1637), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 18516, 18645), - }); - declarations.push(Declaration { - id: DeclarationId(832), - name: Some("TransformNode".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "id".to_string(), - ty: DeclarationId(735), - }, - Field { - label: "target".to_string(), - ty: DeclarationId(818), - }, - Field { - label: "inputs".to_string(), - ty: DeclarationId(1638), - }, - Field { - label: "result_port".to_string(), - ty: DeclarationId(736), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 18647, 18772), - }); - declarations.push(Declaration { - id: DeclarationId(833), - name: Some("BranchEmitParticipation".to_string()), - connective: TypeConnective::Disj { - variants: vec![Field { - label: "UserMatch".to_string(), - ty: DeclarationId(1639), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 18937, 18979), - }); - declarations.push(Declaration { - id: DeclarationId(834), - name: Some("BranchNode".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "id".to_string(), - ty: DeclarationId(735), - }, - Field { - label: "input".to_string(), - ty: DeclarationId(736), - }, - Field { - label: "paths".to_string(), - ty: DeclarationId(1640), - }, - Field { - label: "result_port".to_string(), - ty: DeclarationId(736), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - Field { - label: "emit_participation".to_string(), - ty: DeclarationId(1641), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 18981, 19143), - }); - declarations.push(Declaration { - id: DeclarationId(835), - name: Some("LoopNode".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "id".to_string(), - ty: DeclarationId(735), - }, - Field { - label: "source".to_string(), - ty: DeclarationId(736), - }, - Field { - label: "init".to_string(), - ty: DeclarationId(736), - }, - Field { - label: "body".to_string(), - ty: DeclarationId(735), - }, - Field { - label: "bound".to_string(), - ty: DeclarationId(829), - }, - Field { - label: "result_port".to_string(), - ty: DeclarationId(736), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19145, 19282), - }); - declarations.push(Declaration { - id: DeclarationId(836), - name: Some("BindEmitParticipation".to_string()), - connective: TypeConnective::Disj { - variants: vec![Field { - label: "UserCallable".to_string(), - ty: DeclarationId(1642), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19524, 19567), - }); - declarations.push(Declaration { - id: DeclarationId(837), - name: Some("BindNode".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "id".to_string(), - ty: DeclarationId(735), - }, - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "result_port".to_string(), - ty: DeclarationId(736), - }, - Field { - label: "params".to_string(), - ty: DeclarationId(1643), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - Field { - label: "lane2_workflow".to_string(), - ty: DeclarationId(1644), - }, - Field { - label: "emit_participation".to_string(), - ty: DeclarationId(1645), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19569, 19757), - }); - declarations.push(Declaration { - id: DeclarationId(838), - name: Some("Behavior".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Value".to_string(), - ty: DeclarationId(1646), - }, - Field { - label: "Transform".to_string(), - ty: DeclarationId(1647), - }, - Field { - label: "Branch".to_string(), - ty: DeclarationId(1648), - }, - Field { - label: "Loop".to_string(), - ty: DeclarationId(1649), - }, - Field { - label: "Bind".to_string(), - ty: DeclarationId(1650), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19829, 19953), - }); - declarations.push(Declaration { - id: DeclarationId(839), - name: Some("Dag".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "declarations".to_string(), - ty: DeclarationId(1651), - }, - Field { - label: "nodes".to_string(), - ty: DeclarationId(1652), - }, - Field { - label: "ports".to_string(), - ty: DeclarationId(1653), - }, - Field { - label: "clusters".to_string(), - ty: DeclarationId(1654), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19955, 20074), - }); - declarations.push(Declaration { - id: DeclarationId(840), - name: Some("SubstrateAccessorRealization".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "carrier".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 21426, 21481), - }); - declarations.push(Declaration { - id: DeclarationId(841), - name: Some("SubstrateAccessorBinding".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "accessor".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "realization".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "language".to_string(), - ty: DeclarationId(1337), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 22248, 22365), - }); - declarations.push(Declaration { - id: DeclarationId(842), - name: Some("port".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839), DeclarationId(736)], - output: DeclarationId(1536), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/substrate.dag", - 22407, - 22422, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 22367, 22422), - }); - declarations.push(Declaration { - id: DeclarationId(843), - name: Some("node".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839), DeclarationId(735)], - output: DeclarationId(1537), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/substrate.dag", - 22465, - 22480, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 22424, 22480), - }); - declarations.push(Declaration { - id: DeclarationId(844), - name: Some("resolve_producer".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839), DeclarationId(736)], - output: DeclarationId(1538), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/substrate.dag", - 22540, - 22567, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 22482, 22567), - }); - declarations.push(Declaration { - id: DeclarationId(845), - name: Some("declaration_by_id".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839), DeclarationId(737)], - output: DeclarationId(1539), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/substrate.dag", - 22929, - 22957, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 22865, 22957), - }); - declarations.push(Declaration { - id: DeclarationId(846), - name: Some("declaration_by_name".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839), DeclarationId(227)], - output: DeclarationId(1540), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/substrate.dag", - 23804, - 23834, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 23743, 23834), - }); - declarations.push(Declaration { - id: DeclarationId(847), - name: Some("lane2_workflow_at".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839), DeclarationId(735)], - output: DeclarationId(1541), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/substrate.dag", - 24130, - 24165, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 24070, 24165), - }); - declarations.push(Declaration { - id: DeclarationId(848), - name: Some("WorkflowRoot".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "SingleRoot".to_string(), - ty: DeclarationId(1655), - }, - Field { - label: "NoRoot".to_string(), - ty: DeclarationId(1656), - }, - Field { - label: "AmbiguousRoot".to_string(), - ty: DeclarationId(1658), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 26133, 26243), - }); - declarations.push(Declaration { - id: DeclarationId(849), - name: Some("workflow_root_port".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839)], - output: DeclarationId(848), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/substrate.dag", - 27749, - 27778, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 27703, 27778), - }); - declarations.push(Declaration { - id: DeclarationId(850), - name: Some("miss_declaration_id_lookup".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(1542), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/substrate.dag", - 28135, - 28145, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 28078, 28145), - }); - declarations.push(Declaration { - id: DeclarationId(851), - name: Some("hit_declaration_id_lookup".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(737)], - output: DeclarationId(1543), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/substrate.dag", - 28220, - 28233, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 28147, 28233), - }); - declarations.push(Declaration { - id: DeclarationId(852), - name: Some("MethodRef".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "decl".to_string(), - ty: DeclarationId(1337), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/methods.dag", 1604, 1645), - }); - declarations.push(Declaration { - id: DeclarationId(853), - name: Some("AnthropicChatMessage".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "UserMessage".to_string(), - ty: DeclarationId(1660), - }, - Field { - label: "AssistantMessage".to_string(), - ty: DeclarationId(1662), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 2660, 2822), - }); - declarations.push(Declaration { - id: DeclarationId(854), - name: Some("ImageSource".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Base64Image".to_string(), - ty: DeclarationId(1663), - }, - Field { - label: "UrlImage".to_string(), - ty: DeclarationId(1664), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 2978, 3093), - }); - declarations.push(Declaration { - id: DeclarationId(855), - name: Some("CacheControl".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "type".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 3260, 3296), - }); - declarations.push(Declaration { - id: DeclarationId(856), - name: Some("AnthropicSearchResultCitationsConfig".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "enabled".to_string(), - ty: DeclarationId(124), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 3393, 3454), - }); - declarations.push(Declaration { - id: DeclarationId(857), - name: Some("AnthropicToolResultContent".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ToolResultText".to_string(), - ty: DeclarationId(1665), - }, - Field { - label: "ToolResultBlocks".to_string(), - ty: DeclarationId(1667), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 3752, 3863), - }); - declarations.push(Declaration { - id: DeclarationId(858), - name: Some("AnthropicToolResultWireTextTag".to_string()), - connective: TypeConnective::Disj { - variants: vec![Field { - label: "Text".to_string(), - ty: DeclarationId(1668), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 5032, 5079), - }); - declarations.push(Declaration { - id: DeclarationId(859), - name: Some("AnthropicPlainTextDocumentMediaType".to_string()), - connective: TypeConnective::Disj { - variants: vec![Field { - label: "TextPlain".to_string(), - ty: DeclarationId(1669), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 5160, 5217), - }); - declarations.push(Declaration { - id: DeclarationId(860), - name: Some("AnthropicToolResultTextBlock".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "type".to_string(), - ty: DeclarationId(858), - }, - Field { - label: "text".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 5308, 5399), - }); - declarations.push(Declaration { - id: DeclarationId(861), - name: Some("AnthropicToolResultBlock".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "AnthropicTextBlock".to_string(), - ty: DeclarationId(1670), - }, - Field { - label: "AnthropicImageBlock".to_string(), - ty: DeclarationId(1671), - }, - Field { - label: "AnthropicDocumentBlock".to_string(), - ty: DeclarationId(1672), - }, - Field { - label: "AnthropicSearchResultBlock".to_string(), - ty: DeclarationId(1676), - }, - Field { - label: "AnthropicToolReferenceBlock".to_string(), - ty: DeclarationId(1677), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 5401, 5874), - }); - declarations.push(Declaration { - id: DeclarationId(862), - name: Some("AnthropicToolResultPlainTextDocumentSource".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "type".to_string(), - ty: DeclarationId(858), - }, - Field { - label: "media_type".to_string(), - ty: DeclarationId(859), - }, - Field { - label: "document_data".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 5876, 6101), - }); - declarations.push(Declaration { - id: DeclarationId(863), - name: Some("AnthropicUserContentBlock".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "UserTextBlock".to_string(), - ty: DeclarationId(1678), - }, - Field { - label: "UserToolResultBlock".to_string(), - ty: DeclarationId(1681), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 6347, 6541), - }); - declarations.push(Declaration { - id: DeclarationId(864), - name: Some("AnthropicAssistantContentBlock".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "AssistantTextBlock".to_string(), - ty: DeclarationId(1682), - }, - Field { - label: "AssistantToolUseBlock".to_string(), - ty: DeclarationId(1683), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 6948, 7114), - }); - declarations.push(Declaration { - id: DeclarationId(865), - name: Some("AnthropicStopReason".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "EndTurn".to_string(), - ty: DeclarationId(1684), - }, - Field { - label: "MaxTokens".to_string(), - ty: DeclarationId(1685), - }, - Field { - label: "StopSequence".to_string(), - ty: DeclarationId(1686), - }, - Field { - label: "ToolUse".to_string(), - ty: DeclarationId(1687), - }, - Field { - label: "PauseTurn".to_string(), - ty: DeclarationId(1688), - }, - Field { - label: "Refusal".to_string(), - ty: DeclarationId(1689), - }, - Field { - label: "ModelContextWindowExceeded".to_string(), - ty: DeclarationId(1690), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 7443, 7579), - }); - declarations.push(Declaration { - id: DeclarationId(866), - name: Some("AnthropicMessages200Citation".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "CharLocation".to_string(), - ty: DeclarationId(1693), - }, - Field { - label: "PageLocation".to_string(), - ty: DeclarationId(1696), - }, - Field { - label: "ContentBlockLocation".to_string(), - ty: DeclarationId(1699), - }, - Field { - label: "WebSearchResultLocation".to_string(), - ty: DeclarationId(1701), - }, - Field { - label: "SearchResultLocation".to_string(), - ty: DeclarationId(1703), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 7781, 8527), - }); - declarations.push(Declaration { - id: DeclarationId(867), - name: Some("AnthropicMessages200ContentBlock".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "MessagesTextBlock".to_string(), - ty: DeclarationId(1706), - }, - Field { - label: "MessagesThinkingBlock".to_string(), - ty: DeclarationId(1707), - }, - Field { - label: "MessagesRedactedThinkingBlock".to_string(), - ty: DeclarationId(1708), - }, - Field { - label: "MessagesToolUseBlock".to_string(), - ty: DeclarationId(1710), - }, - Field { - label: "MessagesServerToolUseBlock".to_string(), - ty: DeclarationId(1712), - }, - Field { - label: "MessagesWebSearchToolResultBlock".to_string(), - ty: DeclarationId(1714), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9064, 9592), - }); - declarations.push(Declaration { - id: DeclarationId(868), - name: Some("AnthropicServerToolName".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "WebSearch".to_string(), - ty: DeclarationId(1715), - }, - Field { - label: "WebFetch".to_string(), - ty: DeclarationId(1716), - }, - Field { - label: "CodeExecution".to_string(), - ty: DeclarationId(1717), - }, - Field { - label: "BashCodeExecution".to_string(), - ty: DeclarationId(1718), - }, - Field { - label: "TextEditorCodeExecution".to_string(), - ty: DeclarationId(1719), - }, - Field { - label: "ToolSearchToolRegex".to_string(), - ty: DeclarationId(1720), - }, - Field { - label: "ToolSearchToolBm25".to_string(), - ty: DeclarationId(1721), - }, - Field { - label: "Advisor".to_string(), - ty: DeclarationId(1722), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9780, 9962), - }); - declarations.push(Declaration { - id: DeclarationId(869), - name: Some("AnthropicMessages200ServiceTier".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Standard".to_string(), - ty: DeclarationId(1723), - }, - Field { - label: "Priority".to_string(), - ty: DeclarationId(1724), - }, - Field { - label: "Batch".to_string(), - ty: DeclarationId(1725), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 10201, 10273), - }); - declarations.push(Declaration { - id: DeclarationId(870), - name: Some("AnthropicMessages200Usage".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "input_tokens".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "output_tokens".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "cache_creation_input_tokens".to_string(), - ty: DeclarationId(1726), - }, - Field { - label: "cache_read_input_tokens".to_string(), - ty: DeclarationId(1727), - }, - Field { - label: "service_tier".to_string(), - ty: DeclarationId(1728), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 10389, 10629), - }); - declarations.push(Declaration { - id: DeclarationId(871), - name: Some("AnthropicMessages200Role".to_string()), - connective: TypeConnective::Disj { - variants: vec![Field { - label: "Assistant".to_string(), - ty: DeclarationId(1729), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 10950, 10993), - }); - declarations.push(Declaration { - id: DeclarationId(872), - name: Some("AnthropicMessages200Body".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "id".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "type".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "role".to_string(), - ty: DeclarationId(871), - }, - Field { - label: "content".to_string(), - ty: DeclarationId(1730), - }, - Field { - label: "model".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "stop_reason".to_string(), - ty: DeclarationId(865), - }, - Field { - label: "stop_sequence".to_string(), - ty: DeclarationId(1731), - }, - Field { - label: "usage".to_string(), - ty: DeclarationId(870), - }, - Field { - label: "container".to_string(), - ty: DeclarationId(1732), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 11340, 11671), - }); - declarations.push(Declaration { - id: DeclarationId(873), - name: Some("anthropic_messages".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![ - DeclarationId(143), - DeclarationId(227), - DeclarationId(1733), - DeclarationId(87), - DeclarationId(1734), - DeclarationId(1735), - ], - output: DeclarationId(872), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/anthropic_messages.dag", - 4627, - 4656, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_messages.dag", 4419, 4656), - }); - declarations.push(Declaration { - id: DeclarationId(874), - name: Some("BinShim".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "entrypoint_name".to_string(), - ty: DeclarationId(147), - }, - Field { - label: "description".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "entry".to_string(), - ty: DeclarationId(1337), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/bin_shim.dag", 801, 894), - }); - declarations.push(Declaration { - id: DeclarationId(875), - name: Some("BootstrapAuthority".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "StdAuthority".to_string(), - ty: DeclarationId(1736), - }, - Field { - label: "V3StdAuthority".to_string(), - ty: DeclarationId(1737), - }, - Field { - label: "V3SpecAuthority".to_string(), - ty: DeclarationId(1738), - }, - Field { - label: "CompilerAuthority".to_string(), - ty: DeclarationId(1739), - }, - Field { - label: "ExtdepsFixtureAuthority".to_string(), - ty: DeclarationId(1740), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/bootstrap_authority.dag", 985, 1114), - }); - declarations.push(Declaration { - id: DeclarationId(876), - name: Some("BootstrapAuthoritySet".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(875), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/bootstrap_authority.dag", 1299, 1359), - }); - declarations.push(Declaration { - id: DeclarationId(877), - name: Some("bootstrap_authority".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(876), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(876)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Map( - FieldMap::from_entries(vec![ - ( - "dsl/std/logic.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1736), - payload: vec![], - }, - ), - ( - "dsl/std/bit.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1736), - payload: vec![], - }, - ), - ( - "dsl/std/error_primitives.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1736), - payload: vec![], - }, - ), - ( - "dsl/std/algebra.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1736), - payload: vec![], - }, - ), - ( - "dsl/std/magnitude.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1736), - payload: vec![], - }, - ), - ( - "dsl/std/machine_constraints.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1736), - payload: vec![], - }, - ), - ( - "dsl/std/nat.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1736), - payload: vec![], - }, - ), - ( - "dsl/std/integer.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1736), - payload: vec![], - }, - ), - ( - "dsl/std/rational.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1736), - payload: vec![], - }, - ), - ( - "dsl/std/float.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1736), - payload: vec![], - }, - ), - ( - "dsl/std/types.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1736), - payload: vec![], - }, - ), - ( - "dsl/std/string_type.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1736), - payload: vec![], - }, - ), - ( - "dsl/std/unicode.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1736), - payload: vec![], - }, - ), - ( - "dsl/std/render_repeat_string_bootstrap.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1736), - payload: vec![], - }, - ), - ( - "dsl/std/methods.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1736), - payload: vec![], - }, - ), - ( - "dsl/std/serialization.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1736), - payload: vec![], - }, - ), - ( - "src/v3/std/algebra.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1737), - payload: vec![], - }, - ), - ( - "src/v3/std/anthropic_messages.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1737), - payload: vec![], - }, - ), - ( - "src/v3/std/anthropic_operations.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1737), - payload: vec![], - }, - ), - ( - "src/v3/std/anthropic_schema.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1737), - payload: vec![], - }, - ), - ( - "src/v3/std/approximate_field.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1737), - payload: vec![], - }, - ), - ( - "src/v3/std/bin_shim.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1737), - payload: vec![], - }, - ), - ( - "src/v3/std/bootstrap_authority.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1737), - payload: vec![], - }, - ), - ( - "src/v3/std/bridge_ledger.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1737), - payload: vec![], - }, - ), - ( - "src/v3/std/clean_emission.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1737), - payload: vec![], - }, - ), - ( - "src/v3/std/computation.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1737), - payload: vec![], - }, - ), - ( - "src/v3/std/computation_model.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1737), - payload: vec![], - }, - ), - ( - "src/v3/std/coproduct_projection.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1737), - payload: vec![], - }, - ), - ( - "src/v3/std/cross_target_coverage.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1737), - payload: vec![], - }, - ), - ( - "src/v3/std/diagnostics.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1737), - payload: vec![], - }, - ), - ( - "src/v3/std/dimensions.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1737), - payload: vec![], - }, - ), - ( - "src/v3/std/effects.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1737), - payload: vec![], - }, - ), - ( - "src/v3/std/emission_provenance.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1737), - payload: vec![], - }, - ), - ( - "src/v3/std/emit_model.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1737), - payload: vec![], - }, - ), - ( - "src/v3/std/extdeps_bootstrap_fixtures.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1737), - payload: vec![], - }, - ), - ( - "src/v3/std/go_method_template_contracts.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1737), - payload: vec![], - }, - ), - ( - "src/v3/std/induction.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1737), - payload: vec![], - }, - ), - ( - "src/v3/std/integer_diagnostic_order.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1737), - payload: vec![], - }, - ), - ( - "src/v3/std/lens.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1737), - payload: vec![], - }, - ), - ( - "src/v3/std/lens_application.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1737), - payload: vec![], - }, - ), - ( - "src/v3/std/list.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1737), - payload: vec![], - }, - ), - ( - "src/v3/std/lookup.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1737), - payload: vec![], - }, - ), - ( - "src/v3/std/methods.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1737), - payload: vec![], - }, - ), - ( - "src/v3/std/parse_surface.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1737), - payload: vec![], - }, - ), - ( - "src/v3/std/python_method_template_contracts.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1737), - payload: vec![], - }, - ), - ( - "src/v3/std/resources.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1737), - payload: vec![], - }, - ), - ( - "src/v3/std/runtime.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1737), - payload: vec![], - }, - ), - ( - "src/v3/std/rust_method_template_contracts.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1737), - payload: vec![], - }, - ), - ( - "src/v3/std/services.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1737), - payload: vec![], - }, - ), - ( - "src/v3/std/substrate.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1737), - payload: vec![], - }, - ), - ( - "src/v3/std/substrate_minimal.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1737), - payload: vec![], - }, - ), - ( - "src/v3/std/termination.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1737), - payload: vec![], - }, - ), - ( - "src/v3/std/timing_lens.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1737), - payload: vec![], - }, - ), - ( - "src/v3/std/t_ci_workflow_as_data_demo.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1737), - payload: vec![], - }, - ), - ( - "src/v3/std/tokenize.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1737), - payload: vec![], - }, - ), - ( - "src/v3/std/verification.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1737), - payload: vec![], - }, - ), - ( - "src/v3/std/workflows.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1737), - payload: vec![], - }, - ), - ( - "src/v3/spec/v3_l1.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1738), - payload: vec![], - }, - ), - ( - "src/v3/spec/go.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1738), - payload: vec![], - }, - ), - ( - "src/v3/spec/python.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1738), - payload: vec![], - }, - ), - ( - "src/v3/spec/rust.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1738), - payload: vec![], - }, - ), - ( - "src/v3/compiler/pipeline.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1739), - payload: vec![], - }, - ), - ( - "src/v3/compiler/operators.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1739), - payload: vec![], - }, - ), - ( - "src/v3/compiler/regen.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1739), - payload: vec![], - }, - ), - ( - "dsl/extdeps/languages/rust/primitives.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1740), - payload: vec![], - }, - ), - ( - "dsl/extdeps/cron/schedule_model.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1740), - payload: vec![], - }, - ), - ( - "dsl/extdeps/github/github.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1740), - payload: vec![], - }, - ), - ( - "dsl/extdeps/github/actions.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1740), - payload: vec![], - }, - ), - ( - "dsl/extdeps/github/ci.dag".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1740), - payload: vec![], - }, - ), - ]) - .expect("ValueBody::Map"), - )), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/bootstrap_authority.dag", 1361, 4934), - }); - declarations.push(Declaration { - id: DeclarationId(878), - name: Some("BridgeStatus".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Retired".to_string(), - ty: DeclarationId(1741), - }, - Field { - label: "Open".to_string(), - ty: DeclarationId(1742), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/bridge_ledger.dag", 4987, 5025), - }); - declarations.push(Declaration { - id: DeclarationId(879), - name: Some("BridgeLedgerRef".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "decl".to_string(), - ty: DeclarationId(1337), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/bridge_ledger.dag", 5989, 6036), - }); - declarations.push(Declaration { - id: DeclarationId(880), - name: Some("BridgeLedgerRow".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "owner".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "status".to_string(), - ty: DeclarationId(878), - }, - Field { - label: "authority".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/bridge_ledger.dag", 6679, 6789), - }); - declarations.push(Declaration { id: DeclarationId(881), name: Some("bridge_ledger".to_string()), connective: TypeConnective::Instantiation { template: DeclarationId(699), arguments: vec![TemplateArgument { parameter: DeclarationId(700), value: DeclarationId(880) }] }, type_params: vec![], phantom_params: Vec::new(), meta_tag: Some(DeclarationId(1743)), specialization_parent: None, inhabits: None, value_body: Some(ValueBody::List(vec![FieldValue::Record(vec![("name".to_string(), FieldValue::Literal(LiteralBits::String("bridge_source_span_file_participation_retired".to_string()))), ("owner".to_string(), FieldValue::Literal(LiteralBits::String("R3".to_string()))), ("status".to_string(), FieldValue::Variant { constructor: DeclarationId(1742), payload: vec![] }), ("authority".to_string(), FieldValue::Literal(LiteralBits::String("ROADMAP.md#lens-fold-file-path-semantics".to_string())))]), FieldValue::Record(vec![("name".to_string(), FieldValue::Literal(LiteralBits::String("bridge_mark_bootstrap_secret_nominal_opacity_retired".to_string()))), ("owner".to_string(), FieldValue::Literal(LiteralBits::String("R2-Substrate".to_string()))), ("status".to_string(), FieldValue::Variant { constructor: DeclarationId(1741), payload: vec![] }), ("authority".to_string(), FieldValue::Literal(LiteralBits::String("PR #937".to_string())))]), FieldValue::Record(vec![("name".to_string(), FieldValue::Literal(LiteralBits::String("bridge_canonical_lens_name_dispatch_pr1183_slice_retired".to_string()))), ("owner".to_string(), FieldValue::Literal(LiteralBits::String("R2-Substrate".to_string()))), ("status".to_string(), FieldValue::Variant { constructor: DeclarationId(1741), payload: vec![] }), ("authority".to_string(), FieldValue::Literal(LiteralBits::String("src/v3/compiler/tests/integration/canonical_lens_bridge_ratchet_test.rs".to_string())))]), FieldValue::Record(vec![("name".to_string(), FieldValue::Literal(LiteralBits::String("bridge_canonical_lens_name_patching_residual".to_string()))), ("owner".to_string(), FieldValue::Literal(LiteralBits::String("PB-Runtime".to_string()))), ("status".to_string(), FieldValue::Variant { constructor: DeclarationId(1741), payload: vec![] }), ("authority".to_string(), FieldValue::Literal(LiteralBits::String("docs/briefs/r3-pb-bridge-canonical-lens-name-dispatch-closure.md".to_string())))]), FieldValue::Record(vec![("name".to_string(), FieldValue::Literal(LiteralBits::String("bridge_include_str_side_channels_retired".to_string()))), ("owner".to_string(), FieldValue::Literal(LiteralBits::String("pipeline_authority".to_string()))), ("status".to_string(), FieldValue::Variant { constructor: DeclarationId(1741), payload: vec![] }), ("authority".to_string(), FieldValue::Literal(LiteralBits::String("src/v3/compiler/tests/integration/l1_5_fixed_point_test.rs".to_string())))]), FieldValue::Record(vec![("name".to_string(), FieldValue::Literal(LiteralBits::String("bridge_exact_string_patching_residual_retired".to_string()))), ("owner".to_string(), FieldValue::Literal(LiteralBits::String("PB-Tier-2".to_string()))), ("status".to_string(), FieldValue::Variant { constructor: DeclarationId(1741), payload: vec![] }), ("authority".to_string(), FieldValue::Literal(LiteralBits::String("src/v3/compiler/tests/integration/bridge_lower_helpers_patch_zero_residual_test.rs".to_string())))]), FieldValue::Record(vec![("name".to_string(), FieldValue::Literal(LiteralBits::String("bridge_exact_string_semantic_patching_residual".to_string()))), ("owner".to_string(), FieldValue::Literal(LiteralBits::String("PB-Runtime".to_string()))), ("status".to_string(), FieldValue::Variant { constructor: DeclarationId(1742), payload: vec![] }), ("authority".to_string(), FieldValue::Literal(LiteralBits::String("docs/briefs/r3-v-bridge-row-4-exact-string-deeper-detail-receipt.md".to_string())))])])), refinement: None, nominal_opacity: None, span: SourceSpan::new("src/v3/std/bridge_ledger.dag", 7253, 8706) }); - declarations.push(Declaration { - id: DeclarationId(882), - name: Some("Mutability".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Immutable".to_string(), - ty: DeclarationId(1744), - }, - Field { - label: "Mutable".to_string(), - ty: DeclarationId(1745), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 340, 381), - }); - declarations.push(Declaration { - id: DeclarationId(883), - name: Some("Purity".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Pure".to_string(), - ty: DeclarationId(1746), - }, - Field { - label: "Effectful".to_string(), - ty: DeclarationId(1747), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 598, 632), - }); - declarations.push(Declaration { - id: DeclarationId(884), - name: Some("Structure".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ExplicitDAG".to_string(), - ty: DeclarationId(1748), - }, - Field { - label: "Arbitrary".to_string(), - ty: DeclarationId(1749), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 891, 935), - }); - declarations.push(Declaration { - id: DeclarationId(885), - name: Some("Iteration".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Bounded".to_string(), - ty: DeclarationId(1750), - }, - Field { - label: "Unbounded".to_string(), - ty: DeclarationId(1751), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 1147, 1187), - }); - declarations.push(Declaration { - id: DeclarationId(886), - name: Some("ComputationModel".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "mutability".to_string(), - ty: DeclarationId(882), - }, - Field { - label: "purity".to_string(), - ty: DeclarationId(883), - }, - Field { - label: "structure".to_string(), - ty: DeclarationId(884), - }, - Field { - label: "iteration".to_string(), - ty: DeclarationId(885), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 1387, 1500), - }); - declarations.push(Declaration { - id: DeclarationId(887), - name: Some("dag_model".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(886), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(886)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "mutability".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1744), - payload: vec![], - }, - ), - ( - "purity".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1746), - payload: vec![], - }, - ), - ( - "structure".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1748), - payload: vec![], - }, - ), - ( - "iteration".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1750), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 1502, 1625), - }); - declarations.push(Declaration { - id: DeclarationId(888), - name: Some("MemoryModel".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ValueOnly".to_string(), - ty: DeclarationId(1752), - }, - Field { - label: "GarbageCollected".to_string(), - ty: DeclarationId(1753), - }, - Field { - label: "RefCounted".to_string(), - ty: DeclarationId(1754), - }, - Field { - label: "OwnershipBased".to_string(), - ty: DeclarationId(1755), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 2014, 2099), - }); - declarations.push(Declaration { - id: DeclarationId(889), - name: Some("ScopeModel".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "LexicalScoping".to_string(), - ty: DeclarationId(1756), - }, - Field { - label: "DynamicScoping".to_string(), - ty: DeclarationId(1757), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 2365, 2418), - }); - declarations.push(Declaration { - id: DeclarationId(890), - name: Some("TargetExecutionModel".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "memory".to_string(), - ty: DeclarationId(888), - }, - Field { - label: "scope".to_string(), - ty: DeclarationId(889), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 2561, 2632), - }); - declarations.push(Declaration { - id: DeclarationId(891), - name: Some("SourceFiltering".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "excluded_prefixes".to_string(), - ty: DeclarationId(1758), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 2774, 2832), - }); - declarations.push(Declaration { - id: DeclarationId(892), - name: Some("ShapeATargetSourceFiltering".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "internal".to_string(), - ty: DeclarationId(891), - }, - Field { - label: "additional_excluded_prefixes".to_string(), - ty: DeclarationId(1759), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 3115, 3224), - }); - declarations.push(Declaration { - id: DeclarationId(893), - name: Some("internal_source_filtering".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(891), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(891)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "excluded_prefixes".to_string(), - FieldValue::List(vec![ - FieldValue::Literal(LiteralBits::String("dsl/std/".to_string())), - FieldValue::Literal(LiteralBits::String("dsl/extdeps/".to_string())), - FieldValue::Literal(LiteralBits::String("src/v3/std/".to_string())), - FieldValue::Literal(LiteralBits::String("src/v3/spec/".to_string())), - ]), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 3226, 3381), - }); - declarations.push(Declaration { - id: DeclarationId(894), - name: Some("ExecutionModelRequirement".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "OwnershipBased".to_string(), - ty: DeclarationId(1760), - }, - Field { - label: "GarbageCollected".to_string(), - ty: DeclarationId(1761), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 3659, 3729), - }); - declarations.push(Declaration { - id: DeclarationId(895), - name: Some("VariantId".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/coproduct_projection.dag", 5139, 5162), - }); - declarations.push(Declaration { - id: DeclarationId(896), - name: Some("WireTagValue".to_string()), - connective: TypeConnective::Disj { - variants: vec![Field { - label: "StringTag".to_string(), - ty: DeclarationId(1762), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/coproduct_projection.dag", 6737, 6786), - }); - declarations.push(Declaration { - id: DeclarationId(897), - name: Some("FieldProjection".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Empty".to_string(), - ty: DeclarationId(1763), - }, - Field { - label: "Populated".to_string(), - ty: DeclarationId(1764), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/coproduct_projection.dag", 7586, 7630), - }); - declarations.push(Declaration { - id: DeclarationId(898), - name: Some("CoproductVariantProjection".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "field_projection".to_string(), - ty: DeclarationId(897), - }, - Field { - label: "wire_tag_value".to_string(), - ty: DeclarationId(896), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/coproduct_projection.dag", 8046, 8150), - }); - declarations.push(Declaration { - id: DeclarationId(899), - name: Some("CoproductProjection".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "declaration".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "wire_tag_field".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "variant_projections".to_string(), - ty: DeclarationId(1765), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/coproduct_projection.dag", 9395, 9557), - }); - declarations.push(Declaration { - id: DeclarationId(900), - name: Some("BootstrapFixture".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "virtual_path".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/extdeps_bootstrap_fixtures.dag", 1395, 1443), - }); - declarations.push(Declaration { - id: DeclarationId(901), - name: Some("BootstrapFixtureSet".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "rust_grounding_primitives".to_string(), - ty: DeclarationId(900), - }, - Field { - label: "rust_method_template_contracts".to_string(), - ty: DeclarationId(900), - }, - Field { - label: "python_method_template_contracts".to_string(), - ty: DeclarationId(900), - }, - Field { - label: "go_method_template_contracts".to_string(), - ty: DeclarationId(900), - }, - Field { - label: "anthropic_operations".to_string(), - ty: DeclarationId(900), - }, - Field { - label: "cross_target_coverage".to_string(), - ty: DeclarationId(900), - }, - Field { - label: "extdeps_cron".to_string(), - ty: DeclarationId(900), - }, - Field { - label: "extdeps_github_github".to_string(), - ty: DeclarationId(900), - }, - Field { - label: "extdeps_github_actions".to_string(), - ty: DeclarationId(900), - }, - Field { - label: "extdeps_github_ci".to_string(), - ty: DeclarationId(900), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/extdeps_bootstrap_fixtures.dag", 1600, 2066), - }); - declarations.push(Declaration { - id: DeclarationId(902), - name: Some("bootstrap_fixture_authority".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(901), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(901)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "rust_grounding_primitives".to_string(), - FieldValue::Record(vec![( - "virtual_path".to_string(), - FieldValue::Literal(LiteralBits::String( - "dsl/extdeps/languages/rust/primitives.dag".to_string(), - )), - )]), - ), - ( - "rust_method_template_contracts".to_string(), - FieldValue::Record(vec![( - "virtual_path".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/std/rust_method_template_contracts.dag".to_string(), - )), - )]), - ), - ( - "python_method_template_contracts".to_string(), - FieldValue::Record(vec![( - "virtual_path".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/std/python_method_template_contracts.dag".to_string(), - )), - )]), - ), - ( - "go_method_template_contracts".to_string(), - FieldValue::Record(vec![( - "virtual_path".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/std/go_method_template_contracts.dag".to_string(), - )), - )]), - ), - ( - "anthropic_operations".to_string(), - FieldValue::Record(vec![( - "virtual_path".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/std/anthropic_operations.dag".to_string(), - )), - )]), - ), - ( - "cross_target_coverage".to_string(), - FieldValue::Record(vec![( - "virtual_path".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/std/cross_target_coverage.dag".to_string(), - )), - )]), - ), - ( - "extdeps_cron".to_string(), - FieldValue::Record(vec![( - "virtual_path".to_string(), - FieldValue::Literal(LiteralBits::String( - "dsl/extdeps/cron/schedule_model.dag".to_string(), - )), - )]), - ), - ( - "extdeps_github_github".to_string(), - FieldValue::Record(vec![( - "virtual_path".to_string(), - FieldValue::Literal(LiteralBits::String( - "dsl/extdeps/github/github.dag".to_string(), - )), - )]), - ), - ( - "extdeps_github_actions".to_string(), - FieldValue::Record(vec![( - "virtual_path".to_string(), - FieldValue::Literal(LiteralBits::String( - "dsl/extdeps/github/actions.dag".to_string(), - )), - )]), - ), - ( - "extdeps_github_ci".to_string(), - FieldValue::Record(vec![( - "virtual_path".to_string(), - FieldValue::Literal(LiteralBits::String( - "dsl/extdeps/github/ci.dag".to_string(), - )), - )]), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/extdeps_bootstrap_fixtures.dag", 2068, 3040), - }); - declarations.push(Declaration { - id: DeclarationId(903), - name: Some("signed_int_diagnostic_order".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1337), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1766)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::List(vec![ - FieldValue::Reference(DeclarationId(77)), - FieldValue::Reference(DeclarationId(78)), - FieldValue::Reference(DeclarationId(79)), - FieldValue::Reference(DeclarationId(80)), - FieldValue::Reference(DeclarationId(81)), - ])), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/integer_diagnostic_order.dag", 1200, 1304), - }); - declarations.push(Declaration { - id: DeclarationId(904), - name: Some("unsigned_int_diagnostic_order".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1337), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1767)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::List(vec![ - FieldValue::Reference(DeclarationId(82)), - FieldValue::Reference(DeclarationId(83)), - FieldValue::Reference(DeclarationId(84)), - FieldValue::Reference(DeclarationId(85)), - FieldValue::Reference(DeclarationId(86)), - ])), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/integer_diagnostic_order.dag", 1378, 1489), - }); - declarations.push(Declaration { - id: DeclarationId(905), - name: Some("map_get".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1768), DeclarationId(906)], - output: DeclarationId(1769), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/lookup.dag", 1451, 1469)), - }, - type_params: vec![DeclarationId(906), DeclarationId(907)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lookup.dag", 1388, 1469), - }); - declarations.push(Declaration { - id: DeclarationId(906), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("key".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lookup.dag", 1388, 1469), - }); - declarations.push(Declaration { - id: DeclarationId(907), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("value".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lookup.dag", 1388, 1469), - }); - declarations.push(Declaration { - id: DeclarationId(908), - name: Some("Lookup".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Miss".to_string(), - ty: DeclarationId(1772), - }, - Field { - label: "Hit".to_string(), - ty: DeclarationId(1773), - }, - ], - }, - type_params: vec![DeclarationId(909)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lookup.dag", 4917, 4959), - }); - declarations.push(Declaration { - id: DeclarationId(909), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("value".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lookup.dag", 4917, 4959), - }); - declarations.push(Declaration { - id: DeclarationId(910), - name: Some("miss_int_lookup".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(1770), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/lookup.dag", 4997, 5007)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lookup.dag", 4961, 5007), - }); - declarations.push(Declaration { - id: DeclarationId(911), - name: Some("hit_int_lookup".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87)], - output: DeclarationId(1771), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/lookup.dag", 5050, 5062)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lookup.dag", 5009, 5062), - }); - declarations.push(Declaration { - id: DeclarationId(912), - name: Some("CollectionSizeEffect".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ShrinkEffect".to_string(), - ty: DeclarationId(1798), - }, - Field { - label: "ProjectionEffect".to_string(), - ty: DeclarationId(1799), - }, - Field { - label: "IdentityEffect".to_string(), - ty: DeclarationId(1800), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 4923, 5005), - }); - declarations.push(Declaration { - id: DeclarationId(913), - name: Some("CostShape".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ShapeConstant".to_string(), - ty: DeclarationId(1801), - }, - Field { - label: "ShapeLinearScan".to_string(), - ty: DeclarationId(1802), - }, - Field { - label: "ShapeIterateBody".to_string(), - ty: DeclarationId(1803), - }, - Field { - label: "ShapeSortBody".to_string(), - ty: DeclarationId(1804), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 5836, 5927), - }); - declarations.push(Declaration { - id: DeclarationId(914), - name: Some("MethodContract".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "algebra_id".to_string(), - ty: DeclarationId(737), - }, - Field { - label: "method_id".to_string(), - ty: DeclarationId(737), - }, - Field { - label: "size_effect".to_string(), - ty: DeclarationId(1805), - }, - Field { - label: "cost_shape".to_string(), - ty: DeclarationId(1806), - }, - Field { - label: "callback_element_position".to_string(), - ty: DeclarationId(1807), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 6688, 6862), - }); - declarations.push(Declaration { - id: DeclarationId(915), - name: Some("SizeVariable".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "source_port".to_string(), - ty: DeclarationId(736), - }, - Field { - label: "display_name".to_string(), - ty: DeclarationId(1808), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 7371, 7438), - }); - declarations.push(Declaration { - id: DeclarationId(916), - name: Some("unnamed_size_variable".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(736)], - output: DeclarationId(915), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/algebra.dag", 7502, 7534)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 7440, 7534), - }); - declarations.push(Declaration { - id: DeclarationId(917), - name: Some("size_variable_eq".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(915), DeclarationId(915)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(304))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 7536, 7632), - }); - declarations.push(Declaration { - id: DeclarationId(918), - name: Some("DegreeAtLeastTwo".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "DegreeTwo".to_string(), - ty: DeclarationId(1809), - }, - Field { - label: "DegreeSuccessor".to_string(), - ty: DeclarationId(1810), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 8379, 8465), - }); - declarations.push(Declaration { - id: DeclarationId(919), - name: Some("SymbolicCost".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ConstantCost".to_string(), - ty: DeclarationId(1811), - }, - Field { - label: "LinearCost".to_string(), - ty: DeclarationId(1812), - }, - Field { - label: "PolynomialCost".to_string(), - ty: DeclarationId(1813), - }, - Field { - label: "ProductCost".to_string(), - ty: DeclarationId(1815), - }, - Field { - label: "SumCost".to_string(), - ty: DeclarationId(1817), - }, - Field { - label: "LogCost".to_string(), - ty: DeclarationId(1818), - }, - Field { - label: "UnknownCost".to_string(), - ty: DeclarationId(1819), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: Some(DeclarationId(1820)), - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 9452, 9761), - }); - declarations.push(Declaration { - id: DeclarationId(920), - name: Some("DominateScanAcc".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "any".to_string(), - ty: DeclarationId(124), - }, - Field { - label: "pivot".to_string(), - ty: DeclarationId(919), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 10167, 10225), - }); - declarations.push(Declaration { - id: DeclarationId(921), - name: Some("dominate_scan_init".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(919)], - output: DeclarationId(920), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(307))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 10227, 10322), - }); - declarations.push(Declaration { - id: DeclarationId(922), - name: Some("miss_symbolic_cost_lookup".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(1774), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/algebra.dag", 10963, 10973)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 10908, 10973), - }); - declarations.push(Declaration { - id: DeclarationId(923), - name: Some("hit_symbolic_cost_lookup".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(919)], - output: DeclarationId(1775), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/algebra.dag", 11047, 11062)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 10975, 11062), - }); - declarations.push(Declaration { - id: DeclarationId(924), - name: Some("two_terms".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(919), DeclarationId(919)], - output: DeclarationId(1776), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(311))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 11064, 11539), - }); - declarations.push(Declaration { - id: DeclarationId(925), - name: Some("many_terms".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(919), DeclarationId(919), DeclarationId(1777)], - output: DeclarationId(1778), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(313))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 11541, 11726), - }); - declarations.push(Declaration { - id: DeclarationId(926), - name: Some("reject_all_symbolic_costs".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(919)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(318))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 11728, 11856), - }); - declarations.push(Declaration { - id: DeclarationId(927), - name: Some("degree_raw".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(918)], - output: DeclarationId(87), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(326))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 11858, 12011), - }); - declarations.push(Declaration { - id: DeclarationId(928), - name: Some("sequential".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(919), DeclarationId(919)], - output: DeclarationId(919), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(330))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 12247, 12350), - }); - declarations.push(Declaration { - id: DeclarationId(929), - name: Some("iterate".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(919), DeclarationId(919)], - output: DeclarationId(919), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(334))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 12536, 12654), - }); - declarations.push(Declaration { - id: DeclarationId(930), - name: Some("max_path_step".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(919), DeclarationId(919)], - output: DeclarationId(919), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(338))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 13514, 13681), - }); - declarations.push(Declaration { - id: DeclarationId(931), - name: Some("keep_or_sum".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(919), DeclarationId(919)], - output: DeclarationId(919), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(342))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 13683, 13841), - }); - declarations.push(Declaration { - id: DeclarationId(932), - name: Some("max_path".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1779)], - output: DeclarationId(919), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(346))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 14143, 14245), - }); - declarations.push(Declaration { - id: DeclarationId(933), - name: Some("dominates".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(919), DeclarationId(919)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(399))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 15113, 17198), - }); - declarations.push(Declaration { - id: DeclarationId(934), - name: Some("same_size_variable".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(915), DeclarationId(915)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(401))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 17200, 17290), - }); - declarations.push(Declaration { - id: DeclarationId(935), - name: Some("AsymptoticClass".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ClassConstant".to_string(), - ty: DeclarationId(1821), - }, - Field { - label: "ClassLog".to_string(), - ty: DeclarationId(1822), - }, - Field { - label: "ClassLinear".to_string(), - ty: DeclarationId(1823), - }, - Field { - label: "ClassLinearithmic".to_string(), - ty: DeclarationId(1824), - }, - Field { - label: "ClassQuadratic".to_string(), - ty: DeclarationId(1825), - }, - Field { - label: "ClassPolynomial".to_string(), - ty: DeclarationId(1826), - }, - Field { - label: "ClassExponential".to_string(), - ty: DeclarationId(1827), - }, - Field { - label: "ClassUnknown".to_string(), - ty: DeclarationId(1828), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: Some(DeclarationId(1829)), - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 18077, 18318), - }); - declarations.push(Declaration { - id: DeclarationId(936), - name: Some("asymptotic_dominates".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(935), DeclarationId(935)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(471))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 18320, 20588), - }); - declarations.push(Declaration { - id: DeclarationId(937), - name: Some("meet_asymptotic_class".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(935), DeclarationId(935)], - output: DeclarationId(935), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(474))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 20590, 20721), - }); - declarations.push(Declaration { - id: DeclarationId(938), - name: Some("join_asymptotic_class".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(935), DeclarationId(935)], - output: DeclarationId(935), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(477))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 20723, 20854), - }); - declarations.push(Declaration { - id: DeclarationId(939), - name: Some("classify_symbolic_cost".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(919)], - output: DeclarationId(935), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/algebra.dag", 20921, 20954)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 20856, 20954), - }); - declarations.push(Declaration { - id: DeclarationId(940), - name: Some("normalize".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(919)], - output: DeclarationId(919), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(486))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 21828, 22193), - }); - declarations.push(Declaration { - id: DeclarationId(941), - name: Some("nsl_to_list".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1780)], - output: DeclarationId(1781), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(492))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 22195, 22324), - }); - declarations.push(Declaration { - id: DeclarationId(942), - name: Some("drop_additive_zero".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1782)], - output: DeclarationId(1783), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(505))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 22501, 22793), - }); - declarations.push(Declaration { - id: DeclarationId(943), - name: Some("collapse_on_multiplicative_zero".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1784)], - output: DeclarationId(1785), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(512))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 23002, 23165), - }); - declarations.push(Declaration { - id: DeclarationId(944), - name: Some("any_zero".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1786)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(521))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 23167, 23332), - }); - declarations.push(Declaration { - id: DeclarationId(945), - name: Some("drop_multiplicative_one".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1787)], - output: DeclarationId(1788), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(534))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 23490, 23796), - }); - declarations.push(Declaration { - id: DeclarationId(946), - name: Some("is_zero_constant".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(919)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(544))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 23798, 24052), - }); - declarations.push(Declaration { - id: DeclarationId(947), - name: Some("is_one_constant".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(919)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(554))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 24054, 24307), - }); - declarations.push(Declaration { - id: DeclarationId(948), - name: Some("reduce_sum".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1789)], - output: DeclarationId(919), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(566))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 25092, 25363), - }); - declarations.push(Declaration { - id: DeclarationId(949), - name: Some("wrap_sum".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1790)], - output: DeclarationId(919), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(578))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 25365, 25640), - }); - declarations.push(Declaration { - id: DeclarationId(950), - name: Some("reduce_product".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1791)], - output: DeclarationId(919), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(595))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 25825, 26246), - }); - declarations.push(Declaration { - id: DeclarationId(951), - name: Some("combine_binary_product".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(919), DeclarationId(919)], - output: DeclarationId(919), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(604))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 26411, 26798), - }); - declarations.push(Declaration { - id: DeclarationId(952), - name: Some("combine_linear_with".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(915), DeclarationId(919), DeclarationId(919)], - output: DeclarationId(919), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(613))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 26800, 27209), - }); - declarations.push(Declaration { - id: DeclarationId(953), - name: Some("collapse_linear_square".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![ - DeclarationId(915), - DeclarationId(915), - DeclarationId(919), - DeclarationId(919), - ], - output: DeclarationId(919), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(618))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 27211, 27427), - }); - declarations.push(Declaration { - id: DeclarationId(954), - name: Some("polynomial_square".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(915)], - output: DeclarationId(919), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/algebra.dag", 27483, 27533)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 27429, 27533), - }); - declarations.push(Declaration { - id: DeclarationId(955), - name: Some("product_pair".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(919), DeclarationId(919)], - output: DeclarationId(919), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(621))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 27535, 27633), - }); - declarations.push(Declaration { - id: DeclarationId(956), - name: Some("fold_or_dominate_scan".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(920), DeclarationId(919)], - output: DeclarationId(920), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(628))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 27635, 27784), - }); - declarations.push(Declaration { - id: DeclarationId(957), - name: Some("scan_hit".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(920)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(630))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 27786, 27841), - }); - declarations.push(Declaration { - id: DeclarationId(958), - name: Some("filter_not_dominated_by".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1792), DeclarationId(919)], - output: DeclarationId(1793), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(643))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 27843, 28205), - }); - declarations.push(Declaration { - id: DeclarationId(959), - name: Some("drop_dominated_step".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1794), DeclarationId(919)], - output: DeclarationId(1795), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(650))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 28207, 28449), - }); - declarations.push(Declaration { - id: DeclarationId(960), - name: Some("drop_dominated".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1796)], - output: DeclarationId(1797), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(653))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 28637, 28749), - }); - declarations.push(Declaration { - id: DeclarationId(961), - name: Some("ResourceHandle".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "type".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "resource_id".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "key".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "cap".to_string(), - ty: DeclarationId(143), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/resources.dag", 739, 827), - }); - declarations.push(Declaration { - id: DeclarationId(962), - name: Some("ResourceReference".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "target".to_string(), - ty: DeclarationId(1337), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/resources.dag", 829, 880), - }); - declarations.push(Declaration { - id: DeclarationId(963), - name: Some("InputField".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/services.dag", 3237, 3255), - }); - declarations.push(Declaration { - id: DeclarationId(964), - name: Some("RestEndpointBinding".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "method".to_string(), - ty: DeclarationId(195), - }, - Field { - label: "path".to_string(), - ty: DeclarationId(744), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/services.dag", 3888, 3960), - }); - declarations.push(Declaration { - id: DeclarationId(965), - name: Some("CallableRef".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "decl".to_string(), - ty: DeclarationId(1337), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/services.dag", 4768, 4811), - }); - declarations.push(Declaration { - id: DeclarationId(966), - name: Some("Operation".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "callable".to_string(), - ty: DeclarationId(965), - }, - Field { - label: "inputs".to_string(), - ty: DeclarationId(1857), - }, - Field { - label: "endpoint".to_string(), - ty: DeclarationId(964), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/services.dag", 5685, 5795), - }); - declarations.push(Declaration { - id: DeclarationId(967), - name: Some("anthropic_operations".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(966), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1858)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::List(vec![])), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_operations.dag", 6519, 6566), - }); - declarations.push(Declaration { - id: DeclarationId(968), - name: Some("SizeBound".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "CollectionSize".to_string(), - ty: DeclarationId(1865), - }, - Field { - label: "ParserStreamSize".to_string(), - ty: DeclarationId(1866), - }, - Field { - label: "WorklistDrainSize".to_string(), - ty: DeclarationId(1867), - }, - Field { - label: "TreeSize".to_string(), - ty: DeclarationId(1868), - }, - Field { - label: "ArithmeticParam".to_string(), - ty: DeclarationId(1869), - }, - Field { - label: "ExplicitCountZero".to_string(), - ty: DeclarationId(1870), - }, - Field { - label: "ExplicitCountPositive".to_string(), - ty: DeclarationId(1871), - }, - Field { - label: "Forever".to_string(), - ty: DeclarationId(1872), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 1411, 1707), - }); - declarations.push(Declaration { - id: DeclarationId(969), - name: Some("tree_size_bound".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227)], - output: DeclarationId(968), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/computation.dag", - 1756, - 1787, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 1709, 1787), - }); - declarations.push(Declaration { - id: DeclarationId(970), - name: Some("CallPattern".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ChildAccessorCall".to_string(), - ty: DeclarationId(1873), - }, - Field { - label: "CollectionShrinkCall".to_string(), - ty: DeclarationId(1874), - }, - Field { - label: "ArithmeticSubtractCall".to_string(), - ty: DeclarationId(1875), - }, - Field { - label: "ArithmeticDivideCall".to_string(), - ty: DeclarationId(1876), - }, - Field { - label: "ParserAdvanceCall".to_string(), - ty: DeclarationId(1877), - }, - Field { - label: "WorklistDrainCall".to_string(), - ty: DeclarationId(1878), - }, - Field { - label: "FoldBodyCall".to_string(), - ty: DeclarationId(1879), - }, - Field { - label: "SameArgumentCall".to_string(), - ty: DeclarationId(1880), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 2038, 2485), - }); - declarations.push(Declaration { - id: DeclarationId(971), - name: Some("per_call_pattern_at".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839), DeclarationId(735)], - output: DeclarationId(1859), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/computation.dag", - 2764, - 2794, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 2698, 2794), - }); - declarations.push(Declaration { - id: DeclarationId(972), - name: Some("per_call_descent_operand_port".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839), DeclarationId(735)], - output: DeclarationId(1860), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/computation.dag", - 2969, - 3009, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 2898, 3009), - }); - declarations.push(Declaration { - id: DeclarationId(973), - name: Some("ShrinkFactor".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "UnitShrink".to_string(), - ty: DeclarationId(1881), - }, - Field { - label: "ConstantShrink".to_string(), - ty: DeclarationId(1882), - }, - Field { - label: "ProportionalShrink".to_string(), - ty: DeclarationId(1883), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 3199, 3339), - }); - declarations.push(Declaration { - id: DeclarationId(974), - name: Some("IterationPrimitive".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Fold".to_string(), - ty: DeclarationId(1884), - }, - Field { - label: "Descend".to_string(), - ty: DeclarationId(1885), - }, - Field { - label: "Repeat".to_string(), - ty: DeclarationId(1886), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 3501, 3556), - }); - declarations.push(Declaration { - id: DeclarationId(975), - name: Some("LoweringTarget".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "primitive".to_string(), - ty: DeclarationId(974), - }, - Field { - label: "bound".to_string(), - ty: DeclarationId(968), - }, - Field { - label: "evidence".to_string(), - ty: DeclarationId(1141), - }, - Field { - label: "factor".to_string(), - ty: DeclarationId(1887), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 3748, 3874), - }); - declarations.push(Declaration { - id: DeclarationId(976), - name: Some("lower_call_pattern".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(970)], - output: DeclarationId(975), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/computation.dag", - 4185, - 5736, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 4123, 5736), - }); - declarations.push(Declaration { - id: DeclarationId(977), - name: Some("size_bound_param".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(968)], - output: DeclarationId(1861), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/computation.dag", - 5787, - 6212, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 5738, 6212), - }); - declarations.push(Declaration { - id: DeclarationId(978), - name: Some("is_constant_bound".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(968)], - output: DeclarationId(124), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/computation.dag", - 6261, - 6432, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 6214, 6432), - }); - declarations.push(Declaration { - id: DeclarationId(979), - name: Some("forever_iteration_bound".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(87), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/computation.dag", - 6549, - 6572, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 6513, 6572), - }); - declarations.push(Declaration { - id: DeclarationId(980), - name: Some("constant_bound_value".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(968)], - output: DeclarationId(1862), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/computation.dag", - 6715, - 6980, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 6665, 6980), - }); - declarations.push(Declaration { - id: DeclarationId(981), - name: Some("IterationDimension".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "TreeDescent".to_string(), - ty: DeclarationId(1888), - }, - Field { - label: "CollectionFold".to_string(), - ty: DeclarationId(1889), - }, - Field { - label: "ArithmeticRepeat".to_string(), - ty: DeclarationId(1890), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 7465, 7648), - }); - declarations.push(Declaration { - id: DeclarationId(982), - name: Some("algebra_profile_to_dimension".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(53)], - output: DeclarationId(1863), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/computation.dag", - 7781, - 8274, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 7701, 8274), - }); - declarations.push(Declaration { - id: DeclarationId(983), - name: Some("type_iteration_dimension".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227)], - output: DeclarationId(1864), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/computation.dag", - 8346, - 8565, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 8276, 8565), - }); - declarations.push(Declaration { - id: DeclarationId(984), - name: Some("EmissionRule".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emission_provenance.dag", 2797, 2823), - }); - declarations.push(Declaration { - id: DeclarationId(985), - name: Some("OptionalSourceSpan".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "NoSourceSpan".to_string(), - ty: DeclarationId(1891), - }, - Field { - label: "SomeSourceSpan".to_string(), - ty: DeclarationId(1892), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emission_provenance.dag", 3681, 3762), - }); - declarations.push(Declaration { - id: DeclarationId(986), - name: Some("EmissionProvenance".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "emitted_line".to_string(), - ty: DeclarationId(92), - }, - Field { - label: "rule".to_string(), - ty: DeclarationId(984), - }, - Field { - label: "source_span".to_string(), - ty: DeclarationId(985), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emission_provenance.dag", 4898, 5008), - }); - declarations.push(Declaration { - id: DeclarationId(987), - name: Some("TypeRealization".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "language".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "target".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "carrier".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "is_copy".to_string(), - ty: DeclarationId(124), - }, - Field { - label: "fields".to_string(), - ty: DeclarationId(1893), - }, - Field { - label: "cost".to_string(), - ty: DeclarationId(87), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 736, 887), - }); - declarations.push(Declaration { - id: DeclarationId(988), - name: Some("TargetIntegerTypeInhabitance".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "language".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "kernel_integer".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "algebra".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "bound".to_string(), - ty: DeclarationId(989), - }, - Field { - label: "type_realization".to_string(), - ty: DeclarationId(1337), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 2385, 2840), - }); - declarations.push(Declaration { - id: DeclarationId(989), - name: Some("TargetIntegerInhabitanceBound".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "BoundUnspecified".to_string(), - ty: DeclarationId(1894), - }, - Field { - label: "StaticBoundFact".to_string(), - ty: DeclarationId(1895), - }, - Field { - label: "PlatformDependentFact".to_string(), - ty: DeclarationId(1896), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 4334, 4686), - }); - declarations.push(Declaration { - id: DeclarationId(990), - name: Some("FieldBinding".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "dag_name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "access".to_string(), - ty: DeclarationId(991), - }, - Field { - label: "borrowed_read".to_string(), - ty: DeclarationId(124), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 4688, 4772), - }); - declarations.push(Declaration { - id: DeclarationId(991), - name: Some("FieldAccess".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "DirectField".to_string(), - ty: DeclarationId(1897), - }, - Field { - label: "AccessorMethod".to_string(), - ty: DeclarationId(1898), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 5155, 5222), - }); - declarations.push(Declaration { - id: DeclarationId(992), - name: Some("OperatorRealization".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "language".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "target".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "op".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "carrier".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "cost".to_string(), - ty: DeclarationId(87), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 5224, 5355), - }); - declarations.push(Declaration { - id: DeclarationId(993), - name: Some("BehaviorRealization".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "language".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "target".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "carrier".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "cost".to_string(), - ty: DeclarationId(87), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 5357, 5467), - }); - declarations.push(Declaration { - id: DeclarationId(994), - name: Some("CallableRealization".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "language".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "target".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "strategy".to_string(), - ty: DeclarationId(1003), - }, - Field { - label: "parameters".to_string(), - ty: DeclarationId(1899), - }, - Field { - label: "cost".to_string(), - ty: DeclarationId(87), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 5469, 5628), - }); - declarations.push(Declaration { - id: DeclarationId(995), - name: Some("CallableParameter".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "slot".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "disposition".to_string(), - ty: DeclarationId(996), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 6050, 6124), - }); - declarations.push(Declaration { - id: DeclarationId(996), - name: Some("ParameterDisposition".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Borrowed".to_string(), - ty: DeclarationId(1900), - }, - Field { - label: "Consumed".to_string(), - ty: DeclarationId(1901), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 6581, 6632), - }); - declarations.push(Declaration { - id: DeclarationId(997), - name: Some("StringOwnershipAxis".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Owned".to_string(), - ty: DeclarationId(1902), - }, - Field { - label: "Borrowed".to_string(), - ty: DeclarationId(1903), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 7044, 7091), - }); - declarations.push(Declaration { - id: DeclarationId(998), - name: Some("StringLifetimeAxis".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "SelfContained".to_string(), - ty: DeclarationId(1904), - }, - Field { - label: "Caller".to_string(), - ty: DeclarationId(1905), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 7399, 7451), - }); - declarations.push(Declaration { - id: DeclarationId(999), - name: Some("StringGrowabilityAxis".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Growable".to_string(), - ty: DeclarationId(1906), - }, - Field { - label: "Fixed".to_string(), - ty: DeclarationId(1907), - }, - Field { - label: "NotApplicable".to_string(), - ty: DeclarationId(1908), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 7678, 7745), - }); - declarations.push(Declaration { - id: DeclarationId(1000), - name: Some("StringEncodingAxis".to_string()), - connective: TypeConnective::Disj { - variants: vec![Field { - label: "Utf8FreeMonoidChar".to_string(), - ty: DeclarationId(1909), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 8054, 8100), - }); - declarations.push(Declaration { - id: DeclarationId(1001), - name: Some("StringFamilyInhabitanceRow".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "language".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "target_type".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "type_realization".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "ownership".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "lifetime".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "growability".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "encoding".to_string(), - ty: DeclarationId(1337), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 8684, 8923), - }); - declarations.push(Declaration { - id: DeclarationId(1002), - name: Some("TypeInstantiationRealization".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "language".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "target".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "carrier".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "cost".to_string(), - ty: DeclarationId(87), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 8925, 9044), - }); - declarations.push(Declaration { - id: DeclarationId(1003), - name: Some("CallableStrategy".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ListEmpty".to_string(), - ty: DeclarationId(1910), - }, - Field { - label: "ListSingleton".to_string(), - ty: DeclarationId(1911), - }, - Field { - label: "ListCons".to_string(), - ty: DeclarationId(1912), - }, - Field { - label: "ListConcat".to_string(), - ty: DeclarationId(1913), - }, - Field { - label: "ListLength".to_string(), - ty: DeclarationId(1914), - }, - Field { - label: "ListIsEmpty".to_string(), - ty: DeclarationId(1915), - }, - Field { - label: "ListFold".to_string(), - ty: DeclarationId(1916), - }, - Field { - label: "ListMap".to_string(), - ty: DeclarationId(1917), - }, - Field { - label: "ListFilter".to_string(), - ty: DeclarationId(1918), - }, - Field { - label: "ListContains".to_string(), - ty: DeclarationId(1919), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 9449, 9618), - }); - declarations.push(Declaration { - id: DeclarationId(1004), - name: Some("PatternRealization".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "language".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "target".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "strategy".to_string(), - ty: DeclarationId(1005), - }, - Field { - label: "empty_variant".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "cons_variant".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "scrutinee".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "empty_pattern".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "cons_pattern".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "head_expr".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "tail_expr".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "cost".to_string(), - ty: DeclarationId(87), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 11557, 11846), - }); - declarations.push(Declaration { - id: DeclarationId(1005), - name: Some("PatternStrategy".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "PlaceholderPatternStrategy".to_string(), - ty: DeclarationId(1920), - }, - Field { - label: "VectorList".to_string(), - ty: DeclarationId(1921), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 12286, 12352), - }); - declarations.push(Declaration { - id: DeclarationId(1006), - name: Some("StatementSyntax".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "let_binding".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "let_binding_inferred".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 12354, 12431), - }); - declarations.push(Declaration { - id: DeclarationId(1007), - name: Some("ExpressionSyntax".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "field_access".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "function_call".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "closure".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 12433, 12523), - }); - declarations.push(Declaration { - id: DeclarationId(1008), - name: Some("ForEachSyntax".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "prefix".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "separator".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 12525, 12584), - }); - declarations.push(Declaration { - id: DeclarationId(1009), - name: Some("ControlFlowSyntax".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "if_else".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "match_arm".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "for_each_syntax".to_string(), - ty: DeclarationId(1008), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 12586, 12683), - }); - declarations.push(Declaration { - id: DeclarationId(1010), - name: Some("LiteralSyntax".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "true_keyword".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "false_keyword".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "string_delimiter".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 12685, 12781), - }); - declarations.push(Declaration { - id: DeclarationId(1011), - name: Some("ModuleSyntax".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "path_separator".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 12783, 12829), - }); - declarations.push(Declaration { - id: DeclarationId(1012), - name: Some("FunctionSyntax".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "definition".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "definition_exported".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "definition_void".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "param_with_type".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "param_separator".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 12831, 12983), - }); - declarations.push(Declaration { - id: DeclarationId(1013), - name: Some("TypeApplicationSyntax".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "optional".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 12985, 13034), - }); - declarations.push(Declaration { - id: DeclarationId(1014), - name: Some("TypeDefinitionSyntax".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "struct_def".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "struct_field".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "enum_def".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "enum_unit_variant".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "enum_data_variant".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 13248, 13396), - }); - declarations.push(Declaration { - id: DeclarationId(1015), - name: Some("RecordDeriveTemplateBundle".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "struct_def_no_debug".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "enum_def_no_debug".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 14057, 14150), - }); - declarations.push(Declaration { - id: DeclarationId(1016), - name: Some("PatternMatchSyntax".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "match_expr".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "match_arm".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "variant_pattern".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "variant_pattern_positional".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "variant_pattern_empty".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "field_binding".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "field_binding_separator".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "wildcard".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 14854, 15094), - }); - declarations.push(Declaration { - id: DeclarationId(1017), - name: Some("CollectionOps".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "concat_contract".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "length_contract".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "is_empty_contract".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "fold_contract".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "filter_contract".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "flat_map_contract".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "any_contract".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "all_contract".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "map_contract".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "filter".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "contains".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "empty_list".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "list_literal".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "cons".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 15096, 16332), - }); - declarations.push(Declaration { - id: DeclarationId(1018), - name: Some("ValueConstructionSyntax".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "struct_literal".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "struct_field_init".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "struct_field_separator".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "variant_construction".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "variant_named_construction".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 16334, 16520), - }); - declarations.push(Declaration { - id: DeclarationId(1019), - name: Some("RenderingModel".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "read".to_string(), - ty: DeclarationId(1020), - }, - Field { - label: "construct".to_string(), - ty: DeclarationId(1021), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 16522, 16597), - }); - declarations.push(Declaration { - id: DeclarationId(1020), - name: Some("ReadStrategy".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Borrow".to_string(), - ty: DeclarationId(1922), - }, - Field { - label: "PassByValue".to_string(), - ty: DeclarationId(1923), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 17095, 17139), - }); - declarations.push(Declaration { - id: DeclarationId(1021), - name: Some("ConstructStrategy".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "CopyOrClone".to_string(), - ty: DeclarationId(1924), - }, - Field { - label: "PassByValue".to_string(), - ty: DeclarationId(1925), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 17432, 17486), - }); - declarations.push(Declaration { - id: DeclarationId(1022), - name: Some("LanguageSpec".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "statements".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "expressions".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "control_flow".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "literals".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "modules".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "functions".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "type_applications".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "type_definitions".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "record_derive_templates".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "patterns".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "collection_ops".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "values".to_string(), - ty: DeclarationId(1337), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 17488, 18014), - }); - declarations.push(Declaration { - id: DeclarationId(1023), - name: Some("PlaceholderConvention".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "IndexedArgs".to_string(), - ty: DeclarationId(1926), - }, - Field { - label: "NamedArg".to_string(), - ty: DeclarationId(1927), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 19388, 19443), - }); - declarations.push(Declaration { - id: DeclarationId(1024), - name: Some("MethodEmitTemplate".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "SingleTemplate".to_string(), - ty: DeclarationId(1928), - }, - Field { - label: "HigherOrderTemplates".to_string(), - ty: DeclarationId(1929), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 20578, 20734), - }); - declarations.push(Declaration { - id: DeclarationId(1025), - name: Some("MethodTemplateContract".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "dag_method".to_string(), - ty: DeclarationId(852), - }, - Field { - label: "runtime_template".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "emit_template".to_string(), - ty: DeclarationId(1024), - }, - Field { - label: "wraps_result".to_string(), - ty: DeclarationId(124), - }, - Field { - label: "placeholder_convention".to_string(), - ty: DeclarationId(1023), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 22527, 22714), - }); - declarations.push(Declaration { - id: DeclarationId(1026), - name: Some("CleanEmissionContract".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "expression_wrapping".to_string(), - ty: DeclarationId(1028), - }, - Field { - label: "pattern_bindings".to_string(), - ty: DeclarationId(1029), - }, - Field { - label: "variant_payload_field_access".to_string(), - ty: DeclarationId(1030), - }, - Field { - label: "imports".to_string(), - ty: DeclarationId(1031), - }, - Field { - label: "block_return".to_string(), - ty: DeclarationId(1032), - }, - Field { - label: "variable_bindings".to_string(), - ty: DeclarationId(1033), - }, - Field { - label: "match_arm_body".to_string(), - ty: DeclarationId(1034), - }, - Field { - label: "correction_style".to_string(), - ty: DeclarationId(1035), - }, - Field { - label: "post_emit_verifier".to_string(), - ty: DeclarationId(1036), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 562, 944), - }); - declarations.push(Declaration { - id: DeclarationId(1027), - name: Some("TargetCleanEmissionBinding".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "language".to_string(), - ty: DeclarationId(1022), - }, - Field { - label: "clean_emission".to_string(), - ty: DeclarationId(1026), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 1748, 1848), - }); - declarations.push(Declaration { - id: DeclarationId(1028), - name: Some("ExpressionWrappingRule".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "WrapEverything".to_string(), - ty: DeclarationId(1930), - }, - Field { - label: "WrapOnlyInOperandPosition".to_string(), - ty: DeclarationId(1931), - }, - Field { - label: "NoWrapping".to_string(), - ty: DeclarationId(1932), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 2192, 2283), - }); - declarations.push(Declaration { - id: DeclarationId(1029), - name: Some("PatternBindingRule".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "EmitBindingAlways".to_string(), - ty: DeclarationId(1933), - }, - Field { - label: "EmitUnderscoreWhenUnused".to_string(), - ty: DeclarationId(1934), - }, - Field { - label: "EmitPrefixedUnderscoreWhenUnused".to_string(), - ty: DeclarationId(1935), - }, - Field { - label: "NotApplicablePatternBinding".to_string(), - ty: DeclarationId(1936), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 2520, 2663), - }); - declarations.push(Declaration { - id: DeclarationId(1030), - name: Some("VariantPayloadFieldAccessRule".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "AccessFromPayloadBinding".to_string(), - ty: DeclarationId(1937), - }, - Field { - label: "OverrideNamedFieldsAtBindingSite".to_string(), - ty: DeclarationId(1938), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 3330, 3430), - }); - declarations.push(Declaration { - id: DeclarationId(1031), - name: Some("ImportRule".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ImportEverythingDeclared".to_string(), - ty: DeclarationId(1939), - }, - Field { - label: "IncludeOnlyReferenced".to_string(), - ty: DeclarationId(1940), - }, - Field { - label: "ImportPerUsageSite".to_string(), - ty: DeclarationId(1941), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 3544, 3637), - }); - declarations.push(Declaration { - id: DeclarationId(1032), - name: Some("BlockReturnRule".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "WrapReturnValue".to_string(), - ty: DeclarationId(1942), - }, - Field { - label: "NoWrappingOnTerminalExpression".to_string(), - ty: DeclarationId(1943), - }, - Field { - label: "ExplicitReturnKeyword".to_string(), - ty: DeclarationId(1944), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 3756, 3857), - }); - declarations.push(Declaration { - id: DeclarationId(1033), - name: Some("VariableBindingRule".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "EmitLetBindingAlways".to_string(), - ty: DeclarationId(1945), - }, - Field { - label: "EmitLetUnderscoreWhenUnused".to_string(), - ty: DeclarationId(1946), - }, - Field { - label: "OmitLetBinding".to_string(), - ty: DeclarationId(1947), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 3995, 4095), - }); - declarations.push(Declaration { - id: DeclarationId(1034), - name: Some("MatchArmBodyRule".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "WrapBody".to_string(), - ty: DeclarationId(1948), - }, - Field { - label: "NoWrappingOnNonComplexBody".to_string(), - ty: DeclarationId(1949), - }, - Field { - label: "NotApplicableMatchArmBody".to_string(), - ty: DeclarationId(1950), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 4328, 4423), - }); - declarations.push(Declaration { - id: DeclarationId(1035), - name: Some("CorrectionStyle".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "indent_unit".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "line_ending".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "string_quote".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "trailing_semicolon".to_string(), - ty: DeclarationId(124), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 4736, 4854), - }); - declarations.push(Declaration { - id: DeclarationId(1036), - name: Some("PostEmitVerifier".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "command".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "args".to_string(), - ty: DeclarationId(1951), - }, - Field { - label: "syntax_only".to_string(), - ty: DeclarationId(124), - }, - Field { - label: "expected_exit_code".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "output_policy".to_string(), - ty: DeclarationId(1037), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 5270, 5418), - }); - declarations.push(Declaration { - id: DeclarationId(1037), - name: Some("VerifierOutputPolicy".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "IgnoreVerifierOutput".to_string(), - ty: DeclarationId(1952), - }, - Field { - label: "RequireEmptyStdout".to_string(), - ty: DeclarationId(1953), - }, - Field { - label: "RequireEmptyStderr".to_string(), - ty: DeclarationId(1954), - }, - Field { - label: "RequireEmptyStdoutAndStderr".to_string(), - ty: DeclarationId(1955), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 5663, 5791), - }); - declarations.push(Declaration { - id: DeclarationId(1038), - name: Some("ShapeATarget".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1022), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/cross_target_coverage.dag", 2839, 2871), - }); - declarations.push(Declaration { - id: DeclarationId(1039), - name: Some("rust_shape_a_target".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1038), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1038)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Unparsed(SourceSpan::new( - "src/v3/std/cross_target_coverage.dag", - 2914, - 2927, - ))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/cross_target_coverage.dag", 2873, 2927), - }); - declarations.push(Declaration { - id: DeclarationId(1040), - name: Some("python_shape_a_target".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1038), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1038)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Unparsed(SourceSpan::new( - "src/v3/std/cross_target_coverage.dag", - 2971, - 2986, - ))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/cross_target_coverage.dag", 2928, 2986), - }); - declarations.push(Declaration { - id: DeclarationId(1041), - name: Some("go_shape_a_target".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1038), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1038)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Unparsed(SourceSpan::new( - "src/v3/std/cross_target_coverage.dag", - 3026, - 3037, - ))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/cross_target_coverage.dag", 2987, 3037), - }); - declarations.push(Declaration { - id: DeclarationId(1042), - name: Some("FormAxis".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Atom".to_string(), - ty: DeclarationId(1956), - }, - Field { - label: "Conj".to_string(), - ty: DeclarationId(1957), - }, - Field { - label: "Disj".to_string(), - ty: DeclarationId(1958), - }, - Field { - label: "Arrow".to_string(), - ty: DeclarationId(1959), - }, - Field { - label: "Cardinality".to_string(), - ty: DeclarationId(1960), - }, - Field { - label: "Instantiation".to_string(), - ty: DeclarationId(1961), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/cross_target_coverage.dag", 3837, 3909), - }); - declarations.push(Declaration { - id: DeclarationId(1043), - name: Some("BehaviorAxis".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Value".to_string(), - ty: DeclarationId(1962), - }, - Field { - label: "Transform".to_string(), - ty: DeclarationId(1963), - }, - Field { - label: "Branch".to_string(), - ty: DeclarationId(1964), - }, - Field { - label: "Loop".to_string(), - ty: DeclarationId(1965), - }, - Field { - label: "Bind".to_string(), - ty: DeclarationId(1966), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/cross_target_coverage.dag", 4469, 4529), - }); - declarations.push(Declaration { - id: DeclarationId(1044), - name: Some("MethodTemplateContractKey".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "target".to_string(), - ty: DeclarationId(1038), - }, - Field { - label: "dag_method".to_string(), - ty: DeclarationId(852), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/cross_target_coverage.dag", 4913, 4994), - }); - declarations.push(Declaration { - id: DeclarationId(1045), - name: Some("EmissionCell".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "connective".to_string(), - ty: DeclarationId(1042), - }, - Field { - label: "behavior".to_string(), - ty: DeclarationId(1043), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/cross_target_coverage.dag", 5427, 5496), - }); - declarations.push(Declaration { - id: DeclarationId(1046), - name: Some("EmissionPathProjection".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "row_identity".to_string(), - ty: DeclarationId(1044), - }, - Field { - label: "cells".to_string(), - ty: DeclarationId(1967), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/cross_target_coverage.dag", 5842, 5943), - }); - declarations.push(Declaration { - id: DeclarationId(1047), - name: Some("emission_path_projections".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1046), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1968)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::List(vec![ - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1039)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(255)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1960), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1963), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1039)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(268)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1960), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1963), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1039)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(292)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1960), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1963), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1039)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(270)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1960), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1963), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1039)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(261)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1960), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1963), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1039)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(259)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1960), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1963), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1039)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(249)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1960), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1963), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1039)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(260)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1960), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1963), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1039)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(246)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1960), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1963), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1039)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(245)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1960), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1963), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1039)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(262)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1960), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1963), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1039)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(290)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1960), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1963), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1039)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(296)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1960), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1963), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1040)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(255)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1960), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1963), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1040)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(268)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1960), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1963), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1040)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(292)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1960), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1963), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1040)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(270)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1960), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1963), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1040)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(261)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1960), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1963), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1040)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(259)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1960), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1963), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1040)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(249)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1960), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1963), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1040)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(260)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1960), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1963), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1040)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(246)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1960), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1963), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1040)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(245)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1960), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1963), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1040)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(262)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1960), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1963), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1040)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(290)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1960), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1963), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1040)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(296)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1960), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1963), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1040)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(291)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1960), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1963), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1040)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(247)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1960), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1963), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1040)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(294)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1960), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1963), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1041)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(255)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1960), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1963), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1041)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(268)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1960), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1963), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1041)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(292)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1960), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1963), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1041)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(260)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1960), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1963), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1041)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(246)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1960), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1963), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1041)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(245)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1960), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1963), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1041)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(262)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1960), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1963), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1041)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(290)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1960), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1963), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1041)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(296)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1960), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1963), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1041)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(291)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1960), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1963), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1041)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(247)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1960), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1963), - payload: vec![], - }, - ), - ])]), - ), - ]), - FieldValue::Record(vec![ - ( - "row_identity".to_string(), - FieldValue::Record(vec![ - ( - "target".to_string(), - FieldValue::Reference(DeclarationId(1041)), - ), - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(294)), - )]), - ), - ]), - ), - ( - "cells".to_string(), - FieldValue::List(vec![FieldValue::Record(vec![ - ( - "connective".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1960), - payload: vec![], - }, - ), - ( - "behavior".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1963), - payload: vec![], - }, - ), - ])]), - ), - ]), - ])), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/cross_target_coverage.dag", 6364, 12528), - }); - declarations.push(Declaration { - id: DeclarationId(1048), - name: Some("CompilerDiagnosticKind".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "TokenizerError".to_string(), - ty: DeclarationId(1969), - }, - Field { - label: "ParseError".to_string(), - ty: DeclarationId(1970), - }, - Field { - label: "TypeMismatch".to_string(), - ty: DeclarationId(1971), - }, - Field { - label: "ArityMismatch".to_string(), - ty: DeclarationId(1972), - }, - Field { - label: "ResolveError".to_string(), - ty: DeclarationId(1973), - }, - Field { - label: "UnitMismatch".to_string(), - ty: DeclarationId(1974), - }, - Field { - label: "BranchConditionNotBool".to_string(), - ty: DeclarationId(1975), - }, - Field { - label: "MagnitudeOutOfRange".to_string(), - ty: DeclarationId(1976), - }, - Field { - label: "MalformedIntegerRangeFact".to_string(), - ty: DeclarationId(1977), - }, - Field { - label: "NominalOpacityViolation".to_string(), - ty: DeclarationId(1978), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 1067, 1306), - }); - declarations.push(Declaration { - id: DeclarationId(1049), - name: Some("CorrectionWitness".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "description".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - Field { - label: "new_source".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 1517, 1777), - }); - declarations.push(Declaration { - id: DeclarationId(1050), - name: Some("RetirementPlan".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "owner".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "exit_condition".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 1982, 2046), - }); - declarations.push(Declaration { - id: DeclarationId(1051), - name: Some("Correction".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "LiveCorrection".to_string(), - ty: DeclarationId(1979), - }, - Field { - label: "DeferredCorrection".to_string(), - ty: DeclarationId(1980), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 2896, 3036), - }); - declarations.push(Declaration { - id: DeclarationId(1052), - name: Some("DiagnosticKindDecl".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "payload".to_string(), - ty: DeclarationId(789), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 3816, 3879), - }); - declarations.push(Declaration { - id: DeclarationId(1053), - name: Some("LensInstanceKindWitness".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "kind_decl".to_string(), - ty: DeclarationId(1337), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 6081, 6141), - }); - declarations.push(Declaration { - id: DeclarationId(1054), - name: Some("AnyDiagnosticKind".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "CompilerKind".to_string(), - ty: DeclarationId(1981), - }, - Field { - label: "LensInstanceKind".to_string(), - ty: DeclarationId(1982), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 6750, 6859), - }); - declarations.push(Declaration { - id: DeclarationId(1055), - name: Some("Diagnostic".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "kind".to_string(), - ty: DeclarationId(1054), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - Field { - label: "message".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "correction".to_string(), - ty: DeclarationId(1051), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 7228, 7335), - }); - declarations.push(Declaration { - id: DeclarationId(1056), - name: Some("EmissionDiagnostic".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "UnderRefined".to_string(), - ty: DeclarationId(1983), - }, - Field { - label: "NoInhabitant".to_string(), - ty: DeclarationId(1984), - }, - Field { - label: "ContradictoryUse".to_string(), - ty: DeclarationId(1986), - }, - Field { - label: "OutOfR2Scope".to_string(), - ty: DeclarationId(1987), - }, - Field { - label: "LifetimeProgramExtractionPending".to_string(), - ty: DeclarationId(1988), - }, - Field { - label: "FoldNotImplemented".to_string(), - ty: DeclarationId(1989), - }, - Field { - label: "MissingEmissionPath".to_string(), - ty: DeclarationId(1990), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 9969, 12739), - }); - declarations.push(Declaration { - id: DeclarationId(1057), - name: Some("ViolatesSubject".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "AtBehavior".to_string(), - ty: DeclarationId(2005), - }, - Field { - label: "ProducerLookupMissingPort".to_string(), - ty: DeclarationId(2006), - }, - Field { - label: "ProducerLookupMissingNode".to_string(), - ty: DeclarationId(2007), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 2360, 2503), - }); - declarations.push(Declaration { - id: DeclarationId(1058), - name: Some("Witness".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Inhabits".to_string(), - ty: DeclarationId(2008), - }, - Field { - label: "Violates".to_string(), - ty: DeclarationId(2009), - }, - ], - }, - type_params: vec![DeclarationId(1059)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 2505, 2606), - }); - declarations.push(Declaration { - id: DeclarationId(1059), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Carrier".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 2505, 2606), - }); - declarations.push(Declaration { - id: DeclarationId(1060), - name: Some("OptionalDiagnostic".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "NoDiagnostic".to_string(), - ty: DeclarationId(2010), - }, - Field { - label: "SomeDiagnostic".to_string(), - ty: DeclarationId(2011), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 2760, 2841), - }); - declarations.push(Declaration { - id: DeclarationId(1061), - name: Some("DimensionReport".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "DimensionOk".to_string(), - ty: DeclarationId(2014), - }, - Field { - label: "DimensionFail".to_string(), - ty: DeclarationId(2018), - }, - ], - }, - type_params: vec![DeclarationId(1062)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 3200, 3476), - }); - declarations.push(Declaration { - id: DeclarationId(1062), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Carrier".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 3200, 3476), - }); - declarations.push(Declaration { - id: DeclarationId(1063), - name: Some("AnalysisDimension".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "witness_of".to_string(), - ty: DeclarationId(2020), - }, - Field { - label: "compose".to_string(), - ty: DeclarationId(2021), - }, - Field { - label: "break_diagnostic".to_string(), - ty: DeclarationId(2022), - }, - ], - }, - type_params: vec![DeclarationId(1064)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 4727, 4920), - }); - declarations.push(Declaration { - id: DeclarationId(1064), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Carrier".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 4727, 4920), - }); - declarations.push(Declaration { - id: DeclarationId(1065), - name: Some("Dimension".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "value".to_string(), - ty: DeclarationId(1067), - }], - }, - type_params: vec![DeclarationId(1066), DeclarationId(1067)], - phantom_params: vec![PhantomParameter { - parameter: DeclarationId(1066), - algebra: DeclarationId(2023), - }], - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 5561, 5611), - }); - declarations.push(Declaration { - id: DeclarationId(1066), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Unit".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 5561, 5611), - }); - declarations.push(Declaration { - id: DeclarationId(1067), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Carrier".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 5561, 5611), - }); - declarations.push(Declaration { - id: DeclarationId(1068), - name: Some("Meters".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 5613, 5624), - }); - declarations.push(Declaration { - id: DeclarationId(1069), - name: Some("Seconds".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 5625, 5637), - }); - declarations.push(Declaration { - id: DeclarationId(1070), - name: Some("Kilograms".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 5638, 5652), - }); - declarations.push(Declaration { - id: DeclarationId(1071), - name: Some("Amperes".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 5653, 5665), - }); - declarations.push(Declaration { - id: DeclarationId(1072), - name: Some("Kelvin".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 5666, 5677), - }); - declarations.push(Declaration { - id: DeclarationId(1073), - name: Some("Moles".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 5678, 5688), - }); - declarations.push(Declaration { - id: DeclarationId(1074), - name: Some("Candela".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 5689, 5701), - }); - declarations.push(Declaration { - id: DeclarationId(1075), - name: Some("add_dimension".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![ - DeclarationId(1991), - DeclarationId(1992), - DeclarationId(1993), - ], - output: DeclarationId(1994), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/dimensions.dag", 5875, 5897)), - }, - type_params: vec![DeclarationId(1076), DeclarationId(1077)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 5703, 5897), - }); - declarations.push(Declaration { - id: DeclarationId(1076), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Unit".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 5703, 5897), - }); - declarations.push(Declaration { - id: DeclarationId(1077), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Carrier".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 5703, 5897), - }); - declarations.push(Declaration { - id: DeclarationId(1078), - name: Some("sub_dimension".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![ - DeclarationId(1995), - DeclarationId(1996), - DeclarationId(1997), - ], - output: DeclarationId(1998), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/dimensions.dag", 6071, 6093)), - }, - type_params: vec![DeclarationId(1079), DeclarationId(1080)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 5899, 6093), - }); - declarations.push(Declaration { - id: DeclarationId(1079), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Unit".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 5899, 6093), - }); - declarations.push(Declaration { - id: DeclarationId(1080), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Carrier".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 5899, 6093), - }); - declarations.push(Declaration { - id: DeclarationId(1081), - name: Some("mul_dimension_scalar".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![ - DeclarationId(1999), - DeclarationId(2000), - DeclarationId(1083), - ], - output: DeclarationId(2001), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/dimensions.dag", 6259, 6288)), - }, - type_params: vec![DeclarationId(1082), DeclarationId(1083)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 6095, 6288), - }); - declarations.push(Declaration { - id: DeclarationId(1082), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Unit".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 6095, 6288), - }); - declarations.push(Declaration { - id: DeclarationId(1083), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Carrier".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 6095, 6288), - }); - declarations.push(Declaration { - id: DeclarationId(1084), - name: Some("div_dimension_scalar".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![ - DeclarationId(2002), - DeclarationId(2003), - DeclarationId(1086), - ], - output: DeclarationId(2004), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/dimensions.dag", 6454, 6483)), - }, - type_params: vec![DeclarationId(1085), DeclarationId(1086)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 6290, 6483), - }); - declarations.push(Declaration { - id: DeclarationId(1085), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Unit".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 6290, 6483), - }); - declarations.push(Declaration { - id: DeclarationId(1086), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Carrier".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 6290, 6483), - }); - declarations.push(Declaration { - id: DeclarationId(1087), - name: Some("go_language_spec_free_monoid_concat_contract".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1025), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1025)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(253)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String( - "append({left}, {right}...)".to_string(), - )), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1928), - payload: vec![FieldValue::Literal(LiteralBits::String( - "append({left}, {right}...)".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1927), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/go_method_template_contracts.dag", 3213, 3515), - }); - declarations.push(Declaration { - id: DeclarationId(1088), - name: Some("go_language_spec_free_monoid_length_contract".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1025), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1025)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(271)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String("int64(len({recv}))".to_string())), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1928), - payload: vec![FieldValue::Literal(LiteralBits::String( - "int64(len({recv}))".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1927), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/go_method_template_contracts.dag", 3517, 3803), - }); - declarations.push(Declaration { - id: DeclarationId(1089), - name: Some("go_language_spec_free_monoid_emptiness_contract".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1025), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1025)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(267)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String("len({recv}) == 0".to_string())), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1928), - payload: vec![FieldValue::Literal(LiteralBits::String( - "len({recv}) == 0".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1927), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/go_method_template_contracts.dag", 3895, 4182), - }); - declarations.push(Declaration { - id: DeclarationId(1090), - name: Some("go_language_spec_free_monoid_fold_contract".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1025), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1025)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(263)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String( - "/* fold({recv}, {init}, {body}) */".to_string(), - )), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1928), - payload: vec![FieldValue::Literal(LiteralBits::String( - "/* fold({recv}, {init}, {body}) */".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1927), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/go_method_template_contracts.dag", 4617, 4931), - }); - declarations.push(Declaration { - id: DeclarationId(1091), - name: Some("go_language_spec_map_contract".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1025), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1025)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(274)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String( - "/* map({recv}, {body}) */".to_string(), - )), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1928), - payload: vec![FieldValue::Literal(LiteralBits::String( - "/* map({recv}, {body}) */".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1927), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/go_method_template_contracts.dag", 5417, 5699), - }); - declarations.push(Declaration { - id: DeclarationId(1092), - name: Some("go_filter_method_template_contract".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1025), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1025)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(260)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String( - "v2rt.Filter({recv}, {arg})".to_string(), - )), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1928), - payload: vec![FieldValue::Literal(LiteralBits::String( - "v2rt.Filter({recv}, {arg})".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1927), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/go_method_template_contracts.dag", 5701, 5993), - }); - declarations.push(Declaration { - id: DeclarationId(1093), - name: Some("go_any_method_template_contract".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1025), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1025)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(246)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String( - "v2rt.Any({recv}, {arg})".to_string(), - )), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1928), - payload: vec![FieldValue::Literal(LiteralBits::String( - "v2rt.Any({recv}, {arg})".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1927), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/go_method_template_contracts.dag", 5995, 6275), - }); - declarations.push(Declaration { - id: DeclarationId(1094), - name: Some("go_all_method_template_contract".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1025), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1025)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(245)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String( - "v2rt.All({recv}, {arg})".to_string(), - )), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1928), - payload: vec![FieldValue::Literal(LiteralBits::String( - "v2rt.All({recv}, {arg})".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1927), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/go_method_template_contracts.dag", 6277, 6557), - }); - declarations.push(Declaration { - id: DeclarationId(1095), - name: Some("go_flat_map_method_template_contract".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1025), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1025)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(262)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String( - "v2rt.FlatMap({recv}, {arg})".to_string(), - )), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1928), - payload: vec![FieldValue::Literal(LiteralBits::String( - "v2rt.FlatMap({recv}, {arg})".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1927), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/go_method_template_contracts.dag", 6559, 6857), - }); - declarations.push(Declaration { - id: DeclarationId(1096), - name: Some("go_method_template_contracts".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1025), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(2024)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::List(vec![ - FieldValue::Record(vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(255)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String("len({recv})".to_string())), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1928), - payload: vec![FieldValue::Literal(LiteralBits::String( - "len({recv})".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1927), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(268)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String( - "strings.Join({recv}, {arg})".to_string(), - )), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1928), - payload: vec![FieldValue::Literal(LiteralBits::String( - "strings.Join({recv}, {arg})".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1927), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(292)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String( - "strings.Split({recv}, {arg})".to_string(), - )), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1928), - payload: vec![FieldValue::Literal(LiteralBits::String( - "strings.Split({recv}, {arg})".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1927), - payload: vec![], - }, - ), - ]), - FieldValue::Reference(DeclarationId(1092)), - FieldValue::Reference(DeclarationId(1093)), - FieldValue::Reference(DeclarationId(1094)), - FieldValue::Reference(DeclarationId(1095)), - FieldValue::Record(vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(290)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String("{recv}[{arg}:]".to_string())), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1928), - payload: vec![FieldValue::Literal(LiteralBits::String( - "{recv}[{arg}:]".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1927), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(296)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String("{recv}[:{arg}]".to_string())), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1928), - payload: vec![FieldValue::Literal(LiteralBits::String( - "{recv}[:{arg}]".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1927), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(291)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String( - "v2rt.SortBy({recv}, {arg})".to_string(), - )), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1928), - payload: vec![FieldValue::Literal(LiteralBits::String( - "v2rt.SortBy({recv}, {arg})".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1927), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(247)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String( - "append({recv}, {arg})".to_string(), - )), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1928), - payload: vec![FieldValue::Literal(LiteralBits::String( - "append({recv}, {arg})".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1927), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(294)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String( - "strings.Contains({recv}, {arg})".to_string(), - )), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1928), - payload: vec![FieldValue::Literal(LiteralBits::String( - "strings.Contains({recv}, {arg})".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1927), - payload: vec![], - }, - ), - ]), - ])), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/go_method_template_contracts.dag", 6859, 8941), - }); - declarations.push(Declaration { - id: DeclarationId(1097), - name: Some("Lens".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "read".to_string(), - ty: DeclarationId(2026), - }, - Field { - label: "sequential".to_string(), - ty: DeclarationId(2027), - }, - Field { - label: "branch".to_string(), - ty: DeclarationId(2028), - }, - Field { - label: "iterate".to_string(), - ty: DeclarationId(2029), - }, - Field { - label: "validate".to_string(), - ty: DeclarationId(2030), - }, - ], - }, - type_params: vec![DeclarationId(1098)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens.dag", 4121, 4318), - }); - declarations.push(Declaration { - id: DeclarationId(1098), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("C".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens.dag", 4121, 4318), - }); - declarations.push(Declaration { - id: DeclarationId(1099), - name: Some("SectionRef".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "DeclarationScope".to_string(), - ty: DeclarationId(2031), - }, - Field { - label: "NodeScope".to_string(), - ty: DeclarationId(2032), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens_application.dag", 3544, 3677), - }); - declarations.push(Declaration { - id: DeclarationId(1100), - name: Some("DiagnosticSeverity".to_string()), - connective: TypeConnective::Disj { - variants: vec![Field { - label: "Error".to_string(), - ty: DeclarationId(2033), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens_application.dag", 4530, 4561), - }); - declarations.push(Declaration { - id: DeclarationId(1101), - name: Some("LensEnforcement".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "project".to_string(), - ty: DeclarationId(2034), - }, - Field { - label: "violates".to_string(), - ty: DeclarationId(2035), - }, - ], - }, - type_params: vec![ - DeclarationId(1102), - DeclarationId(1103), - DeclarationId(1104), - ], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens_application.dag", 5737, 5862), - }); - declarations.push(Declaration { - id: DeclarationId(1102), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Output".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens_application.dag", 5737, 5862), - }); - declarations.push(Declaration { - id: DeclarationId(1103), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Budget".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens_application.dag", 5737, 5862), - }); - declarations.push(Declaration { - id: DeclarationId(1104), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Projected".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens_application.dag", 5737, 5862), - }); - declarations.push(Declaration { - id: DeclarationId(1105), - name: Some("EnforceableLens".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "lens".to_string(), - ty: DeclarationId(2036), - }, - Field { - label: "enforcement".to_string(), - ty: DeclarationId(2037), - }, - ], - }, - type_params: vec![ - DeclarationId(1106), - DeclarationId(1107), - DeclarationId(1108), - ], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens_application.dag", 7813, 7943), - }); - declarations.push(Declaration { - id: DeclarationId(1106), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Output".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens_application.dag", 7813, 7943), - }); - declarations.push(Declaration { - id: DeclarationId(1107), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Budget".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens_application.dag", 7813, 7943), - }); - declarations.push(Declaration { - id: DeclarationId(1108), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Projected".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens_application.dag", 7813, 7943), - }); - declarations.push(Declaration { - id: DeclarationId(1109), - name: Some("EnforcedApplication".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "enforceable_lens".to_string(), - ty: DeclarationId(2038), - }, - Field { - label: "section".to_string(), - ty: DeclarationId(1099), - }, - Field { - label: "budget".to_string(), - ty: DeclarationId(1111), - }, - Field { - label: "diagnostic_severity".to_string(), - ty: DeclarationId(1100), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - ], - }, - type_params: vec![ - DeclarationId(1110), - DeclarationId(1111), - DeclarationId(1112), - ], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens_application.dag", 9637, 9855), - }); - declarations.push(Declaration { - id: DeclarationId(1110), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Output".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens_application.dag", 9637, 9855), - }); - declarations.push(Declaration { - id: DeclarationId(1111), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Budget".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens_application.dag", 9637, 9855), - }); - declarations.push(Declaration { - id: DeclarationId(1112), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Projected".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens_application.dag", 9637, 9855), - }); - declarations.push(Declaration { - id: DeclarationId(1113), - name: Some("IntrospectApplication".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "lens".to_string(), - ty: DeclarationId(2039), - }, - Field { - label: "section".to_string(), - ty: DeclarationId(1099), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - ], - }, - type_params: vec![DeclarationId(1114)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens_application.dag", 10728, 10828), - }); - declarations.push(Declaration { - id: DeclarationId(1114), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Output".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens_application.dag", 10728, 10828), - }); - declarations.push(Declaration { - id: DeclarationId(1115), - name: Some("python_language_spec_free_monoid_concat_contract".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1025), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1025)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(253)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String("[*{left}, *{right}]".to_string())), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1928), - payload: vec![FieldValue::Literal(LiteralBits::String( - "[*{left}, *{right}]".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1927), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new( - "src/v3/std/python_method_template_contracts.dag", - 3320, - 3612, - ), - }); - declarations.push(Declaration { - id: DeclarationId(1116), - name: Some("python_language_spec_free_monoid_length_contract".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1025), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1025)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(271)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String("len({recv})".to_string())), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1928), - payload: vec![FieldValue::Literal(LiteralBits::String( - "len({recv})".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1927), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new( - "src/v3/std/python_method_template_contracts.dag", - 3614, - 3890, - ), - }); - declarations.push(Declaration { - id: DeclarationId(1117), - name: Some("python_language_spec_free_monoid_emptiness_contract".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1025), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1025)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(267)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String("(len({recv}) == 0)".to_string())), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1928), - payload: vec![FieldValue::Literal(LiteralBits::String( - "(len({recv}) == 0)".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1927), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new( - "src/v3/std/python_method_template_contracts.dag", - 3997, - 4292, - ), - }); - declarations.push(Declaration { - id: DeclarationId(1118), - name: Some("python_language_spec_free_monoid_fold_contract".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1025), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1025)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(263)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String( - "__v3_fold({recv}, {init}, {body})".to_string(), - )), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1928), - payload: vec![FieldValue::Literal(LiteralBits::String( - "__v3_fold({recv}, {init}, {body})".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1927), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new( - "src/v3/std/python_method_template_contracts.dag", - 4665, - 4981, - ), - }); - declarations.push(Declaration { - id: DeclarationId(1119), - name: Some("python_language_spec_map_contract".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1025), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1025)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(274)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String( - "[{body} for {item} in {recv}]".to_string(), - )), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1928), - payload: vec![FieldValue::Literal(LiteralBits::String( - "[{body} for {item} in {recv}]".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1927), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new( - "src/v3/std/python_method_template_contracts.dag", - 5189, - 5483, - ), - }); - declarations.push(Declaration { - id: DeclarationId(1120), - name: Some("python_filter_method_template_contract".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1025), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1025)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(260)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String( - "[x for x in {recv} if {arg}(x)]".to_string(), - )), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1928), - payload: vec![FieldValue::Literal(LiteralBits::String( - "[x for x in {recv} if {arg}(x)]".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1927), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new( - "src/v3/std/python_method_template_contracts.dag", - 5485, - 5791, - ), - }); - declarations.push(Declaration { - id: DeclarationId(1121), - name: Some("python_any_method_template_contract".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1025), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1025)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(246)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String( - "any({arg}(x) for x in {recv})".to_string(), - )), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1928), - payload: vec![FieldValue::Literal(LiteralBits::String( - "any({arg}(x) for x in {recv})".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1927), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new( - "src/v3/std/python_method_template_contracts.dag", - 5793, - 6089, - ), - }); - declarations.push(Declaration { - id: DeclarationId(1122), - name: Some("python_all_method_template_contract".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1025), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1025)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(245)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String( - "all({arg}(x) for x in {recv})".to_string(), - )), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1928), - payload: vec![FieldValue::Literal(LiteralBits::String( - "all({arg}(x) for x in {recv})".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1927), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new( - "src/v3/std/python_method_template_contracts.dag", - 6091, - 6387, - ), - }); - declarations.push(Declaration { - id: DeclarationId(1123), - name: Some("python_flat_map_method_template_contract".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1025), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1025)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(262)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String( - "[y for x in {recv} for y in {arg}(x)]".to_string(), - )), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1928), - payload: vec![FieldValue::Literal(LiteralBits::String( - "[y for x in {recv} for y in {arg}(x)]".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1927), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new( - "src/v3/std/python_method_template_contracts.dag", - 6389, - 6711, - ), - }); - declarations.push(Declaration { - id: DeclarationId(1124), - name: Some("python_method_template_contracts".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1025), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(2040)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::List(vec![ - FieldValue::Record(vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(255)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String("len({recv})".to_string())), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1928), - payload: vec![FieldValue::Literal(LiteralBits::String( - "len({recv})".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1927), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(268)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String("{arg}.join({recv})".to_string())), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1928), - payload: vec![FieldValue::Literal(LiteralBits::String( - "{arg}.join({recv})".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1927), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(292)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String("{recv}.split({arg})".to_string())), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1928), - payload: vec![FieldValue::Literal(LiteralBits::String( - "{recv}.split({arg})".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1927), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(270)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String( - "{recv}[-1] if {recv} else None".to_string(), - )), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1928), - payload: vec![FieldValue::Literal(LiteralBits::String( - "{recv}[-1] if {recv} else None".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1927), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(261)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String( - "{recv}[0] if {recv} else None".to_string(), - )), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1928), - payload: vec![FieldValue::Literal(LiteralBits::String( - "{recv}[0] if {recv} else None".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1927), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(259)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String( - "list(enumerate({recv}))".to_string(), - )), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1928), - payload: vec![FieldValue::Literal(LiteralBits::String( - "list(enumerate({recv}))".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1927), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(249)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String( - "[ord(c) for c in {recv}]".to_string(), - )), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1928), - payload: vec![FieldValue::Literal(LiteralBits::String( - "[ord(c) for c in {recv}]".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1927), - payload: vec![], - }, - ), - ]), - FieldValue::Reference(DeclarationId(1120)), - FieldValue::Reference(DeclarationId(1121)), - FieldValue::Reference(DeclarationId(1122)), - FieldValue::Reference(DeclarationId(1123)), - FieldValue::Record(vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(290)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String("{recv}[{arg}:]".to_string())), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1928), - payload: vec![FieldValue::Literal(LiteralBits::String( - "{recv}[{arg}:]".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1927), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(296)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String("{recv}[:{arg}]".to_string())), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1928), - payload: vec![FieldValue::Literal(LiteralBits::String( - "{recv}[:{arg}]".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1927), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(291)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String( - "sorted({recv}, key={arg})".to_string(), - )), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1928), - payload: vec![FieldValue::Literal(LiteralBits::String( - "sorted({recv}, key={arg})".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1927), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(247)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String("{recv} + [{arg}]".to_string())), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1928), - payload: vec![FieldValue::Literal(LiteralBits::String( - "{recv} + [{arg}]".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1927), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "dag_method".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(DeclarationId(294)), - )]), - ), - ( - "runtime_template".to_string(), - FieldValue::Literal(LiteralBits::String("{arg} in {recv}".to_string())), - ), - ( - "emit_template".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1928), - payload: vec![FieldValue::Literal(LiteralBits::String( - "{arg} in {recv}".to_string(), - ))], - }, - ), - ( - "wraps_result".to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - ), - ( - "placeholder_convention".to_string(), - FieldValue::Variant { - constructor: DeclarationId(1927), - payload: vec![], - }, - ), - ]), - ])), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new( - "src/v3/std/python_method_template_contracts.dag", - 6713, - 9706, - ), - }); - declarations.push(Declaration { - id: DeclarationId(1125), - name: Some("NamedField".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "label".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "value".to_string(), - ty: DeclarationId(1126), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/runtime.dag", 760, 810), - }); - declarations.push(Declaration { - id: DeclarationId(1126), - name: Some("Value".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "LiteralValue".to_string(), - ty: DeclarationId(2042), - }, - Field { - label: "RecordValue".to_string(), - ty: DeclarationId(2044), - }, - Field { - label: "VariantValue".to_string(), - ty: DeclarationId(2045), - }, - Field { - label: "NodeRef".to_string(), - ty: DeclarationId(2046), - }, - Field { - label: "CardinalityValue".to_string(), - ty: DeclarationId(2047), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/runtime.dag", 2122, 2304), - }); - declarations.push(Declaration { - id: DeclarationId(1127), - name: Some("ProgramObservation".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "observed".to_string(), - ty: DeclarationId(1128), - }], - }, - type_params: vec![DeclarationId(1128)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/runtime.dag", 3208, 3264), - }); - declarations.push(Declaration { - id: DeclarationId(1128), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Carrier".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/runtime.dag", 3208, 3264), - }); - declarations.push(Declaration { - id: DeclarationId(1129), - name: Some("EvalFrame".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "bindings".to_string(), - ty: DeclarationId(2048), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/runtime.dag", 3907, 3956), - }); - declarations.push(Declaration { - id: DeclarationId(1130), - name: Some("EvalStateStack".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "frames".to_string(), - ty: DeclarationId(2049), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/runtime.dag", 4510, 4559), - }); - declarations.push(Declaration { - id: DeclarationId(1131), - name: Some("EvalStateKey".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "state".to_string(), - ty: DeclarationId(1130), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/runtime.dag", 4940, 4985), - }); - declarations.push(Declaration { - id: DeclarationId(1132), - name: Some("EvalStrategy".to_string()), - connective: TypeConnective::Disj { - variants: vec![Field { - label: "ApplicativeOrder".to_string(), - ty: DeclarationId(2050), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/runtime.dag", 5368, 5442), - }); - declarations.push(Declaration { - id: DeclarationId(1133), - name: Some("InputEvaluationOrder".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "LeftFirst".to_string(), - ty: DeclarationId(2051), - }, - Field { - label: "RightFirst".to_string(), - ty: DeclarationId(2052), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/runtime.dag", 5654, 5704), - }); - declarations.push(Declaration { - id: DeclarationId(1134), - name: Some("EvalMemoKey".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "program".to_string(), - ty: DeclarationId(737), - }, - Field { - label: "node".to_string(), - ty: DeclarationId(735), - }, - Field { - label: "state_key".to_string(), - ty: DeclarationId(1131), - }, - Field { - label: "strategy".to_string(), - ty: DeclarationId(1132), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/runtime.dag", 6013, 6124), - }); - declarations.push(Declaration { - id: DeclarationId(1135), - name: Some("evaluate".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839), DeclarationId(735), DeclarationId(2041)], - output: DeclarationId(1126), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/runtime.dag", 11260, 11279)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/runtime.dag", 11191, 11279), - }); - declarations.push(Declaration { id: DeclarationId(1136), name: Some("rust_filter_method_template_contract".to_string()), connective: TypeConnective::Instantiation { template: DeclarationId(1025), arguments: vec![] }, type_params: vec![], phantom_params: Vec::new(), meta_tag: Some(DeclarationId(1025)), specialization_parent: None, inhabits: None, value_body: Some(ValueBody::Structural { fields: vec![("dag_method".to_string(), FieldValue::Record(vec![("decl".to_string(), FieldValue::Reference(DeclarationId(260)))])), ("runtime_template".to_string(), FieldValue::Literal(LiteralBits::String("{ let __filter_source = {iter}; let mut __result = Vec::new(); for {param} in __filter_source.iter() { if {body} { __result.push((*{param}).clone()); } } __result }".to_string()))), ("emit_template".to_string(), FieldValue::Variant { constructor: DeclarationId(1929), payload: vec![FieldValue::Literal(LiteralBits::String("{ let __filter_source = {iter}; let mut __result = Vec::new(); for {param} in __filter_source.iter() { if {body} { __result.push((*{param}).clone()); } } __result }".to_string())), FieldValue::Literal(LiteralBits::String("{iter}.filter({arg}).collect::>()".to_string()))] }), ("wraps_result".to_string(), FieldValue::Literal(LiteralBits::Bool(true))), ("placeholder_convention".to_string(), FieldValue::Variant { constructor: DeclarationId(1927), payload: vec![] })] }), refinement: None, nominal_opacity: None, span: SourceSpan::new("src/v3/std/rust_method_template_contracts.dag", 3555, 4208) }); - declarations.push(Declaration { id: DeclarationId(1137), name: Some("rust_any_method_template_contract".to_string()), connective: TypeConnective::Instantiation { template: DeclarationId(1025), arguments: vec![] }, type_params: vec![], phantom_params: Vec::new(), meta_tag: Some(DeclarationId(1025)), specialization_parent: None, inhabits: None, value_body: Some(ValueBody::Structural { fields: vec![("dag_method".to_string(), FieldValue::Record(vec![("decl".to_string(), FieldValue::Reference(DeclarationId(246)))])), ("runtime_template".to_string(), FieldValue::Literal(LiteralBits::String("{ let mut __found = false; for {param} in {iter} { if {body} { __found = true; break; } } __found }".to_string()))), ("emit_template".to_string(), FieldValue::Variant { constructor: DeclarationId(1929), payload: vec![FieldValue::Literal(LiteralBits::String("{ let mut __found = false; for {param} in {iter} { if {body} { __found = true; break; } } __found }".to_string())), FieldValue::Literal(LiteralBits::String("{iter}.any({arg})".to_string()))] }), ("wraps_result".to_string(), FieldValue::Literal(LiteralBits::Bool(false))), ("placeholder_convention".to_string(), FieldValue::Variant { constructor: DeclarationId(1927), payload: vec![] })] }), refinement: None, nominal_opacity: None, span: SourceSpan::new("src/v3/std/rust_method_template_contracts.dag", 4210, 4705) }); - declarations.push(Declaration { id: DeclarationId(1138), name: Some("rust_all_method_template_contract".to_string()), connective: TypeConnective::Instantiation { template: DeclarationId(1025), arguments: vec![] }, type_params: vec![], phantom_params: Vec::new(), meta_tag: Some(DeclarationId(1025)), specialization_parent: None, inhabits: None, value_body: Some(ValueBody::Structural { fields: vec![("dag_method".to_string(), FieldValue::Record(vec![("decl".to_string(), FieldValue::Reference(DeclarationId(245)))])), ("runtime_template".to_string(), FieldValue::Literal(LiteralBits::String("{ let mut __all = true; for {param} in {iter} { if !({body}) { __all = false; break; } } __all }".to_string()))), ("emit_template".to_string(), FieldValue::Variant { constructor: DeclarationId(1929), payload: vec![FieldValue::Literal(LiteralBits::String("{ let mut __all = true; for {param} in {iter} { if !({body}) { __all = false; break; } } __all }".to_string())), FieldValue::Literal(LiteralBits::String("{iter}.all({arg})".to_string()))] }), ("wraps_result".to_string(), FieldValue::Literal(LiteralBits::Bool(false))), ("placeholder_convention".to_string(), FieldValue::Variant { constructor: DeclarationId(1927), payload: vec![] })] }), refinement: None, nominal_opacity: None, span: SourceSpan::new("src/v3/std/rust_method_template_contracts.dag", 4707, 5196) }); - declarations.push(Declaration { id: DeclarationId(1139), name: Some("rust_flat_map_method_template_contract".to_string()), connective: TypeConnective::Instantiation { template: DeclarationId(1025), arguments: vec![] }, type_params: vec![], phantom_params: Vec::new(), meta_tag: Some(DeclarationId(1025)), specialization_parent: None, inhabits: None, value_body: Some(ValueBody::Structural { fields: vec![("dag_method".to_string(), FieldValue::Record(vec![("decl".to_string(), FieldValue::Reference(DeclarationId(262)))])), ("runtime_template".to_string(), FieldValue::Literal(LiteralBits::String("{ let mut __result = Vec::new(); for {param} in {iter} { __result.extend({inner_iter}); } __result }".to_string()))), ("emit_template".to_string(), FieldValue::Variant { constructor: DeclarationId(1929), payload: vec![FieldValue::Literal(LiteralBits::String("{ let mut __result = Vec::new(); for {param} in {iter} { __result.extend({inner_iter}); } __result }".to_string())), FieldValue::Literal(LiteralBits::String("{iter}.flat_map({arg}).collect::>()".to_string()))] }), ("wraps_result".to_string(), FieldValue::Literal(LiteralBits::Bool(true))), ("placeholder_convention".to_string(), FieldValue::Variant { constructor: DeclarationId(1927), payload: vec![] })] }), refinement: None, nominal_opacity: None, span: SourceSpan::new("src/v3/std/rust_method_template_contracts.dag", 5198, 5729) }); - declarations.push(Declaration { id: DeclarationId(1140), name: Some("rust_method_template_contracts".to_string()), connective: TypeConnective::Instantiation { template: DeclarationId(699), arguments: vec![TemplateArgument { parameter: DeclarationId(700), value: DeclarationId(1025) }] }, type_params: vec![], phantom_params: Vec::new(), meta_tag: Some(DeclarationId(2053)), specialization_parent: None, inhabits: None, value_body: Some(ValueBody::List(vec![FieldValue::Record(vec![("dag_method".to_string(), FieldValue::Record(vec![("decl".to_string(), FieldValue::Reference(DeclarationId(255)))])), ("runtime_template".to_string(), FieldValue::Literal(LiteralBits::String("{recv}.len()".to_string()))), ("emit_template".to_string(), FieldValue::Variant { constructor: DeclarationId(1928), payload: vec![FieldValue::Literal(LiteralBits::String("({recv}.len() as i64)".to_string()))] }), ("wraps_result".to_string(), FieldValue::Literal(LiteralBits::Bool(false))), ("placeholder_convention".to_string(), FieldValue::Variant { constructor: DeclarationId(1927), payload: vec![] })]), FieldValue::Record(vec![("dag_method".to_string(), FieldValue::Record(vec![("decl".to_string(), FieldValue::Reference(DeclarationId(268)))])), ("runtime_template".to_string(), FieldValue::Literal(LiteralBits::String("{recv}.join(&{arg})".to_string()))), ("emit_template".to_string(), FieldValue::Variant { constructor: DeclarationId(1928), payload: vec![FieldValue::Literal(LiteralBits::String("{recv}.join(&{arg})".to_string()))] }), ("wraps_result".to_string(), FieldValue::Literal(LiteralBits::Bool(false))), ("placeholder_convention".to_string(), FieldValue::Variant { constructor: DeclarationId(1927), payload: vec![] })]), FieldValue::Record(vec![("dag_method".to_string(), FieldValue::Record(vec![("decl".to_string(), FieldValue::Reference(DeclarationId(292)))])), ("runtime_template".to_string(), FieldValue::Literal(LiteralBits::String("{recv}.split(&{arg}).map(|s| s.to_string()).collect::>()".to_string()))), ("emit_template".to_string(), FieldValue::Variant { constructor: DeclarationId(1928), payload: vec![FieldValue::Literal(LiteralBits::String("{recv}.split(&{arg}).map(|s| s.to_string()).collect::>()".to_string()))] }), ("wraps_result".to_string(), FieldValue::Literal(LiteralBits::Bool(true))), ("placeholder_convention".to_string(), FieldValue::Variant { constructor: DeclarationId(1927), payload: vec![] })]), FieldValue::Record(vec![("dag_method".to_string(), FieldValue::Record(vec![("decl".to_string(), FieldValue::Reference(DeclarationId(270)))])), ("runtime_template".to_string(), FieldValue::Literal(LiteralBits::String("{recv}.last().cloned()".to_string()))), ("emit_template".to_string(), FieldValue::Variant { constructor: DeclarationId(1928), payload: vec![FieldValue::Literal(LiteralBits::String("{recv}.last().cloned()".to_string()))] }), ("wraps_result".to_string(), FieldValue::Literal(LiteralBits::Bool(false))), ("placeholder_convention".to_string(), FieldValue::Variant { constructor: DeclarationId(1927), payload: vec![] })]), FieldValue::Record(vec![("dag_method".to_string(), FieldValue::Record(vec![("decl".to_string(), FieldValue::Reference(DeclarationId(261)))])), ("runtime_template".to_string(), FieldValue::Literal(LiteralBits::String("{recv}.first().cloned()".to_string()))), ("emit_template".to_string(), FieldValue::Variant { constructor: DeclarationId(1928), payload: vec![FieldValue::Literal(LiteralBits::String("{recv}.first().cloned()".to_string()))] }), ("wraps_result".to_string(), FieldValue::Literal(LiteralBits::Bool(false))), ("placeholder_convention".to_string(), FieldValue::Variant { constructor: DeclarationId(1927), payload: vec![] })]), FieldValue::Record(vec![("dag_method".to_string(), FieldValue::Record(vec![("decl".to_string(), FieldValue::Reference(DeclarationId(259)))])), ("runtime_template".to_string(), FieldValue::Literal(LiteralBits::String("{recv}.iter().enumerate().map(|(i, v)| (i, v.clone())).collect::>()".to_string()))), ("emit_template".to_string(), FieldValue::Variant { constructor: DeclarationId(1928), payload: vec![FieldValue::Literal(LiteralBits::String("{recv}.iter().cloned().enumerate().map(|(i, v)| (i as i64, v)).collect::>()".to_string()))] }), ("wraps_result".to_string(), FieldValue::Literal(LiteralBits::Bool(true))), ("placeholder_convention".to_string(), FieldValue::Variant { constructor: DeclarationId(1927), payload: vec![] })]), FieldValue::Record(vec![("dag_method".to_string(), FieldValue::Record(vec![("decl".to_string(), FieldValue::Reference(DeclarationId(249)))])), ("runtime_template".to_string(), FieldValue::Literal(LiteralBits::String("{recv}.chars().map(|c| c as i64).collect::>()".to_string()))), ("emit_template".to_string(), FieldValue::Variant { constructor: DeclarationId(1928), payload: vec![FieldValue::Literal(LiteralBits::String("{recv}.chars().map(|c| c as i64).collect::>()".to_string()))] }), ("wraps_result".to_string(), FieldValue::Literal(LiteralBits::Bool(true))), ("placeholder_convention".to_string(), FieldValue::Variant { constructor: DeclarationId(1927), payload: vec![] })]), FieldValue::Reference(DeclarationId(1136)), FieldValue::Reference(DeclarationId(1137)), FieldValue::Reference(DeclarationId(1138)), FieldValue::Reference(DeclarationId(1139)), FieldValue::Record(vec![("dag_method".to_string(), FieldValue::Record(vec![("decl".to_string(), FieldValue::Reference(DeclarationId(290)))])), ("runtime_template".to_string(), FieldValue::Literal(LiteralBits::String("{recv}.iter().cloned().skip({arg} as usize).collect::>()".to_string()))), ("emit_template".to_string(), FieldValue::Variant { constructor: DeclarationId(1928), payload: vec![FieldValue::Literal(LiteralBits::String("{recv}.iter().cloned().skip({arg} as usize).collect::>()".to_string()))] }), ("wraps_result".to_string(), FieldValue::Literal(LiteralBits::Bool(true))), ("placeholder_convention".to_string(), FieldValue::Variant { constructor: DeclarationId(1927), payload: vec![] })]), FieldValue::Record(vec![("dag_method".to_string(), FieldValue::Record(vec![("decl".to_string(), FieldValue::Reference(DeclarationId(296)))])), ("runtime_template".to_string(), FieldValue::Literal(LiteralBits::String("{recv}.iter().cloned().take({arg} as usize).collect::>()".to_string()))), ("emit_template".to_string(), FieldValue::Variant { constructor: DeclarationId(1928), payload: vec![FieldValue::Literal(LiteralBits::String("{recv}.iter().cloned().take({arg} as usize).collect::>()".to_string()))] }), ("wraps_result".to_string(), FieldValue::Literal(LiteralBits::Bool(true))), ("placeholder_convention".to_string(), FieldValue::Variant { constructor: DeclarationId(1927), payload: vec![] })])])), refinement: None, nominal_opacity: None, span: SourceSpan::new("src/v3/std/rust_method_template_contracts.dag", 5732, 8453) }); - declarations.push(Declaration { - id: DeclarationId(1141), - name: Some("DescentEvidence".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Strict".to_string(), - ty: DeclarationId(2062), - }, - Field { - label: "NonIncreasing".to_string(), - ty: DeclarationId(2063), - }, - Field { - label: "DescentUnknown".to_string(), - ty: DeclarationId(2064), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 742, 810), - }); - declarations.push(Declaration { - id: DeclarationId(1142), - name: Some("evidence_rank".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1141)], - output: DeclarationId(87), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/termination.dag", 856, 938)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 812, 938), - }); - declarations.push(Declaration { - id: DeclarationId(1143), - name: Some("merge_evidence".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1141), DeclarationId(1141)], - output: DeclarationId(1141), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/termination.dag", - 1082, - 1410, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 1005, 1410), - }); - declarations.push(Declaration { - id: DeclarationId(1144), - name: Some("join_evidence".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1141), DeclarationId(1141)], - output: DeclarationId(1141), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/termination.dag", - 1556, - 1755, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 1480, 1755), - }); - declarations.push(Declaration { - id: DeclarationId(1145), - name: Some("promote_to_strict".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1141)], - output: DeclarationId(1141), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/termination.dag", - 2217, - 2336, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 2150, 2336), - }); - declarations.push(Declaration { - id: DeclarationId(1146), - name: Some("optional_evidence_meet".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(2054), DeclarationId(2055)], - output: DeclarationId(2056), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/termination.dag", - 2488, - 2664, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 2400, 2664), - }); - declarations.push(Declaration { - id: DeclarationId(1147), - name: Some("map_evidence_merge_at".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(2057), DeclarationId(227), DeclarationId(1141)], - output: DeclarationId(2058), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/termination.dag", - 2833, - 3007, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 2701, 3007), - }); - declarations.push(Declaration { - id: DeclarationId(1148), - name: Some("RankingDimension".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "TreeSize".to_string(), - ty: DeclarationId(2065), - }, - Field { - label: "ListLength".to_string(), - ty: DeclarationId(2066), - }, - Field { - label: "ArithmeticValue".to_string(), - ty: DeclarationId(2067), - }, - Field { - label: "TokenPosition".to_string(), - ty: DeclarationId(2068), - }, - Field { - label: "SetCardinality".to_string(), - ty: DeclarationId(2069), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 3306, 3502), - }); - declarations.push(Declaration { - id: DeclarationId(1149), - name: Some("PositiveDescentAmount".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "OneStep".to_string(), - ty: DeclarationId(2070), - }, - Field { - label: "AdditionalStep".to_string(), - ty: DeclarationId(2071), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 4478, 4571), - }); - declarations.push(Declaration { - id: DeclarationId(1150), - name: Some("positive_descent_count".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1149)], - output: DeclarationId(87), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/termination.dag", - 4881, - 4989, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 4818, 4989), - }); - declarations.push(Declaration { - id: DeclarationId(1151), - name: Some("ProportionalDivisor".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "DivideByTwo".to_string(), - ty: DeclarationId(2072), - }, - Field { - label: "StrictlyLarger".to_string(), - ty: DeclarationId(2073), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 5455, 5545), - }); - declarations.push(Declaration { - id: DeclarationId(1152), - name: Some("proportional_divisor_to_int".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1151)], - output: DeclarationId(87), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/termination.dag", - 5609, - 5722, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 5547, 5722), - }); - declarations.push(Declaration { - id: DeclarationId(1153), - name: Some("peano_literal_materialization_cap".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(87), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/termination.dag", - 5952, - 5959, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 5906, 5959), - }); - declarations.push(Declaration { - id: DeclarationId(1154), - name: Some("positive_descent_amount_from_positive_int".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87)], - output: DeclarationId(2059), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/termination.dag", - 6420, - 6780, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 6341, 6780), - }); - declarations.push(Declaration { - id: DeclarationId(1155), - name: Some("proportional_divisor_from_int_at_least_two".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87)], - output: DeclarationId(2060), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/termination.dag", - 6860, - 7221, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 6782, 7221), - }); - declarations.push(Declaration { - id: DeclarationId(1156), - name: Some("DescentSource".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ChildAccessor".to_string(), - ty: DeclarationId(2074), - }, - Field { - label: "ListShrink".to_string(), - ty: DeclarationId(2075), - }, - Field { - label: "ArithmeticSubtractDescent".to_string(), - ty: DeclarationId(2076), - }, - Field { - label: "ArithmeticDivideDescent".to_string(), - ty: DeclarationId(2077), - }, - Field { - label: "ParserAdvance".to_string(), - ty: DeclarationId(2078), - }, - Field { - label: "SetRemoval".to_string(), - ty: DeclarationId(2079), - }, - Field { - label: "FoldIteration".to_string(), - ty: DeclarationId(2080), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 7626, 7947), - }); - declarations.push(Declaration { - id: DeclarationId(1157), - name: Some("TerminationProof".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "dimensions".to_string(), - ty: DeclarationId(2081), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 7949, 8011), - }); - declarations.push(Declaration { - id: DeclarationId(1158), - name: Some("ProofEdge".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "caller".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "callee".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "evidence".to_string(), - ty: DeclarationId(2082), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 8156, 8242), - }); - declarations.push(Declaration { - id: DeclarationId(1159), - name: Some("StrictEvidence".to_string()), - connective: TypeConnective::Disj { - variants: vec![Field { - label: "Strict".to_string(), - ty: DeclarationId(2083), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 8716, 8746), - }); - declarations.push(Declaration { - id: DeclarationId(1160), - name: Some("NonStrictEvidence".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "NonIncreasing".to_string(), - ty: DeclarationId(2084), - }, - Field { - label: "DescentUnknown".to_string(), - ty: DeclarationId(2085), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 9112, 9171), - }); - declarations.push(Declaration { - id: DeclarationId(1161), - name: Some("DescentResidual".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "EvidenceUnknown".to_string(), - ty: DeclarationId(2086), - }, - Field { - label: "EvidenceIncomplete".to_string(), - ty: DeclarationId(2087), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 10238, 10320), - }); - declarations.push(Declaration { - id: DeclarationId(1162), - name: Some("DescentExecutionProof".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "cluster".to_string(), - ty: DeclarationId(738), - }, - Field { - label: "port".to_string(), - ty: DeclarationId(736), - }, - Field { - label: "per_path".to_string(), - ty: DeclarationId(2088), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 11157, 11263), - }); - declarations.push(Declaration { - id: DeclarationId(1163), - name: Some("descent_execution_proof".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839), DeclarationId(738), DeclarationId(736)], - output: DeclarationId(2061), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/termination.dag", - 12400, - 12439, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 12279, 12439), - }); - declarations.push(Declaration { - id: DeclarationId(1164), - name: Some("RecursionShape".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "DirectRecursion".to_string(), - ty: DeclarationId(2102), - }, - Field { - label: "ListRecursion".to_string(), - ty: DeclarationId(2103), - }, - Field { - label: "OptionalRecursion".to_string(), - ty: DeclarationId(2104), - }, - Field { - label: "SetRecursion".to_string(), - ty: DeclarationId(2105), - }, - Field { - label: "MapValueRecursion".to_string(), - ty: DeclarationId(2106), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 5605, 5878), - }); - declarations.push(Declaration { - id: DeclarationId(1165), - name: Some("InductiveField".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "type_name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "variant_name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "field_name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "shape".to_string(), - ty: DeclarationId(1164), - }, - Field { - label: "element_type".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 7170, 7592), - }); - declarations.push(Declaration { - id: DeclarationId(1166), - name: Some("recursion_shape_eq".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1164), DeclarationId(1164)], - output: DeclarationId(124), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/induction.dag", 7662, 8034)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 7594, 8034), - }); - declarations.push(Declaration { - id: DeclarationId(1167), - name: Some("inductive_field_eq".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1165), DeclarationId(1165)], - output: DeclarationId(124), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/induction.dag", 8104, 8302)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 8036, 8302), - }); - declarations.push(Declaration { - id: DeclarationId(1168), - name: Some("inductive_field_to_dimension".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1165), DeclarationId(227)], - output: DeclarationId(1148), - body: ArrowBody::Unparsed(SourceSpan::new("src/v3/std/induction.dag", 8768, 8799)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 8678, 8799), - }); - declarations.push(Declaration { - id: DeclarationId(1169), - name: Some("SubValueRelation".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "StrictSubValue".to_string(), - ty: DeclarationId(2107), - }, - Field { - label: "IteratedSubValue".to_string(), - ty: DeclarationId(2108), - }, - Field { - label: "ArithmeticDescent".to_string(), - ty: DeclarationId(2109), - }, - Field { - label: "PreservedValue".to_string(), - ty: DeclarationId(2110), - }, - Field { - label: "NonIncreasingValue".to_string(), - ty: DeclarationId(2111), - }, - Field { - label: "StrictAxisErased".to_string(), - ty: DeclarationId(2112), - }, - Field { - label: "MixedTop".to_string(), - ty: DeclarationId(2113), - }, - Field { - label: "SubValueUnknown".to_string(), - ty: DeclarationId(2114), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 10384, 10677), - }); - declarations.push(Declaration { - id: DeclarationId(1170), - name: Some("sub_value_to_evidence".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1169)], - output: DeclarationId(1141), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 11630, - 12468, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 11558, 12468), - }); - declarations.push(Declaration { - id: DeclarationId(1171), - name: Some("shrink_factor_eq".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(973), DeclarationId(973)], - output: DeclarationId(124), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 12936, - 13422, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 12874, 13422), - }); - declarations.push(Declaration { - id: DeclarationId(1172), - name: Some("sub_value_structural_eq".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1169), DeclarationId(1169)], - output: DeclarationId(124), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 13659, - 14629, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 13582, 14629), - }); - declarations.push(Declaration { - id: DeclarationId(1173), - name: Some("is_strict_style_structural".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1169)], - output: DeclarationId(124), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 14956, - 15166, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 14897, 15166), - }); - declarations.push(Declaration { - id: DeclarationId(1174), - name: Some("sub_value_level".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1169)], - output: DeclarationId(87), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 15215, - 15493, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 15168, 15493), - }); - declarations.push(Declaration { - id: DeclarationId(1175), - name: Some("meet_sub_value".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1169), DeclarationId(1169)], - output: DeclarationId(1169), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 15575, - 16156, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 15495, 16156), - }); - declarations.push(Declaration { - id: DeclarationId(1176), - name: Some("join_sub_value".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1169), DeclarationId(1169)], - output: DeclarationId(1169), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 16238, - 16794, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 16158, 16794), - }); - declarations.push(Declaration { - id: DeclarationId(1177), - name: Some("compose_sub_value".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1169), DeclarationId(1165)], - output: DeclarationId(1169), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 17875, - 17997, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 17787, 17997), - }); - declarations.push(Declaration { - id: DeclarationId(1178), - name: Some("compose_sub_value_relations".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1169), DeclarationId(1169)], - output: DeclarationId(1169), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 18853, - 21192, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 18745, 21192), - }); - declarations.push(Declaration { - id: DeclarationId(1179), - name: Some("sub_value_to_call_pattern".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1169)], - output: DeclarationId(2089), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 21967, - 22925, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 21894, 22925), - }); - declarations.push(Declaration { - id: DeclarationId(1180), - name: Some("sub_value_to_lowering_target".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1169)], - output: DeclarationId(2090), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 23517, - 24833, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 23438, 24833), - }); - declarations.push(Declaration { - id: DeclarationId(1181), - name: Some("PolynomialExponent".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "IntegerExpZero".to_string(), - ty: DeclarationId(2115), - }, - Field { - label: "IntegerExpPos".to_string(), - ty: DeclarationId(2116), - }, - Field { - label: "FractionExp".to_string(), - ty: DeclarationId(2117), - }, - Field { - label: "LogBasedExp".to_string(), - ty: DeclarationId(2118), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 26076, 26331), - }); - declarations.push(Declaration { - id: DeclarationId(1182), - name: Some("poly_exp_degree_one".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(1181), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 26380, - 26419, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 26333, 26419), - }); - declarations.push(Declaration { - id: DeclarationId(1183), - name: Some("AtomicCost".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "PolyCost".to_string(), - ty: DeclarationId(2119), - }, - Field { - label: "LogCost".to_string(), - ty: DeclarationId(2120), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 26931, 27048), - }); - declarations.push(Declaration { - id: DeclarationId(1184), - name: Some("CostBound".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ConstantBound".to_string(), - ty: DeclarationId(2121), - }, - Field { - label: "AtomicBound".to_string(), - ty: DeclarationId(2122), - }, - Field { - label: "ProductBound".to_string(), - ty: DeclarationId(2124), - }, - Field { - label: "SumOfProductsBound".to_string(), - ty: DeclarationId(2127), - }, - Field { - label: "SumBound".to_string(), - ty: DeclarationId(2129), - }, - Field { - label: "ForeverBound".to_string(), - ty: DeclarationId(2130), - }, - Field { - label: "ErrorBound".to_string(), - ty: DeclarationId(2131), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 28678, 29438), - }); - declarations.push(Declaration { - id: DeclarationId(1185), - name: Some("sum_bound".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(2091)], - output: DeclarationId(1184), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 29849, - 29955, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 29799, 29955), - }); - declarations.push(Declaration { - id: DeclarationId(1186), - name: Some("cost_bound_is_sum_bound".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1184)], - output: DeclarationId(124), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 30279, - 30532, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 30230, 30532), - }); - declarations.push(Declaration { - id: DeclarationId(1187), - name: Some("cost_bound_to_symbolic".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1184)], - output: DeclarationId(919), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(670))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 30969, 31486), - }); - declarations.push(Declaration { - id: DeclarationId(1188), - name: Some("atomic_cost_to_symbolic".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1183)], - output: DeclarationId(919), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(679))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 31488, 31808), - }); - declarations.push(Declaration { - id: DeclarationId(1189), - name: Some("product_atoms_to_symbolic".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(2092)], - output: DeclarationId(919), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 31882, - 31918, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 31810, 31918), - }); - declarations.push(Declaration { - id: DeclarationId(1190), - name: Some("product_term_to_symbolic".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(2093)], - output: DeclarationId(919), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(681))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 31920, 32029), - }); - declarations.push(Declaration { - id: DeclarationId(1191), - name: Some("sum_products_to_symbolic".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(2095)], - output: DeclarationId(919), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 32106, - 32141, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 32031, 32141), - }); - declarations.push(Declaration { - id: DeclarationId(1192), - name: Some("cost_constant".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(1184), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 32175, - 32192, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 32143, 32192), - }); - declarations.push(Declaration { - id: DeclarationId(1193), - name: Some("cost_linear".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227)], - output: DeclarationId(1184), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 32236, - 32320, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 32193, 32320), - }); - declarations.push(Declaration { - id: DeclarationId(1194), - name: Some("cost_poly".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227), DeclarationId(87)], - output: DeclarationId(1184), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 32375, - 32774, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 32321, 32774), - }); - declarations.push(Declaration { - id: DeclarationId(1195), - name: Some("cost_root".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227), DeclarationId(87)], - output: DeclarationId(1184), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 32824, - 33098, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 32775, 33098), - }); - declarations.push(Declaration { - id: DeclarationId(1196), - name: Some("cost_sqrt".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227)], - output: DeclarationId(1184), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 33140, - 33173, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 33099, 33173), - }); - declarations.push(Declaration { - id: DeclarationId(1197), - name: Some("cost_cbrt".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227)], - output: DeclarationId(1184), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 33215, - 33248, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 33174, 33248), - }); - declarations.push(Declaration { - id: DeclarationId(1198), - name: Some("cost_log".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227)], - output: DeclarationId(1184), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 33289, - 33339, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 33249, 33339), - }); - declarations.push(Declaration { - id: DeclarationId(1199), - name: Some("cost_nlogn".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227)], - output: DeclarationId(1184), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 33383, - 33501, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 33341, 33501), - }); - declarations.push(Declaration { - id: DeclarationId(1200), - name: Some("cost_graph_linear".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227), DeclarationId(227)], - output: DeclarationId(1184), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 33571, - 33747, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 33503, 33747), - }); - declarations.push(Declaration { - id: DeclarationId(1201), - name: Some("RecurrenceForm".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "param".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "branches".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "divisor".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "work_exponent".to_string(), - ty: DeclarationId(87), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 34904, 34995), - }); - declarations.push(Declaration { - id: DeclarationId(1202), - name: Some("int_add_checked".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87), DeclarationId(87)], - output: DeclarationId(2096), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 35586, - 35837, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 35543, 35837), - }); - declarations.push(Declaration { - id: DeclarationId(1203), - name: Some("int_mul_checked".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87), DeclarationId(87)], - output: DeclarationId(2097), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 35882, - 36671, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 35839, 36671), - }); - declarations.push(Declaration { - id: DeclarationId(1204), - name: Some("bounded_int_pow_exponent".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87)], - output: DeclarationId(2098), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 37131, - 37254, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 37087, 37254), - }); - declarations.push(Declaration { - id: DeclarationId(1205), - name: Some("int_pow_bounded".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87), DeclarationId(87)], - output: DeclarationId(2099), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 37606, - 38651, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 37558, 38651), - }); - declarations.push(Declaration { - id: DeclarationId(1206), - name: Some("ceil_log".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87), DeclarationId(87)], - output: DeclarationId(2100), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 38869, - 38984, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 38823, 38984), - }); - declarations.push(Declaration { - id: DeclarationId(1207), - name: Some("ceil_log_iter".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![ - DeclarationId(87), - DeclarationId(87), - DeclarationId(87), - DeclarationId(87), - ], - output: DeclarationId(2101), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 39141, - 39503, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 39070, 39503), - }); - declarations.push(Declaration { - id: DeclarationId(1208), - name: Some("master_theorem".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1201)], - output: DeclarationId(1184), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 39558, - 41595, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 39505, 41595), - }); - declarations.push(Declaration { - id: DeclarationId(1209), - name: Some("catamorphism_bound".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227), DeclarationId(87)], - output: DeclarationId(1184), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 41948, - 42106, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 41878, 42106), - }); - declarations.push(Declaration { - id: DeclarationId(1210), - name: Some("derive_bound".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![ - DeclarationId(227), - DeclarationId(87), - DeclarationId(973), - DeclarationId(87), - ], - output: DeclarationId(1184), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 42605, - 43629, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 42504, 43629), - }); - declarations.push(Declaration { - id: DeclarationId(1211), - name: Some("tree_traversal_bound".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(1184), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 43962, - 44019, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 43923, 44019), - }); - declarations.push(Declaration { - id: DeclarationId(1212), - name: Some("nested_iteration_bound".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(1184), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 44062, - 44120, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 44021, 44120), - }); - declarations.push(Declaration { - id: DeclarationId(1213), - name: Some("linear_scan_bound".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(1184), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 44220, - 44275, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 44184, 44275), - }); - declarations.push(Declaration { - id: DeclarationId(1214), - name: Some("binary_search_bound".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(1184), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 44472, - 44587, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 44434, 44587), - }); - declarations.push(Declaration { - id: DeclarationId(1215), - name: Some("mergesort_bound".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(1184), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 44667, - 44782, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 44633, 44782), - }); - declarations.push(Declaration { - id: DeclarationId(1216), - name: Some("karatsuba_bound".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(1184), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 44949, - 45068, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 44915, 45068), - }); - declarations.push(Declaration { - id: DeclarationId(1217), - name: Some("strassen_bound".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(1184), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 45233, - 45347, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 45200, 45347), - }); - declarations.push(Declaration { - id: DeclarationId(1218), - name: Some("trial_division_bound".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(1184), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 45464, - 45489, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 45425, 45489), - }); - declarations.push(Declaration { - id: DeclarationId(1219), - name: Some("cube_root_bound".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(1184), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 45524, - 45549, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 45490, 45549), - }); - declarations.push(Declaration { - id: DeclarationId(1220), - name: Some("kth_root_bound".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87)], - output: DeclarationId(1184), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 45631, - 45662, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 45592, 45662), - }); - declarations.push(Declaration { - id: DeclarationId(1221), - name: Some("bfs_dfs_bound".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(1184), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 45898, - 45949, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 45866, 45949), - }); - declarations.push(Declaration { - id: DeclarationId(1222), - name: Some("dijkstra_bound".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(1184), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 46040, - 46322, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 46007, 46322), - }); - declarations.push(Declaration { - id: DeclarationId(1223), - name: Some("bellman_ford_bound".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(1184), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 46425, - 46585, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 46388, 46585), - }); - declarations.push(Declaration { - id: DeclarationId(1224), - name: Some("floyd_warshall_bound".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(1184), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/induction.dag", - 46692, - 46730, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 46653, 46730), - }); - declarations.push(Declaration { - id: DeclarationId(1225), - name: Some("TokenKind".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "KwLet".to_string(), - ty: DeclarationId(2132), - }, - Field { - label: "KwIf".to_string(), - ty: DeclarationId(2133), - }, - Field { - label: "KwThen".to_string(), - ty: DeclarationId(2134), - }, - Field { - label: "KwElse".to_string(), - ty: DeclarationId(2135), - }, - Field { - label: "KwFn".to_string(), - ty: DeclarationId(2136), - }, - Field { - label: "KwType".to_string(), - ty: DeclarationId(2137), - }, - Field { - label: "KwModule".to_string(), - ty: DeclarationId(2138), - }, - Field { - label: "KwImport".to_string(), - ty: DeclarationId(2139), - }, - Field { - label: "KwMatch".to_string(), - ty: DeclarationId(2140), - }, - Field { - label: "KwData".to_string(), - ty: DeclarationId(2141), - }, - Field { - label: "KwWhere".to_string(), - ty: DeclarationId(2142), - }, - Field { - label: "KwTrue".to_string(), - ty: DeclarationId(2143), - }, - Field { - label: "KwFalse".to_string(), - ty: DeclarationId(2144), - }, - Field { - label: "Ident".to_string(), - ty: DeclarationId(2145), - }, - Field { - label: "IntLit".to_string(), - ty: DeclarationId(2146), - }, - Field { - label: "StringLit".to_string(), - ty: DeclarationId(2147), - }, - Field { - label: "Eq".to_string(), - ty: DeclarationId(2148), - }, - Field { - label: "EqEq".to_string(), - ty: DeclarationId(2149), - }, - Field { - label: "NotEq".to_string(), - ty: DeclarationId(2150), - }, - Field { - label: "Lt".to_string(), - ty: DeclarationId(2151), - }, - Field { - label: "Le".to_string(), - ty: DeclarationId(2152), - }, - Field { - label: "Gt".to_string(), - ty: DeclarationId(2153), - }, - Field { - label: "Ge".to_string(), - ty: DeclarationId(2154), - }, - Field { - label: "Plus".to_string(), - ty: DeclarationId(2155), - }, - Field { - label: "Minus".to_string(), - ty: DeclarationId(2156), - }, - Field { - label: "Star".to_string(), - ty: DeclarationId(2157), - }, - Field { - label: "Slash".to_string(), - ty: DeclarationId(2158), - }, - Field { - label: "AmpAmp".to_string(), - ty: DeclarationId(2159), - }, - Field { - label: "PipePipe".to_string(), - ty: DeclarationId(2160), - }, - Field { - label: "Colon".to_string(), - ty: DeclarationId(2161), - }, - Field { - label: "Arrow".to_string(), - ty: DeclarationId(2162), - }, - Field { - label: "FatArrow".to_string(), - ty: DeclarationId(2163), - }, - Field { - label: "PipeArrow".to_string(), - ty: DeclarationId(2164), - }, - Field { - label: "Dot".to_string(), - ty: DeclarationId(2165), - }, - Field { - label: "LParen".to_string(), - ty: DeclarationId(2166), - }, - Field { - label: "RParen".to_string(), - ty: DeclarationId(2167), - }, - Field { - label: "LBrace".to_string(), - ty: DeclarationId(2168), - }, - Field { - label: "RBrace".to_string(), - ty: DeclarationId(2169), - }, - Field { - label: "LBracket".to_string(), - ty: DeclarationId(2170), - }, - Field { - label: "RBracket".to_string(), - ty: DeclarationId(2171), - }, - Field { - label: "Comma".to_string(), - ty: DeclarationId(2172), - }, - Field { - label: "Semicolon".to_string(), - ty: DeclarationId(2173), - }, - Field { - label: "Pipe".to_string(), - ty: DeclarationId(2174), - }, - Field { - label: "Question".to_string(), - ty: DeclarationId(2175), - }, - Field { - label: "Caret".to_string(), - ty: DeclarationId(2176), - }, - Field { - label: "Eof".to_string(), - ty: DeclarationId(2177), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 627, 1230), - }); - declarations.push(Declaration { - id: DeclarationId(1226), - name: Some("Token".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "kind".to_string(), - ty: DeclarationId(1225), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1365, 1416), - }); - declarations.push(Declaration { - id: DeclarationId(1227), - name: Some("KeywordTokenKind".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "KwLet".to_string(), - ty: DeclarationId(2178), - }, - Field { - label: "KwIf".to_string(), - ty: DeclarationId(2179), - }, - Field { - label: "KwThen".to_string(), - ty: DeclarationId(2180), - }, - Field { - label: "KwElse".to_string(), - ty: DeclarationId(2181), - }, - Field { - label: "KwFn".to_string(), - ty: DeclarationId(2182), - }, - Field { - label: "KwType".to_string(), - ty: DeclarationId(2183), - }, - Field { - label: "KwModule".to_string(), - ty: DeclarationId(2184), - }, - Field { - label: "KwImport".to_string(), - ty: DeclarationId(2185), - }, - Field { - label: "KwMatch".to_string(), - ty: DeclarationId(2186), - }, - Field { - label: "KwData".to_string(), - ty: DeclarationId(2187), - }, - Field { - label: "KwWhere".to_string(), - ty: DeclarationId(2188), - }, - Field { - label: "KwTrue".to_string(), - ty: DeclarationId(2189), - }, - Field { - label: "KwFalse".to_string(), - ty: DeclarationId(2190), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1775, 1941), - }); - declarations.push(Declaration { - id: DeclarationId(1228), - name: Some("PunctTokenKind".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Eq".to_string(), - ty: DeclarationId(2191), - }, - Field { - label: "EqEq".to_string(), - ty: DeclarationId(2192), - }, - Field { - label: "NotEq".to_string(), - ty: DeclarationId(2193), - }, - Field { - label: "Lt".to_string(), - ty: DeclarationId(2194), - }, - Field { - label: "Le".to_string(), - ty: DeclarationId(2195), - }, - Field { - label: "Gt".to_string(), - ty: DeclarationId(2196), - }, - Field { - label: "Ge".to_string(), - ty: DeclarationId(2197), - }, - Field { - label: "Plus".to_string(), - ty: DeclarationId(2198), - }, - Field { - label: "Minus".to_string(), - ty: DeclarationId(2199), - }, - Field { - label: "Star".to_string(), - ty: DeclarationId(2200), - }, - Field { - label: "Slash".to_string(), - ty: DeclarationId(2201), - }, - Field { - label: "AmpAmp".to_string(), - ty: DeclarationId(2202), - }, - Field { - label: "PipePipe".to_string(), - ty: DeclarationId(2203), - }, - Field { - label: "Colon".to_string(), - ty: DeclarationId(2204), - }, - Field { - label: "Arrow".to_string(), - ty: DeclarationId(2205), - }, - Field { - label: "FatArrow".to_string(), - ty: DeclarationId(2206), - }, - Field { - label: "PipeArrow".to_string(), - ty: DeclarationId(2207), - }, - Field { - label: "Dot".to_string(), - ty: DeclarationId(2208), - }, - Field { - label: "LParen".to_string(), - ty: DeclarationId(2209), - }, - Field { - label: "RParen".to_string(), - ty: DeclarationId(2210), - }, - Field { - label: "LBrace".to_string(), - ty: DeclarationId(2211), - }, - Field { - label: "RBrace".to_string(), - ty: DeclarationId(2212), - }, - Field { - label: "LBracket".to_string(), - ty: DeclarationId(2213), - }, - Field { - label: "RBracket".to_string(), - ty: DeclarationId(2214), - }, - Field { - label: "Comma".to_string(), - ty: DeclarationId(2215), - }, - Field { - label: "Semicolon".to_string(), - ty: DeclarationId(2216), - }, - Field { - label: "Pipe".to_string(), - ty: DeclarationId(2217), - }, - Field { - label: "Question".to_string(), - ty: DeclarationId(2218), - }, - Field { - label: "Caret".to_string(), - ty: DeclarationId(2219), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2357, 2673), - }); - declarations.push(Declaration { - id: DeclarationId(1229), - name: Some("LocalPunctSpec".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "pattern".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "kind".to_string(), - ty: DeclarationId(1228), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2883, 2947), - }); - declarations.push(Declaration { - id: DeclarationId(1230), - name: Some("StringEscapeSpec".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "suffix".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "output_codepoint".to_string(), - ty: DeclarationId(87), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 3334, 3400), - }); - declarations.push(Declaration { - id: DeclarationId(1231), - name: Some("behavior_spine".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839)], - output: DeclarationId(2220), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(683))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/workflows.dag", 957, 1012), - }); - declarations.push(Declaration { - id: DeclarationId(1232), - name: Some("timing_lens_module_path_witness".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(154), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(685))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 1533, 1614), - }); - declarations.push(Declaration { - id: DeclarationId(1233), - name: Some("Nanoseconds".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "count".to_string(), - ty: DeclarationId(76), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 2075, 2108), - }); - declarations.push(Declaration { - id: DeclarationId(1234), - name: Some("TimingMeasurement".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Observed".to_string(), - ty: DeclarationId(2222), - }, - Field { - label: "Unobserved".to_string(), - ty: DeclarationId(2223), - }, - Field { - label: "Ambiguous".to_string(), - ty: DeclarationId(2224), - }, - Field { - label: "Stale".to_string(), - ty: DeclarationId(2225), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 4119, 4219), - }); - declarations.push(Declaration { - id: DeclarationId(1235), - name: Some("WorkflowObservationAnchor".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "subject_node".to_string(), - ty: DeclarationId(735), - }, - Field { - label: "artifact_digest".to_string(), - ty: DeclarationId(170), - }, - Field { - label: "producer_id".to_string(), - ty: DeclarationId(171), - }, - Field { - label: "observer_id".to_string(), - ty: DeclarationId(172), - }, - Field { - label: "prover_id".to_string(), - ty: DeclarationId(173), - }, - Field { - label: "attached_at_ns".to_string(), - ty: DeclarationId(1233), - }, - Field { - label: "workflow_run_id".to_string(), - ty: DeclarationId(174), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 5680, 5929), - }); - declarations.push(Declaration { - id: DeclarationId(1236), - name: Some("FileAttachment".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "subject_node".to_string(), - ty: DeclarationId(735), - }, - Field { - label: "content_digest".to_string(), - ty: DeclarationId(170), - }, - Field { - label: "producer_id".to_string(), - ty: DeclarationId(171), - }, - Field { - label: "workflow_run_id".to_string(), - ty: DeclarationId(174), - }, - Field { - label: "attached_at_ns".to_string(), - ty: DeclarationId(1233), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 6688, 6861), - }); - declarations.push(Declaration { - id: DeclarationId(1237), - name: Some("gate_62_file_attachment_demo_record".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![ - DeclarationId(735), - DeclarationId(170), - DeclarationId(171), - DeclarationId(174), - DeclarationId(1233), - ], - output: DeclarationId(1236), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(687))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 7262, 7589), - }); - declarations.push(Declaration { - id: DeclarationId(1238), - name: Some("TimingObservationSet".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "observations".to_string(), - ty: DeclarationId(2226), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 7673, 7747), - }); - declarations.push(Declaration { - id: DeclarationId(1239), - name: Some("TimingObservationEntry".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "anchor".to_string(), - ty: DeclarationId(1235), - }, - Field { - label: "measurement".to_string(), - ty: DeclarationId(1234), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 7749, 7849), - }); - declarations.push(Declaration { - id: DeclarationId(1240), - name: Some("TimingBudget".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "max".to_string(), - ty: DeclarationId(1233), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 7987, 8027), - }); - declarations.push(Declaration { - id: DeclarationId(1241), - name: Some("TimingEnforcementProjected".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "TimedUsage".to_string(), - ty: DeclarationId(2227), - }, - Field { - label: "NonEvidenceUsage".to_string(), - ty: DeclarationId(2228), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 9193, 9281), - }); - declarations.push(Declaration { - id: DeclarationId(1242), - name: Some("TimingLens".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1097), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1098), - value: DeclarationId(1234), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 9537, 9578), - }); - declarations.push(Declaration { - id: DeclarationId(1243), - name: Some("timing_measurement_unobserved".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(1234), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(689))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 9580, 9650), - }); - declarations.push(Declaration { - id: DeclarationId(1244), - name: Some("timing_measurement_lens_combine".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1234), DeclarationId(1234), DeclarationId(124)], - output: DeclarationId(1234), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(721))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 9808, 10700), - }); - declarations.push(Declaration { - id: DeclarationId(1245), - name: Some("timing_sequential_op".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1234), DeclarationId(1234)], - output: DeclarationId(1234), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(724))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10775, 10911), - }); - declarations.push(Declaration { - id: DeclarationId(1246), - name: Some("nanoseconds_zero".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(1233), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(727))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10913, 10966), - }); - declarations.push(Declaration { - id: DeclarationId(1247), - name: Some("timing_sequential_identity".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(1234), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(730))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 10968, 11066), - }); - declarations.push(Declaration { - id: DeclarationId(1248), - name: Some("timing_branch_op".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1234), DeclarationId(1234)], - output: DeclarationId(1234), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(733))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 11126, 11259), - }); - declarations.push(Declaration { - id: DeclarationId(1249), - name: Some("timing_lens_correction_retirement_plan".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(1050), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(737))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 11798, 12111), - }); - declarations.push(Declaration { - id: DeclarationId(1250), - name: Some("timing_lens_deferred_correction".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(1051), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(741))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 12113, 12332), - }); - declarations.push(Declaration { - id: DeclarationId(1251), - name: Some("timing_lens_behavior_span".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(838)], - output: DeclarationId(155), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(748))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 12515, 12714), - }); - declarations.push(Declaration { - id: DeclarationId(1252), - name: Some("timing_lens_scaffold_non_evidence_diagnostic".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227), DeclarationId(155)], - output: DeclarationId(1055), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(753))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 12961, 13180), - }); - declarations.push(Declaration { - id: DeclarationId(1253), - name: Some("timing_lens_degenerate_empty_dag_span".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(155), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(758))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 13414, 13548), - }); - declarations.push(Declaration { - id: DeclarationId(1254), - name: Some("timing_lens_validate_non_observed".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839), DeclarationId(227)], - output: DeclarationId(1060), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(774))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 14010, 14715), - }); - declarations.push(Declaration { - id: DeclarationId(1255), - name: Some("timing_measurement_iterate".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1234), DeclarationId(829)], - output: DeclarationId(1234), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(783))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 15040, 15401), - }); - declarations.push(Declaration { - id: DeclarationId(1256), - name: Some("timing_lens_read".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839), DeclarationId(838)], - output: DeclarationId(2221), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(820))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16178, 17004), - }); - declarations.push(Declaration { - id: DeclarationId(1257), - name: Some("timing_lens_validate".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839), DeclarationId(1234)], - output: DeclarationId(1060), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(834))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 17006, 17851), - }); - declarations.push(Declaration { - id: DeclarationId(1258), - name: Some("timing_enforcement_fault_sentinel_count".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(76), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(836))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 18961, 19035), - }); - declarations.push(Declaration { - id: DeclarationId(1259), - name: Some("timing_enforcement_project".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1234)], - output: DeclarationId(1241), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(843))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19037, 19289), - }); - declarations.push(Declaration { - id: DeclarationId(1260), - name: Some("timing_enforcement_violates".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1234), DeclarationId(1240)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(866))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19291, 19556), - }); - declarations.push(Declaration { - id: DeclarationId(1261), - name: Some("timing_lens_monoid".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(19), - arguments: vec![TemplateArgument { - parameter: DeclarationId(20), - value: DeclarationId(1234), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(2229)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ("op".to_string(), FieldValue::Reference(DeclarationId(1245))), - ( - "identity".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2222), - payload: vec![FieldValue::Record(vec![( - "count".to_string(), - FieldValue::Literal(LiteralBits::Int("0".to_string())), - )])], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19558, 19689), - }); - declarations.push(Declaration { - id: DeclarationId(1262), - name: Some("timing_lens".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1242), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1242)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("timing".to_string())), - ), - ( - "read".to_string(), - FieldValue::Reference(DeclarationId(1256)), - ), - ( - "sequential".to_string(), - FieldValue::Reference(DeclarationId(1261)), - ), - ( - "branch".to_string(), - FieldValue::Reference(DeclarationId(1248)), - ), - ( - "iterate".to_string(), - FieldValue::Reference(DeclarationId(1255)), - ), - ( - "validate".to_string(), - FieldValue::Reference(DeclarationId(1257)), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19691, 19898), - }); - declarations.push(Declaration { - id: DeclarationId(1263), - name: Some("timing_enforcement".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1101), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(1102), - value: DeclarationId(1234), - }, - TemplateArgument { - parameter: DeclarationId(1103), - value: DeclarationId(1240), - }, - TemplateArgument { - parameter: DeclarationId(1104), - value: DeclarationId(1241), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(2230)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "project".to_string(), - FieldValue::Reference(DeclarationId(1259)), - ), - ( - "violates".to_string(), - FieldValue::Reference(DeclarationId(1260)), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19900, 20085), - }); - declarations.push(Declaration { - id: DeclarationId(1264), - name: Some("timing_enforceable".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1105), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(1106), - value: DeclarationId(1234), - }, - TemplateArgument { - parameter: DeclarationId(1107), - value: DeclarationId(1240), - }, - TemplateArgument { - parameter: DeclarationId(1108), - value: DeclarationId(1241), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(2231)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "lens".to_string(), - FieldValue::Reference(DeclarationId(1262)), - ), - ( - "enforcement".to_string(), - FieldValue::Reference(DeclarationId(1263)), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 20087, 20248), - }); - declarations.push(Declaration { - id: DeclarationId(1265), - name: Some("modeled_gunbc_ci_workflow".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1400), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1400)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Unparsed(SourceSpan::new( - "src/v3/std/t_ci_workflow_as_data_demo.dag", - 1440, - 2696, - ))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 1397, 2696), - }); - declarations.push(Declaration { - id: DeclarationId(1266), - name: Some("ci_demo_timing_read".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839), DeclarationId(838)], - output: DeclarationId(2242), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(908))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3209, 4468), - }); - declarations.push(Declaration { - id: DeclarationId(1267), - name: Some("ci_wad_modeled_workflow_timing_witness".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839), DeclarationId(838)], - output: DeclarationId(2243), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(910))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 4762, 4884), - }); - declarations.push(Declaration { - id: DeclarationId(1268), - name: Some("_ci_wad_seed_list_declaration_empty".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(2244), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(912))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5078, 5147), - }); - declarations.push(Declaration { - id: DeclarationId(1269), - name: Some("_ci_wad_seed_list_behavior_empty".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(2245), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(914))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5149, 5212), - }); - declarations.push(Declaration { - id: DeclarationId(1270), - name: Some("_ci_wad_seed_list_dagport_empty".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(2246), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(916))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5214, 5275), - }); - declarations.push(Declaration { - id: DeclarationId(1271), - name: Some("_ci_wad_seed_list_cluster_empty".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(2247), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(918))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5277, 5338), - }); - declarations.push(Declaration { - id: DeclarationId(1272), - name: Some("_ci_wad_empty_list_diagnostic".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(2248), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(920))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5340, 5402), - }); - declarations.push(Declaration { - id: DeclarationId(1273), - name: Some("_ci_wad_empty_list_witness_tm".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(2250), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(922))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5404, 5482), - }); - declarations.push(Declaration { - id: DeclarationId(1274), - name: Some("_ci_wad_witnesses_singleton_tm".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1234)], - output: DeclarationId(2252), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(926))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5484, 5645), - }); - declarations.push(Declaration { - id: DeclarationId(1275), - name: Some("_ci_wad_violations_singleton".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1055)], - output: DeclarationId(2253), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(929))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5647, 5779), - }); - declarations.push(Declaration { - id: DeclarationId(1276), - name: Some("_ci_wad_dimension_ok_tm_payload".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1234)], - output: DeclarationId(2254), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(933))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5781, 6005), - }); - declarations.push(Declaration { - id: DeclarationId(1277), - name: Some("_ci_wad_dimension_fail_tm_payload".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1234), DeclarationId(1055)], - output: DeclarationId(2255), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(938))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 6007, 6288), - }); - declarations.push(Declaration { - id: DeclarationId(1278), - name: Some("report_dim_ok_tm".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839), DeclarationId(1234)], - output: DeclarationId(2256), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(945))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 6553, 6792), - }); - declarations.push(Declaration { - id: DeclarationId(1279), - name: Some("report_dim_fail_tm".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839), DeclarationId(1234), DeclarationId(1055)], - output: DeclarationId(2257), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(952))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 6794, 7069), - }); - declarations.push(Declaration { - id: DeclarationId(1280), - name: Some("report_inhabits_branch_tm".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839), DeclarationId(1234), DeclarationId(1060)], - output: DeclarationId(2258), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(957))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7071, 7322), - }); - declarations.push(Declaration { - id: DeclarationId(1281), - name: Some("dimension_report_tm_from_witness".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839), DeclarationId(2259)], - output: DeclarationId(2260), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(978))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7324, 8325), - }); - declarations.push(Declaration { - id: DeclarationId(1282), - name: Some("demo_ci_modeled_timing_dimension_report".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839), DeclarationId(838)], - output: DeclarationId(2261), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(986))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 9186, 9487), - }); - declarations.push(Declaration { - id: DeclarationId(1283), - name: Some("gate_58_ci_workflow_timing_row".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "workflow".to_string(), - ty: DeclarationId(1400), - }, - Field { - label: "measurement".to_string(), - ty: DeclarationId(1234), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 10675, 10768), - }); - declarations.push(Declaration { - id: DeclarationId(1284), - name: Some("gate_58_modeled_ci_timing_measurement".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1283), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1283)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "workflow".to_string(), - FieldValue::Reference(DeclarationId(1265)), - ), - ( - "measurement".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2222), - payload: vec![FieldValue::Record(vec![( - "count".to_string(), - FieldValue::Literal(LiteralBits::Int("0".to_string())), - )])], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 10770, 10939), - }); - declarations.push(Declaration { - id: DeclarationId(1285), - name: Some("gate_58_apply_lens_self_application_pass".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1109), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(1110), - value: DeclarationId(1234), - }, - TemplateArgument { - parameter: DeclarationId(1111), - value: DeclarationId(1240), - }, - TemplateArgument { - parameter: DeclarationId(1112), - value: DeclarationId(1241), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(2262)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "enforceable_lens".to_string(), - FieldValue::Reference(DeclarationId(1264)), - ), - ( - "section".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2031), - payload: vec![FieldValue::Reference(DeclarationId(1284))], - }, - ), - ( - "budget".to_string(), - FieldValue::Record(vec![( - "max".to_string(), - FieldValue::Record(vec![( - "count".to_string(), - FieldValue::Literal(LiteralBits::Int("1000000000".to_string())), - )]), - )]), - ), - ( - "diagnostic_severity".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2033), - payload: vec![], - }, - ), - ( - "span".to_string(), - FieldValue::Record(vec![ - ( - "file".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/std/t_ci_workflow_as_data_demo.dag".to_string(), - )), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("0".to_string())), - ), - ( - "end".to_string(), - FieldValue::Literal(LiteralBits::Int("0".to_string())), - ), - ]), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 11199, 11604), - }); - declarations.push(Declaration { - id: DeclarationId(1286), - name: Some("Path".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(154), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 1402, 1422), - }); - declarations.push(Declaration { - id: DeclarationId(1287), - name: Some("SnapshotRef".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(147), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 1423, 1453), - }); - declarations.push(Declaration { - id: DeclarationId(1288), - name: Some("GeneratedManifestEntry".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "PendingFact".to_string(), - ty: DeclarationId(2287), - }, - Field { - label: "ResolvedFact".to_string(), - ty: DeclarationId(2288), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 2584, 2762), - }); - declarations.push(Declaration { - id: DeclarationId(1289), - name: Some("CensusListConstant".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 2969, 2995), - }); - declarations.push(Declaration { - id: DeclarationId(1290), - name: Some("expected_hand_authored_non_test".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1289), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1289)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { fields: vec![] }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 2997, 3058), - }); - declarations.push(Declaration { - id: DeclarationId(1291), - name: Some("expected_hand_authored_test".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1289), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1289)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { fields: vec![] }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 3059, 3116), - }); - declarations.push(Declaration { - id: DeclarationId(1292), - name: Some("expected_hand_authored_fragments".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1289), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1289)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { fields: vec![] }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 3117, 3179), - }); - declarations.push(Declaration { - id: DeclarationId(1293), - name: Some("LensProducerFilesSubsetPredicate".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 3311, 3351), - }); - declarations.push(Declaration { - id: DeclarationId(1294), - name: Some("lens_producer_files_subset_predicate".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1293), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1293)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { fields: vec![] }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 3353, 3433), - }); - declarations.push(Declaration { - id: DeclarationId(1295), - name: Some("BinShimFilesSubsetPredicate".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 3540, 3575), - }); - declarations.push(Declaration { - id: DeclarationId(1296), - name: Some("bin_shim_files_subset_predicate".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1295), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1295)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { fields: vec![] }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 3577, 3647), - }); - declarations.push(Declaration { - id: DeclarationId(1297), - name: Some("CompilerStdPositiveSetRatchet".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 3726, 3763), - }); - declarations.push(Declaration { - id: DeclarationId(1298), - name: Some("compiler_std_positive_set_ratchet".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1297), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1297)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { fields: vec![] }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 3765, 3839), - }); - declarations.push(Declaration { - id: DeclarationId(1299), - name: Some("DiagnosticKind".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "TokenizerError".to_string(), - ty: DeclarationId(2289), - }, - Field { - label: "ParseError".to_string(), - ty: DeclarationId(2290), - }, - Field { - label: "TypeMismatch".to_string(), - ty: DeclarationId(2291), - }, - Field { - label: "ArityMismatch".to_string(), - ty: DeclarationId(2292), - }, - Field { - label: "ResolveError".to_string(), - ty: DeclarationId(2293), - }, - Field { - label: "UnitMismatch".to_string(), - ty: DeclarationId(2294), - }, - Field { - label: "BranchConditionNotBool".to_string(), - ty: DeclarationId(2295), - }, - Field { - label: "MagnitudeOutOfRange".to_string(), - ty: DeclarationId(2296), - }, - Field { - label: "MalformedIntegerRangeFact".to_string(), - ty: DeclarationId(2297), - }, - Field { - label: "NominalOpacityViolation".to_string(), - ty: DeclarationId(2298), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 4174, 4405), - }); - declarations.push(Declaration { - id: DeclarationId(1300), - name: Some("DiagnosticDetailExpectation".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "AnyDetail".to_string(), - ty: DeclarationId(2299), - }, - Field { - label: "Contains".to_string(), - ty: DeclarationId(2300), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 4774, 4841), - }); - declarations.push(Declaration { - id: DeclarationId(1301), - name: Some("DiagnosticReference".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "kind".to_string(), - ty: DeclarationId(1299), - }, - Field { - label: "detail_contains".to_string(), - ty: DeclarationId(1300), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 4985, 5083), - }); - declarations.push(Declaration { - id: DeclarationId(1302), - name: Some("PortStateExpectation".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Resolved".to_string(), - ty: DeclarationId(2301), - }, - Field { - label: "Unresolved".to_string(), - ty: DeclarationId(2302), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 5470, 5523), - }); - declarations.push(Declaration { - id: DeclarationId(1303), - name: Some("PerfBudgetComparisonOp".to_string()), - connective: TypeConnective::Disj { - variants: vec![Field { - label: "AtMostBudget".to_string(), - ty: DeclarationId(2303), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 5716, 5760), - }); - declarations.push(Declaration { - id: DeclarationId(1304), - name: Some("AlgebraicLawKind".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Associativity".to_string(), - ty: DeclarationId(2304), - }, - Field { - label: "Commutativity".to_string(), - ty: DeclarationId(2305), - }, - Field { - label: "Identity".to_string(), - ty: DeclarationId(2306), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 6549, 6619), - }); - declarations.push(Declaration { - id: DeclarationId(1305), - name: Some("ProgramGenerator".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "generator".to_string(), - ty: DeclarationId(1337), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 6856, 6909), - }); - declarations.push(Declaration { - id: DeclarationId(1306), - name: Some("ProgramShape".to_string()), - connective: TypeConnective::Disj { - variants: vec![Field { - label: "LiteralProgram".to_string(), - ty: DeclarationId(2307), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 7142, 7231), - }); - declarations.push(Declaration { - id: DeclarationId(1307), - name: Some("SymbolicCostBindParamExpected".to_string()), - connective: TypeConnective::Disj { - variants: vec![Field { - label: "LinearCostForBindParam".to_string(), - ty: DeclarationId(2308), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 7233, 7325), - }); - declarations.push(Declaration { - id: DeclarationId(1308), - name: Some("BindParamSizeVariable".to_string()), - connective: TypeConnective::Disj { - variants: vec![Field { - label: "SelectedBindParamSizeVariable".to_string(), - ty: DeclarationId(2309), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 7327, 7387), - }); - declarations.push(Declaration { - id: DeclarationId(1309), - name: Some("BindParamRef".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "index".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 7389, 7423), - }); - declarations.push(Declaration { - id: DeclarationId(1310), - name: Some("LensCapabilityStructuralStatus".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "LensCapabilityStructuralTerminal".to_string(), - ty: DeclarationId(2310), - }, - Field { - label: "LensCapabilityStructuralPartial".to_string(), - ty: DeclarationId(2311), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 7949, 8057), - }); - declarations.push(Declaration { - id: DeclarationId(1311), - name: Some("LensCapabilityBehavioralStatus".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "LensCapabilityBehavioralComplete".to_string(), - ty: DeclarationId(2312), - }, - Field { - label: "LensCapabilityBehavioralPartial".to_string(), - ty: DeclarationId(2313), - }, - Field { - label: "LensCapabilityBehavioralStub".to_string(), - ty: DeclarationId(2314), - }, - Field { - label: "LensCapabilityBehavioralNA".to_string(), - ty: DeclarationId(2315), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 8059, 8231), - }); - declarations.push(Declaration { - id: DeclarationId(1312), - name: Some("LensCapabilityV2Counterpart".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "LensCapabilityV2RealV2".to_string(), - ty: DeclarationId(2316), - }, - Field { - label: "LensCapabilityV2NoneV3Native".to_string(), - ty: DeclarationId(2317), - }, - Field { - label: "LensCapabilityV2NotApplicable".to_string(), - ty: DeclarationId(2318), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 8233, 8359), - }); - declarations.push(Declaration { - id: DeclarationId(1313), - name: Some("LensCapabilityRegisterRow".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "lens_basename".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "structural".to_string(), - ty: DeclarationId(1310), - }, - Field { - label: "behavioral".to_string(), - ty: DeclarationId(1311), - }, - Field { - label: "v2_counterpart".to_string(), - ty: DeclarationId(1312), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 8361, 8555), - }); - declarations.push(Declaration { - id: DeclarationId(1314), - name: Some("lens_capability_register_rows".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1313), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(2358)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::List(vec![ - FieldValue::Record(vec![ - ( - "lens_basename".to_string(), - FieldValue::Literal(LiteralBits::String("complexity.dag".to_string())), - ), - ( - "structural".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2310), - payload: vec![], - }, - ), - ( - "behavioral".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2312), - payload: vec![], - }, - ), - ( - "v2_counterpart".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2316), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "lens_basename".to_string(), - FieldValue::Literal(LiteralBits::String("cost.dag".to_string())), - ), - ( - "structural".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2310), - payload: vec![], - }, - ), - ( - "behavioral".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2312), - payload: vec![], - }, - ), - ( - "v2_counterpart".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2316), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "lens_basename".to_string(), - FieldValue::Literal(LiteralBits::String( - "cost_target_realization.dag".to_string(), - )), - ), - ( - "structural".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2310), - payload: vec![], - }, - ), - ( - "behavioral".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2315), - payload: vec![], - }, - ), - ( - "v2_counterpart".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2317), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "lens_basename".to_string(), - FieldValue::Literal(LiteralBits::String( - "effect_enumeration.dag".to_string(), - )), - ), - ( - "structural".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2310), - payload: vec![], - }, - ), - ( - "behavioral".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2312), - payload: vec![], - }, - ), - ( - "v2_counterpart".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2317), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "lens_basename".to_string(), - FieldValue::Literal(LiteralBits::String("idempotency.dag".to_string())), - ), - ( - "structural".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2310), - payload: vec![], - }, - ), - ( - "behavioral".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2312), - payload: vec![], - }, - ), - ( - "v2_counterpart".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2317), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "lens_basename".to_string(), - FieldValue::Literal(LiteralBits::String("parallelism.dag".to_string())), - ), - ( - "structural".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2310), - payload: vec![], - }, - ), - ( - "behavioral".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2312), - payload: vec![], - }, - ), - ( - "v2_counterpart".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2317), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "lens_basename".to_string(), - FieldValue::Literal(LiteralBits::String("provenance.dag".to_string())), - ), - ( - "structural".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2310), - payload: vec![], - }, - ), - ( - "behavioral".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2312), - payload: vec![], - }, - ), - ( - "v2_counterpart".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2317), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "lens_basename".to_string(), - FieldValue::Literal(LiteralBits::String( - "unused_parameters.dag".to_string(), - )), - ), - ( - "structural".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2310), - payload: vec![], - }, - ), - ( - "behavioral".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2312), - payload: vec![], - }, - ), - ( - "v2_counterpart".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2317), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "lens_basename".to_string(), - FieldValue::Literal(LiteralBits::String("variant_payload.dag".to_string())), - ), - ( - "structural".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2310), - payload: vec![], - }, - ), - ( - "behavioral".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2312), - payload: vec![], - }, - ), - ( - "v2_counterpart".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2317), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "lens_basename".to_string(), - FieldValue::Literal(LiteralBits::String( - "structural_resolution.dag".to_string(), - )), - ), - ( - "structural".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2310), - payload: vec![], - }, - ), - ( - "behavioral".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2312), - payload: vec![], - }, - ), - ( - "v2_counterpart".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2317), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "lens_basename".to_string(), - FieldValue::Literal(LiteralBits::String("infer_helpers.dag".to_string())), - ), - ( - "structural".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2311), - payload: vec![], - }, - ), - ( - "behavioral".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2315), - payload: vec![], - }, - ), - ( - "v2_counterpart".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2318), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "lens_basename".to_string(), - FieldValue::Literal(LiteralBits::String("lower_helpers.dag".to_string())), - ), - ( - "structural".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2311), - payload: vec![], - }, - ), - ( - "behavioral".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2315), - payload: vec![], - }, - ), - ( - "v2_counterpart".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2318), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "lens_basename".to_string(), - FieldValue::Literal(LiteralBits::String( - "named_function_count.dag".to_string(), - )), - ), - ( - "structural".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2310), - payload: vec![], - }, - ), - ( - "behavioral".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2315), - payload: vec![], - }, - ), - ( - "v2_counterpart".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2318), - payload: vec![], - }, - ), - ]), - ])), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 8557, 11146), - }); - declarations.push(Declaration { - id: DeclarationId(1315), - name: Some("TestPredicate".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Compiles".to_string(), - ty: DeclarationId(2319), - }, - Field { - label: "FailsWithDiagnostic".to_string(), - ty: DeclarationId(2320), - }, - Field { - label: "OutputEquals".to_string(), - ty: DeclarationId(2321), - }, - Field { - label: "PortHasState".to_string(), - ty: DeclarationId(2322), - }, - Field { - label: "DeclarationHasRefinement".to_string(), - ty: DeclarationId(2323), - }, - Field { - label: "CostBounded".to_string(), - ty: DeclarationId(2324), - }, - Field { - label: "BehavioralObservation".to_string(), - ty: DeclarationId(2325), - }, - Field { - label: "MockBackedInvariant".to_string(), - ty: DeclarationId(2326), - }, - Field { - label: "ExecuteCommand".to_string(), - ty: DeclarationId(2328), - }, - Field { - label: "ForAllTargets".to_string(), - ty: DeclarationId(2330), - }, - Field { - label: "LensOutputEquals".to_string(), - ty: DeclarationId(2331), - }, - Field { - label: "DifferentialEquals".to_string(), - ty: DeclarationId(2332), - }, - Field { - label: "SymbolicCostExprEquals".to_string(), - ty: DeclarationId(2333), - }, - Field { - label: "SymbolicCostExprEqualsForBindParam".to_string(), - ty: DeclarationId(2334), - }, - Field { - label: "PerfWithinBaseline".to_string(), - ty: DeclarationId(2335), - }, - Field { - label: "BinaryDimensionReportEquals".to_string(), - ty: DeclarationId(2336), - }, - Field { - label: "AlgebraicLaw".to_string(), - ty: DeclarationId(2337), - }, - Field { - label: "CensusBoundCheck".to_string(), - ty: DeclarationId(2338), - }, - Field { - label: "CensusSubsetCount".to_string(), - ty: DeclarationId(2339), - }, - Field { - label: "FixedPointConverges".to_string(), - ty: DeclarationId(2340), - }, - Field { - label: "RatchetZero".to_string(), - ty: DeclarationId(2341), - }, - Field { - label: "GeneratedFromDag".to_string(), - ty: DeclarationId(2343), - }, - Field { - label: "CementingDispatchMatchesProjection".to_string(), - ty: DeclarationId(2344), - }, - Field { - label: "ReleaseDeferredClaim".to_string(), - ty: DeclarationId(2345), - }, - Field { - label: "SubstrateResearchDeferredClaim".to_string(), - ty: DeclarationId(2346), - }, - Field { - label: "BridgeLedgerZero".to_string(), - ty: DeclarationId(2347), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 11148, 25196), - }); - declarations.push(Declaration { - id: DeclarationId(1316), - name: Some("ProgramInput".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 25304, 25324), - }); - declarations.push(Declaration { - id: DeclarationId(1317), - name: Some("ProgramOutputBind".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "output_ref".to_string(), - ty: DeclarationId(1337), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 25467, 25522), - }); - declarations.push(Declaration { - id: DeclarationId(1318), - name: Some("TestClaim".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "source".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "file_name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "predicate".to_string(), - ty: DeclarationId(1315), - }, - Field { - label: "requires".to_string(), - ty: DeclarationId(2348), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 26132, 26265), - }); - declarations.push(Declaration { - id: DeclarationId(1319), - name: Some("Quantifier".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ForAll".to_string(), - ty: DeclarationId(2349), - }, - Field { - label: "Exists".to_string(), - ty: DeclarationId(2350), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 26446, 26483), - }); - declarations.push(Declaration { - id: DeclarationId(1320), - name: Some("QuantifiedTestClaim".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "generator".to_string(), - ty: DeclarationId(1305), - }, - Field { - label: "quantifier".to_string(), - ty: DeclarationId(1319), - }, - Field { - label: "predicate".to_string(), - ty: DeclarationId(1315), - }, - Field { - label: "requires".to_string(), - ty: DeclarationId(2351), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 26485, 26646), - }); - declarations.push(Declaration { - id: DeclarationId(1321), - name: Some("TestNodeRef".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "EnumeratedTestNode".to_string(), - ty: DeclarationId(2352), - }, - Field { - label: "QuantifiedTestNode".to_string(), - ty: DeclarationId(2353), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 28627, 28721), - }); - declarations.push(Declaration { - id: DeclarationId(1322), - name: Some("TestNodeCostDimension".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "node".to_string(), - ty: DeclarationId(1321), - }, - Field { - label: "budget".to_string(), - ty: DeclarationId(1240), - }, - Field { - label: "measured".to_string(), - ty: DeclarationId(1234), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 28723, 28826), - }); - declarations.push(Declaration { - id: DeclarationId(1323), - name: Some("SuiteClaim".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Enumerated".to_string(), - ty: DeclarationId(2354), - }, - Field { - label: "Quantified".to_string(), - ty: DeclarationId(2355), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 29559, 29636), - }); - declarations.push(Declaration { - id: DeclarationId(1324), - name: Some("TestSuite".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "claims".to_string(), - ty: DeclarationId(2356), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 29638, 29698), - }); - declarations.push(Declaration { - id: DeclarationId(1325), - name: Some("TestObligation".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "claim_name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "resources".to_string(), - ty: DeclarationId(2357), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 29896, 29977), - }); - declarations.push(Declaration { - id: DeclarationId(1326), - name: Some("claim_obligation_resources".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1318)], - output: DeclarationId(2284), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/verification.dag", - 30419, - 30435, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 30348, 30435), - }); - declarations.push(Declaration { - id: DeclarationId(1327), - name: Some("obligation_for_claim".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1318)], - output: DeclarationId(1325), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/verification.dag", - 30493, - 30578, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 30437, 30578), - }); - declarations.push(Declaration { - id: DeclarationId(1328), - name: Some("obligation_for_quantified_claim".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1320)], - output: DeclarationId(1325), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/verification.dag", - 30885, - 30951, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 30808, 30951), - }); - declarations.push(Declaration { - id: DeclarationId(1329), - name: Some("obligation_for_suite_claim".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1323)], - output: DeclarationId(1325), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(990))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 31256, 31445), - }); - declarations.push(Declaration { - id: DeclarationId(1330), - name: Some("materialize_test_obligations".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(2285)], - output: DeclarationId(2286), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/std/verification.dag", - 31529, - 31574, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 31447, 31574), - }); - declarations.push(Declaration { - id: DeclarationId(1331), - name: Some("ValueBehavior".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/v3_l1.dag", 2935, 2956), - }); - declarations.push(Declaration { - id: DeclarationId(1332), - name: Some("Transform".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/v3_l1.dag", 2957, 2974), - }); - declarations.push(Declaration { - id: DeclarationId(1333), - name: Some("Branch".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/v3_l1.dag", 2975, 2989), - }); - declarations.push(Declaration { - id: DeclarationId(1334), - name: Some("Loop".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/v3_l1.dag", 2990, 3002), - }); - declarations.push(Declaration { - id: DeclarationId(1335), - name: Some("Bind".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/v3_l1.dag", 3003, 3015), - }); - declarations.push(Declaration { - id: DeclarationId(1336), - name: Some("Main".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/v3_l1.dag", 3016, 3028), - }); - declarations.push(Declaration { - id: DeclarationId(1337), - name: Some("DeclarationRef".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/spec/v3_l1.dag", 3761, 3783), - }); - declarations.push(Declaration { - id: DeclarationId(1338), - name: Some("CompilerHostRealization".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "symbol".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/pipeline.dag", 453, 502), - }); - declarations.push(Declaration { - id: DeclarationId(1339), - name: Some("PipelineSnapshotKind".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "SnapshotSurface".to_string(), - ty: DeclarationId(2359), - }, - Field { - label: "SnapshotDag".to_string(), - ty: DeclarationId(2360), - }, - Field { - label: "SnapshotText".to_string(), - ty: DeclarationId(2361), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/pipeline.dag", 504, 576), - }); - declarations.push(Declaration { - id: DeclarationId(1340), - name: Some("PipelineStageBinding".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "stage".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "realization".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "snapshot".to_string(), - ty: DeclarationId(1339), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/pipeline.dag", 578, 694), - }); - declarations.push(Declaration { - id: DeclarationId(1341), - name: Some("parse_realization".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "symbol".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1338)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "symbol".to_string(), - FieldValue::Literal(LiteralBits::String("v3_compiler::parse".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/pipeline.dag", 696, 780), - }); - declarations.push(Declaration { - id: DeclarationId(1342), - name: Some("lower_realization".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "symbol".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1338)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "symbol".to_string(), - FieldValue::Literal(LiteralBits::String("v3_compiler::lower".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/pipeline.dag", 782, 866), - }); - declarations.push(Declaration { - id: DeclarationId(1343), - name: Some("infer_realization".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "symbol".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1338)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "symbol".to_string(), - FieldValue::Literal(LiteralBits::String("v3_compiler::infer".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/pipeline.dag", 868, 952), - }); - declarations.push(Declaration { - id: DeclarationId(1344), - name: Some("compute_ownership_realization".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "symbol".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1338)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "symbol".to_string(), - FieldValue::Literal(LiteralBits::String( - "v3_compiler::compute_ownership".to_string(), - )), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/pipeline.dag", 954, 1062), - }); - declarations.push(Declaration { - id: DeclarationId(1345), - name: Some("emit_realization".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "symbol".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1338)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "symbol".to_string(), - FieldValue::Literal(LiteralBits::String("v3_compiler::emit".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/pipeline.dag", 1064, 1146), - }); - declarations.push(Declaration { - id: DeclarationId(1346), - name: Some("lens_complexity_realization".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "symbol".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1338)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "symbol".to_string(), - FieldValue::Literal(LiteralBits::String( - "v3_compiler::lens_complexity".to_string(), - )), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/pipeline.dag", 1148, 1252), - }); - declarations.push(Declaration { - id: DeclarationId(1347), - name: Some("parse_stage_binding".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1340), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1340)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "stage".to_string(), - FieldValue::Reference(DeclarationId(1353)), - ), - ( - "realization".to_string(), - FieldValue::Reference(DeclarationId(1341)), - ), - ( - "snapshot".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2359), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/pipeline.dag", 1254, 1382), - }); - declarations.push(Declaration { - id: DeclarationId(1348), - name: Some("lower_stage_binding".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1340), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1340)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "stage".to_string(), - FieldValue::Reference(DeclarationId(1354)), - ), - ( - "realization".to_string(), - FieldValue::Reference(DeclarationId(1342)), - ), - ( - "snapshot".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2360), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/pipeline.dag", 1384, 1508), - }); - declarations.push(Declaration { - id: DeclarationId(1349), - name: Some("infer_stage_binding".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1340), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1340)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "stage".to_string(), - FieldValue::Reference(DeclarationId(1355)), - ), - ( - "realization".to_string(), - FieldValue::Reference(DeclarationId(1343)), - ), - ( - "snapshot".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2360), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/pipeline.dag", 1510, 1634), - }); - declarations.push(Declaration { - id: DeclarationId(1350), - name: Some("compute_ownership_stage_binding".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1340), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1340)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "stage".to_string(), - FieldValue::Reference(DeclarationId(1356)), - ), - ( - "realization".to_string(), - FieldValue::Reference(DeclarationId(1344)), - ), - ( - "snapshot".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2360), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/pipeline.dag", 1636, 1796), - }); - declarations.push(Declaration { - id: DeclarationId(1351), - name: Some("lens_complexity_stage_binding".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1340), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1340)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "stage".to_string(), - FieldValue::Reference(DeclarationId(1357)), - ), - ( - "realization".to_string(), - FieldValue::Reference(DeclarationId(1346)), - ), - ( - "snapshot".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2360), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/pipeline.dag", 1798, 1952), - }); - declarations.push(Declaration { - id: DeclarationId(1352), - name: Some("emit_stage_binding".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1340), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1340)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "stage".to_string(), - FieldValue::Reference(DeclarationId(1358)), - ), - ( - "realization".to_string(), - FieldValue::Reference(DeclarationId(1345)), - ), - ( - "snapshot".to_string(), - FieldValue::Variant { - constructor: DeclarationId(2361), - payload: vec![], - }, - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/pipeline.dag", 1954, 2076), - }); - declarations.push(Declaration { - id: DeclarationId(1353), - name: Some("parse".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227), DeclarationId(227)], - output: DeclarationId(839), - body: ArrowBody::ExternalRealization(DeclarationId(1341)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/pipeline.dag", 2078, 2140), - }); - declarations.push(Declaration { - id: DeclarationId(1354), - name: Some("lower".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839)], - output: DeclarationId(839), - body: ArrowBody::ExternalRealization(DeclarationId(1342)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/pipeline.dag", 2142, 2184), - }); - declarations.push(Declaration { - id: DeclarationId(1355), - name: Some("infer".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839)], - output: DeclarationId(839), - body: ArrowBody::ExternalRealization(DeclarationId(1343)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/pipeline.dag", 2186, 2228), - }); - declarations.push(Declaration { - id: DeclarationId(1356), - name: Some("compute_ownership".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839)], - output: DeclarationId(839), - body: ArrowBody::ExternalRealization(DeclarationId(1344)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/pipeline.dag", 2230, 2288), - }); - declarations.push(Declaration { - id: DeclarationId(1357), - name: Some("lens_complexity".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839)], - output: DeclarationId(839), - body: ArrowBody::ExternalRealization(DeclarationId(1346)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/pipeline.dag", 2290, 2347), - }); - declarations.push(Declaration { - id: DeclarationId(1358), - name: Some("emit".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![ - DeclarationId(839), - DeclarationId(839), - DeclarationId(839), - DeclarationId(1022), - ], - output: DeclarationId(227), - body: ArrowBody::ExternalRealization(DeclarationId(1345)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/pipeline.dag", 2349, 2460), - }); - declarations.push(Declaration { - id: DeclarationId(1359), - name: Some("compile".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227), DeclarationId(227), DeclarationId(1022)], - output: DeclarationId(227), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/compiler/pipeline.dag", - 2533, - 2605, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/pipeline.dag", 2462, 2605), - }); - declarations.push(Declaration { - id: DeclarationId(1360), - name: Some("from_symbol".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227)], - output: DeclarationId(2362), - body: ArrowBody::Unparsed(SourceSpan::new( - "src/v3/compiler/operators.dag", - 156, - 771, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/operators.dag", 108, 771), - }); - declarations.push(Declaration { - id: DeclarationId(1361), - name: Some("symbol".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(817)], - output: DeclarationId(227), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(1007))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/operators.dag", 773, 1214), - }); - declarations.push(Declaration { - id: DeclarationId(1362), - name: Some("algebra_field_name".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(817)], - output: DeclarationId(227), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(1024))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/operators.dag", 1216, 2017), - }); - declarations.push(Declaration { - id: DeclarationId(1363), - name: Some("LensRegistryEntry".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(147), - }, - Field { - label: "lens_file".to_string(), - ty: DeclarationId(154), - }, - Field { - label: "generated_file".to_string(), - ty: DeclarationId(154), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/regen.dag", 2117, 2212), - }); - declarations.push(Declaration { - id: DeclarationId(1364), - name: Some("lens_cost_entry".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1363), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1363)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("cost".to_string())), - ), - ( - "lens_file".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/lenses/complexity.dag".to_string(), - )), - ), - ( - "generated_file".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/compiler/src/complexity_lens_generated.rs".to_string(), - )), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/regen.dag", 2214, 2387), - }); - declarations.push(Declaration { - id: DeclarationId(1365), - name: Some("lens_cost_symbolic_entry".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1363), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1363)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("cost_symbolic".to_string())), - ), - ( - "lens_file".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/lenses/cost.dag".to_string(), - )), - ), - ( - "generated_file".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/compiler/src/cost_symbolic_lens_generated.rs".to_string(), - )), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/regen.dag", 2389, 2577), - }); - declarations.push(Declaration { - id: DeclarationId(1366), - name: Some("lens_cost_target_realization_entry".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1363), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1363)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String( - "cost_target_realization".to_string(), - )), - ), - ( - "lens_file".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/lenses/cost_target_realization.dag".to_string(), - )), - ), - ( - "generated_file".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/compiler/src/lens_cost_target_realization_generated.rs" - .to_string(), - )), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/regen.dag", 2579, 2816), - }); - declarations.push(Declaration { - id: DeclarationId(1367), - name: Some("lens_effect_enumeration_entry".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1363), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1363)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("effect_enumeration".to_string())), - ), - ( - "lens_file".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/lenses/effect_enumeration.dag".to_string(), - )), - ), - ( - "generated_file".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/compiler/src/lens_effect_enumeration_generated.rs".to_string(), - )), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/regen.dag", 2818, 3035), - }); - declarations.push(Declaration { - id: DeclarationId(1368), - name: Some("lens_parallelism_entry".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1363), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1363)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("parallelism".to_string())), - ), - ( - "lens_file".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/lenses/parallelism.dag".to_string(), - )), - ), - ( - "generated_file".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/compiler/src/lens_parallelism_generated.rs".to_string(), - )), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/regen.dag", 3037, 3226), - }); - declarations.push(Declaration { - id: DeclarationId(1369), - name: Some("lens_idempotency_entry".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1363), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1363)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("idempotency".to_string())), - ), - ( - "lens_file".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/lenses/idempotency.dag".to_string(), - )), - ), - ( - "generated_file".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/compiler/src/lens_idempotency_generated.rs".to_string(), - )), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/regen.dag", 3228, 3417), - }); - declarations.push(Declaration { - id: DeclarationId(1370), - name: Some("lens_provenance_entry".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1363), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1363)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("provenance".to_string())), - ), - ( - "lens_file".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/lenses/provenance.dag".to_string(), - )), - ), - ( - "generated_file".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/compiler/src/lens_provenance_generated.rs".to_string(), - )), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/regen.dag", 3419, 3604), - }); - declarations.push(Declaration { - id: DeclarationId(1371), - name: Some("lens_structural_resolution_entry".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1363), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1363)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String( - "structural_resolution".to_string(), - )), - ), - ( - "lens_file".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/lenses/structural_resolution.dag".to_string(), - )), - ), - ( - "generated_file".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/compiler/src/lens_structural_resolution_generated.rs" - .to_string(), - )), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/regen.dag", 3606, 3835), - }); - declarations.push(Declaration { - id: DeclarationId(1372), - name: Some("lens_unused_parameters_entry".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1363), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1363)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("unused_parameters".to_string())), - ), - ( - "lens_file".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/lenses/unused_parameters.dag".to_string(), - )), - ), - ( - "generated_file".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/compiler/src/lens_unused_parameters_generated.rs".to_string(), - )), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/regen.dag", 3837, 4050), - }); - declarations.push(Declaration { - id: DeclarationId(1373), - name: Some("lens_infer_helpers_entry".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1363), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1363)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("infer_helpers".to_string())), - ), - ( - "lens_file".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/lenses/infer_helpers.dag".to_string(), - )), - ), - ( - "generated_file".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/compiler/src/infer_helpers_generated.rs".to_string(), - )), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/regen.dag", 4677, 4869), - }); - declarations.push(Declaration { - id: DeclarationId(1374), - name: Some("lens_variant_payload_entry".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1363), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1363)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("variant_payload".to_string())), - ), - ( - "lens_file".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/lenses/variant_payload.dag".to_string(), - )), - ), - ( - "generated_file".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/compiler/src/variant_payload_generated.rs".to_string(), - )), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/regen.dag", 4871, 5071), - }); - declarations.push(Declaration { - id: DeclarationId(1375), - name: Some("lens_lower_helpers_entry".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1363), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1363)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("lower_helpers".to_string())), - ), - ( - "lens_file".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/lenses/lower_helpers.dag".to_string(), - )), - ), - ( - "generated_file".to_string(), - FieldValue::Literal(LiteralBits::String( - "src/v3/compiler/src/lower_helpers_generated.rs".to_string(), - )), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/regen.dag", 5321, 5513), - }); - declarations.push(Declaration { - id: DeclarationId(1376), - name: Some("IntegerAlgebra".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "OrderedRingAlgebra".to_string(), - ty: DeclarationId(2363), - }, - Field { - label: "SemiringAlgebra".to_string(), - ty: DeclarationId(2364), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/languages/rust/primitives.dag", 6434, 6496), - }); - declarations.push(Declaration { - id: DeclarationId(1377), - name: Some("NonIntegerAlgebra".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ApproximateFieldAlgebra".to_string(), - ty: DeclarationId(2365), - }, - Field { - label: "BooleanAlgebraAlgebra".to_string(), - ty: DeclarationId(2366), - }, - Field { - label: "TerminalAlgebra".to_string(), - ty: DeclarationId(2367), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/languages/rust/primitives.dag", 6498, 6594), - }); - declarations.push(Declaration { - id: DeclarationId(1378), - name: Some("TargetCarrier".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "BitCarrier".to_string(), - ty: DeclarationId(2368), - }, - Field { - label: "ByteCarrier".to_string(), - ty: DeclarationId(2369), - }, - Field { - label: "Word16Carrier".to_string(), - ty: DeclarationId(2370), - }, - Field { - label: "Word32Carrier".to_string(), - ty: DeclarationId(2371), - }, - Field { - label: "Word64Carrier".to_string(), - ty: DeclarationId(2372), - }, - Field { - label: "Word128Carrier".to_string(), - ty: DeclarationId(2373), - }, - Field { - label: "TerminalCarrier".to_string(), - ty: DeclarationId(2374), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/languages/rust/primitives.dag", 8184, 8326), - }); - declarations.push(Declaration { - id: DeclarationId(1379), - name: Some("IntegerOverflow".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "TwoComplementWrap".to_string(), - ty: DeclarationId(2375), - }, - Field { - label: "Saturating".to_string(), - ty: DeclarationId(2376), - }, - Field { - label: "Trap".to_string(), - ty: DeclarationId(2377), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/languages/rust/primitives.dag", 9043, 9109), - }); - declarations.push(Declaration { - id: DeclarationId(1380), - name: Some("RustPrimitive".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "IntegerPrimitive".to_string(), - ty: DeclarationId(2378), - }, - Field { - label: "NonIntegerPrimitive".to_string(), - ty: DeclarationId(2379), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/languages/rust/primitives.dag", 9864, 10650), - }); - declarations.push(Declaration { - id: DeclarationId(1381), - name: Some("rust_grounding_primitives".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1380), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(2380)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::List(vec![ - FieldValue::Variant { - constructor: DeclarationId(2378), - payload: vec![ - FieldValue::Literal(LiteralBits::String("i8".to_string())), - FieldValue::Variant { - constructor: DeclarationId(2363), - payload: vec![], - }, - FieldValue::Variant { - constructor: DeclarationId(2369), - payload: vec![], - }, - FieldValue::Literal(LiteralBits::String("-128".to_string())), - FieldValue::Literal(LiteralBits::String("127".to_string())), - FieldValue::Literal(LiteralBits::Bool(true)), - FieldValue::Variant { - constructor: DeclarationId(2375), - payload: vec![], - }, - ], - }, - FieldValue::Variant { - constructor: DeclarationId(2378), - payload: vec![ - FieldValue::Literal(LiteralBits::String("i16".to_string())), - FieldValue::Variant { - constructor: DeclarationId(2363), - payload: vec![], - }, - FieldValue::Variant { - constructor: DeclarationId(2370), - payload: vec![], - }, - FieldValue::Literal(LiteralBits::String("-32768".to_string())), - FieldValue::Literal(LiteralBits::String("32767".to_string())), - FieldValue::Literal(LiteralBits::Bool(true)), - FieldValue::Variant { - constructor: DeclarationId(2375), - payload: vec![], - }, - ], - }, - FieldValue::Variant { - constructor: DeclarationId(2378), - payload: vec![ - FieldValue::Literal(LiteralBits::String("i32".to_string())), - FieldValue::Variant { - constructor: DeclarationId(2363), - payload: vec![], - }, - FieldValue::Variant { - constructor: DeclarationId(2371), - payload: vec![], - }, - FieldValue::Literal(LiteralBits::String("-2147483648".to_string())), - FieldValue::Literal(LiteralBits::String("2147483647".to_string())), - FieldValue::Literal(LiteralBits::Bool(true)), - FieldValue::Variant { - constructor: DeclarationId(2375), - payload: vec![], - }, - ], - }, - FieldValue::Variant { - constructor: DeclarationId(2378), - payload: vec![ - FieldValue::Literal(LiteralBits::String("i64".to_string())), - FieldValue::Variant { - constructor: DeclarationId(2363), - payload: vec![], - }, - FieldValue::Variant { - constructor: DeclarationId(2372), - payload: vec![], - }, - FieldValue::Literal(LiteralBits::String( - "-9223372036854775808".to_string(), - )), - FieldValue::Literal(LiteralBits::String("9223372036854775807".to_string())), - FieldValue::Literal(LiteralBits::Bool(true)), - FieldValue::Variant { - constructor: DeclarationId(2375), - payload: vec![], - }, - ], - }, - FieldValue::Variant { - constructor: DeclarationId(2378), - payload: vec![ - FieldValue::Literal(LiteralBits::String("i128".to_string())), - FieldValue::Variant { - constructor: DeclarationId(2363), - payload: vec![], - }, - FieldValue::Variant { - constructor: DeclarationId(2373), - payload: vec![], - }, - FieldValue::Literal(LiteralBits::String( - "-170141183460469231731687303715884105728".to_string(), - )), - FieldValue::Literal(LiteralBits::String( - "170141183460469231731687303715884105727".to_string(), - )), - FieldValue::Literal(LiteralBits::Bool(true)), - FieldValue::Variant { - constructor: DeclarationId(2375), - payload: vec![], - }, - ], - }, - FieldValue::Variant { - constructor: DeclarationId(2378), - payload: vec![ - FieldValue::Literal(LiteralBits::String("u8".to_string())), - FieldValue::Variant { - constructor: DeclarationId(2364), - payload: vec![], - }, - FieldValue::Variant { - constructor: DeclarationId(2369), - payload: vec![], - }, - FieldValue::Literal(LiteralBits::String("0".to_string())), - FieldValue::Literal(LiteralBits::String("255".to_string())), - FieldValue::Literal(LiteralBits::Bool(true)), - FieldValue::Variant { - constructor: DeclarationId(2375), - payload: vec![], - }, - ], - }, - FieldValue::Variant { - constructor: DeclarationId(2378), - payload: vec![ - FieldValue::Literal(LiteralBits::String("u16".to_string())), - FieldValue::Variant { - constructor: DeclarationId(2364), - payload: vec![], - }, - FieldValue::Variant { - constructor: DeclarationId(2370), - payload: vec![], - }, - FieldValue::Literal(LiteralBits::String("0".to_string())), - FieldValue::Literal(LiteralBits::String("65535".to_string())), - FieldValue::Literal(LiteralBits::Bool(true)), - FieldValue::Variant { - constructor: DeclarationId(2375), - payload: vec![], - }, - ], - }, - FieldValue::Variant { - constructor: DeclarationId(2378), - payload: vec![ - FieldValue::Literal(LiteralBits::String("u32".to_string())), - FieldValue::Variant { - constructor: DeclarationId(2364), - payload: vec![], - }, - FieldValue::Variant { - constructor: DeclarationId(2371), - payload: vec![], - }, - FieldValue::Literal(LiteralBits::String("0".to_string())), - FieldValue::Literal(LiteralBits::String("4294967295".to_string())), - FieldValue::Literal(LiteralBits::Bool(true)), - FieldValue::Variant { - constructor: DeclarationId(2375), - payload: vec![], - }, - ], - }, - FieldValue::Variant { - constructor: DeclarationId(2378), - payload: vec![ - FieldValue::Literal(LiteralBits::String("u64".to_string())), - FieldValue::Variant { - constructor: DeclarationId(2364), - payload: vec![], - }, - FieldValue::Variant { - constructor: DeclarationId(2372), - payload: vec![], - }, - FieldValue::Literal(LiteralBits::String("0".to_string())), - FieldValue::Literal(LiteralBits::String( - "18446744073709551615".to_string(), - )), - FieldValue::Literal(LiteralBits::Bool(true)), - FieldValue::Variant { - constructor: DeclarationId(2375), - payload: vec![], - }, - ], - }, - FieldValue::Variant { - constructor: DeclarationId(2378), - payload: vec![ - FieldValue::Literal(LiteralBits::String("u128".to_string())), - FieldValue::Variant { - constructor: DeclarationId(2364), - payload: vec![], - }, - FieldValue::Variant { - constructor: DeclarationId(2373), - payload: vec![], - }, - FieldValue::Literal(LiteralBits::String("0".to_string())), - FieldValue::Literal(LiteralBits::String( - "340282366920938463463374607431768211455".to_string(), - )), - FieldValue::Literal(LiteralBits::Bool(true)), - FieldValue::Variant { - constructor: DeclarationId(2375), - payload: vec![], - }, - ], - }, - FieldValue::Variant { - constructor: DeclarationId(2379), - payload: vec![ - FieldValue::Literal(LiteralBits::String("f32".to_string())), - FieldValue::Variant { - constructor: DeclarationId(2365), - payload: vec![], - }, - FieldValue::Variant { - constructor: DeclarationId(2371), - payload: vec![], - }, - FieldValue::Literal(LiteralBits::Bool(true)), - ], - }, - FieldValue::Variant { - constructor: DeclarationId(2379), - payload: vec![ - FieldValue::Literal(LiteralBits::String("f64".to_string())), - FieldValue::Variant { - constructor: DeclarationId(2365), - payload: vec![], - }, - FieldValue::Variant { - constructor: DeclarationId(2372), - payload: vec![], - }, - FieldValue::Literal(LiteralBits::Bool(true)), - ], - }, - FieldValue::Variant { - constructor: DeclarationId(2379), - payload: vec![ - FieldValue::Literal(LiteralBits::String("bool".to_string())), - FieldValue::Variant { - constructor: DeclarationId(2366), - payload: vec![], - }, - FieldValue::Variant { - constructor: DeclarationId(2368), - payload: vec![], - }, - FieldValue::Literal(LiteralBits::Bool(true)), - ], - }, - FieldValue::Variant { - constructor: DeclarationId(2379), - payload: vec![ - FieldValue::Literal(LiteralBits::String("()".to_string())), - FieldValue::Variant { - constructor: DeclarationId(2367), - payload: vec![], - }, - FieldValue::Variant { - constructor: DeclarationId(2374), - payload: vec![], - }, - FieldValue::Literal(LiteralBits::Bool(true)), - ], - }, - ])), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/languages/rust/primitives.dag", 10996, 15736), - }); - declarations.push(Declaration { - id: DeclarationId(1382), - name: Some("CronField".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Wildcard".to_string(), - ty: DeclarationId(2381), - }, - Field { - label: "Exact".to_string(), - ty: DeclarationId(2382), - }, - Field { - label: "Listed".to_string(), - ty: DeclarationId(2384), - }, - Field { - label: "Ranged".to_string(), - ty: DeclarationId(2385), - }, - Field { - label: "Step".to_string(), - ty: DeclarationId(2386), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/cron/schedule_model.dag", 4224, 4443), - }); - declarations.push(Declaration { - id: DeclarationId(1383), - name: Some("CronSchedule".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "minute".to_string(), - ty: DeclarationId(1382), - }, - Field { - label: "hour".to_string(), - ty: DeclarationId(1382), - }, - Field { - label: "day_of_month".to_string(), - ty: DeclarationId(1382), - }, - Field { - label: "month".to_string(), - ty: DeclarationId(1382), - }, - Field { - label: "day_of_week".to_string(), - ty: DeclarationId(1382), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/cron/schedule_model.dag", 4445, 4574), - }); - declarations.push(Declaration { - id: DeclarationId(1384), - name: Some("CronEntry".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "tag".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "schedule".to_string(), - ty: DeclarationId(1383), - }, - Field { - label: "command".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/cron/schedule_model.dag", 4576, 4651), - }); - declarations.push(Declaration { - id: DeclarationId(1385), - name: Some("render_cron_field".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1382)], - output: DeclarationId(227), - body: ArrowBody::Unparsed(SourceSpan::new( - "dsl/extdeps/cron/schedule_model.dag", - 4698, - 4973, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/cron/schedule_model.dag", 4653, 4973), - }); - declarations.push(Declaration { - id: DeclarationId(1386), - name: Some("render_cron_schedule".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1383)], - output: DeclarationId(227), - body: ArrowBody::Unparsed(SourceSpan::new( - "dsl/extdeps/cron/schedule_model.dag", - 5026, - 5263, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/cron/schedule_model.dag", 4975, 5263), - }); - declarations.push(Declaration { - id: DeclarationId(1387), - name: Some("wire_contract".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(309), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(309)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Unparsed(SourceSpan::new( - "dsl/extdeps/github/github.dag", - 722, - 758, - ))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 684, 758), - }); - declarations.push(Declaration { - id: DeclarationId(1388), - name: Some("UserType".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "User".to_string(), - ty: DeclarationId(2387), - }, - Field { - label: "Bot".to_string(), - ty: DeclarationId(2388), - }, - Field { - label: "Organization".to_string(), - ty: DeclarationId(2389), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 831, 872), - }); - declarations.push(Declaration { - id: DeclarationId(1389), - name: Some("GitHubUser".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "login".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "id".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "type".to_string(), - ty: DeclarationId(1388), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 874, 936), - }); - declarations.push(Declaration { - id: DeclarationId(1390), - name: Some("Repository".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "owner".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "full_name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "private".to_string(), - ty: DeclarationId(124), - }, - Field { - label: "default_branch".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 1009, 1120), - }); - declarations.push(Declaration { - id: DeclarationId(1391), - name: Some("GitHubAuthToken".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "token".to_string(), - ty: DeclarationId(143), - }, - Field { - label: "scopes".to_string(), - ty: DeclarationId(2390), - }, - Field { - label: "expires_at".to_string(), - ty: DeclarationId(2391), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 1193, 1286), - }); - declarations.push(Declaration { - id: DeclarationId(1392), - name: Some("GitHubScope".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ScopeRepo".to_string(), - ty: DeclarationId(2392), - }, - Field { - label: "ScopeGist".to_string(), - ty: DeclarationId(2393), - }, - Field { - label: "ScopeWorkflow".to_string(), - ty: DeclarationId(2394), - }, - Field { - label: "ScopeReadOrg".to_string(), - ty: DeclarationId(2395), - }, - Field { - label: "ScopeReadUser".to_string(), - ty: DeclarationId(2396), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 1288, 1385), - }); - declarations.push(Declaration { - id: DeclarationId(1393), - name: Some("Pagination".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "per_page".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "cursor".to_string(), - ty: DeclarationId(2397), - }, - Field { - label: "has_next".to_string(), - ty: DeclarationId(124), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 1510, 1580), - }); - declarations.push(Declaration { - id: DeclarationId(1394), - name: Some("GitHubPermission".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "PermRead".to_string(), - ty: DeclarationId(2398), - }, - Field { - label: "PermWrite".to_string(), - ty: DeclarationId(2399), - }, - Field { - label: "PermAdmin".to_string(), - ty: DeclarationId(2400), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 1653, 1709), - }); - declarations.push(Declaration { - id: DeclarationId(1395), - name: Some("default_api_base".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(227)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Scalar(LiteralBits::String( - "https://api.github.com".to_string(), - ))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 1782, 1838), - }); - declarations.push(Declaration { - id: DeclarationId(1396), - name: Some("default_per_page".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(87), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(87)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Scalar(LiteralBits::Int("30".to_string()))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 1840, 1871), - }); - declarations.push(Declaration { - id: DeclarationId(1397), - name: Some("max_per_page".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(87), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(87)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Scalar(LiteralBits::Int("100".to_string()))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 1873, 1901), - }); - declarations.push(Declaration { - id: DeclarationId(1398), - name: Some("GitHubActionsRuntime".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "oidc_request_url_env".to_string(), - ty: DeclarationId(147), - }, - Field { - label: "oidc_request_token_env".to_string(), - ty: DeclarationId(147), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 1099, 1202), - }); - declarations.push(Declaration { - id: DeclarationId(1399), - name: Some("github_actions_runtime".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1398), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1398)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "oidc_request_url_env".to_string(), - FieldValue::Literal(LiteralBits::String( - "ACTIONS_ID_TOKEN_REQUEST_URL".to_string(), - )), - ), - ( - "oidc_request_token_env".to_string(), - FieldValue::Literal(LiteralBits::String( - "ACTIONS_ID_TOKEN_REQUEST_TOKEN".to_string(), - )), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 1204, 1373), - }); - declarations.push(Declaration { - id: DeclarationId(1400), - name: Some("Workflow".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "on".to_string(), - ty: DeclarationId(2401), - }, - Field { - label: "concurrency".to_string(), - ty: DeclarationId(2402), - }, - Field { - label: "jobs".to_string(), - ty: DeclarationId(2403), - }, - Field { - label: "env".to_string(), - ty: DeclarationId(2405), - }, - Field { - label: "permissions".to_string(), - ty: DeclarationId(2406), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 1773, 2037), - }); - declarations.push(Declaration { - id: DeclarationId(1401), - name: Some("WorkflowPermissions".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "contents".to_string(), - ty: DeclarationId(1402), - }, - Field { - label: "pull_requests".to_string(), - ty: DeclarationId(1402), - }, - Field { - label: "issues".to_string(), - ty: DeclarationId(1402), - }, - Field { - label: "actions".to_string(), - ty: DeclarationId(1402), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2039, 2181), - }); - declarations.push(Declaration { - id: DeclarationId(1402), - name: Some("PermissionLevel".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "PermRead".to_string(), - ty: DeclarationId(2407), - }, - Field { - label: "PermWrite".to_string(), - ty: DeclarationId(2408), - }, - Field { - label: "PermNone".to_string(), - ty: DeclarationId(2409), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2183, 2237), - }); - declarations.push(Declaration { - id: DeclarationId(1403), - name: Some("WorkflowTrigger".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Push".to_string(), - ty: DeclarationId(2412), - }, - Field { - label: "PullRequest".to_string(), - ty: DeclarationId(2415), - }, - Field { - label: "Schedule".to_string(), - ty: DeclarationId(2416), - }, - Field { - label: "WorkflowDispatch".to_string(), - ty: DeclarationId(2418), - }, - Field { - label: "WorkflowCall".to_string(), - ty: DeclarationId(2420), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2353, 2645), - }); - declarations.push(Declaration { - id: DeclarationId(1404), - name: Some("PullRequestActivity".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Opened".to_string(), - ty: DeclarationId(2421), - }, - Field { - label: "Synchronize".to_string(), - ty: DeclarationId(2422), - }, - Field { - label: "Reopened".to_string(), - ty: DeclarationId(2423), - }, - Field { - label: "ReadyForReview".to_string(), - ty: DeclarationId(2424), - }, - Field { - label: "Closed".to_string(), - ty: DeclarationId(2425), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2647, 2741), - }); - declarations.push(Declaration { - id: DeclarationId(1405), - name: Some("DispatchInput".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "description".to_string(), - ty: DeclarationId(2426), - }, - Field { - label: "required".to_string(), - ty: DeclarationId(124), - }, - Field { - label: "default".to_string(), - ty: DeclarationId(2427), - }, - Field { - label: "type".to_string(), - ty: DeclarationId(1406), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2743, 2865), - }); - declarations.push(Declaration { - id: DeclarationId(1406), - name: Some("DispatchInputType".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "InputString".to_string(), - ty: DeclarationId(2428), - }, - Field { - label: "InputBoolean".to_string(), - ty: DeclarationId(2429), - }, - Field { - label: "InputChoice".to_string(), - ty: DeclarationId(2430), - }, - Field { - label: "InputEnvironment".to_string(), - ty: DeclarationId(2431), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2867, 2951), - }); - declarations.push(Declaration { - id: DeclarationId(1407), - name: Some("SecretScope".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "StepScope".to_string(), - ty: DeclarationId(2432), - }, - Field { - label: "JobScope".to_string(), - ty: DeclarationId(2433), - }, - Field { - label: "WorkflowScope".to_string(), - ty: DeclarationId(2434), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5054, 5109), - }); - declarations.push(Declaration { - id: DeclarationId(1408), - name: Some("WorkflowSecret".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(149), - }, - Field { - label: "scope".to_string(), - ty: DeclarationId(1407), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5384, 5447), - }); - declarations.push(Declaration { - id: DeclarationId(1409), - name: Some("Job".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "id".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "name".to_string(), - ty: DeclarationId(2435), - }, - Field { - label: "runner".to_string(), - ty: DeclarationId(1413), - }, - Field { - label: "steps".to_string(), - ty: DeclarationId(2436), - }, - Field { - label: "needs".to_string(), - ty: DeclarationId(2437), - }, - Field { - label: "env".to_string(), - ty: DeclarationId(2439), - }, - Field { - label: "outputs".to_string(), - ty: DeclarationId(2441), - }, - Field { - label: "if_condition".to_string(), - ty: DeclarationId(2442), - }, - Field { - label: "strategy".to_string(), - ty: DeclarationId(2443), - }, - Field { - label: "timeout_minutes".to_string(), - ty: DeclarationId(2444), - }, - Field { - label: "continue_on_error".to_string(), - ty: DeclarationId(124), - }, - Field { - label: "concurrency".to_string(), - ty: DeclarationId(2445), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5591, 6060), - }); - declarations.push(Declaration { - id: DeclarationId(1410), - name: Some("CancelInProgressSpec".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "CancelInProgressBool".to_string(), - ty: DeclarationId(2446), - }, - Field { - label: "CancelInProgressExpression".to_string(), - ty: DeclarationId(2447), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 6878, 6998), - }); - declarations.push(Declaration { - id: DeclarationId(1411), - name: Some("CancelInProgressWhenQueueMax".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "QueueMaxCancelInProgressFalse".to_string(), - ty: DeclarationId(2448), - }, - Field { - label: "QueueMaxCancelInProgressExpression".to_string(), - ty: DeclarationId(2449), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 7806, 7935), - }); - declarations.push(Declaration { - id: DeclarationId(1412), - name: Some("ConcurrencySpec".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ConcurrencyScalar".to_string(), - ty: DeclarationId(2450), - }, - Field { - label: "ConcurrencyMappingQueueMax".to_string(), - ty: DeclarationId(2452), - }, - Field { - label: "ConcurrencyMappingQueueNotMax".to_string(), - ty: DeclarationId(2455), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 8488, 9134), - }); - declarations.push(Declaration { - id: DeclarationId(1413), - name: Some("RunnerSpec".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "HostedRunner".to_string(), - ty: DeclarationId(2456), - }, - Field { - label: "SelfHosted".to_string(), - ty: DeclarationId(2458), - }, - Field { - label: "RunsOnExpression".to_string(), - ty: DeclarationId(2459), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10306, 10529), - }); - declarations.push(Declaration { - id: DeclarationId(1414), - name: Some("RunnerLabel".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "UbuntuLatest".to_string(), - ty: DeclarationId(2460), - }, - Field { - label: "Ubuntu2404".to_string(), - ty: DeclarationId(2461), - }, - Field { - label: "Ubuntu2204".to_string(), - ty: DeclarationId(2462), - }, - Field { - label: "MacosLatest".to_string(), - ty: DeclarationId(2463), - }, - Field { - label: "Macos14".to_string(), - ty: DeclarationId(2464), - }, - Field { - label: "WindowsLatest".to_string(), - ty: DeclarationId(2465), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10531, 10640), - }); - declarations.push(Declaration { - id: DeclarationId(1415), - name: Some("Step".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "RunStep".to_string(), - ty: DeclarationId(2473), - }, - Field { - label: "UsesStep".to_string(), - ty: DeclarationId(2482), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10785, 11380), - }); - declarations.push(Declaration { - id: DeclarationId(1416), - name: Some("ShellType".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Bash".to_string(), - ty: DeclarationId(2483), - }, - Field { - label: "Sh".to_string(), - ty: DeclarationId(2484), - }, - Field { - label: "Pwsh".to_string(), - ty: DeclarationId(2485), - }, - Field { - label: "Python".to_string(), - ty: DeclarationId(2486), - }, - Field { - label: "Cmd".to_string(), - ty: DeclarationId(2487), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11382, 11430), - }); - declarations.push(Declaration { - id: DeclarationId(1417), - name: Some("ActionRef".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "owner".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "repo".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "ref".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11432, 11495), - }); - declarations.push(Declaration { - id: DeclarationId(1418), - name: Some("LogAnnotation".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "AnnotationError".to_string(), - ty: DeclarationId(2491), - }, - Field { - label: "AnnotationWarning".to_string(), - ty: DeclarationId(2495), - }, - Field { - label: "AnnotationNotice".to_string(), - ty: DeclarationId(2499), - }, - Field { - label: "AnnotationGroup".to_string(), - ty: DeclarationId(2500), - }, - Field { - label: "AnnotationEndGroup".to_string(), - ty: DeclarationId(2501), - }, - Field { - label: "SetOutput".to_string(), - ty: DeclarationId(2502), - }, - Field { - label: "AddMask".to_string(), - ty: DeclarationId(2503), - }, - Field { - label: "StopCommands".to_string(), - ty: DeclarationId(2504), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11729, 12156), - }); - declarations.push(Declaration { - id: DeclarationId(1419), - name: Some("annotation_error_prefix".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(227)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Scalar(LiteralBits::String( - "::error ".to_string(), - ))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 12222, 12271), - }); - declarations.push(Declaration { - id: DeclarationId(1420), - name: Some("annotation_warning_prefix".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(227)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Scalar(LiteralBits::String( - "::warning ".to_string(), - ))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 12272, 12325), - }); - declarations.push(Declaration { - id: DeclarationId(1421), - name: Some("annotation_notice_prefix".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(227)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Scalar(LiteralBits::String( - "::notice ".to_string(), - ))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 12326, 12377), - }); - declarations.push(Declaration { - id: DeclarationId(1422), - name: Some("annotation_group_prefix".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(227)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Scalar(LiteralBits::String( - "::group::".to_string(), - ))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 12378, 12428), - }); - declarations.push(Declaration { - id: DeclarationId(1423), - name: Some("annotation_endgroup".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(227)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Scalar(LiteralBits::String( - "::endgroup::".to_string(), - ))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 12429, 12478), - }); - declarations.push(Declaration { - id: DeclarationId(1424), - name: Some("annotation_set_output_prefix".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(227)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Scalar(LiteralBits::String( - "::set-output name=".to_string(), - ))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 12479, 12543), - }); - declarations.push(Declaration { - id: DeclarationId(1425), - name: Some("annotation_add_mask_prefix".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(227)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Scalar(LiteralBits::String( - "::add-mask::".to_string(), - ))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 12544, 12600), - }); - declarations.push(Declaration { - id: DeclarationId(1426), - name: Some("annotation_stop_commands_prefix".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(227)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Scalar(LiteralBits::String( - "::stop-commands::".to_string(), - ))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 12601, 12667), - }); - declarations.push(Declaration { - id: DeclarationId(1427), - name: Some("ArtifactOp".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Upload".to_string(), - ty: DeclarationId(2506), - }, - Field { - label: "Download".to_string(), - ty: DeclarationId(2508), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 12889, 13054), - }); - declarations.push(Declaration { - id: DeclarationId(1428), - name: Some("MissingFilesBehavior".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Warn".to_string(), - ty: DeclarationId(2509), - }, - Field { - label: "ErrorOut".to_string(), - ty: DeclarationId(2510), - }, - Field { - label: "Ignore".to_string(), - ty: DeclarationId(2511), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13056, 13108), - }); - declarations.push(Declaration { - id: DeclarationId(1429), - name: Some("upload_artifact_action".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1417), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1417)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Unparsed(SourceSpan::new( - "dsl/extdeps/github/actions.dag", - 13200, - 13268, - ))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13159, 13268), - }); - declarations.push(Declaration { - id: DeclarationId(1430), - name: Some("download_artifact_action".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1417), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1417)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Unparsed(SourceSpan::new( - "dsl/extdeps/github/actions.dag", - 13313, - 13383, - ))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13270, 13383), - }); - declarations.push(Declaration { - id: DeclarationId(1431), - name: Some("MatrixStrategy".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "dimensions".to_string(), - ty: DeclarationId(2513), - }, - Field { - label: "include".to_string(), - ty: DeclarationId(2515), - }, - Field { - label: "exclude".to_string(), - ty: DeclarationId(2517), - }, - Field { - label: "fail_fast".to_string(), - ty: DeclarationId(124), - }, - Field { - label: "max_parallel".to_string(), - ty: DeclarationId(2518), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13522, 13698), - }); - declarations.push(Declaration { - id: DeclarationId(1432), - name: Some("CheckConclusion".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Success".to_string(), - ty: DeclarationId(2519), - }, - Field { - label: "Failure".to_string(), - ty: DeclarationId(2520), - }, - Field { - label: "Cancelled".to_string(), - ty: DeclarationId(2521), - }, - Field { - label: "Skipped".to_string(), - ty: DeclarationId(2522), - }, - Field { - label: "TimedOut".to_string(), - ty: DeclarationId(2523), - }, - Field { - label: "ActionRequired".to_string(), - ty: DeclarationId(2524), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13827, 13929), - }); - declarations.push(Declaration { - id: DeclarationId(1433), - name: Some("checkout_action".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1417), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1417)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Unparsed(SourceSpan::new( - "dsl/extdeps/github/actions.dag", - 14089, - 14150, - ))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 14055, 14150), - }); - declarations.push(Declaration { - id: DeclarationId(1434), - name: Some("setup_rust_action".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1417), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1417)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Unparsed(SourceSpan::new( - "dsl/extdeps/github/actions.dag", - 14188, - 14276, - ))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 14152, 14276), - }); - declarations.push(Declaration { - id: DeclarationId(1435), - name: Some("cache_action".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(1417), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(1417)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Unparsed(SourceSpan::new( - "dsl/extdeps/github/actions.dag", - 14309, - 14367, - ))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 14278, 14367), - }); - declarations.push(Declaration { - id: DeclarationId(1436), - name: Some("max_job_timeout_minutes".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(87), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(87)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Scalar(LiteralBits::Int("360".to_string()))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 14443, 14482), - }); - declarations.push(Declaration { - id: DeclarationId(1437), - name: Some("default_job_timeout_minutes".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(87), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(87)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Scalar(LiteralBits::Int("360".to_string()))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 14484, 14527), - }); - declarations.push(Declaration { - id: DeclarationId(1438), - name: Some("max_matrix_combinations".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(87), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(87)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Scalar(LiteralBits::Int("256".to_string()))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 14529, 14568), - }); - declarations.push(Declaration { - id: DeclarationId(1439), - name: Some("github_actions_workflows_dir".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(227)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Scalar(LiteralBits::String( - ".github/workflows".to_string(), - ))), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/ci.dag", 1207, 1270), - }); - declarations.push(Declaration { - id: DeclarationId(1440), - name: Some("GitHubActionsWorkflowExtension".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "GitHubActionsWorkflowYml".to_string(), - ty: DeclarationId(2525), - }, - Field { - label: "GitHubActionsWorkflowYaml".to_string(), - ty: DeclarationId(2526), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/ci.dag", 1895, 1989), - }); - declarations.push(Declaration { - id: DeclarationId(1441), - name: Some("GitHubActionsWorkflowStemSegment".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(147))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(2527)), - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/ci.dag", 2615, 2714), - }); - declarations.push(Declaration { - id: DeclarationId(1442), - name: Some("GitHubActionsWorkflowStem".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "segment".to_string(), - ty: DeclarationId(1441), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/ci.dag", 2916, 2994), - }); - declarations.push(Declaration { - id: DeclarationId(1443), - name: Some("GitHubActionsWorkflowFileRef".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "stem".to_string(), - ty: DeclarationId(1442), - }, - Field { - label: "extension".to_string(), - ty: DeclarationId(1440), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/ci.dag", 3398, 3513), - }); - declarations.push(Declaration { - id: DeclarationId(1444), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(702), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 3259, 3272), - }); - declarations.push(Declaration { - id: DeclarationId(1445), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(704), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 3421, 3434), - }); - declarations.push(Declaration { - id: DeclarationId(1446), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(704), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 3439, 3452), - }); - declarations.push(Declaration { - id: DeclarationId(1447), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(706), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 3556, 3569), - }); - declarations.push(Declaration { - id: DeclarationId(1448), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(708), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 4162, 4169), - }); - declarations.push(Declaration { - id: DeclarationId(1449), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(709), DeclarationId(708)], - output: DeclarationId(709), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 4183, 4196), - }); - declarations.push(Declaration { - id: DeclarationId(1450), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(711), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 4617, 4624), - }); - declarations.push(Declaration { - id: DeclarationId(1451), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(711), DeclarationId(712)], - output: DeclarationId(712), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 4638, 4651), - }); - declarations.push(Declaration { - id: DeclarationId(1452), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(714), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 5336, 5349), - }); - declarations.push(Declaration { - id: DeclarationId(1453), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(714), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 5354, 5367), - }); - declarations.push(Declaration { - id: DeclarationId(1454), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(714), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 5372, 5385), - }); - declarations.push(Declaration { - id: DeclarationId(1455), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(716), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 5686, 5693), - }); - declarations.push(Declaration { - id: DeclarationId(1456), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(716)], - output: DeclarationId(717), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 5698, 5708), - }); - declarations.push(Declaration { - id: DeclarationId(1457), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(717), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 5713, 5720), - }); - declarations.push(Declaration { - id: DeclarationId(1458), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(719), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 5867, 5874), - }); - declarations.push(Declaration { - id: DeclarationId(1459), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(719)], - output: DeclarationId(124), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 5879, 5892), - }); - declarations.push(Declaration { - id: DeclarationId(1460), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(719), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 5897, 5904), - }); - declarations.push(Declaration { - id: DeclarationId(1461), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(721), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 6130, 6137), - }); - declarations.push(Declaration { - id: DeclarationId(1462), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(722), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 6151, 6158), - }); - declarations.push(Declaration { - id: DeclarationId(1463), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(721)], - output: DeclarationId(1462), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 6142, 6158), - }); - declarations.push(Declaration { - id: DeclarationId(1464), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(722), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 6163, 6170), - }); - declarations.push(Declaration { - id: DeclarationId(1465), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(724), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 6356, 6363), - }); - declarations.push(Declaration { - id: DeclarationId(1466), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(726), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 6588, 6595), - }); - declarations.push(Declaration { - id: DeclarationId(1467), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(730), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 7202, 7209), - }); - declarations.push(Declaration { - id: DeclarationId(1468), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(727), - arguments: vec![TemplateArgument { - parameter: DeclarationId(728), - value: DeclarationId(730), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 7219, 7236), - }); - declarations.push(Declaration { - id: DeclarationId(1469), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1468), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 7214, 7237), - }); - declarations.push(Declaration { - id: DeclarationId(1470), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(732), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 7415, 7422), - }); - declarations.push(Declaration { - id: DeclarationId(1471), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(727), - arguments: vec![TemplateArgument { - parameter: DeclarationId(728), - value: DeclarationId(732), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 7444, 7461), - }); - declarations.push(Declaration { - id: DeclarationId(1472), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1471), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 7439, 7462), - }); - declarations.push(Declaration { - id: DeclarationId(1473), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(734), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 8177, 8184), - }); - declarations.push(Declaration { - id: DeclarationId(1474), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 2106, 2111), - }); - declarations.push(Declaration { - id: DeclarationId(1475), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(700), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 2144, 2157), - }); - declarations.push(Declaration { - id: DeclarationId(1476), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "head".to_string(), - ty: DeclarationId(700), - }, - Field { - label: "tail".to_string(), - ty: DeclarationId(1475), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 2116, 2159), - }); - declarations.push(Declaration { - id: DeclarationId(1477), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(740), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate_minimal.dag", 1477, 1490), - }); - declarations.push(Declaration { - id: DeclarationId(1478), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(742), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate_minimal.dag", 1570, 1583), - }); - declarations.push(Declaration { - id: DeclarationId(1479), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 11898, 11905), - }); - declarations.push(Declaration { - id: DeclarationId(1480), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 24553, 24560), - }); - declarations.push(Declaration { - id: DeclarationId(1481), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(824), - arguments: vec![TemplateArgument { - parameter: DeclarationId(825), - value: DeclarationId(966), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 24784, 24805), - }); - declarations.push(Declaration { - id: DeclarationId(1482), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(727), - arguments: vec![TemplateArgument { - parameter: DeclarationId(728), - value: DeclarationId(966), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 24857, 24882), - }); - declarations.push(Declaration { - id: DeclarationId(1483), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(824), - arguments: vec![TemplateArgument { - parameter: DeclarationId(825), - value: DeclarationId(966), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 24887, 24908), - }); - declarations.push(Declaration { - id: DeclarationId(1484), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(1483), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 24887, 24909), - }); - declarations.push(Declaration { - id: DeclarationId(1485), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(966), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 25035, 25050), - }); - declarations.push(Declaration { - id: DeclarationId(1486), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(824), - arguments: vec![TemplateArgument { - parameter: DeclarationId(825), - value: DeclarationId(966), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 25055, 25076), - }); - declarations.push(Declaration { - id: DeclarationId(1487), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(1486), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 25055, 25077), - }); - declarations.push(Declaration { - id: DeclarationId(1488), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(966), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 26100, 26115), - }); - declarations.push(Declaration { - id: DeclarationId(1489), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(966), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 32908, 32923), - }); - declarations.push(Declaration { - id: DeclarationId(1490), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(786), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 32929, 32960), - }); - declarations.push(Declaration { - id: DeclarationId(1491), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "text".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 7677, 7706), - }); - declarations.push(Declaration { - id: DeclarationId(1492), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "name".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 7711, 7740), - }); - declarations.push(Declaration { - id: DeclarationId(1493), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(743), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 7772, 7790), - }); - declarations.push(Declaration { - id: DeclarationId(1494), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(743), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 8211, 8229), - }); - declarations.push(Declaration { - id: DeclarationId(1495), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "tokens".to_string(), - ty: DeclarationId(1494), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 8181, 8231), - }); - declarations.push(Declaration { - id: DeclarationId(1496), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "segment".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "reason".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 8236, 8292), - }); - declarations.push(Declaration { - id: DeclarationId(1497), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "template".to_string(), - ty: DeclarationId(744), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 8655, 8700), - }); - declarations.push(Declaration { - id: DeclarationId(1498), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "raw".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "segment".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "reason".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 8705, 8775), - }); - declarations.push(Declaration { - id: DeclarationId(1499), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 14498, 14508), - }); - declarations.push(Declaration { - id: DeclarationId(1500), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "key_source".to_string(), - ty: DeclarationId(756), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 14513, 14551), - }); - declarations.push(Declaration { - id: DeclarationId(1501), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "key_source".to_string(), - ty: DeclarationId(756), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 14556, 14594), - }); - declarations.push(Declaration { - id: DeclarationId(1502), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "cause".to_string(), - ty: DeclarationId(753), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 14840, 14875), - }); - declarations.push(Declaration { - id: DeclarationId(1503), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 14880, 14892), - }); - declarations.push(Declaration { - id: DeclarationId(1504), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(750), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 15314, 15343), - }); - declarations.push(Declaration { - id: DeclarationId(1505), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(751), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 15348, 15373), - }); - declarations.push(Declaration { - id: DeclarationId(1506), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 15886, 15896), - }); - declarations.push(Declaration { - id: DeclarationId(1507), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "method".to_string(), - ty: DeclarationId(195), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 15901, 15939), - }); - declarations.push(Declaration { - id: DeclarationId(1508), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 15978, 16010), - }); - declarations.push(Declaration { - id: DeclarationId(1509), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "shape".to_string(), - ty: DeclarationId(752), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 16048, 16087), - }); - declarations.push(Declaration { - id: DeclarationId(1510), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "failure".to_string(), - ty: DeclarationId(754), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 16092, 16159), - }); - declarations.push(Declaration { - id: DeclarationId(1511), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "param".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 16809, 16836), - }); - declarations.push(Declaration { - id: DeclarationId(1512), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "field".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 16841, 16869), - }); - declarations.push(Declaration { - id: DeclarationId(1513), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 17546, 17559), - }); - declarations.push(Declaration { - id: DeclarationId(1514), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 17564, 17578), - }); - declarations.push(Declaration { - id: DeclarationId(1515), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "reason".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 17583, 17615), - }); - declarations.push(Declaration { - id: DeclarationId(1516), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 20027, 20048), - }); - declarations.push(Declaration { - id: DeclarationId(1517), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(824), - arguments: vec![TemplateArgument { - parameter: DeclarationId(825), - value: DeclarationId(966), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 20079, 20100), - }); - declarations.push(Declaration { - id: DeclarationId(1518), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "first_breaker".to_string(), - ty: DeclarationId(1517), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 20053, 20102), - }); - declarations.push(Declaration { - id: DeclarationId(1519), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(966), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 28369, 28384), - }); - declarations.push(Declaration { - id: DeclarationId(1520), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "ops".to_string(), - ty: DeclarationId(1519), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 28349, 28386), - }); - declarations.push(Declaration { - id: DeclarationId(1521), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(741), - arguments: vec![TemplateArgument { - parameter: DeclarationId(742), - value: DeclarationId(776), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 28412, 28439), - }); - declarations.push(Declaration { - id: DeclarationId(1522), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "arms".to_string(), - ty: DeclarationId(1521), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 28391, 28441), - }); - declarations.push(Declaration { - id: DeclarationId(1523), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "body".to_string(), - ty: DeclarationId(777), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 28446, 28481), - }); - declarations.push(Declaration { - id: DeclarationId(1524), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(741), - arguments: vec![TemplateArgument { - parameter: DeclarationId(742), - value: DeclarationId(777), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 28513, 28545), - }); - declarations.push(Declaration { - id: DeclarationId(1525), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "branches".to_string(), - ty: DeclarationId(1524), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 28486, 28547), - }); - declarations.push(Declaration { - id: DeclarationId(1526), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(760), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 29184, 29230), - }); - declarations.push(Declaration { - id: DeclarationId(1527), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(778), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 29235, 29287), - }); - declarations.push(Declaration { - id: DeclarationId(1528), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 29784, 29804), - }); - declarations.push(Declaration { - id: DeclarationId(1529), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 29809, 29830), - }); - declarations.push(Declaration { - id: DeclarationId(1530), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 29835, 29858), - }); - declarations.push(Declaration { - id: DeclarationId(1531), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "left".to_string(), - ty: DeclarationId(966), - }, - Field { - label: "right".to_string(), - ty: DeclarationId(966), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 29863, 29919), - }); - declarations.push(Declaration { - id: DeclarationId(1532), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 29924, 29955), - }); - declarations.push(Declaration { - id: DeclarationId(1533), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 29960, 29978), - }); - declarations.push(Declaration { - id: DeclarationId(1534), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(760), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 30295, 30341), - }); - declarations.push(Declaration { - id: DeclarationId(1535), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(782), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 30346, 30398), - }); - declarations.push(Declaration { - id: DeclarationId(1536), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(792), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 22398, 22406), - }); - declarations.push(Declaration { - id: DeclarationId(1537), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(838), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 22455, 22464), - }); - declarations.push(Declaration { - id: DeclarationId(1538), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(838), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 22530, 22539), - }); - declarations.push(Declaration { - id: DeclarationId(1539), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(810), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 22916, 22928), - }); - declarations.push(Declaration { - id: DeclarationId(1540), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(810), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 23791, 23803), - }); - declarations.push(Declaration { - id: DeclarationId(1541), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(777), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 24114, 24129), - }); - declarations.push(Declaration { - id: DeclarationId(1542), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(908), - arguments: vec![TemplateArgument { - parameter: DeclarationId(909), - value: DeclarationId(737), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 28113, 28134), - }); - declarations.push(Declaration { - id: DeclarationId(1543), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(908), - arguments: vec![TemplateArgument { - parameter: DeclarationId(909), - value: DeclarationId(737), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 28198, 28219), - }); - declarations.push(Declaration { - id: DeclarationId(1544), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 754, 764), - }); - declarations.push(Declaration { - id: DeclarationId(1545), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(789), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 769, 788), - }); - declarations.push(Declaration { - id: DeclarationId(1546), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 793, 803), - }); - declarations.push(Declaration { - id: DeclarationId(1547), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(735), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 867, 874), - }); - declarations.push(Declaration { - id: DeclarationId(1548), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 1379, 1393), - }); - declarations.push(Declaration { - id: DeclarationId(1549), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(124), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 1398, 1411), - }); - declarations.push(Declaration { - id: DeclarationId(1550), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 1416, 1433), - }); - declarations.push(Declaration { - id: DeclarationId(1551), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 1526, 1543), - }); - declarations.push(Declaration { - id: DeclarationId(1552), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(793), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 3676, 3696), - }); - declarations.push(Declaration { - id: DeclarationId(1553), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 3701, 3729), - }); - declarations.push(Declaration { - id: DeclarationId(1554), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(737), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 3734, 3768), - }); - declarations.push(Declaration { - id: DeclarationId(1555), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(737), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 3773, 3802), - }); - declarations.push(Declaration { - id: DeclarationId(1556), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 3807, 3824), - }); - declarations.push(Declaration { - id: DeclarationId(1557), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 4448, 4455), - }); - declarations.push(Declaration { - id: DeclarationId(1558), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "previous".to_string(), - ty: DeclarationId(795), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 4460, 4510), - }); - declarations.push(Declaration { - id: DeclarationId(1559), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "units".to_string(), - ty: DeclarationId(76), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 6074, 6098), - }); - declarations.push(Declaration { - id: DeclarationId(1560), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 6123, 6132), - }); - declarations.push(Declaration { - id: DeclarationId(1561), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(795), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 6137, 6173), - }); - declarations.push(Declaration { - id: DeclarationId(1562), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "lower".to_string(), - ty: DeclarationId(798), - }, - Field { - label: "width".to_string(), - ty: DeclarationId(796), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 6485, 6535), - }); - declarations.push(Declaration { - id: DeclarationId(1563), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 6540, 6549), - }); - declarations.push(Declaration { - id: DeclarationId(1564), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(797), - arguments: vec![TemplateArgument { - parameter: DeclarationId(798), - value: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 7125, 7138), - }); - declarations.push(Declaration { - id: DeclarationId(1565), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1564), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 7113, 7139), - }); - declarations.push(Declaration { - id: DeclarationId(1566), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 7144, 7161), - }); - declarations.push(Declaration { - id: DeclarationId(1567), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 7412, 7422), - }); - declarations.push(Declaration { - id: DeclarationId(1568), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 7427, 7436), - }); - declarations.push(Declaration { - id: DeclarationId(1569), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 7441, 7450), - }); - declarations.push(Declaration { - id: DeclarationId(1570), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(793), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 7877, 7897), - }); - declarations.push(Declaration { - id: DeclarationId(1571), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(737), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 7902, 7926), - }); - declarations.push(Declaration { - id: DeclarationId(1572), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(804), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 7938, 7954), - }); - declarations.push(Declaration { - id: DeclarationId(1573), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1572), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 7931, 7955), - }); - declarations.push(Declaration { - id: DeclarationId(1574), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(805), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 7965, 7981), - }); - declarations.push(Declaration { - id: DeclarationId(1575), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1574), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 7960, 7982), - }); - declarations.push(Declaration { - id: DeclarationId(1576), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(804), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 7991, 8007), - }); - declarations.push(Declaration { - id: DeclarationId(1577), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1576), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 7987, 8008), - }); - declarations.push(Declaration { - id: DeclarationId(1578), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(805), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 8071, 8087), - }); - declarations.push(Declaration { - id: DeclarationId(1579), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "constructor".to_string(), - ty: DeclarationId(737), - }, - Field { - label: "payload".to_string(), - ty: DeclarationId(1578), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 8013, 8093), - }); - declarations.push(Declaration { - id: DeclarationId(1580), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(155), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 9706, 9735), - }); - declarations.push(Declaration { - id: DeclarationId(1581), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(804), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 9770, 9786), - }); - declarations.push(Declaration { - id: DeclarationId(1582), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "fields".to_string(), - ty: DeclarationId(1581), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 9740, 9788), - }); - declarations.push(Declaration { - id: DeclarationId(1583), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(793), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 9793, 9821), - }); - declarations.push(Declaration { - id: DeclarationId(1584), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(805), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 9840, 9856), - }); - declarations.push(Declaration { - id: DeclarationId(1585), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1584), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 9826, 9857), - }); - declarations.push(Declaration { - id: DeclarationId(1586), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(804), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 9875, 9891), - }); - declarations.push(Declaration { - id: DeclarationId(1587), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1586), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 9862, 9892), - }); - declarations.push(Declaration { - id: DeclarationId(1588), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(807), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 11146, 11169), - }); - declarations.push(Declaration { - id: DeclarationId(1589), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(737), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 11174, 11208), - }); - declarations.push(Declaration { - id: DeclarationId(1590), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 11213, 11220), - }); - declarations.push(Declaration { - id: DeclarationId(1591), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 11225, 11231), - }); - declarations.push(Declaration { - id: DeclarationId(1592), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(155), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 11236, 11256), - }); - declarations.push(Declaration { - id: DeclarationId(1593), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(794), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 11485, 11502), - }); - declarations.push(Declaration { - id: DeclarationId(1594), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(802), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 11524, 11539), - }); - declarations.push(Declaration { - id: DeclarationId(1595), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "children".to_string(), - ty: DeclarationId(1594), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 11507, 11541), - }); - declarations.push(Declaration { - id: DeclarationId(1596), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(802), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 11563, 11578), - }); - declarations.push(Declaration { - id: DeclarationId(1597), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "variants".to_string(), - ty: DeclarationId(1596), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 11546, 11580), - }); - declarations.push(Declaration { - id: DeclarationId(1598), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(737), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 11607, 11626), - }); - declarations.push(Declaration { - id: DeclarationId(1599), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "inputs".to_string(), - ty: DeclarationId(1598), - }, - Field { - label: "output".to_string(), - ty: DeclarationId(737), - }, - Field { - label: "body".to_string(), - ty: DeclarationId(808), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 11585, 11682), - }); - declarations.push(Declaration { - id: DeclarationId(1600), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "element".to_string(), - ty: DeclarationId(737), - }, - Field { - label: "bound".to_string(), - ty: DeclarationId(801), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 11687, 11765), - }); - declarations.push(Declaration { - id: DeclarationId(1601), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(803), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 11833, 11855), - }); - declarations.push(Declaration { - id: DeclarationId(1602), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "template".to_string(), - ty: DeclarationId(737), - }, - Field { - label: "arguments".to_string(), - ty: DeclarationId(1601), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 11770, 11861), - }); - declarations.push(Declaration { - id: DeclarationId(1603), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 11910, 11917), - }); - declarations.push(Declaration { - id: DeclarationId(1604), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(737), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 11962, 11981), - }); - declarations.push(Declaration { - id: DeclarationId(1605), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(811), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 12000, 12022), - }); - declarations.push(Declaration { - id: DeclarationId(1606), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(737), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 12035, 12049), - }); - declarations.push(Declaration { - id: DeclarationId(1607), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(737), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 12062, 12076), - }); - declarations.push(Declaration { - id: DeclarationId(1608), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(806), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 12091, 12101), - }); - declarations.push(Declaration { - id: DeclarationId(1609), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(812), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 12121, 12136), - }); - declarations.push(Declaration { - id: DeclarationId(1610), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(737), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 13259, 13278), - }); - declarations.push(Declaration { - id: DeclarationId(1611), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 13559, 13562), - }); - declarations.push(Declaration { - id: DeclarationId(1612), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 13567, 13570), - }); - declarations.push(Declaration { - id: DeclarationId(1613), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 13575, 13578), - }); - declarations.push(Declaration { - id: DeclarationId(1614), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 13583, 13586), - }); - declarations.push(Declaration { - id: DeclarationId(1615), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 13710, 13712), - }); - declarations.push(Declaration { - id: DeclarationId(1616), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 13717, 13719), - }); - declarations.push(Declaration { - id: DeclarationId(1617), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 13724, 13726), - }); - declarations.push(Declaration { - id: DeclarationId(1618), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 13731, 13733), - }); - declarations.push(Declaration { - id: DeclarationId(1619), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 13738, 13740), - }); - declarations.push(Declaration { - id: DeclarationId(1620), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 13745, 13747), - }); - declarations.push(Declaration { - id: DeclarationId(1621), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 14524, 14527), - }); - declarations.push(Declaration { - id: DeclarationId(1622), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 14532, 14534), - }); - declarations.push(Declaration { - id: DeclarationId(1623), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(813), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 14770, 14794), - }); - declarations.push(Declaration { - id: DeclarationId(1624), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(814), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 14799, 14823), - }); - declarations.push(Declaration { - id: DeclarationId(1625), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(816), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 14828, 14846), - }); - declarations.push(Declaration { - id: DeclarationId(1626), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(737), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 15033, 15056), - }); - declarations.push(Declaration { - id: DeclarationId(1627), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "field_label".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 15061, 15117), - }); - declarations.push(Declaration { - id: DeclarationId(1628), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "field_label".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 15122, 15176), - }); - declarations.push(Declaration { - id: DeclarationId(1629), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(817), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 15181, 15203), - }); - declarations.push(Declaration { - id: DeclarationId(1630), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "span".to_string(), - ty: DeclarationId(155), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 15328, 15380), - }); - declarations.push(Declaration { - id: DeclarationId(1631), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(737), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 15385, 15415), - }); - declarations.push(Declaration { - id: DeclarationId(1632), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(820), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 15579, 15594), - }); - declarations.push(Declaration { - id: DeclarationId(1633), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(741), - arguments: vec![TemplateArgument { - parameter: DeclarationId(742), - value: DeclarationId(826), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 17570, 17601), - }); - declarations.push(Declaration { - id: DeclarationId(1634), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(739), - arguments: vec![TemplateArgument { - parameter: DeclarationId(740), - value: DeclarationId(827), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 17625, 17655), - }); - declarations.push(Declaration { - id: DeclarationId(1635), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "count".to_string(), - ty: DeclarationId(736), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 18278, 18307), - }); - declarations.push(Declaration { - id: DeclarationId(1636), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "cluster".to_string(), - ty: DeclarationId(738), - }, - Field { - label: "measure".to_string(), - ty: DeclarationId(736), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 18312, 18359), - }); - declarations.push(Declaration { - id: DeclarationId(1637), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(777), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 18628, 18643), - }); - declarations.push(Declaration { - id: DeclarationId(1638), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(736), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 18717, 18729), - }); - declarations.push(Declaration { - id: DeclarationId(1639), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 18970, 18979), - }); - declarations.push(Declaration { - id: DeclarationId(1640), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(821), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19037, 19053), - }); - declarations.push(Declaration { - id: DeclarationId(1641), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(833), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19117, 19141), - }); - declarations.push(Declaration { - id: DeclarationId(1642), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19555, 19567), - }); - declarations.push(Declaration { - id: DeclarationId(1643), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(736), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19645, 19657), - }); - declarations.push(Declaration { - id: DeclarationId(1644), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(777), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19695, 19710), - }); - declarations.push(Declaration { - id: DeclarationId(1645), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(836), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19733, 19755), - }); - declarations.push(Declaration { - id: DeclarationId(1646), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(831), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19847, 19863), - }); - declarations.push(Declaration { - id: DeclarationId(1647), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(832), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19868, 19892), - }); - declarations.push(Declaration { - id: DeclarationId(1648), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(834), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19897, 19915), - }); - declarations.push(Declaration { - id: DeclarationId(1649), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(835), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19920, 19934), - }); - declarations.push(Declaration { - id: DeclarationId(1650), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(837), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19939, 19953), - }); - declarations.push(Declaration { - id: DeclarationId(1651), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(810), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19982, 19999), - }); - declarations.push(Declaration { - id: DeclarationId(1652), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(838), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 20009, 20023), - }); - declarations.push(Declaration { - id: DeclarationId(1653), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(792), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 20033, 20046), - }); - declarations.push(Declaration { - id: DeclarationId(1654), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(828), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 20059, 20072), - }); - declarations.push(Declaration { - id: DeclarationId(1655), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(736), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 26155, 26173), - }); - declarations.push(Declaration { - id: DeclarationId(1656), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 26178, 26184), - }); - declarations.push(Declaration { - id: DeclarationId(1657), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(741), - arguments: vec![TemplateArgument { - parameter: DeclarationId(742), - value: DeclarationId(736), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 26217, 26241), - }); - declarations.push(Declaration { - id: DeclarationId(1658), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "candidates".to_string(), - ty: DeclarationId(1657), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 26189, 26243), - }); - declarations.push(Declaration { - id: DeclarationId(1659), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(863), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 2718, 2749), - }); - declarations.push(Declaration { - id: DeclarationId(1660), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "content".to_string(), - ty: DeclarationId(1659), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 2690, 2751), - }); - declarations.push(Declaration { - id: DeclarationId(1661), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(864), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 2784, 2820), - }); - declarations.push(Declaration { - id: DeclarationId(1662), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "content".to_string(), - ty: DeclarationId(1661), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 2756, 2822), - }); - declarations.push(Declaration { - id: DeclarationId(1663), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "media_type".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "base64".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 2999, 3064), - }); - declarations.push(Declaration { - id: DeclarationId(1664), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "url".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 3069, 3093), - }); - declarations.push(Declaration { - id: DeclarationId(1665), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 3788, 3810), - }); - declarations.push(Declaration { - id: DeclarationId(1666), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(861), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 3832, 3862), - }); - declarations.push(Declaration { - id: DeclarationId(1667), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1666), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 3815, 3863), - }); - declarations.push(Declaration { - id: DeclarationId(1668), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 5072, 5079), - }); - declarations.push(Declaration { - id: DeclarationId(1669), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 5205, 5217), - }); - declarations.push(Declaration { - id: DeclarationId(1670), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "text".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 5435, 5470), - }); - declarations.push(Declaration { - id: DeclarationId(1671), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "source".to_string(), - ty: DeclarationId(854), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 5475, 5518), - }); - declarations.push(Declaration { - id: DeclarationId(1672), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "source".to_string(), - ty: DeclarationId(862), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 5523, 5600), - }); - declarations.push(Declaration { - id: DeclarationId(1673), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(860), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 5690, 5724), - }); - declarations.push(Declaration { - id: DeclarationId(1674), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(856), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 5742, 5779), - }); - declarations.push(Declaration { - id: DeclarationId(1675), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(855), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 5801, 5814), - }); - declarations.push(Declaration { - id: DeclarationId(1676), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "source".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "title".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "content".to_string(), - ty: DeclarationId(1673), - }, - Field { - label: "citations".to_string(), - ty: DeclarationId(1674), - }, - Field { - label: "cache_control".to_string(), - ty: DeclarationId(1675), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 5605, 5820), - }); - declarations.push(Declaration { - id: DeclarationId(1677), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "tool_name".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 5825, 5874), - }); - declarations.push(Declaration { - id: DeclarationId(1678), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "text".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 6382, 6418), - }); - declarations.push(Declaration { - id: DeclarationId(1679), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(857), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 6486, 6513), - }); - declarations.push(Declaration { - id: DeclarationId(1680), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(124), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 6530, 6535), - }); - declarations.push(Declaration { - id: DeclarationId(1681), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "tool_use_id".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "content".to_string(), - ty: DeclarationId(1679), - }, - Field { - label: "is_error".to_string(), - ty: DeclarationId(1680), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 6423, 6541), - }); - declarations.push(Declaration { - id: DeclarationId(1682), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "text".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 6988, 7026), - }); - declarations.push(Declaration { - id: DeclarationId(1683), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "id".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "input".to_string(), - ty: DeclarationId(126), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 7031, 7114), - }); - declarations.push(Declaration { - id: DeclarationId(1684), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 7472, 7479), - }); - declarations.push(Declaration { - id: DeclarationId(1685), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 7484, 7493), - }); - declarations.push(Declaration { - id: DeclarationId(1686), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 7498, 7510), - }); - declarations.push(Declaration { - id: DeclarationId(1687), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 7515, 7522), - }); - declarations.push(Declaration { - id: DeclarationId(1688), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 7527, 7536), - }); - declarations.push(Declaration { - id: DeclarationId(1689), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 7541, 7548), - }); - declarations.push(Declaration { - id: DeclarationId(1690), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 7553, 7579), - }); - declarations.push(Declaration { - id: DeclarationId(1691), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 7891, 7898), - }); - declarations.push(Declaration { - id: DeclarationId(1692), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 7909, 7916), - }); - declarations.push(Declaration { - id: DeclarationId(1693), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "cited_text".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "document_index".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "document_title".to_string(), - ty: DeclarationId(1691), - }, - Field { - label: "file_id".to_string(), - ty: DeclarationId(1692), - }, - Field { - label: "start_char_index".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "end_char_index".to_string(), - ty: DeclarationId(87), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 7819, 7962), - }); - declarations.push(Declaration { - id: DeclarationId(1694), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8039, 8046), - }); - declarations.push(Declaration { - id: DeclarationId(1695), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8057, 8064), - }); - declarations.push(Declaration { - id: DeclarationId(1696), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "cited_text".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "document_index".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "document_title".to_string(), - ty: DeclarationId(1694), - }, - Field { - label: "file_id".to_string(), - ty: DeclarationId(1695), - }, - Field { - label: "start_page_number".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "end_page_number".to_string(), - ty: DeclarationId(87), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 7967, 8112), - }); - declarations.push(Declaration { - id: DeclarationId(1697), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8197, 8204), - }); - declarations.push(Declaration { - id: DeclarationId(1698), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8215, 8222), - }); - declarations.push(Declaration { - id: DeclarationId(1699), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "cited_text".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "document_index".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "document_title".to_string(), - ty: DeclarationId(1697), - }, - Field { - label: "file_id".to_string(), - ty: DeclarationId(1698), - }, - Field { - label: "start_block_index".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "end_block_index".to_string(), - ty: DeclarationId(87), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8117, 8270), - }); - declarations.push(Declaration { - id: DeclarationId(1700), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8353, 8360), - }); - declarations.push(Declaration { - id: DeclarationId(1701), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "cited_text".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "encrypted_index".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "title".to_string(), - ty: DeclarationId(1700), - }, - Field { - label: "url".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8275, 8375), - }); - declarations.push(Declaration { - id: DeclarationId(1702), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8446, 8453), - }); - declarations.push(Declaration { - id: DeclarationId(1703), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "cited_text".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "source".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "title".to_string(), - ty: DeclarationId(1702), - }, - Field { - label: "search_result_index".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "start_block_index".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "end_block_index".to_string(), - ty: DeclarationId(87), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8380, 8527), - }); - declarations.push(Declaration { - id: DeclarationId(1704), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(866), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9151, 9185), - }); - declarations.push(Declaration { - id: DeclarationId(1705), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(1704), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9151, 9186), - }); - declarations.push(Declaration { - id: DeclarationId(1706), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "text".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "citations".to_string(), - ty: DeclarationId(1705), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9106, 9188), - }); - declarations.push(Declaration { - id: DeclarationId(1707), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "thinking".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "signature".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9193, 9254), - }); - declarations.push(Declaration { - id: DeclarationId(1708), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "redacted_data".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9259, 9314), - }); - declarations.push(Declaration { - id: DeclarationId(1709), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(126), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9389, 9394), - }); - declarations.push(Declaration { - id: DeclarationId(1710), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "id".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "input".to_string(), - ty: DeclarationId(126), - }, - Field { - label: "caller".to_string(), - ty: DeclarationId(1709), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9319, 9396), - }); - declarations.push(Declaration { - id: DeclarationId(1711), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(126), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9494, 9499), - }); - declarations.push(Declaration { - id: DeclarationId(1712), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "id".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "name".to_string(), - ty: DeclarationId(868), - }, - Field { - label: "input".to_string(), - ty: DeclarationId(126), - }, - Field { - label: "caller".to_string(), - ty: DeclarationId(1711), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9401, 9501), - }); - declarations.push(Declaration { - id: DeclarationId(1713), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(126), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9585, 9590), - }); - declarations.push(Declaration { - id: DeclarationId(1714), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "tool_use_id".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "content".to_string(), - ty: DeclarationId(126), - }, - Field { - label: "caller".to_string(), - ty: DeclarationId(1713), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9506, 9592), - }); - declarations.push(Declaration { - id: DeclarationId(1715), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9813, 9822), - }); - declarations.push(Declaration { - id: DeclarationId(1716), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9827, 9835), - }); - declarations.push(Declaration { - id: DeclarationId(1717), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9840, 9853), - }); - declarations.push(Declaration { - id: DeclarationId(1718), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9858, 9875), - }); - declarations.push(Declaration { - id: DeclarationId(1719), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9880, 9903), - }); - declarations.push(Declaration { - id: DeclarationId(1720), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9908, 9927), - }); - declarations.push(Declaration { - id: DeclarationId(1721), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9932, 9950), - }); - declarations.push(Declaration { - id: DeclarationId(1722), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9955, 9962), - }); - declarations.push(Declaration { - id: DeclarationId(1723), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 10242, 10250), - }); - declarations.push(Declaration { - id: DeclarationId(1724), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 10255, 10263), - }); - declarations.push(Declaration { - id: DeclarationId(1725), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 10268, 10273), - }); - declarations.push(Declaration { - id: DeclarationId(1726), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(87), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 10523, 10527), - }); - declarations.push(Declaration { - id: DeclarationId(1727), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(87), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 10559, 10563), - }); - declarations.push(Declaration { - id: DeclarationId(1728), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(869), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 10595, 10627), - }); - declarations.push(Declaration { - id: DeclarationId(1729), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 10984, 10993), - }); - declarations.push(Declaration { - id: DeclarationId(1730), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(867), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 11479, 11517), - }); - declarations.push(Declaration { - id: DeclarationId(1731), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 11596, 11603), - }); - declarations.push(Declaration { - id: DeclarationId(1732), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(126), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 11664, 11669), - }); - declarations.push(Declaration { - id: DeclarationId(1733), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(853), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_messages.dag", 4503, 4529), - }); - declarations.push(Declaration { - id: DeclarationId(1734), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(109), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_messages.dag", 4566, 4572), - }); - declarations.push(Declaration { - id: DeclarationId(1735), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_messages.dag", 4589, 4596), - }); - declarations.push(Declaration { - id: DeclarationId(1736), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/bootstrap_authority.dag", 1013, 1025), - }); - declarations.push(Declaration { - id: DeclarationId(1737), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/bootstrap_authority.dag", 1030, 1044), - }); - declarations.push(Declaration { - id: DeclarationId(1738), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/bootstrap_authority.dag", 1049, 1064), - }); - declarations.push(Declaration { - id: DeclarationId(1739), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/bootstrap_authority.dag", 1069, 1086), - }); - declarations.push(Declaration { - id: DeclarationId(1740), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/bootstrap_authority.dag", 1091, 1114), - }); - declarations.push(Declaration { - id: DeclarationId(1741), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/bridge_ledger.dag", 5009, 5016), - }); - declarations.push(Declaration { - id: DeclarationId(1742), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/bridge_ledger.dag", 5021, 5025), - }); - declarations.push(Declaration { - id: DeclarationId(1743), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(880), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/bridge_ledger.dag", 7273, 7294), - }); - declarations.push(Declaration { - id: DeclarationId(1744), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 360, 369), - }); - declarations.push(Declaration { - id: DeclarationId(1745), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 374, 381), - }); - declarations.push(Declaration { - id: DeclarationId(1746), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 614, 618), - }); - declarations.push(Declaration { - id: DeclarationId(1747), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 623, 632), - }); - declarations.push(Declaration { - id: DeclarationId(1748), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 910, 921), - }); - declarations.push(Declaration { - id: DeclarationId(1749), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 926, 935), - }); - declarations.push(Declaration { - id: DeclarationId(1750), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 1166, 1173), - }); - declarations.push(Declaration { - id: DeclarationId(1751), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 1178, 1187), - }); - declarations.push(Declaration { - id: DeclarationId(1752), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 2035, 2044), - }); - declarations.push(Declaration { - id: DeclarationId(1753), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 2049, 2065), - }); - declarations.push(Declaration { - id: DeclarationId(1754), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 2070, 2080), - }); - declarations.push(Declaration { - id: DeclarationId(1755), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 2085, 2099), - }); - declarations.push(Declaration { - id: DeclarationId(1756), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 2385, 2399), - }); - declarations.push(Declaration { - id: DeclarationId(1757), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 2404, 2418), - }); - declarations.push(Declaration { - id: DeclarationId(1758), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 2818, 2830), - }); - declarations.push(Declaration { - id: DeclarationId(1759), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 3210, 3222), - }); - declarations.push(Declaration { - id: DeclarationId(1760), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 3694, 3708), - }); - declarations.push(Declaration { - id: DeclarationId(1761), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation_model.dag", 3713, 3729), - }); - declarations.push(Declaration { - id: DeclarationId(1762), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "value".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/coproduct_projection.dag", 6759, 6786), - }); - declarations.push(Declaration { - id: DeclarationId(1763), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/coproduct_projection.dag", 7611, 7616), - }); - declarations.push(Declaration { - id: DeclarationId(1764), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/coproduct_projection.dag", 7621, 7630), - }); - declarations.push(Declaration { - id: DeclarationId(1765), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(895), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(898), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/coproduct_projection.dag", 9513, 9555), - }); - declarations.push(Declaration { - id: DeclarationId(1766), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1337), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/integer_diagnostic_order.dag", 1234, 1254), - }); - declarations.push(Declaration { - id: DeclarationId(1767), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1337), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/integer_diagnostic_order.dag", 1414, 1434), - }); - declarations.push(Declaration { - id: DeclarationId(1768), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(906), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(907), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lookup.dag", 1414, 1429), - }); - declarations.push(Declaration { - id: DeclarationId(1769), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(907), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lookup.dag", 1444, 1450), - }); - declarations.push(Declaration { - id: DeclarationId(1770), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(908), - arguments: vec![TemplateArgument { - parameter: DeclarationId(909), - value: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lookup.dag", 4985, 4996), - }); - declarations.push(Declaration { - id: DeclarationId(1771), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(908), - arguments: vec![TemplateArgument { - parameter: DeclarationId(909), - value: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lookup.dag", 5038, 5049), - }); - declarations.push(Declaration { - id: DeclarationId(1772), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lookup.dag", 4940, 4944), - }); - declarations.push(Declaration { - id: DeclarationId(1773), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(909), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lookup.dag", 4949, 4959), - }); - declarations.push(Declaration { - id: DeclarationId(1774), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(908), - arguments: vec![TemplateArgument { - parameter: DeclarationId(909), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 10942, 10962), - }); - declarations.push(Declaration { - id: DeclarationId(1775), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(908), - arguments: vec![TemplateArgument { - parameter: DeclarationId(909), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 11026, 11046), - }); - declarations.push(Declaration { - id: DeclarationId(1776), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(741), - arguments: vec![TemplateArgument { - parameter: DeclarationId(742), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 11114, 11144), - }); - declarations.push(Declaration { - id: DeclarationId(1777), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 11611, 11629), - }); - declarations.push(Declaration { - id: DeclarationId(1778), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(741), - arguments: vec![TemplateArgument { - parameter: DeclarationId(742), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 11635, 11665), - }); - declarations.push(Declaration { - id: DeclarationId(1779), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 14162, 14180), - }); - declarations.push(Declaration { - id: DeclarationId(1780), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(741), - arguments: vec![TemplateArgument { - parameter: DeclarationId(742), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 22217, 22247), - }); - declarations.push(Declaration { - id: DeclarationId(1781), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 22252, 22270), - }); - declarations.push(Declaration { - id: DeclarationId(1782), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 22530, 22548), - }); - declarations.push(Declaration { - id: DeclarationId(1783), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 22553, 22571), - }); - declarations.push(Declaration { - id: DeclarationId(1784), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 23044, 23062), - }); - declarations.push(Declaration { - id: DeclarationId(1785), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 23067, 23085), - }); - declarations.push(Declaration { - id: DeclarationId(1786), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 23186, 23204), - }); - declarations.push(Declaration { - id: DeclarationId(1787), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 23524, 23542), - }); - declarations.push(Declaration { - id: DeclarationId(1788), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 23547, 23565), - }); - declarations.push(Declaration { - id: DeclarationId(1789), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 25113, 25131), - }); - declarations.push(Declaration { - id: DeclarationId(1790), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 25384, 25402), - }); - declarations.push(Declaration { - id: DeclarationId(1791), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 25850, 25868), - }); - declarations.push(Declaration { - id: DeclarationId(1792), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 27885, 27903), - }); - declarations.push(Declaration { - id: DeclarationId(1793), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 27933, 27951), - }); - declarations.push(Declaration { - id: DeclarationId(1794), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 28238, 28256), - }); - declarations.push(Declaration { - id: DeclarationId(1795), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 28284, 28302), - }); - declarations.push(Declaration { - id: DeclarationId(1796), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 28662, 28680), - }); - declarations.push(Declaration { - id: DeclarationId(1797), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 28685, 28703), - }); - declarations.push(Declaration { - id: DeclarationId(1798), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 4953, 4965), - }); - declarations.push(Declaration { - id: DeclarationId(1799), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 4970, 4986), - }); - declarations.push(Declaration { - id: DeclarationId(1800), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 4991, 5005), - }); - declarations.push(Declaration { - id: DeclarationId(1801), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 5855, 5868), - }); - declarations.push(Declaration { - id: DeclarationId(1802), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 5873, 5888), - }); - declarations.push(Declaration { - id: DeclarationId(1803), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 5893, 5909), - }); - declarations.push(Declaration { - id: DeclarationId(1804), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 5914, 5927), - }); - declarations.push(Declaration { - id: DeclarationId(1805), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(912), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 6780, 6801), - }); - declarations.push(Declaration { - id: DeclarationId(1806), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(913), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 6816, 6826), - }); - declarations.push(Declaration { - id: DeclarationId(1807), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(87), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 6856, 6860), - }); - declarations.push(Declaration { - id: DeclarationId(1808), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 7429, 7436), - }); - declarations.push(Declaration { - id: DeclarationId(1809), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 8405, 8414), - }); - declarations.push(Declaration { - id: DeclarationId(1810), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "previous".to_string(), - ty: DeclarationId(918), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 8419, 8465), - }); - declarations.push(Declaration { - id: DeclarationId(1811), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 9506, 9523), - }); - declarations.push(Declaration { - id: DeclarationId(1812), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(915), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 9528, 9552), - }); - declarations.push(Declaration { - id: DeclarationId(1813), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "var".to_string(), - ty: DeclarationId(915), - }, - Field { - label: "degree".to_string(), - ty: DeclarationId(918), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 9557, 9619), - }); - declarations.push(Declaration { - id: DeclarationId(1814), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(741), - arguments: vec![TemplateArgument { - parameter: DeclarationId(742), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 9636, 9666), - }); - declarations.push(Declaration { - id: DeclarationId(1815), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1814), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 9624, 9667), - }); - declarations.push(Declaration { - id: DeclarationId(1816), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(741), - arguments: vec![TemplateArgument { - parameter: DeclarationId(742), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 9680, 9710), - }); - declarations.push(Declaration { - id: DeclarationId(1817), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1816), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 9672, 9711), - }); - declarations.push(Declaration { - id: DeclarationId(1818), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(915), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 9716, 9737), - }); - declarations.push(Declaration { - id: DeclarationId(1819), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 9742, 9761), - }); - declarations.push(Declaration { - id: DeclarationId(1820), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(31), - arguments: vec![TemplateArgument { - parameter: DeclarationId(32), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 9479, 9501), - }); - declarations.push(Declaration { - id: DeclarationId(1821), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 18143, 18156), - }); - declarations.push(Declaration { - id: DeclarationId(1822), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 18161, 18169), - }); - declarations.push(Declaration { - id: DeclarationId(1823), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 18174, 18185), - }); - declarations.push(Declaration { - id: DeclarationId(1824), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 18190, 18207), - }); - declarations.push(Declaration { - id: DeclarationId(1825), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 18212, 18226), - }); - declarations.push(Declaration { - id: DeclarationId(1826), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "degree".to_string(), - ty: DeclarationId(1149), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 18231, 18280), - }); - declarations.push(Declaration { - id: DeclarationId(1827), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 18285, 18301), - }); - declarations.push(Declaration { - id: DeclarationId(1828), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 18306, 18318), - }); - declarations.push(Declaration { - id: DeclarationId(1829), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(43), - arguments: vec![TemplateArgument { - parameter: DeclarationId(44), - value: DeclarationId(935), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 18107, 18138), - }); - declarations.push(Declaration { - id: DeclarationId(1830), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(705), - arguments: vec![TemplateArgument { - parameter: DeclarationId(706), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 11495, 11507), - }); - declarations.push(Declaration { - id: DeclarationId(1831), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(742)], - output: DeclarationId(124), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 5879, 5892), - }); - declarations.push(Declaration { - id: DeclarationId(1832), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(718), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(719), - value: DeclarationId(919), - }, - TemplateArgument { - parameter: DeclarationId(1459), - value: DeclarationId(926), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 11488, 11535), - }); - declarations.push(Declaration { - id: DeclarationId(1833), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(705), - arguments: vec![TemplateArgument { - parameter: DeclarationId(706), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 11795, 11810), - }); - declarations.push(Declaration { - id: DeclarationId(1834), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(919), DeclarationId(919)], - output: DeclarationId(919), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 4183, 4196), - }); - declarations.push(Declaration { - id: DeclarationId(1835), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(707), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(709), - value: DeclarationId(919), - }, - TemplateArgument { - parameter: DeclarationId(708), - value: DeclarationId(919), - }, - TemplateArgument { - parameter: DeclarationId(1449), - value: DeclarationId(930), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 14202, 14245), - }); - declarations.push(Declaration { - id: DeclarationId(1836), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(920), DeclarationId(708)], - output: DeclarationId(920), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 4183, 4196), - }); - declarations.push(Declaration { - id: DeclarationId(1837), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(707), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(709), - value: DeclarationId(920), - }, - TemplateArgument { - parameter: DeclarationId(1449), - value: DeclarationId(956), - }, - TemplateArgument { - parameter: DeclarationId(708), - value: DeclarationId(919), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 16911, 17021), - }); - declarations.push(Declaration { - id: DeclarationId(1838), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(920), DeclarationId(708)], - output: DeclarationId(920), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 4183, 4196), - }); - declarations.push(Declaration { - id: DeclarationId(1839), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(707), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(709), - value: DeclarationId(920), - }, - TemplateArgument { - parameter: DeclarationId(1449), - value: DeclarationId(956), - }, - TemplateArgument { - parameter: DeclarationId(708), - value: DeclarationId(919), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 17076, 17186), - }); - declarations.push(Declaration { - id: DeclarationId(1840), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(703), - arguments: vec![TemplateArgument { - parameter: DeclarationId(704), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 22293, 22323), - }); - declarations.push(Declaration { - id: DeclarationId(1841), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(703), - arguments: vec![TemplateArgument { - parameter: DeclarationId(704), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 22275, 22324), - }); - declarations.push(Declaration { - id: DeclarationId(1842), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(701), - arguments: vec![TemplateArgument { - parameter: DeclarationId(702), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 22603, 22610), - }); - declarations.push(Declaration { - id: DeclarationId(1843), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(703), - arguments: vec![TemplateArgument { - parameter: DeclarationId(704), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 22737, 22789), - }); - declarations.push(Declaration { - id: DeclarationId(1844), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(701), - arguments: vec![TemplateArgument { - parameter: DeclarationId(702), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 23140, 23147), - }); - declarations.push(Declaration { - id: DeclarationId(1845), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(703), - arguments: vec![TemplateArgument { - parameter: DeclarationId(704), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 23118, 23148), - }); - declarations.push(Declaration { - id: DeclarationId(1846), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(701), - arguments: vec![TemplateArgument { - parameter: DeclarationId(702), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 23597, 23604), - }); - declarations.push(Declaration { - id: DeclarationId(1847), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(703), - arguments: vec![TemplateArgument { - parameter: DeclarationId(704), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 23735, 23792), - }); - declarations.push(Declaration { - id: DeclarationId(1848), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(703), - arguments: vec![TemplateArgument { - parameter: DeclarationId(704), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 25317, 25349), - }); - declarations.push(Declaration { - id: DeclarationId(1849), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(701), - arguments: vec![TemplateArgument { - parameter: DeclarationId(702), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 27988, 27995), - }); - declarations.push(Declaration { - id: DeclarationId(1850), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(703), - arguments: vec![TemplateArgument { - parameter: DeclarationId(704), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 28136, 28201), - }); - declarations.push(Declaration { - id: DeclarationId(1851), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(920), DeclarationId(919)], - output: DeclarationId(920), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 4183, 4196), - }); - declarations.push(Declaration { - id: DeclarationId(1852), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(707), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(709), - value: DeclarationId(920), - }, - TemplateArgument { - parameter: DeclarationId(708), - value: DeclarationId(919), - }, - TemplateArgument { - parameter: DeclarationId(1449), - value: DeclarationId(956), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 28319, 28377), - }); - declarations.push(Declaration { - id: DeclarationId(1853), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(703), - arguments: vec![TemplateArgument { - parameter: DeclarationId(704), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 28403, 28449), - }); - declarations.push(Declaration { - id: DeclarationId(1854), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(701), - arguments: vec![TemplateArgument { - parameter: DeclarationId(702), - value: DeclarationId(919), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 28720, 28727), - }); - declarations.push(Declaration { - id: DeclarationId(1855), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1797), DeclarationId(919)], - output: DeclarationId(1797), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/list.dag", 4183, 4196), - }); - declarations.push(Declaration { - id: DeclarationId(1856), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(707), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(709), - value: DeclarationId(1797), - }, - TemplateArgument { - parameter: DeclarationId(708), - value: DeclarationId(919), - }, - TemplateArgument { - parameter: DeclarationId(1449), - value: DeclarationId(959), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 28708, 28749), - }); - declarations.push(Declaration { - id: DeclarationId(1857), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(963), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/services.dag", 5738, 5761), - }); - declarations.push(Declaration { - id: DeclarationId(1858), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(966), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_operations.dag", 6546, 6561), - }); - declarations.push(Declaration { - id: DeclarationId(1859), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(970), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 2751, 2763), - }); - declarations.push(Declaration { - id: DeclarationId(1860), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(736), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 2961, 2968), - }); - declarations.push(Declaration { - id: DeclarationId(1861), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 5779, 5786), - }); - declarations.push(Declaration { - id: DeclarationId(1862), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(87), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 6710, 6714), - }); - declarations.push(Declaration { - id: DeclarationId(1863), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(981), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 7761, 7780), - }); - declarations.push(Declaration { - id: DeclarationId(1864), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(981), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 8326, 8345), - }); - declarations.push(Declaration { - id: DeclarationId(1865), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "param".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 1430, 1462), - }); - declarations.push(Declaration { - id: DeclarationId(1866), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "witness".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 1467, 1503), - }); - declarations.push(Declaration { - id: DeclarationId(1867), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "element".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 1508, 1545), - }); - declarations.push(Declaration { - id: DeclarationId(1868), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "param".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 1550, 1576), - }); - declarations.push(Declaration { - id: DeclarationId(1869), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "param".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 1581, 1614), - }); - declarations.push(Declaration { - id: DeclarationId(1870), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 1619, 1636), - }); - declarations.push(Declaration { - id: DeclarationId(1871), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "steps".to_string(), - ty: DeclarationId(1149), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 1641, 1695), - }); - declarations.push(Declaration { - id: DeclarationId(1872), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 1700, 1707), - }); - declarations.push(Declaration { - id: DeclarationId(1873), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "accessor".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 2059, 2097), - }); - declarations.push(Declaration { - id: DeclarationId(1874), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "amount".to_string(), - ty: DeclarationId(1149), - }, - Field { - label: "collection".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 2102, 2176), - }); - declarations.push(Declaration { - id: DeclarationId(1875), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "steps".to_string(), - ty: DeclarationId(1149), - }, - Field { - label: "ring_param".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 2181, 2256), - }); - declarations.push(Declaration { - id: DeclarationId(1876), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "divisor".to_string(), - ty: DeclarationId(1151), - }, - Field { - label: "ring_param".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 2261, 2334), - }); - declarations.push(Declaration { - id: DeclarationId(1877), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "witness".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 2339, 2376), - }); - declarations.push(Declaration { - id: DeclarationId(1878), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "element".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 2381, 2418), - }); - declarations.push(Declaration { - id: DeclarationId(1879), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "outer_collection".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 2423, 2464), - }); - declarations.push(Declaration { - id: DeclarationId(1880), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 2469, 2485), - }); - declarations.push(Declaration { - id: DeclarationId(1881), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 3221, 3231), - }); - declarations.push(Declaration { - id: DeclarationId(1882), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "steps".to_string(), - ty: DeclarationId(1149), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 3236, 3283), - }); - declarations.push(Declaration { - id: DeclarationId(1883), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "divisor".to_string(), - ty: DeclarationId(1151), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 3288, 3339), - }); - declarations.push(Declaration { - id: DeclarationId(1884), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 3529, 3533), - }); - declarations.push(Declaration { - id: DeclarationId(1885), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 3538, 3545), - }); - declarations.push(Declaration { - id: DeclarationId(1886), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 3550, 3556), - }); - declarations.push(Declaration { - id: DeclarationId(1887), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(973), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 3859, 3872), - }); - declarations.push(Declaration { - id: DeclarationId(1888), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 7493, 7504), - }); - declarations.push(Declaration { - id: DeclarationId(1889), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 7553, 7567), - }); - declarations.push(Declaration { - id: DeclarationId(1890), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 7632, 7648), - }); - declarations.push(Declaration { - id: DeclarationId(1891), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emission_provenance.dag", 3709, 3721), - }); - declarations.push(Declaration { - id: DeclarationId(1892), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "value".to_string(), - ty: DeclarationId(155), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emission_provenance.dag", 3726, 3762), - }); - declarations.push(Declaration { - id: DeclarationId(1893), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(990), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 855, 873), - }); - declarations.push(Declaration { - id: DeclarationId(1894), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 4373, 4389), - }); - declarations.push(Declaration { - id: DeclarationId(1895), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(799), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 4394, 4422), - }); - declarations.push(Declaration { - id: DeclarationId(1896), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 4665, 4686), - }); - declarations.push(Declaration { - id: DeclarationId(1897), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 5176, 5195), - }); - declarations.push(Declaration { - id: DeclarationId(1898), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 5200, 5222), - }); - declarations.push(Declaration { - id: DeclarationId(1899), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(995), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 5591, 5614), - }); - declarations.push(Declaration { - id: DeclarationId(1900), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 6611, 6619), - }); - declarations.push(Declaration { - id: DeclarationId(1901), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 6624, 6632), - }); - declarations.push(Declaration { - id: DeclarationId(1902), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 7073, 7078), - }); - declarations.push(Declaration { - id: DeclarationId(1903), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 7083, 7091), - }); - declarations.push(Declaration { - id: DeclarationId(1904), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 7427, 7440), - }); - declarations.push(Declaration { - id: DeclarationId(1905), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 7445, 7451), - }); - declarations.push(Declaration { - id: DeclarationId(1906), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 7709, 7717), - }); - declarations.push(Declaration { - id: DeclarationId(1907), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 7722, 7727), - }); - declarations.push(Declaration { - id: DeclarationId(1908), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 7732, 7745), - }); - declarations.push(Declaration { - id: DeclarationId(1909), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 8082, 8100), - }); - declarations.push(Declaration { - id: DeclarationId(1910), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 9475, 9484), - }); - declarations.push(Declaration { - id: DeclarationId(1911), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 9489, 9502), - }); - declarations.push(Declaration { - id: DeclarationId(1912), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 9507, 9515), - }); - declarations.push(Declaration { - id: DeclarationId(1913), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 9520, 9530), - }); - declarations.push(Declaration { - id: DeclarationId(1914), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 9535, 9545), - }); - declarations.push(Declaration { - id: DeclarationId(1915), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 9550, 9561), - }); - declarations.push(Declaration { - id: DeclarationId(1916), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 9566, 9574), - }); - declarations.push(Declaration { - id: DeclarationId(1917), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 9579, 9586), - }); - declarations.push(Declaration { - id: DeclarationId(1918), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 9591, 9601), - }); - declarations.push(Declaration { - id: DeclarationId(1919), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 9606, 9618), - }); - declarations.push(Declaration { - id: DeclarationId(1920), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 12311, 12337), - }); - declarations.push(Declaration { - id: DeclarationId(1921), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 12342, 12352), - }); - declarations.push(Declaration { - id: DeclarationId(1922), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 17117, 17123), - }); - declarations.push(Declaration { - id: DeclarationId(1923), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 17128, 17139), - }); - declarations.push(Declaration { - id: DeclarationId(1924), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 17459, 17470), - }); - declarations.push(Declaration { - id: DeclarationId(1925), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 17475, 17486), - }); - declarations.push(Declaration { - id: DeclarationId(1926), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 19419, 19430), - }); - declarations.push(Declaration { - id: DeclarationId(1927), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 19435, 19443), - }); - declarations.push(Declaration { - id: DeclarationId(1928), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "template".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 20606, 20641), - }); - declarations.push(Declaration { - id: DeclarationId(1929), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "inline_template".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "fn_ref_template".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/emit_model.dag", 20646, 20734), - }); - declarations.push(Declaration { - id: DeclarationId(1930), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 2224, 2238), - }); - declarations.push(Declaration { - id: DeclarationId(1931), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 2243, 2268), - }); - declarations.push(Declaration { - id: DeclarationId(1932), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 2273, 2283), - }); - declarations.push(Declaration { - id: DeclarationId(1933), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 2548, 2565), - }); - declarations.push(Declaration { - id: DeclarationId(1934), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 2570, 2594), - }); - declarations.push(Declaration { - id: DeclarationId(1935), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 2599, 2631), - }); - declarations.push(Declaration { - id: DeclarationId(1936), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 2636, 2663), - }); - declarations.push(Declaration { - id: DeclarationId(1937), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 3369, 3393), - }); - declarations.push(Declaration { - id: DeclarationId(1938), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 3398, 3430), - }); - declarations.push(Declaration { - id: DeclarationId(1939), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 3564, 3588), - }); - declarations.push(Declaration { - id: DeclarationId(1940), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 3593, 3614), - }); - declarations.push(Declaration { - id: DeclarationId(1941), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 3619, 3637), - }); - declarations.push(Declaration { - id: DeclarationId(1942), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 3781, 3796), - }); - declarations.push(Declaration { - id: DeclarationId(1943), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 3801, 3831), - }); - declarations.push(Declaration { - id: DeclarationId(1944), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 3836, 3857), - }); - declarations.push(Declaration { - id: DeclarationId(1945), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 4024, 4044), - }); - declarations.push(Declaration { - id: DeclarationId(1946), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 4049, 4076), - }); - declarations.push(Declaration { - id: DeclarationId(1947), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 4081, 4095), - }); - declarations.push(Declaration { - id: DeclarationId(1948), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 4354, 4362), - }); - declarations.push(Declaration { - id: DeclarationId(1949), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 4367, 4393), - }); - declarations.push(Declaration { - id: DeclarationId(1950), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 4398, 4423), - }); - declarations.push(Declaration { - id: DeclarationId(1951), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 5320, 5332), - }); - declarations.push(Declaration { - id: DeclarationId(1952), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 5693, 5713), - }); - declarations.push(Declaration { - id: DeclarationId(1953), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 5718, 5736), - }); - declarations.push(Declaration { - id: DeclarationId(1954), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 5741, 5759), - }); - declarations.push(Declaration { - id: DeclarationId(1955), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/clean_emission.dag", 5764, 5791), - }); - declarations.push(Declaration { - id: DeclarationId(1956), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/cross_target_coverage.dag", 3853, 3857), - }); - declarations.push(Declaration { - id: DeclarationId(1957), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/cross_target_coverage.dag", 3860, 3864), - }); - declarations.push(Declaration { - id: DeclarationId(1958), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/cross_target_coverage.dag", 3867, 3871), - }); - declarations.push(Declaration { - id: DeclarationId(1959), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/cross_target_coverage.dag", 3874, 3879), - }); - declarations.push(Declaration { - id: DeclarationId(1960), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/cross_target_coverage.dag", 3882, 3893), - }); - declarations.push(Declaration { - id: DeclarationId(1961), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/cross_target_coverage.dag", 3896, 3909), - }); - declarations.push(Declaration { - id: DeclarationId(1962), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/cross_target_coverage.dag", 4489, 4494), - }); - declarations.push(Declaration { - id: DeclarationId(1963), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/cross_target_coverage.dag", 4497, 4506), - }); - declarations.push(Declaration { - id: DeclarationId(1964), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/cross_target_coverage.dag", 4509, 4515), - }); - declarations.push(Declaration { - id: DeclarationId(1965), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/cross_target_coverage.dag", 4518, 4522), - }); - declarations.push(Declaration { - id: DeclarationId(1966), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/cross_target_coverage.dag", 4525, 4529), - }); - declarations.push(Declaration { - id: DeclarationId(1967), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1045), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/cross_target_coverage.dag", 5923, 5941), - }); - declarations.push(Declaration { - id: DeclarationId(1968), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1046), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/cross_target_coverage.dag", 6396, 6424), - }); - declarations.push(Declaration { - id: DeclarationId(1969), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 1099, 1113), - }); - declarations.push(Declaration { - id: DeclarationId(1970), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 1118, 1128), - }); - declarations.push(Declaration { - id: DeclarationId(1971), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 1133, 1145), - }); - declarations.push(Declaration { - id: DeclarationId(1972), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 1150, 1163), - }); - declarations.push(Declaration { - id: DeclarationId(1973), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 1168, 1180), - }); - declarations.push(Declaration { - id: DeclarationId(1974), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 1185, 1197), - }); - declarations.push(Declaration { - id: DeclarationId(1975), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 1202, 1224), - }); - declarations.push(Declaration { - id: DeclarationId(1976), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 1229, 1248), - }); - declarations.push(Declaration { - id: DeclarationId(1977), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 1253, 1278), - }); - declarations.push(Declaration { - id: DeclarationId(1978), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 1283, 1306), - }); - declarations.push(Declaration { - id: DeclarationId(1979), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "witness".to_string(), - ty: DeclarationId(1049), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 2916, 2961), - }); - declarations.push(Declaration { - id: DeclarationId(1980), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "reason".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "retirement_plan".to_string(), - ty: DeclarationId(1050), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 2966, 3036), - }); - declarations.push(Declaration { - id: DeclarationId(1981), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1048), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 6777, 6813), - }); - declarations.push(Declaration { - id: DeclarationId(1982), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1053), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 6818, 6859), - }); - declarations.push(Declaration { - id: DeclarationId(1983), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "unspecified_axis".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 10445, 10486), - }); - declarations.push(Declaration { - id: DeclarationId(1984), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 10783, 10795), - }); - declarations.push(Declaration { - id: DeclarationId(1985), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 11065, 11077), - }); - declarations.push(Declaration { - id: DeclarationId(1986), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "binding".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "sites".to_string(), - ty: DeclarationId(1985), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 11022, 11079), - }); - declarations.push(Declaration { - id: DeclarationId(1987), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "construct".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 11389, 11423), - }); - declarations.push(Declaration { - id: DeclarationId(1988), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "detail".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 11826, 11877), - }); - declarations.push(Declaration { - id: DeclarationId(1989), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 12220, 12238), - }); - declarations.push(Declaration { - id: DeclarationId(1990), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "connective".to_string(), - ty: DeclarationId(1042), - }, - Field { - label: "behavior".to_string(), - ty: DeclarationId(1043), - }, - Field { - label: "target".to_string(), - ty: DeclarationId(1038), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/diagnostics.dag", 12627, 12739), - }); - declarations.push(Declaration { - id: DeclarationId(1991), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(37), - arguments: vec![TemplateArgument { - parameter: DeclarationId(38), - value: DeclarationId(1077), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 5755, 5775), - }); - declarations.push(Declaration { - id: DeclarationId(1992), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1065), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(1066), - value: DeclarationId(1076), - }, - TemplateArgument { - parameter: DeclarationId(1067), - value: DeclarationId(1077), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 5785, 5809), - }); - declarations.push(Declaration { - id: DeclarationId(1993), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1065), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(1066), - value: DeclarationId(1076), - }, - TemplateArgument { - parameter: DeclarationId(1067), - value: DeclarationId(1077), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 5820, 5844), - }); - declarations.push(Declaration { - id: DeclarationId(1994), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1065), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(1066), - value: DeclarationId(1076), - }, - TemplateArgument { - parameter: DeclarationId(1067), - value: DeclarationId(1077), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 5850, 5874), - }); - declarations.push(Declaration { - id: DeclarationId(1995), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(37), - arguments: vec![TemplateArgument { - parameter: DeclarationId(38), - value: DeclarationId(1080), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 5951, 5971), - }); - declarations.push(Declaration { - id: DeclarationId(1996), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1065), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(1066), - value: DeclarationId(1079), - }, - TemplateArgument { - parameter: DeclarationId(1067), - value: DeclarationId(1080), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 5981, 6005), - }); - declarations.push(Declaration { - id: DeclarationId(1997), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1065), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(1066), - value: DeclarationId(1079), - }, - TemplateArgument { - parameter: DeclarationId(1067), - value: DeclarationId(1080), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 6016, 6040), - }); - declarations.push(Declaration { - id: DeclarationId(1998), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1065), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(1066), - value: DeclarationId(1079), - }, - TemplateArgument { - parameter: DeclarationId(1067), - value: DeclarationId(1080), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 6046, 6070), - }); - declarations.push(Declaration { - id: DeclarationId(1999), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(37), - arguments: vec![TemplateArgument { - parameter: DeclarationId(38), - value: DeclarationId(1083), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 6154, 6174), - }); - declarations.push(Declaration { - id: DeclarationId(2000), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1065), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(1066), - value: DeclarationId(1082), - }, - TemplateArgument { - parameter: DeclarationId(1067), - value: DeclarationId(1083), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 6185, 6209), - }); - declarations.push(Declaration { - id: DeclarationId(2001), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1065), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(1066), - value: DeclarationId(1082), - }, - TemplateArgument { - parameter: DeclarationId(1067), - value: DeclarationId(1083), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 6234, 6258), - }); - declarations.push(Declaration { - id: DeclarationId(2002), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(37), - arguments: vec![TemplateArgument { - parameter: DeclarationId(38), - value: DeclarationId(1086), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 6349, 6369), - }); - declarations.push(Declaration { - id: DeclarationId(2003), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1065), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(1066), - value: DeclarationId(1085), - }, - TemplateArgument { - parameter: DeclarationId(1067), - value: DeclarationId(1086), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 6380, 6404), - }); - declarations.push(Declaration { - id: DeclarationId(2004), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1065), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(1066), - value: DeclarationId(1085), - }, - TemplateArgument { - parameter: DeclarationId(1067), - value: DeclarationId(1086), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 6429, 6453), - }); - declarations.push(Declaration { - id: DeclarationId(2005), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(838), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 2385, 2405), - }); - declarations.push(Declaration { - id: DeclarationId(2006), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "port".to_string(), - ty: DeclarationId(736), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 2410, 2452), - }); - declarations.push(Declaration { - id: DeclarationId(2007), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "producer".to_string(), - ty: DeclarationId(735), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 2457, 2503), - }); - declarations.push(Declaration { - id: DeclarationId(2008), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1059), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 2531, 2548), - }); - declarations.push(Declaration { - id: DeclarationId(2009), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "reason".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "subject".to_string(), - ty: DeclarationId(1057), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 2553, 2606), - }); - declarations.push(Declaration { - id: DeclarationId(2010), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 2788, 2800), - }); - declarations.push(Declaration { - id: DeclarationId(2011), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "value".to_string(), - ty: DeclarationId(1055), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 2805, 2841), - }); - declarations.push(Declaration { - id: DeclarationId(2012), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1058), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1062), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 3323, 3339), - }); - declarations.push(Declaration { - id: DeclarationId(2013), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(2012), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 3318, 3340), - }); - declarations.push(Declaration { - id: DeclarationId(2014), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "dimension_name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "composed".to_string(), - ty: DeclarationId(1062), - }, - Field { - label: "witnesses".to_string(), - ty: DeclarationId(2013), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 3234, 3346), - }); - declarations.push(Declaration { - id: DeclarationId(2015), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1055), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 3414, 3430), - }); - declarations.push(Declaration { - id: DeclarationId(2016), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1058), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1062), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 3453, 3469), - }); - declarations.push(Declaration { - id: DeclarationId(2017), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(2016), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 3448, 3470), - }); - declarations.push(Declaration { - id: DeclarationId(2018), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "dimension_name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "violations".to_string(), - ty: DeclarationId(2015), - }, - Field { - label: "witnesses".to_string(), - ty: DeclarationId(2017), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 3351, 3476), - }); - declarations.push(Declaration { - id: DeclarationId(2019), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1058), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1064), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 4811, 4827), - }); - declarations.push(Declaration { - id: DeclarationId(2020), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839), DeclarationId(838)], - output: DeclarationId(2019), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 4790, 4827), - }); - declarations.push(Declaration { - id: DeclarationId(2021), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(19), - arguments: vec![TemplateArgument { - parameter: DeclarationId(20), - value: DeclarationId(1064), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 4839, 4854), - }); - declarations.push(Declaration { - id: DeclarationId(2022), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(838), DeclarationId(1064)], - output: DeclarationId(1060), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 4875, 4918), - }); - declarations.push(Declaration { - id: DeclarationId(2023), - name: Some("DimensionUnitAbelianGroup".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(25), - arguments: vec![TemplateArgument { - parameter: DeclarationId(26), - value: DeclarationId(1066), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/dimensions.dag", 5561, 5611), - }); - declarations.push(Declaration { - id: DeclarationId(2024), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1025), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/go_method_template_contracts.dag", 6894, 6922), - }); - declarations.push(Declaration { - id: DeclarationId(2025), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1058), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1098), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens.dag", 4180, 4190), - }); - declarations.push(Declaration { - id: DeclarationId(2026), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839), DeclarationId(838)], - output: DeclarationId(2025), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens.dag", 4159, 4190), - }); - declarations.push(Declaration { - id: DeclarationId(2027), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(19), - arguments: vec![TemplateArgument { - parameter: DeclarationId(20), - value: DeclarationId(1098), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens.dag", 4205, 4214), - }); - declarations.push(Declaration { - id: DeclarationId(2028), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1098), DeclarationId(1098)], - output: DeclarationId(1098), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens.dag", 4225, 4238), - }); - declarations.push(Declaration { - id: DeclarationId(2029), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1098), DeclarationId(829)], - output: DeclarationId(1098), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens.dag", 4250, 4271), - }); - declarations.push(Declaration { - id: DeclarationId(2030), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(839), DeclarationId(1098)], - output: DeclarationId(1060), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens.dag", 4284, 4316), - }); - declarations.push(Declaration { - id: DeclarationId(2031), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "declaration".to_string(), - ty: DeclarationId(737), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens_application.dag", 3564, 3611), - }); - declarations.push(Declaration { - id: DeclarationId(2032), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "declaration".to_string(), - ty: DeclarationId(737), - }, - Field { - label: "node".to_string(), - ty: DeclarationId(735), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens_application.dag", 3616, 3677), - }); - declarations.push(Declaration { - id: DeclarationId(2033), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens_application.dag", 4556, 4561), - }); - declarations.push(Declaration { - id: DeclarationId(2034), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1102)], - output: DeclarationId(1104), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens_application.dag", 5798, 5821), - }); - declarations.push(Declaration { - id: DeclarationId(2035), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(1102), DeclarationId(1103)], - output: DeclarationId(124), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens_application.dag", 5834, 5860), - }); - declarations.push(Declaration { - id: DeclarationId(2036), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1097), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1098), - value: DeclarationId(1106), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens_application.dag", 7871, 7883), - }); - declarations.push(Declaration { - id: DeclarationId(2037), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1101), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(1102), - value: DeclarationId(1106), - }, - TemplateArgument { - parameter: DeclarationId(1103), - value: DeclarationId(1107), - }, - TemplateArgument { - parameter: DeclarationId(1104), - value: DeclarationId(1108), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens_application.dag", 7899, 7941), - }); - declarations.push(Declaration { - id: DeclarationId(2038), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1105), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(1106), - value: DeclarationId(1110), - }, - TemplateArgument { - parameter: DeclarationId(1107), - value: DeclarationId(1111), - }, - TemplateArgument { - parameter: DeclarationId(1108), - value: DeclarationId(1112), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens_application.dag", 9711, 9753), - }); - declarations.push(Declaration { - id: DeclarationId(2039), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1097), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1098), - value: DeclarationId(1114), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lens_application.dag", 10773, 10785), - }); - declarations.push(Declaration { - id: DeclarationId(2040), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1025), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new( - "src/v3/std/python_method_template_contracts.dag", - 6752, - 6780, - ), - }); - declarations.push(Declaration { - id: DeclarationId(2041), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1126), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/runtime.dag", 11238, 11249), - }); - declarations.push(Declaration { - id: DeclarationId(2042), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(793), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/runtime.dag", 2137, 2162), - }); - declarations.push(Declaration { - id: DeclarationId(2043), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1125), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/runtime.dag", 2179, 2195), - }); - declarations.push(Declaration { - id: DeclarationId(2044), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(2043), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/runtime.dag", 2167, 2196), - }); - declarations.push(Declaration { - id: DeclarationId(2045), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "tag".to_string(), - ty: DeclarationId(737), - }, - Field { - label: "payload".to_string(), - ty: DeclarationId(1126), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/runtime.dag", 2201, 2252), - }); - declarations.push(Declaration { - id: DeclarationId(2046), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(735), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/runtime.dag", 2257, 2272), - }); - declarations.push(Declaration { - id: DeclarationId(2047), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(829), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/runtime.dag", 2277, 2304), - }); - declarations.push(Declaration { - id: DeclarationId(2048), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(736), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(1126), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/runtime.dag", 3936, 3954), - }); - declarations.push(Declaration { - id: DeclarationId(2049), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1129), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/runtime.dag", 4542, 4557), - }); - declarations.push(Declaration { - id: DeclarationId(2050), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "input_order".to_string(), - ty: DeclarationId(1133), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/runtime.dag", 5388, 5442), - }); - declarations.push(Declaration { - id: DeclarationId(2051), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/runtime.dag", 5682, 5691), - }); - declarations.push(Declaration { - id: DeclarationId(2052), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/runtime.dag", 5694, 5704), - }); - declarations.push(Declaration { - id: DeclarationId(2053), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1025), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/rust_method_template_contracts.dag", 5769, 5797), - }); - declarations.push(Declaration { - id: DeclarationId(2054), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(1141), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 2429, 2445), - }); - declarations.push(Declaration { - id: DeclarationId(2055), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(1141), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 2450, 2466), - }); - declarations.push(Declaration { - id: DeclarationId(2056), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(1141), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 2471, 2487), - }); - declarations.push(Declaration { - id: DeclarationId(2057), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(1141), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 2732, 2760), - }); - declarations.push(Declaration { - id: DeclarationId(2058), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(1141), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 2804, 2832), - }); - declarations.push(Declaration { - id: DeclarationId(2059), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(1149), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 6397, 6419), - }); - declarations.push(Declaration { - id: DeclarationId(2060), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(1151), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 6839, 6859), - }); - declarations.push(Declaration { - id: DeclarationId(2061), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(11), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(12), - value: DeclarationId(1162), - }, - TemplateArgument { - parameter: DeclarationId(13), - value: DeclarationId(1161), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 12353, 12399), - }); - declarations.push(Declaration { - id: DeclarationId(2062), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 767, 773), - }); - declarations.push(Declaration { - id: DeclarationId(2063), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 778, 791), - }); - declarations.push(Declaration { - id: DeclarationId(2064), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 796, 810), - }); - declarations.push(Declaration { - id: DeclarationId(2065), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "param".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 3332, 3358), - }); - declarations.push(Declaration { - id: DeclarationId(2066), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "param".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 3363, 3391), - }); - declarations.push(Declaration { - id: DeclarationId(2067), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "param".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 3396, 3429), - }); - declarations.push(Declaration { - id: DeclarationId(2068), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "param".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 3434, 3465), - }); - declarations.push(Declaration { - id: DeclarationId(2069), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "param".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 3470, 3502), - }); - declarations.push(Declaration { - id: DeclarationId(2070), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 4509, 4516), - }); - declarations.push(Declaration { - id: DeclarationId(2071), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "previous".to_string(), - ty: DeclarationId(1149), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 4521, 4571), - }); - declarations.push(Declaration { - id: DeclarationId(2072), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 5484, 5495), - }); - declarations.push(Declaration { - id: DeclarationId(2073), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "inner".to_string(), - ty: DeclarationId(1151), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 5500, 5545), - }); - declarations.push(Declaration { - id: DeclarationId(2074), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "accessor".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 7649, 7683), - }); - declarations.push(Declaration { - id: DeclarationId(2075), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "amount".to_string(), - ty: DeclarationId(1149), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 7688, 7732), - }); - declarations.push(Declaration { - id: DeclarationId(2076), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "steps".to_string(), - ty: DeclarationId(1149), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 7737, 7795), - }); - declarations.push(Declaration { - id: DeclarationId(2077), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "divisor".to_string(), - ty: DeclarationId(1151), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 7800, 7856), - }); - declarations.push(Declaration { - id: DeclarationId(2078), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "witness".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 7861, 7894), - }); - declarations.push(Declaration { - id: DeclarationId(2079), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "element".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 7899, 7929), - }); - declarations.push(Declaration { - id: DeclarationId(2080), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 7934, 7947), - }); - declarations.push(Declaration { - id: DeclarationId(2081), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1148), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 7987, 8009), - }); - declarations.push(Declaration { - id: DeclarationId(2082), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1141), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 8219, 8240), - }); - declarations.push(Declaration { - id: DeclarationId(2083), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 8740, 8746), - }); - declarations.push(Declaration { - id: DeclarationId(2084), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 9139, 9152), - }); - declarations.push(Declaration { - id: DeclarationId(2085), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 9157, 9171), - }); - declarations.push(Declaration { - id: DeclarationId(2086), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1160), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 10263, 10297), - }); - declarations.push(Declaration { - id: DeclarationId(2087), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 10302, 10320), - }); - declarations.push(Declaration { - id: DeclarationId(2088), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(1159), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 11234, 11261), - }); - declarations.push(Declaration { - id: DeclarationId(2089), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(970), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 21954, 21966), - }); - declarations.push(Declaration { - id: DeclarationId(2090), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(975), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 23501, 23516), - }); - declarations.push(Declaration { - id: DeclarationId(2091), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1184), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 29819, 29834), - }); - declarations.push(Declaration { - id: DeclarationId(2092), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1183), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 31848, 31864), - }); - declarations.push(Declaration { - id: DeclarationId(2093), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1183), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 31957, 31973), - }); - declarations.push(Declaration { - id: DeclarationId(2094), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1183), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 32071, 32087), - }); - declarations.push(Declaration { - id: DeclarationId(2095), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(2094), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 32066, 32088), - }); - declarations.push(Declaration { - id: DeclarationId(2096), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(87), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 35581, 35585), - }); - declarations.push(Declaration { - id: DeclarationId(2097), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(87), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 35877, 35881), - }); - declarations.push(Declaration { - id: DeclarationId(2098), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(87), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 37126, 37130), - }); - declarations.push(Declaration { - id: DeclarationId(2099), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(87), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 37601, 37605), - }); - declarations.push(Declaration { - id: DeclarationId(2100), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(87), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 38864, 38868), - }); - declarations.push(Declaration { - id: DeclarationId(2101), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(87), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 39136, 39140), - }); - declarations.push(Declaration { - id: DeclarationId(2102), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 5629, 5644), - }); - declarations.push(Declaration { - id: DeclarationId(2103), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 5684, 5697), - }); - declarations.push(Declaration { - id: DeclarationId(2104), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 5745, 5762), - }); - declarations.push(Declaration { - id: DeclarationId(2105), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 5801, 5813), - }); - declarations.push(Declaration { - id: DeclarationId(2106), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 5861, 5878), - }); - declarations.push(Declaration { - id: DeclarationId(2107), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "field".to_string(), - ty: DeclarationId(1165), - }, - Field { - label: "factor".to_string(), - ty: DeclarationId(973), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 10410, 10472), - }); - declarations.push(Declaration { - id: DeclarationId(2108), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "field".to_string(), - ty: DeclarationId(1165), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 10477, 10519), - }); - declarations.push(Declaration { - id: DeclarationId(2109), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "param".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "factor".to_string(), - ty: DeclarationId(973), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 10524, 10581), - }); - declarations.push(Declaration { - id: DeclarationId(2110), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 10586, 10600), - }); - declarations.push(Declaration { - id: DeclarationId(2111), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 10605, 10623), - }); - declarations.push(Declaration { - id: DeclarationId(2112), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 10628, 10644), - }); - declarations.push(Declaration { - id: DeclarationId(2113), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 10649, 10657), - }); - declarations.push(Declaration { - id: DeclarationId(2114), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 10662, 10677), - }); - declarations.push(Declaration { - id: DeclarationId(2115), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 26104, 26118), - }); - declarations.push(Declaration { - id: DeclarationId(2116), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "degree".to_string(), - ty: DeclarationId(1149), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 26123, 26170), - }); - declarations.push(Declaration { - id: DeclarationId(2117), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "numerator".to_string(), - ty: DeclarationId(1149), - }, - Field { - label: "root".to_string(), - ty: DeclarationId(1149), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 26175, 26252), - }); - declarations.push(Declaration { - id: DeclarationId(2118), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "base".to_string(), - ty: DeclarationId(1151), - }, - Field { - label: "argument".to_string(), - ty: DeclarationId(1149), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 26257, 26331), - }); - declarations.push(Declaration { - id: DeclarationId(2119), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "param".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "exponent".to_string(), - ty: DeclarationId(1181), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 26951, 27007), - }); - declarations.push(Declaration { - id: DeclarationId(2120), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "param".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 27023, 27048), - }); - declarations.push(Declaration { - id: DeclarationId(2121), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 28697, 28710), - }); - declarations.push(Declaration { - id: DeclarationId(2122), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "cost".to_string(), - ty: DeclarationId(1183), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 28754, 28786), - }); - declarations.push(Declaration { - id: DeclarationId(2123), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1183), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 28849, 28865), - }); - declarations.push(Declaration { - id: DeclarationId(2124), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "factors".to_string(), - ty: DeclarationId(2123), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 28825, 28867), - }); - declarations.push(Declaration { - id: DeclarationId(2125), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1183), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 28929, 28945), - }); - declarations.push(Declaration { - id: DeclarationId(2126), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(2125), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 28924, 28946), - }); - declarations.push(Declaration { - id: DeclarationId(2127), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "terms".to_string(), - ty: DeclarationId(2126), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 28896, 28948), - }); - declarations.push(Declaration { - id: DeclarationId(2128), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1184), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 29246, 29261), - }); - declarations.push(Declaration { - id: DeclarationId(2129), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "terms".to_string(), - ty: DeclarationId(2128), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 29228, 29263), - }); - declarations.push(Declaration { - id: DeclarationId(2130), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 29346, 29358), - }); - declarations.push(Declaration { - id: DeclarationId(2131), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 29428, 29438), - }); - declarations.push(Declaration { - id: DeclarationId(2132), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 646, 651), - }); - declarations.push(Declaration { - id: DeclarationId(2133), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 656, 660), - }); - declarations.push(Declaration { - id: DeclarationId(2134), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 665, 671), - }); - declarations.push(Declaration { - id: DeclarationId(2135), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 676, 682), - }); - declarations.push(Declaration { - id: DeclarationId(2136), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 687, 691), - }); - declarations.push(Declaration { - id: DeclarationId(2137), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 696, 702), - }); - declarations.push(Declaration { - id: DeclarationId(2138), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 707, 715), - }); - declarations.push(Declaration { - id: DeclarationId(2139), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 720, 728), - }); - declarations.push(Declaration { - id: DeclarationId(2140), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 733, 740), - }); - declarations.push(Declaration { - id: DeclarationId(2141), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 745, 751), - }); - declarations.push(Declaration { - id: DeclarationId(2142), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 756, 763), - }); - declarations.push(Declaration { - id: DeclarationId(2143), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 768, 774), - }); - declarations.push(Declaration { - id: DeclarationId(2144), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 779, 786), - }); - declarations.push(Declaration { - id: DeclarationId(2145), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 791, 804), - }); - declarations.push(Declaration { - id: DeclarationId(2146), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 889, 903), - }); - declarations.push(Declaration { - id: DeclarationId(2147), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 908, 925), - }); - declarations.push(Declaration { - id: DeclarationId(2148), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 930, 932), - }); - declarations.push(Declaration { - id: DeclarationId(2149), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 937, 941), - }); - declarations.push(Declaration { - id: DeclarationId(2150), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 946, 951), - }); - declarations.push(Declaration { - id: DeclarationId(2151), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 956, 958), - }); - declarations.push(Declaration { - id: DeclarationId(2152), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 963, 965), - }); - declarations.push(Declaration { - id: DeclarationId(2153), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 970, 972), - }); - declarations.push(Declaration { - id: DeclarationId(2154), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 977, 979), - }); - declarations.push(Declaration { - id: DeclarationId(2155), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 984, 988), - }); - declarations.push(Declaration { - id: DeclarationId(2156), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 993, 998), - }); - declarations.push(Declaration { - id: DeclarationId(2157), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1003, 1007), - }); - declarations.push(Declaration { - id: DeclarationId(2158), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1012, 1017), - }); - declarations.push(Declaration { - id: DeclarationId(2159), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1022, 1028), - }); - declarations.push(Declaration { - id: DeclarationId(2160), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1033, 1041), - }); - declarations.push(Declaration { - id: DeclarationId(2161), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1046, 1051), - }); - declarations.push(Declaration { - id: DeclarationId(2162), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1056, 1061), - }); - declarations.push(Declaration { - id: DeclarationId(2163), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1066, 1074), - }); - declarations.push(Declaration { - id: DeclarationId(2164), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1079, 1088), - }); - declarations.push(Declaration { - id: DeclarationId(2165), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1093, 1096), - }); - declarations.push(Declaration { - id: DeclarationId(2166), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1101, 1107), - }); - declarations.push(Declaration { - id: DeclarationId(2167), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1112, 1118), - }); - declarations.push(Declaration { - id: DeclarationId(2168), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1123, 1129), - }); - declarations.push(Declaration { - id: DeclarationId(2169), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1134, 1140), - }); - declarations.push(Declaration { - id: DeclarationId(2170), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1145, 1153), - }); - declarations.push(Declaration { - id: DeclarationId(2171), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1158, 1166), - }); - declarations.push(Declaration { - id: DeclarationId(2172), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1171, 1176), - }); - declarations.push(Declaration { - id: DeclarationId(2173), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1181, 1190), - }); - declarations.push(Declaration { - id: DeclarationId(2174), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1195, 1199), - }); - declarations.push(Declaration { - id: DeclarationId(2175), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1204, 1212), - }); - declarations.push(Declaration { - id: DeclarationId(2176), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1217, 1222), - }); - declarations.push(Declaration { - id: DeclarationId(2177), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1227, 1230), - }); - declarations.push(Declaration { - id: DeclarationId(2178), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1801, 1806), - }); - declarations.push(Declaration { - id: DeclarationId(2179), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1811, 1815), - }); - declarations.push(Declaration { - id: DeclarationId(2180), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1820, 1826), - }); - declarations.push(Declaration { - id: DeclarationId(2181), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1831, 1837), - }); - declarations.push(Declaration { - id: DeclarationId(2182), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1842, 1846), - }); - declarations.push(Declaration { - id: DeclarationId(2183), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1851, 1857), - }); - declarations.push(Declaration { - id: DeclarationId(2184), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1862, 1870), - }); - declarations.push(Declaration { - id: DeclarationId(2185), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1875, 1883), - }); - declarations.push(Declaration { - id: DeclarationId(2186), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1888, 1895), - }); - declarations.push(Declaration { - id: DeclarationId(2187), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1900, 1906), - }); - declarations.push(Declaration { - id: DeclarationId(2188), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1911, 1918), - }); - declarations.push(Declaration { - id: DeclarationId(2189), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1923, 1929), - }); - declarations.push(Declaration { - id: DeclarationId(2190), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 1934, 1941), - }); - declarations.push(Declaration { - id: DeclarationId(2191), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2381, 2383), - }); - declarations.push(Declaration { - id: DeclarationId(2192), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2388, 2392), - }); - declarations.push(Declaration { - id: DeclarationId(2193), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2397, 2402), - }); - declarations.push(Declaration { - id: DeclarationId(2194), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2407, 2409), - }); - declarations.push(Declaration { - id: DeclarationId(2195), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2414, 2416), - }); - declarations.push(Declaration { - id: DeclarationId(2196), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2421, 2423), - }); - declarations.push(Declaration { - id: DeclarationId(2197), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2428, 2430), - }); - declarations.push(Declaration { - id: DeclarationId(2198), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2435, 2439), - }); - declarations.push(Declaration { - id: DeclarationId(2199), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2444, 2449), - }); - declarations.push(Declaration { - id: DeclarationId(2200), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2454, 2458), - }); - declarations.push(Declaration { - id: DeclarationId(2201), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2463, 2468), - }); - declarations.push(Declaration { - id: DeclarationId(2202), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2473, 2479), - }); - declarations.push(Declaration { - id: DeclarationId(2203), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2484, 2492), - }); - declarations.push(Declaration { - id: DeclarationId(2204), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2497, 2502), - }); - declarations.push(Declaration { - id: DeclarationId(2205), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2507, 2512), - }); - declarations.push(Declaration { - id: DeclarationId(2206), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2517, 2525), - }); - declarations.push(Declaration { - id: DeclarationId(2207), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2530, 2539), - }); - declarations.push(Declaration { - id: DeclarationId(2208), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2544, 2547), - }); - declarations.push(Declaration { - id: DeclarationId(2209), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2552, 2558), - }); - declarations.push(Declaration { - id: DeclarationId(2210), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2563, 2569), - }); - declarations.push(Declaration { - id: DeclarationId(2211), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2574, 2580), - }); - declarations.push(Declaration { - id: DeclarationId(2212), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2585, 2591), - }); - declarations.push(Declaration { - id: DeclarationId(2213), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2596, 2604), - }); - declarations.push(Declaration { - id: DeclarationId(2214), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2609, 2617), - }); - declarations.push(Declaration { - id: DeclarationId(2215), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2622, 2627), - }); - declarations.push(Declaration { - id: DeclarationId(2216), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2632, 2641), - }); - declarations.push(Declaration { - id: DeclarationId(2217), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2646, 2650), - }); - declarations.push(Declaration { - id: DeclarationId(2218), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2655, 2663), - }); - declarations.push(Declaration { - id: DeclarationId(2219), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/tokenize.dag", 2668, 2673), - }); - declarations.push(Declaration { - id: DeclarationId(2220), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(838), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/workflows.dag", 986, 1000), - }); - declarations.push(Declaration { - id: DeclarationId(2221), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1058), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1234), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16222, 16248), - }); - declarations.push(Declaration { - id: DeclarationId(2222), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "duration".to_string(), - ty: DeclarationId(1233), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 4146, 4180), - }); - declarations.push(Declaration { - id: DeclarationId(2223), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 4185, 4195), - }); - declarations.push(Declaration { - id: DeclarationId(2224), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 4200, 4209), - }); - declarations.push(Declaration { - id: DeclarationId(2225), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 4214, 4219), - }); - declarations.push(Declaration { - id: DeclarationId(2226), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1239), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 7717, 7745), - }); - declarations.push(Declaration { - id: DeclarationId(2227), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "max".to_string(), - ty: DeclarationId(1233), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 9229, 9260), - }); - declarations.push(Declaration { - id: DeclarationId(2228), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 9265, 9281), - }); - declarations.push(Declaration { - id: DeclarationId(2229), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(19), - arguments: vec![TemplateArgument { - parameter: DeclarationId(20), - value: DeclarationId(1234), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19583, 19608), - }); - declarations.push(Declaration { - id: DeclarationId(2230), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1101), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(1102), - value: DeclarationId(1234), - }, - TemplateArgument { - parameter: DeclarationId(1103), - value: DeclarationId(1240), - }, - TemplateArgument { - parameter: DeclarationId(1104), - value: DeclarationId(1241), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 19925, 20001), - }); - declarations.push(Declaration { - id: DeclarationId(2231), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1105), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(1106), - value: DeclarationId(1234), - }, - TemplateArgument { - parameter: DeclarationId(1107), - value: DeclarationId(1240), - }, - TemplateArgument { - parameter: DeclarationId(1108), - value: DeclarationId(1241), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 20112, 20188), - }); - declarations.push(Declaration { - id: DeclarationId(2232), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(2008), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1234), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16222, 16248), - }); - declarations.push(Declaration { - id: DeclarationId(2233), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(2008), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1234), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16222, 16248), - }); - declarations.push(Declaration { - id: DeclarationId(2234), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(2008), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1234), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16222, 16248), - }); - declarations.push(Declaration { - id: DeclarationId(2235), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(2008), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1234), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16222, 16248), - }); - declarations.push(Declaration { - id: DeclarationId(2236), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(2008), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1234), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16222, 16248), - }); - declarations.push(Declaration { - id: DeclarationId(2237), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(2008), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1234), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16222, 16248), - }); - declarations.push(Declaration { - id: DeclarationId(2238), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(2008), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1234), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16222, 16248), - }); - declarations.push(Declaration { - id: DeclarationId(2239), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(2008), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1234), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16222, 16248), - }); - declarations.push(Declaration { - id: DeclarationId(2240), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(2008), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1234), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16222, 16248), - }); - declarations.push(Declaration { - id: DeclarationId(2241), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(2008), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1234), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/timing_lens.dag", 16222, 16248), - }); - declarations.push(Declaration { - id: DeclarationId(2242), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1058), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1234), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3256, 3282), - }); - declarations.push(Declaration { - id: DeclarationId(2243), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1058), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1234), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 4828, 4854), - }); - declarations.push(Declaration { - id: DeclarationId(2244), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(810), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5122, 5139), - }); - declarations.push(Declaration { - id: DeclarationId(2245), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(838), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5190, 5204), - }); - declarations.push(Declaration { - id: DeclarationId(2246), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(792), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5254, 5267), - }); - declarations.push(Declaration { - id: DeclarationId(2247), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(828), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5317, 5330), - }); - declarations.push(Declaration { - id: DeclarationId(2248), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1055), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5378, 5394), - }); - declarations.push(Declaration { - id: DeclarationId(2249), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1058), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1234), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5447, 5473), - }); - declarations.push(Declaration { - id: DeclarationId(2250), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(2249), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5442, 5474), - }); - declarations.push(Declaration { - id: DeclarationId(2251), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1058), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1234), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5548, 5574), - }); - declarations.push(Declaration { - id: DeclarationId(2252), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(2251), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5543, 5575), - }); - declarations.push(Declaration { - id: DeclarationId(2253), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1055), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5700, 5716), - }); - declarations.push(Declaration { - id: DeclarationId(2254), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1061), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1062), - value: DeclarationId(1234), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5841, 5875), - }); - declarations.push(Declaration { - id: DeclarationId(2255), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1061), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1062), - value: DeclarationId(1234), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 6087, 6121), - }); - declarations.push(Declaration { - id: DeclarationId(2256), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1061), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1062), - value: DeclarationId(1234), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 6606, 6640), - }); - declarations.push(Declaration { - id: DeclarationId(2257), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1061), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1062), - value: DeclarationId(1234), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 6867, 6901), - }); - declarations.push(Declaration { - id: DeclarationId(2258), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1061), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1062), - value: DeclarationId(1234), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7157, 7191), - }); - declarations.push(Declaration { - id: DeclarationId(2259), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1058), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1234), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7371, 7397), - }); - declarations.push(Declaration { - id: DeclarationId(2260), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1061), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1062), - value: DeclarationId(1234), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 7402, 7436), - }); - declarations.push(Declaration { - id: DeclarationId(2261), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1061), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1062), - value: DeclarationId(1234), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 9253, 9287), - }); - declarations.push(Declaration { - id: DeclarationId(2262), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1109), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(1110), - value: DeclarationId(1234), - }, - TemplateArgument { - parameter: DeclarationId(1111), - value: DeclarationId(1240), - }, - TemplateArgument { - parameter: DeclarationId(1112), - value: DeclarationId(1241), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 11246, 11326), - }); - declarations.push(Declaration { - id: DeclarationId(2263), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(2008), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1234), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3256, 3282), - }); - declarations.push(Declaration { - id: DeclarationId(2264), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(2008), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1234), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3256, 3282), - }); - declarations.push(Declaration { - id: DeclarationId(2265), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(2008), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1234), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3256, 3282), - }); - declarations.push(Declaration { - id: DeclarationId(2266), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(2008), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1234), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3256, 3282), - }); - declarations.push(Declaration { - id: DeclarationId(2267), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(2008), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1234), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3256, 3282), - }); - declarations.push(Declaration { - id: DeclarationId(2268), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(2008), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1234), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3256, 3282), - }); - declarations.push(Declaration { - id: DeclarationId(2269), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(2008), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1234), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3256, 3282), - }); - declarations.push(Declaration { - id: DeclarationId(2270), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(2008), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1234), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3256, 3282), - }); - declarations.push(Declaration { - id: DeclarationId(2271), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(2008), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1234), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3256, 3282), - }); - declarations.push(Declaration { - id: DeclarationId(2272), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(2008), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1234), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 3256, 3282), - }); - declarations.push(Declaration { - id: DeclarationId(2273), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1474), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(810), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5122, 5139), - }); - declarations.push(Declaration { - id: DeclarationId(2274), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1474), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(838), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5190, 5204), - }); - declarations.push(Declaration { - id: DeclarationId(2275), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1474), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(792), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5254, 5267), - }); - declarations.push(Declaration { - id: DeclarationId(2276), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1474), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(828), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5317, 5330), - }); - declarations.push(Declaration { - id: DeclarationId(2277), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1474), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1055), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5378, 5394), - }); - declarations.push(Declaration { - id: DeclarationId(2278), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1474), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(2249), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5442, 5474), - }); - declarations.push(Declaration { - id: DeclarationId(2279), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1476), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(2251), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5543, 5575), - }); - declarations.push(Declaration { - id: DeclarationId(2280), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(2008), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1059), - value: DeclarationId(1234), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5548, 5574), - }); - declarations.push(Declaration { - id: DeclarationId(2281), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(1476), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1055), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5700, 5716), - }); - declarations.push(Declaration { - id: DeclarationId(2282), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(2014), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1062), - value: DeclarationId(1234), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 5841, 5875), - }); - declarations.push(Declaration { - id: DeclarationId(2283), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(2018), - arguments: vec![TemplateArgument { - parameter: DeclarationId(1062), - value: DeclarationId(1234), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/t_ci_workflow_as_data_demo.dag", 6087, 6121), - }); - declarations.push(Declaration { - id: DeclarationId(2284), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(962), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 30395, 30418), - }); - declarations.push(Declaration { - id: DeclarationId(2285), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1323), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 31487, 31503), - }); - declarations.push(Declaration { - id: DeclarationId(2286), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1325), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 31508, 31528), - }); - declarations.push(Declaration { - id: DeclarationId(2287), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "output_path".to_string(), - ty: DeclarationId(1286), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 2616, 2649), - }); - declarations.push(Declaration { - id: DeclarationId(2288), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "output_path".to_string(), - ty: DeclarationId(1286), - }, - Field { - label: "dag_source".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "source_hash".to_string(), - ty: DeclarationId(147), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 2654, 2762), - }); - declarations.push(Declaration { - id: DeclarationId(2289), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 4198, 4212), - }); - declarations.push(Declaration { - id: DeclarationId(2290), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 4217, 4227), - }); - declarations.push(Declaration { - id: DeclarationId(2291), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 4232, 4244), - }); - declarations.push(Declaration { - id: DeclarationId(2292), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 4249, 4262), - }); - declarations.push(Declaration { - id: DeclarationId(2293), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 4267, 4279), - }); - declarations.push(Declaration { - id: DeclarationId(2294), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 4284, 4296), - }); - declarations.push(Declaration { - id: DeclarationId(2295), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 4301, 4323), - }); - declarations.push(Declaration { - id: DeclarationId(2296), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 4328, 4347), - }); - declarations.push(Declaration { - id: DeclarationId(2297), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 4352, 4377), - }); - declarations.push(Declaration { - id: DeclarationId(2298), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 4382, 4405), - }); - declarations.push(Declaration { - id: DeclarationId(2299), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 4811, 4820), - }); - declarations.push(Declaration { - id: DeclarationId(2300), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 4825, 4841), - }); - declarations.push(Declaration { - id: DeclarationId(2301), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 5500, 5508), - }); - declarations.push(Declaration { - id: DeclarationId(2302), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 5513, 5523), - }); - declarations.push(Declaration { - id: DeclarationId(2303), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 5748, 5760), - }); - declarations.push(Declaration { - id: DeclarationId(2304), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 6575, 6588), - }); - declarations.push(Declaration { - id: DeclarationId(2305), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 6593, 6606), - }); - declarations.push(Declaration { - id: DeclarationId(2306), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 6611, 6619), - }); - declarations.push(Declaration { - id: DeclarationId(2307), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "source".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "file_name".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 7164, 7231), - }); - declarations.push(Declaration { - id: DeclarationId(2308), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "var".to_string(), - ty: DeclarationId(1308), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 7272, 7325), - }); - declarations.push(Declaration { - id: DeclarationId(2309), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 7358, 7387), - }); - declarations.push(Declaration { - id: DeclarationId(2310), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 7989, 8021), - }); - declarations.push(Declaration { - id: DeclarationId(2311), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 8026, 8057), - }); - declarations.push(Declaration { - id: DeclarationId(2312), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 8099, 8131), - }); - declarations.push(Declaration { - id: DeclarationId(2313), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 8136, 8167), - }); - declarations.push(Declaration { - id: DeclarationId(2314), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 8172, 8200), - }); - declarations.push(Declaration { - id: DeclarationId(2315), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 8205, 8231), - }); - declarations.push(Declaration { - id: DeclarationId(2316), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 8270, 8292), - }); - declarations.push(Declaration { - id: DeclarationId(2317), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 8297, 8325), - }); - declarations.push(Declaration { - id: DeclarationId(2318), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 8330, 8359), - }); - declarations.push(Declaration { - id: DeclarationId(2319), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 11171, 11179), - }); - declarations.push(Declaration { - id: DeclarationId(2320), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1301), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 11184, 11224), - }); - declarations.push(Declaration { - id: DeclarationId(2321), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "expected".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 11229, 11262), - }); - declarations.push(Declaration { - id: DeclarationId(2322), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "bind_name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "state".to_string(), - ty: DeclarationId(1302), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 11267, 11345), - }); - declarations.push(Declaration { - id: DeclarationId(2323), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "declaration_name".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 11511, 11574), - }); - declarations.push(Declaration { - id: DeclarationId(2324), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "bind_name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "comparator".to_string(), - ty: DeclarationId(814), - }, - Field { - label: "bound".to_string(), - ty: DeclarationId(87), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 11579, 11670), - }); - declarations.push(Declaration { - id: DeclarationId(2325), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "subject".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "input_sample".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "expected_output".to_string(), - ty: DeclarationId(1337), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 11675, 11807), - }); - declarations.push(Declaration { - id: DeclarationId(2326), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "subject".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "invariant".to_string(), - ty: DeclarationId(1337), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 12022, 12111), - }); - declarations.push(Declaration { - id: DeclarationId(2327), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 12911, 12923), - }); - declarations.push(Declaration { - id: DeclarationId(2328), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "command".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "args".to_string(), - ty: DeclarationId(2327), - }, - Field { - label: "expect_exit_code".to_string(), - ty: DeclarationId(87), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 12860, 12957), - }); - declarations.push(Declaration { - id: DeclarationId(2329), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 13672, 13684), - }); - declarations.push(Declaration { - id: DeclarationId(2330), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "command".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "args".to_string(), - ty: DeclarationId(2329), - }, - Field { - label: "expect_exit_code".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "input_ref".to_string(), - ty: DeclarationId(1337), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 13622, 13750), - }); - declarations.push(Declaration { - id: DeclarationId(2331), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "lens_ref".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "input_ref".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "expected_ref".to_string(), - ty: DeclarationId(1337), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 14048, 14170), - }); - declarations.push(Declaration { - id: DeclarationId(2332), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "subject_ref".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "oracle_ref".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "input_ref".to_string(), - ty: DeclarationId(1337), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 14432, 14557), - }); - declarations.push(Declaration { - id: DeclarationId(2333), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "expected".to_string(), - ty: DeclarationId(1337), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 16610, 16671), - }); - declarations.push(Declaration { - id: DeclarationId(2334), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "expected".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "param".to_string(), - ty: DeclarationId(1309), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 16676, 16775), - }); - declarations.push(Declaration { - id: DeclarationId(2335), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "subject".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "comparator".to_string(), - ty: DeclarationId(1303), - }, - Field { - label: "baseline_ref".to_string(), - ty: DeclarationId(1337), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 17129, 17261), - }); - declarations.push(Declaration { - id: DeclarationId(2336), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "left_report_ref".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "right_report_ref".to_string(), - ty: DeclarationId(1337), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 17828, 17940), - }); - declarations.push(Declaration { - id: DeclarationId(2337), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "law".to_string(), - ty: DeclarationId(1304), - }, - Field { - label: "lens_ref".to_string(), - ty: DeclarationId(1337), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 18637, 18716), - }); - declarations.push(Declaration { - id: DeclarationId(2338), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "authority".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "list_constant".to_string(), - ty: DeclarationId(1289), - }, - Field { - label: "bound".to_string(), - ty: DeclarationId(87), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 18936, 19049), - }); - declarations.push(Declaration { - id: DeclarationId(2339), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "authority".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "list_constant".to_string(), - ty: DeclarationId(1289), - }, - Field { - label: "subset_predicate".to_string(), - ty: DeclarationId(1337), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 19054, 19190), - }); - declarations.push(Declaration { - id: DeclarationId(2340), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "compile_target".to_string(), - ty: DeclarationId(1286), - }, - Field { - label: "expected".to_string(), - ty: DeclarationId(1287), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 19897, 19979), - }); - declarations.push(Declaration { - id: DeclarationId(2341), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "authority".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "ratchet_kind".to_string(), - ty: DeclarationId(1337), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 19984, 20070), - }); - declarations.push(Declaration { - id: DeclarationId(2342), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1288), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 20970, 20998), - }); - declarations.push(Declaration { - id: DeclarationId(2343), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "authority".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "manifest_entries".to_string(), - ty: DeclarationId(2342), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 20895, 21004), - }); - declarations.push(Declaration { - id: DeclarationId(2344), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "capability_register".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "cementing_receipts".to_string(), - ty: DeclarationId(1337), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 22313, 22438), - }); - declarations.push(Declaration { - id: DeclarationId(2345), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "deferred_gate".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "target_lane".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "authority_doc".to_string(), - ty: DeclarationId(1337), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 23380, 23514), - }); - declarations.push(Declaration { - id: DeclarationId(2346), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "deferred_gate".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "target_lane".to_string(), - ty: DeclarationId(1337), - }, - Field { - label: "authority_doc".to_string(), - ty: DeclarationId(1337), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 24153, 24297), - }); - declarations.push(Declaration { - id: DeclarationId(2347), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "ledger".to_string(), - ty: DeclarationId(879), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 25142, 25196), - }); - declarations.push(Declaration { - id: DeclarationId(2348), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(962), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 26240, 26263), - }); - declarations.push(Declaration { - id: DeclarationId(2349), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 26466, 26472), - }); - declarations.push(Declaration { - id: DeclarationId(2350), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 26477, 26483), - }); - declarations.push(Declaration { - id: DeclarationId(2351), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(962), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 26621, 26644), - }); - declarations.push(Declaration { - id: DeclarationId(2352), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1318), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 28648, 28677), - }); - declarations.push(Declaration { - id: DeclarationId(2353), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1320), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 28682, 28721), - }); - declarations.push(Declaration { - id: DeclarationId(2354), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1318), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 29579, 29600), - }); - declarations.push(Declaration { - id: DeclarationId(2355), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1320), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 29605, 29636), - }); - declarations.push(Declaration { - id: DeclarationId(2356), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1323), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 29680, 29696), - }); - declarations.push(Declaration { - id: DeclarationId(2357), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(962), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 29952, 29975), - }); - declarations.push(Declaration { - id: DeclarationId(2358), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1313), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/verification.dag", 8593, 8624), - }); - declarations.push(Declaration { - id: DeclarationId(2359), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/pipeline.dag", 532, 547), - }); - declarations.push(Declaration { - id: DeclarationId(2360), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/pipeline.dag", 550, 561), - }); - declarations.push(Declaration { - id: DeclarationId(2361), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/pipeline.dag", 564, 576), - }); - declarations.push(Declaration { - id: DeclarationId(2362), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(817), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/operators.dag", 142, 155), - }); - declarations.push(Declaration { - id: DeclarationId(2363), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/languages/rust/primitives.dag", 6458, 6476), - }); - declarations.push(Declaration { - id: DeclarationId(2364), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/languages/rust/primitives.dag", 6481, 6496), - }); - declarations.push(Declaration { - id: DeclarationId(2365), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/languages/rust/primitives.dag", 6525, 6548), - }); - declarations.push(Declaration { - id: DeclarationId(2366), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/languages/rust/primitives.dag", 6553, 6574), - }); - declarations.push(Declaration { - id: DeclarationId(2367), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/languages/rust/primitives.dag", 6579, 6594), - }); - declarations.push(Declaration { - id: DeclarationId(2368), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/languages/rust/primitives.dag", 8207, 8217), - }); - declarations.push(Declaration { - id: DeclarationId(2369), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/languages/rust/primitives.dag", 8222, 8233), - }); - declarations.push(Declaration { - id: DeclarationId(2370), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/languages/rust/primitives.dag", 8238, 8251), - }); - declarations.push(Declaration { - id: DeclarationId(2371), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/languages/rust/primitives.dag", 8256, 8269), - }); - declarations.push(Declaration { - id: DeclarationId(2372), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/languages/rust/primitives.dag", 8274, 8287), - }); - declarations.push(Declaration { - id: DeclarationId(2373), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/languages/rust/primitives.dag", 8292, 8306), - }); - declarations.push(Declaration { - id: DeclarationId(2374), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/languages/rust/primitives.dag", 8311, 8326), - }); - declarations.push(Declaration { - id: DeclarationId(2375), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/languages/rust/primitives.dag", 9068, 9085), - }); - declarations.push(Declaration { - id: DeclarationId(2376), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/languages/rust/primitives.dag", 9090, 9100), - }); - declarations.push(Declaration { - id: DeclarationId(2377), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/languages/rust/primitives.dag", 9105, 9109), - }); - declarations.push(Declaration { - id: DeclarationId(2378), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "target_name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "algebra".to_string(), - ty: DeclarationId(1376), - }, - Field { - label: "carrier".to_string(), - ty: DeclarationId(1378), - }, - Field { - label: "range_min_inclusive".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "range_max_inclusive".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "is_copy".to_string(), - ty: DeclarationId(124), - }, - Field { - label: "overflow".to_string(), - ty: DeclarationId(1379), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/languages/rust/primitives.dag", 9887, 10463), - }); - declarations.push(Declaration { - id: DeclarationId(2379), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "target_name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "algebra".to_string(), - ty: DeclarationId(1377), - }, - Field { - label: "carrier".to_string(), - ty: DeclarationId(1378), - }, - Field { - label: "is_copy".to_string(), - ty: DeclarationId(124), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/languages/rust/primitives.dag", 10468, 10650), - }); - declarations.push(Declaration { - id: DeclarationId(2380), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1380), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/languages/rust/primitives.dag", 11028, 11047), - }); - declarations.push(Declaration { - id: DeclarationId(2381), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/cron/schedule_model.dag", 4243, 4251), - }); - declarations.push(Declaration { - id: DeclarationId(2382), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "value".to_string(), - ty: DeclarationId(91), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/cron/schedule_model.dag", 4256, 4287), - }); - declarations.push(Declaration { - id: DeclarationId(2383), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(91), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/cron/schedule_model.dag", 4309, 4329), - }); - declarations.push(Declaration { - id: DeclarationId(2384), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "values".to_string(), - ty: DeclarationId(2383), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/cron/schedule_model.dag", 4292, 4331), - }); - declarations.push(Declaration { - id: DeclarationId(2385), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "start".to_string(), - ty: DeclarationId(91), - }, - Field { - label: "end".to_string(), - ty: DeclarationId(91), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/cron/schedule_model.dag", 4336, 4389), - }); - declarations.push(Declaration { - id: DeclarationId(2386), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "start".to_string(), - ty: DeclarationId(91), - }, - Field { - label: "step".to_string(), - ty: DeclarationId(92), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/cron/schedule_model.dag", 4394, 4443), - }); - declarations.push(Declaration { - id: DeclarationId(2387), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 847, 851), - }); - declarations.push(Declaration { - id: DeclarationId(2388), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 854, 857), - }); - declarations.push(Declaration { - id: DeclarationId(2389), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 860, 872), - }); - declarations.push(Declaration { - id: DeclarationId(2390), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1392), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 1242, 1259), - }); - declarations.push(Declaration { - id: DeclarationId(2391), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(156), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 1274, 1284), - }); - declarations.push(Declaration { - id: DeclarationId(2392), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 1309, 1318), - }); - declarations.push(Declaration { - id: DeclarationId(2393), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 1323, 1332), - }); - declarations.push(Declaration { - id: DeclarationId(2394), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 1337, 1350), - }); - declarations.push(Declaration { - id: DeclarationId(2395), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 1355, 1367), - }); - declarations.push(Declaration { - id: DeclarationId(2396), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 1372, 1385), - }); - declarations.push(Declaration { - id: DeclarationId(2397), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 1554, 1561), - }); - declarations.push(Declaration { - id: DeclarationId(2398), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 1677, 1685), - }); - declarations.push(Declaration { - id: DeclarationId(2399), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 1688, 1697), - }); - declarations.push(Declaration { - id: DeclarationId(2400), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 1700, 1709), - }); - declarations.push(Declaration { - id: DeclarationId(2401), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1403), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 1810, 1831), - }); - declarations.push(Declaration { - id: DeclarationId(2402), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(1412), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 1847, 1863), - }); - declarations.push(Declaration { - id: DeclarationId(2403), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1409), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 1872, 1881), - }); - declarations.push(Declaration { - id: DeclarationId(2404), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 1979, 1998), - }); - declarations.push(Declaration { - id: DeclarationId(2405), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(2404), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 1979, 1999), - }); - declarations.push(Declaration { - id: DeclarationId(2406), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(1401), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2015, 2035), - }); - declarations.push(Declaration { - id: DeclarationId(2407), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2206, 2214), - }); - declarations.push(Declaration { - id: DeclarationId(2408), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2217, 2226), - }); - declarations.push(Declaration { - id: DeclarationId(2409), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2229, 2237), - }); - declarations.push(Declaration { - id: DeclarationId(2410), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2395, 2407), - }); - declarations.push(Declaration { - id: DeclarationId(2411), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2416, 2428), - }); - declarations.push(Declaration { - id: DeclarationId(2412), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "branches".to_string(), - ty: DeclarationId(2410), - }, - Field { - label: "paths".to_string(), - ty: DeclarationId(2411), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2378, 2430), - }); - declarations.push(Declaration { - id: DeclarationId(2413), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2459, 2471), - }); - declarations.push(Declaration { - id: DeclarationId(2414), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1404), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2480, 2505), - }); - declarations.push(Declaration { - id: DeclarationId(2415), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "branches".to_string(), - ty: DeclarationId(2413), - }, - Field { - label: "types".to_string(), - ty: DeclarationId(2414), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2435, 2507), - }); - declarations.push(Declaration { - id: DeclarationId(2416), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "cron".to_string(), - ty: DeclarationId(1383), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2512, 2543), - }); - declarations.push(Declaration { - id: DeclarationId(2417), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1405), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2575, 2594), - }); - declarations.push(Declaration { - id: DeclarationId(2418), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "inputs".to_string(), - ty: DeclarationId(2417), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2548, 2596), - }); - declarations.push(Declaration { - id: DeclarationId(2419), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1405), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2624, 2643), - }); - declarations.push(Declaration { - id: DeclarationId(2420), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "inputs".to_string(), - ty: DeclarationId(2419), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2601, 2645), - }); - declarations.push(Declaration { - id: DeclarationId(2421), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2676, 2682), - }); - declarations.push(Declaration { - id: DeclarationId(2422), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2687, 2698), - }); - declarations.push(Declaration { - id: DeclarationId(2423), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2703, 2711), - }); - declarations.push(Declaration { - id: DeclarationId(2424), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2716, 2730), - }); - declarations.push(Declaration { - id: DeclarationId(2425), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2735, 2741), - }); - declarations.push(Declaration { - id: DeclarationId(2426), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2794, 2801), - }); - declarations.push(Declaration { - id: DeclarationId(2427), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2830, 2837), - }); - declarations.push(Declaration { - id: DeclarationId(2428), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2892, 2903), - }); - declarations.push(Declaration { - id: DeclarationId(2429), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2906, 2918), - }); - declarations.push(Declaration { - id: DeclarationId(2430), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2921, 2932), - }); - declarations.push(Declaration { - id: DeclarationId(2431), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2935, 2951), - }); - declarations.push(Declaration { - id: DeclarationId(2432), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5073, 5082), - }); - declarations.push(Declaration { - id: DeclarationId(2433), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5085, 5093), - }); - declarations.push(Declaration { - id: DeclarationId(2434), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5096, 5109), - }); - declarations.push(Declaration { - id: DeclarationId(2435), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5623, 5630), - }); - declarations.push(Declaration { - id: DeclarationId(2436), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(1415), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5661, 5671), - }); - declarations.push(Declaration { - id: DeclarationId(2437), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5681, 5693), - }); - declarations.push(Declaration { - id: DeclarationId(2438), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5781, 5800), - }); - declarations.push(Declaration { - id: DeclarationId(2439), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(2438), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5781, 5801), - }); - declarations.push(Declaration { - id: DeclarationId(2440), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5904, 5923), - }); - declarations.push(Declaration { - id: DeclarationId(2441), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(2440), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5904, 5924), - }); - declarations.push(Declaration { - id: DeclarationId(2442), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5941, 5948), - }); - declarations.push(Declaration { - id: DeclarationId(2443), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(1431), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5961, 5976), - }); - declarations.push(Declaration { - id: DeclarationId(2444), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(87), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5996, 6000), - }); - declarations.push(Declaration { - id: DeclarationId(2445), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(1412), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 6042, 6058), - }); - declarations.push(Declaration { - id: DeclarationId(2446), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "value".to_string(), - ty: DeclarationId(124), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 6908, 6944), - }); - declarations.push(Declaration { - id: DeclarationId(2447), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "expression".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 6949, 6998), - }); - declarations.push(Declaration { - id: DeclarationId(2448), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 7844, 7873), - }); - declarations.push(Declaration { - id: DeclarationId(2449), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "expression".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 7878, 7935), - }); - declarations.push(Declaration { - id: DeclarationId(2450), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "group".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 8513, 8548), - }); - declarations.push(Declaration { - id: DeclarationId(2451), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(1411), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 8707, 8736), - }); - declarations.push(Declaration { - id: DeclarationId(2452), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "group".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "cancel_in_progress".to_string(), - ty: DeclarationId(2451), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 8553, 8742), - }); - declarations.push(Declaration { - id: DeclarationId(2453), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(1410), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 8904, 8925), - }); - declarations.push(Declaration { - id: DeclarationId(2454), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(125), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 9123, 9128), - }); - declarations.push(Declaration { - id: DeclarationId(2455), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "group".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "cancel_in_progress".to_string(), - ty: DeclarationId(2453), - }, - Field { - label: "explicit_single".to_string(), - ty: DeclarationId(2454), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 8747, 9134), - }); - declarations.push(Declaration { - id: DeclarationId(2456), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "label".to_string(), - ty: DeclarationId(1414), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10326, 10361), - }); - declarations.push(Declaration { - id: DeclarationId(2457), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10387, 10399), - }); - declarations.push(Declaration { - id: DeclarationId(2458), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "labels".to_string(), - ty: DeclarationId(2457), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10366, 10401), - }); - declarations.push(Declaration { - id: DeclarationId(2459), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "expression".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10490, 10529), - }); - declarations.push(Declaration { - id: DeclarationId(2460), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10552, 10564), - }); - declarations.push(Declaration { - id: DeclarationId(2461), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10569, 10579), - }); - declarations.push(Declaration { - id: DeclarationId(2462), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10584, 10594), - }); - declarations.push(Declaration { - id: DeclarationId(2463), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10599, 10610), - }); - declarations.push(Declaration { - id: DeclarationId(2464), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10615, 10622), - }); - declarations.push(Declaration { - id: DeclarationId(2465), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10627, 10640), - }); - declarations.push(Declaration { - id: DeclarationId(2466), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10821, 10828), - }); - declarations.push(Declaration { - id: DeclarationId(2467), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10840, 10847), - }); - declarations.push(Declaration { - id: DeclarationId(2468), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10903, 10922), - }); - declarations.push(Declaration { - id: DeclarationId(2469), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(2468), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10903, 10923), - }); - declarations.push(Declaration { - id: DeclarationId(2470), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10950, 10957), - }); - declarations.push(Declaration { - id: DeclarationId(2471), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10979, 10986), - }); - declarations.push(Declaration { - id: DeclarationId(2472), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(87), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11042, 11046), - }); - declarations.push(Declaration { - id: DeclarationId(2473), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(2466), - }, - Field { - label: "id".to_string(), - ty: DeclarationId(2467), - }, - Field { - label: "run".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "shell".to_string(), - ty: DeclarationId(1416), - }, - Field { - label: "env".to_string(), - ty: DeclarationId(2469), - }, - Field { - label: "working_directory".to_string(), - ty: DeclarationId(2470), - }, - Field { - label: "if_condition".to_string(), - ty: DeclarationId(2471), - }, - Field { - label: "continue_on_error".to_string(), - ty: DeclarationId(124), - }, - Field { - label: "timeout_minutes".to_string(), - ty: DeclarationId(2472), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10799, 11052), - }); - declarations.push(Declaration { - id: DeclarationId(2474), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11080, 11087), - }); - declarations.push(Declaration { - id: DeclarationId(2475), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11099, 11106), - }); - declarations.push(Declaration { - id: DeclarationId(2476), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11232, 11251), - }); - declarations.push(Declaration { - id: DeclarationId(2477), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(2476), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11232, 11252), - }); - declarations.push(Declaration { - id: DeclarationId(2478), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11265, 11284), - }); - declarations.push(Declaration { - id: DeclarationId(2479), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(2478), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11265, 11285), - }); - declarations.push(Declaration { - id: DeclarationId(2480), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11307, 11314), - }); - declarations.push(Declaration { - id: DeclarationId(2481), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(87), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11370, 11374), - }); - declarations.push(Declaration { - id: DeclarationId(2482), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(2474), - }, - Field { - label: "id".to_string(), - ty: DeclarationId(2475), - }, - Field { - label: "uses".to_string(), - ty: DeclarationId(1417), - }, - Field { - label: "with".to_string(), - ty: DeclarationId(2477), - }, - Field { - label: "env".to_string(), - ty: DeclarationId(2479), - }, - Field { - label: "if_condition".to_string(), - ty: DeclarationId(2480), - }, - Field { - label: "continue_on_error".to_string(), - ty: DeclarationId(124), - }, - Field { - label: "timeout_minutes".to_string(), - ty: DeclarationId(2481), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11057, 11380), - }); - declarations.push(Declaration { - id: DeclarationId(2483), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11399, 11403), - }); - declarations.push(Declaration { - id: DeclarationId(2484), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11406, 11408), - }); - declarations.push(Declaration { - id: DeclarationId(2485), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11411, 11415), - }); - declarations.push(Declaration { - id: DeclarationId(2486), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11418, 11424), - }); - declarations.push(Declaration { - id: DeclarationId(2487), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11427, 11430), - }); - declarations.push(Declaration { - id: DeclarationId(2488), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11793, 11800), - }); - declarations.push(Declaration { - id: DeclarationId(2489), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(87), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11808, 11812), - }); - declarations.push(Declaration { - id: DeclarationId(2490), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(87), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11819, 11823), - }); - declarations.push(Declaration { - id: DeclarationId(2491), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "message".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "file".to_string(), - ty: DeclarationId(2488), - }, - Field { - label: "line".to_string(), - ty: DeclarationId(2489), - }, - Field { - label: "col".to_string(), - ty: DeclarationId(2490), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11752, 11825), - }); - declarations.push(Declaration { - id: DeclarationId(2492), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11873, 11880), - }); - declarations.push(Declaration { - id: DeclarationId(2493), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(87), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11888, 11892), - }); - declarations.push(Declaration { - id: DeclarationId(2494), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(87), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11899, 11903), - }); - declarations.push(Declaration { - id: DeclarationId(2495), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "message".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "file".to_string(), - ty: DeclarationId(2492), - }, - Field { - label: "line".to_string(), - ty: DeclarationId(2493), - }, - Field { - label: "col".to_string(), - ty: DeclarationId(2494), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11830, 11905), - }); - declarations.push(Declaration { - id: DeclarationId(2496), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11952, 11959), - }); - declarations.push(Declaration { - id: DeclarationId(2497), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(87), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11967, 11971), - }); - declarations.push(Declaration { - id: DeclarationId(2498), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(87), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11978, 11982), - }); - declarations.push(Declaration { - id: DeclarationId(2499), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "message".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "file".to_string(), - ty: DeclarationId(2496), - }, - Field { - label: "line".to_string(), - ty: DeclarationId(2497), - }, - Field { - label: "col".to_string(), - ty: DeclarationId(2498), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11910, 11984), - }); - declarations.push(Declaration { - id: DeclarationId(2500), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "title".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11989, 12022), - }); - declarations.push(Declaration { - id: DeclarationId(2501), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 12027, 12045), - }); - declarations.push(Declaration { - id: DeclarationId(2502), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "value".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 12050, 12091), - }); - declarations.push(Declaration { - id: DeclarationId(2503), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "value".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 12096, 12121), - }); - declarations.push(Declaration { - id: DeclarationId(2504), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "token".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 12126, 12156), - }); - declarations.push(Declaration { - id: DeclarationId(2505), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(87), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 12962, 12966), - }); - declarations.push(Declaration { - id: DeclarationId(2506), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "path".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "retention_days".to_string(), - ty: DeclarationId(2505), - }, - Field { - label: "if_no_files_found".to_string(), - ty: DeclarationId(1428), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 12909, 13009), - }); - declarations.push(Declaration { - id: DeclarationId(2507), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13045, 13052), - }); - declarations.push(Declaration { - id: DeclarationId(2508), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "path".to_string(), - ty: DeclarationId(2507), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13014, 13054), - }); - declarations.push(Declaration { - id: DeclarationId(2509), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13084, 13088), - }); - declarations.push(Declaration { - id: DeclarationId(2510), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13091, 13099), - }); - declarations.push(Declaration { - id: DeclarationId(2511), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13102, 13108), - }); - declarations.push(Declaration { - id: DeclarationId(2512), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13570, 13582), - }); - declarations.push(Declaration { - id: DeclarationId(2513), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(2512), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13558, 13583), - }); - declarations.push(Declaration { - id: DeclarationId(2514), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13600, 13619), - }); - declarations.push(Declaration { - id: DeclarationId(2515), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(2514), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13595, 13620), - }); - declarations.push(Declaration { - id: DeclarationId(2516), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13637, 13656), - }); - declarations.push(Declaration { - id: DeclarationId(2517), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(699), - arguments: vec![TemplateArgument { - parameter: DeclarationId(700), - value: DeclarationId(2516), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13632, 13657), - }); - declarations.push(Declaration { - id: DeclarationId(2518), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(87), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13692, 13696), - }); - declarations.push(Declaration { - id: DeclarationId(2519), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13852, 13859), - }); - declarations.push(Declaration { - id: DeclarationId(2520), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13864, 13871), - }); - declarations.push(Declaration { - id: DeclarationId(2521), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13876, 13885), - }); - declarations.push(Declaration { - id: DeclarationId(2522), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13890, 13897), - }); - declarations.push(Declaration { - id: DeclarationId(2523), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13902, 13910), - }); - declarations.push(Declaration { - id: DeclarationId(2524), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13915, 13929), - }); - declarations.push(Declaration { - id: DeclarationId(2525), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/ci.dag", 1935, 1959), - }); - declarations.push(Declaration { - id: DeclarationId(2526), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/ci.dag", 1964, 1989), - }); - declarations.push(Declaration { - id: DeclarationId(2527), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(147)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(1030))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/ci.dag", 2673, 2714), - }); - declarations.push(Declaration { - id: DeclarationId(2528), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(48), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17832, 17834), - }); - declarations.push(Declaration { - id: DeclarationId(2529), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17832, 17834), - }); - declarations.push(Declaration { - id: DeclarationId(2530), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2528), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2529), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17832, 17834), - }); - declarations.push(Declaration { - id: DeclarationId(2531), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(48), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17851, 17853), - }); - declarations.push(Declaration { - id: DeclarationId(2532), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17851, 17853), - }); - declarations.push(Declaration { - id: DeclarationId(2533), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2531), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2532), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17851, 17853), - }); - declarations.push(Declaration { - id: DeclarationId(2534), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(51), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19069, 19071), - }); - declarations.push(Declaration { - id: DeclarationId(2535), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19069, 19071), - }); - declarations.push(Declaration { - id: DeclarationId(2536), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2534), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2535), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19069, 19071), - }); - declarations.push(Declaration { - id: DeclarationId(2537), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(56), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23611, 23632), - }); - declarations.push(Declaration { - id: DeclarationId(2538), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23611, 23632), - }); - declarations.push(Declaration { - id: DeclarationId(2539), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2537), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2538), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23611, 23632), - }); - declarations.push(Declaration { - id: DeclarationId(2540), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(57), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23647, 23657), - }); - declarations.push(Declaration { - id: DeclarationId(2541), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23647, 23657), - }); - declarations.push(Declaration { - id: DeclarationId(2542), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2540), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2541), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23647, 23657), - }); - declarations.push(Declaration { - id: DeclarationId(2543), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23902, 23906), - }); - declarations.push(Declaration { - id: DeclarationId(2544), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23902, 23906), - }); - declarations.push(Declaration { - id: DeclarationId(2545), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2543), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2544), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23902, 23906), - }); - declarations.push(Declaration { - id: DeclarationId(2546), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 3805, 3809), - }); - declarations.push(Declaration { - id: DeclarationId(2547), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 3805, 3809), - }); - declarations.push(Declaration { - id: DeclarationId(2548), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2546), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2547), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 3805, 3809), - }); - declarations.push(Declaration { - id: DeclarationId(2549), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 4356, 4363), - }); - declarations.push(Declaration { - id: DeclarationId(2550), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 4356, 4363), - }); - declarations.push(Declaration { - id: DeclarationId(2551), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2549), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2550), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 4356, 4363), - }); - declarations.push(Declaration { - id: DeclarationId(2552), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 6656, 6663), - }); - declarations.push(Declaration { - id: DeclarationId(2553), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 6656, 6663), - }); - declarations.push(Declaration { - id: DeclarationId(2554), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2552), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2553), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 6656, 6663), - }); - declarations.push(Declaration { - id: DeclarationId(2555), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 6771, 6778), - }); - declarations.push(Declaration { - id: DeclarationId(2556), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 6771, 6778), - }); - declarations.push(Declaration { - id: DeclarationId(2557), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2555), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2556), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 6771, 6778), - }); - declarations.push(Declaration { - id: DeclarationId(2558), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(177), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17906, 17926), - }); - declarations.push(Declaration { - id: DeclarationId(2559), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17906, 17926), - }); - declarations.push(Declaration { - id: DeclarationId(2560), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2558), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2559), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17906, 17926), - }); - declarations.push(Declaration { - id: DeclarationId(2561), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(186), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18562, 18569), - }); - declarations.push(Declaration { - id: DeclarationId(2562), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18562, 18569), - }); - declarations.push(Declaration { - id: DeclarationId(2563), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2561), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2562), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18562, 18569), - }); - declarations.push(Declaration { - id: DeclarationId(2564), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(156), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22322, 22332), - }); - declarations.push(Declaration { - id: DeclarationId(2565), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22322, 22332), - }); - declarations.push(Declaration { - id: DeclarationId(2566), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2564), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2565), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22322, 22332), - }); - declarations.push(Declaration { - id: DeclarationId(2567), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22457, 22464), - }); - declarations.push(Declaration { - id: DeclarationId(2568), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22457, 22464), - }); - declarations.push(Declaration { - id: DeclarationId(2569), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2567), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2568), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22457, 22464), - }); - declarations.push(Declaration { - id: DeclarationId(2570), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22531, 22535), - }); - declarations.push(Declaration { - id: DeclarationId(2571), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22531, 22535), - }); - declarations.push(Declaration { - id: DeclarationId(2572), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2570), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2571), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22531, 22535), - }); - declarations.push(Declaration { - id: DeclarationId(2573), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24302, 24309), - }); - declarations.push(Declaration { - id: DeclarationId(2574), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24302, 24309), - }); - declarations.push(Declaration { - id: DeclarationId(2575), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2573), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2574), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24302, 24309), - }); - declarations.push(Declaration { - id: DeclarationId(2576), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24814, 24821), - }); - declarations.push(Declaration { - id: DeclarationId(2577), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24814, 24821), - }); - declarations.push(Declaration { - id: DeclarationId(2578), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2576), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2577), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24814, 24821), - }); - declarations.push(Declaration { - id: DeclarationId(2579), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24908, 24915), - }); - declarations.push(Declaration { - id: DeclarationId(2580), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24908, 24915), - }); - declarations.push(Declaration { - id: DeclarationId(2581), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2579), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2580), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24908, 24915), - }); - declarations.push(Declaration { - id: DeclarationId(2582), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(222), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25138, 25153), - }); - declarations.push(Declaration { - id: DeclarationId(2583), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25138, 25153), - }); - declarations.push(Declaration { - id: DeclarationId(2584), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2582), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2583), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25138, 25153), - }); - declarations.push(Declaration { - id: DeclarationId(2585), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(188), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25164, 25177), - }); - declarations.push(Declaration { - id: DeclarationId(2586), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25164, 25177), - }); - declarations.push(Declaration { - id: DeclarationId(2587), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2585), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2586), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25164, 25177), - }); - declarations.push(Declaration { - id: DeclarationId(2588), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(187), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25193, 25206), - }); - declarations.push(Declaration { - id: DeclarationId(2589), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25193, 25206), - }); - declarations.push(Declaration { - id: DeclarationId(2590), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2588), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2589), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25193, 25206), - }); - declarations.push(Declaration { - id: DeclarationId(2591), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25316, 25323), - }); - declarations.push(Declaration { - id: DeclarationId(2592), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25316, 25323), - }); - declarations.push(Declaration { - id: DeclarationId(2593), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2591), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2592), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25316, 25323), - }); - declarations.push(Declaration { - id: DeclarationId(2594), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 11898, 11905), - }); - declarations.push(Declaration { - id: DeclarationId(2595), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 11898, 11905), - }); - declarations.push(Declaration { - id: DeclarationId(2596), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2594), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2595), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 11898, 11905), - }); - declarations.push(Declaration { - id: DeclarationId(2597), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 24553, 24560), - }); - declarations.push(Declaration { - id: DeclarationId(2598), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 24553, 24560), - }); - declarations.push(Declaration { - id: DeclarationId(2599), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2597), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2598), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 24553, 24560), - }); - declarations.push(Declaration { - id: DeclarationId(2600), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1483), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 24887, 24909), - }); - declarations.push(Declaration { - id: DeclarationId(2601), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 24887, 24909), - }); - declarations.push(Declaration { - id: DeclarationId(2602), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2600), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2601), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 24887, 24909), - }); - declarations.push(Declaration { - id: DeclarationId(2603), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1486), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 25055, 25077), - }); - declarations.push(Declaration { - id: DeclarationId(2604), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 25055, 25077), - }); - declarations.push(Declaration { - id: DeclarationId(2605), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2603), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2604), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/effects.dag", 25055, 25077), - }); - declarations.push(Declaration { - id: DeclarationId(2606), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(792), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 22398, 22406), - }); - declarations.push(Declaration { - id: DeclarationId(2607), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 22398, 22406), - }); - declarations.push(Declaration { - id: DeclarationId(2608), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2606), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2607), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 22398, 22406), - }); - declarations.push(Declaration { - id: DeclarationId(2609), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(838), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 22455, 22464), - }); - declarations.push(Declaration { - id: DeclarationId(2610), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 22455, 22464), - }); - declarations.push(Declaration { - id: DeclarationId(2611), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2609), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2610), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 22455, 22464), - }); - declarations.push(Declaration { - id: DeclarationId(2612), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(838), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 22530, 22539), - }); - declarations.push(Declaration { - id: DeclarationId(2613), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 22530, 22539), - }); - declarations.push(Declaration { - id: DeclarationId(2614), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2612), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2613), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 22530, 22539), - }); - declarations.push(Declaration { - id: DeclarationId(2615), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(810), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 22916, 22928), - }); - declarations.push(Declaration { - id: DeclarationId(2616), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 22916, 22928), - }); - declarations.push(Declaration { - id: DeclarationId(2617), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2615), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2616), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 22916, 22928), - }); - declarations.push(Declaration { - id: DeclarationId(2618), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(810), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 23791, 23803), - }); - declarations.push(Declaration { - id: DeclarationId(2619), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 23791, 23803), - }); - declarations.push(Declaration { - id: DeclarationId(2620), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2618), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2619), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 23791, 23803), - }); - declarations.push(Declaration { - id: DeclarationId(2621), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(777), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 24114, 24129), - }); - declarations.push(Declaration { - id: DeclarationId(2622), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 24114, 24129), - }); - declarations.push(Declaration { - id: DeclarationId(2623), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2621), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2622), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 24114, 24129), - }); - declarations.push(Declaration { - id: DeclarationId(2624), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(735), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 867, 874), - }); - declarations.push(Declaration { - id: DeclarationId(2625), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 867, 874), - }); - declarations.push(Declaration { - id: DeclarationId(2626), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2624), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2625), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 867, 874), - }); - declarations.push(Declaration { - id: DeclarationId(2627), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 11910, 11917), - }); - declarations.push(Declaration { - id: DeclarationId(2628), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 11910, 11917), - }); - declarations.push(Declaration { - id: DeclarationId(2629), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2627), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2628), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 11910, 11917), - }); - declarations.push(Declaration { - id: DeclarationId(2630), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(737), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 12035, 12049), - }); - declarations.push(Declaration { - id: DeclarationId(2631), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 12035, 12049), - }); - declarations.push(Declaration { - id: DeclarationId(2632), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2630), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2631), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 12035, 12049), - }); - declarations.push(Declaration { - id: DeclarationId(2633), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(737), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 12062, 12076), - }); - declarations.push(Declaration { - id: DeclarationId(2634), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 12062, 12076), - }); - declarations.push(Declaration { - id: DeclarationId(2635), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2633), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2634), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 12062, 12076), - }); - declarations.push(Declaration { - id: DeclarationId(2636), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(806), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 12091, 12101), - }); - declarations.push(Declaration { - id: DeclarationId(2637), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 12091, 12101), - }); - declarations.push(Declaration { - id: DeclarationId(2638), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2636), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2637), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 12091, 12101), - }); - declarations.push(Declaration { - id: DeclarationId(2639), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(812), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 12121, 12136), - }); - declarations.push(Declaration { - id: DeclarationId(2640), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 12121, 12136), - }); - declarations.push(Declaration { - id: DeclarationId(2641), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2639), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2640), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 12121, 12136), - }); - declarations.push(Declaration { - id: DeclarationId(2642), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(820), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 15579, 15594), - }); - declarations.push(Declaration { - id: DeclarationId(2643), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 15579, 15594), - }); - declarations.push(Declaration { - id: DeclarationId(2644), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2642), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2643), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 15579, 15594), - }); - declarations.push(Declaration { - id: DeclarationId(2645), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(777), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 18628, 18643), - }); - declarations.push(Declaration { - id: DeclarationId(2646), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 18628, 18643), - }); - declarations.push(Declaration { - id: DeclarationId(2647), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2645), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2646), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 18628, 18643), - }); - declarations.push(Declaration { - id: DeclarationId(2648), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(833), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19117, 19141), - }); - declarations.push(Declaration { - id: DeclarationId(2649), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19117, 19141), - }); - declarations.push(Declaration { - id: DeclarationId(2650), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2648), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2649), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19117, 19141), - }); - declarations.push(Declaration { - id: DeclarationId(2651), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(777), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19695, 19710), - }); - declarations.push(Declaration { - id: DeclarationId(2652), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19695, 19710), - }); - declarations.push(Declaration { - id: DeclarationId(2653), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2651), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2652), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19695, 19710), - }); - declarations.push(Declaration { - id: DeclarationId(2654), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(836), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19733, 19755), - }); - declarations.push(Declaration { - id: DeclarationId(2655), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19733, 19755), - }); - declarations.push(Declaration { - id: DeclarationId(2656), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2654), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2655), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/substrate.dag", 19733, 19755), - }); - declarations.push(Declaration { - id: DeclarationId(2657), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(856), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 5742, 5779), - }); - declarations.push(Declaration { - id: DeclarationId(2658), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 5742, 5779), - }); - declarations.push(Declaration { - id: DeclarationId(2659), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2657), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2658), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 5742, 5779), - }); - declarations.push(Declaration { - id: DeclarationId(2660), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(855), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 5801, 5814), - }); - declarations.push(Declaration { - id: DeclarationId(2661), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 5801, 5814), - }); - declarations.push(Declaration { - id: DeclarationId(2662), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2660), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2661), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 5801, 5814), - }); - declarations.push(Declaration { - id: DeclarationId(2663), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(857), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 6486, 6513), - }); - declarations.push(Declaration { - id: DeclarationId(2664), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 6486, 6513), - }); - declarations.push(Declaration { - id: DeclarationId(2665), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2663), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2664), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 6486, 6513), - }); - declarations.push(Declaration { - id: DeclarationId(2666), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(124), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 6530, 6535), - }); - declarations.push(Declaration { - id: DeclarationId(2667), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 6530, 6535), - }); - declarations.push(Declaration { - id: DeclarationId(2668), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2666), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2667), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 6530, 6535), - }); - declarations.push(Declaration { - id: DeclarationId(2669), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 7891, 7898), - }); - declarations.push(Declaration { - id: DeclarationId(2670), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 7891, 7898), - }); - declarations.push(Declaration { - id: DeclarationId(2671), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2669), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2670), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 7891, 7898), - }); - declarations.push(Declaration { - id: DeclarationId(2672), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 7909, 7916), - }); - declarations.push(Declaration { - id: DeclarationId(2673), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 7909, 7916), - }); - declarations.push(Declaration { - id: DeclarationId(2674), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2672), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2673), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 7909, 7916), - }); - declarations.push(Declaration { - id: DeclarationId(2675), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8039, 8046), - }); - declarations.push(Declaration { - id: DeclarationId(2676), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8039, 8046), - }); - declarations.push(Declaration { - id: DeclarationId(2677), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2675), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2676), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8039, 8046), - }); - declarations.push(Declaration { - id: DeclarationId(2678), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8057, 8064), - }); - declarations.push(Declaration { - id: DeclarationId(2679), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8057, 8064), - }); - declarations.push(Declaration { - id: DeclarationId(2680), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2678), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2679), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8057, 8064), - }); - declarations.push(Declaration { - id: DeclarationId(2681), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8197, 8204), - }); - declarations.push(Declaration { - id: DeclarationId(2682), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8197, 8204), - }); - declarations.push(Declaration { - id: DeclarationId(2683), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2681), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2682), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8197, 8204), - }); - declarations.push(Declaration { - id: DeclarationId(2684), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8215, 8222), - }); - declarations.push(Declaration { - id: DeclarationId(2685), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8215, 8222), - }); - declarations.push(Declaration { - id: DeclarationId(2686), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2684), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2685), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8215, 8222), - }); - declarations.push(Declaration { - id: DeclarationId(2687), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8353, 8360), - }); - declarations.push(Declaration { - id: DeclarationId(2688), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8353, 8360), - }); - declarations.push(Declaration { - id: DeclarationId(2689), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2687), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2688), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8353, 8360), - }); - declarations.push(Declaration { - id: DeclarationId(2690), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8446, 8453), - }); - declarations.push(Declaration { - id: DeclarationId(2691), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8446, 8453), - }); - declarations.push(Declaration { - id: DeclarationId(2692), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2690), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2691), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 8446, 8453), - }); - declarations.push(Declaration { - id: DeclarationId(2693), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1704), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9151, 9186), - }); - declarations.push(Declaration { - id: DeclarationId(2694), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9151, 9186), - }); - declarations.push(Declaration { - id: DeclarationId(2695), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2693), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2694), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9151, 9186), - }); - declarations.push(Declaration { - id: DeclarationId(2696), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(126), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9389, 9394), - }); - declarations.push(Declaration { - id: DeclarationId(2697), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9389, 9394), - }); - declarations.push(Declaration { - id: DeclarationId(2698), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2696), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2697), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9389, 9394), - }); - declarations.push(Declaration { - id: DeclarationId(2699), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(126), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9494, 9499), - }); - declarations.push(Declaration { - id: DeclarationId(2700), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9494, 9499), - }); - declarations.push(Declaration { - id: DeclarationId(2701), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2699), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2700), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9494, 9499), - }); - declarations.push(Declaration { - id: DeclarationId(2702), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(126), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9585, 9590), - }); - declarations.push(Declaration { - id: DeclarationId(2703), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9585, 9590), - }); - declarations.push(Declaration { - id: DeclarationId(2704), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2702), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2703), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 9585, 9590), - }); - declarations.push(Declaration { - id: DeclarationId(2705), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 10523, 10527), - }); - declarations.push(Declaration { - id: DeclarationId(2706), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 10523, 10527), - }); - declarations.push(Declaration { - id: DeclarationId(2707), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2705), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2706), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 10523, 10527), - }); - declarations.push(Declaration { - id: DeclarationId(2708), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 10559, 10563), - }); - declarations.push(Declaration { - id: DeclarationId(2709), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 10559, 10563), - }); - declarations.push(Declaration { - id: DeclarationId(2710), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2708), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2709), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 10559, 10563), - }); - declarations.push(Declaration { - id: DeclarationId(2711), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(869), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 10595, 10627), - }); - declarations.push(Declaration { - id: DeclarationId(2712), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 10595, 10627), - }); - declarations.push(Declaration { - id: DeclarationId(2713), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2711), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2712), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 10595, 10627), - }); - declarations.push(Declaration { - id: DeclarationId(2714), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 11596, 11603), - }); - declarations.push(Declaration { - id: DeclarationId(2715), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 11596, 11603), - }); - declarations.push(Declaration { - id: DeclarationId(2716), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2714), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2715), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 11596, 11603), - }); - declarations.push(Declaration { - id: DeclarationId(2717), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(126), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 11664, 11669), - }); - declarations.push(Declaration { - id: DeclarationId(2718), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 11664, 11669), - }); - declarations.push(Declaration { - id: DeclarationId(2719), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2717), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2718), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_schema.dag", 11664, 11669), - }); - declarations.push(Declaration { - id: DeclarationId(2720), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(109), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_messages.dag", 4566, 4572), - }); - declarations.push(Declaration { - id: DeclarationId(2721), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_messages.dag", 4566, 4572), - }); - declarations.push(Declaration { - id: DeclarationId(2722), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2720), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2721), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_messages.dag", 4566, 4572), - }); - declarations.push(Declaration { - id: DeclarationId(2723), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_messages.dag", 4589, 4596), - }); - declarations.push(Declaration { - id: DeclarationId(2724), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_messages.dag", 4589, 4596), - }); - declarations.push(Declaration { - id: DeclarationId(2725), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2723), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2724), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/anthropic_messages.dag", 4589, 4596), - }); - declarations.push(Declaration { - id: DeclarationId(2726), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(907), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lookup.dag", 1444, 1450), - }); - declarations.push(Declaration { - id: DeclarationId(2727), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lookup.dag", 1444, 1450), - }); - declarations.push(Declaration { - id: DeclarationId(2728), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2726), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2727), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/lookup.dag", 1444, 1450), - }); - declarations.push(Declaration { - id: DeclarationId(2729), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(912), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 6780, 6801), - }); - declarations.push(Declaration { - id: DeclarationId(2730), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 6780, 6801), - }); - declarations.push(Declaration { - id: DeclarationId(2731), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2729), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2730), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 6780, 6801), - }); - declarations.push(Declaration { - id: DeclarationId(2732), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(913), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 6816, 6826), - }); - declarations.push(Declaration { - id: DeclarationId(2733), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 6816, 6826), - }); - declarations.push(Declaration { - id: DeclarationId(2734), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2732), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2733), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 6816, 6826), - }); - declarations.push(Declaration { - id: DeclarationId(2735), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 6856, 6860), - }); - declarations.push(Declaration { - id: DeclarationId(2736), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 6856, 6860), - }); - declarations.push(Declaration { - id: DeclarationId(2737), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2735), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2736), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 6856, 6860), - }); - declarations.push(Declaration { - id: DeclarationId(2738), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 7429, 7436), - }); - declarations.push(Declaration { - id: DeclarationId(2739), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 7429, 7436), - }); - declarations.push(Declaration { - id: DeclarationId(2740), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2738), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2739), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/algebra.dag", 7429, 7436), - }); - declarations.push(Declaration { - id: DeclarationId(2741), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(970), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 2751, 2763), - }); - declarations.push(Declaration { - id: DeclarationId(2742), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 2751, 2763), - }); - declarations.push(Declaration { - id: DeclarationId(2743), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2741), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2742), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 2751, 2763), - }); - declarations.push(Declaration { - id: DeclarationId(2744), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(736), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 2961, 2968), - }); - declarations.push(Declaration { - id: DeclarationId(2745), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 2961, 2968), - }); - declarations.push(Declaration { - id: DeclarationId(2746), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2744), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2745), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 2961, 2968), - }); - declarations.push(Declaration { - id: DeclarationId(2747), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 5779, 5786), - }); - declarations.push(Declaration { - id: DeclarationId(2748), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 5779, 5786), - }); - declarations.push(Declaration { - id: DeclarationId(2749), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2747), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2748), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 5779, 5786), - }); - declarations.push(Declaration { - id: DeclarationId(2750), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 6710, 6714), - }); - declarations.push(Declaration { - id: DeclarationId(2751), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 6710, 6714), - }); - declarations.push(Declaration { - id: DeclarationId(2752), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2750), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2751), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 6710, 6714), - }); - declarations.push(Declaration { - id: DeclarationId(2753), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(981), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 7761, 7780), - }); - declarations.push(Declaration { - id: DeclarationId(2754), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 7761, 7780), - }); - declarations.push(Declaration { - id: DeclarationId(2755), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2753), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2754), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 7761, 7780), - }); - declarations.push(Declaration { - id: DeclarationId(2756), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(981), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 8326, 8345), - }); - declarations.push(Declaration { - id: DeclarationId(2757), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 8326, 8345), - }); - declarations.push(Declaration { - id: DeclarationId(2758), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2756), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2757), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 8326, 8345), - }); - declarations.push(Declaration { - id: DeclarationId(2759), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(973), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 3859, 3872), - }); - declarations.push(Declaration { - id: DeclarationId(2760), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 3859, 3872), - }); - declarations.push(Declaration { - id: DeclarationId(2761), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2759), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2760), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/computation.dag", 3859, 3872), - }); - declarations.push(Declaration { - id: DeclarationId(2762), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1141), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 2429, 2445), - }); - declarations.push(Declaration { - id: DeclarationId(2763), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 2429, 2445), - }); - declarations.push(Declaration { - id: DeclarationId(2764), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2762), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2763), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 2429, 2445), - }); - declarations.push(Declaration { - id: DeclarationId(2765), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1141), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 2450, 2466), - }); - declarations.push(Declaration { - id: DeclarationId(2766), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 2450, 2466), - }); - declarations.push(Declaration { - id: DeclarationId(2767), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2765), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2766), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 2450, 2466), - }); - declarations.push(Declaration { - id: DeclarationId(2768), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1141), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 2471, 2487), - }); - declarations.push(Declaration { - id: DeclarationId(2769), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 2471, 2487), - }); - declarations.push(Declaration { - id: DeclarationId(2770), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2768), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2769), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 2471, 2487), - }); - declarations.push(Declaration { - id: DeclarationId(2771), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1149), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 6397, 6419), - }); - declarations.push(Declaration { - id: DeclarationId(2772), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 6397, 6419), - }); - declarations.push(Declaration { - id: DeclarationId(2773), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2771), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2772), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 6397, 6419), - }); - declarations.push(Declaration { - id: DeclarationId(2774), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1151), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 6839, 6859), - }); - declarations.push(Declaration { - id: DeclarationId(2775), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 6839, 6859), - }); - declarations.push(Declaration { - id: DeclarationId(2776), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2774), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2775), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/termination.dag", 6839, 6859), - }); - declarations.push(Declaration { - id: DeclarationId(2777), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(970), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 21954, 21966), - }); - declarations.push(Declaration { - id: DeclarationId(2778), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 21954, 21966), - }); - declarations.push(Declaration { - id: DeclarationId(2779), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2777), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2778), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 21954, 21966), - }); - declarations.push(Declaration { - id: DeclarationId(2780), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(975), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 23501, 23516), - }); - declarations.push(Declaration { - id: DeclarationId(2781), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 23501, 23516), - }); - declarations.push(Declaration { - id: DeclarationId(2782), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2780), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2781), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 23501, 23516), - }); - declarations.push(Declaration { - id: DeclarationId(2783), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 35581, 35585), - }); - declarations.push(Declaration { - id: DeclarationId(2784), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 35581, 35585), - }); - declarations.push(Declaration { - id: DeclarationId(2785), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2783), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2784), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 35581, 35585), - }); - declarations.push(Declaration { - id: DeclarationId(2786), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 35877, 35881), - }); - declarations.push(Declaration { - id: DeclarationId(2787), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 35877, 35881), - }); - declarations.push(Declaration { - id: DeclarationId(2788), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2786), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2787), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 35877, 35881), - }); - declarations.push(Declaration { - id: DeclarationId(2789), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 37126, 37130), - }); - declarations.push(Declaration { - id: DeclarationId(2790), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 37126, 37130), - }); - declarations.push(Declaration { - id: DeclarationId(2791), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2789), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2790), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 37126, 37130), - }); - declarations.push(Declaration { - id: DeclarationId(2792), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 37601, 37605), - }); - declarations.push(Declaration { - id: DeclarationId(2793), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 37601, 37605), - }); - declarations.push(Declaration { - id: DeclarationId(2794), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2792), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2793), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 37601, 37605), - }); - declarations.push(Declaration { - id: DeclarationId(2795), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 38864, 38868), - }); - declarations.push(Declaration { - id: DeclarationId(2796), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 38864, 38868), - }); - declarations.push(Declaration { - id: DeclarationId(2797), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2795), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2796), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 38864, 38868), - }); - declarations.push(Declaration { - id: DeclarationId(2798), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 39136, 39140), - }); - declarations.push(Declaration { - id: DeclarationId(2799), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 39136, 39140), - }); - declarations.push(Declaration { - id: DeclarationId(2800), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2798), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2799), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/induction.dag", 39136, 39140), - }); - declarations.push(Declaration { - id: DeclarationId(2801), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(817), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/operators.dag", 142, 155), - }); - declarations.push(Declaration { - id: DeclarationId(2802), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/operators.dag", 142, 155), - }); - declarations.push(Declaration { - id: DeclarationId(2803), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2801), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2802), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/compiler/operators.dag", 142, 155), - }); - declarations.push(Declaration { - id: DeclarationId(2804), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(156), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 1274, 1284), - }); - declarations.push(Declaration { - id: DeclarationId(2805), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 1274, 1284), - }); - declarations.push(Declaration { - id: DeclarationId(2806), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2804), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2805), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 1274, 1284), - }); - declarations.push(Declaration { - id: DeclarationId(2807), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 1554, 1561), - }); - declarations.push(Declaration { - id: DeclarationId(2808), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 1554, 1561), - }); - declarations.push(Declaration { - id: DeclarationId(2809), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2807), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2808), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/github.dag", 1554, 1561), - }); - declarations.push(Declaration { - id: DeclarationId(2810), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1412), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 1847, 1863), - }); - declarations.push(Declaration { - id: DeclarationId(2811), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 1847, 1863), - }); - declarations.push(Declaration { - id: DeclarationId(2812), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2810), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2811), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 1847, 1863), - }); - declarations.push(Declaration { - id: DeclarationId(2813), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(2404), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 1979, 1999), - }); - declarations.push(Declaration { - id: DeclarationId(2814), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 1979, 1999), - }); - declarations.push(Declaration { - id: DeclarationId(2815), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2813), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2814), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 1979, 1999), - }); - declarations.push(Declaration { - id: DeclarationId(2816), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1401), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2015, 2035), - }); - declarations.push(Declaration { - id: DeclarationId(2817), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2015, 2035), - }); - declarations.push(Declaration { - id: DeclarationId(2818), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2816), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2817), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2015, 2035), - }); - declarations.push(Declaration { - id: DeclarationId(2819), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2794, 2801), - }); - declarations.push(Declaration { - id: DeclarationId(2820), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2794, 2801), - }); - declarations.push(Declaration { - id: DeclarationId(2821), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2819), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2820), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2794, 2801), - }); - declarations.push(Declaration { - id: DeclarationId(2822), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2830, 2837), - }); - declarations.push(Declaration { - id: DeclarationId(2823), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2830, 2837), - }); - declarations.push(Declaration { - id: DeclarationId(2824), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2822), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2823), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 2830, 2837), - }); - declarations.push(Declaration { - id: DeclarationId(2825), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5623, 5630), - }); - declarations.push(Declaration { - id: DeclarationId(2826), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5623, 5630), - }); - declarations.push(Declaration { - id: DeclarationId(2827), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2825), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2826), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5623, 5630), - }); - declarations.push(Declaration { - id: DeclarationId(2828), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(2438), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5781, 5801), - }); - declarations.push(Declaration { - id: DeclarationId(2829), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5781, 5801), - }); - declarations.push(Declaration { - id: DeclarationId(2830), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2828), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2829), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5781, 5801), - }); - declarations.push(Declaration { - id: DeclarationId(2831), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(2440), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5904, 5924), - }); - declarations.push(Declaration { - id: DeclarationId(2832), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5904, 5924), - }); - declarations.push(Declaration { - id: DeclarationId(2833), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2831), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2832), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5904, 5924), - }); - declarations.push(Declaration { - id: DeclarationId(2834), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5941, 5948), - }); - declarations.push(Declaration { - id: DeclarationId(2835), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5941, 5948), - }); - declarations.push(Declaration { - id: DeclarationId(2836), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2834), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2835), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5941, 5948), - }); - declarations.push(Declaration { - id: DeclarationId(2837), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1431), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5961, 5976), - }); - declarations.push(Declaration { - id: DeclarationId(2838), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5961, 5976), - }); - declarations.push(Declaration { - id: DeclarationId(2839), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2837), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2838), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5961, 5976), - }); - declarations.push(Declaration { - id: DeclarationId(2840), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5996, 6000), - }); - declarations.push(Declaration { - id: DeclarationId(2841), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5996, 6000), - }); - declarations.push(Declaration { - id: DeclarationId(2842), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2840), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2841), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 5996, 6000), - }); - declarations.push(Declaration { - id: DeclarationId(2843), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1412), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 6042, 6058), - }); - declarations.push(Declaration { - id: DeclarationId(2844), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 6042, 6058), - }); - declarations.push(Declaration { - id: DeclarationId(2845), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2843), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2844), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 6042, 6058), - }); - declarations.push(Declaration { - id: DeclarationId(2846), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1411), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 8707, 8736), - }); - declarations.push(Declaration { - id: DeclarationId(2847), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 8707, 8736), - }); - declarations.push(Declaration { - id: DeclarationId(2848), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2846), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2847), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 8707, 8736), - }); - declarations.push(Declaration { - id: DeclarationId(2849), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(1410), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 8904, 8925), - }); - declarations.push(Declaration { - id: DeclarationId(2850), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 8904, 8925), - }); - declarations.push(Declaration { - id: DeclarationId(2851), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2849), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2850), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 8904, 8925), - }); - declarations.push(Declaration { - id: DeclarationId(2852), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(125), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 9123, 9128), - }); - declarations.push(Declaration { - id: DeclarationId(2853), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 9123, 9128), - }); - declarations.push(Declaration { - id: DeclarationId(2854), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2852), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2853), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 9123, 9128), - }); - declarations.push(Declaration { - id: DeclarationId(2855), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10821, 10828), - }); - declarations.push(Declaration { - id: DeclarationId(2856), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10821, 10828), - }); - declarations.push(Declaration { - id: DeclarationId(2857), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2855), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2856), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10821, 10828), - }); - declarations.push(Declaration { - id: DeclarationId(2858), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10840, 10847), - }); - declarations.push(Declaration { - id: DeclarationId(2859), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10840, 10847), - }); - declarations.push(Declaration { - id: DeclarationId(2860), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2858), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2859), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10840, 10847), - }); - declarations.push(Declaration { - id: DeclarationId(2861), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(2468), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10903, 10923), - }); - declarations.push(Declaration { - id: DeclarationId(2862), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10903, 10923), - }); - declarations.push(Declaration { - id: DeclarationId(2863), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2861), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2862), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10903, 10923), - }); - declarations.push(Declaration { - id: DeclarationId(2864), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10950, 10957), - }); - declarations.push(Declaration { - id: DeclarationId(2865), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10950, 10957), - }); - declarations.push(Declaration { - id: DeclarationId(2866), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2864), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2865), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10950, 10957), - }); - declarations.push(Declaration { - id: DeclarationId(2867), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10979, 10986), - }); - declarations.push(Declaration { - id: DeclarationId(2868), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10979, 10986), - }); - declarations.push(Declaration { - id: DeclarationId(2869), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2867), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2868), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 10979, 10986), - }); - declarations.push(Declaration { - id: DeclarationId(2870), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11042, 11046), - }); - declarations.push(Declaration { - id: DeclarationId(2871), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11042, 11046), - }); - declarations.push(Declaration { - id: DeclarationId(2872), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2870), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2871), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11042, 11046), - }); - declarations.push(Declaration { - id: DeclarationId(2873), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11080, 11087), - }); - declarations.push(Declaration { - id: DeclarationId(2874), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11080, 11087), - }); - declarations.push(Declaration { - id: DeclarationId(2875), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2873), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2874), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11080, 11087), - }); - declarations.push(Declaration { - id: DeclarationId(2876), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11099, 11106), - }); - declarations.push(Declaration { - id: DeclarationId(2877), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11099, 11106), - }); - declarations.push(Declaration { - id: DeclarationId(2878), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2876), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2877), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11099, 11106), - }); - declarations.push(Declaration { - id: DeclarationId(2879), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(2476), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11232, 11252), - }); - declarations.push(Declaration { - id: DeclarationId(2880), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11232, 11252), - }); - declarations.push(Declaration { - id: DeclarationId(2881), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2879), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2880), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11232, 11252), - }); - declarations.push(Declaration { - id: DeclarationId(2882), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(2478), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11265, 11285), - }); - declarations.push(Declaration { - id: DeclarationId(2883), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11265, 11285), - }); - declarations.push(Declaration { - id: DeclarationId(2884), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2882), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2883), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11265, 11285), - }); - declarations.push(Declaration { - id: DeclarationId(2885), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11307, 11314), - }); - declarations.push(Declaration { - id: DeclarationId(2886), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11307, 11314), - }); - declarations.push(Declaration { - id: DeclarationId(2887), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2885), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2886), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11307, 11314), - }); - declarations.push(Declaration { - id: DeclarationId(2888), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11370, 11374), - }); - declarations.push(Declaration { - id: DeclarationId(2889), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11370, 11374), - }); - declarations.push(Declaration { - id: DeclarationId(2890), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2888), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2889), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11370, 11374), - }); - declarations.push(Declaration { - id: DeclarationId(2891), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11793, 11800), - }); - declarations.push(Declaration { - id: DeclarationId(2892), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11793, 11800), - }); - declarations.push(Declaration { - id: DeclarationId(2893), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2891), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2892), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11793, 11800), - }); - declarations.push(Declaration { - id: DeclarationId(2894), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11808, 11812), - }); - declarations.push(Declaration { - id: DeclarationId(2895), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11808, 11812), - }); - declarations.push(Declaration { - id: DeclarationId(2896), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2894), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2895), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11808, 11812), - }); - declarations.push(Declaration { - id: DeclarationId(2897), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11819, 11823), - }); - declarations.push(Declaration { - id: DeclarationId(2898), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11819, 11823), - }); - declarations.push(Declaration { - id: DeclarationId(2899), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2897), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2898), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11819, 11823), - }); - declarations.push(Declaration { - id: DeclarationId(2900), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11873, 11880), - }); - declarations.push(Declaration { - id: DeclarationId(2901), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11873, 11880), - }); - declarations.push(Declaration { - id: DeclarationId(2902), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2900), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2901), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11873, 11880), - }); - declarations.push(Declaration { - id: DeclarationId(2903), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11888, 11892), - }); - declarations.push(Declaration { - id: DeclarationId(2904), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11888, 11892), - }); - declarations.push(Declaration { - id: DeclarationId(2905), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2903), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2904), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11888, 11892), - }); - declarations.push(Declaration { - id: DeclarationId(2906), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11899, 11903), - }); - declarations.push(Declaration { - id: DeclarationId(2907), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11899, 11903), - }); - declarations.push(Declaration { - id: DeclarationId(2908), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2906), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2907), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11899, 11903), - }); - declarations.push(Declaration { - id: DeclarationId(2909), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11952, 11959), - }); - declarations.push(Declaration { - id: DeclarationId(2910), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11952, 11959), - }); - declarations.push(Declaration { - id: DeclarationId(2911), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2909), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2910), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11952, 11959), - }); - declarations.push(Declaration { - id: DeclarationId(2912), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11967, 11971), - }); - declarations.push(Declaration { - id: DeclarationId(2913), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11967, 11971), - }); - declarations.push(Declaration { - id: DeclarationId(2914), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2912), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2913), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11967, 11971), - }); - declarations.push(Declaration { - id: DeclarationId(2915), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11978, 11982), - }); - declarations.push(Declaration { - id: DeclarationId(2916), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11978, 11982), - }); - declarations.push(Declaration { - id: DeclarationId(2917), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2915), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2916), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 11978, 11982), - }); - declarations.push(Declaration { - id: DeclarationId(2918), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 12962, 12966), - }); - declarations.push(Declaration { - id: DeclarationId(2919), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 12962, 12966), - }); - declarations.push(Declaration { - id: DeclarationId(2920), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2918), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2919), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 12962, 12966), - }); - declarations.push(Declaration { - id: DeclarationId(2921), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13045, 13052), - }); - declarations.push(Declaration { - id: DeclarationId(2922), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13045, 13052), - }); - declarations.push(Declaration { - id: DeclarationId(2923), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2921), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2922), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13045, 13052), - }); - declarations.push(Declaration { - id: DeclarationId(2924), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13692, 13696), - }); - declarations.push(Declaration { - id: DeclarationId(2925), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13692, 13696), - }); - declarations.push(Declaration { - id: DeclarationId(2926), - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: DeclarationId(2924), - }, - Field { - label: "None".to_string(), - ty: DeclarationId(2925), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/extdeps/github/actions.dag", 13692, 13696), - }); - declarations - } -} - -fn bootstrapped_fixture_without_parse_surface_dag_ports() -> HashMap { - { - let mut ports = HashMap::new(); - ports.insert( - PortId(0), - Port { - id: PortId(0), - state: PortState::Resolved(TypeShape::new(DeclarationId(76))), - produced_by: None, - }, - ); - ports.insert( - PortId(1), - Port { - id: PortId(1), - state: PortState::Uninferred, - produced_by: Some(NodeId(0)), - }, - ); - ports.insert( - PortId(2), - Port { - id: PortId(2), - state: PortState::Uninferred, - produced_by: Some(NodeId(1)), - }, - ); - ports.insert( - PortId(3), - Port { - id: PortId(3), - state: PortState::Resolved(TypeShape::new(DeclarationId(87))), - produced_by: None, - }, - ); - ports.insert( - PortId(4), - Port { - id: PortId(4), - state: PortState::Uninferred, - produced_by: Some(NodeId(3)), - }, - ); - ports.insert( - PortId(5), - Port { - id: PortId(5), - state: PortState::Uninferred, - produced_by: Some(NodeId(4)), - }, - ); - ports.insert( - PortId(6), - Port { - id: PortId(6), - state: PortState::Uninferred, - produced_by: Some(NodeId(5)), - }, - ); - ports.insert( - PortId(7), - Port { - id: PortId(7), - state: PortState::Uninferred, - produced_by: Some(NodeId(6)), - }, - ); - ports.insert( - PortId(8), - Port { - id: PortId(8), - state: PortState::Uninferred, - produced_by: Some(NodeId(7)), - }, - ); - ports.insert( - PortId(9), - Port { - id: PortId(9), - state: PortState::Uninferred, - produced_by: Some(NodeId(8)), - }, - ); - ports.insert( - PortId(10), - Port { - id: PortId(10), - state: PortState::Uninferred, - produced_by: Some(NodeId(9)), - }, - ); - ports.insert( - PortId(11), - Port { - id: PortId(11), - state: PortState::Uninferred, - produced_by: Some(NodeId(10)), - }, - ); - ports.insert( - PortId(12), - Port { - id: PortId(12), - state: PortState::Uninferred, - produced_by: Some(NodeId(11)), - }, - ); - ports.insert( - PortId(13), - Port { - id: PortId(13), - state: PortState::Uninferred, - produced_by: Some(NodeId(12)), - }, - ); - ports.insert( - PortId(14), - Port { - id: PortId(14), - state: PortState::Uninferred, - produced_by: Some(NodeId(13)), - }, - ); - ports.insert( - PortId(15), - Port { - id: PortId(15), - state: PortState::Uninferred, - produced_by: Some(NodeId(14)), - }, - ); - ports.insert( - PortId(16), - Port { - id: PortId(16), - state: PortState::Uninferred, - produced_by: Some(NodeId(15)), - }, - ); - ports.insert( - PortId(17), - Port { - id: PortId(17), - state: PortState::Uninferred, - produced_by: Some(NodeId(16)), - }, - ); - ports.insert( - PortId(18), - Port { - id: PortId(18), - state: PortState::Uninferred, - produced_by: Some(NodeId(17)), - }, - ); - ports.insert( - PortId(19), - Port { - id: PortId(19), - state: PortState::Uninferred, - produced_by: Some(NodeId(18)), - }, - ); - ports.insert( - PortId(20), - Port { - id: PortId(20), - state: PortState::Uninferred, - produced_by: Some(NodeId(19)), - }, - ); - ports.insert( - PortId(21), - Port { - id: PortId(21), - state: PortState::Resolved(TypeShape::new(DeclarationId(87))), - produced_by: None, - }, - ); - ports.insert( - PortId(22), - Port { - id: PortId(22), - state: PortState::Uninferred, - produced_by: Some(NodeId(21)), - }, - ); - ports.insert( - PortId(23), - Port { - id: PortId(23), - state: PortState::Uninferred, - produced_by: Some(NodeId(22)), - }, - ); - ports.insert( - PortId(24), - Port { - id: PortId(24), - state: PortState::Uninferred, - produced_by: Some(NodeId(23)), - }, - ); - ports.insert( - PortId(25), - Port { - id: PortId(25), - state: PortState::Uninferred, - produced_by: Some(NodeId(24)), - }, - ); - ports.insert( - PortId(26), - Port { - id: PortId(26), - state: PortState::Uninferred, - produced_by: Some(NodeId(25)), - }, - ); - ports.insert( - PortId(27), - Port { - id: PortId(27), - state: PortState::Resolved(TypeShape::new(DeclarationId(87))), - produced_by: None, - }, - ); - ports.insert( - PortId(28), - Port { - id: PortId(28), - state: PortState::Uninferred, - produced_by: Some(NodeId(27)), - }, - ); - ports.insert( - PortId(29), - Port { - id: PortId(29), - state: PortState::Uninferred, - produced_by: Some(NodeId(28)), - }, - ); - ports.insert( - PortId(30), - Port { - id: PortId(30), - state: PortState::Uninferred, - produced_by: Some(NodeId(29)), - }, - ); - ports.insert( - PortId(31), - Port { - id: PortId(31), - state: PortState::Uninferred, - produced_by: Some(NodeId(30)), - }, - ); - ports.insert( - PortId(32), - Port { - id: PortId(32), - state: PortState::Uninferred, - produced_by: Some(NodeId(31)), - }, - ); - ports.insert( - PortId(33), - Port { - id: PortId(33), - state: PortState::Resolved(TypeShape::new(DeclarationId(87))), - produced_by: None, - }, - ); - ports.insert( - PortId(34), - Port { - id: PortId(34), - state: PortState::Uninferred, - produced_by: Some(NodeId(33)), - }, - ); - ports.insert( - PortId(35), - Port { - id: PortId(35), - state: PortState::Uninferred, - produced_by: Some(NodeId(34)), - }, - ); - ports.insert( - PortId(36), - Port { - id: PortId(36), - state: PortState::Uninferred, - produced_by: Some(NodeId(35)), - }, - ); - ports.insert( - PortId(37), - Port { - id: PortId(37), - state: PortState::Uninferred, - produced_by: Some(NodeId(36)), - }, - ); - ports.insert( - PortId(38), - Port { - id: PortId(38), - state: PortState::Uninferred, - produced_by: Some(NodeId(37)), - }, - ); - ports.insert( - PortId(39), - Port { - id: PortId(39), - state: PortState::Resolved(TypeShape::new(DeclarationId(147))), - produced_by: None, - }, - ); - ports.insert( - PortId(40), - Port { - id: PortId(40), - state: PortState::Uninferred, - produced_by: Some(NodeId(39)), - }, - ); - ports.insert( - PortId(41), - Port { - id: PortId(41), - state: PortState::Uninferred, - produced_by: Some(NodeId(40)), - }, - ); - ports.insert( - PortId(42), - Port { - id: PortId(42), - state: PortState::Uninferred, - produced_by: Some(NodeId(41)), - }, - ); - ports.insert( - PortId(43), - Port { - id: PortId(43), - state: PortState::Uninferred, - produced_by: Some(NodeId(42)), - }, - ); - ports.insert( - PortId(44), - Port { - id: PortId(44), - state: PortState::Uninferred, - produced_by: Some(NodeId(43)), - }, - ); - ports.insert( - PortId(45), - Port { - id: PortId(45), - state: PortState::Resolved(TypeShape::new(DeclarationId(147))), - produced_by: None, - }, - ); - ports.insert( - PortId(46), - Port { - id: PortId(46), - state: PortState::Uninferred, - produced_by: Some(NodeId(45)), - }, - ); - ports.insert( - PortId(47), - Port { - id: PortId(47), - state: PortState::Uninferred, - produced_by: Some(NodeId(46)), - }, - ); - ports.insert( - PortId(48), - Port { - id: PortId(48), - state: PortState::Uninferred, - produced_by: Some(NodeId(47)), - }, - ); - ports.insert( - PortId(49), - Port { - id: PortId(49), - state: PortState::Uninferred, - produced_by: Some(NodeId(48)), - }, - ); - ports.insert( - PortId(50), - Port { - id: PortId(50), - state: PortState::Uninferred, - produced_by: Some(NodeId(49)), - }, - ); - ports.insert( - PortId(51), - Port { - id: PortId(51), - state: PortState::Resolved(TypeShape::new(DeclarationId(87))), - produced_by: None, - }, - ); - ports.insert( - PortId(52), - Port { - id: PortId(52), - state: PortState::Uninferred, - produced_by: Some(NodeId(51)), - }, - ); - ports.insert( - PortId(53), - Port { - id: PortId(53), - state: PortState::Uninferred, - produced_by: Some(NodeId(52)), - }, - ); - ports.insert( - PortId(54), - Port { - id: PortId(54), - state: PortState::Resolved(TypeShape::new(DeclarationId(87))), - produced_by: None, - }, - ); - ports.insert( - PortId(55), - Port { - id: PortId(55), - state: PortState::Uninferred, - produced_by: Some(NodeId(54)), - }, - ); - ports.insert( - PortId(56), - Port { - id: PortId(56), - state: PortState::Uninferred, - produced_by: Some(NodeId(55)), - }, - ); - ports.insert( - PortId(57), - Port { - id: PortId(57), - state: PortState::Resolved(TypeShape::new(DeclarationId(87))), - produced_by: None, - }, - ); - ports.insert( - PortId(58), - Port { - id: PortId(58), - state: PortState::Uninferred, - produced_by: Some(NodeId(57)), - }, - ); - ports.insert( - PortId(59), - Port { - id: PortId(59), - state: PortState::Uninferred, - produced_by: Some(NodeId(58)), - }, - ); - ports.insert( - PortId(60), - Port { - id: PortId(60), - state: PortState::Uninferred, - produced_by: Some(NodeId(59)), - }, - ); - ports.insert( - PortId(61), - Port { - id: PortId(61), - state: PortState::Uninferred, - produced_by: Some(NodeId(60)), - }, - ); - ports.insert( - PortId(62), - Port { - id: PortId(62), - state: PortState::Uninferred, - produced_by: Some(NodeId(61)), - }, - ); - ports.insert( - PortId(63), - Port { - id: PortId(63), - state: PortState::Uninferred, - produced_by: Some(NodeId(62)), - }, - ); - ports.insert( - PortId(64), - Port { - id: PortId(64), - state: PortState::Uninferred, - produced_by: Some(NodeId(63)), - }, - ); - ports.insert( - PortId(65), - Port { - id: PortId(65), - state: PortState::Uninferred, - produced_by: Some(NodeId(64)), - }, - ); - ports.insert( - PortId(66), - Port { - id: PortId(66), - state: PortState::Resolved(TypeShape::new(DeclarationId(87))), - produced_by: None, - }, - ); - ports.insert( - PortId(67), - Port { - id: PortId(67), - state: PortState::Uninferred, - produced_by: Some(NodeId(66)), - }, - ); - ports.insert( - PortId(68), - Port { - id: PortId(68), - state: PortState::Uninferred, - produced_by: Some(NodeId(67)), - }, - ); - ports.insert( - PortId(69), - Port { - id: PortId(69), - state: PortState::Uninferred, - produced_by: Some(NodeId(68)), - }, - ); - ports.insert( - PortId(70), - Port { - id: PortId(70), - state: PortState::Uninferred, - produced_by: Some(NodeId(69)), - }, - ); - ports.insert( - PortId(71), - Port { - id: PortId(71), - state: PortState::Uninferred, - produced_by: Some(NodeId(70)), - }, - ); - ports.insert( - PortId(72), - Port { - id: PortId(72), - state: PortState::Uninferred, - produced_by: Some(NodeId(71)), - }, - ); - ports.insert( - PortId(73), - Port { - id: PortId(73), - state: PortState::Uninferred, - produced_by: Some(NodeId(72)), - }, - ); - ports.insert( - PortId(74), - Port { - id: PortId(74), - state: PortState::Uninferred, - produced_by: Some(NodeId(73)), - }, - ); - ports.insert( - PortId(75), - Port { - id: PortId(75), - state: PortState::Resolved(TypeShape::new(DeclarationId(147))), - produced_by: None, - }, - ); - ports.insert( - PortId(76), - Port { - id: PortId(76), - state: PortState::Uninferred, - produced_by: Some(NodeId(75)), - }, - ); - ports.insert( - PortId(77), - Port { - id: PortId(77), - state: PortState::Uninferred, - produced_by: Some(NodeId(76)), - }, - ); - ports.insert( - PortId(78), - Port { - id: PortId(78), - state: PortState::Uninferred, - produced_by: Some(NodeId(77)), - }, - ); - ports.insert( - PortId(79), - Port { - id: PortId(79), - state: PortState::Uninferred, - produced_by: Some(NodeId(78)), - }, - ); - ports.insert( - PortId(80), - Port { - id: PortId(80), - state: PortState::Uninferred, - produced_by: Some(NodeId(79)), - }, - ); - ports.insert( - PortId(81), - Port { - id: PortId(81), - state: PortState::Resolved(TypeShape::new(DeclarationId(147))), - produced_by: None, - }, - ); - ports.insert( - PortId(82), - Port { - id: PortId(82), - state: PortState::Uninferred, - produced_by: Some(NodeId(81)), - }, - ); - ports.insert( - PortId(83), - Port { - id: PortId(83), - state: PortState::Uninferred, - produced_by: Some(NodeId(82)), - }, - ); - ports.insert( - PortId(84), - Port { - id: PortId(84), - state: PortState::Uninferred, - produced_by: Some(NodeId(83)), - }, - ); - ports.insert( - PortId(85), - Port { - id: PortId(85), - state: PortState::Uninferred, - produced_by: Some(NodeId(84)), - }, - ); - ports.insert( - PortId(86), - Port { - id: PortId(86), - state: PortState::Uninferred, - produced_by: Some(NodeId(85)), - }, - ); - ports.insert( - PortId(87), - Port { - id: PortId(87), - state: PortState::Resolved(TypeShape::new(DeclarationId(147))), - produced_by: None, - }, - ); - ports.insert( - PortId(88), - Port { - id: PortId(88), - state: PortState::Uninferred, - produced_by: Some(NodeId(87)), - }, - ); - ports.insert( - PortId(89), - Port { - id: PortId(89), - state: PortState::Uninferred, - produced_by: Some(NodeId(88)), - }, - ); - ports.insert( - PortId(90), - Port { - id: PortId(90), - state: PortState::Uninferred, - produced_by: Some(NodeId(89)), - }, - ); - ports.insert( - PortId(91), - Port { - id: PortId(91), - state: PortState::Uninferred, - produced_by: Some(NodeId(90)), - }, - ); - ports.insert( - PortId(92), - Port { - id: PortId(92), - state: PortState::Uninferred, - produced_by: Some(NodeId(91)), - }, - ); - ports.insert( - PortId(93), - Port { - id: PortId(93), - state: PortState::Resolved(TypeShape::new(DeclarationId(147))), - produced_by: None, - }, - ); - ports.insert( - PortId(94), - Port { - id: PortId(94), - state: PortState::Uninferred, - produced_by: Some(NodeId(93)), - }, - ); - ports.insert( - PortId(95), - Port { - id: PortId(95), - state: PortState::Uninferred, - produced_by: Some(NodeId(94)), - }, - ); - ports.insert( - PortId(96), - Port { - id: PortId(96), - state: PortState::Uninferred, - produced_by: Some(NodeId(95)), - }, - ); - ports.insert( - PortId(97), - Port { - id: PortId(97), - state: PortState::Uninferred, - produced_by: Some(NodeId(96)), - }, - ); - ports.insert( - PortId(98), - Port { - id: PortId(98), - state: PortState::Uninferred, - produced_by: Some(NodeId(97)), - }, - ); - ports.insert( - PortId(99), - Port { - id: PortId(99), - state: PortState::Resolved(TypeShape::new(DeclarationId(147))), - produced_by: None, - }, - ); - ports.insert( - PortId(100), - Port { - id: PortId(100), - state: PortState::Uninferred, - produced_by: Some(NodeId(99)), - }, - ); - ports.insert( - PortId(101), - Port { - id: PortId(101), - state: PortState::Uninferred, - produced_by: Some(NodeId(100)), - }, - ); - ports.insert( - PortId(102), - Port { - id: PortId(102), - state: PortState::Uninferred, - produced_by: Some(NodeId(101)), - }, - ); - ports.insert( - PortId(103), - Port { - id: PortId(103), - state: PortState::Uninferred, - produced_by: Some(NodeId(102)), - }, - ); - ports.insert( - PortId(104), - Port { - id: PortId(104), - state: PortState::Uninferred, - produced_by: Some(NodeId(103)), - }, - ); - ports.insert( - PortId(105), - Port { - id: PortId(105), - state: PortState::Resolved(TypeShape::new(DeclarationId(147))), - produced_by: None, - }, - ); - ports.insert( - PortId(106), - Port { - id: PortId(106), - state: PortState::Uninferred, - produced_by: Some(NodeId(105)), - }, - ); - ports.insert( - PortId(107), - Port { - id: PortId(107), - state: PortState::Uninferred, - produced_by: Some(NodeId(106)), - }, - ); - ports.insert( - PortId(108), - Port { - id: PortId(108), - state: PortState::Uninferred, - produced_by: Some(NodeId(107)), - }, - ); - ports.insert( - PortId(109), - Port { - id: PortId(109), - state: PortState::Uninferred, - produced_by: Some(NodeId(108)), - }, - ); - ports.insert( - PortId(110), - Port { - id: PortId(110), - state: PortState::Uninferred, - produced_by: Some(NodeId(109)), - }, - ); - ports.insert( - PortId(111), - Port { - id: PortId(111), - state: PortState::Resolved(TypeShape::new(DeclarationId(147))), - produced_by: None, - }, - ); - ports.insert( - PortId(112), - Port { - id: PortId(112), - state: PortState::Uninferred, - produced_by: Some(NodeId(111)), - }, - ); - ports.insert( - PortId(113), - Port { - id: PortId(113), - state: PortState::Uninferred, - produced_by: Some(NodeId(112)), - }, - ); - ports.insert( - PortId(114), - Port { - id: PortId(114), - state: PortState::Uninferred, - produced_by: Some(NodeId(113)), - }, - ); - ports.insert( - PortId(115), - Port { - id: PortId(115), - state: PortState::Uninferred, - produced_by: Some(NodeId(114)), - }, - ); - ports.insert( - PortId(116), - Port { - id: PortId(116), - state: PortState::Uninferred, - produced_by: Some(NodeId(115)), - }, - ); - ports.insert( - PortId(117), - Port { - id: PortId(117), - state: PortState::Resolved(TypeShape::new(DeclarationId(147))), - produced_by: None, - }, - ); - ports.insert( - PortId(118), - Port { - id: PortId(118), - state: PortState::Uninferred, - produced_by: Some(NodeId(117)), - }, - ); - ports.insert( - PortId(119), - Port { - id: PortId(119), - state: PortState::Uninferred, - produced_by: Some(NodeId(118)), - }, - ); - ports.insert( - PortId(120), - Port { - id: PortId(120), - state: PortState::Uninferred, - produced_by: Some(NodeId(119)), - }, - ); - ports.insert( - PortId(121), - Port { - id: PortId(121), - state: PortState::Uninferred, - produced_by: Some(NodeId(120)), - }, - ); - ports.insert( - PortId(122), - Port { - id: PortId(122), - state: PortState::Uninferred, - produced_by: Some(NodeId(121)), - }, - ); - ports.insert( - PortId(123), - Port { - id: PortId(123), - state: PortState::Resolved(TypeShape::new(DeclarationId(147))), - produced_by: None, - }, - ); - ports.insert( - PortId(124), - Port { - id: PortId(124), - state: PortState::Uninferred, - produced_by: Some(NodeId(123)), - }, - ); - ports.insert( - PortId(125), - Port { - id: PortId(125), - state: PortState::Uninferred, - produced_by: Some(NodeId(124)), - }, - ); - ports.insert( - PortId(126), - Port { - id: PortId(126), - state: PortState::Uninferred, - produced_by: Some(NodeId(125)), - }, - ); - ports.insert( - PortId(127), - Port { - id: PortId(127), - state: PortState::Uninferred, - produced_by: Some(NodeId(126)), - }, - ); - ports.insert( - PortId(128), - Port { - id: PortId(128), - state: PortState::Uninferred, - produced_by: Some(NodeId(127)), - }, - ); - ports.insert( - PortId(129), - Port { - id: PortId(129), - state: PortState::Resolved(TypeShape::new(DeclarationId(147))), - produced_by: None, - }, - ); - ports.insert( - PortId(130), - Port { - id: PortId(130), - state: PortState::Uninferred, - produced_by: Some(NodeId(129)), - }, - ); - ports.insert( - PortId(131), - Port { - id: PortId(131), - state: PortState::Uninferred, - produced_by: Some(NodeId(130)), - }, - ); - ports.insert( - PortId(132), - Port { - id: PortId(132), - state: PortState::Uninferred, - produced_by: Some(NodeId(131)), - }, - ); - ports.insert( - PortId(133), - Port { - id: PortId(133), - state: PortState::Uninferred, - produced_by: Some(NodeId(132)), - }, - ); - ports.insert( - PortId(134), - Port { - id: PortId(134), - state: PortState::Uninferred, - produced_by: Some(NodeId(133)), - }, - ); - ports.insert( - PortId(135), - Port { - id: PortId(135), - state: PortState::Resolved(TypeShape::new(DeclarationId(147))), - produced_by: None, - }, - ); - ports.insert( - PortId(136), - Port { - id: PortId(136), - state: PortState::Uninferred, - produced_by: Some(NodeId(135)), - }, - ); - ports.insert( - PortId(137), - Port { - id: PortId(137), - state: PortState::Uninferred, - produced_by: Some(NodeId(136)), - }, - ); - ports.insert( - PortId(138), - Port { - id: PortId(138), - state: PortState::Uninferred, - produced_by: Some(NodeId(137)), - }, - ); - ports.insert( - PortId(139), - Port { - id: PortId(139), - state: PortState::Uninferred, - produced_by: Some(NodeId(138)), - }, - ); - ports.insert( - PortId(140), - Port { - id: PortId(140), - state: PortState::Uninferred, - produced_by: Some(NodeId(139)), - }, - ); - ports.insert( - PortId(141), - Port { - id: PortId(141), - state: PortState::Resolved(TypeShape::new(DeclarationId(147))), - produced_by: None, - }, - ); - ports.insert( - PortId(142), - Port { - id: PortId(142), - state: PortState::Uninferred, - produced_by: Some(NodeId(141)), - }, - ); - ports.insert( - PortId(143), - Port { - id: PortId(143), - state: PortState::Uninferred, - produced_by: Some(NodeId(142)), - }, - ); - ports.insert( - PortId(144), - Port { - id: PortId(144), - state: PortState::Uninferred, - produced_by: Some(NodeId(143)), - }, - ); - ports.insert( - PortId(145), - Port { - id: PortId(145), - state: PortState::Uninferred, - produced_by: Some(NodeId(144)), - }, - ); - ports.insert( - PortId(146), - Port { - id: PortId(146), - state: PortState::Uninferred, - produced_by: Some(NodeId(145)), - }, - ); - ports.insert( - PortId(147), - Port { - id: PortId(147), - state: PortState::Resolved(TypeShape::new(DeclarationId(147))), - produced_by: None, - }, - ); - ports.insert( - PortId(148), - Port { - id: PortId(148), - state: PortState::Uninferred, - produced_by: Some(NodeId(147)), - }, - ); - ports.insert( - PortId(149), - Port { - id: PortId(149), - state: PortState::Uninferred, - produced_by: Some(NodeId(148)), - }, - ); - ports.insert( - PortId(150), - Port { - id: PortId(150), - state: PortState::Uninferred, - produced_by: Some(NodeId(149)), - }, - ); - ports.insert( - PortId(151), - Port { - id: PortId(151), - state: PortState::Uninferred, - produced_by: Some(NodeId(150)), - }, - ); - ports.insert( - PortId(152), - Port { - id: PortId(152), - state: PortState::Uninferred, - produced_by: Some(NodeId(151)), - }, - ); - ports.insert( - PortId(153), - Port { - id: PortId(153), - state: PortState::Resolved(TypeShape::new(DeclarationId(147))), - produced_by: None, - }, - ); - ports.insert( - PortId(154), - Port { - id: PortId(154), - state: PortState::Uninferred, - produced_by: Some(NodeId(153)), - }, - ); - ports.insert( - PortId(155), - Port { - id: PortId(155), - state: PortState::Uninferred, - produced_by: Some(NodeId(154)), - }, - ); - ports.insert( - PortId(156), - Port { - id: PortId(156), - state: PortState::Uninferred, - produced_by: Some(NodeId(155)), - }, - ); - ports.insert( - PortId(157), - Port { - id: PortId(157), - state: PortState::Uninferred, - produced_by: Some(NodeId(156)), - }, - ); - ports.insert( - PortId(158), - Port { - id: PortId(158), - state: PortState::Uninferred, - produced_by: Some(NodeId(157)), - }, - ); - ports.insert( - PortId(159), - Port { - id: PortId(159), - state: PortState::Resolved(TypeShape::new(DeclarationId(154))), - produced_by: None, - }, - ); - ports.insert( - PortId(160), - Port { - id: PortId(160), - state: PortState::Uninferred, - produced_by: Some(NodeId(159)), - }, - ); - ports.insert( - PortId(161), - Port { - id: PortId(161), - state: PortState::Uninferred, - produced_by: Some(NodeId(160)), - }, - ); - ports.insert( - PortId(162), - Port { - id: PortId(162), - state: PortState::Uninferred, - produced_by: Some(NodeId(161)), - }, - ); - ports.insert( - PortId(163), - Port { - id: PortId(163), - state: PortState::Uninferred, - produced_by: Some(NodeId(162)), - }, - ); - ports.insert( - PortId(164), - Port { - id: PortId(164), - state: PortState::Uninferred, - produced_by: Some(NodeId(163)), - }, - ); - ports.insert( - PortId(165), - Port { - id: PortId(165), - state: PortState::Resolved(TypeShape::new(DeclarationId(125))), - produced_by: None, - }, - ); - ports.insert( - PortId(166), - Port { - id: PortId(166), - state: PortState::Uninferred, - produced_by: Some(NodeId(165)), - }, - ); - ports.insert( - PortId(167), - Port { - id: PortId(167), - state: PortState::Uninferred, - produced_by: Some(NodeId(166)), - }, - ); - ports.insert( - PortId(168), - Port { - id: PortId(168), - state: PortState::Uninferred, - produced_by: Some(NodeId(167)), - }, - ); - ports.insert( - PortId(169), - Port { - id: PortId(169), - state: PortState::Uninferred, - produced_by: Some(NodeId(168)), - }, - ); - ports.insert( - PortId(170), - Port { - id: PortId(170), - state: PortState::Uninferred, - produced_by: Some(NodeId(169)), - }, - ); - ports.insert( - PortId(171), - Port { - id: PortId(171), - state: PortState::Resolved(TypeShape::new(DeclarationId(227))), - produced_by: None, - }, - ); - ports.insert( - PortId(172), - Port { - id: PortId(172), - state: PortState::Uninferred, - produced_by: Some(NodeId(171)), - }, - ); - ports.insert( - PortId(173), - Port { - id: PortId(173), - state: PortState::Uninferred, - produced_by: Some(NodeId(172)), - }, - ); - ports.insert( - PortId(174), - Port { - id: PortId(174), - state: PortState::Uninferred, - produced_by: Some(NodeId(173)), - }, - ); - ports.insert( - PortId(175), - Port { - id: PortId(175), - state: PortState::Uninferred, - produced_by: Some(NodeId(174)), - }, - ); - ports.insert( - PortId(176), - Port { - id: PortId(176), - state: PortState::Uninferred, - produced_by: Some(NodeId(175)), - }, - ); - ports.insert( - PortId(177), - Port { - id: PortId(177), - state: PortState::Resolved(TypeShape::new(DeclarationId(128))), - produced_by: None, - }, - ); - ports.insert( - PortId(178), - Port { - id: PortId(178), - state: PortState::Resolved(TypeShape::new(DeclarationId(228))), - produced_by: None, - }, - ); - ports.insert( - PortId(179), - Port { - id: PortId(179), - state: PortState::Uninferred, - produced_by: Some(NodeId(177)), - }, - ); - ports.insert( - PortId(180), - Port { - id: PortId(180), - state: PortState::Uninferred, - produced_by: Some(NodeId(178)), - }, - ); - ports.insert( - PortId(181), - Port { - id: PortId(181), - state: PortState::Uninferred, - produced_by: Some(NodeId(179)), - }, - ); - ports.insert( - PortId(182), - Port { - id: PortId(182), - state: PortState::Uninferred, - produced_by: Some(NodeId(180)), - }, - ); - ports.insert( - PortId(183), - Port { - id: PortId(183), - state: PortState::Uninferred, - produced_by: Some(NodeId(181)), - }, - ); - ports.insert( - PortId(184), - Port { - id: PortId(184), - state: PortState::Uninferred, - produced_by: Some(NodeId(182)), - }, - ); - ports.insert( - PortId(185), - Port { - id: PortId(185), - state: PortState::Uninferred, - produced_by: Some(NodeId(183)), - }, - ); - ports.insert( - PortId(186), - Port { - id: PortId(186), - state: PortState::Uninferred, - produced_by: Some(NodeId(184)), - }, - ); - ports.insert( - PortId(187), - Port { - id: PortId(187), - state: PortState::Uninferred, - produced_by: Some(NodeId(185)), - }, - ); - ports.insert( - PortId(188), - Port { - id: PortId(188), - state: PortState::Uninferred, - produced_by: Some(NodeId(186)), - }, - ); - ports.insert( - PortId(189), - Port { - id: PortId(189), - state: PortState::Uninferred, - produced_by: Some(NodeId(187)), - }, - ); - ports.insert( - PortId(190), - Port { - id: PortId(190), - state: PortState::Uninferred, - produced_by: Some(NodeId(188)), - }, - ); - ports.insert( - PortId(191), - Port { - id: PortId(191), - state: PortState::Uninferred, - produced_by: Some(NodeId(189)), - }, - ); - ports.insert( - PortId(192), - Port { - id: PortId(192), - state: PortState::Uninferred, - produced_by: Some(NodeId(190)), - }, - ); - ports.insert( - PortId(193), - Port { - id: PortId(193), - state: PortState::Uninferred, - produced_by: Some(NodeId(191)), - }, - ); - ports.insert( - PortId(194), - Port { - id: PortId(194), - state: PortState::Uninferred, - produced_by: Some(NodeId(192)), - }, - ); - ports.insert( - PortId(195), - Port { - id: PortId(195), - state: PortState::Uninferred, - produced_by: Some(NodeId(193)), - }, - ); - ports.insert( - PortId(196), - Port { - id: PortId(196), - state: PortState::Uninferred, - produced_by: Some(NodeId(194)), - }, - ); - ports.insert( - PortId(197), - Port { - id: PortId(197), - state: PortState::Uninferred, - produced_by: Some(NodeId(195)), - }, - ); - ports.insert( - PortId(198), - Port { - id: PortId(198), - state: PortState::Uninferred, - produced_by: Some(NodeId(196)), - }, - ); - ports.insert( - PortId(199), - Port { - id: PortId(199), - state: PortState::Uninferred, - produced_by: Some(NodeId(197)), - }, - ); - ports.insert( - PortId(200), - Port { - id: PortId(200), - state: PortState::Uninferred, - produced_by: Some(NodeId(198)), - }, - ); - ports.insert( - PortId(201), - Port { - id: PortId(201), - state: PortState::Uninferred, - produced_by: Some(NodeId(199)), - }, - ); - ports.insert( - PortId(202), - Port { - id: PortId(202), - state: PortState::Uninferred, - produced_by: Some(NodeId(200)), - }, - ); - ports.insert( - PortId(203), - Port { - id: PortId(203), - state: PortState::Uninferred, - produced_by: Some(NodeId(201)), - }, - ); - ports.insert( - PortId(204), - Port { - id: PortId(204), - state: PortState::Uninferred, - produced_by: Some(NodeId(202)), - }, - ); - ports.insert( - PortId(205), - Port { - id: PortId(205), - state: PortState::Uninferred, - produced_by: Some(NodeId(203)), - }, - ); - ports.insert( - PortId(206), - Port { - id: PortId(206), - state: PortState::Uninferred, - produced_by: Some(NodeId(204)), - }, - ); - ports.insert( - PortId(207), - Port { - id: PortId(207), - state: PortState::Uninferred, - produced_by: Some(NodeId(205)), - }, - ); - ports.insert( - PortId(208), - Port { - id: PortId(208), - state: PortState::Uninferred, - produced_by: Some(NodeId(206)), - }, - ); - ports.insert( - PortId(209), - Port { - id: PortId(209), - state: PortState::Uninferred, - produced_by: Some(NodeId(207)), - }, - ); - ports.insert( - PortId(210), - Port { - id: PortId(210), - state: PortState::Uninferred, - produced_by: Some(NodeId(208)), - }, - ); - ports.insert( - PortId(211), - Port { - id: PortId(211), - state: PortState::Uninferred, - produced_by: Some(NodeId(209)), - }, - ); - ports.insert( - PortId(212), - Port { - id: PortId(212), - state: PortState::Uninferred, - produced_by: Some(NodeId(210)), - }, - ); - ports.insert( - PortId(213), - Port { - id: PortId(213), - state: PortState::Uninferred, - produced_by: Some(NodeId(211)), - }, - ); - ports.insert( - PortId(214), - Port { - id: PortId(214), - state: PortState::Uninferred, - produced_by: Some(NodeId(212)), - }, - ); - ports.insert( - PortId(215), - Port { - id: PortId(215), - state: PortState::Uninferred, - produced_by: Some(NodeId(213)), - }, - ); - ports.insert( - PortId(216), - Port { - id: PortId(216), - state: PortState::Uninferred, - produced_by: Some(NodeId(214)), - }, - ); - ports.insert( - PortId(217), - Port { - id: PortId(217), - state: PortState::Uninferred, - produced_by: Some(NodeId(215)), - }, - ); - ports.insert( - PortId(218), - Port { - id: PortId(218), - state: PortState::Uninferred, - produced_by: Some(NodeId(216)), - }, - ); - ports.insert( - PortId(219), - Port { - id: PortId(219), - state: PortState::Uninferred, - produced_by: Some(NodeId(217)), - }, - ); - ports.insert( - PortId(220), - Port { - id: PortId(220), - state: PortState::Uninferred, - produced_by: Some(NodeId(218)), - }, - ); - ports.insert( - PortId(221), - Port { - id: PortId(221), - state: PortState::Uninferred, - produced_by: Some(NodeId(219)), - }, - ); - ports.insert( - PortId(222), - Port { - id: PortId(222), - state: PortState::Uninferred, - produced_by: Some(NodeId(220)), - }, - ); - ports.insert( - PortId(223), - Port { - id: PortId(223), - state: PortState::Uninferred, - produced_by: Some(NodeId(221)), - }, - ); - ports.insert( - PortId(224), - Port { - id: PortId(224), - state: PortState::Uninferred, - produced_by: Some(NodeId(222)), - }, - ); - ports.insert( - PortId(225), - Port { - id: PortId(225), - state: PortState::Uninferred, - produced_by: Some(NodeId(223)), - }, - ); - ports.insert( - PortId(226), - Port { - id: PortId(226), - state: PortState::Uninferred, - produced_by: Some(NodeId(224)), - }, - ); - ports.insert( - PortId(227), - Port { - id: PortId(227), - state: PortState::Uninferred, - produced_by: Some(NodeId(225)), - }, - ); - ports.insert( - PortId(228), - Port { - id: PortId(228), - state: PortState::Uninferred, - produced_by: Some(NodeId(226)), - }, - ); - ports.insert( - PortId(229), - Port { - id: PortId(229), - state: PortState::Uninferred, - produced_by: Some(NodeId(227)), - }, - ); - ports.insert( - PortId(230), - Port { - id: PortId(230), - state: PortState::Uninferred, - produced_by: Some(NodeId(228)), - }, - ); - ports.insert( - PortId(231), - Port { - id: PortId(231), - state: PortState::Uninferred, - produced_by: Some(NodeId(229)), - }, - ); - ports.insert( - PortId(232), - Port { - id: PortId(232), - state: PortState::Uninferred, - produced_by: Some(NodeId(230)), - }, - ); - ports.insert( - PortId(233), - Port { - id: PortId(233), - state: PortState::Uninferred, - produced_by: Some(NodeId(231)), - }, - ); - ports.insert( - PortId(234), - Port { - id: PortId(234), - state: PortState::Uninferred, - produced_by: Some(NodeId(232)), - }, - ); - ports.insert( - PortId(235), - Port { - id: PortId(235), - state: PortState::Uninferred, - produced_by: Some(NodeId(233)), - }, - ); - ports.insert( - PortId(236), - Port { - id: PortId(236), - state: PortState::Uninferred, - produced_by: Some(NodeId(234)), - }, - ); - ports.insert( - PortId(237), - Port { - id: PortId(237), - state: PortState::Uninferred, - produced_by: Some(NodeId(235)), - }, - ); - ports.insert( - PortId(238), - Port { - id: PortId(238), - state: PortState::Uninferred, - produced_by: Some(NodeId(236)), - }, - ); - ports.insert( - PortId(239), - Port { - id: PortId(239), - state: PortState::Uninferred, - produced_by: Some(NodeId(237)), - }, - ); - ports.insert( - PortId(240), - Port { - id: PortId(240), - state: PortState::Uninferred, - produced_by: Some(NodeId(238)), - }, - ); - ports.insert( - PortId(241), - Port { - id: PortId(241), - state: PortState::Uninferred, - produced_by: Some(NodeId(239)), - }, - ); - ports.insert( - PortId(242), - Port { - id: PortId(242), - state: PortState::Uninferred, - produced_by: Some(NodeId(240)), - }, - ); - ports.insert( - PortId(243), - Port { - id: PortId(243), - state: PortState::Uninferred, - produced_by: Some(NodeId(241)), - }, - ); - ports.insert( - PortId(244), - Port { - id: PortId(244), - state: PortState::Uninferred, - produced_by: Some(NodeId(242)), - }, - ); - ports.insert( - PortId(245), - Port { - id: PortId(245), - state: PortState::Uninferred, - produced_by: Some(NodeId(243)), - }, - ); - ports.insert( - PortId(246), - Port { - id: PortId(246), - state: PortState::Uninferred, - produced_by: Some(NodeId(244)), - }, - ); - ports.insert( - PortId(247), - Port { - id: PortId(247), - state: PortState::Uninferred, - produced_by: Some(NodeId(245)), - }, - ); - ports.insert( - PortId(248), - Port { - id: PortId(248), - state: PortState::Uninferred, - produced_by: Some(NodeId(246)), - }, - ); - ports.insert( - PortId(249), - Port { - id: PortId(249), - state: PortState::Uninferred, - produced_by: Some(NodeId(247)), - }, - ); - ports.insert( - PortId(250), - Port { - id: PortId(250), - state: PortState::Uninferred, - produced_by: Some(NodeId(248)), - }, - ); - ports.insert( - PortId(251), - Port { - id: PortId(251), - state: PortState::Resolved(TypeShape::new(DeclarationId(124))), - produced_by: Some(NodeId(249)), - }, - ); - ports.insert( - PortId(252), - Port { - id: PortId(252), - state: PortState::Resolved(TypeShape::new(DeclarationId(128))), - produced_by: None, - }, - ); - ports.insert( - PortId(253), - Port { - id: PortId(253), - state: PortState::Uninferred, - produced_by: Some(NodeId(251)), - }, - ); - ports.insert( - PortId(254), - Port { - id: PortId(254), - state: PortState::Resolved(TypeShape::new(DeclarationId(87))), - produced_by: Some(NodeId(252)), - }, - ); - ports.insert( - PortId(255), - Port { - id: PortId(255), - state: PortState::Resolved(TypeShape::new(DeclarationId(966))), - produced_by: None, - }, - ); - ports.insert( - PortId(256), - Port { - id: PortId(256), - state: PortState::Uninferred, - produced_by: Some(NodeId(254)), - }, - ); - ports.insert( - PortId(257), - Port { - id: PortId(257), - state: PortState::Resolved(TypeShape::new(DeclarationId(124))), - produced_by: Some(NodeId(255)), - }, - ); - ports.insert( - PortId(258), - Port { - id: PortId(258), - state: PortState::Resolved(TypeShape::new(DeclarationId(752))), - produced_by: None, - }, - ); - ports.insert( - PortId(259), - Port { - id: PortId(259), - state: PortState::Uninferred, - produced_by: Some(NodeId(257)), - }, - ); - ports.insert( - PortId(260), - Port { - id: PortId(260), - state: PortState::Uninferred, - produced_by: Some(NodeId(258)), - }, - ); - ports.insert( - PortId(261), - Port { - id: PortId(261), - state: PortState::Resolved(TypeShape::new(DeclarationId(124))), - produced_by: Some(NodeId(259)), - }, - ); - ports.insert( - PortId(262), - Port { - id: PortId(262), - state: PortState::Resolved(TypeShape::new(DeclarationId(195))), - produced_by: None, - }, - ); - ports.insert( - PortId(263), - Port { - id: PortId(263), - state: PortState::Uninferred, - produced_by: Some(NodeId(261)), - }, - ); - ports.insert( - PortId(264), - Port { - id: PortId(264), - state: PortState::Uninferred, - produced_by: Some(NodeId(262)), - }, - ); - ports.insert( - PortId(265), - Port { - id: PortId(265), - state: PortState::Uninferred, - produced_by: Some(NodeId(263)), - }, - ); - ports.insert( - PortId(266), - Port { - id: PortId(266), - state: PortState::Uninferred, - produced_by: Some(NodeId(264)), - }, - ); - ports.insert( - PortId(267), - Port { - id: PortId(267), - state: PortState::Uninferred, - produced_by: Some(NodeId(265)), - }, - ); - ports.insert( - PortId(268), - Port { - id: PortId(268), - state: PortState::Uninferred, - produced_by: Some(NodeId(266)), - }, - ); - ports.insert( - PortId(269), - Port { - id: PortId(269), - state: PortState::Uninferred, - produced_by: Some(NodeId(267)), - }, - ); - ports.insert( - PortId(270), - Port { - id: PortId(270), - state: PortState::Resolved(TypeShape::new(DeclarationId(124))), - produced_by: Some(NodeId(268)), - }, - ); - ports.insert( - PortId(271), - Port { - id: PortId(271), - state: PortState::Resolved(TypeShape::new(DeclarationId(195))), - produced_by: None, - }, - ); - ports.insert( - PortId(272), - Port { - id: PortId(272), - state: PortState::Uninferred, - produced_by: Some(NodeId(270)), - }, - ); - ports.insert( - PortId(273), - Port { - id: PortId(273), - state: PortState::Uninferred, - produced_by: Some(NodeId(271)), - }, - ); - ports.insert( - PortId(274), - Port { - id: PortId(274), - state: PortState::Uninferred, - produced_by: Some(NodeId(272)), - }, - ); - ports.insert( - PortId(275), - Port { - id: PortId(275), - state: PortState::Uninferred, - produced_by: Some(NodeId(273)), - }, - ); - ports.insert( - PortId(276), - Port { - id: PortId(276), - state: PortState::Uninferred, - produced_by: Some(NodeId(274)), - }, - ); - ports.insert( - PortId(277), - Port { - id: PortId(277), - state: PortState::Uninferred, - produced_by: Some(NodeId(275)), - }, - ); - ports.insert( - PortId(278), - Port { - id: PortId(278), - state: PortState::Uninferred, - produced_by: Some(NodeId(276)), - }, - ); - ports.insert( - PortId(279), - Port { - id: PortId(279), - state: PortState::Resolved(TypeShape::new(DeclarationId(124))), - produced_by: Some(NodeId(277)), - }, - ); - ports.insert( - PortId(280), - Port { - id: PortId(280), - state: PortState::Resolved(TypeShape::new(DeclarationId(195))), - produced_by: None, - }, - ); - ports.insert( - PortId(281), - Port { - id: PortId(281), - state: PortState::Uninferred, - produced_by: Some(NodeId(279)), - }, - ); - ports.insert( - PortId(282), - Port { - id: PortId(282), - state: PortState::Uninferred, - produced_by: Some(NodeId(280)), - }, - ); - ports.insert( - PortId(283), - Port { - id: PortId(283), - state: PortState::Uninferred, - produced_by: Some(NodeId(281)), - }, - ); - ports.insert( - PortId(284), - Port { - id: PortId(284), - state: PortState::Uninferred, - produced_by: Some(NodeId(282)), - }, - ); - ports.insert( - PortId(285), - Port { - id: PortId(285), - state: PortState::Uninferred, - produced_by: Some(NodeId(283)), - }, - ); - ports.insert( - PortId(286), - Port { - id: PortId(286), - state: PortState::Uninferred, - produced_by: Some(NodeId(284)), - }, - ); - ports.insert( - PortId(287), - Port { - id: PortId(287), - state: PortState::Uninferred, - produced_by: Some(NodeId(285)), - }, - ); - ports.insert( - PortId(288), - Port { - id: PortId(288), - state: PortState::Resolved(TypeShape::new(DeclarationId(124))), - produced_by: Some(NodeId(286)), - }, - ); - ports.insert( - PortId(289), - Port { - id: PortId(289), - state: PortState::Resolved(TypeShape::new(DeclarationId(195))), - produced_by: None, - }, - ); - ports.insert( - PortId(290), - Port { - id: PortId(290), - state: PortState::Uninferred, - produced_by: Some(NodeId(288)), - }, - ); - ports.insert( - PortId(291), - Port { - id: PortId(291), - state: PortState::Uninferred, - produced_by: Some(NodeId(289)), - }, - ); - ports.insert( - PortId(292), - Port { - id: PortId(292), - state: PortState::Uninferred, - produced_by: Some(NodeId(290)), - }, - ); - ports.insert( - PortId(293), - Port { - id: PortId(293), - state: PortState::Uninferred, - produced_by: Some(NodeId(291)), - }, - ); - ports.insert( - PortId(294), - Port { - id: PortId(294), - state: PortState::Uninferred, - produced_by: Some(NodeId(292)), - }, - ); - ports.insert( - PortId(295), - Port { - id: PortId(295), - state: PortState::Uninferred, - produced_by: Some(NodeId(293)), - }, - ); - ports.insert( - PortId(296), - Port { - id: PortId(296), - state: PortState::Uninferred, - produced_by: Some(NodeId(294)), - }, - ); - ports.insert( - PortId(297), - Port { - id: PortId(297), - state: PortState::Resolved(TypeShape::new(DeclarationId(124))), - produced_by: Some(NodeId(295)), - }, - ); - ports.insert( - PortId(298), - Port { - id: PortId(298), - state: PortState::Resolved(TypeShape::new(DeclarationId(829))), - produced_by: None, - }, - ); - ports.insert( - PortId(299), - Port { - id: PortId(299), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(300), - Port { - id: PortId(300), - state: PortState::Uninferred, - produced_by: Some(NodeId(297)), - }, - ); - ports.insert( - PortId(301), - Port { - id: PortId(301), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(302), - Port { - id: PortId(302), - state: PortState::Uninferred, - produced_by: Some(NodeId(298)), - }, - ); - ports.insert( - PortId(303), - Port { - id: PortId(303), - state: PortState::Resolved(TypeShape::new(DeclarationId(736))), - produced_by: Some(NodeId(299)), - }, - ); - ports.insert( - PortId(304), - Port { - id: PortId(304), - state: PortState::Resolved(TypeShape::new(DeclarationId(915))), - produced_by: None, - }, - ); - ports.insert( - PortId(305), - Port { - id: PortId(305), - state: PortState::Resolved(TypeShape::new(DeclarationId(915))), - produced_by: None, - }, - ); - ports.insert( - PortId(306), - Port { - id: PortId(306), - state: PortState::Resolved(TypeShape::new(DeclarationId(736))), - produced_by: Some(NodeId(301)), - }, - ); - ports.insert( - PortId(307), - Port { - id: PortId(307), - state: PortState::Resolved(TypeShape::new(DeclarationId(736))), - produced_by: Some(NodeId(302)), - }, - ); - ports.insert( - PortId(308), - Port { - id: PortId(308), - state: PortState::Resolved(TypeShape::new(DeclarationId(124))), - produced_by: Some(NodeId(303)), - }, - ); - ports.insert( - PortId(309), - Port { - id: PortId(309), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(310), - Port { - id: PortId(310), - state: PortState::Uninferred, - produced_by: Some(NodeId(305)), - }, - ); - ports.insert( - PortId(311), - Port { - id: PortId(311), - state: PortState::Resolved(TypeShape::new(DeclarationId(920))), - produced_by: Some(NodeId(306)), - }, - ); - ports.insert( - PortId(312), - Port { - id: PortId(312), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(313), - Port { - id: PortId(313), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(314), - Port { - id: PortId(314), - state: PortState::Uninferred, - produced_by: Some(NodeId(308)), - }, - ); - ports.insert( - PortId(315), - Port { - id: PortId(315), - state: PortState::Uninferred, - produced_by: Some(NodeId(309)), - }, - ); - ports.insert( - PortId(316), - Port { - id: PortId(316), - state: PortState::Resolved(TypeShape::new(DeclarationId(1776))), - produced_by: Some(NodeId(310)), - }, - ); - ports.insert( - PortId(317), - Port { - id: PortId(317), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(318), - Port { - id: PortId(318), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(319), - Port { - id: PortId(319), - state: PortState::Resolved(TypeShape::new(DeclarationId(1777))), - produced_by: None, - }, - ); - ports.insert( - PortId(320), - Port { - id: PortId(320), - state: PortState::Resolved(TypeShape::new(DeclarationId(1778))), - produced_by: Some(NodeId(312)), - }, - ); - ports.insert( - PortId(321), - Port { - id: PortId(321), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(322), - Port { - id: PortId(322), - state: PortState::Uninferred, - produced_by: Some(NodeId(314)), - }, - ); - ports.insert( - PortId(323), - Port { - id: PortId(323), - state: PortState::Uninferred, - produced_by: Some(NodeId(315)), - }, - ); - ports.insert( - PortId(324), - Port { - id: PortId(324), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(325), - Port { - id: PortId(325), - state: PortState::Uninferred, - produced_by: Some(NodeId(316)), - }, - ); - ports.insert( - PortId(326), - Port { - id: PortId(326), - state: PortState::Resolved(TypeShape::new(DeclarationId(124))), - produced_by: Some(NodeId(317)), - }, - ); - ports.insert( - PortId(327), - Port { - id: PortId(327), - state: PortState::Resolved(TypeShape::new(DeclarationId(918))), - produced_by: None, - }, - ); - ports.insert( - PortId(328), - Port { - id: PortId(328), - state: PortState::Uninferred, - produced_by: Some(NodeId(319)), - }, - ); - ports.insert( - PortId(329), - Port { - id: PortId(329), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(330), - Port { - id: PortId(330), - state: PortState::Uninferred, - produced_by: Some(NodeId(320)), - }, - ); - ports.insert( - PortId(331), - Port { - id: PortId(331), - state: PortState::Uninferred, - produced_by: Some(NodeId(321)), - }, - ); - ports.insert( - PortId(332), - Port { - id: PortId(332), - state: PortState::Uninferred, - produced_by: Some(NodeId(322)), - }, - ); - ports.insert( - PortId(333), - Port { - id: PortId(333), - state: PortState::Uninferred, - produced_by: Some(NodeId(323)), - }, - ); - ports.insert( - PortId(334), - Port { - id: PortId(334), - state: PortState::Uninferred, - produced_by: Some(NodeId(324)), - }, - ); - ports.insert( - PortId(335), - Port { - id: PortId(335), - state: PortState::Resolved(TypeShape::new(DeclarationId(87))), - produced_by: Some(NodeId(325)), - }, - ); - ports.insert( - PortId(336), - Port { - id: PortId(336), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(337), - Port { - id: PortId(337), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(338), - Port { - id: PortId(338), - state: PortState::Uninferred, - produced_by: Some(NodeId(327)), - }, - ); - ports.insert( - PortId(339), - Port { - id: PortId(339), - state: PortState::Uninferred, - produced_by: Some(NodeId(328)), - }, - ); - ports.insert( - PortId(340), - Port { - id: PortId(340), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: Some(NodeId(329)), - }, - ); - ports.insert( - PortId(341), - Port { - id: PortId(341), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(342), - Port { - id: PortId(342), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(343), - Port { - id: PortId(343), - state: PortState::Uninferred, - produced_by: Some(NodeId(331)), - }, - ); - ports.insert( - PortId(344), - Port { - id: PortId(344), - state: PortState::Uninferred, - produced_by: Some(NodeId(332)), - }, - ); - ports.insert( - PortId(345), - Port { - id: PortId(345), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: Some(NodeId(333)), - }, - ); - ports.insert( - PortId(346), - Port { - id: PortId(346), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(347), - Port { - id: PortId(347), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(348), - Port { - id: PortId(348), - state: PortState::Uninferred, - produced_by: Some(NodeId(335)), - }, - ); - ports.insert( - PortId(349), - Port { - id: PortId(349), - state: PortState::Uninferred, - produced_by: Some(NodeId(336)), - }, - ); - ports.insert( - PortId(350), - Port { - id: PortId(350), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: Some(NodeId(337)), - }, - ); - ports.insert( - PortId(351), - Port { - id: PortId(351), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(352), - Port { - id: PortId(352), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(353), - Port { - id: PortId(353), - state: PortState::Uninferred, - produced_by: Some(NodeId(339)), - }, - ); - ports.insert( - PortId(354), - Port { - id: PortId(354), - state: PortState::Uninferred, - produced_by: Some(NodeId(340)), - }, - ); - ports.insert( - PortId(355), - Port { - id: PortId(355), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: Some(NodeId(341)), - }, - ); - ports.insert( - PortId(356), - Port { - id: PortId(356), - state: PortState::Resolved(TypeShape::new(DeclarationId(1779))), - produced_by: None, - }, - ); - ports.insert( - PortId(357), - Port { - id: PortId(357), - state: PortState::Uninferred, - produced_by: Some(NodeId(343)), - }, - ); - ports.insert( - PortId(358), - Port { - id: PortId(358), - state: PortState::Uninferred, - produced_by: Some(NodeId(344)), - }, - ); - ports.insert( - PortId(359), - Port { - id: PortId(359), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: Some(NodeId(345)), - }, - ); - ports.insert( - PortId(360), - Port { - id: PortId(360), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(361), - Port { - id: PortId(361), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(362), - Port { - id: PortId(362), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(363), - Port { - id: PortId(363), - state: PortState::Uninferred, - produced_by: Some(NodeId(347)), - }, - ); - ports.insert( - PortId(364), - Port { - id: PortId(364), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(365), - Port { - id: PortId(365), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(366), - Port { - id: PortId(366), - state: PortState::Uninferred, - produced_by: Some(NodeId(348)), - }, - ); - ports.insert( - PortId(367), - Port { - id: PortId(367), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(368), - Port { - id: PortId(368), - state: PortState::Uninferred, - produced_by: Some(NodeId(349)), - }, - ); - ports.insert( - PortId(369), - Port { - id: PortId(369), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(370), - Port { - id: PortId(370), - state: PortState::Uninferred, - produced_by: Some(NodeId(350)), - }, - ); - ports.insert( - PortId(371), - Port { - id: PortId(371), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(372), - Port { - id: PortId(372), - state: PortState::Uninferred, - produced_by: Some(NodeId(351)), - }, - ); - ports.insert( - PortId(373), - Port { - id: PortId(373), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(374), - Port { - id: PortId(374), - state: PortState::Uninferred, - produced_by: Some(NodeId(352)), - }, - ); - ports.insert( - PortId(375), - Port { - id: PortId(375), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(376), - Port { - id: PortId(376), - state: PortState::Uninferred, - produced_by: Some(NodeId(353)), - }, - ); - ports.insert( - PortId(377), - Port { - id: PortId(377), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(378), - Port { - id: PortId(378), - state: PortState::Uninferred, - produced_by: Some(NodeId(354)), - }, - ); - ports.insert( - PortId(379), - Port { - id: PortId(379), - state: PortState::Uninferred, - produced_by: Some(NodeId(355)), - }, - ); - ports.insert( - PortId(380), - Port { - id: PortId(380), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(381), - Port { - id: PortId(381), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(382), - Port { - id: PortId(382), - state: PortState::Uninferred, - produced_by: Some(NodeId(356)), - }, - ); - ports.insert( - PortId(383), - Port { - id: PortId(383), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(384), - Port { - id: PortId(384), - state: PortState::Uninferred, - produced_by: Some(NodeId(357)), - }, - ); - ports.insert( - PortId(385), - Port { - id: PortId(385), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(386), - Port { - id: PortId(386), - state: PortState::Uninferred, - produced_by: Some(NodeId(358)), - }, - ); - ports.insert( - PortId(387), - Port { - id: PortId(387), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(388), - Port { - id: PortId(388), - state: PortState::Uninferred, - produced_by: Some(NodeId(359)), - }, - ); - ports.insert( - PortId(389), - Port { - id: PortId(389), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(390), - Port { - id: PortId(390), - state: PortState::Uninferred, - produced_by: Some(NodeId(360)), - }, - ); - ports.insert( - PortId(391), - Port { - id: PortId(391), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(392), - Port { - id: PortId(392), - state: PortState::Uninferred, - produced_by: Some(NodeId(361)), - }, - ); - ports.insert( - PortId(393), - Port { - id: PortId(393), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(394), - Port { - id: PortId(394), - state: PortState::Uninferred, - produced_by: Some(NodeId(362)), - }, - ); - ports.insert( - PortId(395), - Port { - id: PortId(395), - state: PortState::Uninferred, - produced_by: Some(NodeId(363)), - }, - ); - ports.insert( - PortId(396), - Port { - id: PortId(396), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(397), - Port { - id: PortId(397), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(398), - Port { - id: PortId(398), - state: PortState::Uninferred, - produced_by: Some(NodeId(364)), - }, - ); - ports.insert( - PortId(399), - Port { - id: PortId(399), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(400), - Port { - id: PortId(400), - state: PortState::Uninferred, - produced_by: Some(NodeId(365)), - }, - ); - ports.insert( - PortId(401), - Port { - id: PortId(401), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(402), - Port { - id: PortId(402), - state: PortState::Uninferred, - produced_by: Some(NodeId(366)), - }, - ); - ports.insert( - PortId(403), - Port { - id: PortId(403), - state: PortState::Uninferred, - produced_by: Some(NodeId(367)), - }, - ); - ports.insert( - PortId(404), - Port { - id: PortId(404), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(405), - Port { - id: PortId(405), - state: PortState::Uninferred, - produced_by: Some(NodeId(368)), - }, - ); - ports.insert( - PortId(406), - Port { - id: PortId(406), - state: PortState::Uninferred, - produced_by: Some(NodeId(369)), - }, - ); - ports.insert( - PortId(407), - Port { - id: PortId(407), - state: PortState::Uninferred, - produced_by: Some(NodeId(370)), - }, - ); - ports.insert( - PortId(408), - Port { - id: PortId(408), - state: PortState::Uninferred, - produced_by: Some(NodeId(371)), - }, - ); - ports.insert( - PortId(409), - Port { - id: PortId(409), - state: PortState::Uninferred, - produced_by: Some(NodeId(372)), - }, - ); - ports.insert( - PortId(410), - Port { - id: PortId(410), - state: PortState::Uninferred, - produced_by: Some(NodeId(373)), - }, - ); - ports.insert( - PortId(411), - Port { - id: PortId(411), - state: PortState::Uninferred, - produced_by: Some(NodeId(374)), - }, - ); - ports.insert( - PortId(412), - Port { - id: PortId(412), - state: PortState::Uninferred, - produced_by: Some(NodeId(375)), - }, - ); - ports.insert( - PortId(413), - Port { - id: PortId(413), - state: PortState::Uninferred, - produced_by: Some(NodeId(376)), - }, - ); - ports.insert( - PortId(414), - Port { - id: PortId(414), - state: PortState::Uninferred, - produced_by: Some(NodeId(377)), - }, - ); - ports.insert( - PortId(415), - Port { - id: PortId(415), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(416), - Port { - id: PortId(416), - state: PortState::Uninferred, - produced_by: Some(NodeId(378)), - }, - ); - ports.insert( - PortId(417), - Port { - id: PortId(417), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(418), - Port { - id: PortId(418), - state: PortState::Uninferred, - produced_by: Some(NodeId(379)), - }, - ); - ports.insert( - PortId(419), - Port { - id: PortId(419), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(420), - Port { - id: PortId(420), - state: PortState::Uninferred, - produced_by: Some(NodeId(380)), - }, - ); - ports.insert( - PortId(421), - Port { - id: PortId(421), - state: PortState::Uninferred, - produced_by: Some(NodeId(381)), - }, - ); - ports.insert( - PortId(422), - Port { - id: PortId(422), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(423), - Port { - id: PortId(423), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(424), - Port { - id: PortId(424), - state: PortState::Uninferred, - produced_by: Some(NodeId(382)), - }, - ); - ports.insert( - PortId(425), - Port { - id: PortId(425), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(426), - Port { - id: PortId(426), - state: PortState::Uninferred, - produced_by: Some(NodeId(383)), - }, - ); - ports.insert( - PortId(427), - Port { - id: PortId(427), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(428), - Port { - id: PortId(428), - state: PortState::Uninferred, - produced_by: Some(NodeId(384)), - }, - ); - ports.insert( - PortId(429), - Port { - id: PortId(429), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(430), - Port { - id: PortId(430), - state: PortState::Uninferred, - produced_by: Some(NodeId(385)), - }, - ); - ports.insert( - PortId(431), - Port { - id: PortId(431), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(432), - Port { - id: PortId(432), - state: PortState::Uninferred, - produced_by: Some(NodeId(386)), - }, - ); - ports.insert( - PortId(433), - Port { - id: PortId(433), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(434), - Port { - id: PortId(434), - state: PortState::Uninferred, - produced_by: Some(NodeId(387)), - }, - ); - ports.insert( - PortId(435), - Port { - id: PortId(435), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(436), - Port { - id: PortId(436), - state: PortState::Uninferred, - produced_by: Some(NodeId(388)), - }, - ); - ports.insert( - PortId(437), - Port { - id: PortId(437), - state: PortState::Uninferred, - produced_by: Some(NodeId(389)), - }, - ); - ports.insert( - PortId(438), - Port { - id: PortId(438), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(439), - Port { - id: PortId(439), - state: PortState::Uninferred, - produced_by: Some(NodeId(390)), - }, - ); - ports.insert( - PortId(440), - Port { - id: PortId(440), - state: PortState::Uninferred, - produced_by: Some(NodeId(391)), - }, - ); - ports.insert( - PortId(441), - Port { - id: PortId(441), - state: PortState::Uninferred, - produced_by: Some(NodeId(392)), - }, - ); - ports.insert( - PortId(442), - Port { - id: PortId(442), - state: PortState::Uninferred, - produced_by: Some(NodeId(393)), - }, - ); - ports.insert( - PortId(443), - Port { - id: PortId(443), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(444), - Port { - id: PortId(444), - state: PortState::Uninferred, - produced_by: Some(NodeId(394)), - }, - ); - ports.insert( - PortId(445), - Port { - id: PortId(445), - state: PortState::Uninferred, - produced_by: Some(NodeId(395)), - }, - ); - ports.insert( - PortId(446), - Port { - id: PortId(446), - state: PortState::Uninferred, - produced_by: Some(NodeId(396)), - }, - ); - ports.insert( - PortId(447), - Port { - id: PortId(447), - state: PortState::Uninferred, - produced_by: Some(NodeId(397)), - }, - ); - ports.insert( - PortId(448), - Port { - id: PortId(448), - state: PortState::Resolved(TypeShape::new(DeclarationId(124))), - produced_by: Some(NodeId(398)), - }, - ); - ports.insert( - PortId(449), - Port { - id: PortId(449), - state: PortState::Resolved(TypeShape::new(DeclarationId(915))), - produced_by: None, - }, - ); - ports.insert( - PortId(450), - Port { - id: PortId(450), - state: PortState::Resolved(TypeShape::new(DeclarationId(915))), - produced_by: None, - }, - ); - ports.insert( - PortId(451), - Port { - id: PortId(451), - state: PortState::Resolved(TypeShape::new(DeclarationId(124))), - produced_by: Some(NodeId(400)), - }, - ); - ports.insert( - PortId(452), - Port { - id: PortId(452), - state: PortState::Resolved(TypeShape::new(DeclarationId(935))), - produced_by: None, - }, - ); - ports.insert( - PortId(453), - Port { - id: PortId(453), - state: PortState::Resolved(TypeShape::new(DeclarationId(935))), - produced_by: None, - }, - ); - ports.insert( - PortId(454), - Port { - id: PortId(454), - state: PortState::Uninferred, - produced_by: Some(NodeId(402)), - }, - ); - ports.insert( - PortId(455), - Port { - id: PortId(455), - state: PortState::Uninferred, - produced_by: Some(NodeId(403)), - }, - ); - ports.insert( - PortId(456), - Port { - id: PortId(456), - state: PortState::Uninferred, - produced_by: Some(NodeId(404)), - }, - ); - ports.insert( - PortId(457), - Port { - id: PortId(457), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(458), - Port { - id: PortId(458), - state: PortState::Uninferred, - produced_by: Some(NodeId(405)), - }, - ); - ports.insert( - PortId(459), - Port { - id: PortId(459), - state: PortState::Uninferred, - produced_by: Some(NodeId(406)), - }, - ); - ports.insert( - PortId(460), - Port { - id: PortId(460), - state: PortState::Uninferred, - produced_by: Some(NodeId(407)), - }, - ); - ports.insert( - PortId(461), - Port { - id: PortId(461), - state: PortState::Uninferred, - produced_by: Some(NodeId(408)), - }, - ); - ports.insert( - PortId(462), - Port { - id: PortId(462), - state: PortState::Uninferred, - produced_by: Some(NodeId(409)), - }, - ); - ports.insert( - PortId(463), - Port { - id: PortId(463), - state: PortState::Uninferred, - produced_by: Some(NodeId(410)), - }, - ); - ports.insert( - PortId(464), - Port { - id: PortId(464), - state: PortState::Uninferred, - produced_by: Some(NodeId(411)), - }, - ); - ports.insert( - PortId(465), - Port { - id: PortId(465), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(466), - Port { - id: PortId(466), - state: PortState::Uninferred, - produced_by: Some(NodeId(412)), - }, - ); - ports.insert( - PortId(467), - Port { - id: PortId(467), - state: PortState::Uninferred, - produced_by: Some(NodeId(413)), - }, - ); - ports.insert( - PortId(468), - Port { - id: PortId(468), - state: PortState::Uninferred, - produced_by: Some(NodeId(414)), - }, - ); - ports.insert( - PortId(469), - Port { - id: PortId(469), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(470), - Port { - id: PortId(470), - state: PortState::Uninferred, - produced_by: Some(NodeId(415)), - }, - ); - ports.insert( - PortId(471), - Port { - id: PortId(471), - state: PortState::Uninferred, - produced_by: Some(NodeId(416)), - }, - ); - ports.insert( - PortId(472), - Port { - id: PortId(472), - state: PortState::Uninferred, - produced_by: Some(NodeId(417)), - }, - ); - ports.insert( - PortId(473), - Port { - id: PortId(473), - state: PortState::Uninferred, - produced_by: Some(NodeId(418)), - }, - ); - ports.insert( - PortId(474), - Port { - id: PortId(474), - state: PortState::Uninferred, - produced_by: Some(NodeId(419)), - }, - ); - ports.insert( - PortId(475), - Port { - id: PortId(475), - state: PortState::Uninferred, - produced_by: Some(NodeId(420)), - }, - ); - ports.insert( - PortId(476), - Port { - id: PortId(476), - state: PortState::Uninferred, - produced_by: Some(NodeId(421)), - }, - ); - ports.insert( - PortId(477), - Port { - id: PortId(477), - state: PortState::Uninferred, - produced_by: Some(NodeId(422)), - }, - ); - ports.insert( - PortId(478), - Port { - id: PortId(478), - state: PortState::Uninferred, - produced_by: Some(NodeId(423)), - }, - ); - ports.insert( - PortId(479), - Port { - id: PortId(479), - state: PortState::Uninferred, - produced_by: Some(NodeId(424)), - }, - ); - ports.insert( - PortId(480), - Port { - id: PortId(480), - state: PortState::Uninferred, - produced_by: Some(NodeId(425)), - }, - ); - ports.insert( - PortId(481), - Port { - id: PortId(481), - state: PortState::Uninferred, - produced_by: Some(NodeId(426)), - }, - ); - ports.insert( - PortId(482), - Port { - id: PortId(482), - state: PortState::Uninferred, - produced_by: Some(NodeId(427)), - }, - ); - ports.insert( - PortId(483), - Port { - id: PortId(483), - state: PortState::Uninferred, - produced_by: Some(NodeId(428)), - }, - ); - ports.insert( - PortId(484), - Port { - id: PortId(484), - state: PortState::Uninferred, - produced_by: Some(NodeId(429)), - }, - ); - ports.insert( - PortId(485), - Port { - id: PortId(485), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(486), - Port { - id: PortId(486), - state: PortState::Uninferred, - produced_by: Some(NodeId(430)), - }, - ); - ports.insert( - PortId(487), - Port { - id: PortId(487), - state: PortState::Uninferred, - produced_by: Some(NodeId(431)), - }, - ); - ports.insert( - PortId(488), - Port { - id: PortId(488), - state: PortState::Uninferred, - produced_by: Some(NodeId(432)), - }, - ); - ports.insert( - PortId(489), - Port { - id: PortId(489), - state: PortState::Uninferred, - produced_by: Some(NodeId(433)), - }, - ); - ports.insert( - PortId(490), - Port { - id: PortId(490), - state: PortState::Uninferred, - produced_by: Some(NodeId(434)), - }, - ); - ports.insert( - PortId(491), - Port { - id: PortId(491), - state: PortState::Uninferred, - produced_by: Some(NodeId(435)), - }, - ); - ports.insert( - PortId(492), - Port { - id: PortId(492), - state: PortState::Uninferred, - produced_by: Some(NodeId(436)), - }, - ); - ports.insert( - PortId(493), - Port { - id: PortId(493), - state: PortState::Uninferred, - produced_by: Some(NodeId(437)), - }, - ); - ports.insert( - PortId(494), - Port { - id: PortId(494), - state: PortState::Uninferred, - produced_by: Some(NodeId(438)), - }, - ); - ports.insert( - PortId(495), - Port { - id: PortId(495), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(496), - Port { - id: PortId(496), - state: PortState::Uninferred, - produced_by: Some(NodeId(439)), - }, - ); - ports.insert( - PortId(497), - Port { - id: PortId(497), - state: PortState::Uninferred, - produced_by: Some(NodeId(440)), - }, - ); - ports.insert( - PortId(498), - Port { - id: PortId(498), - state: PortState::Uninferred, - produced_by: Some(NodeId(441)), - }, - ); - ports.insert( - PortId(499), - Port { - id: PortId(499), - state: PortState::Uninferred, - produced_by: Some(NodeId(442)), - }, - ); - ports.insert( - PortId(500), - Port { - id: PortId(500), - state: PortState::Uninferred, - produced_by: Some(NodeId(443)), - }, - ); - ports.insert( - PortId(501), - Port { - id: PortId(501), - state: PortState::Uninferred, - produced_by: Some(NodeId(444)), - }, - ); - ports.insert( - PortId(502), - Port { - id: PortId(502), - state: PortState::Uninferred, - produced_by: Some(NodeId(445)), - }, - ); - ports.insert( - PortId(503), - Port { - id: PortId(503), - state: PortState::Uninferred, - produced_by: Some(NodeId(446)), - }, - ); - ports.insert( - PortId(504), - Port { - id: PortId(504), - state: PortState::Uninferred, - produced_by: Some(NodeId(447)), - }, - ); - ports.insert( - PortId(505), - Port { - id: PortId(505), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(506), - Port { - id: PortId(506), - state: PortState::Uninferred, - produced_by: Some(NodeId(448)), - }, - ); - ports.insert( - PortId(507), - Port { - id: PortId(507), - state: PortState::Uninferred, - produced_by: Some(NodeId(449)), - }, - ); - ports.insert( - PortId(508), - Port { - id: PortId(508), - state: PortState::Uninferred, - produced_by: Some(NodeId(450)), - }, - ); - ports.insert( - PortId(509), - Port { - id: PortId(509), - state: PortState::Uninferred, - produced_by: Some(NodeId(451)), - }, - ); - ports.insert( - PortId(510), - Port { - id: PortId(510), - state: PortState::Uninferred, - produced_by: Some(NodeId(452)), - }, - ); - ports.insert( - PortId(511), - Port { - id: PortId(511), - state: PortState::Uninferred, - produced_by: Some(NodeId(453)), - }, - ); - ports.insert( - PortId(512), - Port { - id: PortId(512), - state: PortState::Uninferred, - produced_by: Some(NodeId(454)), - }, - ); - ports.insert( - PortId(513), - Port { - id: PortId(513), - state: PortState::Uninferred, - produced_by: Some(NodeId(455)), - }, - ); - ports.insert( - PortId(514), - Port { - id: PortId(514), - state: PortState::Uninferred, - produced_by: Some(NodeId(456)), - }, - ); - ports.insert( - PortId(515), - Port { - id: PortId(515), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(516), - Port { - id: PortId(516), - state: PortState::Uninferred, - produced_by: Some(NodeId(457)), - }, - ); - ports.insert( - PortId(517), - Port { - id: PortId(517), - state: PortState::Uninferred, - produced_by: Some(NodeId(458)), - }, - ); - ports.insert( - PortId(518), - Port { - id: PortId(518), - state: PortState::Uninferred, - produced_by: Some(NodeId(459)), - }, - ); - ports.insert( - PortId(519), - Port { - id: PortId(519), - state: PortState::Uninferred, - produced_by: Some(NodeId(460)), - }, - ); - ports.insert( - PortId(520), - Port { - id: PortId(520), - state: PortState::Uninferred, - produced_by: Some(NodeId(461)), - }, - ); - ports.insert( - PortId(521), - Port { - id: PortId(521), - state: PortState::Uninferred, - produced_by: Some(NodeId(462)), - }, - ); - ports.insert( - PortId(522), - Port { - id: PortId(522), - state: PortState::Uninferred, - produced_by: Some(NodeId(463)), - }, - ); - ports.insert( - PortId(523), - Port { - id: PortId(523), - state: PortState::Uninferred, - produced_by: Some(NodeId(464)), - }, - ); - ports.insert( - PortId(524), - Port { - id: PortId(524), - state: PortState::Uninferred, - produced_by: Some(NodeId(465)), - }, - ); - ports.insert( - PortId(525), - Port { - id: PortId(525), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(526), - Port { - id: PortId(526), - state: PortState::Uninferred, - produced_by: Some(NodeId(466)), - }, - ); - ports.insert( - PortId(527), - Port { - id: PortId(527), - state: PortState::Uninferred, - produced_by: Some(NodeId(467)), - }, - ); - ports.insert( - PortId(528), - Port { - id: PortId(528), - state: PortState::Uninferred, - produced_by: Some(NodeId(468)), - }, - ); - ports.insert( - PortId(529), - Port { - id: PortId(529), - state: PortState::Uninferred, - produced_by: Some(NodeId(469)), - }, - ); - ports.insert( - PortId(530), - Port { - id: PortId(530), - state: PortState::Resolved(TypeShape::new(DeclarationId(124))), - produced_by: Some(NodeId(470)), - }, - ); - ports.insert( - PortId(531), - Port { - id: PortId(531), - state: PortState::Resolved(TypeShape::new(DeclarationId(935))), - produced_by: None, - }, - ); - ports.insert( - PortId(532), - Port { - id: PortId(532), - state: PortState::Resolved(TypeShape::new(DeclarationId(935))), - produced_by: None, - }, - ); - ports.insert( - PortId(533), - Port { - id: PortId(533), - state: PortState::Uninferred, - produced_by: Some(NodeId(472)), - }, - ); - ports.insert( - PortId(534), - Port { - id: PortId(534), - state: PortState::Resolved(TypeShape::new(DeclarationId(935))), - produced_by: Some(NodeId(473)), - }, - ); - ports.insert( - PortId(535), - Port { - id: PortId(535), - state: PortState::Resolved(TypeShape::new(DeclarationId(935))), - produced_by: None, - }, - ); - ports.insert( - PortId(536), - Port { - id: PortId(536), - state: PortState::Resolved(TypeShape::new(DeclarationId(935))), - produced_by: None, - }, - ); - ports.insert( - PortId(537), - Port { - id: PortId(537), - state: PortState::Uninferred, - produced_by: Some(NodeId(475)), - }, - ); - ports.insert( - PortId(538), - Port { - id: PortId(538), - state: PortState::Resolved(TypeShape::new(DeclarationId(935))), - produced_by: Some(NodeId(476)), - }, - ); - ports.insert( - PortId(539), - Port { - id: PortId(539), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(540), - Port { - id: PortId(540), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(541), - Port { - id: PortId(541), - state: PortState::Uninferred, - produced_by: Some(NodeId(478)), - }, - ); - ports.insert( - PortId(542), - Port { - id: PortId(542), - state: PortState::Uninferred, - produced_by: Some(NodeId(479)), - }, - ); - ports.insert( - PortId(543), - Port { - id: PortId(543), - state: PortState::Uninferred, - produced_by: Some(NodeId(480)), - }, - ); - ports.insert( - PortId(544), - Port { - id: PortId(544), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(545), - Port { - id: PortId(545), - state: PortState::Uninferred, - produced_by: Some(NodeId(481)), - }, - ); - ports.insert( - PortId(546), - Port { - id: PortId(546), - state: PortState::Uninferred, - produced_by: Some(NodeId(482)), - }, - ); - ports.insert( - PortId(547), - Port { - id: PortId(547), - state: PortState::Uninferred, - produced_by: Some(NodeId(483)), - }, - ); - ports.insert( - PortId(548), - Port { - id: PortId(548), - state: PortState::Uninferred, - produced_by: Some(NodeId(484)), - }, - ); - ports.insert( - PortId(549), - Port { - id: PortId(549), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: Some(NodeId(485)), - }, - ); - ports.insert( - PortId(550), - Port { - id: PortId(550), - state: PortState::Resolved(TypeShape::new(DeclarationId(1780))), - produced_by: None, - }, - ); - ports.insert( - PortId(551), - Port { - id: PortId(551), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: Some(NodeId(487)), - }, - ); - ports.insert( - PortId(552), - Port { - id: PortId(552), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: Some(NodeId(488)), - }, - ); - ports.insert( - PortId(553), - Port { - id: PortId(553), - state: PortState::Resolved(TypeShape::new(DeclarationId(1777))), - produced_by: Some(NodeId(489)), - }, - ); - ports.insert( - PortId(554), - Port { - id: PortId(554), - state: PortState::Uninferred, - produced_by: Some(NodeId(490)), - }, - ); - ports.insert( - PortId(555), - Port { - id: PortId(555), - state: PortState::Resolved(TypeShape::new(DeclarationId(1781))), - produced_by: Some(NodeId(491)), - }, - ); - ports.insert( - PortId(556), - Port { - id: PortId(556), - state: PortState::Resolved(TypeShape::new(DeclarationId(1782))), - produced_by: None, - }, - ); - ports.insert( - PortId(557), - Port { - id: PortId(557), - state: PortState::Uninferred, - produced_by: Some(NodeId(493)), - }, - ); - ports.insert( - PortId(558), - Port { - id: PortId(558), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(559), - Port { - id: PortId(559), - state: PortState::Uninferred, - produced_by: Some(NodeId(494)), - }, - ); - ports.insert( - PortId(560), - Port { - id: PortId(560), - state: PortState::Uninferred, - produced_by: Some(NodeId(495)), - }, - ); - ports.insert( - PortId(561), - Port { - id: PortId(561), - state: PortState::Uninferred, - produced_by: Some(NodeId(496)), - }, - ); - ports.insert( - PortId(562), - Port { - id: PortId(562), - state: PortState::Uninferred, - produced_by: Some(NodeId(497)), - }, - ); - ports.insert( - PortId(563), - Port { - id: PortId(563), - state: PortState::Uninferred, - produced_by: Some(NodeId(498)), - }, - ); - ports.insert( - PortId(564), - Port { - id: PortId(564), - state: PortState::Uninferred, - produced_by: Some(NodeId(499)), - }, - ); - ports.insert( - PortId(565), - Port { - id: PortId(565), - state: PortState::Uninferred, - produced_by: Some(NodeId(500)), - }, - ); - ports.insert( - PortId(566), - Port { - id: PortId(566), - state: PortState::Uninferred, - produced_by: Some(NodeId(501)), - }, - ); - ports.insert( - PortId(567), - Port { - id: PortId(567), - state: PortState::Uninferred, - produced_by: Some(NodeId(502)), - }, - ); - ports.insert( - PortId(568), - Port { - id: PortId(568), - state: PortState::Uninferred, - produced_by: Some(NodeId(503)), - }, - ); - ports.insert( - PortId(569), - Port { - id: PortId(569), - state: PortState::Resolved(TypeShape::new(DeclarationId(1783))), - produced_by: Some(NodeId(504)), - }, - ); - ports.insert( - PortId(570), - Port { - id: PortId(570), - state: PortState::Resolved(TypeShape::new(DeclarationId(1784))), - produced_by: None, - }, - ); - ports.insert( - PortId(571), - Port { - id: PortId(571), - state: PortState::Uninferred, - produced_by: Some(NodeId(506)), - }, - ); - ports.insert( - PortId(572), - Port { - id: PortId(572), - state: PortState::Uninferred, - produced_by: Some(NodeId(507)), - }, - ); - ports.insert( - PortId(573), - Port { - id: PortId(573), - state: PortState::Uninferred, - produced_by: Some(NodeId(508)), - }, - ); - ports.insert( - PortId(574), - Port { - id: PortId(574), - state: PortState::Uninferred, - produced_by: Some(NodeId(509)), - }, - ); - ports.insert( - PortId(575), - Port { - id: PortId(575), - state: PortState::Uninferred, - produced_by: Some(NodeId(510)), - }, - ); - ports.insert( - PortId(576), - Port { - id: PortId(576), - state: PortState::Resolved(TypeShape::new(DeclarationId(1785))), - produced_by: Some(NodeId(511)), - }, - ); - ports.insert( - PortId(577), - Port { - id: PortId(577), - state: PortState::Resolved(TypeShape::new(DeclarationId(1786))), - produced_by: None, - }, - ); - ports.insert( - PortId(578), - Port { - id: PortId(578), - state: PortState::Uninferred, - produced_by: Some(NodeId(513)), - }, - ); - ports.insert( - PortId(579), - Port { - id: PortId(579), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(580), - Port { - id: PortId(580), - state: PortState::Uninferred, - produced_by: Some(NodeId(514)), - }, - ); - ports.insert( - PortId(581), - Port { - id: PortId(581), - state: PortState::Uninferred, - produced_by: Some(NodeId(515)), - }, - ); - ports.insert( - PortId(582), - Port { - id: PortId(582), - state: PortState::Uninferred, - produced_by: Some(NodeId(516)), - }, - ); - ports.insert( - PortId(583), - Port { - id: PortId(583), - state: PortState::Uninferred, - produced_by: Some(NodeId(517)), - }, - ); - ports.insert( - PortId(584), - Port { - id: PortId(584), - state: PortState::Uninferred, - produced_by: Some(NodeId(518)), - }, - ); - ports.insert( - PortId(585), - Port { - id: PortId(585), - state: PortState::Uninferred, - produced_by: Some(NodeId(519)), - }, - ); - ports.insert( - PortId(586), - Port { - id: PortId(586), - state: PortState::Resolved(TypeShape::new(DeclarationId(124))), - produced_by: Some(NodeId(520)), - }, - ); - ports.insert( - PortId(587), - Port { - id: PortId(587), - state: PortState::Resolved(TypeShape::new(DeclarationId(1787))), - produced_by: None, - }, - ); - ports.insert( - PortId(588), - Port { - id: PortId(588), - state: PortState::Uninferred, - produced_by: Some(NodeId(522)), - }, - ); - ports.insert( - PortId(589), - Port { - id: PortId(589), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(590), - Port { - id: PortId(590), - state: PortState::Uninferred, - produced_by: Some(NodeId(523)), - }, - ); - ports.insert( - PortId(591), - Port { - id: PortId(591), - state: PortState::Uninferred, - produced_by: Some(NodeId(524)), - }, - ); - ports.insert( - PortId(592), - Port { - id: PortId(592), - state: PortState::Uninferred, - produced_by: Some(NodeId(525)), - }, - ); - ports.insert( - PortId(593), - Port { - id: PortId(593), - state: PortState::Uninferred, - produced_by: Some(NodeId(526)), - }, - ); - ports.insert( - PortId(594), - Port { - id: PortId(594), - state: PortState::Uninferred, - produced_by: Some(NodeId(527)), - }, - ); - ports.insert( - PortId(595), - Port { - id: PortId(595), - state: PortState::Uninferred, - produced_by: Some(NodeId(528)), - }, - ); - ports.insert( - PortId(596), - Port { - id: PortId(596), - state: PortState::Uninferred, - produced_by: Some(NodeId(529)), - }, - ); - ports.insert( - PortId(597), - Port { - id: PortId(597), - state: PortState::Uninferred, - produced_by: Some(NodeId(530)), - }, - ); - ports.insert( - PortId(598), - Port { - id: PortId(598), - state: PortState::Uninferred, - produced_by: Some(NodeId(531)), - }, - ); - ports.insert( - PortId(599), - Port { - id: PortId(599), - state: PortState::Uninferred, - produced_by: Some(NodeId(532)), - }, - ); - ports.insert( - PortId(600), - Port { - id: PortId(600), - state: PortState::Resolved(TypeShape::new(DeclarationId(1788))), - produced_by: Some(NodeId(533)), - }, - ); - ports.insert( - PortId(601), - Port { - id: PortId(601), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(602), - Port { - id: PortId(602), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(603), - Port { - id: PortId(603), - state: PortState::Uninferred, - produced_by: Some(NodeId(535)), - }, - ); - ports.insert( - PortId(604), - Port { - id: PortId(604), - state: PortState::Uninferred, - produced_by: Some(NodeId(536)), - }, - ); - ports.insert( - PortId(605), - Port { - id: PortId(605), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(606), - Port { - id: PortId(606), - state: PortState::Uninferred, - produced_by: Some(NodeId(537)), - }, - ); - ports.insert( - PortId(607), - Port { - id: PortId(607), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(608), - Port { - id: PortId(608), - state: PortState::Uninferred, - produced_by: Some(NodeId(538)), - }, - ); - ports.insert( - PortId(609), - Port { - id: PortId(609), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(610), - Port { - id: PortId(610), - state: PortState::Uninferred, - produced_by: Some(NodeId(539)), - }, - ); - ports.insert( - PortId(611), - Port { - id: PortId(611), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(612), - Port { - id: PortId(612), - state: PortState::Uninferred, - produced_by: Some(NodeId(540)), - }, - ); - ports.insert( - PortId(613), - Port { - id: PortId(613), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(614), - Port { - id: PortId(614), - state: PortState::Uninferred, - produced_by: Some(NodeId(541)), - }, - ); - ports.insert( - PortId(615), - Port { - id: PortId(615), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(616), - Port { - id: PortId(616), - state: PortState::Uninferred, - produced_by: Some(NodeId(542)), - }, - ); - ports.insert( - PortId(617), - Port { - id: PortId(617), - state: PortState::Resolved(TypeShape::new(DeclarationId(124))), - produced_by: Some(NodeId(543)), - }, - ); - ports.insert( - PortId(618), - Port { - id: PortId(618), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(619), - Port { - id: PortId(619), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(620), - Port { - id: PortId(620), - state: PortState::Uninferred, - produced_by: Some(NodeId(545)), - }, - ); - ports.insert( - PortId(621), - Port { - id: PortId(621), - state: PortState::Uninferred, - produced_by: Some(NodeId(546)), - }, - ); - ports.insert( - PortId(622), - Port { - id: PortId(622), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(623), - Port { - id: PortId(623), - state: PortState::Uninferred, - produced_by: Some(NodeId(547)), - }, - ); - ports.insert( - PortId(624), - Port { - id: PortId(624), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(625), - Port { - id: PortId(625), - state: PortState::Uninferred, - produced_by: Some(NodeId(548)), - }, - ); - ports.insert( - PortId(626), - Port { - id: PortId(626), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(627), - Port { - id: PortId(627), - state: PortState::Uninferred, - produced_by: Some(NodeId(549)), - }, - ); - ports.insert( - PortId(628), - Port { - id: PortId(628), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(629), - Port { - id: PortId(629), - state: PortState::Uninferred, - produced_by: Some(NodeId(550)), - }, - ); - ports.insert( - PortId(630), - Port { - id: PortId(630), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(631), - Port { - id: PortId(631), - state: PortState::Uninferred, - produced_by: Some(NodeId(551)), - }, - ); - ports.insert( - PortId(632), - Port { - id: PortId(632), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(633), - Port { - id: PortId(633), - state: PortState::Uninferred, - produced_by: Some(NodeId(552)), - }, - ); - ports.insert( - PortId(634), - Port { - id: PortId(634), - state: PortState::Resolved(TypeShape::new(DeclarationId(124))), - produced_by: Some(NodeId(553)), - }, - ); - ports.insert( - PortId(635), - Port { - id: PortId(635), - state: PortState::Resolved(TypeShape::new(DeclarationId(1789))), - produced_by: None, - }, - ); - ports.insert( - PortId(636), - Port { - id: PortId(636), - state: PortState::Uninferred, - produced_by: Some(NodeId(555)), - }, - ); - ports.insert( - PortId(637), - Port { - id: PortId(637), - state: PortState::Uninferred, - produced_by: Some(NodeId(556)), - }, - ); - ports.insert( - PortId(638), - Port { - id: PortId(638), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(639), - Port { - id: PortId(639), - state: PortState::Uninferred, - produced_by: Some(NodeId(557)), - }, - ); - ports.insert( - PortId(640), - Port { - id: PortId(640), - state: PortState::Uninferred, - produced_by: Some(NodeId(558)), - }, - ); - ports.insert( - PortId(641), - Port { - id: PortId(641), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(642), - Port { - id: PortId(642), - state: PortState::Uninferred, - produced_by: Some(NodeId(559)), - }, - ); - ports.insert( - PortId(643), - Port { - id: PortId(643), - state: PortState::Uninferred, - produced_by: Some(NodeId(560)), - }, - ); - ports.insert( - PortId(644), - Port { - id: PortId(644), - state: PortState::Uninferred, - produced_by: Some(NodeId(561)), - }, - ); - ports.insert( - PortId(645), - Port { - id: PortId(645), - state: PortState::Uninferred, - produced_by: Some(NodeId(562)), - }, - ); - ports.insert( - PortId(646), - Port { - id: PortId(646), - state: PortState::Uninferred, - produced_by: Some(NodeId(563)), - }, - ); - ports.insert( - PortId(647), - Port { - id: PortId(647), - state: PortState::Uninferred, - produced_by: Some(NodeId(564)), - }, - ); - ports.insert( - PortId(648), - Port { - id: PortId(648), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: Some(NodeId(565)), - }, - ); - ports.insert( - PortId(649), - Port { - id: PortId(649), - state: PortState::Resolved(TypeShape::new(DeclarationId(1790))), - produced_by: None, - }, - ); - ports.insert( - PortId(650), - Port { - id: PortId(650), - state: PortState::Uninferred, - produced_by: Some(NodeId(567)), - }, - ); - ports.insert( - PortId(651), - Port { - id: PortId(651), - state: PortState::Uninferred, - produced_by: Some(NodeId(568)), - }, - ); - ports.insert( - PortId(652), - Port { - id: PortId(652), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(653), - Port { - id: PortId(653), - state: PortState::Uninferred, - produced_by: Some(NodeId(569)), - }, - ); - ports.insert( - PortId(654), - Port { - id: PortId(654), - state: PortState::Uninferred, - produced_by: Some(NodeId(570)), - }, - ); - ports.insert( - PortId(655), - Port { - id: PortId(655), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(656), - Port { - id: PortId(656), - state: PortState::Uninferred, - produced_by: Some(NodeId(571)), - }, - ); - ports.insert( - PortId(657), - Port { - id: PortId(657), - state: PortState::Uninferred, - produced_by: Some(NodeId(572)), - }, - ); - ports.insert( - PortId(658), - Port { - id: PortId(658), - state: PortState::Uninferred, - produced_by: Some(NodeId(573)), - }, - ); - ports.insert( - PortId(659), - Port { - id: PortId(659), - state: PortState::Uninferred, - produced_by: Some(NodeId(574)), - }, - ); - ports.insert( - PortId(660), - Port { - id: PortId(660), - state: PortState::Uninferred, - produced_by: Some(NodeId(575)), - }, - ); - ports.insert( - PortId(661), - Port { - id: PortId(661), - state: PortState::Uninferred, - produced_by: Some(NodeId(576)), - }, - ); - ports.insert( - PortId(662), - Port { - id: PortId(662), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: Some(NodeId(577)), - }, - ); - ports.insert( - PortId(663), - Port { - id: PortId(663), - state: PortState::Resolved(TypeShape::new(DeclarationId(1791))), - produced_by: None, - }, - ); - ports.insert( - PortId(664), - Port { - id: PortId(664), - state: PortState::Uninferred, - produced_by: Some(NodeId(579)), - }, - ); - ports.insert( - PortId(665), - Port { - id: PortId(665), - state: PortState::Uninferred, - produced_by: Some(NodeId(580)), - }, - ); - ports.insert( - PortId(666), - Port { - id: PortId(666), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(667), - Port { - id: PortId(667), - state: PortState::Uninferred, - produced_by: Some(NodeId(581)), - }, - ); - ports.insert( - PortId(668), - Port { - id: PortId(668), - state: PortState::Uninferred, - produced_by: Some(NodeId(582)), - }, - ); - ports.insert( - PortId(669), - Port { - id: PortId(669), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(670), - Port { - id: PortId(670), - state: PortState::Uninferred, - produced_by: Some(NodeId(583)), - }, - ); - ports.insert( - PortId(671), - Port { - id: PortId(671), - state: PortState::Uninferred, - produced_by: Some(NodeId(584)), - }, - ); - ports.insert( - PortId(672), - Port { - id: PortId(672), - state: PortState::Uninferred, - produced_by: Some(NodeId(585)), - }, - ); - ports.insert( - PortId(673), - Port { - id: PortId(673), - state: PortState::Uninferred, - produced_by: Some(NodeId(586)), - }, - ); - ports.insert( - PortId(674), - Port { - id: PortId(674), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(675), - Port { - id: PortId(675), - state: PortState::Uninferred, - produced_by: Some(NodeId(587)), - }, - ); - ports.insert( - PortId(676), - Port { - id: PortId(676), - state: PortState::Uninferred, - produced_by: Some(NodeId(588)), - }, - ); - ports.insert( - PortId(677), - Port { - id: PortId(677), - state: PortState::Uninferred, - produced_by: Some(NodeId(589)), - }, - ); - ports.insert( - PortId(678), - Port { - id: PortId(678), - state: PortState::Uninferred, - produced_by: Some(NodeId(590)), - }, - ); - ports.insert( - PortId(679), - Port { - id: PortId(679), - state: PortState::Uninferred, - produced_by: Some(NodeId(591)), - }, - ); - ports.insert( - PortId(680), - Port { - id: PortId(680), - state: PortState::Uninferred, - produced_by: Some(NodeId(592)), - }, - ); - ports.insert( - PortId(681), - Port { - id: PortId(681), - state: PortState::Uninferred, - produced_by: Some(NodeId(593)), - }, - ); - ports.insert( - PortId(682), - Port { - id: PortId(682), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: Some(NodeId(594)), - }, - ); - ports.insert( - PortId(683), - Port { - id: PortId(683), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(684), - Port { - id: PortId(684), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(685), - Port { - id: PortId(685), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(686), - Port { - id: PortId(686), - state: PortState::Uninferred, - produced_by: Some(NodeId(596)), - }, - ); - ports.insert( - PortId(687), - Port { - id: PortId(687), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(688), - Port { - id: PortId(688), - state: PortState::Uninferred, - produced_by: Some(NodeId(597)), - }, - ); - ports.insert( - PortId(689), - Port { - id: PortId(689), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(690), - Port { - id: PortId(690), - state: PortState::Uninferred, - produced_by: Some(NodeId(598)), - }, - ); - ports.insert( - PortId(691), - Port { - id: PortId(691), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(692), - Port { - id: PortId(692), - state: PortState::Uninferred, - produced_by: Some(NodeId(599)), - }, - ); - ports.insert( - PortId(693), - Port { - id: PortId(693), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(694), - Port { - id: PortId(694), - state: PortState::Uninferred, - produced_by: Some(NodeId(600)), - }, - ); - ports.insert( - PortId(695), - Port { - id: PortId(695), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(696), - Port { - id: PortId(696), - state: PortState::Uninferred, - produced_by: Some(NodeId(601)), - }, - ); - ports.insert( - PortId(697), - Port { - id: PortId(697), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(698), - Port { - id: PortId(698), - state: PortState::Uninferred, - produced_by: Some(NodeId(602)), - }, - ); - ports.insert( - PortId(699), - Port { - id: PortId(699), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: Some(NodeId(603)), - }, - ); - ports.insert( - PortId(700), - Port { - id: PortId(700), - state: PortState::Resolved(TypeShape::new(DeclarationId(915))), - produced_by: None, - }, - ); - ports.insert( - PortId(701), - Port { - id: PortId(701), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(702), - Port { - id: PortId(702), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(703), - Port { - id: PortId(703), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(704), - Port { - id: PortId(704), - state: PortState::Uninferred, - produced_by: Some(NodeId(605)), - }, - ); - ports.insert( - PortId(705), - Port { - id: PortId(705), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(706), - Port { - id: PortId(706), - state: PortState::Uninferred, - produced_by: Some(NodeId(606)), - }, - ); - ports.insert( - PortId(707), - Port { - id: PortId(707), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(708), - Port { - id: PortId(708), - state: PortState::Uninferred, - produced_by: Some(NodeId(607)), - }, - ); - ports.insert( - PortId(709), - Port { - id: PortId(709), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(710), - Port { - id: PortId(710), - state: PortState::Uninferred, - produced_by: Some(NodeId(608)), - }, - ); - ports.insert( - PortId(711), - Port { - id: PortId(711), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(712), - Port { - id: PortId(712), - state: PortState::Uninferred, - produced_by: Some(NodeId(609)), - }, - ); - ports.insert( - PortId(713), - Port { - id: PortId(713), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(714), - Port { - id: PortId(714), - state: PortState::Uninferred, - produced_by: Some(NodeId(610)), - }, - ); - ports.insert( - PortId(715), - Port { - id: PortId(715), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(716), - Port { - id: PortId(716), - state: PortState::Uninferred, - produced_by: Some(NodeId(611)), - }, - ); - ports.insert( - PortId(717), - Port { - id: PortId(717), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: Some(NodeId(612)), - }, - ); - ports.insert( - PortId(718), - Port { - id: PortId(718), - state: PortState::Resolved(TypeShape::new(DeclarationId(915))), - produced_by: None, - }, - ); - ports.insert( - PortId(719), - Port { - id: PortId(719), - state: PortState::Resolved(TypeShape::new(DeclarationId(915))), - produced_by: None, - }, - ); - ports.insert( - PortId(720), - Port { - id: PortId(720), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(721), - Port { - id: PortId(721), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(722), - Port { - id: PortId(722), - state: PortState::Uninferred, - produced_by: Some(NodeId(614)), - }, - ); - ports.insert( - PortId(723), - Port { - id: PortId(723), - state: PortState::Uninferred, - produced_by: Some(NodeId(615)), - }, - ); - ports.insert( - PortId(724), - Port { - id: PortId(724), - state: PortState::Uninferred, - produced_by: Some(NodeId(616)), - }, - ); - ports.insert( - PortId(725), - Port { - id: PortId(725), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: Some(NodeId(617)), - }, - ); - ports.insert( - PortId(726), - Port { - id: PortId(726), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(727), - Port { - id: PortId(727), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(728), - Port { - id: PortId(728), - state: PortState::Uninferred, - produced_by: Some(NodeId(619)), - }, - ); - ports.insert( - PortId(729), - Port { - id: PortId(729), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: Some(NodeId(620)), - }, - ); - ports.insert( - PortId(730), - Port { - id: PortId(730), - state: PortState::Resolved(TypeShape::new(DeclarationId(920))), - produced_by: None, - }, - ); - ports.insert( - PortId(731), - Port { - id: PortId(731), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(732), - Port { - id: PortId(732), - state: PortState::Resolved(TypeShape::new(DeclarationId(124))), - produced_by: Some(NodeId(622)), - }, - ); - ports.insert( - PortId(733), - Port { - id: PortId(733), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: Some(NodeId(623)), - }, - ); - ports.insert( - PortId(734), - Port { - id: PortId(734), - state: PortState::Uninferred, - produced_by: Some(NodeId(624)), - }, - ); - ports.insert( - PortId(735), - Port { - id: PortId(735), - state: PortState::Uninferred, - produced_by: Some(NodeId(625)), - }, - ); - ports.insert( - PortId(736), - Port { - id: PortId(736), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: Some(NodeId(626)), - }, - ); - ports.insert( - PortId(737), - Port { - id: PortId(737), - state: PortState::Resolved(TypeShape::new(DeclarationId(920))), - produced_by: Some(NodeId(627)), - }, - ); - ports.insert( - PortId(738), - Port { - id: PortId(738), - state: PortState::Resolved(TypeShape::new(DeclarationId(920))), - produced_by: None, - }, - ); - ports.insert( - PortId(739), - Port { - id: PortId(739), - state: PortState::Resolved(TypeShape::new(DeclarationId(124))), - produced_by: Some(NodeId(629)), - }, - ); - ports.insert( - PortId(740), - Port { - id: PortId(740), - state: PortState::Resolved(TypeShape::new(DeclarationId(1792))), - produced_by: None, - }, - ); - ports.insert( - PortId(741), - Port { - id: PortId(741), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(742), - Port { - id: PortId(742), - state: PortState::Uninferred, - produced_by: Some(NodeId(631)), - }, - ); - ports.insert( - PortId(743), - Port { - id: PortId(743), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(744), - Port { - id: PortId(744), - state: PortState::Uninferred, - produced_by: Some(NodeId(632)), - }, - ); - ports.insert( - PortId(745), - Port { - id: PortId(745), - state: PortState::Uninferred, - produced_by: Some(NodeId(633)), - }, - ); - ports.insert( - PortId(746), - Port { - id: PortId(746), - state: PortState::Uninferred, - produced_by: Some(NodeId(634)), - }, - ); - ports.insert( - PortId(747), - Port { - id: PortId(747), - state: PortState::Uninferred, - produced_by: Some(NodeId(635)), - }, - ); - ports.insert( - PortId(748), - Port { - id: PortId(748), - state: PortState::Uninferred, - produced_by: Some(NodeId(636)), - }, - ); - ports.insert( - PortId(749), - Port { - id: PortId(749), - state: PortState::Uninferred, - produced_by: Some(NodeId(637)), - }, - ); - ports.insert( - PortId(750), - Port { - id: PortId(750), - state: PortState::Uninferred, - produced_by: Some(NodeId(638)), - }, - ); - ports.insert( - PortId(751), - Port { - id: PortId(751), - state: PortState::Uninferred, - produced_by: Some(NodeId(639)), - }, - ); - ports.insert( - PortId(752), - Port { - id: PortId(752), - state: PortState::Uninferred, - produced_by: Some(NodeId(640)), - }, - ); - ports.insert( - PortId(753), - Port { - id: PortId(753), - state: PortState::Uninferred, - produced_by: Some(NodeId(641)), - }, - ); - ports.insert( - PortId(754), - Port { - id: PortId(754), - state: PortState::Resolved(TypeShape::new(DeclarationId(1793))), - produced_by: Some(NodeId(642)), - }, - ); - ports.insert( - PortId(755), - Port { - id: PortId(755), - state: PortState::Resolved(TypeShape::new(DeclarationId(1794))), - produced_by: None, - }, - ); - ports.insert( - PortId(756), - Port { - id: PortId(756), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: None, - }, - ); - ports.insert( - PortId(757), - Port { - id: PortId(757), - state: PortState::Uninferred, - produced_by: Some(NodeId(644)), - }, - ); - ports.insert( - PortId(758), - Port { - id: PortId(758), - state: PortState::Uninferred, - produced_by: Some(NodeId(645)), - }, - ); - ports.insert( - PortId(759), - Port { - id: PortId(759), - state: PortState::Uninferred, - produced_by: Some(NodeId(646)), - }, - ); - ports.insert( - PortId(760), - Port { - id: PortId(760), - state: PortState::Uninferred, - produced_by: Some(NodeId(647)), - }, - ); - ports.insert( - PortId(761), - Port { - id: PortId(761), - state: PortState::Uninferred, - produced_by: Some(NodeId(648)), - }, - ); - ports.insert( - PortId(762), - Port { - id: PortId(762), - state: PortState::Resolved(TypeShape::new(DeclarationId(1795))), - produced_by: Some(NodeId(649)), - }, - ); - ports.insert( - PortId(763), - Port { - id: PortId(763), - state: PortState::Resolved(TypeShape::new(DeclarationId(1796))), - produced_by: None, - }, - ); - ports.insert( - PortId(764), - Port { - id: PortId(764), - state: PortState::Uninferred, - produced_by: Some(NodeId(651)), - }, - ); - ports.insert( - PortId(765), - Port { - id: PortId(765), - state: PortState::Resolved(TypeShape::new(DeclarationId(1797))), - produced_by: Some(NodeId(652)), - }, - ); - ports.insert( - PortId(766), - Port { - id: PortId(766), - state: PortState::Resolved(TypeShape::new(DeclarationId(1184))), - produced_by: None, - }, - ); - ports.insert( - PortId(767), - Port { - id: PortId(767), - state: PortState::Uninferred, - produced_by: Some(NodeId(654)), - }, - ); - ports.insert( - PortId(768), - Port { - id: PortId(768), - state: PortState::Uninferred, - produced_by: Some(NodeId(655)), - }, - ); - ports.insert( - PortId(769), - Port { - id: PortId(769), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(770), - Port { - id: PortId(770), - state: PortState::Uninferred, - produced_by: Some(NodeId(656)), - }, - ); - ports.insert( - PortId(771), - Port { - id: PortId(771), - state: PortState::Uninferred, - produced_by: Some(NodeId(657)), - }, - ); - ports.insert( - PortId(772), - Port { - id: PortId(772), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(773), - Port { - id: PortId(773), - state: PortState::Uninferred, - produced_by: Some(NodeId(658)), - }, - ); - ports.insert( - PortId(774), - Port { - id: PortId(774), - state: PortState::Uninferred, - produced_by: Some(NodeId(659)), - }, - ); - ports.insert( - PortId(775), - Port { - id: PortId(775), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(776), - Port { - id: PortId(776), - state: PortState::Uninferred, - produced_by: Some(NodeId(660)), - }, - ); - ports.insert( - PortId(777), - Port { - id: PortId(777), - state: PortState::Uninferred, - produced_by: Some(NodeId(661)), - }, - ); - ports.insert( - PortId(778), - Port { - id: PortId(778), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(779), - Port { - id: PortId(779), - state: PortState::Uninferred, - produced_by: Some(NodeId(662)), - }, - ); - ports.insert( - PortId(780), - Port { - id: PortId(780), - state: PortState::Uninferred, - produced_by: Some(NodeId(663)), - }, - ); - ports.insert( - PortId(781), - Port { - id: PortId(781), - state: PortState::Uninferred, - produced_by: Some(NodeId(664)), - }, - ); - ports.insert( - PortId(782), - Port { - id: PortId(782), - state: PortState::Uninferred, - produced_by: Some(NodeId(665)), - }, - ); - ports.insert( - PortId(783), - Port { - id: PortId(783), - state: PortState::Uninferred, - produced_by: Some(NodeId(666)), - }, - ); - ports.insert( - PortId(784), - Port { - id: PortId(784), - state: PortState::Uninferred, - produced_by: Some(NodeId(667)), - }, - ); - ports.insert( - PortId(785), - Port { - id: PortId(785), - state: PortState::Uninferred, - produced_by: Some(NodeId(668)), - }, - ); - ports.insert( - PortId(786), - Port { - id: PortId(786), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: Some(NodeId(669)), - }, - ); - ports.insert( - PortId(787), - Port { - id: PortId(787), - state: PortState::Resolved(TypeShape::new(DeclarationId(1183))), - produced_by: None, - }, - ); - ports.insert( - PortId(788), - Port { - id: PortId(788), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(789), - Port { - id: PortId(789), - state: PortState::Uninferred, - produced_by: Some(NodeId(671)), - }, - ); - ports.insert( - PortId(790), - Port { - id: PortId(790), - state: PortState::Uninferred, - produced_by: Some(NodeId(672)), - }, - ); - ports.insert( - PortId(791), - Port { - id: PortId(791), - state: PortState::Uninferred, - produced_by: Some(NodeId(673)), - }, - ); - ports.insert( - PortId(792), - Port { - id: PortId(792), - state: PortState::Uninferred, - produced_by: Some(NodeId(674)), - }, - ); - ports.insert( - PortId(793), - Port { - id: PortId(793), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(794), - Port { - id: PortId(794), - state: PortState::Uninferred, - produced_by: Some(NodeId(675)), - }, - ); - ports.insert( - PortId(795), - Port { - id: PortId(795), - state: PortState::Uninferred, - produced_by: Some(NodeId(676)), - }, - ); - ports.insert( - PortId(796), - Port { - id: PortId(796), - state: PortState::Uninferred, - produced_by: Some(NodeId(677)), - }, - ); - ports.insert( - PortId(797), - Port { - id: PortId(797), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: Some(NodeId(678)), - }, - ); - ports.insert( - PortId(798), - Port { - id: PortId(798), - state: PortState::Resolved(TypeShape::new(DeclarationId(2093))), - produced_by: None, - }, - ); - ports.insert( - PortId(799), - Port { - id: PortId(799), - state: PortState::Resolved(TypeShape::new(DeclarationId(919))), - produced_by: Some(NodeId(680)), - }, - ); - ports.insert( - PortId(800), - Port { - id: PortId(800), - state: PortState::Resolved(TypeShape::new(DeclarationId(839))), - produced_by: None, - }, - ); - ports.insert( - PortId(801), - Port { - id: PortId(801), - state: PortState::Resolved(TypeShape::new(DeclarationId(2220))), - produced_by: Some(NodeId(682)), - }, - ); - ports.insert( - PortId(802), - Port { - id: PortId(802), - state: PortState::Resolved(TypeShape::new(DeclarationId(154))), - produced_by: Some(NodeId(684)), - }, - ); - ports.insert( - PortId(803), - Port { - id: PortId(803), - state: PortState::Resolved(TypeShape::new(DeclarationId(735))), - produced_by: None, - }, - ); - ports.insert( - PortId(804), - Port { - id: PortId(804), - state: PortState::Resolved(TypeShape::new(DeclarationId(170))), - produced_by: None, - }, - ); - ports.insert( - PortId(805), - Port { - id: PortId(805), - state: PortState::Resolved(TypeShape::new(DeclarationId(171))), - produced_by: None, - }, - ); - ports.insert( - PortId(806), - Port { - id: PortId(806), - state: PortState::Resolved(TypeShape::new(DeclarationId(174))), - produced_by: None, - }, - ); - ports.insert( - PortId(807), - Port { - id: PortId(807), - state: PortState::Resolved(TypeShape::new(DeclarationId(1233))), - produced_by: None, - }, - ); - ports.insert( - PortId(808), - Port { - id: PortId(808), - state: PortState::Resolved(TypeShape::new(DeclarationId(1236))), - produced_by: Some(NodeId(686)), - }, - ); - ports.insert( - PortId(809), - Port { - id: PortId(809), - state: PortState::Resolved(TypeShape::new(DeclarationId(1234))), - produced_by: Some(NodeId(688)), - }, - ); - ports.insert( - PortId(810), - Port { - id: PortId(810), - state: PortState::Resolved(TypeShape::new(DeclarationId(1234))), - produced_by: None, - }, - ); - ports.insert( - PortId(811), - Port { - id: PortId(811), - state: PortState::Resolved(TypeShape::new(DeclarationId(1234))), - produced_by: None, - }, - ); - ports.insert( - PortId(812), - Port { - id: PortId(812), - state: PortState::Resolved(TypeShape::new(DeclarationId(124))), - produced_by: None, - }, - ); - ports.insert( - PortId(813), - Port { - id: PortId(813), - state: PortState::Uninferred, - produced_by: Some(NodeId(690)), - }, - ); - ports.insert( - PortId(814), - Port { - id: PortId(814), - state: PortState::Uninferred, - produced_by: Some(NodeId(691)), - }, - ); - ports.insert( - PortId(815), - Port { - id: PortId(815), - state: PortState::Uninferred, - produced_by: Some(NodeId(692)), - }, - ); - ports.insert( - PortId(816), - Port { - id: PortId(816), - state: PortState::Uninferred, - produced_by: Some(NodeId(693)), - }, - ); - ports.insert( - PortId(817), - Port { - id: PortId(817), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(818), - Port { - id: PortId(818), - state: PortState::Uninferred, - produced_by: Some(NodeId(694)), - }, - ); - ports.insert( - PortId(819), - Port { - id: PortId(819), - state: PortState::Uninferred, - produced_by: Some(NodeId(695)), - }, - ); - ports.insert( - PortId(820), - Port { - id: PortId(820), - state: PortState::Uninferred, - produced_by: Some(NodeId(696)), - }, - ); - ports.insert( - PortId(821), - Port { - id: PortId(821), - state: PortState::Uninferred, - produced_by: Some(NodeId(697)), - }, - ); - ports.insert( - PortId(822), - Port { - id: PortId(822), - state: PortState::Uninferred, - produced_by: Some(NodeId(698)), - }, - ); - ports.insert( - PortId(823), - Port { - id: PortId(823), - state: PortState::Uninferred, - produced_by: Some(NodeId(699)), - }, - ); - ports.insert( - PortId(824), - Port { - id: PortId(824), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(825), - Port { - id: PortId(825), - state: PortState::Uninferred, - produced_by: Some(NodeId(700)), - }, - ); - ports.insert( - PortId(826), - Port { - id: PortId(826), - state: PortState::Uninferred, - produced_by: Some(NodeId(701)), - }, - ); - ports.insert( - PortId(827), - Port { - id: PortId(827), - state: PortState::Uninferred, - produced_by: Some(NodeId(702)), - }, - ); - ports.insert( - PortId(828), - Port { - id: PortId(828), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(829), - Port { - id: PortId(829), - state: PortState::Uninferred, - produced_by: Some(NodeId(703)), - }, - ); - ports.insert( - PortId(830), - Port { - id: PortId(830), - state: PortState::Uninferred, - produced_by: Some(NodeId(704)), - }, - ); - ports.insert( - PortId(831), - Port { - id: PortId(831), - state: PortState::Uninferred, - produced_by: Some(NodeId(705)), - }, - ); - ports.insert( - PortId(832), - Port { - id: PortId(832), - state: PortState::Uninferred, - produced_by: Some(NodeId(706)), - }, - ); - ports.insert( - PortId(833), - Port { - id: PortId(833), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(834), - Port { - id: PortId(834), - state: PortState::Uninferred, - produced_by: Some(NodeId(707)), - }, - ); - ports.insert( - PortId(835), - Port { - id: PortId(835), - state: PortState::Uninferred, - produced_by: Some(NodeId(708)), - }, - ); - ports.insert( - PortId(836), - Port { - id: PortId(836), - state: PortState::Uninferred, - produced_by: Some(NodeId(709)), - }, - ); - ports.insert( - PortId(837), - Port { - id: PortId(837), - state: PortState::Uninferred, - produced_by: Some(NodeId(710)), - }, - ); - ports.insert( - PortId(838), - Port { - id: PortId(838), - state: PortState::Uninferred, - produced_by: Some(NodeId(711)), - }, - ); - ports.insert( - PortId(839), - Port { - id: PortId(839), - state: PortState::Uninferred, - produced_by: Some(NodeId(712)), - }, - ); - ports.insert( - PortId(840), - Port { - id: PortId(840), - state: PortState::Uninferred, - produced_by: Some(NodeId(713)), - }, - ); - ports.insert( - PortId(841), - Port { - id: PortId(841), - state: PortState::Uninferred, - produced_by: Some(NodeId(714)), - }, - ); - ports.insert( - PortId(842), - Port { - id: PortId(842), - state: PortState::Uninferred, - produced_by: Some(NodeId(715)), - }, - ); - ports.insert( - PortId(843), - Port { - id: PortId(843), - state: PortState::Uninferred, - produced_by: Some(NodeId(716)), - }, - ); - ports.insert( - PortId(844), - Port { - id: PortId(844), - state: PortState::Uninferred, - produced_by: Some(NodeId(717)), - }, - ); - ports.insert( - PortId(845), - Port { - id: PortId(845), - state: PortState::Uninferred, - produced_by: Some(NodeId(718)), - }, - ); - ports.insert( - PortId(846), - Port { - id: PortId(846), - state: PortState::Uninferred, - produced_by: Some(NodeId(719)), - }, - ); - ports.insert( - PortId(847), - Port { - id: PortId(847), - state: PortState::Resolved(TypeShape::new(DeclarationId(1234))), - produced_by: Some(NodeId(720)), - }, - ); - ports.insert( - PortId(848), - Port { - id: PortId(848), - state: PortState::Resolved(TypeShape::new(DeclarationId(1234))), - produced_by: None, - }, - ); - ports.insert( - PortId(849), - Port { - id: PortId(849), - state: PortState::Resolved(TypeShape::new(DeclarationId(1234))), - produced_by: None, - }, - ); - ports.insert( - PortId(850), - Port { - id: PortId(850), - state: PortState::Uninferred, - produced_by: Some(NodeId(722)), - }, - ); - ports.insert( - PortId(851), - Port { - id: PortId(851), - state: PortState::Resolved(TypeShape::new(DeclarationId(1234))), - produced_by: Some(NodeId(723)), - }, - ); - ports.insert( - PortId(852), - Port { - id: PortId(852), - state: PortState::Uninferred, - produced_by: Some(NodeId(725)), - }, - ); - ports.insert( - PortId(853), - Port { - id: PortId(853), - state: PortState::Resolved(TypeShape::new(DeclarationId(1233))), - produced_by: Some(NodeId(726)), - }, - ); - ports.insert( - PortId(854), - Port { - id: PortId(854), - state: PortState::Uninferred, - produced_by: Some(NodeId(728)), - }, - ); - ports.insert( - PortId(855), - Port { - id: PortId(855), - state: PortState::Resolved(TypeShape::new(DeclarationId(1234))), - produced_by: Some(NodeId(729)), - }, - ); - ports.insert( - PortId(856), - Port { - id: PortId(856), - state: PortState::Resolved(TypeShape::new(DeclarationId(1234))), - produced_by: None, - }, - ); - ports.insert( - PortId(857), - Port { - id: PortId(857), - state: PortState::Resolved(TypeShape::new(DeclarationId(1234))), - produced_by: None, - }, - ); - ports.insert( - PortId(858), - Port { - id: PortId(858), - state: PortState::Uninferred, - produced_by: Some(NodeId(731)), - }, - ); - ports.insert( - PortId(859), - Port { - id: PortId(859), - state: PortState::Resolved(TypeShape::new(DeclarationId(1234))), - produced_by: Some(NodeId(732)), - }, - ); - ports.insert( - PortId(860), - Port { - id: PortId(860), - state: PortState::Uninferred, - produced_by: Some(NodeId(734)), - }, - ); - ports.insert( - PortId(861), - Port { - id: PortId(861), - state: PortState::Uninferred, - produced_by: Some(NodeId(735)), - }, - ); - ports.insert( - PortId(862), - Port { - id: PortId(862), - state: PortState::Resolved(TypeShape::new(DeclarationId(1050))), - produced_by: Some(NodeId(736)), - }, - ); - ports.insert( - PortId(863), - Port { - id: PortId(863), - state: PortState::Uninferred, - produced_by: Some(NodeId(738)), - }, - ); - ports.insert( - PortId(864), - Port { - id: PortId(864), - state: PortState::Uninferred, - produced_by: Some(NodeId(739)), - }, - ); - ports.insert( - PortId(865), - Port { - id: PortId(865), - state: PortState::Resolved(TypeShape::new(DeclarationId(1051))), - produced_by: Some(NodeId(740)), - }, - ); - ports.insert( - PortId(866), - Port { - id: PortId(866), - state: PortState::Resolved(TypeShape::new(DeclarationId(838))), - produced_by: None, - }, - ); - ports.insert( - PortId(867), - Port { - id: PortId(867), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(868), - Port { - id: PortId(868), - state: PortState::Uninferred, - produced_by: Some(NodeId(742)), - }, - ); - ports.insert( - PortId(869), - Port { - id: PortId(869), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(870), - Port { - id: PortId(870), - state: PortState::Uninferred, - produced_by: Some(NodeId(743)), - }, - ); - ports.insert( - PortId(871), - Port { - id: PortId(871), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(872), - Port { - id: PortId(872), - state: PortState::Uninferred, - produced_by: Some(NodeId(744)), - }, - ); - ports.insert( - PortId(873), - Port { - id: PortId(873), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(874), - Port { - id: PortId(874), - state: PortState::Uninferred, - produced_by: Some(NodeId(745)), - }, - ); - ports.insert( - PortId(875), - Port { - id: PortId(875), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(876), - Port { - id: PortId(876), - state: PortState::Uninferred, - produced_by: Some(NodeId(746)), - }, - ); - ports.insert( - PortId(877), - Port { - id: PortId(877), - state: PortState::Resolved(TypeShape::new(DeclarationId(155))), - produced_by: Some(NodeId(747)), - }, - ); - ports.insert( - PortId(878), - Port { - id: PortId(878), - state: PortState::Resolved(TypeShape::new(DeclarationId(227))), - produced_by: None, - }, - ); - ports.insert( - PortId(879), - Port { - id: PortId(879), - state: PortState::Resolved(TypeShape::new(DeclarationId(155))), - produced_by: None, - }, - ); - ports.insert( - PortId(880), - Port { - id: PortId(880), - state: PortState::Uninferred, - produced_by: Some(NodeId(749)), - }, - ); - ports.insert( - PortId(881), - Port { - id: PortId(881), - state: PortState::Uninferred, - produced_by: Some(NodeId(750)), - }, - ); - ports.insert( - PortId(882), - Port { - id: PortId(882), - state: PortState::Uninferred, - produced_by: Some(NodeId(751)), - }, - ); - ports.insert( - PortId(883), - Port { - id: PortId(883), - state: PortState::Resolved(TypeShape::new(DeclarationId(1055))), - produced_by: Some(NodeId(752)), - }, - ); - ports.insert( - PortId(884), - Port { - id: PortId(884), - state: PortState::Uninferred, - produced_by: Some(NodeId(754)), - }, - ); - ports.insert( - PortId(885), - Port { - id: PortId(885), - state: PortState::Uninferred, - produced_by: Some(NodeId(755)), - }, - ); - ports.insert( - PortId(886), - Port { - id: PortId(886), - state: PortState::Uninferred, - produced_by: Some(NodeId(756)), - }, - ); - ports.insert( - PortId(887), - Port { - id: PortId(887), - state: PortState::Resolved(TypeShape::new(DeclarationId(155))), - produced_by: Some(NodeId(757)), - }, - ); - ports.insert( - PortId(888), - Port { - id: PortId(888), - state: PortState::Resolved(TypeShape::new(DeclarationId(839))), - produced_by: None, - }, - ); - ports.insert( - PortId(889), - Port { - id: PortId(889), - state: PortState::Resolved(TypeShape::new(DeclarationId(227))), - produced_by: None, - }, - ); - ports.insert( - PortId(890), - Port { - id: PortId(890), - state: PortState::Uninferred, - produced_by: Some(NodeId(759)), - }, - ); - ports.insert( - PortId(891), - Port { - id: PortId(891), - state: PortState::Resolved(TypeShape::new(DeclarationId(1651))), - produced_by: Some(NodeId(760)), - }, - ); - ports.insert( - PortId(892), - Port { - id: PortId(892), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(893), - Port { - id: PortId(893), - state: PortState::Uninferred, - produced_by: Some(NodeId(761)), - }, - ); - ports.insert( - PortId(894), - Port { - id: PortId(894), - state: PortState::Uninferred, - produced_by: Some(NodeId(762)), - }, - ); - ports.insert( - PortId(895), - Port { - id: PortId(895), - state: PortState::Uninferred, - produced_by: Some(NodeId(763)), - }, - ); - ports.insert( - PortId(896), - Port { - id: PortId(896), - state: PortState::Uninferred, - produced_by: Some(NodeId(764)), - }, - ); - ports.insert( - PortId(897), - Port { - id: PortId(897), - state: PortState::Uninferred, - produced_by: Some(NodeId(765)), - }, - ); - ports.insert( - PortId(898), - Port { - id: PortId(898), - state: PortState::Uninferred, - produced_by: Some(NodeId(766)), - }, - ); - ports.insert( - PortId(899), - Port { - id: PortId(899), - state: PortState::Uninferred, - produced_by: Some(NodeId(767)), - }, - ); - ports.insert( - PortId(900), - Port { - id: PortId(900), - state: PortState::Uninferred, - produced_by: Some(NodeId(768)), - }, - ); - ports.insert( - PortId(901), - Port { - id: PortId(901), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(902), - Port { - id: PortId(902), - state: PortState::Uninferred, - produced_by: Some(NodeId(769)), - }, - ); - ports.insert( - PortId(903), - Port { - id: PortId(903), - state: PortState::Uninferred, - produced_by: Some(NodeId(770)), - }, - ); - ports.insert( - PortId(904), - Port { - id: PortId(904), - state: PortState::Uninferred, - produced_by: Some(NodeId(771)), - }, - ); - ports.insert( - PortId(905), - Port { - id: PortId(905), - state: PortState::Uninferred, - produced_by: Some(NodeId(772)), - }, - ); - ports.insert( - PortId(906), - Port { - id: PortId(906), - state: PortState::Resolved(TypeShape::new(DeclarationId(1060))), - produced_by: Some(NodeId(773)), - }, - ); - ports.insert( - PortId(907), - Port { - id: PortId(907), - state: PortState::Resolved(TypeShape::new(DeclarationId(1234))), - produced_by: None, - }, - ); - ports.insert( - PortId(908), - Port { - id: PortId(908), - state: PortState::Resolved(TypeShape::new(DeclarationId(829))), - produced_by: None, - }, - ); - ports.insert( - PortId(909), - Port { - id: PortId(909), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(910), - Port { - id: PortId(910), - state: PortState::Uninferred, - produced_by: Some(NodeId(775)), - }, - ); - ports.insert( - PortId(911), - Port { - id: PortId(911), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(912), - Port { - id: PortId(912), - state: PortState::Uninferred, - produced_by: Some(NodeId(776)), - }, - ); - ports.insert( - PortId(913), - Port { - id: PortId(913), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(914), - Port { - id: PortId(914), - state: PortState::Uninferred, - produced_by: Some(NodeId(777)), - }, - ); - ports.insert( - PortId(915), - Port { - id: PortId(915), - state: PortState::Uninferred, - produced_by: Some(NodeId(778)), - }, - ); - ports.insert( - PortId(916), - Port { - id: PortId(916), - state: PortState::Uninferred, - produced_by: Some(NodeId(779)), - }, - ); - ports.insert( - PortId(917), - Port { - id: PortId(917), - state: PortState::Uninferred, - produced_by: Some(NodeId(780)), - }, - ); - ports.insert( - PortId(918), - Port { - id: PortId(918), - state: PortState::Uninferred, - produced_by: Some(NodeId(781)), - }, - ); - ports.insert( - PortId(919), - Port { - id: PortId(919), - state: PortState::Resolved(TypeShape::new(DeclarationId(1234))), - produced_by: Some(NodeId(782)), - }, - ); - ports.insert( - PortId(920), - Port { - id: PortId(920), - state: PortState::Resolved(TypeShape::new(DeclarationId(839))), - produced_by: None, - }, - ); - ports.insert( - PortId(921), - Port { - id: PortId(921), - state: PortState::Resolved(TypeShape::new(DeclarationId(838))), - produced_by: None, - }, - ); - ports.insert( - PortId(922), - Port { - id: PortId(922), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(923), - Port { - id: PortId(923), - state: PortState::Uninferred, - produced_by: Some(NodeId(784)), - }, - ); - ports.insert( - PortId(924), - Port { - id: PortId(924), - state: PortState::Uninferred, - produced_by: Some(NodeId(785)), - }, - ); - ports.insert( - PortId(925), - Port { - id: PortId(925), - state: PortState::Uninferred, - produced_by: Some(NodeId(786)), - }, - ); - ports.insert( - PortId(926), - Port { - id: PortId(926), - state: PortState::Uninferred, - produced_by: Some(NodeId(787)), - }, - ); - ports.insert( - PortId(927), - Port { - id: PortId(927), - state: PortState::Uninferred, - produced_by: Some(NodeId(788)), - }, - ); - ports.insert( - PortId(928), - Port { - id: PortId(928), - state: PortState::Uninferred, - produced_by: Some(NodeId(789)), - }, - ); - ports.insert( - PortId(929), - Port { - id: PortId(929), - state: PortState::Uninferred, - produced_by: Some(NodeId(790)), - }, - ); - ports.insert( - PortId(930), - Port { - id: PortId(930), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(931), - Port { - id: PortId(931), - state: PortState::Uninferred, - produced_by: Some(NodeId(791)), - }, - ); - ports.insert( - PortId(932), - Port { - id: PortId(932), - state: PortState::Uninferred, - produced_by: Some(NodeId(792)), - }, - ); - ports.insert( - PortId(933), - Port { - id: PortId(933), - state: PortState::Uninferred, - produced_by: Some(NodeId(793)), - }, - ); - ports.insert( - PortId(934), - Port { - id: PortId(934), - state: PortState::Uninferred, - produced_by: Some(NodeId(794)), - }, - ); - ports.insert( - PortId(935), - Port { - id: PortId(935), - state: PortState::Uninferred, - produced_by: Some(NodeId(795)), - }, - ); - ports.insert( - PortId(936), - Port { - id: PortId(936), - state: PortState::Uninferred, - produced_by: Some(NodeId(796)), - }, - ); - ports.insert( - PortId(937), - Port { - id: PortId(937), - state: PortState::Uninferred, - produced_by: Some(NodeId(797)), - }, - ); - ports.insert( - PortId(938), - Port { - id: PortId(938), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(939), - Port { - id: PortId(939), - state: PortState::Uninferred, - produced_by: Some(NodeId(798)), - }, - ); - ports.insert( - PortId(940), - Port { - id: PortId(940), - state: PortState::Uninferred, - produced_by: Some(NodeId(799)), - }, - ); - ports.insert( - PortId(941), - Port { - id: PortId(941), - state: PortState::Uninferred, - produced_by: Some(NodeId(800)), - }, - ); - ports.insert( - PortId(942), - Port { - id: PortId(942), - state: PortState::Uninferred, - produced_by: Some(NodeId(801)), - }, - ); - ports.insert( - PortId(943), - Port { - id: PortId(943), - state: PortState::Uninferred, - produced_by: Some(NodeId(802)), - }, - ); - ports.insert( - PortId(944), - Port { - id: PortId(944), - state: PortState::Uninferred, - produced_by: Some(NodeId(803)), - }, - ); - ports.insert( - PortId(945), - Port { - id: PortId(945), - state: PortState::Uninferred, - produced_by: Some(NodeId(804)), - }, - ); - ports.insert( - PortId(946), - Port { - id: PortId(946), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(947), - Port { - id: PortId(947), - state: PortState::Uninferred, - produced_by: Some(NodeId(805)), - }, - ); - ports.insert( - PortId(948), - Port { - id: PortId(948), - state: PortState::Uninferred, - produced_by: Some(NodeId(806)), - }, - ); - ports.insert( - PortId(949), - Port { - id: PortId(949), - state: PortState::Uninferred, - produced_by: Some(NodeId(807)), - }, - ); - ports.insert( - PortId(950), - Port { - id: PortId(950), - state: PortState::Uninferred, - produced_by: Some(NodeId(808)), - }, - ); - ports.insert( - PortId(951), - Port { - id: PortId(951), - state: PortState::Uninferred, - produced_by: Some(NodeId(809)), - }, - ); - ports.insert( - PortId(952), - Port { - id: PortId(952), - state: PortState::Uninferred, - produced_by: Some(NodeId(810)), - }, - ); - ports.insert( - PortId(953), - Port { - id: PortId(953), - state: PortState::Uninferred, - produced_by: Some(NodeId(811)), - }, - ); - ports.insert( - PortId(954), - Port { - id: PortId(954), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(955), - Port { - id: PortId(955), - state: PortState::Uninferred, - produced_by: Some(NodeId(812)), - }, - ); - ports.insert( - PortId(956), - Port { - id: PortId(956), - state: PortState::Uninferred, - produced_by: Some(NodeId(813)), - }, - ); - ports.insert( - PortId(957), - Port { - id: PortId(957), - state: PortState::Uninferred, - produced_by: Some(NodeId(814)), - }, - ); - ports.insert( - PortId(958), - Port { - id: PortId(958), - state: PortState::Uninferred, - produced_by: Some(NodeId(815)), - }, - ); - ports.insert( - PortId(959), - Port { - id: PortId(959), - state: PortState::Uninferred, - produced_by: Some(NodeId(816)), - }, - ); - ports.insert( - PortId(960), - Port { - id: PortId(960), - state: PortState::Uninferred, - produced_by: Some(NodeId(817)), - }, - ); - ports.insert( - PortId(961), - Port { - id: PortId(961), - state: PortState::Uninferred, - produced_by: Some(NodeId(818)), - }, - ); - ports.insert( - PortId(962), - Port { - id: PortId(962), - state: PortState::Resolved(TypeShape::new(DeclarationId(2221))), - produced_by: Some(NodeId(819)), - }, - ); - ports.insert( - PortId(963), - Port { - id: PortId(963), - state: PortState::Resolved(TypeShape::new(DeclarationId(839))), - produced_by: None, - }, - ); - ports.insert( - PortId(964), - Port { - id: PortId(964), - state: PortState::Resolved(TypeShape::new(DeclarationId(1234))), - produced_by: None, - }, - ); - ports.insert( - PortId(965), - Port { - id: PortId(965), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(966), - Port { - id: PortId(966), - state: PortState::Uninferred, - produced_by: Some(NodeId(821)), - }, - ); - ports.insert( - PortId(967), - Port { - id: PortId(967), - state: PortState::Uninferred, - produced_by: Some(NodeId(822)), - }, - ); - ports.insert( - PortId(968), - Port { - id: PortId(968), - state: PortState::Uninferred, - produced_by: Some(NodeId(823)), - }, - ); - ports.insert( - PortId(969), - Port { - id: PortId(969), - state: PortState::Uninferred, - produced_by: Some(NodeId(824)), - }, - ); - ports.insert( - PortId(970), - Port { - id: PortId(970), - state: PortState::Uninferred, - produced_by: Some(NodeId(825)), - }, - ); - ports.insert( - PortId(971), - Port { - id: PortId(971), - state: PortState::Uninferred, - produced_by: Some(NodeId(826)), - }, - ); - ports.insert( - PortId(972), - Port { - id: PortId(972), - state: PortState::Uninferred, - produced_by: Some(NodeId(827)), - }, - ); - ports.insert( - PortId(973), - Port { - id: PortId(973), - state: PortState::Uninferred, - produced_by: Some(NodeId(828)), - }, - ); - ports.insert( - PortId(974), - Port { - id: PortId(974), - state: PortState::Uninferred, - produced_by: Some(NodeId(829)), - }, - ); - ports.insert( - PortId(975), - Port { - id: PortId(975), - state: PortState::Uninferred, - produced_by: Some(NodeId(830)), - }, - ); - ports.insert( - PortId(976), - Port { - id: PortId(976), - state: PortState::Uninferred, - produced_by: Some(NodeId(831)), - }, - ); - ports.insert( - PortId(977), - Port { - id: PortId(977), - state: PortState::Uninferred, - produced_by: Some(NodeId(832)), - }, - ); - ports.insert( - PortId(978), - Port { - id: PortId(978), - state: PortState::Resolved(TypeShape::new(DeclarationId(1060))), - produced_by: Some(NodeId(833)), - }, - ); - ports.insert( - PortId(979), - Port { - id: PortId(979), - state: PortState::Resolved(TypeShape::new(DeclarationId(76))), - produced_by: Some(NodeId(835)), - }, - ); - ports.insert( - PortId(980), - Port { - id: PortId(980), - state: PortState::Resolved(TypeShape::new(DeclarationId(1234))), - produced_by: None, - }, - ); - ports.insert( - PortId(981), - Port { - id: PortId(981), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(982), - Port { - id: PortId(982), - state: PortState::Uninferred, - produced_by: Some(NodeId(837)), - }, - ); - ports.insert( - PortId(983), - Port { - id: PortId(983), - state: PortState::Uninferred, - produced_by: Some(NodeId(838)), - }, - ); - ports.insert( - PortId(984), - Port { - id: PortId(984), - state: PortState::Uninferred, - produced_by: Some(NodeId(839)), - }, - ); - ports.insert( - PortId(985), - Port { - id: PortId(985), - state: PortState::Uninferred, - produced_by: Some(NodeId(840)), - }, - ); - ports.insert( - PortId(986), - Port { - id: PortId(986), - state: PortState::Uninferred, - produced_by: Some(NodeId(841)), - }, - ); - ports.insert( - PortId(987), - Port { - id: PortId(987), - state: PortState::Resolved(TypeShape::new(DeclarationId(1241))), - produced_by: Some(NodeId(842)), - }, - ); - ports.insert( - PortId(988), - Port { - id: PortId(988), - state: PortState::Resolved(TypeShape::new(DeclarationId(1234))), - produced_by: None, - }, - ); - ports.insert( - PortId(989), - Port { - id: PortId(989), - state: PortState::Resolved(TypeShape::new(DeclarationId(1240))), - produced_by: None, - }, - ); - ports.insert( - PortId(990), - Port { - id: PortId(990), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(991), - Port { - id: PortId(991), - state: PortState::Uninferred, - produced_by: Some(NodeId(844)), - }, - ); - ports.insert( - PortId(992), - Port { - id: PortId(992), - state: PortState::Uninferred, - produced_by: Some(NodeId(845)), - }, - ); - ports.insert( - PortId(993), - Port { - id: PortId(993), - state: PortState::Resolved(TypeShape::new(DeclarationId(1233))), - produced_by: Some(NodeId(846)), - }, - ); - ports.insert( - PortId(994), - Port { - id: PortId(994), - state: PortState::Resolved(TypeShape::new(DeclarationId(76))), - produced_by: Some(NodeId(847)), - }, - ); - ports.insert( - PortId(995), - Port { - id: PortId(995), - state: PortState::Uninferred, - produced_by: Some(NodeId(848)), - }, - ); - ports.insert( - PortId(996), - Port { - id: PortId(996), - state: PortState::Uninferred, - produced_by: Some(NodeId(849)), - }, - ); - ports.insert( - PortId(997), - Port { - id: PortId(997), - state: PortState::Uninferred, - produced_by: Some(NodeId(850)), - }, - ); - ports.insert( - PortId(998), - Port { - id: PortId(998), - state: PortState::Uninferred, - produced_by: Some(NodeId(851)), - }, - ); - ports.insert( - PortId(999), - Port { - id: PortId(999), - state: PortState::Uninferred, - produced_by: Some(NodeId(852)), - }, - ); - ports.insert( - PortId(1000), - Port { - id: PortId(1000), - state: PortState::Uninferred, - produced_by: Some(NodeId(853)), - }, - ); - ports.insert( - PortId(1001), - Port { - id: PortId(1001), - state: PortState::Uninferred, - produced_by: Some(NodeId(854)), - }, - ); - ports.insert( - PortId(1002), - Port { - id: PortId(1002), - state: PortState::Uninferred, - produced_by: Some(NodeId(855)), - }, - ); - ports.insert( - PortId(1003), - Port { - id: PortId(1003), - state: PortState::Uninferred, - produced_by: Some(NodeId(856)), - }, - ); - ports.insert( - PortId(1004), - Port { - id: PortId(1004), - state: PortState::Uninferred, - produced_by: Some(NodeId(857)), - }, - ); - ports.insert( - PortId(1005), - Port { - id: PortId(1005), - state: PortState::Uninferred, - produced_by: Some(NodeId(858)), - }, - ); - ports.insert( - PortId(1006), - Port { - id: PortId(1006), - state: PortState::Uninferred, - produced_by: Some(NodeId(859)), - }, - ); - ports.insert( - PortId(1007), - Port { - id: PortId(1007), - state: PortState::Uninferred, - produced_by: Some(NodeId(860)), - }, - ); - ports.insert( - PortId(1008), - Port { - id: PortId(1008), - state: PortState::Uninferred, - produced_by: Some(NodeId(861)), - }, - ); - ports.insert( - PortId(1009), - Port { - id: PortId(1009), - state: PortState::Uninferred, - produced_by: Some(NodeId(862)), - }, - ); - ports.insert( - PortId(1010), - Port { - id: PortId(1010), - state: PortState::Uninferred, - produced_by: Some(NodeId(863)), - }, - ); - ports.insert( - PortId(1011), - Port { - id: PortId(1011), - state: PortState::Uninferred, - produced_by: Some(NodeId(864)), - }, - ); - ports.insert( - PortId(1012), - Port { - id: PortId(1012), - state: PortState::Resolved(TypeShape::new(DeclarationId(124))), - produced_by: Some(NodeId(865)), - }, - ); - ports.insert( - PortId(1013), - Port { - id: PortId(1013), - state: PortState::Resolved(TypeShape::new(DeclarationId(839))), - produced_by: None, - }, - ); - ports.insert( - PortId(1014), - Port { - id: PortId(1014), - state: PortState::Resolved(TypeShape::new(DeclarationId(838))), - produced_by: None, - }, - ); - ports.insert( - PortId(1015), - Port { - id: PortId(1015), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1016), - Port { - id: PortId(1016), - state: PortState::Uninferred, - produced_by: Some(NodeId(867)), - }, - ); - ports.insert( - PortId(1017), - Port { - id: PortId(1017), - state: PortState::Uninferred, - produced_by: Some(NodeId(868)), - }, - ); - ports.insert( - PortId(1018), - Port { - id: PortId(1018), - state: PortState::Uninferred, - produced_by: Some(NodeId(869)), - }, - ); - ports.insert( - PortId(1019), - Port { - id: PortId(1019), - state: PortState::Uninferred, - produced_by: Some(NodeId(870)), - }, - ); - ports.insert( - PortId(1020), - Port { - id: PortId(1020), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1021), - Port { - id: PortId(1021), - state: PortState::Uninferred, - produced_by: Some(NodeId(871)), - }, - ); - ports.insert( - PortId(1022), - Port { - id: PortId(1022), - state: PortState::Uninferred, - produced_by: Some(NodeId(872)), - }, - ); - ports.insert( - PortId(1023), - Port { - id: PortId(1023), - state: PortState::Uninferred, - produced_by: Some(NodeId(873)), - }, - ); - ports.insert( - PortId(1024), - Port { - id: PortId(1024), - state: PortState::Uninferred, - produced_by: Some(NodeId(874)), - }, - ); - ports.insert( - PortId(1025), - Port { - id: PortId(1025), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1026), - Port { - id: PortId(1026), - state: PortState::Uninferred, - produced_by: Some(NodeId(875)), - }, - ); - ports.insert( - PortId(1027), - Port { - id: PortId(1027), - state: PortState::Uninferred, - produced_by: Some(NodeId(876)), - }, - ); - ports.insert( - PortId(1028), - Port { - id: PortId(1028), - state: PortState::Uninferred, - produced_by: Some(NodeId(877)), - }, - ); - ports.insert( - PortId(1029), - Port { - id: PortId(1029), - state: PortState::Uninferred, - produced_by: Some(NodeId(878)), - }, - ); - ports.insert( - PortId(1030), - Port { - id: PortId(1030), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1031), - Port { - id: PortId(1031), - state: PortState::Uninferred, - produced_by: Some(NodeId(879)), - }, - ); - ports.insert( - PortId(1032), - Port { - id: PortId(1032), - state: PortState::Uninferred, - produced_by: Some(NodeId(880)), - }, - ); - ports.insert( - PortId(1033), - Port { - id: PortId(1033), - state: PortState::Uninferred, - produced_by: Some(NodeId(881)), - }, - ); - ports.insert( - PortId(1034), - Port { - id: PortId(1034), - state: PortState::Uninferred, - produced_by: Some(NodeId(882)), - }, - ); - ports.insert( - PortId(1035), - Port { - id: PortId(1035), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1036), - Port { - id: PortId(1036), - state: PortState::Uninferred, - produced_by: Some(NodeId(883)), - }, - ); - ports.insert( - PortId(1037), - Port { - id: PortId(1037), - state: PortState::Uninferred, - produced_by: Some(NodeId(884)), - }, - ); - ports.insert( - PortId(1038), - Port { - id: PortId(1038), - state: PortState::Uninferred, - produced_by: Some(NodeId(885)), - }, - ); - ports.insert( - PortId(1039), - Port { - id: PortId(1039), - state: PortState::Uninferred, - produced_by: Some(NodeId(886)), - }, - ); - ports.insert( - PortId(1040), - Port { - id: PortId(1040), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1041), - Port { - id: PortId(1041), - state: PortState::Uninferred, - produced_by: Some(NodeId(887)), - }, - ); - ports.insert( - PortId(1042), - Port { - id: PortId(1042), - state: PortState::Uninferred, - produced_by: Some(NodeId(888)), - }, - ); - ports.insert( - PortId(1043), - Port { - id: PortId(1043), - state: PortState::Uninferred, - produced_by: Some(NodeId(889)), - }, - ); - ports.insert( - PortId(1044), - Port { - id: PortId(1044), - state: PortState::Uninferred, - produced_by: Some(NodeId(890)), - }, - ); - ports.insert( - PortId(1045), - Port { - id: PortId(1045), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1046), - Port { - id: PortId(1046), - state: PortState::Uninferred, - produced_by: Some(NodeId(891)), - }, - ); - ports.insert( - PortId(1047), - Port { - id: PortId(1047), - state: PortState::Uninferred, - produced_by: Some(NodeId(892)), - }, - ); - ports.insert( - PortId(1048), - Port { - id: PortId(1048), - state: PortState::Uninferred, - produced_by: Some(NodeId(893)), - }, - ); - ports.insert( - PortId(1049), - Port { - id: PortId(1049), - state: PortState::Uninferred, - produced_by: Some(NodeId(894)), - }, - ); - ports.insert( - PortId(1050), - Port { - id: PortId(1050), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1051), - Port { - id: PortId(1051), - state: PortState::Uninferred, - produced_by: Some(NodeId(895)), - }, - ); - ports.insert( - PortId(1052), - Port { - id: PortId(1052), - state: PortState::Uninferred, - produced_by: Some(NodeId(896)), - }, - ); - ports.insert( - PortId(1053), - Port { - id: PortId(1053), - state: PortState::Uninferred, - produced_by: Some(NodeId(897)), - }, - ); - ports.insert( - PortId(1054), - Port { - id: PortId(1054), - state: PortState::Uninferred, - produced_by: Some(NodeId(898)), - }, - ); - ports.insert( - PortId(1055), - Port { - id: PortId(1055), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1056), - Port { - id: PortId(1056), - state: PortState::Uninferred, - produced_by: Some(NodeId(899)), - }, - ); - ports.insert( - PortId(1057), - Port { - id: PortId(1057), - state: PortState::Uninferred, - produced_by: Some(NodeId(900)), - }, - ); - ports.insert( - PortId(1058), - Port { - id: PortId(1058), - state: PortState::Uninferred, - produced_by: Some(NodeId(901)), - }, - ); - ports.insert( - PortId(1059), - Port { - id: PortId(1059), - state: PortState::Uninferred, - produced_by: Some(NodeId(902)), - }, - ); - ports.insert( - PortId(1060), - Port { - id: PortId(1060), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1061), - Port { - id: PortId(1061), - state: PortState::Uninferred, - produced_by: Some(NodeId(903)), - }, - ); - ports.insert( - PortId(1062), - Port { - id: PortId(1062), - state: PortState::Uninferred, - produced_by: Some(NodeId(904)), - }, - ); - ports.insert( - PortId(1063), - Port { - id: PortId(1063), - state: PortState::Uninferred, - produced_by: Some(NodeId(905)), - }, - ); - ports.insert( - PortId(1064), - Port { - id: PortId(1064), - state: PortState::Uninferred, - produced_by: Some(NodeId(906)), - }, - ); - ports.insert( - PortId(1065), - Port { - id: PortId(1065), - state: PortState::Resolved(TypeShape::new(DeclarationId(2242))), - produced_by: Some(NodeId(907)), - }, - ); - ports.insert( - PortId(1066), - Port { - id: PortId(1066), - state: PortState::Resolved(TypeShape::new(DeclarationId(839))), - produced_by: None, - }, - ); - ports.insert( - PortId(1067), - Port { - id: PortId(1067), - state: PortState::Resolved(TypeShape::new(DeclarationId(838))), - produced_by: None, - }, - ); - ports.insert( - PortId(1068), - Port { - id: PortId(1068), - state: PortState::Resolved(TypeShape::new(DeclarationId(2243))), - produced_by: Some(NodeId(909)), - }, - ); - ports.insert( - PortId(1069), - Port { - id: PortId(1069), - state: PortState::Resolved(TypeShape::new(DeclarationId(2244))), - produced_by: Some(NodeId(911)), - }, - ); - ports.insert( - PortId(1070), - Port { - id: PortId(1070), - state: PortState::Resolved(TypeShape::new(DeclarationId(2245))), - produced_by: Some(NodeId(913)), - }, - ); - ports.insert( - PortId(1071), - Port { - id: PortId(1071), - state: PortState::Resolved(TypeShape::new(DeclarationId(2246))), - produced_by: Some(NodeId(915)), - }, - ); - ports.insert( - PortId(1072), - Port { - id: PortId(1072), - state: PortState::Resolved(TypeShape::new(DeclarationId(2247))), - produced_by: Some(NodeId(917)), - }, - ); - ports.insert( - PortId(1073), - Port { - id: PortId(1073), - state: PortState::Resolved(TypeShape::new(DeclarationId(2248))), - produced_by: Some(NodeId(919)), - }, - ); - ports.insert( - PortId(1074), - Port { - id: PortId(1074), - state: PortState::Resolved(TypeShape::new(DeclarationId(2250))), - produced_by: Some(NodeId(921)), - }, - ); - ports.insert( - PortId(1075), - Port { - id: PortId(1075), - state: PortState::Resolved(TypeShape::new(DeclarationId(1234))), - produced_by: None, - }, - ); - ports.insert( - PortId(1076), - Port { - id: PortId(1076), - state: PortState::Uninferred, - produced_by: Some(NodeId(923)), - }, - ); - ports.insert( - PortId(1077), - Port { - id: PortId(1077), - state: PortState::Uninferred, - produced_by: Some(NodeId(924)), - }, - ); - ports.insert( - PortId(1078), - Port { - id: PortId(1078), - state: PortState::Resolved(TypeShape::new(DeclarationId(2252))), - produced_by: Some(NodeId(925)), - }, - ); - ports.insert( - PortId(1079), - Port { - id: PortId(1079), - state: PortState::Resolved(TypeShape::new(DeclarationId(1055))), - produced_by: None, - }, - ); - ports.insert( - PortId(1080), - Port { - id: PortId(1080), - state: PortState::Uninferred, - produced_by: Some(NodeId(927)), - }, - ); - ports.insert( - PortId(1081), - Port { - id: PortId(1081), - state: PortState::Resolved(TypeShape::new(DeclarationId(2253))), - produced_by: Some(NodeId(928)), - }, - ); - ports.insert( - PortId(1082), - Port { - id: PortId(1082), - state: PortState::Resolved(TypeShape::new(DeclarationId(1234))), - produced_by: None, - }, - ); - ports.insert( - PortId(1083), - Port { - id: PortId(1083), - state: PortState::Uninferred, - produced_by: Some(NodeId(930)), - }, - ); - ports.insert( - PortId(1084), - Port { - id: PortId(1084), - state: PortState::Uninferred, - produced_by: Some(NodeId(931)), - }, - ); - ports.insert( - PortId(1085), - Port { - id: PortId(1085), - state: PortState::Resolved(TypeShape::new(DeclarationId(2254))), - produced_by: Some(NodeId(932)), - }, - ); - ports.insert( - PortId(1086), - Port { - id: PortId(1086), - state: PortState::Resolved(TypeShape::new(DeclarationId(1234))), - produced_by: None, - }, - ); - ports.insert( - PortId(1087), - Port { - id: PortId(1087), - state: PortState::Resolved(TypeShape::new(DeclarationId(1055))), - produced_by: None, - }, - ); - ports.insert( - PortId(1088), - Port { - id: PortId(1088), - state: PortState::Uninferred, - produced_by: Some(NodeId(934)), - }, - ); - ports.insert( - PortId(1089), - Port { - id: PortId(1089), - state: PortState::Uninferred, - produced_by: Some(NodeId(935)), - }, - ); - ports.insert( - PortId(1090), - Port { - id: PortId(1090), - state: PortState::Uninferred, - produced_by: Some(NodeId(936)), - }, - ); - ports.insert( - PortId(1091), - Port { - id: PortId(1091), - state: PortState::Resolved(TypeShape::new(DeclarationId(2255))), - produced_by: Some(NodeId(937)), - }, - ); - ports.insert( - PortId(1092), - Port { - id: PortId(1092), - state: PortState::Resolved(TypeShape::new(DeclarationId(839))), - produced_by: None, - }, - ); - ports.insert( - PortId(1093), - Port { - id: PortId(1093), - state: PortState::Resolved(TypeShape::new(DeclarationId(1234))), - produced_by: None, - }, - ); - ports.insert( - PortId(1094), - Port { - id: PortId(1094), - state: PortState::Uninferred, - produced_by: Some(NodeId(939)), - }, - ); - ports.insert( - PortId(1095), - Port { - id: PortId(1095), - state: PortState::Uninferred, - produced_by: Some(NodeId(940)), - }, - ); - ports.insert( - PortId(1096), - Port { - id: PortId(1096), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1097), - Port { - id: PortId(1097), - state: PortState::Uninferred, - produced_by: Some(NodeId(941)), - }, - ); - ports.insert( - PortId(1098), - Port { - id: PortId(1098), - state: PortState::Uninferred, - produced_by: Some(NodeId(942)), - }, - ); - ports.insert( - PortId(1099), - Port { - id: PortId(1099), - state: PortState::Uninferred, - produced_by: Some(NodeId(943)), - }, - ); - ports.insert( - PortId(1100), - Port { - id: PortId(1100), - state: PortState::Resolved(TypeShape::new(DeclarationId(2256))), - produced_by: Some(NodeId(944)), - }, - ); - ports.insert( - PortId(1101), - Port { - id: PortId(1101), - state: PortState::Resolved(TypeShape::new(DeclarationId(839))), - produced_by: None, - }, - ); - ports.insert( - PortId(1102), - Port { - id: PortId(1102), - state: PortState::Resolved(TypeShape::new(DeclarationId(1234))), - produced_by: None, - }, - ); - ports.insert( - PortId(1103), - Port { - id: PortId(1103), - state: PortState::Resolved(TypeShape::new(DeclarationId(1055))), - produced_by: None, - }, - ); - ports.insert( - PortId(1104), - Port { - id: PortId(1104), - state: PortState::Uninferred, - produced_by: Some(NodeId(946)), - }, - ); - ports.insert( - PortId(1105), - Port { - id: PortId(1105), - state: PortState::Uninferred, - produced_by: Some(NodeId(947)), - }, - ); - ports.insert( - PortId(1106), - Port { - id: PortId(1106), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1107), - Port { - id: PortId(1107), - state: PortState::Uninferred, - produced_by: Some(NodeId(948)), - }, - ); - ports.insert( - PortId(1108), - Port { - id: PortId(1108), - state: PortState::Uninferred, - produced_by: Some(NodeId(949)), - }, - ); - ports.insert( - PortId(1109), - Port { - id: PortId(1109), - state: PortState::Uninferred, - produced_by: Some(NodeId(950)), - }, - ); - ports.insert( - PortId(1110), - Port { - id: PortId(1110), - state: PortState::Resolved(TypeShape::new(DeclarationId(2257))), - produced_by: Some(NodeId(951)), - }, - ); - ports.insert( - PortId(1111), - Port { - id: PortId(1111), - state: PortState::Resolved(TypeShape::new(DeclarationId(839))), - produced_by: None, - }, - ); - ports.insert( - PortId(1112), - Port { - id: PortId(1112), - state: PortState::Resolved(TypeShape::new(DeclarationId(1234))), - produced_by: None, - }, - ); - ports.insert( - PortId(1113), - Port { - id: PortId(1113), - state: PortState::Resolved(TypeShape::new(DeclarationId(1060))), - produced_by: None, - }, - ); - ports.insert( - PortId(1114), - Port { - id: PortId(1114), - state: PortState::Uninferred, - produced_by: Some(NodeId(953)), - }, - ); - ports.insert( - PortId(1115), - Port { - id: PortId(1115), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1116), - Port { - id: PortId(1116), - state: PortState::Uninferred, - produced_by: Some(NodeId(954)), - }, - ); - ports.insert( - PortId(1117), - Port { - id: PortId(1117), - state: PortState::Uninferred, - produced_by: Some(NodeId(955)), - }, - ); - ports.insert( - PortId(1118), - Port { - id: PortId(1118), - state: PortState::Resolved(TypeShape::new(DeclarationId(2258))), - produced_by: Some(NodeId(956)), - }, - ); - ports.insert( - PortId(1119), - Port { - id: PortId(1119), - state: PortState::Resolved(TypeShape::new(DeclarationId(839))), - produced_by: None, - }, - ); - ports.insert( - PortId(1120), - Port { - id: PortId(1120), - state: PortState::Resolved(TypeShape::new(DeclarationId(2259))), - produced_by: None, - }, - ); - ports.insert( - PortId(1121), - Port { - id: PortId(1121), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1122), - Port { - id: PortId(1122), - state: PortState::Uninferred, - produced_by: Some(NodeId(958)), - }, - ); - ports.insert( - PortId(1123), - Port { - id: PortId(1123), - state: PortState::Uninferred, - produced_by: Some(NodeId(959)), - }, - ); - ports.insert( - PortId(1124), - Port { - id: PortId(1124), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1125), - Port { - id: PortId(1125), - state: PortState::Uninferred, - produced_by: Some(NodeId(960)), - }, - ); - ports.insert( - PortId(1126), - Port { - id: PortId(1126), - state: PortState::Uninferred, - produced_by: Some(NodeId(961)), - }, - ); - ports.insert( - PortId(1127), - Port { - id: PortId(1127), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1128), - Port { - id: PortId(1128), - state: PortState::Uninferred, - produced_by: Some(NodeId(962)), - }, - ); - ports.insert( - PortId(1129), - Port { - id: PortId(1129), - state: PortState::Uninferred, - produced_by: Some(NodeId(963)), - }, - ); - ports.insert( - PortId(1130), - Port { - id: PortId(1130), - state: PortState::Uninferred, - produced_by: Some(NodeId(964)), - }, - ); - ports.insert( - PortId(1131), - Port { - id: PortId(1131), - state: PortState::Uninferred, - produced_by: Some(NodeId(965)), - }, - ); - ports.insert( - PortId(1132), - Port { - id: PortId(1132), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1133), - Port { - id: PortId(1133), - state: PortState::Uninferred, - produced_by: Some(NodeId(966)), - }, - ); - ports.insert( - PortId(1134), - Port { - id: PortId(1134), - state: PortState::Uninferred, - produced_by: Some(NodeId(967)), - }, - ); - ports.insert( - PortId(1135), - Port { - id: PortId(1135), - state: PortState::Uninferred, - produced_by: Some(NodeId(968)), - }, - ); - ports.insert( - PortId(1136), - Port { - id: PortId(1136), - state: PortState::Uninferred, - produced_by: Some(NodeId(969)), - }, - ); - ports.insert( - PortId(1137), - Port { - id: PortId(1137), - state: PortState::Uninferred, - produced_by: Some(NodeId(970)), - }, - ); - ports.insert( - PortId(1138), - Port { - id: PortId(1138), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1139), - Port { - id: PortId(1139), - state: PortState::Uninferred, - produced_by: Some(NodeId(971)), - }, - ); - ports.insert( - PortId(1140), - Port { - id: PortId(1140), - state: PortState::Uninferred, - produced_by: Some(NodeId(972)), - }, - ); - ports.insert( - PortId(1141), - Port { - id: PortId(1141), - state: PortState::Uninferred, - produced_by: Some(NodeId(973)), - }, - ); - ports.insert( - PortId(1142), - Port { - id: PortId(1142), - state: PortState::Uninferred, - produced_by: Some(NodeId(974)), - }, - ); - ports.insert( - PortId(1143), - Port { - id: PortId(1143), - state: PortState::Uninferred, - produced_by: Some(NodeId(975)), - }, - ); - ports.insert( - PortId(1144), - Port { - id: PortId(1144), - state: PortState::Uninferred, - produced_by: Some(NodeId(976)), - }, - ); - ports.insert( - PortId(1145), - Port { - id: PortId(1145), - state: PortState::Resolved(TypeShape::new(DeclarationId(2260))), - produced_by: Some(NodeId(977)), - }, - ); - ports.insert( - PortId(1146), - Port { - id: PortId(1146), - state: PortState::Resolved(TypeShape::new(DeclarationId(839))), - produced_by: None, - }, - ); - ports.insert( - PortId(1147), - Port { - id: PortId(1147), - state: PortState::Resolved(TypeShape::new(DeclarationId(838))), - produced_by: None, - }, - ); - ports.insert( - PortId(1148), - Port { - id: PortId(1148), - state: PortState::Uninferred, - produced_by: Some(NodeId(979)), - }, - ); - ports.insert( - PortId(1149), - Port { - id: PortId(1149), - state: PortState::Uninferred, - produced_by: Some(NodeId(980)), - }, - ); - ports.insert( - PortId(1150), - Port { - id: PortId(1150), - state: PortState::Uninferred, - produced_by: Some(NodeId(981)), - }, - ); - ports.insert( - PortId(1151), - Port { - id: PortId(1151), - state: PortState::Uninferred, - produced_by: Some(NodeId(982)), - }, - ); - ports.insert( - PortId(1152), - Port { - id: PortId(1152), - state: PortState::Uninferred, - produced_by: Some(NodeId(983)), - }, - ); - ports.insert( - PortId(1153), - Port { - id: PortId(1153), - state: PortState::Uninferred, - produced_by: Some(NodeId(984)), - }, - ); - ports.insert( - PortId(1154), - Port { - id: PortId(1154), - state: PortState::Resolved(TypeShape::new(DeclarationId(2261))), - produced_by: Some(NodeId(985)), - }, - ); - ports.insert( - PortId(1155), - Port { - id: PortId(1155), - state: PortState::Resolved(TypeShape::new(DeclarationId(1323))), - produced_by: None, - }, - ); - ports.insert( - PortId(1156), - Port { - id: PortId(1156), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1157), - Port { - id: PortId(1157), - state: PortState::Uninferred, - produced_by: Some(NodeId(987)), - }, - ); - ports.insert( - PortId(1158), - Port { - id: PortId(1158), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1159), - Port { - id: PortId(1159), - state: PortState::Uninferred, - produced_by: Some(NodeId(988)), - }, - ); - ports.insert( - PortId(1160), - Port { - id: PortId(1160), - state: PortState::Resolved(TypeShape::new(DeclarationId(1325))), - produced_by: Some(NodeId(989)), - }, - ); - ports.insert( - PortId(1161), - Port { - id: PortId(1161), - state: PortState::Resolved(TypeShape::new(DeclarationId(817))), - produced_by: None, - }, - ); - ports.insert( - PortId(1162), - Port { - id: PortId(1162), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1163), - Port { - id: PortId(1163), - state: PortState::Uninferred, - produced_by: Some(NodeId(991)), - }, - ); - ports.insert( - PortId(1164), - Port { - id: PortId(1164), - state: PortState::Uninferred, - produced_by: Some(NodeId(992)), - }, - ); - ports.insert( - PortId(1165), - Port { - id: PortId(1165), - state: PortState::Uninferred, - produced_by: Some(NodeId(993)), - }, - ); - ports.insert( - PortId(1166), - Port { - id: PortId(1166), - state: PortState::Uninferred, - produced_by: Some(NodeId(994)), - }, - ); - ports.insert( - PortId(1167), - Port { - id: PortId(1167), - state: PortState::Uninferred, - produced_by: Some(NodeId(995)), - }, - ); - ports.insert( - PortId(1168), - Port { - id: PortId(1168), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1169), - Port { - id: PortId(1169), - state: PortState::Uninferred, - produced_by: Some(NodeId(996)), - }, - ); - ports.insert( - PortId(1170), - Port { - id: PortId(1170), - state: PortState::Uninferred, - produced_by: Some(NodeId(997)), - }, - ); - ports.insert( - PortId(1171), - Port { - id: PortId(1171), - state: PortState::Uninferred, - produced_by: Some(NodeId(998)), - }, - ); - ports.insert( - PortId(1172), - Port { - id: PortId(1172), - state: PortState::Uninferred, - produced_by: Some(NodeId(999)), - }, - ); - ports.insert( - PortId(1173), - Port { - id: PortId(1173), - state: PortState::Uninferred, - produced_by: Some(NodeId(1000)), - }, - ); - ports.insert( - PortId(1174), - Port { - id: PortId(1174), - state: PortState::Uninferred, - produced_by: Some(NodeId(1001)), - }, - ); - ports.insert( - PortId(1175), - Port { - id: PortId(1175), - state: PortState::Uninferred, - produced_by: Some(NodeId(1002)), - }, - ); - ports.insert( - PortId(1176), - Port { - id: PortId(1176), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1177), - Port { - id: PortId(1177), - state: PortState::Uninferred, - produced_by: Some(NodeId(1003)), - }, - ); - ports.insert( - PortId(1178), - Port { - id: PortId(1178), - state: PortState::Uninferred, - produced_by: Some(NodeId(1004)), - }, - ); - ports.insert( - PortId(1179), - Port { - id: PortId(1179), - state: PortState::Uninferred, - produced_by: Some(NodeId(1005)), - }, - ); - ports.insert( - PortId(1180), - Port { - id: PortId(1180), - state: PortState::Resolved(TypeShape::new(DeclarationId(227))), - produced_by: Some(NodeId(1006)), - }, - ); - ports.insert( - PortId(1181), - Port { - id: PortId(1181), - state: PortState::Resolved(TypeShape::new(DeclarationId(817))), - produced_by: None, - }, - ); - ports.insert( - PortId(1182), - Port { - id: PortId(1182), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1183), - Port { - id: PortId(1183), - state: PortState::Uninferred, - produced_by: Some(NodeId(1008)), - }, - ); - ports.insert( - PortId(1184), - Port { - id: PortId(1184), - state: PortState::Uninferred, - produced_by: Some(NodeId(1009)), - }, - ); - ports.insert( - PortId(1185), - Port { - id: PortId(1185), - state: PortState::Uninferred, - produced_by: Some(NodeId(1010)), - }, - ); - ports.insert( - PortId(1186), - Port { - id: PortId(1186), - state: PortState::Uninferred, - produced_by: Some(NodeId(1011)), - }, - ); - ports.insert( - PortId(1187), - Port { - id: PortId(1187), - state: PortState::Uninferred, - produced_by: Some(NodeId(1012)), - }, - ); - ports.insert( - PortId(1188), - Port { - id: PortId(1188), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1189), - Port { - id: PortId(1189), - state: PortState::Uninferred, - produced_by: Some(NodeId(1013)), - }, - ); - ports.insert( - PortId(1190), - Port { - id: PortId(1190), - state: PortState::Uninferred, - produced_by: Some(NodeId(1014)), - }, - ); - ports.insert( - PortId(1191), - Port { - id: PortId(1191), - state: PortState::Uninferred, - produced_by: Some(NodeId(1015)), - }, - ); - ports.insert( - PortId(1192), - Port { - id: PortId(1192), - state: PortState::Uninferred, - produced_by: Some(NodeId(1016)), - }, - ); - ports.insert( - PortId(1193), - Port { - id: PortId(1193), - state: PortState::Uninferred, - produced_by: Some(NodeId(1017)), - }, - ); - ports.insert( - PortId(1194), - Port { - id: PortId(1194), - state: PortState::Uninferred, - produced_by: Some(NodeId(1018)), - }, - ); - ports.insert( - PortId(1195), - Port { - id: PortId(1195), - state: PortState::Uninferred, - produced_by: Some(NodeId(1019)), - }, - ); - ports.insert( - PortId(1196), - Port { - id: PortId(1196), - state: PortState::Uninferred, - produced_by: None, - }, - ); - ports.insert( - PortId(1197), - Port { - id: PortId(1197), - state: PortState::Uninferred, - produced_by: Some(NodeId(1020)), - }, - ); - ports.insert( - PortId(1198), - Port { - id: PortId(1198), - state: PortState::Uninferred, - produced_by: Some(NodeId(1021)), - }, - ); - ports.insert( - PortId(1199), - Port { - id: PortId(1199), - state: PortState::Uninferred, - produced_by: Some(NodeId(1022)), - }, - ); - ports.insert( - PortId(1200), - Port { - id: PortId(1200), - state: PortState::Resolved(TypeShape::new(DeclarationId(227))), - produced_by: Some(NodeId(1023)), - }, - ); - ports.insert( - PortId(1201), - Port { - id: PortId(1201), - state: PortState::Resolved(TypeShape::new(DeclarationId(147))), - produced_by: None, - }, - ); - ports.insert( - PortId(1202), - Port { - id: PortId(1202), - state: PortState::Uninferred, - produced_by: Some(NodeId(1025)), - }, - ); - ports.insert( - PortId(1203), - Port { - id: PortId(1203), - state: PortState::Uninferred, - produced_by: Some(NodeId(1026)), - }, - ); - ports.insert( - PortId(1204), - Port { - id: PortId(1204), - state: PortState::Uninferred, - produced_by: Some(NodeId(1027)), - }, - ); - ports.insert( - PortId(1205), - Port { - id: PortId(1205), - state: PortState::Uninferred, - produced_by: Some(NodeId(1028)), - }, - ); - ports.insert( - PortId(1206), - Port { - id: PortId(1206), - state: PortState::Uninferred, - produced_by: Some(NodeId(1029)), - }, - ); - ports - } -} - -fn bootstrapped_fixture_without_parse_surface_dag_diagnostics() -> DiagnosticTable { - DiagnosticTable::new() -} - -fn bootstrapped_fixture_without_parse_surface_dag_clusters() -> Vec { - vec![] -} - -fn bootstrapped_fixture_without_parse_surface_dag_optional_match_disjs( -) -> HashMap { - { - let mut map = HashMap::new(); - map.insert(DeclarationId(386), DeclarationId(2530)); - map.insert(DeclarationId(388), DeclarationId(2533)); - map.insert(DeclarationId(424), DeclarationId(2536)); - map.insert(DeclarationId(470), DeclarationId(2539)); - map.insert(DeclarationId(471), DeclarationId(2542)); - map.insert(DeclarationId(472), DeclarationId(2545)); - map.insert(DeclarationId(524), DeclarationId(2548)); - map.insert(DeclarationId(526), DeclarationId(2551)); - map.insert(DeclarationId(527), DeclarationId(2554)); - map.insert(DeclarationId(528), DeclarationId(2557)); - map.insert(DeclarationId(552), DeclarationId(2560)); - map.insert(DeclarationId(595), DeclarationId(2563)); - map.insert(DeclarationId(615), DeclarationId(2566)); - map.insert(DeclarationId(616), DeclarationId(2569)); - map.insert(DeclarationId(618), DeclarationId(2572)); - map.insert(DeclarationId(621), DeclarationId(2575)); - map.insert(DeclarationId(626), DeclarationId(2578)); - map.insert(DeclarationId(627), DeclarationId(2581)); - map.insert(DeclarationId(631), DeclarationId(2584)); - map.insert(DeclarationId(632), DeclarationId(2587)); - map.insert(DeclarationId(633), DeclarationId(2590)); - map.insert(DeclarationId(638), DeclarationId(2593)); - map.insert(DeclarationId(1479), DeclarationId(2596)); - map.insert(DeclarationId(1480), DeclarationId(2599)); - map.insert(DeclarationId(1484), DeclarationId(2602)); - map.insert(DeclarationId(1487), DeclarationId(2605)); - map.insert(DeclarationId(1536), DeclarationId(2608)); - map.insert(DeclarationId(1537), DeclarationId(2611)); - map.insert(DeclarationId(1538), DeclarationId(2614)); - map.insert(DeclarationId(1539), DeclarationId(2617)); - map.insert(DeclarationId(1540), DeclarationId(2620)); - map.insert(DeclarationId(1541), DeclarationId(2623)); - map.insert(DeclarationId(1547), DeclarationId(2626)); - map.insert(DeclarationId(1603), DeclarationId(2629)); - map.insert(DeclarationId(1606), DeclarationId(2632)); - map.insert(DeclarationId(1607), DeclarationId(2635)); - map.insert(DeclarationId(1608), DeclarationId(2638)); - map.insert(DeclarationId(1609), DeclarationId(2641)); - map.insert(DeclarationId(1632), DeclarationId(2644)); - map.insert(DeclarationId(1637), DeclarationId(2647)); - map.insert(DeclarationId(1641), DeclarationId(2650)); - map.insert(DeclarationId(1644), DeclarationId(2653)); - map.insert(DeclarationId(1645), DeclarationId(2656)); - map.insert(DeclarationId(1674), DeclarationId(2659)); - map.insert(DeclarationId(1675), DeclarationId(2662)); - map.insert(DeclarationId(1679), DeclarationId(2665)); - map.insert(DeclarationId(1680), DeclarationId(2668)); - map.insert(DeclarationId(1691), DeclarationId(2671)); - map.insert(DeclarationId(1692), DeclarationId(2674)); - map.insert(DeclarationId(1694), DeclarationId(2677)); - map.insert(DeclarationId(1695), DeclarationId(2680)); - map.insert(DeclarationId(1697), DeclarationId(2683)); - map.insert(DeclarationId(1698), DeclarationId(2686)); - map.insert(DeclarationId(1700), DeclarationId(2689)); - map.insert(DeclarationId(1702), DeclarationId(2692)); - map.insert(DeclarationId(1705), DeclarationId(2695)); - map.insert(DeclarationId(1709), DeclarationId(2698)); - map.insert(DeclarationId(1711), DeclarationId(2701)); - map.insert(DeclarationId(1713), DeclarationId(2704)); - map.insert(DeclarationId(1726), DeclarationId(2707)); - map.insert(DeclarationId(1727), DeclarationId(2710)); - map.insert(DeclarationId(1728), DeclarationId(2713)); - map.insert(DeclarationId(1731), DeclarationId(2716)); - map.insert(DeclarationId(1732), DeclarationId(2719)); - map.insert(DeclarationId(1734), DeclarationId(2722)); - map.insert(DeclarationId(1735), DeclarationId(2725)); - map.insert(DeclarationId(1769), DeclarationId(2728)); - map.insert(DeclarationId(1805), DeclarationId(2731)); - map.insert(DeclarationId(1806), DeclarationId(2734)); - map.insert(DeclarationId(1807), DeclarationId(2737)); - map.insert(DeclarationId(1808), DeclarationId(2740)); - map.insert(DeclarationId(1859), DeclarationId(2743)); - map.insert(DeclarationId(1860), DeclarationId(2746)); - map.insert(DeclarationId(1861), DeclarationId(2749)); - map.insert(DeclarationId(1862), DeclarationId(2752)); - map.insert(DeclarationId(1863), DeclarationId(2755)); - map.insert(DeclarationId(1864), DeclarationId(2758)); - map.insert(DeclarationId(1887), DeclarationId(2761)); - map.insert(DeclarationId(2054), DeclarationId(2764)); - map.insert(DeclarationId(2055), DeclarationId(2767)); - map.insert(DeclarationId(2056), DeclarationId(2770)); - map.insert(DeclarationId(2059), DeclarationId(2773)); - map.insert(DeclarationId(2060), DeclarationId(2776)); - map.insert(DeclarationId(2089), DeclarationId(2779)); - map.insert(DeclarationId(2090), DeclarationId(2782)); - map.insert(DeclarationId(2096), DeclarationId(2785)); - map.insert(DeclarationId(2097), DeclarationId(2788)); - map.insert(DeclarationId(2098), DeclarationId(2791)); - map.insert(DeclarationId(2099), DeclarationId(2794)); - map.insert(DeclarationId(2100), DeclarationId(2797)); - map.insert(DeclarationId(2101), DeclarationId(2800)); - map.insert(DeclarationId(2362), DeclarationId(2803)); - map.insert(DeclarationId(2391), DeclarationId(2806)); - map.insert(DeclarationId(2397), DeclarationId(2809)); - map.insert(DeclarationId(2402), DeclarationId(2812)); - map.insert(DeclarationId(2405), DeclarationId(2815)); - map.insert(DeclarationId(2406), DeclarationId(2818)); - map.insert(DeclarationId(2426), DeclarationId(2821)); - map.insert(DeclarationId(2427), DeclarationId(2824)); - map.insert(DeclarationId(2435), DeclarationId(2827)); - map.insert(DeclarationId(2439), DeclarationId(2830)); - map.insert(DeclarationId(2441), DeclarationId(2833)); - map.insert(DeclarationId(2442), DeclarationId(2836)); - map.insert(DeclarationId(2443), DeclarationId(2839)); - map.insert(DeclarationId(2444), DeclarationId(2842)); - map.insert(DeclarationId(2445), DeclarationId(2845)); - map.insert(DeclarationId(2451), DeclarationId(2848)); - map.insert(DeclarationId(2453), DeclarationId(2851)); - map.insert(DeclarationId(2454), DeclarationId(2854)); - map.insert(DeclarationId(2466), DeclarationId(2857)); - map.insert(DeclarationId(2467), DeclarationId(2860)); - map.insert(DeclarationId(2469), DeclarationId(2863)); - map.insert(DeclarationId(2470), DeclarationId(2866)); - map.insert(DeclarationId(2471), DeclarationId(2869)); - map.insert(DeclarationId(2472), DeclarationId(2872)); - map.insert(DeclarationId(2474), DeclarationId(2875)); - map.insert(DeclarationId(2475), DeclarationId(2878)); - map.insert(DeclarationId(2477), DeclarationId(2881)); - map.insert(DeclarationId(2479), DeclarationId(2884)); - map.insert(DeclarationId(2480), DeclarationId(2887)); - map.insert(DeclarationId(2481), DeclarationId(2890)); - map.insert(DeclarationId(2488), DeclarationId(2893)); - map.insert(DeclarationId(2489), DeclarationId(2896)); - map.insert(DeclarationId(2490), DeclarationId(2899)); - map.insert(DeclarationId(2492), DeclarationId(2902)); - map.insert(DeclarationId(2493), DeclarationId(2905)); - map.insert(DeclarationId(2494), DeclarationId(2908)); - map.insert(DeclarationId(2496), DeclarationId(2911)); - map.insert(DeclarationId(2497), DeclarationId(2914)); - map.insert(DeclarationId(2498), DeclarationId(2917)); - map.insert(DeclarationId(2505), DeclarationId(2920)); - map.insert(DeclarationId(2507), DeclarationId(2923)); - map.insert(DeclarationId(2518), DeclarationId(2926)); - map - } -} diff --git a/src/v3/compiler/src/bootstrap_regen_fresh.rs b/src/v3/compiler/src/bootstrap_regen_fresh.rs deleted file mode 100644 index 444119178b7..00000000000 --- a/src/v3/compiler/src/bootstrap_regen_fresh.rs +++ /dev/null @@ -1,318 +0,0 @@ -//! Fresh tokenize/parse/lower bootstrap from on-disk `.dag` authorities. -//! -//! This module is compiled **only** with Cargo feature `bootstrap-regen-fresh` -//! (the `regen_bootstrap` binary enables it via `required-features`). It is not -//! a second production bootstrap authority: `Dag::new()` loads the committed -//! `bootstrap_generated.rs` snapshot. Per PB-1-e mechanism (ii), the -//! fresh-compile-vs-snapshot acid test runs at `regen_bootstrap` time -//! (`--verify`), not in the default integration test suite. -//! -//! **Classification:** permanent PB-1-e **regen verification** substrate (not -//! the old “delete once the drift harness stops needing runtime std” scaffold). -//! **Dissolution:** when PB-Bootstrap-Process replaces this hand-Rust regen -//! host with a declared `bootstrap.dag` / generated producer path, delete this -//! module in favor of that single authority — same cost-of-change rule as the -//! retired `bootstrap_std_fixtures_only` dissolution trigger, reframed for -//! “regen host goes data-native” rather than “in-tree tests stop diffing.” -//! -//! **P5 receipt** (`INVARIANTS.md` §P5 Dispatch-Discipline Mechanisms (b), explicit -//! deferral): `docs/briefs/pb1-e-parse-surface-free-bootstrap-regen-p5-receipt.md` -//! cites lane **T-PB-A** and concrete `ROADMAP.md` rows for this file’s continued -//! hand-Rust (including `WITHOUT_PARSE_SURFACE_EXCLUDED_FIXTURE_PATHS` / -//! `load_runtime_bootstrap_authorities` spec filtering for the parse-surface-free -//! snapshot). - -use crate::dag::{Dag, DeclarationId, RuntimeBootstrapFixtureKind}; -use crate::lower::{collect_symbols_phase, lower_bodies_phase, resolve_pending_identifiers}; -use crate::parse::{parse, SurfaceModule}; -use crate::tokenize::tokenize; -use std::collections::HashMap; - -const LOGIC_DAG: &str = include_str!("../../../../dsl/std/logic.dag"); -const BIT_DAG: &str = include_str!("../../../../dsl/std/bit.dag"); -const ERROR_PRIMITIVES_DAG: &str = include_str!("../../../../dsl/std/error_primitives.dag"); -const ALGEBRA_DAG: &str = include_str!("../../../../dsl/std/algebra.dag"); -const MAGNITUDE_DAG: &str = include_str!("../../../../dsl/std/magnitude.dag"); -const MACHINE_CONSTRAINTS_DAG: &str = include_str!("../../../../dsl/std/machine_constraints.dag"); -const NAT_DAG: &str = include_str!("../../../../dsl/std/nat.dag"); -const INTEGER_DAG: &str = include_str!("../../../../dsl/std/integer.dag"); -const RATIONAL_DAG: &str = include_str!("../../../../dsl/std/rational.dag"); -/// Loaded before `dsl/std/float.dag` so `ApproximateField` exists while lowering -/// `type Real = ApproximateField>` (import resolves to a real -/// template, not an identifier stub — otherwise generic args drop). -const APPROXIMATE_FIELD_BOOTSTRAP_PATH: &str = "src/v3/std/approximate_field.dag"; -const APPROXIMATE_FIELD_DAG: &str = include_str!("../../../../src/v3/std/approximate_field.dag"); -const FLOAT_DAG: &str = include_str!("../../../../dsl/std/float.dag"); -const STRING_TYPE_DAG: &str = include_str!("../../../../dsl/std/string_type.dag"); -const TYPES_DAG: &str = include_str!("../../../../dsl/std/types.dag"); -const UNICODE_DAG: &str = include_str!("../../../../dsl/std/unicode.dag"); -const RENDER_REPEAT_STRING_BOOTSTRAP_DAG: &str = - include_str!("../../../../dsl/std/render_repeat_string_bootstrap.dag"); -const METHODS_DAG: &str = include_str!("../../../../dsl/std/methods.dag"); -const SERIALIZATION_DAG: &str = include_str!("../../../../dsl/std/serialization.dag"); - -// Same `OUT_DIR` fixture arrays `build.rs` emits for staged/spec/compiler/extdeps sources; -// this module is their only remaining fresh-parse consumer. -include!(concat!(env!("OUT_DIR"), "/v3_staged_files.rs")); -include!(concat!(env!("OUT_DIR"), "/v3_specs.rs")); -include!(concat!(env!("OUT_DIR"), "/v3_compiler_files.rs")); -include!(concat!(env!("OUT_DIR"), "/v3_extdeps_files.rs")); - -// `BOOTSTRAP_FIXTURE_PATH_KEYS` may resolve against either STAGED_FILES or -// EXTDEPS_FILES (mixed-tree fixture set per T-Ground-LanguageSpec scope E.1). -// STAGED_FILES are already loaded via `staged_iter` in -// `load_runtime_bootstrap_authorities`, so this iterator returns only the -// extdeps-tree subset of the keys to avoid duplicate-declaration loads. -fn extdeps_keyed_bootstrap_fixtures() -> impl Iterator { - crate::bootstrap::BOOTSTRAP_FIXTURE_PATH_KEYS - .iter() - .copied() - .filter_map(|key| EXTDEPS_FILES.iter().find(|(path, _)| *path == key).copied()) -} - -// Single authority for staged-vs-`dsl/` name collision resolution during regen. -// The committed `bootstrap_generated.rs` snapshot was baked with this policy; any -// future runtime path that re-parses the same fixture set must keep this logic -// in lockstep (cost of change: one module — extend here only). -fn declaration_name_preference_rank(file: &str) -> usize { - if file.starts_with("src/v3/") { - 2 - } else if file.starts_with("dsl/") { - 0 - } else { - 1 - } -} - -pub fn compile_std_bootstrap_dag() -> Dag { - let mut dag = Dag::empty(); - load_fixtures(&mut dag, std_fixtures()); - dag.finalize_runtime_bootstrap_from_generated_snapshot( - RuntimeBootstrapFixtureKind::StdOnlySnapshot, - ); - dag -} - -pub fn compile_full_bootstrap_dag_from_std_seed(std_seed: Dag) -> Dag { - let mut dag = std_seed; - load_runtime_bootstrap_authorities(&mut dag, &[], &[]); - dag -} - -/// Staged/spec authorities omitted when composing the parse-surface-free bootstrap -/// snapshot (`bootstrap_generated_without_parse_surface.rs`). -/// -/// `parse_surface.dag` defines the `DeclarationRef` targets for surface-shaped -/// records in `rust.dag` / `go.dag` / `python.dag`. Loading those specs without -/// `parse_surface` leaves resolve diagnostics in the DAG — forbidden for committed -/// bootstrap snapshots (PB-1-e / fail-closed substrate). -const WITHOUT_PARSE_SURFACE_EXCLUDED_FIXTURE_PATHS: &[&str] = &[ - "src/v3/std/parse_surface.dag", - "src/v3/spec/rust.dag", - "src/v3/spec/go.dag", - "src/v3/spec/python.dag", -]; - -pub fn compile_full_bootstrap_without_parse_surface_dag_from_std_seed(std_seed: Dag) -> Dag { - let mut dag = std_seed; - load_runtime_bootstrap_authorities(&mut dag, WITHOUT_PARSE_SURFACE_EXCLUDED_FIXTURE_PATHS, &[]); - dag -} - -fn load_runtime_bootstrap_authorities( - dag: &mut Dag, - excluded_authority_paths: &[&str], - excluded_compiler_paths: &[&str], -) { - let staged_iter = STAGED_FILES - .iter() - .copied() - .filter(|(path, _)| !excluded_authority_paths.contains(path)) - .filter(|(path, _)| *path != APPROXIMATE_FIELD_BOOTSTRAP_PATH); - let spec_iter = V3_SPECS - .iter() - .copied() - .filter(|(path, _)| !excluded_authority_paths.contains(path)); - let compiler_iter = COMPILER_FILES - .iter() - .copied() - .filter(|(path, _)| !excluded_compiler_paths.contains(path)); - assert_bootstrap_fixture_keys_resolve(); - let fixtures: Vec<(&'static str, &'static str)> = staged_iter - .chain(spec_iter) - .chain(compiler_iter) - .chain(extdeps_keyed_bootstrap_fixtures()) - .collect(); - load_fixtures(dag, &fixtures); - crate::bootstrap::materialize_pipeline_realizations(dag); - // Materialize `optional_match_disjs` for `T?` fields so substrate helpers and - // evaluator harnesses can use `Dag::optional_match_disj` on the embedded graph. - // Full `infer::infer` is intentionally **not** run here: the PB-1 snapshot is a - // lowered structural cache; mixing the interactive inference fixpoint into the - // embedded graph drifts callable/stamping contracts vs `compile_to_dag`. - crate::infer::ensure_all_optional_match_disjs(dag); - dag.finalize_runtime_bootstrap_from_generated_snapshot( - RuntimeBootstrapFixtureKind::FullExtdepsPipelineSnapshot, - ); -} - -fn assert_bootstrap_fixture_keys_resolve() { - let missing: Vec<&str> = crate::bootstrap::BOOTSTRAP_FIXTURE_PATH_KEYS - .iter() - .copied() - .filter(|key| { - !STAGED_FILES.iter().any(|(path, _)| *path == *key) - && !EXTDEPS_FILES.iter().any(|(path, _)| *path == *key) - }) - .collect(); - assert!( - missing.is_empty(), - "BOOTSTRAP_FIXTURE_PATH_KEYS must each appear in STAGED_FILES or EXTDEPS_FILES \ - (from build.rs): {missing:?}" - ); -} - -fn std_fixtures() -> &'static [(&'static str, &'static str)] { - &[ - ("dsl/std/logic.dag", LOGIC_DAG), - ("dsl/std/bit.dag", BIT_DAG), - ("dsl/std/error_primitives.dag", ERROR_PRIMITIVES_DAG), - ("dsl/std/algebra.dag", ALGEBRA_DAG), - ("dsl/std/magnitude.dag", MAGNITUDE_DAG), - ("dsl/std/machine_constraints.dag", MACHINE_CONSTRAINTS_DAG), - ("dsl/std/nat.dag", NAT_DAG), - ("dsl/std/integer.dag", INTEGER_DAG), - ("dsl/std/rational.dag", RATIONAL_DAG), - (APPROXIMATE_FIELD_BOOTSTRAP_PATH, APPROXIMATE_FIELD_DAG), - ("dsl/std/float.dag", FLOAT_DAG), - ("dsl/std/types.dag", TYPES_DAG), - ("dsl/std/string_type.dag", STRING_TYPE_DAG), - ("dsl/std/unicode.dag", UNICODE_DAG), - ( - "dsl/std/render_repeat_string_bootstrap.dag", - RENDER_REPEAT_STRING_BOOTSTRAP_DAG, - ), - ("dsl/std/methods.dag", METHODS_DAG), - ("dsl/std/serialization.dag", SERIALIZATION_DAG), - ] -} - -fn load_fixtures(dag: &mut Dag, fixtures: &[(&'static str, &'static str)]) { - let mut parsed: Vec<(SurfaceModule, Vec)> = Vec::with_capacity(fixtures.len()); - for (file, source) in fixtures.iter() { - let Some(module) = parse_fixture(dag, source, file) else { - continue; - }; - let (_stale_symbols, is_first) = collect_symbols_phase(dag, &module.items); - parsed.push((module, is_first)); - } - - let mut shared_symbols: HashMap = HashMap::new(); - for d in dag.declarations() { - if let Some(name) = &d.name { - match shared_symbols.get(name).copied() { - None => { - shared_symbols.insert(name.clone(), d.id); - } - Some(existing_id) => { - let existing = dag.declaration(existing_id); - let new_rank = declaration_name_preference_rank(&d.span.file); - let existing_rank = declaration_name_preference_rank(&existing.span.file); - if new_rank > existing_rank { - shared_symbols.insert(name.clone(), d.id); - } - } - } - } - } - - for (module, is_first) in parsed.iter() { - lower_bodies_phase(dag, module, &shared_symbols, is_first); - } - - resolve_pending_identifiers(dag); -} - -fn parse_fixture(dag: &mut Dag, source: &str, file: &'static str) -> Option { - let authority = crate::diagnostics::BootstrapAuthorityKey::new(file); - let tokens = match tokenize(source, file) { - Ok(t) => t, - Err(diag) => { - dag.attach_bootstrap_diagnostic(authority, diag); - return None; - } - }; - match parse(&tokens, file) { - Ok(m) => Some(m), - Err(diag) => { - dag.attach_bootstrap_diagnostic(authority, diag); - None - } - } -} - -#[cfg(test)] -mod tests { - //! Bootstrap-side coverage of `BootstrapAuthorityKey` / - //! `DiagnosticAttribution::BootstrapAuthority` for the - //! parse/tokenize attach path. Sibling unit tests in - //! `crate::diagnostics` cover the type-level invariants; - //! `crate::bootstrap::tests` covers the kernel-Bool detached - //! phantom-port path. This test exercises the third bootstrap - //! attach path (`parse_fixture`'s tokenize/parse-failure branches). - //! - //! Verification (PR #1572 Worker B') consumes the resulting - //! attribution via [`DiagnosticTable::iter_attributed`] / - //! [`DiagnosticTable::attribution`] without ever asking - //! `Diagnostic.span().file`. - - use super::*; - use crate::diagnostics::{BootstrapAuthorityKey, DiagnosticAttribution}; - - #[test] - fn parse_fixture_tokenize_failure_carries_bootstrap_authority() { - // Arbitrary illegal byte makes `tokenize` fail closed. - let source = "\u{0}"; - let file: &'static str = "src/v3/std/bootstrap_regen_fresh_tokenize_smoke.dag"; - let mut dag = Dag::empty(); - let outcome = parse_fixture(&mut dag, source, file); - assert!(outcome.is_none(), "tokenize must fail for this fixture"); - let expected = BootstrapAuthorityKey::new(file); - let bootstrap_count = dag - .diagnostics() - .iter_attributed() - .filter(|(_, _, attribution)| attribution.as_bootstrap_authority() == Some(&expected)) - .count(); - assert_eq!( - bootstrap_count, - 1, - "tokenize-failure diagnostic must carry BootstrapAuthority({file:?}); table: {:?}", - dag.diagnostics().iter_attributed().collect::>() - ); - for (_, _, attribution) in dag.diagnostics().iter_attributed() { - assert!( - matches!(attribution, DiagnosticAttribution::BootstrapAuthority(_)), - "every diagnostic from parse_fixture must be BootstrapAuthority-attributed, got {attribution:?}" - ); - } - } - - #[test] - fn parse_fixture_parse_failure_carries_bootstrap_authority() { - // Tokenizes cleanly but trips parse (unmatched closing brace at - // top level — not a valid module item). - let source = "}\n"; - let file: &'static str = "src/v3/std/bootstrap_regen_fresh_parse_smoke.dag"; - let mut dag = Dag::empty(); - let outcome = parse_fixture(&mut dag, source, file); - assert!(outcome.is_none(), "parse must fail for this fixture"); - let expected = BootstrapAuthorityKey::new(file); - assert!( - dag.diagnostics() - .iter_attributed() - .any(|(_, _, attribution)| attribution.as_bootstrap_authority() == Some(&expected)), - "parse-failure diagnostic must carry BootstrapAuthority({file:?}); table: {:?}", - dag.diagnostics().iter_attributed().collect::>() - ); - } -} diff --git a/src/v3/compiler/src/bootstrap_std_generated.rs b/src/v3/compiler/src/bootstrap_std_generated.rs deleted file mode 100644 index c153d54dab1..00000000000 --- a/src/v3/compiler/src/bootstrap_std_generated.rs +++ /dev/null @@ -1,18460 +0,0 @@ -// AUTO-GENERATED from `dsl/std/*.dag` via `regen_bootstrap`. -// Regenerate instead of hand-editing. - -pub(crate) fn bootstrapped_std_fixture_dag() -> Dag { - Dag { - nodes: bootstrapped_std_fixture_dag_nodes(), - declarations: bootstrapped_std_fixture_dag_declarations(), - ports: bootstrapped_std_fixture_dag_ports(), - diagnostics: bootstrapped_std_fixture_dag_diagnostics(), - next_node_id: 254, - next_declaration_id: 699, - next_port_id: 255, - primitives: PrimitiveCache::default(), - substrate_markers: SubstrateMarkers::default(), - realization_metas: RealizationMetaCache::default(), - target_syntax: TargetSyntaxCache::default(), - stdlib_types: StdlibTypeCache::default(), - emit_anchors: EmitAnchorCache::default(), - pattern_binding_rule_variants: PatternBindingRuleVariants::default(), - variant_payload_field_access_rule_variants: VariantPayloadFieldAccessRuleVariants::default( - ), - verifier_output_policy_variants: VerifierOutputPolicyVariants::default(), - callable_strategy_variants: CallableStrategyVariants::default(), - emit_model_variants: EmitModelVariants::default(), - clusters: bootstrapped_std_fixture_dag_clusters(), - optional_match_disjs: bootstrapped_std_fixture_dag_optional_match_disjs(), - declaration_append_begin_after_bootstrap: 699, - } -} - -#[allow(clippy::vec_init_then_push)] -fn bootstrapped_std_fixture_dag_nodes() -> Vec { - { - let mut nodes = Vec::with_capacity(254); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(0), - data: LiteralBits::Int("0".to_string()), - output: PortId(1), - span: SourceSpan::new("dsl/std/integer.dag", 9242, 9249), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(1), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Gt)), - inputs: vec![PortId(0), PortId(1)], - output: PortId(2), - span: SourceSpan::new("dsl/std/integer.dag", 9242, 9249), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(2), - name: "".to_string(), - value: PortId(2), - params: vec![PortId(0)], - span: SourceSpan::new("dsl/std/integer.dag", 9242, 9249), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(3), - data: LiteralBits::Int("0".to_string()), - output: PortId(4), - span: SourceSpan::new("dsl/std/types.dag", 9194, 9208), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(4), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Ge)), - inputs: vec![PortId(3), PortId(4)], - output: PortId(5), - span: SourceSpan::new("dsl/std/types.dag", 9194, 9208), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(5), - data: LiteralBits::Int("55295".to_string()), - output: PortId(6), - span: SourceSpan::new("dsl/std/types.dag", 9194, 9208), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(6), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Le)), - inputs: vec![PortId(3), PortId(6)], - output: PortId(7), - span: SourceSpan::new("dsl/std/types.dag", 9194, 9208), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(7), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(5), PortId(7)], - output: PortId(8), - span: SourceSpan::new("dsl/std/types.dag", 9194, 9208), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(8), - data: LiteralBits::Int("57344".to_string()), - output: PortId(9), - span: SourceSpan::new("dsl/std/types.dag", 9194, 9208), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(9), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Ge)), - inputs: vec![PortId(3), PortId(9)], - output: PortId(10), - span: SourceSpan::new("dsl/std/types.dag", 9194, 9208), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(10), - data: LiteralBits::Int("1114111".to_string()), - output: PortId(11), - span: SourceSpan::new("dsl/std/types.dag", 9194, 9208), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(11), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Le)), - inputs: vec![PortId(3), PortId(11)], - output: PortId(12), - span: SourceSpan::new("dsl/std/types.dag", 9194, 9208), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(12), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(10), PortId(12)], - output: PortId(13), - span: SourceSpan::new("dsl/std/types.dag", 9194, 9208), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(13), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::Or)), - inputs: vec![PortId(8), PortId(13)], - output: PortId(14), - span: SourceSpan::new("dsl/std/types.dag", 9194, 9208), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(14), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(3), PortId(3)], - output: PortId(15), - span: SourceSpan::new("dsl/std/types.dag", 9210, 9223), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(15), - data: LiteralBits::String("Char".to_string()), - output: PortId(16), - span: SourceSpan::new("dsl/std/types.dag", 9210, 9223), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(16), - data: LiteralBits::String("Char".to_string()), - output: PortId(17), - span: SourceSpan::new("dsl/std/types.dag", 9210, 9223), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(17), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(16), PortId(17)], - output: PortId(18), - span: SourceSpan::new("dsl/std/types.dag", 9210, 9223), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(18), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(15), PortId(18)], - output: PortId(19), - span: SourceSpan::new("dsl/std/types.dag", 9210, 9223), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(19), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(14), PortId(19)], - output: PortId(20), - span: SourceSpan::new("dsl/std/types.dag", 9194, 9223), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(20), - name: "".to_string(), - value: PortId(20), - params: vec![PortId(3)], - span: SourceSpan::new("dsl/std/types.dag", 9194, 9223), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(21), - data: LiteralBits::Int("1".to_string()), - output: PortId(22), - span: SourceSpan::new("dsl/std/types.dag", 11619, 11640), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(22), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Ge)), - inputs: vec![PortId(21), PortId(22)], - output: PortId(23), - span: SourceSpan::new("dsl/std/types.dag", 11619, 11640), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(23), - data: LiteralBits::Int("5".to_string()), - output: PortId(24), - span: SourceSpan::new("dsl/std/types.dag", 11619, 11640), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(24), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Le)), - inputs: vec![PortId(21), PortId(24)], - output: PortId(25), - span: SourceSpan::new("dsl/std/types.dag", 11619, 11640), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(25), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(23), PortId(25)], - output: PortId(26), - span: SourceSpan::new("dsl/std/types.dag", 11619, 11640), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(26), - name: "".to_string(), - value: PortId(26), - params: vec![PortId(21)], - span: SourceSpan::new("dsl/std/types.dag", 11619, 11640), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(27), - data: LiteralBits::Int("100".to_string()), - output: PortId(28), - span: SourceSpan::new("dsl/std/types.dag", 11671, 11696), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(28), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Ge)), - inputs: vec![PortId(27), PortId(28)], - output: PortId(29), - span: SourceSpan::new("dsl/std/types.dag", 11671, 11696), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(29), - data: LiteralBits::Int("599".to_string()), - output: PortId(30), - span: SourceSpan::new("dsl/std/types.dag", 11671, 11696), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(30), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Le)), - inputs: vec![PortId(27), PortId(30)], - output: PortId(31), - span: SourceSpan::new("dsl/std/types.dag", 11671, 11696), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(31), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(29), PortId(31)], - output: PortId(32), - span: SourceSpan::new("dsl/std/types.dag", 11671, 11696), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(32), - name: "".to_string(), - value: PortId(32), - params: vec![PortId(27)], - span: SourceSpan::new("dsl/std/types.dag", 11671, 11696), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(33), - data: LiteralBits::Int("1".to_string()), - output: PortId(34), - span: SourceSpan::new("dsl/std/types.dag", 11827, 11852), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(34), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Ge)), - inputs: vec![PortId(33), PortId(34)], - output: PortId(35), - span: SourceSpan::new("dsl/std/types.dag", 11827, 11852), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(35), - data: LiteralBits::Int("65535".to_string()), - output: PortId(36), - span: SourceSpan::new("dsl/std/types.dag", 11827, 11852), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(36), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Le)), - inputs: vec![PortId(33), PortId(36)], - output: PortId(37), - span: SourceSpan::new("dsl/std/types.dag", 11827, 11852), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(37), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(35), PortId(37)], - output: PortId(38), - span: SourceSpan::new("dsl/std/types.dag", 11827, 11852), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(38), - name: "".to_string(), - value: PortId(38), - params: vec![PortId(33)], - span: SourceSpan::new("dsl/std/types.dag", 11827, 11852), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(39), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(39), PortId(39)], - output: PortId(40), - span: SourceSpan::new("dsl/std/types.dag", 13050, 13070), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(40), - data: LiteralBits::String("PathSegment".to_string()), - output: PortId(41), - span: SourceSpan::new("dsl/std/types.dag", 13050, 13070), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(41), - data: LiteralBits::String("PathSegment".to_string()), - output: PortId(42), - span: SourceSpan::new("dsl/std/types.dag", 13050, 13070), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(42), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(41), PortId(42)], - output: PortId(43), - span: SourceSpan::new("dsl/std/types.dag", 13050, 13070), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(43), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(40), PortId(43)], - output: PortId(44), - span: SourceSpan::new("dsl/std/types.dag", 13050, 13070), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(44), - name: "".to_string(), - value: PortId(44), - params: vec![PortId(39)], - span: SourceSpan::new("dsl/std/types.dag", 13050, 13070), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(45), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(45), PortId(45)], - output: PortId(46), - span: SourceSpan::new("dsl/std/types.dag", 13110, 13130), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(46), - data: LiteralBits::String("GlobSegment".to_string()), - output: PortId(47), - span: SourceSpan::new("dsl/std/types.dag", 13110, 13130), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(47), - data: LiteralBits::String("GlobSegment".to_string()), - output: PortId(48), - span: SourceSpan::new("dsl/std/types.dag", 13110, 13130), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(48), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(47), PortId(48)], - output: PortId(49), - span: SourceSpan::new("dsl/std/types.dag", 13110, 13130), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(49), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(46), PortId(49)], - output: PortId(50), - span: SourceSpan::new("dsl/std/types.dag", 13110, 13130), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(50), - name: "".to_string(), - value: PortId(50), - params: vec![PortId(45)], - span: SourceSpan::new("dsl/std/types.dag", 13110, 13130), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(51), - data: LiteralBits::Int("0".to_string()), - output: PortId(52), - span: SourceSpan::new("dsl/std/types.dag", 14114, 14127), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(52), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Ge)), - inputs: vec![PortId(51), PortId(52)], - output: PortId(53), - span: SourceSpan::new("dsl/std/types.dag", 14114, 14127), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(53), - name: "".to_string(), - value: PortId(53), - params: vec![PortId(51)], - span: SourceSpan::new("dsl/std/types.dag", 14114, 14127), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(54), - data: LiteralBits::Int("0".to_string()), - output: PortId(55), - span: SourceSpan::new("dsl/std/types.dag", 14159, 14172), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(55), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Ge)), - inputs: vec![PortId(54), PortId(55)], - output: PortId(56), - span: SourceSpan::new("dsl/std/types.dag", 14159, 14172), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(56), - name: "".to_string(), - value: PortId(56), - params: vec![PortId(54)], - span: SourceSpan::new("dsl/std/types.dag", 14159, 14172), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(57), - data: LiteralBits::Int("0".to_string()), - output: PortId(58), - span: SourceSpan::new("dsl/std/types.dag", 14204, 14217), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(58), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Ge)), - inputs: vec![PortId(57), PortId(58)], - output: PortId(59), - span: SourceSpan::new("dsl/std/types.dag", 14204, 14217), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(59), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(57), PortId(57)], - output: PortId(60), - span: SourceSpan::new("dsl/std/types.dag", 14219, 14240), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(60), - data: LiteralBits::String("Milliseconds".to_string()), - output: PortId(61), - span: SourceSpan::new("dsl/std/types.dag", 14219, 14240), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(61), - data: LiteralBits::String("Milliseconds".to_string()), - output: PortId(62), - span: SourceSpan::new("dsl/std/types.dag", 14219, 14240), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(62), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(61), PortId(62)], - output: PortId(63), - span: SourceSpan::new("dsl/std/types.dag", 14219, 14240), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(63), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(60), PortId(63)], - output: PortId(64), - span: SourceSpan::new("dsl/std/types.dag", 14219, 14240), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(64), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(59), PortId(64)], - output: PortId(65), - span: SourceSpan::new("dsl/std/types.dag", 14204, 14240), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(65), - name: "".to_string(), - value: PortId(65), - params: vec![PortId(57)], - span: SourceSpan::new("dsl/std/types.dag", 14204, 14240), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(66), - data: LiteralBits::Int("0".to_string()), - output: PortId(67), - span: SourceSpan::new("dsl/std/types.dag", 14272, 14285), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(67), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Ge)), - inputs: vec![PortId(66), PortId(67)], - output: PortId(68), - span: SourceSpan::new("dsl/std/types.dag", 14272, 14285), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(68), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(66), PortId(66)], - output: PortId(69), - span: SourceSpan::new("dsl/std/types.dag", 14287, 14303), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(69), - data: LiteralBits::String("Seconds".to_string()), - output: PortId(70), - span: SourceSpan::new("dsl/std/types.dag", 14287, 14303), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(70), - data: LiteralBits::String("Seconds".to_string()), - output: PortId(71), - span: SourceSpan::new("dsl/std/types.dag", 14287, 14303), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(71), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(70), PortId(71)], - output: PortId(72), - span: SourceSpan::new("dsl/std/types.dag", 14287, 14303), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(72), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(69), PortId(72)], - output: PortId(73), - span: SourceSpan::new("dsl/std/types.dag", 14287, 14303), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(73), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(68), PortId(73)], - output: PortId(74), - span: SourceSpan::new("dsl/std/types.dag", 14272, 14303), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(74), - name: "".to_string(), - value: PortId(74), - params: vec![PortId(66)], - span: SourceSpan::new("dsl/std/types.dag", 14272, 14303), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(75), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(75), PortId(75)], - output: PortId(76), - span: SourceSpan::new("dsl/std/types.dag", 14509, 14529), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(76), - data: LiteralBits::String("LogicalTime".to_string()), - output: PortId(77), - span: SourceSpan::new("dsl/std/types.dag", 14509, 14529), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(77), - data: LiteralBits::String("LogicalTime".to_string()), - output: PortId(78), - span: SourceSpan::new("dsl/std/types.dag", 14509, 14529), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(78), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(77), PortId(78)], - output: PortId(79), - span: SourceSpan::new("dsl/std/types.dag", 14509, 14529), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(79), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(76), PortId(79)], - output: PortId(80), - span: SourceSpan::new("dsl/std/types.dag", 14509, 14529), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(80), - name: "".to_string(), - value: PortId(80), - params: vec![PortId(75)], - span: SourceSpan::new("dsl/std/types.dag", 14509, 14529), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(81), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(81), PortId(81)], - output: PortId(82), - span: SourceSpan::new("dsl/std/types.dag", 15091, 15108), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(82), - data: LiteralBits::String("IntentId".to_string()), - output: PortId(83), - span: SourceSpan::new("dsl/std/types.dag", 15091, 15108), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(83), - data: LiteralBits::String("IntentId".to_string()), - output: PortId(84), - span: SourceSpan::new("dsl/std/types.dag", 15091, 15108), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(84), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(83), PortId(84)], - output: PortId(85), - span: SourceSpan::new("dsl/std/types.dag", 15091, 15108), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(85), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(82), PortId(85)], - output: PortId(86), - span: SourceSpan::new("dsl/std/types.dag", 15091, 15108), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(86), - name: "".to_string(), - value: PortId(86), - params: vec![PortId(81)], - span: SourceSpan::new("dsl/std/types.dag", 15091, 15108), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(87), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(87), PortId(87)], - output: PortId(88), - span: SourceSpan::new("dsl/std/types.dag", 15147, 15163), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(88), - data: LiteralBits::String("IssueId".to_string()), - output: PortId(89), - span: SourceSpan::new("dsl/std/types.dag", 15147, 15163), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(89), - data: LiteralBits::String("IssueId".to_string()), - output: PortId(90), - span: SourceSpan::new("dsl/std/types.dag", 15147, 15163), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(90), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(89), PortId(90)], - output: PortId(91), - span: SourceSpan::new("dsl/std/types.dag", 15147, 15163), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(91), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(88), PortId(91)], - output: PortId(92), - span: SourceSpan::new("dsl/std/types.dag", 15147, 15163), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(92), - name: "".to_string(), - value: PortId(92), - params: vec![PortId(87)], - span: SourceSpan::new("dsl/std/types.dag", 15147, 15163), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(93), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(93), PortId(93)], - output: PortId(94), - span: SourceSpan::new("dsl/std/types.dag", 15202, 15217), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(94), - data: LiteralBits::String("RunKey".to_string()), - output: PortId(95), - span: SourceSpan::new("dsl/std/types.dag", 15202, 15217), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(95), - data: LiteralBits::String("RunKey".to_string()), - output: PortId(96), - span: SourceSpan::new("dsl/std/types.dag", 15202, 15217), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(96), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(95), PortId(96)], - output: PortId(97), - span: SourceSpan::new("dsl/std/types.dag", 15202, 15217), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(97), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(94), PortId(97)], - output: PortId(98), - span: SourceSpan::new("dsl/std/types.dag", 15202, 15217), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(98), - name: "".to_string(), - value: PortId(98), - params: vec![PortId(93)], - span: SourceSpan::new("dsl/std/types.dag", 15202, 15217), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(99), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(99), PortId(99)], - output: PortId(100), - span: SourceSpan::new("dsl/std/types.dag", 15256, 15275), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(100), - data: LiteralBits::String("ArtifactId".to_string()), - output: PortId(101), - span: SourceSpan::new("dsl/std/types.dag", 15256, 15275), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(101), - data: LiteralBits::String("ArtifactId".to_string()), - output: PortId(102), - span: SourceSpan::new("dsl/std/types.dag", 15256, 15275), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(102), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(101), PortId(102)], - output: PortId(103), - span: SourceSpan::new("dsl/std/types.dag", 15256, 15275), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(103), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(100), PortId(103)], - output: PortId(104), - span: SourceSpan::new("dsl/std/types.dag", 15256, 15275), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(104), - name: "".to_string(), - value: PortId(104), - params: vec![PortId(99)], - span: SourceSpan::new("dsl/std/types.dag", 15256, 15275), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(105), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(105), PortId(105)], - output: PortId(106), - span: SourceSpan::new("dsl/std/types.dag", 15314, 15333), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(106), - data: LiteralBits::String("LeaseToken".to_string()), - output: PortId(107), - span: SourceSpan::new("dsl/std/types.dag", 15314, 15333), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(107), - data: LiteralBits::String("LeaseToken".to_string()), - output: PortId(108), - span: SourceSpan::new("dsl/std/types.dag", 15314, 15333), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(108), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(107), PortId(108)], - output: PortId(109), - span: SourceSpan::new("dsl/std/types.dag", 15314, 15333), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(109), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(106), PortId(109)], - output: PortId(110), - span: SourceSpan::new("dsl/std/types.dag", 15314, 15333), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(110), - name: "".to_string(), - value: PortId(110), - params: vec![PortId(105)], - span: SourceSpan::new("dsl/std/types.dag", 15314, 15333), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(111), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(111), PortId(111)], - output: PortId(112), - span: SourceSpan::new("dsl/std/types.dag", 15372, 15389), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(112), - data: LiteralBits::String("WorkerId".to_string()), - output: PortId(113), - span: SourceSpan::new("dsl/std/types.dag", 15372, 15389), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(113), - data: LiteralBits::String("WorkerId".to_string()), - output: PortId(114), - span: SourceSpan::new("dsl/std/types.dag", 15372, 15389), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(114), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(113), PortId(114)], - output: PortId(115), - span: SourceSpan::new("dsl/std/types.dag", 15372, 15389), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(115), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(112), PortId(115)], - output: PortId(116), - span: SourceSpan::new("dsl/std/types.dag", 15372, 15389), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(116), - name: "".to_string(), - value: PortId(116), - params: vec![PortId(111)], - span: SourceSpan::new("dsl/std/types.dag", 15372, 15389), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(117), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(117), PortId(117)], - output: PortId(118), - span: SourceSpan::new("dsl/std/types.dag", 15428, 15446), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(118), - data: LiteralBits::String("CommentId".to_string()), - output: PortId(119), - span: SourceSpan::new("dsl/std/types.dag", 15428, 15446), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(119), - data: LiteralBits::String("CommentId".to_string()), - output: PortId(120), - span: SourceSpan::new("dsl/std/types.dag", 15428, 15446), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(120), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(119), PortId(120)], - output: PortId(121), - span: SourceSpan::new("dsl/std/types.dag", 15428, 15446), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(121), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(118), PortId(121)], - output: PortId(122), - span: SourceSpan::new("dsl/std/types.dag", 15428, 15446), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(122), - name: "".to_string(), - value: PortId(122), - params: vec![PortId(117)], - span: SourceSpan::new("dsl/std/types.dag", 15428, 15446), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(123), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(123), PortId(123)], - output: PortId(124), - span: SourceSpan::new("dsl/std/types.dag", 15485, 15503), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(124), - data: LiteralBits::String("SignalKey".to_string()), - output: PortId(125), - span: SourceSpan::new("dsl/std/types.dag", 15485, 15503), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(125), - data: LiteralBits::String("SignalKey".to_string()), - output: PortId(126), - span: SourceSpan::new("dsl/std/types.dag", 15485, 15503), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(126), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(125), PortId(126)], - output: PortId(127), - span: SourceSpan::new("dsl/std/types.dag", 15485, 15503), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(127), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(124), PortId(127)], - output: PortId(128), - span: SourceSpan::new("dsl/std/types.dag", 15485, 15503), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(128), - name: "".to_string(), - value: PortId(128), - params: vec![PortId(123)], - span: SourceSpan::new("dsl/std/types.dag", 15485, 15503), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(129), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(129), PortId(129)], - output: PortId(130), - span: SourceSpan::new("dsl/std/types.dag", 15542, 15562), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(130), - data: LiteralBits::String("ContentHash".to_string()), - output: PortId(131), - span: SourceSpan::new("dsl/std/types.dag", 15542, 15562), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(131), - data: LiteralBits::String("ContentHash".to_string()), - output: PortId(132), - span: SourceSpan::new("dsl/std/types.dag", 15542, 15562), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(132), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(131), PortId(132)], - output: PortId(133), - span: SourceSpan::new("dsl/std/types.dag", 15542, 15562), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(133), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(130), PortId(133)], - output: PortId(134), - span: SourceSpan::new("dsl/std/types.dag", 15542, 15562), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(134), - name: "".to_string(), - value: PortId(134), - params: vec![PortId(129)], - span: SourceSpan::new("dsl/std/types.dag", 15542, 15562), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(135), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(135), PortId(135)], - output: PortId(136), - span: SourceSpan::new("dsl/std/types.dag", 15837, 15864), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(136), - data: LiteralBits::String("WorkflowProducerId".to_string()), - output: PortId(137), - span: SourceSpan::new("dsl/std/types.dag", 15837, 15864), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(137), - data: LiteralBits::String("WorkflowProducerId".to_string()), - output: PortId(138), - span: SourceSpan::new("dsl/std/types.dag", 15837, 15864), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(138), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(137), PortId(138)], - output: PortId(139), - span: SourceSpan::new("dsl/std/types.dag", 15837, 15864), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(139), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(136), PortId(139)], - output: PortId(140), - span: SourceSpan::new("dsl/std/types.dag", 15837, 15864), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(140), - name: "".to_string(), - value: PortId(140), - params: vec![PortId(135)], - span: SourceSpan::new("dsl/std/types.dag", 15837, 15864), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(141), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(141), PortId(141)], - output: PortId(142), - span: SourceSpan::new("dsl/std/types.dag", 15909, 15936), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(142), - data: LiteralBits::String("WorkflowObserverId".to_string()), - output: PortId(143), - span: SourceSpan::new("dsl/std/types.dag", 15909, 15936), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(143), - data: LiteralBits::String("WorkflowObserverId".to_string()), - output: PortId(144), - span: SourceSpan::new("dsl/std/types.dag", 15909, 15936), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(144), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(143), PortId(144)], - output: PortId(145), - span: SourceSpan::new("dsl/std/types.dag", 15909, 15936), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(145), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(142), PortId(145)], - output: PortId(146), - span: SourceSpan::new("dsl/std/types.dag", 15909, 15936), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(146), - name: "".to_string(), - value: PortId(146), - params: vec![PortId(141)], - span: SourceSpan::new("dsl/std/types.dag", 15909, 15936), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(147), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(147), PortId(147)], - output: PortId(148), - span: SourceSpan::new("dsl/std/types.dag", 15979, 16004), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(148), - data: LiteralBits::String("WorkflowProverId".to_string()), - output: PortId(149), - span: SourceSpan::new("dsl/std/types.dag", 15979, 16004), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(149), - data: LiteralBits::String("WorkflowProverId".to_string()), - output: PortId(150), - span: SourceSpan::new("dsl/std/types.dag", 15979, 16004), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(150), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(149), PortId(150)], - output: PortId(151), - span: SourceSpan::new("dsl/std/types.dag", 15979, 16004), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(151), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(148), PortId(151)], - output: PortId(152), - span: SourceSpan::new("dsl/std/types.dag", 15979, 16004), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(152), - name: "".to_string(), - value: PortId(152), - params: vec![PortId(147)], - span: SourceSpan::new("dsl/std/types.dag", 15979, 16004), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(153), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(153), PortId(153)], - output: PortId(154), - span: SourceSpan::new("dsl/std/types.dag", 16044, 16066), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(154), - data: LiteralBits::String("WorkflowRunId".to_string()), - output: PortId(155), - span: SourceSpan::new("dsl/std/types.dag", 16044, 16066), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(155), - data: LiteralBits::String("WorkflowRunId".to_string()), - output: PortId(156), - span: SourceSpan::new("dsl/std/types.dag", 16044, 16066), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(156), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(155), PortId(156)], - output: PortId(157), - span: SourceSpan::new("dsl/std/types.dag", 16044, 16066), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(157), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(154), PortId(157)], - output: PortId(158), - span: SourceSpan::new("dsl/std/types.dag", 16044, 16066), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(158), - name: "".to_string(), - value: PortId(158), - params: vec![PortId(153)], - span: SourceSpan::new("dsl/std/types.dag", 16044, 16066), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(159), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(159), PortId(159)], - output: PortId(160), - span: SourceSpan::new("dsl/std/types.dag", 22653, 22678), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(160), - data: LiteralBits::String("FilesystemHandle".to_string()), - output: PortId(161), - span: SourceSpan::new("dsl/std/types.dag", 22653, 22678), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(161), - data: LiteralBits::String("FilesystemHandle".to_string()), - output: PortId(162), - span: SourceSpan::new("dsl/std/types.dag", 22653, 22678), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(162), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(161), PortId(162)], - output: PortId(163), - span: SourceSpan::new("dsl/std/types.dag", 22653, 22678), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(163), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(160), PortId(163)], - output: PortId(164), - span: SourceSpan::new("dsl/std/types.dag", 22653, 22678), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(164), - name: "".to_string(), - value: PortId(164), - params: vec![PortId(159)], - span: SourceSpan::new("dsl/std/types.dag", 22653, 22678), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(165), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(165), PortId(165)], - output: PortId(166), - span: SourceSpan::new("dsl/std/types.dag", 22714, 22736), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(166), - data: LiteralBits::String("NetworkHandle".to_string()), - output: PortId(167), - span: SourceSpan::new("dsl/std/types.dag", 22714, 22736), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(167), - data: LiteralBits::String("NetworkHandle".to_string()), - output: PortId(168), - span: SourceSpan::new("dsl/std/types.dag", 22714, 22736), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(168), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(167), PortId(168)], - output: PortId(169), - span: SourceSpan::new("dsl/std/types.dag", 22714, 22736), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(169), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(166), PortId(169)], - output: PortId(170), - span: SourceSpan::new("dsl/std/types.dag", 22714, 22736), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(170), - name: "".to_string(), - value: PortId(170), - params: vec![PortId(165)], - span: SourceSpan::new("dsl/std/types.dag", 22714, 22736), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(171), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(171), PortId(171)], - output: PortId(172), - span: SourceSpan::new("dsl/std/types.dag", 22774, 22793), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(172), - data: LiteralBits::String("ToolHandle".to_string()), - output: PortId(173), - span: SourceSpan::new("dsl/std/types.dag", 22774, 22793), - lane2_workflow: None, - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(173), - data: LiteralBits::String("ToolHandle".to_string()), - output: PortId(174), - span: SourceSpan::new("dsl/std/types.dag", 22774, 22793), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(174), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(173), PortId(174)], - output: PortId(175), - span: SourceSpan::new("dsl/std/types.dag", 22774, 22793), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(175), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(172), PortId(175)], - output: PortId(176), - span: SourceSpan::new("dsl/std/types.dag", 22774, 22793), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(176), - name: "".to_string(), - value: PortId(176), - params: vec![PortId(171)], - span: SourceSpan::new("dsl/std/types.dag", 22774, 22793), - lane2_workflow: None, - emit_participation: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(177), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(179), - span: SourceSpan::new("dsl/std/unicode.dag", 4240, 4253), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(178), - data: LiteralBits::Int("9".to_string()), - output: PortId(180), - span: SourceSpan::new("dsl/std/unicode.dag", 4257, 4258), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(179), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(179), PortId(180)], - output: PortId(181), - span: SourceSpan::new("dsl/std/unicode.dag", 4240, 4258), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(180), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(182), - span: SourceSpan::new("dsl/std/unicode.dag", 4262, 4275), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(181), - data: LiteralBits::Int("10".to_string()), - output: PortId(183), - span: SourceSpan::new("dsl/std/unicode.dag", 4279, 4281), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(182), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(182), PortId(183)], - output: PortId(184), - span: SourceSpan::new("dsl/std/unicode.dag", 4262, 4281), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(183), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::Or)), - inputs: vec![PortId(181), PortId(184)], - output: PortId(185), - span: SourceSpan::new("dsl/std/unicode.dag", 4240, 4281), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(184), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(186), - span: SourceSpan::new("dsl/std/unicode.dag", 4285, 4298), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(185), - data: LiteralBits::Int("12".to_string()), - output: PortId(187), - span: SourceSpan::new("dsl/std/unicode.dag", 4302, 4304), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(186), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(186), PortId(187)], - output: PortId(188), - span: SourceSpan::new("dsl/std/unicode.dag", 4285, 4304), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(187), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::Or)), - inputs: vec![PortId(185), PortId(188)], - output: PortId(189), - span: SourceSpan::new("dsl/std/unicode.dag", 4240, 4304), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(188), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(190), - span: SourceSpan::new("dsl/std/unicode.dag", 4314, 4327), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(189), - data: LiteralBits::Int("13".to_string()), - output: PortId(191), - span: SourceSpan::new("dsl/std/unicode.dag", 4331, 4333), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(190), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(190), PortId(191)], - output: PortId(192), - span: SourceSpan::new("dsl/std/unicode.dag", 4314, 4333), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(191), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::Or)), - inputs: vec![PortId(189), PortId(192)], - output: PortId(193), - span: SourceSpan::new("dsl/std/unicode.dag", 4240, 4333), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(192), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(194), - span: SourceSpan::new("dsl/std/unicode.dag", 4337, 4350), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(193), - data: LiteralBits::Int("32".to_string()), - output: PortId(195), - span: SourceSpan::new("dsl/std/unicode.dag", 4354, 4356), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(194), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(194), PortId(195)], - output: PortId(196), - span: SourceSpan::new("dsl/std/unicode.dag", 4337, 4356), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(195), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::Or)), - inputs: vec![PortId(193), PortId(196)], - output: PortId(197), - span: SourceSpan::new("dsl/std/unicode.dag", 4240, 4356), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(196), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(198), - span: SourceSpan::new("dsl/std/unicode.dag", 4370, 4383), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(197), - data: LiteralBits::Int("48".to_string()), - output: PortId(199), - span: SourceSpan::new("dsl/std/unicode.dag", 4387, 4389), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(198), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Ge)), - inputs: vec![PortId(198), PortId(199)], - output: PortId(200), - span: SourceSpan::new("dsl/std/unicode.dag", 4370, 4389), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(199), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(201), - span: SourceSpan::new("dsl/std/unicode.dag", 4393, 4406), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(200), - data: LiteralBits::Int("57".to_string()), - output: PortId(202), - span: SourceSpan::new("dsl/std/unicode.dag", 4410, 4412), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(201), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Le)), - inputs: vec![PortId(201), PortId(202)], - output: PortId(203), - span: SourceSpan::new("dsl/std/unicode.dag", 4393, 4412), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(202), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(200), PortId(203)], - output: PortId(204), - span: SourceSpan::new("dsl/std/unicode.dag", 4370, 4412), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(203), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(205), - span: SourceSpan::new("dsl/std/unicode.dag", 4437, 4450), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(204), - data: LiteralBits::Int("65".to_string()), - output: PortId(206), - span: SourceSpan::new("dsl/std/unicode.dag", 4454, 4456), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(205), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Ge)), - inputs: vec![PortId(205), PortId(206)], - output: PortId(207), - span: SourceSpan::new("dsl/std/unicode.dag", 4437, 4456), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(206), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(208), - span: SourceSpan::new("dsl/std/unicode.dag", 4460, 4473), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(207), - data: LiteralBits::Int("90".to_string()), - output: PortId(209), - span: SourceSpan::new("dsl/std/unicode.dag", 4477, 4479), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(208), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Le)), - inputs: vec![PortId(208), PortId(209)], - output: PortId(210), - span: SourceSpan::new("dsl/std/unicode.dag", 4460, 4479), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(209), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(207), PortId(210)], - output: PortId(211), - span: SourceSpan::new("dsl/std/unicode.dag", 4437, 4479), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(210), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(212), - span: SourceSpan::new("dsl/std/unicode.dag", 4489, 4502), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(211), - data: LiteralBits::Int("97".to_string()), - output: PortId(213), - span: SourceSpan::new("dsl/std/unicode.dag", 4506, 4508), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(212), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Ge)), - inputs: vec![PortId(212), PortId(213)], - output: PortId(214), - span: SourceSpan::new("dsl/std/unicode.dag", 4489, 4508), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(213), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(215), - span: SourceSpan::new("dsl/std/unicode.dag", 4512, 4525), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(214), - data: LiteralBits::Int("122".to_string()), - output: PortId(216), - span: SourceSpan::new("dsl/std/unicode.dag", 4529, 4532), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(215), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Le)), - inputs: vec![PortId(215), PortId(216)], - output: PortId(217), - span: SourceSpan::new("dsl/std/unicode.dag", 4512, 4532), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(216), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(214), PortId(217)], - output: PortId(218), - span: SourceSpan::new("dsl/std/unicode.dag", 4489, 4532), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(217), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::Or)), - inputs: vec![PortId(211), PortId(218)], - output: PortId(219), - span: SourceSpan::new("dsl/std/unicode.dag", 4437, 4532), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(218), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(220), - span: SourceSpan::new("dsl/std/unicode.dag", 4542, 4555), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(219), - data: LiteralBits::Int("95".to_string()), - output: PortId(221), - span: SourceSpan::new("dsl/std/unicode.dag", 4559, 4561), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(220), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(220), PortId(221)], - output: PortId(222), - span: SourceSpan::new("dsl/std/unicode.dag", 4542, 4561), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(221), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::Or)), - inputs: vec![PortId(219), PortId(222)], - output: PortId(223), - span: SourceSpan::new("dsl/std/unicode.dag", 4437, 4561), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(222), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(224), - span: SourceSpan::new("dsl/std/unicode.dag", 4746, 4759), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(223), - data: LiteralBits::Int("48".to_string()), - output: PortId(225), - span: SourceSpan::new("dsl/std/unicode.dag", 4763, 4765), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(224), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Ge)), - inputs: vec![PortId(224), PortId(225)], - output: PortId(226), - span: SourceSpan::new("dsl/std/unicode.dag", 4746, 4765), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(225), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(227), - span: SourceSpan::new("dsl/std/unicode.dag", 4769, 4782), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(226), - data: LiteralBits::Int("57".to_string()), - output: PortId(228), - span: SourceSpan::new("dsl/std/unicode.dag", 4786, 4788), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(227), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Le)), - inputs: vec![PortId(227), PortId(228)], - output: PortId(229), - span: SourceSpan::new("dsl/std/unicode.dag", 4769, 4788), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(228), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(226), PortId(229)], - output: PortId(230), - span: SourceSpan::new("dsl/std/unicode.dag", 4746, 4788), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(229), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(231), - span: SourceSpan::new("dsl/std/unicode.dag", 4798, 4811), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(230), - data: LiteralBits::Int("65".to_string()), - output: PortId(232), - span: SourceSpan::new("dsl/std/unicode.dag", 4815, 4817), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(231), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Ge)), - inputs: vec![PortId(231), PortId(232)], - output: PortId(233), - span: SourceSpan::new("dsl/std/unicode.dag", 4798, 4817), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(232), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(234), - span: SourceSpan::new("dsl/std/unicode.dag", 4821, 4834), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(233), - data: LiteralBits::Int("90".to_string()), - output: PortId(235), - span: SourceSpan::new("dsl/std/unicode.dag", 4838, 4840), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(234), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Le)), - inputs: vec![PortId(234), PortId(235)], - output: PortId(236), - span: SourceSpan::new("dsl/std/unicode.dag", 4821, 4840), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(235), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(233), PortId(236)], - output: PortId(237), - span: SourceSpan::new("dsl/std/unicode.dag", 4798, 4840), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(236), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::Or)), - inputs: vec![PortId(230), PortId(237)], - output: PortId(238), - span: SourceSpan::new("dsl/std/unicode.dag", 4746, 4840), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(237), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(239), - span: SourceSpan::new("dsl/std/unicode.dag", 4850, 4863), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(238), - data: LiteralBits::Int("97".to_string()), - output: PortId(240), - span: SourceSpan::new("dsl/std/unicode.dag", 4867, 4869), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(239), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Ge)), - inputs: vec![PortId(239), PortId(240)], - output: PortId(241), - span: SourceSpan::new("dsl/std/unicode.dag", 4850, 4869), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(240), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(242), - span: SourceSpan::new("dsl/std/unicode.dag", 4873, 4886), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(241), - data: LiteralBits::Int("122".to_string()), - output: PortId(243), - span: SourceSpan::new("dsl/std/unicode.dag", 4890, 4893), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(242), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Le)), - inputs: vec![PortId(242), PortId(243)], - output: PortId(244), - span: SourceSpan::new("dsl/std/unicode.dag", 4873, 4893), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(243), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![PortId(241), PortId(244)], - output: PortId(245), - span: SourceSpan::new("dsl/std/unicode.dag", 4850, 4893), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(244), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::Or)), - inputs: vec![PortId(238), PortId(245)], - output: PortId(246), - span: SourceSpan::new("dsl/std/unicode.dag", 4746, 4893), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(245), - target: TransformTarget::Callable(DeclarationId(236)), - inputs: vec![PortId(177)], - output: PortId(247), - span: SourceSpan::new("dsl/std/unicode.dag", 4903, 4916), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(246), - data: LiteralBits::Int("95".to_string()), - output: PortId(248), - span: SourceSpan::new("dsl/std/unicode.dag", 4920, 4922), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(247), - target: TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Eq)), - inputs: vec![PortId(247), PortId(248)], - output: PortId(249), - span: SourceSpan::new("dsl/std/unicode.dag", 4903, 4922), - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(248), - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::Or)), - inputs: vec![PortId(246), PortId(249)], - output: PortId(250), - span: SourceSpan::new("dsl/std/unicode.dag", 4746, 4922), - })); - nodes.push(Behavior::Branch(BranchNode { - id: NodeId(249), - input: PortId(178), - paths: vec![ - Path { - body: NodeId(195), - output: PortId(197), - pattern: BranchPattern::UnresolvedVariant { - name: "Whitespace".to_string(), - span: SourceSpan::new("dsl/std/unicode.dag", 4220, 4230), - }, - binding: None, - }, - Path { - body: NodeId(202), - output: PortId(204), - pattern: BranchPattern::UnresolvedVariant { - name: "Digit".to_string(), - span: SourceSpan::new("dsl/std/unicode.dag", 4361, 4366), - }, - binding: None, - }, - Path { - body: NodeId(221), - output: PortId(223), - pattern: BranchPattern::UnresolvedVariant { - name: "IdentStart".to_string(), - span: SourceSpan::new("dsl/std/unicode.dag", 4417, 4427), - }, - binding: None, - }, - Path { - body: NodeId(248), - output: PortId(250), - pattern: BranchPattern::UnresolvedVariant { - name: "IdentContinue".to_string(), - span: SourceSpan::new("dsl/std/unicode.dag", 4723, 4736), - }, - binding: None, - }, - ], - output: PortId(251), - span: SourceSpan::new("dsl/std/unicode.dag", 4115, 4926), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(250), - name: "char_in_class".to_string(), - value: PortId(251), - params: vec![PortId(177), PortId(178)], - span: SourceSpan::new("dsl/std/unicode.dag", 4115, 4926), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes.push(Behavior::Value(ValueNode { - id: NodeId(251), - data: LiteralBits::Int("0".to_string()), - output: PortId(253), - span: SourceSpan::new("dsl/std/unicode.dag", 8909, 8910), - lane2_workflow: None, - })); - nodes.push(Behavior::Transform(TransformNode { - id: NodeId(252), - target: TransformTarget::Operator(OperatorKind::Arithmetic(ArithmeticOp::Add)), - inputs: vec![PortId(252), PortId(253)], - output: PortId(254), - span: SourceSpan::new("dsl/std/unicode.dag", 8905, 8910), - })); - nodes.push(Behavior::Bind(BindNode { - id: NodeId(253), - name: "code_point".to_string(), - value: PortId(254), - params: vec![PortId(252)], - span: SourceSpan::new("dsl/std/unicode.dag", 8905, 8910), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - nodes - } -} - -#[allow(clippy::vec_init_then_push)] -fn bootstrapped_std_fixture_dag_declarations() -> Vec { - { - let mut declarations = Vec::with_capacity(699); - declarations.push(Declaration { - id: DeclarationId(0), - name: Some("Classical".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "True".to_string(), - ty: DeclarationId(313), - }, - Field { - label: "False".to_string(), - ty: DeclarationId(314), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/logic.dag", 287, 316), - }); - declarations.push(Declaration { - id: DeclarationId(1), - name: Some("classical_not".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(0)], - output: DeclarationId(0), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/logic.dag", 362, 429)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/logic.dag", 318, 429), - }); - declarations.push(Declaration { - id: DeclarationId(2), - name: Some("classical_and".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(0), DeclarationId(0)], - output: DeclarationId(0), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/logic.dag", 489, 553)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/logic.dag", 431, 553), - }); - declarations.push(Declaration { - id: DeclarationId(3), - name: Some("classical_or".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(0), DeclarationId(0)], - output: DeclarationId(0), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/logic.dag", 612, 675)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/logic.dag", 555, 675), - }); - declarations.push(Declaration { - id: DeclarationId(4), - name: Some("Bit".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(0), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/bit.dag", 897, 917), - }); - declarations.push(Declaration { - id: DeclarationId(5), - name: Some("Nibble".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "bits".to_string(), - ty: DeclarationId(315), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/bit.dag", 1003, 1034), - }); - declarations.push(Declaration { - id: DeclarationId(6), - name: Some("Byte".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "bits".to_string(), - ty: DeclarationId(316), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/bit.dag", 1118, 1147), - }); - declarations.push(Declaration { - id: DeclarationId(7), - name: Some("Word16".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "bytes".to_string(), - ty: DeclarationId(317), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/bit.dag", 1251, 1284), - }); - declarations.push(Declaration { - id: DeclarationId(8), - name: Some("Word32".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "bytes".to_string(), - ty: DeclarationId(318), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/bit.dag", 1285, 1318), - }); - declarations.push(Declaration { - id: DeclarationId(9), - name: Some("Word64".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "bytes".to_string(), - ty: DeclarationId(319), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/bit.dag", 1319, 1352), - }); - declarations.push(Declaration { - id: DeclarationId(10), - name: Some("Word128".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "bytes".to_string(), - ty: DeclarationId(320), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/bit.dag", 1353, 1387), - }); - declarations.push(Declaration { - id: DeclarationId(11), - name: Some("Result".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Ok".to_string(), - ty: DeclarationId(321), - }, - Field { - label: "Err".to_string(), - ty: DeclarationId(322), - }, - ], - }, - type_params: vec![DeclarationId(12), DeclarationId(13)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/error_primitives.dag", 597, 657), - }); - declarations.push(Declaration { - id: DeclarationId(12), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("ok".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/error_primitives.dag", 597, 657), - }); - declarations.push(Declaration { - id: DeclarationId(13), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("err".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/error_primitives.dag", 597, 657), - }); - declarations.push(Declaration { - id: DeclarationId(14), - name: Some("DivError".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "DivideByZero".to_string(), - ty: DeclarationId(323), - }, - Field { - label: "Overflow".to_string(), - ty: DeclarationId(324), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/error_primitives.dag", 920, 959), - }); - declarations.push(Declaration { - id: DeclarationId(15), - name: Some("Magma".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "op".to_string(), - ty: DeclarationId(334), - }], - }, - type_params: vec![DeclarationId(16)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 4702, 4739), - }); - declarations.push(Declaration { - id: DeclarationId(16), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 4702, 4739), - }); - declarations.push(Declaration { - id: DeclarationId(17), - name: Some("Semigroup".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "op".to_string(), - ty: DeclarationId(335), - }], - }, - type_params: vec![DeclarationId(18)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 4817, 4939), - }); - declarations.push(Declaration { - id: DeclarationId(18), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 4817, 4939), - }); - declarations.push(Declaration { - id: DeclarationId(19), - name: Some("Monoid".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "op".to_string(), - ty: DeclarationId(336), - }, - Field { - label: "identity".to_string(), - ty: DeclarationId(20), - }, - ], - }, - type_params: vec![DeclarationId(20)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 5037, 5089), - }); - declarations.push(Declaration { - id: DeclarationId(20), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 5037, 5089), - }); - declarations.push(Declaration { - id: DeclarationId(21), - name: Some("CommutativeMonoid".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "op".to_string(), - ty: DeclarationId(337), - }, - Field { - label: "identity".to_string(), - ty: DeclarationId(22), - }, - ], - }, - type_params: vec![DeclarationId(22)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 5148, 5239), - }); - declarations.push(Declaration { - id: DeclarationId(22), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 5148, 5239), - }); - declarations.push(Declaration { - id: DeclarationId(23), - name: Some("Group".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "op".to_string(), - ty: DeclarationId(338), - }, - Field { - label: "identity".to_string(), - ty: DeclarationId(24), - }, - Field { - label: "inverse".to_string(), - ty: DeclarationId(339), - }, - ], - }, - type_params: vec![DeclarationId(24)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 5311, 5384), - }); - declarations.push(Declaration { - id: DeclarationId(24), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 5311, 5384), - }); - declarations.push(Declaration { - id: DeclarationId(25), - name: Some("AbelianGroup".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "op".to_string(), - ty: DeclarationId(340), - }, - Field { - label: "identity".to_string(), - ty: DeclarationId(26), - }, - Field { - label: "inverse".to_string(), - ty: DeclarationId(341), - }, - ], - }, - type_params: vec![DeclarationId(26)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 5422, 5530), - }); - declarations.push(Declaration { - id: DeclarationId(26), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 5422, 5530), - }); - declarations.push(Declaration { - id: DeclarationId(27), - name: Some("GroupCompletion".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![DeclarationId(28)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 7957, 7977), - }); - declarations.push(Declaration { - id: DeclarationId(28), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("M".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 7957, 7977), - }); - declarations.push(Declaration { - id: DeclarationId(29), - name: Some("FieldOfFractions".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![DeclarationId(30)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 10044, 10065), - }); - declarations.push(Declaration { - id: DeclarationId(30), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("R".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 10044, 10065), - }); - declarations.push(Declaration { - id: DeclarationId(31), - name: Some("Semiring".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "add".to_string(), - ty: DeclarationId(342), - }, - Field { - label: "zero".to_string(), - ty: DeclarationId(32), - }, - Field { - label: "mul".to_string(), - ty: DeclarationId(343), - }, - Field { - label: "one".to_string(), - ty: DeclarationId(32), - }, - ], - }, - type_params: vec![DeclarationId(32)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 10502, 10583), - }); - declarations.push(Declaration { - id: DeclarationId(32), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 10502, 10583), - }); - declarations.push(Declaration { - id: DeclarationId(33), - name: Some("CommutativeSemiring".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "add".to_string(), - ty: DeclarationId(344), - }, - Field { - label: "zero".to_string(), - ty: DeclarationId(34), - }, - Field { - label: "mul".to_string(), - ty: DeclarationId(345), - }, - Field { - label: "one".to_string(), - ty: DeclarationId(34), - }, - ], - }, - type_params: vec![DeclarationId(34)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 10977, 11069), - }); - declarations.push(Declaration { - id: DeclarationId(34), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 10977, 11069), - }); - declarations.push(Declaration { - id: DeclarationId(35), - name: Some("Ring".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "add".to_string(), - ty: DeclarationId(346), - }, - Field { - label: "zero".to_string(), - ty: DeclarationId(36), - }, - Field { - label: "negate".to_string(), - ty: DeclarationId(347), - }, - Field { - label: "mul".to_string(), - ty: DeclarationId(348), - }, - Field { - label: "one".to_string(), - ty: DeclarationId(36), - }, - ], - }, - type_params: vec![DeclarationId(36)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 11196, 11294), - }); - declarations.push(Declaration { - id: DeclarationId(36), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 11196, 11294), - }); - declarations.push(Declaration { - id: DeclarationId(37), - name: Some("OrderedRing".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "add".to_string(), - ty: DeclarationId(349), - }, - Field { - label: "sub".to_string(), - ty: DeclarationId(350), - }, - Field { - label: "zero".to_string(), - ty: DeclarationId(38), - }, - Field { - label: "negate".to_string(), - ty: DeclarationId(351), - }, - Field { - label: "mul".to_string(), - ty: DeclarationId(352), - }, - Field { - label: "div".to_string(), - ty: DeclarationId(354), - }, - Field { - label: "one".to_string(), - ty: DeclarationId(38), - }, - Field { - label: "compare".to_string(), - ty: DeclarationId(355), - }, - Field { - label: "eq".to_string(), - ty: DeclarationId(356), - }, - Field { - label: "ne".to_string(), - ty: DeclarationId(357), - }, - Field { - label: "lt".to_string(), - ty: DeclarationId(358), - }, - Field { - label: "le".to_string(), - ty: DeclarationId(359), - }, - Field { - label: "gt".to_string(), - ty: DeclarationId(360), - }, - Field { - label: "ge".to_string(), - ty: DeclarationId(361), - }, - ], - }, - type_params: vec![DeclarationId(38)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12055, 12390), - }); - declarations.push(Declaration { - id: DeclarationId(38), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12055, 12390), - }); - declarations.push(Declaration { - id: DeclarationId(39), - name: Some("Field".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "add".to_string(), - ty: DeclarationId(362), - }, - Field { - label: "zero".to_string(), - ty: DeclarationId(40), - }, - Field { - label: "negate".to_string(), - ty: DeclarationId(363), - }, - Field { - label: "mul".to_string(), - ty: DeclarationId(364), - }, - Field { - label: "one".to_string(), - ty: DeclarationId(40), - }, - Field { - label: "reciprocal".to_string(), - ty: DeclarationId(365), - }, - Field { - label: "compare".to_string(), - ty: DeclarationId(366), - }, - ], - }, - type_params: vec![DeclarationId(40)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12528, 12684), - }); - declarations.push(Declaration { - id: DeclarationId(40), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12528, 12684), - }); - declarations.push(Declaration { - id: DeclarationId(41), - name: Some("Lattice".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "meet".to_string(), - ty: DeclarationId(367), - }, - Field { - label: "join".to_string(), - ty: DeclarationId(368), - }, - ], - }, - type_params: vec![DeclarationId(42)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 13004, 13067), - }); - declarations.push(Declaration { - id: DeclarationId(42), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 13004, 13067), - }); - declarations.push(Declaration { - id: DeclarationId(43), - name: Some("BoundedLattice".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "meet".to_string(), - ty: DeclarationId(369), - }, - Field { - label: "join".to_string(), - ty: DeclarationId(370), - }, - Field { - label: "top".to_string(), - ty: DeclarationId(44), - }, - Field { - label: "bottom".to_string(), - ty: DeclarationId(44), - }, - ], - }, - type_params: vec![DeclarationId(44)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 13175, 13266), - }); - declarations.push(Declaration { - id: DeclarationId(44), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 13175, 13266), - }); - declarations.push(Declaration { - id: DeclarationId(45), - name: Some("BooleanAlgebra".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "meet".to_string(), - ty: DeclarationId(371), - }, - Field { - label: "join".to_string(), - ty: DeclarationId(372), - }, - Field { - label: "complement".to_string(), - ty: DeclarationId(373), - }, - Field { - label: "top".to_string(), - ty: DeclarationId(46), - }, - Field { - label: "bottom".to_string(), - ty: DeclarationId(46), - }, - ], - }, - type_params: vec![DeclarationId(46)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 13464, 13580), - }); - declarations.push(Declaration { - id: DeclarationId(46), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 13464, 13580), - }); - declarations.push(Declaration { - id: DeclarationId(47), - name: Some("FreeMonoid".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "concat".to_string(), - ty: DeclarationId(377), - }, - Field { - label: "empty".to_string(), - ty: DeclarationId(378), - }, - Field { - label: "append".to_string(), - ty: DeclarationId(380), - }, - Field { - label: "slice".to_string(), - ty: DeclarationId(382), - }, - Field { - label: "length".to_string(), - ty: DeclarationId(383), - }, - Field { - label: "is_empty".to_string(), - ty: DeclarationId(384), - }, - Field { - label: "count".to_string(), - ty: DeclarationId(385), - }, - Field { - label: "first".to_string(), - ty: DeclarationId(387), - }, - Field { - label: "last".to_string(), - ty: DeclarationId(389), - }, - Field { - label: "map".to_string(), - ty: DeclarationId(392), - }, - Field { - label: "filter".to_string(), - ty: DeclarationId(395), - }, - Field { - label: "fold".to_string(), - ty: DeclarationId(397), - }, - Field { - label: "flat_map".to_string(), - ty: DeclarationId(401), - }, - Field { - label: "any".to_string(), - ty: DeclarationId(403), - }, - Field { - label: "all".to_string(), - ty: DeclarationId(405), - }, - Field { - label: "enumerate".to_string(), - ty: DeclarationId(409), - }, - Field { - label: "reverse".to_string(), - ty: DeclarationId(411), - }, - Field { - label: "skip".to_string(), - ty: DeclarationId(413), - }, - Field { - label: "take".to_string(), - ty: DeclarationId(415), - }, - Field { - label: "sort_by".to_string(), - ty: DeclarationId(418), - }, - Field { - label: "contains".to_string(), - ty: DeclarationId(419), - }, - ], - }, - type_params: vec![DeclarationId(48)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17472, 18434), - }); - declarations.push(Declaration { - id: DeclarationId(48), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17472, 18434), - }); - declarations.push(Declaration { - id: DeclarationId(49), - name: Some("PartialFunction".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "lookup".to_string(), - ty: DeclarationId(422), - }, - Field { - label: "empty".to_string(), - ty: DeclarationId(423), - }, - Field { - label: "get".to_string(), - ty: DeclarationId(425), - }, - Field { - label: "insert".to_string(), - ty: DeclarationId(427), - }, - Field { - label: "merge".to_string(), - ty: DeclarationId(430), - }, - Field { - label: "keys".to_string(), - ty: DeclarationId(432), - }, - Field { - label: "values".to_string(), - ty: DeclarationId(434), - }, - Field { - label: "has".to_string(), - ty: DeclarationId(435), - }, - Field { - label: "contains_key".to_string(), - ty: DeclarationId(436), - }, - Field { - label: "size".to_string(), - ty: DeclarationId(437), - }, - ], - }, - type_params: vec![DeclarationId(50), DeclarationId(51)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18963, 19310), - }); - declarations.push(Declaration { - id: DeclarationId(50), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("K".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18963, 19310), - }); - declarations.push(Declaration { - id: DeclarationId(51), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("V".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18963, 19310), - }); - declarations.push(Declaration { - id: DeclarationId(52), - name: Some("Ordering".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Less".to_string(), - ty: DeclarationId(438), - }, - Field { - label: "Equal".to_string(), - ty: DeclarationId(439), - }, - Field { - label: "Greater".to_string(), - ty: DeclarationId(440), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19511, 19549), - }); - declarations.push(Declaration { - id: DeclarationId(53), - name: Some("AlgebraProfile".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "OrderedRingProfile".to_string(), - ty: DeclarationId(441), - }, - Field { - label: "ApproximateFieldProfile".to_string(), - ty: DeclarationId(442), - }, - Field { - label: "BooleanAlgebraProfile".to_string(), - ty: DeclarationId(443), - }, - Field { - label: "BooleanAlgebraCollectionProfile".to_string(), - ty: DeclarationId(444), - }, - Field { - label: "FreeMonoidScalarProfile".to_string(), - ty: DeclarationId(445), - }, - Field { - label: "FreeMonoidCollectionProfile".to_string(), - ty: DeclarationId(446), - }, - Field { - label: "PartialFunctionProfile".to_string(), - ty: DeclarationId(447), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 21634, 21853), - }); - declarations.push(Declaration { - id: DeclarationId(54), - name: Some("ContainerSource".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "SameAsReceiver".to_string(), - ty: DeclarationId(448), - }, - Field { - label: "Named".to_string(), - ty: DeclarationId(449), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 21855, 21921), - }); - declarations.push(Declaration { - id: DeclarationId(55), - name: Some("AlgebraTypeTemplate".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ReceiverSelf".to_string(), - ty: DeclarationId(450), - }, - Field { - label: "ReceiverElement".to_string(), - ty: DeclarationId(451), - }, - Field { - label: "ReceiverKey".to_string(), - ty: DeclarationId(452), - }, - Field { - label: "ReceiverValue".to_string(), - ty: DeclarationId(453), - }, - Field { - label: "NamedTemplate".to_string(), - ty: DeclarationId(454), - }, - Field { - label: "ContainerOf".to_string(), - ty: DeclarationId(455), - }, - Field { - label: "OptionalOf".to_string(), - ty: DeclarationId(456), - }, - Field { - label: "WitnessOf".to_string(), - ty: DeclarationId(457), - }, - Field { - label: "TupleOf".to_string(), - ty: DeclarationId(458), - }, - Field { - label: "CallableOf".to_string(), - ty: DeclarationId(460), - }, - Field { - label: "AlgebraTypeVariable".to_string(), - ty: DeclarationId(461), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 21923, 22416), - }); - declarations.push(Declaration { - id: DeclarationId(56), - name: Some("CollectionSizeEffect".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ShrinkEffect".to_string(), - ty: DeclarationId(462), - }, - Field { - label: "ProjectionEffect".to_string(), - ty: DeclarationId(463), - }, - Field { - label: "IdentityEffect".to_string(), - ty: DeclarationId(464), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 22632, 22809), - }); - declarations.push(Declaration { - id: DeclarationId(57), - name: Some("CostShape".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ShapeConstant".to_string(), - ty: DeclarationId(465), - }, - Field { - label: "ShapeLinearScan".to_string(), - ty: DeclarationId(466), - }, - Field { - label: "ShapeIterateBody".to_string(), - ty: DeclarationId(467), - }, - Field { - label: "ShapeSortBody".to_string(), - ty: DeclarationId(468), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23267, 23452), - }); - declarations.push(Declaration { - id: DeclarationId(58), - name: Some("AlgebraFieldTemplate".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "param_types".to_string(), - ty: DeclarationId(469), - }, - Field { - label: "return_type".to_string(), - ty: DeclarationId(55), - }, - Field { - label: "size_effect".to_string(), - ty: DeclarationId(470), - }, - Field { - label: "cost_shape".to_string(), - ty: DeclarationId(471), - }, - Field { - label: "callback_element_position".to_string(), - ty: DeclarationId(472), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23477, 23908), - }); - declarations.push(Declaration { - id: DeclarationId(59), - name: Some("kernel_algebra_profile".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(53), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(473)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Map( - FieldMap::from_entries(vec![ - ( - "Int".to_string(), - FieldValue::Variant { - constructor: DeclarationId(441), - payload: vec![], - }, - ), - ( - "Float".to_string(), - FieldValue::Variant { - constructor: DeclarationId(442), - payload: vec![], - }, - ), - ( - "Bool".to_string(), - FieldValue::Variant { - constructor: DeclarationId(443), - payload: vec![], - }, - ), - ( - "String".to_string(), - FieldValue::Variant { - constructor: DeclarationId(445), - payload: vec![], - }, - ), - ( - "List".to_string(), - FieldValue::Variant { - constructor: DeclarationId(446), - payload: vec![], - }, - ), - ( - "Set".to_string(), - FieldValue::Variant { - constructor: DeclarationId(444), - payload: vec![], - }, - ), - ( - "Map".to_string(), - FieldValue::Variant { - constructor: DeclarationId(447), - payload: vec![], - }, - ), - ]) - .expect("ValueBody::Map"), - )), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23910, 24220), - }); - declarations.push(Declaration { - id: DeclarationId(60), - name: Some("ordered_ring_templates".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(325), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/algebra.dag", 24280, 25425)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 24222, 25425), - }); - declarations.push(Declaration { - id: DeclarationId(61), - name: Some("approximate_field_templates".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(326), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/algebra.dag", 25490, 26584)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 25427, 26584), - }); - declarations.push(Declaration { - id: DeclarationId(62), - name: Some("boolean_algebra_templates".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(327), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/algebra.dag", 26647, 27408)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 26586, 27408), - }); - declarations.push(Declaration { - id: DeclarationId(63), - name: Some("boolean_algebra_collection_templates".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(328), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/algebra.dag", 27773, 31163)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 27701, 31163), - }); - declarations.push(Declaration { - id: DeclarationId(64), - name: Some("free_monoid_scalar_templates".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(329), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/algebra.dag", 31229, 34472)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 31165, 34472), - }); - declarations.push(Declaration { - id: DeclarationId(65), - name: Some("free_monoid_collection_templates".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(330), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/algebra.dag", 34542, 39903)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 34474, 39903), - }); - declarations.push(Declaration { - id: DeclarationId(66), - name: Some("partial_function_templates".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(331), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/algebra.dag", 39967, 42790)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 39905, 42790), - }); - declarations.push(Declaration { - id: DeclarationId(67), - name: Some("algebra_templates_for_profile".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(53)], - output: DeclarationId(332), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/algebra.dag", 42880, 43343)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 42792, 43343), - }); - declarations.push(Declaration { - id: DeclarationId(68), - name: Some("algebra_type_param_names".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(53)], - output: DeclarationId(333), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/algebra.dag", 43685, 43966)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 43616, 43966), - }); - declarations.push(Declaration { - id: DeclarationId(69), - name: Some("Magnitude".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/magnitude.dag", 1464, 1478), - }); - declarations.push(Declaration { - id: DeclarationId(70), - name: Some("MachineWidth".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![DeclarationId(71)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/machine_constraints.dag", 3296, 3313), - }); - declarations.push(Declaration { - id: DeclarationId(71), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("bits".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/machine_constraints.dag", 3296, 3313), - }); - declarations.push(Declaration { - id: DeclarationId(72), - name: Some("PointerWidth".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/machine_constraints.dag", 6208, 6225), - }); - declarations.push(Declaration { - id: DeclarationId(73), - name: Some("Compose".to_string()), - connective: TypeConnective::Disj { - variants: vec![Field { - label: "Phantom".to_string(), - ty: DeclarationId(474), - }], - }, - type_params: vec![DeclarationId(74), DeclarationId(75)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/machine_constraints.dag", 7292, 7342), - }); - declarations.push(Declaration { - id: DeclarationId(74), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Algebra".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/machine_constraints.dag", 7292, 7342), - }); - declarations.push(Declaration { - id: DeclarationId(75), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam( - "MachineConstraint".to_string(), - )), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/machine_constraints.dag", 7292, 7342), - }); - declarations.push(Declaration { - id: DeclarationId(76), - name: Some("Nat".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(33), - arguments: vec![TemplateArgument { - parameter: DeclarationId(34), - value: DeclarationId(69), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/nat.dag", 2186, 2227), - }); - declarations.push(Declaration { - id: DeclarationId(77), - name: Some("Int8".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(73), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(74), - value: DeclarationId(87), - }, - TemplateArgument { - parameter: DeclarationId(75), - value: DeclarationId(476), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2549, 2590), - }); - declarations.push(Declaration { - id: DeclarationId(78), - name: Some("Int16".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(73), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(74), - value: DeclarationId(87), - }, - TemplateArgument { - parameter: DeclarationId(75), - value: DeclarationId(478), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2591, 2634), - }); - declarations.push(Declaration { - id: DeclarationId(79), - name: Some("Int32".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(73), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(74), - value: DeclarationId(87), - }, - TemplateArgument { - parameter: DeclarationId(75), - value: DeclarationId(480), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2635, 2678), - }); - declarations.push(Declaration { - id: DeclarationId(80), - name: Some("Int64".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(73), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(74), - value: DeclarationId(87), - }, - TemplateArgument { - parameter: DeclarationId(75), - value: DeclarationId(482), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2679, 2722), - }); - declarations.push(Declaration { - id: DeclarationId(81), - name: Some("Int128".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(73), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(74), - value: DeclarationId(87), - }, - TemplateArgument { - parameter: DeclarationId(75), - value: DeclarationId(484), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2723, 2768), - }); - declarations.push(Declaration { - id: DeclarationId(82), - name: Some("UInt8".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(73), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(74), - value: DeclarationId(88), - }, - TemplateArgument { - parameter: DeclarationId(75), - value: DeclarationId(486), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2834, 2877), - }); - declarations.push(Declaration { - id: DeclarationId(83), - name: Some("UInt16".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(73), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(74), - value: DeclarationId(88), - }, - TemplateArgument { - parameter: DeclarationId(75), - value: DeclarationId(488), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2878, 2923), - }); - declarations.push(Declaration { - id: DeclarationId(84), - name: Some("UInt32".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(73), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(74), - value: DeclarationId(88), - }, - TemplateArgument { - parameter: DeclarationId(75), - value: DeclarationId(490), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2924, 2969), - }); - declarations.push(Declaration { - id: DeclarationId(85), - name: Some("UInt64".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(73), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(74), - value: DeclarationId(88), - }, - TemplateArgument { - parameter: DeclarationId(75), - value: DeclarationId(492), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2970, 3015), - }); - declarations.push(Declaration { - id: DeclarationId(86), - name: Some("UInt128".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(73), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(74), - value: DeclarationId(88), - }, - TemplateArgument { - parameter: DeclarationId(75), - value: DeclarationId(494), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 3016, 3063), - }); - declarations.push(Declaration { - id: DeclarationId(87), - name: Some("Int".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(25), - arguments: vec![TemplateArgument { - parameter: DeclarationId(26), - value: DeclarationId(495), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 5921, 5966), - }); - declarations.push(Declaration { - id: DeclarationId(88), - name: Some("UInt".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(76), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 5967, 5982), - }); - declarations.push(Declaration { - id: DeclarationId(89), - name: Some("IntPlatform".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(73), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(74), - value: DeclarationId(87), - }, - TemplateArgument { - parameter: DeclarationId(75), - value: DeclarationId(496), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 7619, 7680), - }); - declarations.push(Declaration { - id: DeclarationId(90), - name: Some("UIntPlatform".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(73), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(74), - value: DeclarationId(88), - }, - TemplateArgument { - parameter: DeclarationId(75), - value: DeclarationId(497), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 7681, 7742), - }); - declarations.push(Declaration { - id: DeclarationId(91), - name: Some("NonNegativeInt".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(76), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 9184, 9209), - }); - declarations.push(Declaration { - id: DeclarationId(92), - name: Some("PositiveInt".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(76))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(498)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 9210, 9249), - }); - declarations.push(Declaration { - id: DeclarationId(93), - name: Some("Rational".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(39), - arguments: vec![TemplateArgument { - parameter: DeclarationId(40), - value: DeclarationId(499), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/rational.dag", 1245, 1289), - }); - declarations.push(Declaration { - id: DeclarationId(94), - name: Some("RoundingMode".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ToNearestEven".to_string(), - ty: DeclarationId(500), - }, - Field { - label: "ToZero".to_string(), - ty: DeclarationId(501), - }, - Field { - label: "ToPositiveInfinity".to_string(), - ty: DeclarationId(502), - }, - Field { - label: "ToNegativeInfinity".to_string(), - ty: DeclarationId(503), - }, - Field { - label: "ToAwayFromZero".to_string(), - ty: DeclarationId(504), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 1030, 1141), - }); - declarations.push(Declaration { - id: DeclarationId(95), - name: Some("Precision".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Unbounded".to_string(), - ty: DeclarationId(505), - }, - Field { - label: "BinaryPrecision".to_string(), - ty: DeclarationId(506), - }, - Field { - label: "DecimalPrecision".to_string(), - ty: DeclarationId(507), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 1404, 1589), - }); - declarations.push(Declaration { - id: DeclarationId(96), - name: Some("NanPolicy".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "NoNaN".to_string(), - ty: DeclarationId(508), - }, - Field { - label: "QuietNaN".to_string(), - ty: DeclarationId(509), - }, - Field { - label: "QuietAndSignalingNaN".to_string(), - ty: DeclarationId(510), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 1812, 1868), - }); - declarations.push(Declaration { - id: DeclarationId(97), - name: Some("InfinityPolicy".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "NoInfinity".to_string(), - ty: DeclarationId(511), - }, - Field { - label: "SignedInfinity".to_string(), - ty: DeclarationId(512), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 2096, 2145), - }); - declarations.push(Declaration { - id: DeclarationId(98), - name: Some("SignedZeroPolicy".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "NoSignedZero".to_string(), - ty: DeclarationId(513), - }, - Field { - label: "SignedZero".to_string(), - ty: DeclarationId(514), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 2376, 2425), - }); - declarations.push(Declaration { - id: DeclarationId(99), - name: Some("SubnormalPolicy".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "NoSubnormals".to_string(), - ty: DeclarationId(515), - }, - Field { - label: "GradualUnderflow".to_string(), - ty: DeclarationId(516), - }, - Field { - label: "FlushToZero".to_string(), - ty: DeclarationId(517), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 2720, 2788), - }); - declarations.push(Declaration { - id: DeclarationId(100), - name: Some("SpecialValues".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "nan".to_string(), - ty: DeclarationId(96), - }, - Field { - label: "infinity".to_string(), - ty: DeclarationId(97), - }, - Field { - label: "signed_zero".to_string(), - ty: DeclarationId(98), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 3064, 3162), - }); - declarations.push(Declaration { - id: DeclarationId(101), - name: Some("ApproximateField".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "base".to_string(), - ty: DeclarationId(518), - }, - Field { - label: "rounding".to_string(), - ty: DeclarationId(94), - }, - Field { - label: "precision".to_string(), - ty: DeclarationId(95), - }, - Field { - label: "special_values".to_string(), - ty: DeclarationId(100), - }, - Field { - label: "subnormal_policy".to_string(), - ty: DeclarationId(99), - }, - ], - }, - type_params: vec![DeclarationId(102)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 3398, 3559), - }); - declarations.push(Declaration { - id: DeclarationId(102), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("F".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 3398, 3559), - }); - declarations.push(Declaration { - id: DeclarationId(103), - name: Some("Ieee754Float".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/float.dag", 1255, 1272), - }); - declarations.push(Declaration { - id: DeclarationId(104), - name: Some("Real".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(101), - arguments: vec![TemplateArgument { - parameter: DeclarationId(102), - value: DeclarationId(519), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/float.dag", 1453, 1504), - }); - declarations.push(Declaration { - id: DeclarationId(105), - name: Some("Real32".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(73), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(74), - value: DeclarationId(104), - }, - TemplateArgument { - parameter: DeclarationId(75), - value: DeclarationId(521), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/float.dag", 1726, 1771), - }); - declarations.push(Declaration { - id: DeclarationId(106), - name: Some("Real64".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(73), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(74), - value: DeclarationId(104), - }, - TemplateArgument { - parameter: DeclarationId(75), - value: DeclarationId(523), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/float.dag", 1772, 1817), - }); - declarations.push(Declaration { - id: DeclarationId(107), - name: Some("Float32".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(105), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/float.dag", 1819, 1840), - }); - declarations.push(Declaration { - id: DeclarationId(108), - name: Some("Float64".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(106), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/float.dag", 1841, 1862), - }); - declarations.push(Declaration { - id: DeclarationId(109), - name: Some("Float".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(108), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/float.dag", 1881, 1901), - }); - declarations.push(Declaration { - id: DeclarationId(110), - name: Some("kernel_type_set".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(124), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(639)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Map( - FieldMap::from_entries(vec![ - ( - "String".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ( - "Int".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ( - "Bool".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ( - "Float".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ( - "Secret".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ( - "Json".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ( - "Unit".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ( - "Bytes".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - ), - ]) - .expect("ValueBody::Map"), - )), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 3041, 3206), - }); - declarations.push(Declaration { - id: DeclarationId(111), - name: Some("is_kernel_type".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227)], - output: DeclarationId(124), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/types.dag", 3248, 3349)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 3208, 3349), - }); - declarations.push(Declaration { - id: DeclarationId(112), - name: Some("container_type_arity".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(87), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(640)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Map( - FieldMap::from_entries(vec![ - ( - "List".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ( - "Set".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ( - "Map".to_string(), - FieldValue::Literal(LiteralBits::Int("2".to_string())), - ), - ( - "Witness".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ]) - .expect("ValueBody::Map"), - )), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 3511, 3606), - }); - declarations.push(Declaration { - id: DeclarationId(113), - name: Some("is_container_type".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227)], - output: DeclarationId(124), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/types.dag", 3651, 3758)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 3608, 3758), - }); - declarations.push(Declaration { - id: DeclarationId(114), - name: Some("container_expected_arity".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227)], - output: DeclarationId(524), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/types.dag", 3810, 3851)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 3760, 3851), - }); - declarations.push(Declaration { - id: DeclarationId(115), - name: Some("container_param_names_for".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227)], - output: DeclarationId(525), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/types.dag", 4091, 4296)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 4027, 4296), - }); - declarations.push(Declaration { - id: DeclarationId(116), - name: Some("container_param_name".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227), DeclarationId(87)], - output: DeclarationId(526), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/types.dag", 4364, 4612)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 4298, 4612), - }); - declarations.push(Declaration { - id: DeclarationId(117), - name: Some("ordered_element_collections".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(124), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(641)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Map( - FieldMap::from_entries(vec![( - "List".to_string(), - FieldValue::Literal(LiteralBits::Bool(true)), - )]) - .expect("ValueBody::Map"), - )), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 4806, 4878), - }); - declarations.push(Declaration { - id: DeclarationId(118), - name: Some("is_ordered_element_collection".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227)], - output: DeclarationId(124), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/types.dag", 4935, 4992)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 4880, 4992), - }); - declarations.push(Declaration { - id: DeclarationId(119), - name: Some("container_template_algebra_rows".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(642)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Map( - FieldMap::from_entries(vec![ - ( - "List".to_string(), - FieldValue::Literal(LiteralBits::String("FreeMonoid".to_string())), - ), - ( - "list".to_string(), - FieldValue::Literal(LiteralBits::String("FreeMonoid".to_string())), - ), - ( - "Set".to_string(), - FieldValue::Literal(LiteralBits::String("BooleanAlgebra".to_string())), - ), - ( - "set".to_string(), - FieldValue::Literal(LiteralBits::String("BooleanAlgebra".to_string())), - ), - ( - "Map".to_string(), - FieldValue::Literal(LiteralBits::String("PartialFunction".to_string())), - ), - ( - "map".to_string(), - FieldValue::Literal(LiteralBits::String("PartialFunction".to_string())), - ), - ( - "FreeMonoid".to_string(), - FieldValue::Literal(LiteralBits::String("FreeMonoid".to_string())), - ), - ( - "free_monoid".to_string(), - FieldValue::Literal(LiteralBits::String("FreeMonoid".to_string())), - ), - ( - "BooleanAlgebra".to_string(), - FieldValue::Literal(LiteralBits::String("BooleanAlgebra".to_string())), - ), - ( - "boolean_algebra".to_string(), - FieldValue::Literal(LiteralBits::String("BooleanAlgebra".to_string())), - ), - ( - "PartialFunction".to_string(), - FieldValue::Literal(LiteralBits::String("PartialFunction".to_string())), - ), - ( - "partial_function".to_string(), - FieldValue::Literal(LiteralBits::String("PartialFunction".to_string())), - ), - ]) - .expect("ValueBody::Map"), - )), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 5784, 6223), - }); - declarations.push(Declaration { - id: DeclarationId(120), - name: Some("container_template_alias_rows".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(643)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Map( - FieldMap::from_entries(vec![ - ( - "List".to_string(), - FieldValue::Literal(LiteralBits::String("FreeMonoid".to_string())), - ), - ( - "list".to_string(), - FieldValue::Literal(LiteralBits::String("FreeMonoid".to_string())), - ), - ( - "Set".to_string(), - FieldValue::Literal(LiteralBits::String("BooleanAlgebra".to_string())), - ), - ( - "set".to_string(), - FieldValue::Literal(LiteralBits::String("BooleanAlgebra".to_string())), - ), - ( - "Map".to_string(), - FieldValue::Literal(LiteralBits::String("PartialFunction".to_string())), - ), - ( - "map".to_string(), - FieldValue::Literal(LiteralBits::String("PartialFunction".to_string())), - ), - ]) - .expect("ValueBody::Map"), - )), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 6389, 6607), - }); - declarations.push(Declaration { - id: DeclarationId(121), - name: Some("container_template_algebra".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227)], - output: DeclarationId(527), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/types.dag", 6664, 6716)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 6609, 6716), - }); - declarations.push(Declaration { - id: DeclarationId(122), - name: Some("container_template_alias_algebra".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227)], - output: DeclarationId(528), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/types.dag", 6779, 6829)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 6718, 6829), - }); - declarations.push(Declaration { - id: DeclarationId(123), - name: Some("canonical_container_names".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(529), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/types.dag", 7242, 7332)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 7195, 7332), - }); - declarations.push(Declaration { - id: DeclarationId(124), - name: Some("Bool".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "True".to_string(), - ty: DeclarationId(530), - }, - Field { - label: "False".to_string(), - ty: DeclarationId(531), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: Some(DeclarationId(532)), - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 8306, 8330), - }); - declarations.push(Declaration { - id: DeclarationId(125), - name: Some("Unit".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 8398, 8407), - }); - declarations.push(Declaration { - id: DeclarationId(126), - name: Some("Json".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 8524, 8533), - }); - declarations.push(Declaration { - id: DeclarationId(127), - name: Some("Bytes".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 8534, 8544), - }); - declarations.push(Declaration { - id: DeclarationId(128), - name: Some("Char".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(87))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(644)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 9172, 9223), - }); - declarations.push(Declaration { - id: DeclarationId(129), - name: Some("List".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(130), - }], - }, - type_params: vec![DeclarationId(130)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 9987, 10027), - }); - declarations.push(Declaration { - id: DeclarationId(130), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("element".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 9987, 10027), - }); - declarations.push(Declaration { - id: DeclarationId(131), - name: Some("Set".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(45), - arguments: vec![TemplateArgument { - parameter: DeclarationId(46), - value: DeclarationId(132), - }], - }, - type_params: vec![DeclarationId(132)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 10028, 10071), - }); - declarations.push(Declaration { - id: DeclarationId(132), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("element".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 10028, 10071), - }); - declarations.push(Declaration { - id: DeclarationId(133), - name: Some("Map".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(49), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(50), - value: DeclarationId(134), - }, - TemplateArgument { - parameter: DeclarationId(51), - value: DeclarationId(135), - }, - ], - }, - type_params: vec![DeclarationId(134), DeclarationId(135)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 10072, 10122), - }); - declarations.push(Declaration { - id: DeclarationId(134), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("key".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 10072, 10122), - }); - declarations.push(Declaration { - id: DeclarationId(135), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("value".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 10072, 10122), - }); - declarations.push(Declaration { - id: DeclarationId(136), - name: Some("CommitSha".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 11468, 11494), - }); - declarations.push(Declaration { - id: DeclarationId(137), - name: Some("Sha256".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 11562, 11588), - }); - declarations.push(Declaration { - id: DeclarationId(138), - name: Some("RetryCount".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(87))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(645)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 11589, 11640), - }); - declarations.push(Declaration { - id: DeclarationId(139), - name: Some("HttpStatus".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(87))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(646)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 11641, 11696), - }); - declarations.push(Declaration { - id: DeclarationId(140), - name: Some("Email".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 11770, 11796), - }); - declarations.push(Declaration { - id: DeclarationId(141), - name: Some("Port".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(87))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(647)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 11797, 11852), - }); - declarations.push(Declaration { - id: DeclarationId(142), - name: Some("GistId".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 11941, 11967), - }); - declarations.push(Declaration { - id: DeclarationId(143), - name: Some("Secret".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: Some(NominalOpacity { - permitted_accessors: vec![], - }), - span: SourceSpan::new("dsl/std/types.dag", 11968, 12009), - }); - declarations.push(Declaration { - id: DeclarationId(144), - name: Some("SecretValue".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(143))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(648)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 12010, 12052), - }); - declarations.push(Declaration { - id: DeclarationId(145), - name: Some("Url".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 12113, 12139), - }); - declarations.push(Declaration { - id: DeclarationId(146), - name: Some("SemVer".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 12212, 12238), - }); - declarations.push(Declaration { - id: DeclarationId(147), - name: Some("NonEmptyStr".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(227))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(649)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 12239, 12284), - }); - declarations.push(Declaration { - id: DeclarationId(148), - name: Some("LanguageId".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(227))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(650)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 12285, 12330), - }); - declarations.push(Declaration { - id: DeclarationId(149), - name: Some("SecretName".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(227))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(651)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 12331, 12376), - }); - declarations.push(Declaration { - id: DeclarationId(150), - name: Some("PathSegment".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(147))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(652)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 13011, 13070), - }); - declarations.push(Declaration { - id: DeclarationId(151), - name: Some("GlobSegment".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(147))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(653)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 13071, 13130), - }); - declarations.push(Declaration { - id: DeclarationId(152), - name: Some("FilePathParts".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "segments".to_string(), - ty: DeclarationId(533), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 13131, 13183), - }); - declarations.push(Declaration { - id: DeclarationId(153), - name: Some("GlobPattern".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "segments".to_string(), - ty: DeclarationId(534), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 13184, 13234), - }); - declarations.push(Declaration { - id: DeclarationId(154), - name: Some("FilePath".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(227))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(654)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 13235, 13278), - }); - declarations.push(Declaration { - id: DeclarationId(155), - name: Some("SourceSpan".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "file".to_string(), - ty: DeclarationId(154), - }, - Field { - label: "start".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "end".to_string(), - ty: DeclarationId(87), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 13896, 13956), - }); - declarations.push(Declaration { - id: DeclarationId(156), - name: Some("Timestamp".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 14056, 14082), - }); - declarations.push(Declaration { - id: DeclarationId(157), - name: Some("EpochMs".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(87))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(655)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 14083, 14127), - }); - declarations.push(Declaration { - id: DeclarationId(158), - name: Some("Duration".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(87))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(656)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 14128, 14172), - }); - declarations.push(Declaration { - id: DeclarationId(159), - name: Some("Milliseconds".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(87))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(657)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 14173, 14240), - }); - declarations.push(Declaration { - id: DeclarationId(160), - name: Some("Seconds".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(87))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(658)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 14241, 14303), - }); - declarations.push(Declaration { - id: DeclarationId(161), - name: Some("LogicalTime".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(147))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(659)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 14470, 14529), - }); - declarations.push(Declaration { - id: DeclarationId(162), - name: Some("IntentId".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(147))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(660)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15053, 15108), - }); - declarations.push(Declaration { - id: DeclarationId(163), - name: Some("IssueId".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(147))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(661)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15109, 15163), - }); - declarations.push(Declaration { - id: DeclarationId(164), - name: Some("RunKey".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(147))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(662)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15164, 15217), - }); - declarations.push(Declaration { - id: DeclarationId(165), - name: Some("ArtifactId".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(147))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(663)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15218, 15275), - }); - declarations.push(Declaration { - id: DeclarationId(166), - name: Some("LeaseToken".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(147))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(664)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15276, 15333), - }); - declarations.push(Declaration { - id: DeclarationId(167), - name: Some("WorkerId".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(147))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(665)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15334, 15389), - }); - declarations.push(Declaration { - id: DeclarationId(168), - name: Some("CommentId".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(147))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(666)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15390, 15446), - }); - declarations.push(Declaration { - id: DeclarationId(169), - name: Some("SignalKey".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(147))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(667)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15447, 15503), - }); - declarations.push(Declaration { - id: DeclarationId(170), - name: Some("ContentHash".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(147))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(668)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15504, 15562), - }); - declarations.push(Declaration { - id: DeclarationId(171), - name: Some("WorkflowProducerId".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(147))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(669)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15793, 15864), - }); - declarations.push(Declaration { - id: DeclarationId(172), - name: Some("WorkflowObserverId".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(147))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(670)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15865, 15936), - }); - declarations.push(Declaration { - id: DeclarationId(173), - name: Some("WorkflowProverId".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(147))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(671)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15937, 16004), - }); - declarations.push(Declaration { - id: DeclarationId(174), - name: Some("WorkflowRunId".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(147))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(672)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 16005, 16066), - }); - declarations.push(Declaration { - id: DeclarationId(175), - name: Some("GitRef".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(227))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(673)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 16146, 16188), - }); - declarations.push(Declaration { - id: DeclarationId(176), - name: Some("GcpProjectId".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(227))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(674)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 16573, 16615), - }); - declarations.push(Declaration { - id: DeclarationId(177), - name: Some("ServiceAccountEmail".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 16740, 16773), - }); - declarations.push(Declaration { - id: DeclarationId(178), - name: Some("Platform".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Linux".to_string(), - ty: DeclarationId(535), - }, - Field { - label: "Macos".to_string(), - ty: DeclarationId(536), - }, - Field { - label: "Windows".to_string(), - ty: DeclarationId(537), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17159, 17202), - }); - declarations.push(Declaration { - id: DeclarationId(179), - name: Some("TopologyNodeKind".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Pure".to_string(), - ty: DeclarationId(538), - }, - Field { - label: "Transport".to_string(), - ty: DeclarationId(539), - }, - Field { - label: "SubDag".to_string(), - ty: DeclarationId(540), - }, - Field { - label: "Env".to_string(), - ty: DeclarationId(541), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17330, 17385), - }); - declarations.push(Declaration { - id: DeclarationId(180), - name: Some("DocSourceKind".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Template".to_string(), - ty: DeclarationId(542), - }, - Field { - label: "Generated".to_string(), - ty: DeclarationId(543), - }, - Field { - label: "Static".to_string(), - ty: DeclarationId(544), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17386, 17439), - }); - declarations.push(Declaration { - id: DeclarationId(181), - name: Some("FermiDepth".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Xs".to_string(), - ty: DeclarationId(545), - }, - Field { - label: "S".to_string(), - ty: DeclarationId(546), - }, - Field { - label: "M".to_string(), - ty: DeclarationId(547), - }, - Field { - label: "L".to_string(), - ty: DeclarationId(548), - }, - Field { - label: "Xl".to_string(), - ty: DeclarationId(549), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17441, 17478), - }); - declarations.push(Declaration { - id: DeclarationId(182), - name: Some("CredentialFlow".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Stored".to_string(), - ty: DeclarationId(550), - }, - Field { - label: "PlatformInjected".to_string(), - ty: DeclarationId(551), - }, - Field { - label: "WorkloadIdentity".to_string(), - ty: DeclarationId(554), - }, - Field { - label: "InteractiveAuth".to_string(), - ty: DeclarationId(556), - }, - Field { - label: "Chained".to_string(), - ty: DeclarationId(558), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17726, 18048), - }); - declarations.push(Declaration { - id: DeclarationId(183), - name: Some("Arch".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "X86_64".to_string(), - ty: DeclarationId(559), - }, - Field { - label: "X86".to_string(), - ty: DeclarationId(560), - }, - Field { - label: "Aarch64".to_string(), - ty: DeclarationId(561), - }, - Field { - label: "Arm".to_string(), - ty: DeclarationId(562), - }, - Field { - label: "Armv7".to_string(), - ty: DeclarationId(563), - }, - Field { - label: "Mips".to_string(), - ty: DeclarationId(564), - }, - Field { - label: "Mipsel".to_string(), - ty: DeclarationId(565), - }, - Field { - label: "Mips64".to_string(), - ty: DeclarationId(566), - }, - Field { - label: "Mips64el".to_string(), - ty: DeclarationId(567), - }, - Field { - label: "Riscv64".to_string(), - ty: DeclarationId(568), - }, - Field { - label: "Wasm32".to_string(), - ty: DeclarationId(569), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18123, 18226), - }); - declarations.push(Declaration { - id: DeclarationId(184), - name: Some("Vendor".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "UnknownVendor".to_string(), - ty: DeclarationId(570), - }, - Field { - label: "Pc".to_string(), - ty: DeclarationId(571), - }, - Field { - label: "Apple".to_string(), - ty: DeclarationId(572), - }, - Field { - label: "W64".to_string(), - ty: DeclarationId(573), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18227, 18273), - }); - declarations.push(Declaration { - id: DeclarationId(185), - name: Some("Os".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Linux".to_string(), - ty: DeclarationId(574), - }, - Field { - label: "Macos".to_string(), - ty: DeclarationId(575), - }, - Field { - label: "Windows".to_string(), - ty: DeclarationId(576), - }, - Field { - label: "Freebsd".to_string(), - ty: DeclarationId(577), - }, - Field { - label: "Android".to_string(), - ty: DeclarationId(578), - }, - Field { - label: "Ios".to_string(), - ty: DeclarationId(579), - }, - Field { - label: "Wasi".to_string(), - ty: DeclarationId(580), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18274, 18340), - }); - declarations.push(Declaration { - id: DeclarationId(186), - name: Some("AbiEnv".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "NoneAbi".to_string(), - ty: DeclarationId(581), - }, - Field { - label: "Gnu".to_string(), - ty: DeclarationId(582), - }, - Field { - label: "GnuEabi".to_string(), - ty: DeclarationId(583), - }, - Field { - label: "GnuEabihf".to_string(), - ty: DeclarationId(584), - }, - Field { - label: "Musl".to_string(), - ty: DeclarationId(585), - }, - Field { - label: "Msvc".to_string(), - ty: DeclarationId(586), - }, - Field { - label: "AndroidAbi".to_string(), - ty: DeclarationId(587), - }, - Field { - label: "Eabi".to_string(), - ty: DeclarationId(588), - }, - Field { - label: "Eabihf".to_string(), - ty: DeclarationId(589), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18341, 18433), - }); - declarations.push(Declaration { - id: DeclarationId(187), - name: Some("ExecutionEnv".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Native".to_string(), - ty: DeclarationId(590), - }, - Field { - label: "Wsl".to_string(), - ty: DeclarationId(591), - }, - Field { - label: "Container".to_string(), - ty: DeclarationId(592), - }, - Field { - label: "Ci".to_string(), - ty: DeclarationId(593), - }, - Field { - label: "Emulator".to_string(), - ty: DeclarationId(594), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18434, 18494), - }); - declarations.push(Declaration { - id: DeclarationId(188), - name: Some("TargetTriple".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "arch".to_string(), - ty: DeclarationId(183), - }, - Field { - label: "vendor".to_string(), - ty: DeclarationId(184), - }, - Field { - label: "os".to_string(), - ty: DeclarationId(185), - }, - Field { - label: "env".to_string(), - ty: DeclarationId(595), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18496, 18571), - }); - declarations.push(Declaration { - id: DeclarationId(189), - name: Some("RuntimePlatform".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "host".to_string(), - ty: DeclarationId(188), - }, - Field { - label: "env".to_string(), - ty: DeclarationId(187), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18573, 18638), - }); - declarations.push(Declaration { - id: DeclarationId(190), - name: Some("EntryKind".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "RegularFile".to_string(), - ty: DeclarationId(596), - }, - Field { - label: "Directory".to_string(), - ty: DeclarationId(597), - }, - Field { - label: "Symlink".to_string(), - ty: DeclarationId(598), - }, - Field { - label: "Missing".to_string(), - ty: DeclarationId(599), - }, - Field { - label: "Other".to_string(), - ty: DeclarationId(600), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18947, 19025), - }); - declarations.push(Declaration { - id: DeclarationId(191), - name: Some("SymlinkTarget".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "TargetFile".to_string(), - ty: DeclarationId(601), - }, - Field { - label: "TargetDir".to_string(), - ty: DeclarationId(602), - }, - Field { - label: "Broken".to_string(), - ty: DeclarationId(603), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 19155, 19213), - }); - declarations.push(Declaration { - id: DeclarationId(192), - name: Some("TextFilePath".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(154), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 20374, 20404), - }); - declarations.push(Declaration { - id: DeclarationId(193), - name: Some("BinaryFilePath".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(154), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 20485, 20515), - }); - declarations.push(Declaration { - id: DeclarationId(194), - name: Some("MimeType".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 20732, 20754), - }); - declarations.push(Declaration { - id: DeclarationId(195), - name: Some("HttpMethod".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "GET".to_string(), - ty: DeclarationId(604), - }, - Field { - label: "POST".to_string(), - ty: DeclarationId(605), - }, - Field { - label: "PUT".to_string(), - ty: DeclarationId(606), - }, - Field { - label: "PATCH".to_string(), - ty: DeclarationId(607), - }, - Field { - label: "DELETE".to_string(), - ty: DeclarationId(608), - }, - Field { - label: "HEAD".to_string(), - ty: DeclarationId(609), - }, - Field { - label: "OPTIONS".to_string(), - ty: DeclarationId(610), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 21498, 21566), - }); - declarations.push(Declaration { - id: DeclarationId(196), - name: Some("AuthScheme".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Bearer".to_string(), - ty: DeclarationId(611), - }, - Field { - label: "Header".to_string(), - ty: DeclarationId(612), - }, - Field { - label: "Basic".to_string(), - ty: DeclarationId(613), - }, - Field { - label: "ApiKey".to_string(), - ty: DeclarationId(614), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22034, 22130), - }); - declarations.push(Declaration { - id: DeclarationId(197), - name: Some("AccessToken".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "token".to_string(), - ty: DeclarationId(143), - }, - Field { - label: "scheme".to_string(), - ty: DeclarationId(196), - }, - Field { - label: "expires_at".to_string(), - ty: DeclarationId(615), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22252, 22385), - }); - declarations.push(Declaration { - id: DeclarationId(198), - name: Some("Credential".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "token".to_string(), - ty: DeclarationId(143), - }, - Field { - label: "scheme".to_string(), - ty: DeclarationId(196), - }, - Field { - label: "header_name".to_string(), - ty: DeclarationId(616), - }, - Field { - label: "source_id".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "required_scopes".to_string(), - ty: DeclarationId(617), - }, - Field { - label: "expires_in".to_string(), - ty: DeclarationId(618), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22387, 22537), - }); - declarations.push(Declaration { - id: DeclarationId(199), - name: Some("FilesystemHandle".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(154))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(675)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22614, 22678), - }); - declarations.push(Declaration { - id: DeclarationId(200), - name: Some("NetworkHandle".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(125))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(676)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22679, 22736), - }); - declarations.push(Declaration { - id: DeclarationId(201), - name: Some("ToolHandle".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(DeclarationId(227))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(DeclarationId(677)), - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22737, 22793), - }); - declarations.push(Declaration { - id: DeclarationId(202), - name: Some("TransportRequest".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "method".to_string(), - ty: DeclarationId(195), - }, - Field { - label: "url".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "headers".to_string(), - ty: DeclarationId(126), - }, - Field { - label: "body".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22870, 22961), - }); - declarations.push(Declaration { - id: DeclarationId(203), - name: Some("TransportResponse".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "status".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "headers".to_string(), - ty: DeclarationId(126), - }, - Field { - label: "body".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22963, 23034), - }); - declarations.push(Declaration { - id: DeclarationId(204), - name: Some("FileResponse".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "path".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "success".to_string(), - ty: DeclarationId(124), - }, - Field { - label: "content".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 23036, 23106), - }); - declarations.push(Declaration { - id: DeclarationId(205), - name: Some("ShellResponse".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "exit_code".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "stdout".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "stderr".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 23108, 23181), - }); - declarations.push(Declaration { - id: DeclarationId(206), - name: Some("RestResponse".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "status".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "headers".to_string(), - ty: DeclarationId(126), - }, - Field { - label: "body".to_string(), - ty: DeclarationId(126), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 23183, 23247), - }); - declarations.push(Declaration { - id: DeclarationId(207), - name: Some("TestResult".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "ok".to_string(), - ty: DeclarationId(124), - }, - Field { - label: "stdout".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "stderr".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "duration_ms".to_string(), - ty: DeclarationId(159), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 23324, 23431), - }); - declarations.push(Declaration { - id: DeclarationId(208), - name: Some("Summary".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "total".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "passed".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "failed".to_string(), - ty: DeclarationId(87), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 23433, 23490), - }); - declarations.push(Declaration { - id: DeclarationId(209), - name: Some("StageResult".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "success".to_string(), - ty: DeclarationId(124), - }, - Field { - label: "stdout".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "stderr".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "skipped".to_string(), - ty: DeclarationId(124), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 23492, 23593), - }); - declarations.push(Declaration { - id: DeclarationId(210), - name: Some("DocumentLine".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "text".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "is_comment".to_string(), - ty: DeclarationId(124), - }, - Field { - label: "is_blank".to_string(), - ty: DeclarationId(124), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 23746, 23818), - }); - declarations.push(Declaration { - id: DeclarationId(211), - name: Some("DocumentSection".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "title".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "has_title".to_string(), - ty: DeclarationId(124), - }, - Field { - label: "lines".to_string(), - ty: DeclarationId(619), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 23820, 23906), - }); - declarations.push(Declaration { - id: DeclarationId(212), - name: Some("Document".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "header".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "has_header".to_string(), - ty: DeclarationId(124), - }, - Field { - label: "comment_prefix".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "sections".to_string(), - ty: DeclarationId(620), - }, - Field { - label: "trailing_newline".to_string(), - ty: DeclarationId(124), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 23908, 24045), - }); - declarations.push(Declaration { - id: DeclarationId(213), - name: Some("TextFile".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "path".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "document".to_string(), - ty: DeclarationId(212), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24047, 24100), - }); - declarations.push(Declaration { - id: DeclarationId(214), - name: Some("RenderedTextFile".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "path".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "content".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24102, 24160), - }); - declarations.push(Declaration { - id: DeclarationId(215), - name: Some("ToolEntry".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "command".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "description".to_string(), - ty: DeclarationId(621), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24237, 24311), - }); - declarations.push(Declaration { - id: DeclarationId(216), - name: Some("ToolRegistry".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "tools".to_string(), - ty: DeclarationId(622), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24313, 24359), - }); - declarations.push(Declaration { - id: DeclarationId(217), - name: Some("DagTopology".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "nodes".to_string(), - ty: DeclarationId(623), - }, - Field { - label: "edges".to_string(), - ty: DeclarationId(624), - }, - Field { - label: "subdag_boundaries".to_string(), - ty: DeclarationId(625), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24618, 24728), - }); - declarations.push(Declaration { - id: DeclarationId(218), - name: Some("TopologyNode".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "id".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "label".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "kind".to_string(), - ty: DeclarationId(179), - }, - Field { - label: "parent".to_string(), - ty: DeclarationId(626), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24730, 24850), - }); - declarations.push(Declaration { - id: DeclarationId(219), - name: Some("TopologyEdge".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "from".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "to".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "port".to_string(), - ty: DeclarationId(627), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24852, 24917), - }); - declarations.push(Declaration { - id: DeclarationId(220), - name: Some("DagDiff".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "added".to_string(), - ty: DeclarationId(628), - }, - Field { - label: "removed".to_string(), - ty: DeclarationId(629), - }, - Field { - label: "changed".to_string(), - ty: DeclarationId(630), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24919, 25005), - }); - declarations.push(Declaration { - id: DeclarationId(221), - name: Some("CodegenTarget".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "path".to_string(), - ty: DeclarationId(154), - }, - Field { - label: "backend".to_string(), - ty: DeclarationId(631), - }, - Field { - label: "target".to_string(), - ty: DeclarationId(632), - }, - Field { - label: "runtime_env".to_string(), - ty: DeclarationId(633), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25074, 25208), - }); - declarations.push(Declaration { - id: DeclarationId(222), - name: Some("CodegenBackend".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Rust".to_string(), - ty: DeclarationId(634), - }, - Field { - label: "Go".to_string(), - ty: DeclarationId(635), - }, - Field { - label: "C".to_string(), - ty: DeclarationId(636), - }, - Field { - label: "Mips".to_string(), - ty: DeclarationId(637), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25210, 25252), - }); - declarations.push(Declaration { - id: DeclarationId(223), - name: Some("PragmaDirective".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "key".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "value".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "scope".to_string(), - ty: DeclarationId(638), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25254, 25325), - }); - declarations.push(Declaration { - id: DeclarationId(224), - name: Some("DocSource".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "path".to_string(), - ty: DeclarationId(154), - }, - Field { - label: "kind".to_string(), - ty: DeclarationId(180), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25466, 25523), - }); - declarations.push(Declaration { - id: DeclarationId(225), - name: Some("ReferenceModel".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![DeclarationId(226)], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 27457, 27476), - }); - declarations.push(Declaration { - id: DeclarationId(226), - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 27457, 27476), - }); - declarations.push(Declaration { - id: DeclarationId(227), - name: Some("String".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(128), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/string_type.dag", 606, 636), - }); - declarations.push(Declaration { - id: DeclarationId(228), - name: Some("CharClass".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Whitespace".to_string(), - ty: DeclarationId(678), - }, - Field { - label: "Digit".to_string(), - ty: DeclarationId(679), - }, - Field { - label: "IdentStart".to_string(), - ty: DeclarationId(680), - }, - Field { - label: "IdentContinue".to_string(), - ty: DeclarationId(681), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 3662, 3726), - }); - declarations.push(Declaration { - id: DeclarationId(229), - name: Some("char_in_class".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(128), DeclarationId(228)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(250))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 4059, 4926), - }); - declarations.push(Declaration { - id: DeclarationId(230), - name: Some("DisplayWidth".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "ZeroWidth".to_string(), - ty: DeclarationId(682), - }, - Field { - label: "Narrow".to_string(), - ty: DeclarationId(683), - }, - Field { - label: "Wide".to_string(), - ty: DeclarationId(684), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 5290, 5335), - }); - declarations.push(Declaration { - id: DeclarationId(231), - name: Some("display_width_columns".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(230)], - output: DeclarationId(87), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/unicode.dag", 5386, 5462)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 5337, 5462), - }); - declarations.push(Declaration { - id: DeclarationId(232), - name: Some("UnicodeBlock".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "name".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "start".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "end_inclusive".to_string(), - ty: DeclarationId(87), - }, - Field { - label: "default_width".to_string(), - ty: DeclarationId(230), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 5697, 5797), - }); - declarations.push(Declaration { - id: DeclarationId(233), - name: Some("zero_width_blocks".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(232), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(685)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::List(vec![ - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String( - "Combining Diacritical Marks".to_string(), - )), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("768".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("879".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(682), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String( - "Combining Diacritical Marks Extended".to_string(), - )), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("6832".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("6911".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(682), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String( - "Combining Diacritical Marks Supplement".to_string(), - )), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("7616".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("7679".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(682), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String( - "Combining Marks for Symbols".to_string(), - )), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("8400".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("8447".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(682), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("Variation Selectors".to_string())), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("65024".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("65039".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(682), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String( - "Combining Half Marks".to_string(), - )), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("65056".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("65071".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(682), - payload: vec![], - }, - ), - ]), - ])), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 5859, 6608), - }); - declarations.push(Declaration { - id: DeclarationId(234), - name: Some("zero_width_codepoints".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(686)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::List(vec![ - FieldValue::Literal(LiteralBits::Int("8203".to_string())), - FieldValue::Literal(LiteralBits::Int("8204".to_string())), - FieldValue::Literal(LiteralBits::Int("8205".to_string())), - FieldValue::Literal(LiteralBits::Int("65279".to_string())), - ])), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 6675, 6887), - }); - declarations.push(Declaration { - id: DeclarationId(235), - name: Some("wide_blocks".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(232), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(687)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::List(vec![ - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("Hangul Jamo".to_string())), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("4352".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("4447".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(684), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String( - "CJK Radicals and Symbols".to_string(), - )), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("11904".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("12350".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(684), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String( - "Hiragana / Katakana / CJK Compat".to_string(), - )), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("12353".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("13247".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(684), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("CJK Extension A".to_string())), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("13312".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("19903".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(684), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String( - "CJK Unified Ideographs".to_string(), - )), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("19968".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("40959".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(684), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String( - "Yi Syllables and Radicals".to_string(), - )), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("40960".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("42191".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(684), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("Hangul Syllables".to_string())), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("44032".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("55215".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(684), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String( - "CJK Compatibility Ideographs".to_string(), - )), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("63744".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("64255".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(684), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String( - "CJK Compatibility Forms".to_string(), - )), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("65072".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("65135".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(684), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("Fullwidth ASCII".to_string())), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("65281".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("65376".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(684), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("Fullwidth Signs".to_string())), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("65504".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("65510".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(684), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("CJK Extension B+".to_string())), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("131072".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("196607".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(684), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("CJK Extension G+".to_string())), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("196608".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("262143".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(684), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String( - "Misc Symbols and Dingbats".to_string(), - )), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("9728".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("10175".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(684), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String( - "Symbols / Pictographs / Emoticons".to_string(), - )), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("127744".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("129535".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(684), - payload: vec![], - }, - ), - ]), - FieldValue::Record(vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("Symbols Extended".to_string())), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("129536".to_string())), - ), - ( - "end_inclusive".to_string(), - FieldValue::Literal(LiteralBits::Int("131071".to_string())), - ), - ( - "default_width".to_string(), - FieldValue::Variant { - constructor: DeclarationId(684), - payload: vec![], - }, - ), - ]), - ])), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 6934, 8723), - }); - declarations.push(Declaration { - id: DeclarationId(236), - name: Some("code_point".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(128)], - output: DeclarationId(87), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(253))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 8873, 8910), - }); - declarations.push(Declaration { - id: DeclarationId(237), - name: Some("in_block".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87), DeclarationId(232)], - output: DeclarationId(124), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/unicode.dag", 8962, 9014)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 8912, 9014), - }); - declarations.push(Declaration { - id: DeclarationId(238), - name: Some("char_display_width".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(128)], - output: DeclarationId(230), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/unicode.dag", 9063, 9366)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 9016, 9366), - }); - declarations.push(Declaration { - id: DeclarationId(239), - name: Some("char_width".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(128)], - output: DeclarationId(87), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/unicode.dag", 9398, 9454)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 9368, 9454), - }); - declarations.push(Declaration { - id: DeclarationId(240), - name: Some("string_display_width".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227)], - output: DeclarationId(87), - body: ArrowBody::Unparsed(SourceSpan::new("dsl/std/unicode.dag", 9498, 9636)), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 9456, 9636), - }); - declarations.push(Declaration { - id: DeclarationId(241), - name: Some("repeat_string_loop".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227), DeclarationId(227), DeclarationId(87)], - output: DeclarationId(227), - body: ArrowBody::Unparsed(SourceSpan::new( - "dsl/std/render_repeat_string_bootstrap.dag", - 598, - 717, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/render_repeat_string_bootstrap.dag", 526, 717), - }); - declarations.push(Declaration { - id: DeclarationId(242), - name: Some("repeat_string".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227), DeclarationId(87)], - output: DeclarationId(227), - body: ArrowBody::Unparsed(SourceSpan::new( - "dsl/std/render_repeat_string_bootstrap.dag", - 765, - 818, - )), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/render_repeat_string_bootstrap.dag", 719, 818), - }); - declarations.push(Declaration { - id: DeclarationId(243), - name: Some("MethodDeclaration".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "name".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 4779, 4820), - }); - declarations.push(Declaration { - id: DeclarationId(244), - name: Some("add_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("add".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 5269, 5321), - }); - declarations.push(Declaration { - id: DeclarationId(245), - name: Some("all_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("all".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 5322, 5374), - }); - declarations.push(Declaration { - id: DeclarationId(246), - name: Some("any_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("any".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 5375, 5427), - }); - declarations.push(Declaration { - id: DeclarationId(247), - name: Some("append_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("append".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 5428, 5486), - }); - declarations.push(Declaration { - id: DeclarationId(248), - name: Some("bottom_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("bottom".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 5487, 5545), - }); - declarations.push(Declaration { - id: DeclarationId(249), - name: Some("chars_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("chars".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 5546, 5602), - }); - declarations.push(Declaration { - id: DeclarationId(250), - name: Some("clamp_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("clamp".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 5603, 5659), - }); - declarations.push(Declaration { - id: DeclarationId(251), - name: Some("compare_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("compare".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 5660, 5720), - }); - declarations.push(Declaration { - id: DeclarationId(252), - name: Some("complement_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("complement".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 5721, 5787), - }); - declarations.push(Declaration { - id: DeclarationId(253), - name: Some("concat_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("concat".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 5788, 5846), - }); - declarations.push(Declaration { - id: DeclarationId(254), - name: Some("contains_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("contains".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 5847, 5909), - }); - declarations.push(Declaration { - id: DeclarationId(255), - name: Some("count_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("count".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 5910, 5966), - }); - declarations.push(Declaration { - id: DeclarationId(256), - name: Some("diff_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("diff".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 5967, 6021), - }); - declarations.push(Declaration { - id: DeclarationId(257), - name: Some("empty_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("empty".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 6022, 6078), - }); - declarations.push(Declaration { - id: DeclarationId(258), - name: Some("ends_with_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("ends_with".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 6079, 6143), - }); - declarations.push(Declaration { - id: DeclarationId(259), - name: Some("enumerate_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("enumerate".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 6144, 6208), - }); - declarations.push(Declaration { - id: DeclarationId(260), - name: Some("filter_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("filter".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 6209, 6267), - }); - declarations.push(Declaration { - id: DeclarationId(261), - name: Some("first_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("first".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 6268, 6324), - }); - declarations.push(Declaration { - id: DeclarationId(262), - name: Some("flat_map_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("flat_map".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 6325, 6387), - }); - declarations.push(Declaration { - id: DeclarationId(263), - name: Some("fold_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("fold".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 6388, 6442), - }); - declarations.push(Declaration { - id: DeclarationId(264), - name: Some("get_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("get".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 6443, 6495), - }); - declarations.push(Declaration { - id: DeclarationId(265), - name: Some("has_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("has".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 6496, 6548), - }); - declarations.push(Declaration { - id: DeclarationId(266), - name: Some("intersect_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("intersect".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 6549, 6613), - }); - declarations.push(Declaration { - id: DeclarationId(267), - name: Some("is_empty_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("is_empty".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 6614, 6676), - }); - declarations.push(Declaration { - id: DeclarationId(268), - name: Some("join_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("join".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 6677, 6731), - }); - declarations.push(Declaration { - id: DeclarationId(269), - name: Some("keys_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("keys".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 6732, 6786), - }); - declarations.push(Declaration { - id: DeclarationId(270), - name: Some("last_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("last".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 6787, 6841), - }); - declarations.push(Declaration { - id: DeclarationId(271), - name: Some("length_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("length".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 6842, 6900), - }); - declarations.push(Declaration { - id: DeclarationId(272), - name: Some("list_push_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("list_push".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 6901, 6965), - }); - declarations.push(Declaration { - id: DeclarationId(273), - name: Some("lookup_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("lookup".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 6966, 7024), - }); - declarations.push(Declaration { - id: DeclarationId(274), - name: Some("map_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("map".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 7025, 7077), - }); - declarations.push(Declaration { - id: DeclarationId(275), - name: Some("map_contains_key_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("map_contains_key".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 7078, 7156), - }); - declarations.push(Declaration { - id: DeclarationId(276), - name: Some("map_get_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("map_get".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 7157, 7217), - }); - declarations.push(Declaration { - id: DeclarationId(277), - name: Some("map_has_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("map_has".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 7218, 7278), - }); - declarations.push(Declaration { - id: DeclarationId(278), - name: Some("map_insert_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("map_insert".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 7279, 7345), - }); - declarations.push(Declaration { - id: DeclarationId(279), - name: Some("map_keys_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("map_keys".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 7346, 7408), - }); - declarations.push(Declaration { - id: DeclarationId(280), - name: Some("map_merge_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("map_merge".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 7409, 7473), - }); - declarations.push(Declaration { - id: DeclarationId(281), - name: Some("map_values_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("map_values".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 7474, 7540), - }); - declarations.push(Declaration { - id: DeclarationId(282), - name: Some("meet_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("meet".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 7541, 7595), - }); - declarations.push(Declaration { - id: DeclarationId(283), - name: Some("member_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("member".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 7596, 7654), - }); - declarations.push(Declaration { - id: DeclarationId(284), - name: Some("mul_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("mul".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 7655, 7707), - }); - declarations.push(Declaration { - id: DeclarationId(285), - name: Some("negate_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("negate".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 7708, 7766), - }); - declarations.push(Declaration { - id: DeclarationId(286), - name: Some("one_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("one".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 7767, 7819), - }); - declarations.push(Declaration { - id: DeclarationId(287), - name: Some("reciprocal_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("reciprocal".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 7820, 7886), - }); - declarations.push(Declaration { - id: DeclarationId(288), - name: Some("replace_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("replace".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 7887, 7947), - }); - declarations.push(Declaration { - id: DeclarationId(289), - name: Some("reverse_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("reverse".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 7948, 8008), - }); - declarations.push(Declaration { - id: DeclarationId(290), - name: Some("skip_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("skip".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 8009, 8063), - }); - declarations.push(Declaration { - id: DeclarationId(291), - name: Some("sort_by_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("sort_by".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 8064, 8124), - }); - declarations.push(Declaration { - id: DeclarationId(292), - name: Some("split_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("split".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 8125, 8181), - }); - declarations.push(Declaration { - id: DeclarationId(293), - name: Some("starts_with_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("starts_with".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 8182, 8250), - }); - declarations.push(Declaration { - id: DeclarationId(294), - name: Some("string_contains_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("string_contains".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 8251, 8327), - }); - declarations.push(Declaration { - id: DeclarationId(295), - name: Some("substring_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("substring".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 8328, 8392), - }); - declarations.push(Declaration { - id: DeclarationId(296), - name: Some("take_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("take".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 8393, 8447), - }); - declarations.push(Declaration { - id: DeclarationId(297), - name: Some("to_int_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("to_int".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 8448, 8506), - }); - declarations.push(Declaration { - id: DeclarationId(298), - name: Some("to_lower_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("to_lower".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 8507, 8569), - }); - declarations.push(Declaration { - id: DeclarationId(299), - name: Some("to_string_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("to_string".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 8570, 8634), - }); - declarations.push(Declaration { - id: DeclarationId(300), - name: Some("to_upper_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("to_upper".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 8635, 8697), - }); - declarations.push(Declaration { - id: DeclarationId(301), - name: Some("top_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("top".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 8698, 8750), - }); - declarations.push(Declaration { - id: DeclarationId(302), - name: Some("trim_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("trim".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 8751, 8805), - }); - declarations.push(Declaration { - id: DeclarationId(303), - name: Some("union_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("union".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 8806, 8862), - }); - declarations.push(Declaration { - id: DeclarationId(304), - name: Some("values_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("values".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 8863, 8921), - }); - declarations.push(Declaration { - id: DeclarationId(305), - name: Some("with_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("with".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 8922, 8976), - }); - declarations.push(Declaration { - id: DeclarationId(306), - name: Some("zero_method".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(243), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: Some(DeclarationId(243)), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![( - "name".to_string(), - FieldValue::Literal(LiteralBits::String("zero".to_string())), - )], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/methods.dag", 8977, 9031), - }); - declarations.push(Declaration { - id: DeclarationId(307), - name: Some("DeclarationRef".to_string()), - connective: TypeConnective::Instantiation { - template: DeclarationId(227), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/serialization.dag", 692, 720), - }); - declarations.push(Declaration { - id: DeclarationId(308), - name: Some("VariantNaming".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "AsAuthored".to_string(), - ty: DeclarationId(688), - }, - Field { - label: "SnakeCase".to_string(), - ty: DeclarationId(689), - }, - Field { - label: "StripPrefixAndSnakeCase".to_string(), - ty: DeclarationId(690), - }, - Field { - label: "StripSuffixAndSnakeCase".to_string(), - ty: DeclarationId(691), - }, - Field { - label: "StripPrefixSuffixAndSnakeCase".to_string(), - ty: DeclarationId(692), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/serialization.dag", 1850, 2060), - }); - declarations.push(Declaration { - id: DeclarationId(309), - name: Some("VariantEncoding".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "StringVariant".to_string(), - ty: DeclarationId(693), - }, - Field { - label: "InternallyTaggedObject".to_string(), - ty: DeclarationId(694), - }, - Field { - label: "UntaggedVariant".to_string(), - ty: DeclarationId(695), - }, - Field { - label: "TaggedVariant".to_string(), - ty: DeclarationId(696), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/serialization.dag", 2606, 2780), - }); - declarations.push(Declaration { - id: DeclarationId(310), - name: Some("CoproductWireContract".to_string()), - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "coproduct".to_string(), - ty: DeclarationId(307), - }, - Field { - label: "encoding".to_string(), - ty: DeclarationId(309), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/serialization.dag", 3002, 3088), - }); - declarations.push(Declaration { - id: DeclarationId(311), - name: Some("WireContract".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "variant_encoding".to_string(), - ty: DeclarationId(309), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/serialization.dag", 3233, 3290), - }); - declarations.push(Declaration { - id: DeclarationId(312), - name: Some("WireFormat".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Json".to_string(), - ty: DeclarationId(697), - }, - Field { - label: "Text".to_string(), - ty: DeclarationId(698), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/serialization.dag", 3481, 3510), - }); - declarations.push(Declaration { - id: DeclarationId(313), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/logic.dag", 304, 308), - }); - declarations.push(Declaration { - id: DeclarationId(314), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/logic.dag", 311, 316), - }); - declarations.push(Declaration { - id: DeclarationId(315), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(4), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/bit.dag", 1023, 1032), - }); - declarations.push(Declaration { - id: DeclarationId(316), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(4), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/bit.dag", 1136, 1145), - }); - declarations.push(Declaration { - id: DeclarationId(317), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(6), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/bit.dag", 1272, 1282), - }); - declarations.push(Declaration { - id: DeclarationId(318), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(6), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/bit.dag", 1306, 1316), - }); - declarations.push(Declaration { - id: DeclarationId(319), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(6), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/bit.dag", 1340, 1350), - }); - declarations.push(Declaration { - id: DeclarationId(320), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(6), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/bit.dag", 1375, 1385), - }); - declarations.push(Declaration { - id: DeclarationId(321), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "value".to_string(), - ty: DeclarationId(12), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/error_primitives.dag", 620, 636), - }); - declarations.push(Declaration { - id: DeclarationId(322), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "value".to_string(), - ty: DeclarationId(13), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/error_primitives.dag", 639, 657), - }); - declarations.push(Declaration { - id: DeclarationId(323), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/error_primitives.dag", 936, 948), - }); - declarations.push(Declaration { - id: DeclarationId(324), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/error_primitives.dag", 951, 959), - }); - declarations.push(Declaration { - id: DeclarationId(325), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(58), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 24253, 24279), - }); - declarations.push(Declaration { - id: DeclarationId(326), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(58), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 25463, 25489), - }); - declarations.push(Declaration { - id: DeclarationId(327), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(58), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 26620, 26646), - }); - declarations.push(Declaration { - id: DeclarationId(328), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(58), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 27746, 27772), - }); - declarations.push(Declaration { - id: DeclarationId(329), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(58), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 31202, 31228), - }); - declarations.push(Declaration { - id: DeclarationId(330), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(58), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 34515, 34541), - }); - declarations.push(Declaration { - id: DeclarationId(331), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(58), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 39940, 39966), - }); - declarations.push(Declaration { - id: DeclarationId(332), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(58), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 42853, 42879), - }); - declarations.push(Declaration { - id: DeclarationId(333), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 43672, 43684), - }); - declarations.push(Declaration { - id: DeclarationId(334), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(16), DeclarationId(16)], - output: DeclarationId(16), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 4724, 4737), - }); - declarations.push(Declaration { - id: DeclarationId(335), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(18), DeclarationId(18)], - output: DeclarationId(18), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 4843, 4856), - }); - declarations.push(Declaration { - id: DeclarationId(336), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(20), DeclarationId(20)], - output: DeclarationId(20), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 5060, 5073), - }); - declarations.push(Declaration { - id: DeclarationId(337), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(22), DeclarationId(22)], - output: DeclarationId(22), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 5182, 5195), - }); - declarations.push(Declaration { - id: DeclarationId(338), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(24), DeclarationId(24)], - output: DeclarationId(24), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 5333, 5346), - }); - declarations.push(Declaration { - id: DeclarationId(339), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(24)], - output: DeclarationId(24), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 5372, 5382), - }); - declarations.push(Declaration { - id: DeclarationId(340), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(26), DeclarationId(26)], - output: DeclarationId(26), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 5451, 5464), - }); - declarations.push(Declaration { - id: DeclarationId(341), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(26)], - output: DeclarationId(26), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 5490, 5500), - }); - declarations.push(Declaration { - id: DeclarationId(342), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(32), DeclarationId(32)], - output: DeclarationId(32), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 10528, 10541), - }); - declarations.push(Declaration { - id: DeclarationId(343), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(32), DeclarationId(32)], - output: DeclarationId(32), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 10559, 10572), - }); - declarations.push(Declaration { - id: DeclarationId(344), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(34), DeclarationId(34)], - output: DeclarationId(34), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 11014, 11027), - }); - declarations.push(Declaration { - id: DeclarationId(345), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(34), DeclarationId(34)], - output: DeclarationId(34), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 11045, 11058), - }); - declarations.push(Declaration { - id: DeclarationId(346), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(36), DeclarationId(36)], - output: DeclarationId(36), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 11218, 11231), - }); - declarations.push(Declaration { - id: DeclarationId(347), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(36)], - output: DeclarationId(36), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 11252, 11262), - }); - declarations.push(Declaration { - id: DeclarationId(348), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(36), DeclarationId(36)], - output: DeclarationId(36), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 11270, 11283), - }); - declarations.push(Declaration { - id: DeclarationId(349), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(38), DeclarationId(38)], - output: DeclarationId(38), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12084, 12097), - }); - declarations.push(Declaration { - id: DeclarationId(350), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(38), DeclarationId(38)], - output: DeclarationId(38), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12105, 12118), - }); - declarations.push(Declaration { - id: DeclarationId(351), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(38)], - output: DeclarationId(38), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12139, 12149), - }); - declarations.push(Declaration { - id: DeclarationId(352), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(38), DeclarationId(38)], - output: DeclarationId(38), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12157, 12170), - }); - declarations.push(Declaration { - id: DeclarationId(353), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(11), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(12), - value: DeclarationId(38), - }, - TemplateArgument { - parameter: DeclarationId(13), - value: DeclarationId(14), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12190, 12209), - }); - declarations.push(Declaration { - id: DeclarationId(354), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(38), DeclarationId(38)], - output: DeclarationId(353), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12178, 12209), - }); - declarations.push(Declaration { - id: DeclarationId(355), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(38), DeclarationId(38)], - output: DeclarationId(52), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12230, 12250), - }); - declarations.push(Declaration { - id: DeclarationId(356), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(38), DeclarationId(38)], - output: DeclarationId(124), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12257, 12273), - }); - declarations.push(Declaration { - id: DeclarationId(357), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(38), DeclarationId(38)], - output: DeclarationId(124), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12280, 12296), - }); - declarations.push(Declaration { - id: DeclarationId(358), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(38), DeclarationId(38)], - output: DeclarationId(124), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12303, 12319), - }); - declarations.push(Declaration { - id: DeclarationId(359), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(38), DeclarationId(38)], - output: DeclarationId(124), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12326, 12342), - }); - declarations.push(Declaration { - id: DeclarationId(360), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(38), DeclarationId(38)], - output: DeclarationId(124), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12349, 12365), - }); - declarations.push(Declaration { - id: DeclarationId(361), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(38), DeclarationId(38)], - output: DeclarationId(124), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12372, 12388), - }); - declarations.push(Declaration { - id: DeclarationId(362), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(40), DeclarationId(40)], - output: DeclarationId(40), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12551, 12564), - }); - declarations.push(Declaration { - id: DeclarationId(363), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(40)], - output: DeclarationId(40), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12585, 12595), - }); - declarations.push(Declaration { - id: DeclarationId(364), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(40), DeclarationId(40)], - output: DeclarationId(40), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12603, 12616), - }); - declarations.push(Declaration { - id: DeclarationId(365), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(40)], - output: DeclarationId(40), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12640, 12650), - }); - declarations.push(Declaration { - id: DeclarationId(366), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(40), DeclarationId(40)], - output: DeclarationId(52), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 12662, 12682), - }); - declarations.push(Declaration { - id: DeclarationId(367), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(42), DeclarationId(42)], - output: DeclarationId(42), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 13030, 13043), - }); - declarations.push(Declaration { - id: DeclarationId(368), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(42), DeclarationId(42)], - output: DeclarationId(42), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 13052, 13065), - }); - declarations.push(Declaration { - id: DeclarationId(369), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(44), DeclarationId(44)], - output: DeclarationId(44), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 13208, 13221), - }); - declarations.push(Declaration { - id: DeclarationId(370), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(44), DeclarationId(44)], - output: DeclarationId(44), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 13230, 13243), - }); - declarations.push(Declaration { - id: DeclarationId(371), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(46), DeclarationId(46)], - output: DeclarationId(46), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 13497, 13510), - }); - declarations.push(Declaration { - id: DeclarationId(372), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(46), DeclarationId(46)], - output: DeclarationId(46), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 13519, 13532), - }); - declarations.push(Declaration { - id: DeclarationId(373), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(46)], - output: DeclarationId(46), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 13547, 13557), - }); - declarations.push(Declaration { - id: DeclarationId(374), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(48), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17529, 17542), - }); - declarations.push(Declaration { - id: DeclarationId(375), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(48), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17544, 17557), - }); - declarations.push(Declaration { - id: DeclarationId(376), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(48), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17562, 17575), - }); - declarations.push(Declaration { - id: DeclarationId(377), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(374), DeclarationId(375)], - output: DeclarationId(376), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17526, 17575), - }); - declarations.push(Declaration { - id: DeclarationId(378), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(48), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17585, 17598), - }); - declarations.push(Declaration { - id: DeclarationId(379), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(48), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17618, 17631), - }); - declarations.push(Declaration { - id: DeclarationId(380), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(48)], - output: DeclarationId(379), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17609, 17631), - }); - declarations.push(Declaration { - id: DeclarationId(381), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(48), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17733, 17746), - }); - declarations.push(Declaration { - id: DeclarationId(382), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87), DeclarationId(87)], - output: DeclarationId(381), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17717, 17746), - }); - declarations.push(Declaration { - id: DeclarationId(383), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(87), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17757, 17768), - }); - declarations.push(Declaration { - id: DeclarationId(384), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(124), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17781, 17793), - }); - declarations.push(Declaration { - id: DeclarationId(385), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(87), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17803, 17814), - }); - declarations.push(Declaration { - id: DeclarationId(386), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(48), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17832, 17834), - }); - declarations.push(Declaration { - id: DeclarationId(387), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(386), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17824, 17834), - }); - declarations.push(Declaration { - id: DeclarationId(388), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(48), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17851, 17853), - }); - declarations.push(Declaration { - id: DeclarationId(389), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(388), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17843, 17853), - }); - declarations.push(Declaration { - id: DeclarationId(390), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(48)], - output: DeclarationId(48), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17951, 17961), - }); - declarations.push(Declaration { - id: DeclarationId(391), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(48), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17966, 17979), - }); - declarations.push(Declaration { - id: DeclarationId(392), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(390)], - output: DeclarationId(391), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17948, 17979), - }); - declarations.push(Declaration { - id: DeclarationId(393), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(48)], - output: DeclarationId(124), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17993, 18006), - }); - declarations.push(Declaration { - id: DeclarationId(394), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(48), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18011, 18024), - }); - declarations.push(Declaration { - id: DeclarationId(395), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(393)], - output: DeclarationId(394), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 17990, 18024), - }); - declarations.push(Declaration { - id: DeclarationId(396), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(48), DeclarationId(48)], - output: DeclarationId(48), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18039, 18052), - }); - declarations.push(Declaration { - id: DeclarationId(397), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(48), DeclarationId(396)], - output: DeclarationId(48), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18033, 18058), - }); - declarations.push(Declaration { - id: DeclarationId(398), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(48), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18083, 18096), - }); - declarations.push(Declaration { - id: DeclarationId(399), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(48)], - output: DeclarationId(398), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18074, 18096), - }); - declarations.push(Declaration { - id: DeclarationId(400), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(48), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18101, 18114), - }); - declarations.push(Declaration { - id: DeclarationId(401), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(399)], - output: DeclarationId(400), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18071, 18114), - }); - declarations.push(Declaration { - id: DeclarationId(402), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(48)], - output: DeclarationId(124), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18125, 18138), - }); - declarations.push(Declaration { - id: DeclarationId(403), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(402)], - output: DeclarationId(124), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18122, 18147), - }); - declarations.push(Declaration { - id: DeclarationId(404), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(48)], - output: DeclarationId(124), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18158, 18171), - }); - declarations.push(Declaration { - id: DeclarationId(405), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(404)], - output: DeclarationId(124), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18155, 18180), - }); - declarations.push(Declaration { - id: DeclarationId(406), - name: None, - connective: TypeConnective::Atom(AtomPayload::UnresolvedIdentifier( - "Tuple".to_string(), - )), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18245, 18258), - }); - declarations.push(Declaration { - id: DeclarationId(407), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(406), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18245, 18258), - }); - declarations.push(Declaration { - id: DeclarationId(408), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(407), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18234, 18259), - }); - declarations.push(Declaration { - id: DeclarationId(409), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(408), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18226, 18259), - }); - declarations.push(Declaration { - id: DeclarationId(410), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(48), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18279, 18292), - }); - declarations.push(Declaration { - id: DeclarationId(411), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(410), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18271, 18292), - }); - declarations.push(Declaration { - id: DeclarationId(412), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(48), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18312, 18325), - }); - declarations.push(Declaration { - id: DeclarationId(413), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87)], - output: DeclarationId(412), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18301, 18325), - }); - declarations.push(Declaration { - id: DeclarationId(414), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(48), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18345, 18358), - }); - declarations.push(Declaration { - id: DeclarationId(415), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87)], - output: DeclarationId(414), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18334, 18358), - }); - declarations.push(Declaration { - id: DeclarationId(416), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(48), DeclarationId(48)], - output: DeclarationId(87), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18373, 18388), - }); - declarations.push(Declaration { - id: DeclarationId(417), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(48), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18393, 18406), - }); - declarations.push(Declaration { - id: DeclarationId(418), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(416)], - output: DeclarationId(417), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18370, 18406), - }); - declarations.push(Declaration { - id: DeclarationId(419), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(48)], - output: DeclarationId(124), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 18419, 18432), - }); - declarations.push(Declaration { - id: DeclarationId(420), - name: None, - connective: TypeConnective::Atom(AtomPayload::UnresolvedIdentifier( - "Witness".to_string(), - )), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19011, 19021), - }); - declarations.push(Declaration { - id: DeclarationId(421), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(420), - arguments: vec![], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19011, 19021), - }); - declarations.push(Declaration { - id: DeclarationId(422), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(50)], - output: DeclarationId(421), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19002, 19021), - }); - declarations.push(Declaration { - id: DeclarationId(423), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(49), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(50), - value: DeclarationId(50), - }, - TemplateArgument { - parameter: DeclarationId(51), - value: DeclarationId(51), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19031, 19052), - }); - declarations.push(Declaration { - id: DeclarationId(424), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(51), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19069, 19071), - }); - declarations.push(Declaration { - id: DeclarationId(425), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(50)], - output: DeclarationId(424), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19060, 19071), - }); - declarations.push(Declaration { - id: DeclarationId(426), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(49), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(50), - value: DeclarationId(50), - }, - TemplateArgument { - parameter: DeclarationId(51), - value: DeclarationId(51), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19094, 19115), - }); - declarations.push(Declaration { - id: DeclarationId(427), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(50), DeclarationId(51)], - output: DeclarationId(426), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19082, 19115), - }); - declarations.push(Declaration { - id: DeclarationId(428), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(49), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(50), - value: DeclarationId(50), - }, - TemplateArgument { - parameter: DeclarationId(51), - value: DeclarationId(51), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19128, 19149), - }); - declarations.push(Declaration { - id: DeclarationId(429), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(49), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(50), - value: DeclarationId(50), - }, - TemplateArgument { - parameter: DeclarationId(51), - value: DeclarationId(51), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19154, 19175), - }); - declarations.push(Declaration { - id: DeclarationId(430), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(428)], - output: DeclarationId(429), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19125, 19175), - }); - declarations.push(Declaration { - id: DeclarationId(431), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(50), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19192, 19205), - }); - declarations.push(Declaration { - id: DeclarationId(432), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(431), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19184, 19205), - }); - declarations.push(Declaration { - id: DeclarationId(433), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(47), - arguments: vec![TemplateArgument { - parameter: DeclarationId(48), - value: DeclarationId(51), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19224, 19237), - }); - declarations.push(Declaration { - id: DeclarationId(434), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(433), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19216, 19237), - }); - declarations.push(Declaration { - id: DeclarationId(435), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(50)], - output: DeclarationId(124), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19245, 19258), - }); - declarations.push(Declaration { - id: DeclarationId(436), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(50)], - output: DeclarationId(124), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19275, 19288), - }); - declarations.push(Declaration { - id: DeclarationId(437), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![], - output: DeclarationId(87), - body: ArrowBody::NoBody, - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19297, 19308), - }); - declarations.push(Declaration { - id: DeclarationId(438), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19527, 19531), - }); - declarations.push(Declaration { - id: DeclarationId(439), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19534, 19539), - }); - declarations.push(Declaration { - id: DeclarationId(440), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 19542, 19549), - }); - declarations.push(Declaration { - id: DeclarationId(441), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 21658, 21676), - }); - declarations.push(Declaration { - id: DeclarationId(442), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 21681, 21704), - }); - declarations.push(Declaration { - id: DeclarationId(443), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 21709, 21730), - }); - declarations.push(Declaration { - id: DeclarationId(444), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 21735, 21766), - }); - declarations.push(Declaration { - id: DeclarationId(445), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 21771, 21794), - }); - declarations.push(Declaration { - id: DeclarationId(446), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 21799, 21826), - }); - declarations.push(Declaration { - id: DeclarationId(447), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 21831, 21853), - }); - declarations.push(Declaration { - id: DeclarationId(448), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 21880, 21894), - }); - declarations.push(Declaration { - id: DeclarationId(449), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "name".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 21899, 21921), - }); - declarations.push(Declaration { - id: DeclarationId(450), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 21952, 21964), - }); - declarations.push(Declaration { - id: DeclarationId(451), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 21969, 21984), - }); - declarations.push(Declaration { - id: DeclarationId(452), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 21989, 22000), - }); - declarations.push(Declaration { - id: DeclarationId(453), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 22005, 22018), - }); - declarations.push(Declaration { - id: DeclarationId(454), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "name".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 22023, 22053), - }); - declarations.push(Declaration { - id: DeclarationId(455), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "source".to_string(), - ty: DeclarationId(54), - }, - Field { - label: "element".to_string(), - ty: DeclarationId(55), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 22058, 22127), - }); - declarations.push(Declaration { - id: DeclarationId(456), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "inner".to_string(), - ty: DeclarationId(55), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 22132, 22173), - }); - declarations.push(Declaration { - id: DeclarationId(457), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "inner".to_string(), - ty: DeclarationId(55), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 22178, 22218), - }); - declarations.push(Declaration { - id: DeclarationId(458), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "first".to_string(), - ty: DeclarationId(55), - }, - Field { - label: "second".to_string(), - ty: DeclarationId(55), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 22223, 22290), - }); - declarations.push(Declaration { - id: DeclarationId(459), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(55), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 22316, 22341), - }); - declarations.push(Declaration { - id: DeclarationId(460), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "params".to_string(), - ty: DeclarationId(459), - }, - Field { - label: "return_type".to_string(), - ty: DeclarationId(55), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 22295, 22377), - }); - declarations.push(Declaration { - id: DeclarationId(461), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "id".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 22382, 22416), - }); - declarations.push(Declaration { - id: DeclarationId(462), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 22662, 22674), - }); - declarations.push(Declaration { - id: DeclarationId(463), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 22732, 22748), - }); - declarations.push(Declaration { - id: DeclarationId(464), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 22795, 22809), - }); - declarations.push(Declaration { - id: DeclarationId(465), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23286, 23299), - }); - declarations.push(Declaration { - id: DeclarationId(466), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23315, 23330), - }); - declarations.push(Declaration { - id: DeclarationId(467), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23376, 23392), - }); - declarations.push(Declaration { - id: DeclarationId(468), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23439, 23452), - }); - declarations.push(Declaration { - id: DeclarationId(469), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(55), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23535, 23560), - }); - declarations.push(Declaration { - id: DeclarationId(470), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(56), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23611, 23632), - }); - declarations.push(Declaration { - id: DeclarationId(471), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(57), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23647, 23657), - }); - declarations.push(Declaration { - id: DeclarationId(472), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(87), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23902, 23906), - }); - declarations.push(Declaration { - id: DeclarationId(473), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(53), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/algebra.dag", 23939, 23966), - }); - declarations.push(Declaration { - id: DeclarationId(474), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/machine_constraints.dag", 7335, 7342), - }); - declarations.push(Declaration { - id: DeclarationId(475), - name: None, - connective: TypeConnective::Atom(AtomPayload::Literal(LiteralBits::Int( - "8".to_string(), - ))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2587, 2588), - }); - declarations.push(Declaration { - id: DeclarationId(476), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(70), - arguments: vec![TemplateArgument { - parameter: DeclarationId(71), - value: DeclarationId(475), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2574, 2589), - }); - declarations.push(Declaration { - id: DeclarationId(477), - name: None, - connective: TypeConnective::Atom(AtomPayload::Literal(LiteralBits::Int( - "16".to_string(), - ))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2630, 2632), - }); - declarations.push(Declaration { - id: DeclarationId(478), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(70), - arguments: vec![TemplateArgument { - parameter: DeclarationId(71), - value: DeclarationId(477), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2617, 2633), - }); - declarations.push(Declaration { - id: DeclarationId(479), - name: None, - connective: TypeConnective::Atom(AtomPayload::Literal(LiteralBits::Int( - "32".to_string(), - ))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2674, 2676), - }); - declarations.push(Declaration { - id: DeclarationId(480), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(70), - arguments: vec![TemplateArgument { - parameter: DeclarationId(71), - value: DeclarationId(479), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2661, 2677), - }); - declarations.push(Declaration { - id: DeclarationId(481), - name: None, - connective: TypeConnective::Atom(AtomPayload::Literal(LiteralBits::Int( - "64".to_string(), - ))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2718, 2720), - }); - declarations.push(Declaration { - id: DeclarationId(482), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(70), - arguments: vec![TemplateArgument { - parameter: DeclarationId(71), - value: DeclarationId(481), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2705, 2721), - }); - declarations.push(Declaration { - id: DeclarationId(483), - name: None, - connective: TypeConnective::Atom(AtomPayload::Literal(LiteralBits::Int( - "128".to_string(), - ))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2763, 2766), - }); - declarations.push(Declaration { - id: DeclarationId(484), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(70), - arguments: vec![TemplateArgument { - parameter: DeclarationId(71), - value: DeclarationId(483), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2750, 2767), - }); - declarations.push(Declaration { - id: DeclarationId(485), - name: None, - connective: TypeConnective::Atom(AtomPayload::Literal(LiteralBits::Int( - "8".to_string(), - ))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2874, 2875), - }); - declarations.push(Declaration { - id: DeclarationId(486), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(70), - arguments: vec![TemplateArgument { - parameter: DeclarationId(71), - value: DeclarationId(485), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2861, 2876), - }); - declarations.push(Declaration { - id: DeclarationId(487), - name: None, - connective: TypeConnective::Atom(AtomPayload::Literal(LiteralBits::Int( - "16".to_string(), - ))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2919, 2921), - }); - declarations.push(Declaration { - id: DeclarationId(488), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(70), - arguments: vec![TemplateArgument { - parameter: DeclarationId(71), - value: DeclarationId(487), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2906, 2922), - }); - declarations.push(Declaration { - id: DeclarationId(489), - name: None, - connective: TypeConnective::Atom(AtomPayload::Literal(LiteralBits::Int( - "32".to_string(), - ))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2965, 2967), - }); - declarations.push(Declaration { - id: DeclarationId(490), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(70), - arguments: vec![TemplateArgument { - parameter: DeclarationId(71), - value: DeclarationId(489), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2952, 2968), - }); - declarations.push(Declaration { - id: DeclarationId(491), - name: None, - connective: TypeConnective::Atom(AtomPayload::Literal(LiteralBits::Int( - "64".to_string(), - ))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 3011, 3013), - }); - declarations.push(Declaration { - id: DeclarationId(492), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(70), - arguments: vec![TemplateArgument { - parameter: DeclarationId(71), - value: DeclarationId(491), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 2998, 3014), - }); - declarations.push(Declaration { - id: DeclarationId(493), - name: None, - connective: TypeConnective::Atom(AtomPayload::Literal(LiteralBits::Int( - "128".to_string(), - ))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 3058, 3061), - }); - declarations.push(Declaration { - id: DeclarationId(494), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(70), - arguments: vec![TemplateArgument { - parameter: DeclarationId(71), - value: DeclarationId(493), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 3045, 3062), - }); - declarations.push(Declaration { - id: DeclarationId(495), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(27), - arguments: vec![TemplateArgument { - parameter: DeclarationId(28), - value: DeclarationId(76), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 5945, 5965), - }); - declarations.push(Declaration { - id: DeclarationId(496), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(70), - arguments: vec![TemplateArgument { - parameter: DeclarationId(71), - value: DeclarationId(72), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 7653, 7679), - }); - declarations.push(Declaration { - id: DeclarationId(497), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(70), - arguments: vec![TemplateArgument { - parameter: DeclarationId(71), - value: DeclarationId(72), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 7715, 7741), - }); - declarations.push(Declaration { - id: DeclarationId(498), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(76)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(2))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/integer.dag", 9242, 9249), - }); - declarations.push(Declaration { - id: DeclarationId(499), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(29), - arguments: vec![TemplateArgument { - parameter: DeclarationId(30), - value: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/rational.dag", 1267, 1288), - }); - declarations.push(Declaration { - id: DeclarationId(500), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 1052, 1065), - }); - declarations.push(Declaration { - id: DeclarationId(501), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 1070, 1076), - }); - declarations.push(Declaration { - id: DeclarationId(502), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 1081, 1099), - }); - declarations.push(Declaration { - id: DeclarationId(503), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 1104, 1122), - }); - declarations.push(Declaration { - id: DeclarationId(504), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 1127, 1141), - }); - declarations.push(Declaration { - id: DeclarationId(505), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 1423, 1432), - }); - declarations.push(Declaration { - id: DeclarationId(506), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "significand_bits".to_string(), - ty: DeclarationId(92), - }, - Field { - label: "exponent_bits".to_string(), - ty: DeclarationId(92), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 1437, 1514), - }); - declarations.push(Declaration { - id: DeclarationId(507), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "digits".to_string(), - ty: DeclarationId(92), - }, - Field { - label: "exponent_digits".to_string(), - ty: DeclarationId(92), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 1519, 1589), - }); - declarations.push(Declaration { - id: DeclarationId(508), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 1829, 1834), - }); - declarations.push(Declaration { - id: DeclarationId(509), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 1837, 1845), - }); - declarations.push(Declaration { - id: DeclarationId(510), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 1848, 1868), - }); - declarations.push(Declaration { - id: DeclarationId(511), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 2118, 2128), - }); - declarations.push(Declaration { - id: DeclarationId(512), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 2131, 2145), - }); - declarations.push(Declaration { - id: DeclarationId(513), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 2400, 2412), - }); - declarations.push(Declaration { - id: DeclarationId(514), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 2415, 2425), - }); - declarations.push(Declaration { - id: DeclarationId(515), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 2743, 2755), - }); - declarations.push(Declaration { - id: DeclarationId(516), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 2758, 2774), - }); - declarations.push(Declaration { - id: DeclarationId(517), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 2777, 2788), - }); - declarations.push(Declaration { - id: DeclarationId(518), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(39), - arguments: vec![TemplateArgument { - parameter: DeclarationId(40), - value: DeclarationId(102), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v3/std/approximate_field.dag", 3433, 3441), - }); - declarations.push(Declaration { - id: DeclarationId(519), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(29), - arguments: vec![TemplateArgument { - parameter: DeclarationId(30), - value: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/float.dag", 1482, 1503), - }); - declarations.push(Declaration { - id: DeclarationId(520), - name: None, - connective: TypeConnective::Atom(AtomPayload::Literal(LiteralBits::Int( - "32".to_string(), - ))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/float.dag", 1767, 1769), - }); - declarations.push(Declaration { - id: DeclarationId(521), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(70), - arguments: vec![TemplateArgument { - parameter: DeclarationId(71), - value: DeclarationId(520), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/float.dag", 1754, 1770), - }); - declarations.push(Declaration { - id: DeclarationId(522), - name: None, - connective: TypeConnective::Atom(AtomPayload::Literal(LiteralBits::Int( - "64".to_string(), - ))), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/float.dag", 1813, 1815), - }); - declarations.push(Declaration { - id: DeclarationId(523), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(70), - arguments: vec![TemplateArgument { - parameter: DeclarationId(71), - value: DeclarationId(522), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/float.dag", 1800, 1816), - }); - declarations.push(Declaration { - id: DeclarationId(524), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(87), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 3805, 3809), - }); - declarations.push(Declaration { - id: DeclarationId(525), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 4078, 4090), - }); - declarations.push(Declaration { - id: DeclarationId(526), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 4356, 4363), - }); - declarations.push(Declaration { - id: DeclarationId(527), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 6656, 6663), - }); - declarations.push(Declaration { - id: DeclarationId(528), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 6771, 6778), - }); - declarations.push(Declaration { - id: DeclarationId(529), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 7229, 7241), - }); - declarations.push(Declaration { - id: DeclarationId(530), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 8318, 8322), - }); - declarations.push(Declaration { - id: DeclarationId(531), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 8325, 8330), - }); - declarations.push(Declaration { - id: DeclarationId(532), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(45), - arguments: vec![TemplateArgument { - parameter: DeclarationId(46), - value: DeclarationId(124), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 8306, 8330), - }); - declarations.push(Declaration { - id: DeclarationId(533), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(150), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 13164, 13181), - }); - declarations.push(Declaration { - id: DeclarationId(534), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(151), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 13215, 13232), - }); - declarations.push(Declaration { - id: DeclarationId(535), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17179, 17184), - }); - declarations.push(Declaration { - id: DeclarationId(536), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17187, 17192), - }); - declarations.push(Declaration { - id: DeclarationId(537), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17195, 17202), - }); - declarations.push(Declaration { - id: DeclarationId(538), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17354, 17358), - }); - declarations.push(Declaration { - id: DeclarationId(539), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17361, 17370), - }); - declarations.push(Declaration { - id: DeclarationId(540), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17373, 17379), - }); - declarations.push(Declaration { - id: DeclarationId(541), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17382, 17385), - }); - declarations.push(Declaration { - id: DeclarationId(542), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17410, 17418), - }); - declarations.push(Declaration { - id: DeclarationId(543), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17421, 17430), - }); - declarations.push(Declaration { - id: DeclarationId(544), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17433, 17439), - }); - declarations.push(Declaration { - id: DeclarationId(545), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17459, 17461), - }); - declarations.push(Declaration { - id: DeclarationId(546), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17464, 17465), - }); - declarations.push(Declaration { - id: DeclarationId(547), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17468, 17469), - }); - declarations.push(Declaration { - id: DeclarationId(548), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17472, 17473), - }); - declarations.push(Declaration { - id: DeclarationId(549), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17476, 17478), - }); - declarations.push(Declaration { - id: DeclarationId(550), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "secret_name".to_string(), - ty: DeclarationId(147), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17750, 17785), - }); - declarations.push(Declaration { - id: DeclarationId(551), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "env_var".to_string(), - ty: DeclarationId(147), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17790, 17831), - }); - declarations.push(Declaration { - id: DeclarationId(552), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(177), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17906, 17926), - }); - declarations.push(Declaration { - id: DeclarationId(553), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17941, 17953), - }); - declarations.push(Declaration { - id: DeclarationId(554), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "audience".to_string(), - ty: DeclarationId(147), - }, - Field { - label: "service_account".to_string(), - ty: DeclarationId(552), - }, - Field { - label: "scopes".to_string(), - ty: DeclarationId(553), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17836, 17959), - }); - declarations.push(Declaration { - id: DeclarationId(555), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17990, 18002), - }); - declarations.push(Declaration { - id: DeclarationId(556), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "scopes".to_string(), - ty: DeclarationId(555), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 17964, 18004), - }); - declarations.push(Declaration { - id: DeclarationId(557), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(182), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18026, 18046), - }); - declarations.push(Declaration { - id: DeclarationId(558), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "steps".to_string(), - ty: DeclarationId(557), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18009, 18048), - }); - declarations.push(Declaration { - id: DeclarationId(559), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18135, 18141), - }); - declarations.push(Declaration { - id: DeclarationId(560), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18144, 18147), - }); - declarations.push(Declaration { - id: DeclarationId(561), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18150, 18157), - }); - declarations.push(Declaration { - id: DeclarationId(562), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18160, 18163), - }); - declarations.push(Declaration { - id: DeclarationId(563), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18166, 18171), - }); - declarations.push(Declaration { - id: DeclarationId(564), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18174, 18178), - }); - declarations.push(Declaration { - id: DeclarationId(565), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18181, 18187), - }); - declarations.push(Declaration { - id: DeclarationId(566), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18190, 18196), - }); - declarations.push(Declaration { - id: DeclarationId(567), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18199, 18207), - }); - declarations.push(Declaration { - id: DeclarationId(568), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18210, 18217), - }); - declarations.push(Declaration { - id: DeclarationId(569), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18220, 18226), - }); - declarations.push(Declaration { - id: DeclarationId(570), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18241, 18254), - }); - declarations.push(Declaration { - id: DeclarationId(571), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18257, 18259), - }); - declarations.push(Declaration { - id: DeclarationId(572), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18262, 18267), - }); - declarations.push(Declaration { - id: DeclarationId(573), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18270, 18273), - }); - declarations.push(Declaration { - id: DeclarationId(574), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18284, 18289), - }); - declarations.push(Declaration { - id: DeclarationId(575), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18292, 18297), - }); - declarations.push(Declaration { - id: DeclarationId(576), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18300, 18307), - }); - declarations.push(Declaration { - id: DeclarationId(577), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18310, 18317), - }); - declarations.push(Declaration { - id: DeclarationId(578), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18320, 18327), - }); - declarations.push(Declaration { - id: DeclarationId(579), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18330, 18333), - }); - declarations.push(Declaration { - id: DeclarationId(580), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18336, 18340), - }); - declarations.push(Declaration { - id: DeclarationId(581), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18355, 18362), - }); - declarations.push(Declaration { - id: DeclarationId(582), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18365, 18368), - }); - declarations.push(Declaration { - id: DeclarationId(583), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18371, 18378), - }); - declarations.push(Declaration { - id: DeclarationId(584), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18381, 18390), - }); - declarations.push(Declaration { - id: DeclarationId(585), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18393, 18397), - }); - declarations.push(Declaration { - id: DeclarationId(586), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18400, 18404), - }); - declarations.push(Declaration { - id: DeclarationId(587), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18407, 18417), - }); - declarations.push(Declaration { - id: DeclarationId(588), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18420, 18424), - }); - declarations.push(Declaration { - id: DeclarationId(589), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18427, 18433), - }); - declarations.push(Declaration { - id: DeclarationId(590), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18454, 18460), - }); - declarations.push(Declaration { - id: DeclarationId(591), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18463, 18466), - }); - declarations.push(Declaration { - id: DeclarationId(592), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18469, 18478), - }); - declarations.push(Declaration { - id: DeclarationId(593), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18481, 18483), - }); - declarations.push(Declaration { - id: DeclarationId(594), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18486, 18494), - }); - declarations.push(Declaration { - id: DeclarationId(595), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(186), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18562, 18569), - }); - declarations.push(Declaration { - id: DeclarationId(596), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18966, 18977), - }); - declarations.push(Declaration { - id: DeclarationId(597), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18982, 18991), - }); - declarations.push(Declaration { - id: DeclarationId(598), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 18996, 19003), - }); - declarations.push(Declaration { - id: DeclarationId(599), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 19008, 19015), - }); - declarations.push(Declaration { - id: DeclarationId(600), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 19020, 19025), - }); - declarations.push(Declaration { - id: DeclarationId(601), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 19178, 19188), - }); - declarations.push(Declaration { - id: DeclarationId(602), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 19193, 19202), - }); - declarations.push(Declaration { - id: DeclarationId(603), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 19207, 19213), - }); - declarations.push(Declaration { - id: DeclarationId(604), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 21516, 21519), - }); - declarations.push(Declaration { - id: DeclarationId(605), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 21522, 21526), - }); - declarations.push(Declaration { - id: DeclarationId(606), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 21529, 21532), - }); - declarations.push(Declaration { - id: DeclarationId(607), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 21535, 21540), - }); - declarations.push(Declaration { - id: DeclarationId(608), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 21543, 21549), - }); - declarations.push(Declaration { - id: DeclarationId(609), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 21552, 21556), - }); - declarations.push(Declaration { - id: DeclarationId(610), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 21559, 21566), - }); - declarations.push(Declaration { - id: DeclarationId(611), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22054, 22060), - }); - declarations.push(Declaration { - id: DeclarationId(612), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "name".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22065, 22088), - }); - declarations.push(Declaration { - id: DeclarationId(613), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "username".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22093, 22119), - }); - declarations.push(Declaration { - id: DeclarationId(614), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22124, 22130), - }); - declarations.push(Declaration { - id: DeclarationId(615), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(156), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22322, 22332), - }); - declarations.push(Declaration { - id: DeclarationId(616), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22457, 22464), - }); - declarations.push(Declaration { - id: DeclarationId(617), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22504, 22516), - }); - declarations.push(Declaration { - id: DeclarationId(618), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(87), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22531, 22535), - }); - declarations.push(Declaration { - id: DeclarationId(619), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(210), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 23886, 23904), - }); - declarations.push(Declaration { - id: DeclarationId(620), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(211), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 23997, 24018), - }); - declarations.push(Declaration { - id: DeclarationId(621), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24302, 24309), - }); - declarations.push(Declaration { - id: DeclarationId(622), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(215), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24342, 24357), - }); - declarations.push(Declaration { - id: DeclarationId(623), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(218), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24646, 24664), - }); - declarations.push(Declaration { - id: DeclarationId(624), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(219), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24674, 24692), - }); - declarations.push(Declaration { - id: DeclarationId(625), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24714, 24726), - }); - declarations.push(Declaration { - id: DeclarationId(626), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24814, 24821), - }); - declarations.push(Declaration { - id: DeclarationId(627), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24908, 24915), - }); - declarations.push(Declaration { - id: DeclarationId(628), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24943, 24955), - }); - declarations.push(Declaration { - id: DeclarationId(629), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24967, 24979), - }); - declarations.push(Declaration { - id: DeclarationId(630), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 24991, 25003), - }); - declarations.push(Declaration { - id: DeclarationId(631), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(222), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25138, 25153), - }); - declarations.push(Declaration { - id: DeclarationId(632), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(188), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25164, 25177), - }); - declarations.push(Declaration { - id: DeclarationId(633), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(187), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25193, 25206), - }); - declarations.push(Declaration { - id: DeclarationId(634), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25232, 25236), - }); - declarations.push(Declaration { - id: DeclarationId(635), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25239, 25241), - }); - declarations.push(Declaration { - id: DeclarationId(636), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25244, 25245), - }); - declarations.push(Declaration { - id: DeclarationId(637), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25248, 25252), - }); - declarations.push(Declaration { - id: DeclarationId(638), - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - DeclarationId(227), - CardinalityBound::AtMostOne, - ), - ), - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 25316, 25323), - }); - declarations.push(Declaration { - id: DeclarationId(639), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(124), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 3063, 3080), - }); - declarations.push(Declaration { - id: DeclarationId(640), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(87), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 3538, 3554), - }); - declarations.push(Declaration { - id: DeclarationId(641), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(124), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 4840, 4857), - }); - declarations.push(Declaration { - id: DeclarationId(642), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 5822, 5841), - }); - declarations.push(Declaration { - id: DeclarationId(643), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(133), - arguments: vec![ - TemplateArgument { - parameter: DeclarationId(134), - value: DeclarationId(227), - }, - TemplateArgument { - parameter: DeclarationId(135), - value: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 6425, 6444), - }); - declarations.push(Declaration { - id: DeclarationId(644), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(20))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 9194, 9223), - }); - declarations.push(Declaration { - id: DeclarationId(645), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(26))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 11619, 11640), - }); - declarations.push(Declaration { - id: DeclarationId(646), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(32))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 11671, 11696), - }); - declarations.push(Declaration { - id: DeclarationId(647), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(38))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 11827, 11852), - }); - declarations.push(Declaration { - id: DeclarationId(648), - name: Some("".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 12010, 12052), - }); - declarations.push(Declaration { - id: DeclarationId(649), - name: Some("".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 12239, 12284), - }); - declarations.push(Declaration { - id: DeclarationId(650), - name: Some("".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 12285, 12330), - }); - declarations.push(Declaration { - id: DeclarationId(651), - name: Some("".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 12331, 12376), - }); - declarations.push(Declaration { - id: DeclarationId(652), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(147)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(44))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 13050, 13070), - }); - declarations.push(Declaration { - id: DeclarationId(653), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(147)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(50))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 13110, 13130), - }); - declarations.push(Declaration { - id: DeclarationId(654), - name: Some("".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 13235, 13278), - }); - declarations.push(Declaration { - id: DeclarationId(655), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(53))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 14114, 14127), - }); - declarations.push(Declaration { - id: DeclarationId(656), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(56))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 14159, 14172), - }); - declarations.push(Declaration { - id: DeclarationId(657), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(65))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 14204, 14240), - }); - declarations.push(Declaration { - id: DeclarationId(658), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(87)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(74))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 14272, 14303), - }); - declarations.push(Declaration { - id: DeclarationId(659), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(147)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(80))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 14509, 14529), - }); - declarations.push(Declaration { - id: DeclarationId(660), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(147)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(86))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15091, 15108), - }); - declarations.push(Declaration { - id: DeclarationId(661), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(147)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(92))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15147, 15163), - }); - declarations.push(Declaration { - id: DeclarationId(662), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(147)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(98))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15202, 15217), - }); - declarations.push(Declaration { - id: DeclarationId(663), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(147)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(104))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15256, 15275), - }); - declarations.push(Declaration { - id: DeclarationId(664), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(147)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(110))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15314, 15333), - }); - declarations.push(Declaration { - id: DeclarationId(665), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(147)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(116))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15372, 15389), - }); - declarations.push(Declaration { - id: DeclarationId(666), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(147)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(122))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15428, 15446), - }); - declarations.push(Declaration { - id: DeclarationId(667), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(147)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(128))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15485, 15503), - }); - declarations.push(Declaration { - id: DeclarationId(668), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(147)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(134))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15542, 15562), - }); - declarations.push(Declaration { - id: DeclarationId(669), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(147)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(140))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15837, 15864), - }); - declarations.push(Declaration { - id: DeclarationId(670), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(147)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(146))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15909, 15936), - }); - declarations.push(Declaration { - id: DeclarationId(671), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(147)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(152))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 15979, 16004), - }); - declarations.push(Declaration { - id: DeclarationId(672), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(147)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(158))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 16044, 16066), - }); - declarations.push(Declaration { - id: DeclarationId(673), - name: Some("".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 16146, 16188), - }); - declarations.push(Declaration { - id: DeclarationId(674), - name: Some("".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 16573, 16615), - }); - declarations.push(Declaration { - id: DeclarationId(675), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(154)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(164))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22653, 22678), - }); - declarations.push(Declaration { - id: DeclarationId(676), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(125)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(170))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22714, 22736), - }); - declarations.push(Declaration { - id: DeclarationId(677), - name: None, - connective: TypeConnective::Arrow { - inputs: vec![DeclarationId(227)], - output: DeclarationId(124), - body: ArrowBody::UserDefined(BindNodeId::new_unchecked(NodeId(176))), - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/types.dag", 22774, 22793), - }); - declarations.push(Declaration { - id: DeclarationId(678), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 3679, 3689), - }); - declarations.push(Declaration { - id: DeclarationId(679), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 3692, 3697), - }); - declarations.push(Declaration { - id: DeclarationId(680), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 3700, 3710), - }); - declarations.push(Declaration { - id: DeclarationId(681), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 3713, 3726), - }); - declarations.push(Declaration { - id: DeclarationId(682), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 5310, 5319), - }); - declarations.push(Declaration { - id: DeclarationId(683), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 5322, 5328), - }); - declarations.push(Declaration { - id: DeclarationId(684), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 5331, 5335), - }); - declarations.push(Declaration { - id: DeclarationId(685), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(232), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 5883, 5901), - }); - declarations.push(Declaration { - id: DeclarationId(686), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(87), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 6703, 6712), - }); - declarations.push(Declaration { - id: DeclarationId(687), - name: None, - connective: TypeConnective::Instantiation { - template: DeclarationId(129), - arguments: vec![TemplateArgument { - parameter: DeclarationId(130), - value: DeclarationId(232), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/unicode.dag", 6952, 6970), - }); - declarations.push(Declaration { - id: DeclarationId(688), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/serialization.dag", 1873, 1883), - }); - declarations.push(Declaration { - id: DeclarationId(689), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/serialization.dag", 1888, 1897), - }); - declarations.push(Declaration { - id: DeclarationId(690), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "prefix".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/serialization.dag", 1902, 1944), - }); - declarations.push(Declaration { - id: DeclarationId(691), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "suffix".to_string(), - ty: DeclarationId(227), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/serialization.dag", 1949, 1991), - }); - declarations.push(Declaration { - id: DeclarationId(692), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "prefix".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "suffix".to_string(), - ty: DeclarationId(227), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/serialization.dag", 1996, 2060), - }); - declarations.push(Declaration { - id: DeclarationId(693), - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "naming".to_string(), - ty: DeclarationId(308), - }], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/serialization.dag", 2631, 2670), - }); - declarations.push(Declaration { - id: DeclarationId(694), - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "tag_field".to_string(), - ty: DeclarationId(227), - }, - Field { - label: "naming".to_string(), - ty: DeclarationId(308), - }, - ], - }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/serialization.dag", 2675, 2742), - }); - declarations.push(Declaration { - id: DeclarationId(695), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/serialization.dag", 2747, 2762), - }); - declarations.push(Declaration { - id: DeclarationId(696), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/serialization.dag", 2767, 2780), - }); - declarations.push(Declaration { - id: DeclarationId(697), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/serialization.dag", 3499, 3503), - }); - declarations.push(Declaration { - id: DeclarationId(698), - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: vec![], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("dsl/std/serialization.dag", 3506, 3510), - }); - declarations - } -} - -fn bootstrapped_std_fixture_dag_ports() -> HashMap { - { - let mut ports = HashMap::new(); - ports.insert( - PortId(0), - Port { - id: PortId(0), - state: PortState::Resolved(TypeShape::new(DeclarationId(76))), - produced_by: None, - }, - ); - ports.insert( - PortId(1), - Port { - id: PortId(1), - state: PortState::Uninferred, - produced_by: Some(NodeId(0)), - }, - ); - ports.insert( - PortId(2), - Port { - id: PortId(2), - state: PortState::Uninferred, - produced_by: Some(NodeId(1)), - }, - ); - ports.insert( - PortId(3), - Port { - id: PortId(3), - state: PortState::Resolved(TypeShape::new(DeclarationId(87))), - produced_by: None, - }, - ); - ports.insert( - PortId(4), - Port { - id: PortId(4), - state: PortState::Uninferred, - produced_by: Some(NodeId(3)), - }, - ); - ports.insert( - PortId(5), - Port { - id: PortId(5), - state: PortState::Uninferred, - produced_by: Some(NodeId(4)), - }, - ); - ports.insert( - PortId(6), - Port { - id: PortId(6), - state: PortState::Uninferred, - produced_by: Some(NodeId(5)), - }, - ); - ports.insert( - PortId(7), - Port { - id: PortId(7), - state: PortState::Uninferred, - produced_by: Some(NodeId(6)), - }, - ); - ports.insert( - PortId(8), - Port { - id: PortId(8), - state: PortState::Uninferred, - produced_by: Some(NodeId(7)), - }, - ); - ports.insert( - PortId(9), - Port { - id: PortId(9), - state: PortState::Uninferred, - produced_by: Some(NodeId(8)), - }, - ); - ports.insert( - PortId(10), - Port { - id: PortId(10), - state: PortState::Uninferred, - produced_by: Some(NodeId(9)), - }, - ); - ports.insert( - PortId(11), - Port { - id: PortId(11), - state: PortState::Uninferred, - produced_by: Some(NodeId(10)), - }, - ); - ports.insert( - PortId(12), - Port { - id: PortId(12), - state: PortState::Uninferred, - produced_by: Some(NodeId(11)), - }, - ); - ports.insert( - PortId(13), - Port { - id: PortId(13), - state: PortState::Uninferred, - produced_by: Some(NodeId(12)), - }, - ); - ports.insert( - PortId(14), - Port { - id: PortId(14), - state: PortState::Uninferred, - produced_by: Some(NodeId(13)), - }, - ); - ports.insert( - PortId(15), - Port { - id: PortId(15), - state: PortState::Uninferred, - produced_by: Some(NodeId(14)), - }, - ); - ports.insert( - PortId(16), - Port { - id: PortId(16), - state: PortState::Uninferred, - produced_by: Some(NodeId(15)), - }, - ); - ports.insert( - PortId(17), - Port { - id: PortId(17), - state: PortState::Uninferred, - produced_by: Some(NodeId(16)), - }, - ); - ports.insert( - PortId(18), - Port { - id: PortId(18), - state: PortState::Uninferred, - produced_by: Some(NodeId(17)), - }, - ); - ports.insert( - PortId(19), - Port { - id: PortId(19), - state: PortState::Uninferred, - produced_by: Some(NodeId(18)), - }, - ); - ports.insert( - PortId(20), - Port { - id: PortId(20), - state: PortState::Uninferred, - produced_by: Some(NodeId(19)), - }, - ); - ports.insert( - PortId(21), - Port { - id: PortId(21), - state: PortState::Resolved(TypeShape::new(DeclarationId(87))), - produced_by: None, - }, - ); - ports.insert( - PortId(22), - Port { - id: PortId(22), - state: PortState::Uninferred, - produced_by: Some(NodeId(21)), - }, - ); - ports.insert( - PortId(23), - Port { - id: PortId(23), - state: PortState::Uninferred, - produced_by: Some(NodeId(22)), - }, - ); - ports.insert( - PortId(24), - Port { - id: PortId(24), - state: PortState::Uninferred, - produced_by: Some(NodeId(23)), - }, - ); - ports.insert( - PortId(25), - Port { - id: PortId(25), - state: PortState::Uninferred, - produced_by: Some(NodeId(24)), - }, - ); - ports.insert( - PortId(26), - Port { - id: PortId(26), - state: PortState::Uninferred, - produced_by: Some(NodeId(25)), - }, - ); - ports.insert( - PortId(27), - Port { - id: PortId(27), - state: PortState::Resolved(TypeShape::new(DeclarationId(87))), - produced_by: None, - }, - ); - ports.insert( - PortId(28), - Port { - id: PortId(28), - state: PortState::Uninferred, - produced_by: Some(NodeId(27)), - }, - ); - ports.insert( - PortId(29), - Port { - id: PortId(29), - state: PortState::Uninferred, - produced_by: Some(NodeId(28)), - }, - ); - ports.insert( - PortId(30), - Port { - id: PortId(30), - state: PortState::Uninferred, - produced_by: Some(NodeId(29)), - }, - ); - ports.insert( - PortId(31), - Port { - id: PortId(31), - state: PortState::Uninferred, - produced_by: Some(NodeId(30)), - }, - ); - ports.insert( - PortId(32), - Port { - id: PortId(32), - state: PortState::Uninferred, - produced_by: Some(NodeId(31)), - }, - ); - ports.insert( - PortId(33), - Port { - id: PortId(33), - state: PortState::Resolved(TypeShape::new(DeclarationId(87))), - produced_by: None, - }, - ); - ports.insert( - PortId(34), - Port { - id: PortId(34), - state: PortState::Uninferred, - produced_by: Some(NodeId(33)), - }, - ); - ports.insert( - PortId(35), - Port { - id: PortId(35), - state: PortState::Uninferred, - produced_by: Some(NodeId(34)), - }, - ); - ports.insert( - PortId(36), - Port { - id: PortId(36), - state: PortState::Uninferred, - produced_by: Some(NodeId(35)), - }, - ); - ports.insert( - PortId(37), - Port { - id: PortId(37), - state: PortState::Uninferred, - produced_by: Some(NodeId(36)), - }, - ); - ports.insert( - PortId(38), - Port { - id: PortId(38), - state: PortState::Uninferred, - produced_by: Some(NodeId(37)), - }, - ); - ports.insert( - PortId(39), - Port { - id: PortId(39), - state: PortState::Resolved(TypeShape::new(DeclarationId(147))), - produced_by: None, - }, - ); - ports.insert( - PortId(40), - Port { - id: PortId(40), - state: PortState::Uninferred, - produced_by: Some(NodeId(39)), - }, - ); - ports.insert( - PortId(41), - Port { - id: PortId(41), - state: PortState::Uninferred, - produced_by: Some(NodeId(40)), - }, - ); - ports.insert( - PortId(42), - Port { - id: PortId(42), - state: PortState::Uninferred, - produced_by: Some(NodeId(41)), - }, - ); - ports.insert( - PortId(43), - Port { - id: PortId(43), - state: PortState::Uninferred, - produced_by: Some(NodeId(42)), - }, - ); - ports.insert( - PortId(44), - Port { - id: PortId(44), - state: PortState::Uninferred, - produced_by: Some(NodeId(43)), - }, - ); - ports.insert( - PortId(45), - Port { - id: PortId(45), - state: PortState::Resolved(TypeShape::new(DeclarationId(147))), - produced_by: None, - }, - ); - ports.insert( - PortId(46), - Port { - id: PortId(46), - state: PortState::Uninferred, - produced_by: Some(NodeId(45)), - }, - ); - ports.insert( - PortId(47), - Port { - id: PortId(47), - state: PortState::Uninferred, - produced_by: Some(NodeId(46)), - }, - ); - ports.insert( - PortId(48), - Port { - id: PortId(48), - state: PortState::Uninferred, - produced_by: Some(NodeId(47)), - }, - ); - ports.insert( - PortId(49), - Port { - id: PortId(49), - state: PortState::Uninferred, - produced_by: Some(NodeId(48)), - }, - ); - ports.insert( - PortId(50), - Port { - id: PortId(50), - state: PortState::Uninferred, - produced_by: Some(NodeId(49)), - }, - ); - ports.insert( - PortId(51), - Port { - id: PortId(51), - state: PortState::Resolved(TypeShape::new(DeclarationId(87))), - produced_by: None, - }, - ); - ports.insert( - PortId(52), - Port { - id: PortId(52), - state: PortState::Uninferred, - produced_by: Some(NodeId(51)), - }, - ); - ports.insert( - PortId(53), - Port { - id: PortId(53), - state: PortState::Uninferred, - produced_by: Some(NodeId(52)), - }, - ); - ports.insert( - PortId(54), - Port { - id: PortId(54), - state: PortState::Resolved(TypeShape::new(DeclarationId(87))), - produced_by: None, - }, - ); - ports.insert( - PortId(55), - Port { - id: PortId(55), - state: PortState::Uninferred, - produced_by: Some(NodeId(54)), - }, - ); - ports.insert( - PortId(56), - Port { - id: PortId(56), - state: PortState::Uninferred, - produced_by: Some(NodeId(55)), - }, - ); - ports.insert( - PortId(57), - Port { - id: PortId(57), - state: PortState::Resolved(TypeShape::new(DeclarationId(87))), - produced_by: None, - }, - ); - ports.insert( - PortId(58), - Port { - id: PortId(58), - state: PortState::Uninferred, - produced_by: Some(NodeId(57)), - }, - ); - ports.insert( - PortId(59), - Port { - id: PortId(59), - state: PortState::Uninferred, - produced_by: Some(NodeId(58)), - }, - ); - ports.insert( - PortId(60), - Port { - id: PortId(60), - state: PortState::Uninferred, - produced_by: Some(NodeId(59)), - }, - ); - ports.insert( - PortId(61), - Port { - id: PortId(61), - state: PortState::Uninferred, - produced_by: Some(NodeId(60)), - }, - ); - ports.insert( - PortId(62), - Port { - id: PortId(62), - state: PortState::Uninferred, - produced_by: Some(NodeId(61)), - }, - ); - ports.insert( - PortId(63), - Port { - id: PortId(63), - state: PortState::Uninferred, - produced_by: Some(NodeId(62)), - }, - ); - ports.insert( - PortId(64), - Port { - id: PortId(64), - state: PortState::Uninferred, - produced_by: Some(NodeId(63)), - }, - ); - ports.insert( - PortId(65), - Port { - id: PortId(65), - state: PortState::Uninferred, - produced_by: Some(NodeId(64)), - }, - ); - ports.insert( - PortId(66), - Port { - id: PortId(66), - state: PortState::Resolved(TypeShape::new(DeclarationId(87))), - produced_by: None, - }, - ); - ports.insert( - PortId(67), - Port { - id: PortId(67), - state: PortState::Uninferred, - produced_by: Some(NodeId(66)), - }, - ); - ports.insert( - PortId(68), - Port { - id: PortId(68), - state: PortState::Uninferred, - produced_by: Some(NodeId(67)), - }, - ); - ports.insert( - PortId(69), - Port { - id: PortId(69), - state: PortState::Uninferred, - produced_by: Some(NodeId(68)), - }, - ); - ports.insert( - PortId(70), - Port { - id: PortId(70), - state: PortState::Uninferred, - produced_by: Some(NodeId(69)), - }, - ); - ports.insert( - PortId(71), - Port { - id: PortId(71), - state: PortState::Uninferred, - produced_by: Some(NodeId(70)), - }, - ); - ports.insert( - PortId(72), - Port { - id: PortId(72), - state: PortState::Uninferred, - produced_by: Some(NodeId(71)), - }, - ); - ports.insert( - PortId(73), - Port { - id: PortId(73), - state: PortState::Uninferred, - produced_by: Some(NodeId(72)), - }, - ); - ports.insert( - PortId(74), - Port { - id: PortId(74), - state: PortState::Uninferred, - produced_by: Some(NodeId(73)), - }, - ); - ports.insert( - PortId(75), - Port { - id: PortId(75), - state: PortState::Resolved(TypeShape::new(DeclarationId(147))), - produced_by: None, - }, - ); - ports.insert( - PortId(76), - Port { - id: PortId(76), - state: PortState::Uninferred, - produced_by: Some(NodeId(75)), - }, - ); - ports.insert( - PortId(77), - Port { - id: PortId(77), - state: PortState::Uninferred, - produced_by: Some(NodeId(76)), - }, - ); - ports.insert( - PortId(78), - Port { - id: PortId(78), - state: PortState::Uninferred, - produced_by: Some(NodeId(77)), - }, - ); - ports.insert( - PortId(79), - Port { - id: PortId(79), - state: PortState::Uninferred, - produced_by: Some(NodeId(78)), - }, - ); - ports.insert( - PortId(80), - Port { - id: PortId(80), - state: PortState::Uninferred, - produced_by: Some(NodeId(79)), - }, - ); - ports.insert( - PortId(81), - Port { - id: PortId(81), - state: PortState::Resolved(TypeShape::new(DeclarationId(147))), - produced_by: None, - }, - ); - ports.insert( - PortId(82), - Port { - id: PortId(82), - state: PortState::Uninferred, - produced_by: Some(NodeId(81)), - }, - ); - ports.insert( - PortId(83), - Port { - id: PortId(83), - state: PortState::Uninferred, - produced_by: Some(NodeId(82)), - }, - ); - ports.insert( - PortId(84), - Port { - id: PortId(84), - state: PortState::Uninferred, - produced_by: Some(NodeId(83)), - }, - ); - ports.insert( - PortId(85), - Port { - id: PortId(85), - state: PortState::Uninferred, - produced_by: Some(NodeId(84)), - }, - ); - ports.insert( - PortId(86), - Port { - id: PortId(86), - state: PortState::Uninferred, - produced_by: Some(NodeId(85)), - }, - ); - ports.insert( - PortId(87), - Port { - id: PortId(87), - state: PortState::Resolved(TypeShape::new(DeclarationId(147))), - produced_by: None, - }, - ); - ports.insert( - PortId(88), - Port { - id: PortId(88), - state: PortState::Uninferred, - produced_by: Some(NodeId(87)), - }, - ); - ports.insert( - PortId(89), - Port { - id: PortId(89), - state: PortState::Uninferred, - produced_by: Some(NodeId(88)), - }, - ); - ports.insert( - PortId(90), - Port { - id: PortId(90), - state: PortState::Uninferred, - produced_by: Some(NodeId(89)), - }, - ); - ports.insert( - PortId(91), - Port { - id: PortId(91), - state: PortState::Uninferred, - produced_by: Some(NodeId(90)), - }, - ); - ports.insert( - PortId(92), - Port { - id: PortId(92), - state: PortState::Uninferred, - produced_by: Some(NodeId(91)), - }, - ); - ports.insert( - PortId(93), - Port { - id: PortId(93), - state: PortState::Resolved(TypeShape::new(DeclarationId(147))), - produced_by: None, - }, - ); - ports.insert( - PortId(94), - Port { - id: PortId(94), - state: PortState::Uninferred, - produced_by: Some(NodeId(93)), - }, - ); - ports.insert( - PortId(95), - Port { - id: PortId(95), - state: PortState::Uninferred, - produced_by: Some(NodeId(94)), - }, - ); - ports.insert( - PortId(96), - Port { - id: PortId(96), - state: PortState::Uninferred, - produced_by: Some(NodeId(95)), - }, - ); - ports.insert( - PortId(97), - Port { - id: PortId(97), - state: PortState::Uninferred, - produced_by: Some(NodeId(96)), - }, - ); - ports.insert( - PortId(98), - Port { - id: PortId(98), - state: PortState::Uninferred, - produced_by: Some(NodeId(97)), - }, - ); - ports.insert( - PortId(99), - Port { - id: PortId(99), - state: PortState::Resolved(TypeShape::new(DeclarationId(147))), - produced_by: None, - }, - ); - ports.insert( - PortId(100), - Port { - id: PortId(100), - state: PortState::Uninferred, - produced_by: Some(NodeId(99)), - }, - ); - ports.insert( - PortId(101), - Port { - id: PortId(101), - state: PortState::Uninferred, - produced_by: Some(NodeId(100)), - }, - ); - ports.insert( - PortId(102), - Port { - id: PortId(102), - state: PortState::Uninferred, - produced_by: Some(NodeId(101)), - }, - ); - ports.insert( - PortId(103), - Port { - id: PortId(103), - state: PortState::Uninferred, - produced_by: Some(NodeId(102)), - }, - ); - ports.insert( - PortId(104), - Port { - id: PortId(104), - state: PortState::Uninferred, - produced_by: Some(NodeId(103)), - }, - ); - ports.insert( - PortId(105), - Port { - id: PortId(105), - state: PortState::Resolved(TypeShape::new(DeclarationId(147))), - produced_by: None, - }, - ); - ports.insert( - PortId(106), - Port { - id: PortId(106), - state: PortState::Uninferred, - produced_by: Some(NodeId(105)), - }, - ); - ports.insert( - PortId(107), - Port { - id: PortId(107), - state: PortState::Uninferred, - produced_by: Some(NodeId(106)), - }, - ); - ports.insert( - PortId(108), - Port { - id: PortId(108), - state: PortState::Uninferred, - produced_by: Some(NodeId(107)), - }, - ); - ports.insert( - PortId(109), - Port { - id: PortId(109), - state: PortState::Uninferred, - produced_by: Some(NodeId(108)), - }, - ); - ports.insert( - PortId(110), - Port { - id: PortId(110), - state: PortState::Uninferred, - produced_by: Some(NodeId(109)), - }, - ); - ports.insert( - PortId(111), - Port { - id: PortId(111), - state: PortState::Resolved(TypeShape::new(DeclarationId(147))), - produced_by: None, - }, - ); - ports.insert( - PortId(112), - Port { - id: PortId(112), - state: PortState::Uninferred, - produced_by: Some(NodeId(111)), - }, - ); - ports.insert( - PortId(113), - Port { - id: PortId(113), - state: PortState::Uninferred, - produced_by: Some(NodeId(112)), - }, - ); - ports.insert( - PortId(114), - Port { - id: PortId(114), - state: PortState::Uninferred, - produced_by: Some(NodeId(113)), - }, - ); - ports.insert( - PortId(115), - Port { - id: PortId(115), - state: PortState::Uninferred, - produced_by: Some(NodeId(114)), - }, - ); - ports.insert( - PortId(116), - Port { - id: PortId(116), - state: PortState::Uninferred, - produced_by: Some(NodeId(115)), - }, - ); - ports.insert( - PortId(117), - Port { - id: PortId(117), - state: PortState::Resolved(TypeShape::new(DeclarationId(147))), - produced_by: None, - }, - ); - ports.insert( - PortId(118), - Port { - id: PortId(118), - state: PortState::Uninferred, - produced_by: Some(NodeId(117)), - }, - ); - ports.insert( - PortId(119), - Port { - id: PortId(119), - state: PortState::Uninferred, - produced_by: Some(NodeId(118)), - }, - ); - ports.insert( - PortId(120), - Port { - id: PortId(120), - state: PortState::Uninferred, - produced_by: Some(NodeId(119)), - }, - ); - ports.insert( - PortId(121), - Port { - id: PortId(121), - state: PortState::Uninferred, - produced_by: Some(NodeId(120)), - }, - ); - ports.insert( - PortId(122), - Port { - id: PortId(122), - state: PortState::Uninferred, - produced_by: Some(NodeId(121)), - }, - ); - ports.insert( - PortId(123), - Port { - id: PortId(123), - state: PortState::Resolved(TypeShape::new(DeclarationId(147))), - produced_by: None, - }, - ); - ports.insert( - PortId(124), - Port { - id: PortId(124), - state: PortState::Uninferred, - produced_by: Some(NodeId(123)), - }, - ); - ports.insert( - PortId(125), - Port { - id: PortId(125), - state: PortState::Uninferred, - produced_by: Some(NodeId(124)), - }, - ); - ports.insert( - PortId(126), - Port { - id: PortId(126), - state: PortState::Uninferred, - produced_by: Some(NodeId(125)), - }, - ); - ports.insert( - PortId(127), - Port { - id: PortId(127), - state: PortState::Uninferred, - produced_by: Some(NodeId(126)), - }, - ); - ports.insert( - PortId(128), - Port { - id: PortId(128), - state: PortState::Uninferred, - produced_by: Some(NodeId(127)), - }, - ); - ports.insert( - PortId(129), - Port { - id: PortId(129), - state: PortState::Resolved(TypeShape::new(DeclarationId(147))), - produced_by: None, - }, - ); - ports.insert( - PortId(130), - Port { - id: PortId(130), - state: PortState::Uninferred, - produced_by: Some(NodeId(129)), - }, - ); - ports.insert( - PortId(131), - Port { - id: PortId(131), - state: PortState::Uninferred, - produced_by: Some(NodeId(130)), - }, - ); - ports.insert( - PortId(132), - Port { - id: PortId(132), - state: PortState::Uninferred, - produced_by: Some(NodeId(131)), - }, - ); - ports.insert( - PortId(133), - Port { - id: PortId(133), - state: PortState::Uninferred, - produced_by: Some(NodeId(132)), - }, - ); - ports.insert( - PortId(134), - Port { - id: PortId(134), - state: PortState::Uninferred, - produced_by: Some(NodeId(133)), - }, - ); - ports.insert( - PortId(135), - Port { - id: PortId(135), - state: PortState::Resolved(TypeShape::new(DeclarationId(147))), - produced_by: None, - }, - ); - ports.insert( - PortId(136), - Port { - id: PortId(136), - state: PortState::Uninferred, - produced_by: Some(NodeId(135)), - }, - ); - ports.insert( - PortId(137), - Port { - id: PortId(137), - state: PortState::Uninferred, - produced_by: Some(NodeId(136)), - }, - ); - ports.insert( - PortId(138), - Port { - id: PortId(138), - state: PortState::Uninferred, - produced_by: Some(NodeId(137)), - }, - ); - ports.insert( - PortId(139), - Port { - id: PortId(139), - state: PortState::Uninferred, - produced_by: Some(NodeId(138)), - }, - ); - ports.insert( - PortId(140), - Port { - id: PortId(140), - state: PortState::Uninferred, - produced_by: Some(NodeId(139)), - }, - ); - ports.insert( - PortId(141), - Port { - id: PortId(141), - state: PortState::Resolved(TypeShape::new(DeclarationId(147))), - produced_by: None, - }, - ); - ports.insert( - PortId(142), - Port { - id: PortId(142), - state: PortState::Uninferred, - produced_by: Some(NodeId(141)), - }, - ); - ports.insert( - PortId(143), - Port { - id: PortId(143), - state: PortState::Uninferred, - produced_by: Some(NodeId(142)), - }, - ); - ports.insert( - PortId(144), - Port { - id: PortId(144), - state: PortState::Uninferred, - produced_by: Some(NodeId(143)), - }, - ); - ports.insert( - PortId(145), - Port { - id: PortId(145), - state: PortState::Uninferred, - produced_by: Some(NodeId(144)), - }, - ); - ports.insert( - PortId(146), - Port { - id: PortId(146), - state: PortState::Uninferred, - produced_by: Some(NodeId(145)), - }, - ); - ports.insert( - PortId(147), - Port { - id: PortId(147), - state: PortState::Resolved(TypeShape::new(DeclarationId(147))), - produced_by: None, - }, - ); - ports.insert( - PortId(148), - Port { - id: PortId(148), - state: PortState::Uninferred, - produced_by: Some(NodeId(147)), - }, - ); - ports.insert( - PortId(149), - Port { - id: PortId(149), - state: PortState::Uninferred, - produced_by: Some(NodeId(148)), - }, - ); - ports.insert( - PortId(150), - Port { - id: PortId(150), - state: PortState::Uninferred, - produced_by: Some(NodeId(149)), - }, - ); - ports.insert( - PortId(151), - Port { - id: PortId(151), - state: PortState::Uninferred, - produced_by: Some(NodeId(150)), - }, - ); - ports.insert( - PortId(152), - Port { - id: PortId(152), - state: PortState::Uninferred, - produced_by: Some(NodeId(151)), - }, - ); - ports.insert( - PortId(153), - Port { - id: PortId(153), - state: PortState::Resolved(TypeShape::new(DeclarationId(147))), - produced_by: None, - }, - ); - ports.insert( - PortId(154), - Port { - id: PortId(154), - state: PortState::Uninferred, - produced_by: Some(NodeId(153)), - }, - ); - ports.insert( - PortId(155), - Port { - id: PortId(155), - state: PortState::Uninferred, - produced_by: Some(NodeId(154)), - }, - ); - ports.insert( - PortId(156), - Port { - id: PortId(156), - state: PortState::Uninferred, - produced_by: Some(NodeId(155)), - }, - ); - ports.insert( - PortId(157), - Port { - id: PortId(157), - state: PortState::Uninferred, - produced_by: Some(NodeId(156)), - }, - ); - ports.insert( - PortId(158), - Port { - id: PortId(158), - state: PortState::Uninferred, - produced_by: Some(NodeId(157)), - }, - ); - ports.insert( - PortId(159), - Port { - id: PortId(159), - state: PortState::Resolved(TypeShape::new(DeclarationId(154))), - produced_by: None, - }, - ); - ports.insert( - PortId(160), - Port { - id: PortId(160), - state: PortState::Uninferred, - produced_by: Some(NodeId(159)), - }, - ); - ports.insert( - PortId(161), - Port { - id: PortId(161), - state: PortState::Uninferred, - produced_by: Some(NodeId(160)), - }, - ); - ports.insert( - PortId(162), - Port { - id: PortId(162), - state: PortState::Uninferred, - produced_by: Some(NodeId(161)), - }, - ); - ports.insert( - PortId(163), - Port { - id: PortId(163), - state: PortState::Uninferred, - produced_by: Some(NodeId(162)), - }, - ); - ports.insert( - PortId(164), - Port { - id: PortId(164), - state: PortState::Uninferred, - produced_by: Some(NodeId(163)), - }, - ); - ports.insert( - PortId(165), - Port { - id: PortId(165), - state: PortState::Resolved(TypeShape::new(DeclarationId(125))), - produced_by: None, - }, - ); - ports.insert( - PortId(166), - Port { - id: PortId(166), - state: PortState::Uninferred, - produced_by: Some(NodeId(165)), - }, - ); - ports.insert( - PortId(167), - Port { - id: PortId(167), - state: PortState::Uninferred, - produced_by: Some(NodeId(166)), - }, - ); - ports.insert( - PortId(168), - Port { - id: PortId(168), - state: PortState::Uninferred, - produced_by: Some(NodeId(167)), - }, - ); - ports.insert( - PortId(169), - Port { - id: PortId(169), - state: PortState::Uninferred, - produced_by: Some(NodeId(168)), - }, - ); - ports.insert( - PortId(170), - Port { - id: PortId(170), - state: PortState::Uninferred, - produced_by: Some(NodeId(169)), - }, - ); - ports.insert( - PortId(171), - Port { - id: PortId(171), - state: PortState::Resolved(TypeShape::new(DeclarationId(227))), - produced_by: None, - }, - ); - ports.insert( - PortId(172), - Port { - id: PortId(172), - state: PortState::Uninferred, - produced_by: Some(NodeId(171)), - }, - ); - ports.insert( - PortId(173), - Port { - id: PortId(173), - state: PortState::Uninferred, - produced_by: Some(NodeId(172)), - }, - ); - ports.insert( - PortId(174), - Port { - id: PortId(174), - state: PortState::Uninferred, - produced_by: Some(NodeId(173)), - }, - ); - ports.insert( - PortId(175), - Port { - id: PortId(175), - state: PortState::Uninferred, - produced_by: Some(NodeId(174)), - }, - ); - ports.insert( - PortId(176), - Port { - id: PortId(176), - state: PortState::Uninferred, - produced_by: Some(NodeId(175)), - }, - ); - ports.insert( - PortId(177), - Port { - id: PortId(177), - state: PortState::Resolved(TypeShape::new(DeclarationId(128))), - produced_by: None, - }, - ); - ports.insert( - PortId(178), - Port { - id: PortId(178), - state: PortState::Resolved(TypeShape::new(DeclarationId(228))), - produced_by: None, - }, - ); - ports.insert( - PortId(179), - Port { - id: PortId(179), - state: PortState::Uninferred, - produced_by: Some(NodeId(177)), - }, - ); - ports.insert( - PortId(180), - Port { - id: PortId(180), - state: PortState::Uninferred, - produced_by: Some(NodeId(178)), - }, - ); - ports.insert( - PortId(181), - Port { - id: PortId(181), - state: PortState::Uninferred, - produced_by: Some(NodeId(179)), - }, - ); - ports.insert( - PortId(182), - Port { - id: PortId(182), - state: PortState::Uninferred, - produced_by: Some(NodeId(180)), - }, - ); - ports.insert( - PortId(183), - Port { - id: PortId(183), - state: PortState::Uninferred, - produced_by: Some(NodeId(181)), - }, - ); - ports.insert( - PortId(184), - Port { - id: PortId(184), - state: PortState::Uninferred, - produced_by: Some(NodeId(182)), - }, - ); - ports.insert( - PortId(185), - Port { - id: PortId(185), - state: PortState::Uninferred, - produced_by: Some(NodeId(183)), - }, - ); - ports.insert( - PortId(186), - Port { - id: PortId(186), - state: PortState::Uninferred, - produced_by: Some(NodeId(184)), - }, - ); - ports.insert( - PortId(187), - Port { - id: PortId(187), - state: PortState::Uninferred, - produced_by: Some(NodeId(185)), - }, - ); - ports.insert( - PortId(188), - Port { - id: PortId(188), - state: PortState::Uninferred, - produced_by: Some(NodeId(186)), - }, - ); - ports.insert( - PortId(189), - Port { - id: PortId(189), - state: PortState::Uninferred, - produced_by: Some(NodeId(187)), - }, - ); - ports.insert( - PortId(190), - Port { - id: PortId(190), - state: PortState::Uninferred, - produced_by: Some(NodeId(188)), - }, - ); - ports.insert( - PortId(191), - Port { - id: PortId(191), - state: PortState::Uninferred, - produced_by: Some(NodeId(189)), - }, - ); - ports.insert( - PortId(192), - Port { - id: PortId(192), - state: PortState::Uninferred, - produced_by: Some(NodeId(190)), - }, - ); - ports.insert( - PortId(193), - Port { - id: PortId(193), - state: PortState::Uninferred, - produced_by: Some(NodeId(191)), - }, - ); - ports.insert( - PortId(194), - Port { - id: PortId(194), - state: PortState::Uninferred, - produced_by: Some(NodeId(192)), - }, - ); - ports.insert( - PortId(195), - Port { - id: PortId(195), - state: PortState::Uninferred, - produced_by: Some(NodeId(193)), - }, - ); - ports.insert( - PortId(196), - Port { - id: PortId(196), - state: PortState::Uninferred, - produced_by: Some(NodeId(194)), - }, - ); - ports.insert( - PortId(197), - Port { - id: PortId(197), - state: PortState::Uninferred, - produced_by: Some(NodeId(195)), - }, - ); - ports.insert( - PortId(198), - Port { - id: PortId(198), - state: PortState::Uninferred, - produced_by: Some(NodeId(196)), - }, - ); - ports.insert( - PortId(199), - Port { - id: PortId(199), - state: PortState::Uninferred, - produced_by: Some(NodeId(197)), - }, - ); - ports.insert( - PortId(200), - Port { - id: PortId(200), - state: PortState::Uninferred, - produced_by: Some(NodeId(198)), - }, - ); - ports.insert( - PortId(201), - Port { - id: PortId(201), - state: PortState::Uninferred, - produced_by: Some(NodeId(199)), - }, - ); - ports.insert( - PortId(202), - Port { - id: PortId(202), - state: PortState::Uninferred, - produced_by: Some(NodeId(200)), - }, - ); - ports.insert( - PortId(203), - Port { - id: PortId(203), - state: PortState::Uninferred, - produced_by: Some(NodeId(201)), - }, - ); - ports.insert( - PortId(204), - Port { - id: PortId(204), - state: PortState::Uninferred, - produced_by: Some(NodeId(202)), - }, - ); - ports.insert( - PortId(205), - Port { - id: PortId(205), - state: PortState::Uninferred, - produced_by: Some(NodeId(203)), - }, - ); - ports.insert( - PortId(206), - Port { - id: PortId(206), - state: PortState::Uninferred, - produced_by: Some(NodeId(204)), - }, - ); - ports.insert( - PortId(207), - Port { - id: PortId(207), - state: PortState::Uninferred, - produced_by: Some(NodeId(205)), - }, - ); - ports.insert( - PortId(208), - Port { - id: PortId(208), - state: PortState::Uninferred, - produced_by: Some(NodeId(206)), - }, - ); - ports.insert( - PortId(209), - Port { - id: PortId(209), - state: PortState::Uninferred, - produced_by: Some(NodeId(207)), - }, - ); - ports.insert( - PortId(210), - Port { - id: PortId(210), - state: PortState::Uninferred, - produced_by: Some(NodeId(208)), - }, - ); - ports.insert( - PortId(211), - Port { - id: PortId(211), - state: PortState::Uninferred, - produced_by: Some(NodeId(209)), - }, - ); - ports.insert( - PortId(212), - Port { - id: PortId(212), - state: PortState::Uninferred, - produced_by: Some(NodeId(210)), - }, - ); - ports.insert( - PortId(213), - Port { - id: PortId(213), - state: PortState::Uninferred, - produced_by: Some(NodeId(211)), - }, - ); - ports.insert( - PortId(214), - Port { - id: PortId(214), - state: PortState::Uninferred, - produced_by: Some(NodeId(212)), - }, - ); - ports.insert( - PortId(215), - Port { - id: PortId(215), - state: PortState::Uninferred, - produced_by: Some(NodeId(213)), - }, - ); - ports.insert( - PortId(216), - Port { - id: PortId(216), - state: PortState::Uninferred, - produced_by: Some(NodeId(214)), - }, - ); - ports.insert( - PortId(217), - Port { - id: PortId(217), - state: PortState::Uninferred, - produced_by: Some(NodeId(215)), - }, - ); - ports.insert( - PortId(218), - Port { - id: PortId(218), - state: PortState::Uninferred, - produced_by: Some(NodeId(216)), - }, - ); - ports.insert( - PortId(219), - Port { - id: PortId(219), - state: PortState::Uninferred, - produced_by: Some(NodeId(217)), - }, - ); - ports.insert( - PortId(220), - Port { - id: PortId(220), - state: PortState::Uninferred, - produced_by: Some(NodeId(218)), - }, - ); - ports.insert( - PortId(221), - Port { - id: PortId(221), - state: PortState::Uninferred, - produced_by: Some(NodeId(219)), - }, - ); - ports.insert( - PortId(222), - Port { - id: PortId(222), - state: PortState::Uninferred, - produced_by: Some(NodeId(220)), - }, - ); - ports.insert( - PortId(223), - Port { - id: PortId(223), - state: PortState::Uninferred, - produced_by: Some(NodeId(221)), - }, - ); - ports.insert( - PortId(224), - Port { - id: PortId(224), - state: PortState::Uninferred, - produced_by: Some(NodeId(222)), - }, - ); - ports.insert( - PortId(225), - Port { - id: PortId(225), - state: PortState::Uninferred, - produced_by: Some(NodeId(223)), - }, - ); - ports.insert( - PortId(226), - Port { - id: PortId(226), - state: PortState::Uninferred, - produced_by: Some(NodeId(224)), - }, - ); - ports.insert( - PortId(227), - Port { - id: PortId(227), - state: PortState::Uninferred, - produced_by: Some(NodeId(225)), - }, - ); - ports.insert( - PortId(228), - Port { - id: PortId(228), - state: PortState::Uninferred, - produced_by: Some(NodeId(226)), - }, - ); - ports.insert( - PortId(229), - Port { - id: PortId(229), - state: PortState::Uninferred, - produced_by: Some(NodeId(227)), - }, - ); - ports.insert( - PortId(230), - Port { - id: PortId(230), - state: PortState::Uninferred, - produced_by: Some(NodeId(228)), - }, - ); - ports.insert( - PortId(231), - Port { - id: PortId(231), - state: PortState::Uninferred, - produced_by: Some(NodeId(229)), - }, - ); - ports.insert( - PortId(232), - Port { - id: PortId(232), - state: PortState::Uninferred, - produced_by: Some(NodeId(230)), - }, - ); - ports.insert( - PortId(233), - Port { - id: PortId(233), - state: PortState::Uninferred, - produced_by: Some(NodeId(231)), - }, - ); - ports.insert( - PortId(234), - Port { - id: PortId(234), - state: PortState::Uninferred, - produced_by: Some(NodeId(232)), - }, - ); - ports.insert( - PortId(235), - Port { - id: PortId(235), - state: PortState::Uninferred, - produced_by: Some(NodeId(233)), - }, - ); - ports.insert( - PortId(236), - Port { - id: PortId(236), - state: PortState::Uninferred, - produced_by: Some(NodeId(234)), - }, - ); - ports.insert( - PortId(237), - Port { - id: PortId(237), - state: PortState::Uninferred, - produced_by: Some(NodeId(235)), - }, - ); - ports.insert( - PortId(238), - Port { - id: PortId(238), - state: PortState::Uninferred, - produced_by: Some(NodeId(236)), - }, - ); - ports.insert( - PortId(239), - Port { - id: PortId(239), - state: PortState::Uninferred, - produced_by: Some(NodeId(237)), - }, - ); - ports.insert( - PortId(240), - Port { - id: PortId(240), - state: PortState::Uninferred, - produced_by: Some(NodeId(238)), - }, - ); - ports.insert( - PortId(241), - Port { - id: PortId(241), - state: PortState::Uninferred, - produced_by: Some(NodeId(239)), - }, - ); - ports.insert( - PortId(242), - Port { - id: PortId(242), - state: PortState::Uninferred, - produced_by: Some(NodeId(240)), - }, - ); - ports.insert( - PortId(243), - Port { - id: PortId(243), - state: PortState::Uninferred, - produced_by: Some(NodeId(241)), - }, - ); - ports.insert( - PortId(244), - Port { - id: PortId(244), - state: PortState::Uninferred, - produced_by: Some(NodeId(242)), - }, - ); - ports.insert( - PortId(245), - Port { - id: PortId(245), - state: PortState::Uninferred, - produced_by: Some(NodeId(243)), - }, - ); - ports.insert( - PortId(246), - Port { - id: PortId(246), - state: PortState::Uninferred, - produced_by: Some(NodeId(244)), - }, - ); - ports.insert( - PortId(247), - Port { - id: PortId(247), - state: PortState::Uninferred, - produced_by: Some(NodeId(245)), - }, - ); - ports.insert( - PortId(248), - Port { - id: PortId(248), - state: PortState::Uninferred, - produced_by: Some(NodeId(246)), - }, - ); - ports.insert( - PortId(249), - Port { - id: PortId(249), - state: PortState::Uninferred, - produced_by: Some(NodeId(247)), - }, - ); - ports.insert( - PortId(250), - Port { - id: PortId(250), - state: PortState::Uninferred, - produced_by: Some(NodeId(248)), - }, - ); - ports.insert( - PortId(251), - Port { - id: PortId(251), - state: PortState::Resolved(TypeShape::new(DeclarationId(124))), - produced_by: Some(NodeId(249)), - }, - ); - ports.insert( - PortId(252), - Port { - id: PortId(252), - state: PortState::Resolved(TypeShape::new(DeclarationId(128))), - produced_by: None, - }, - ); - ports.insert( - PortId(253), - Port { - id: PortId(253), - state: PortState::Uninferred, - produced_by: Some(NodeId(251)), - }, - ); - ports.insert( - PortId(254), - Port { - id: PortId(254), - state: PortState::Resolved(TypeShape::new(DeclarationId(87))), - produced_by: Some(NodeId(252)), - }, - ); - ports - } -} - -fn bootstrapped_std_fixture_dag_diagnostics() -> DiagnosticTable { - DiagnosticTable::new() -} - -fn bootstrapped_std_fixture_dag_clusters() -> Vec { - vec![] -} - -fn bootstrapped_std_fixture_dag_optional_match_disjs() -> HashMap { - HashMap::new() -} diff --git a/src/v3/compiler/src/boundary_emit_gates.rs b/src/v3/compiler/src/boundary_emit_gates.rs deleted file mode 100644 index a35e10e1ada..00000000000 --- a/src/v3/compiler/src/boundary_emit_gates.rs +++ /dev/null @@ -1,166 +0,0 @@ -//! Boundary emit-gate check functions shared by hand-Rust `#[test]` harnesses and -//! the `boundary_emit_gates` `bin` (`ExecuteCommand` logical child for `.dag` -//! `TestClaim` wrappers under `tests/dag/`). -//! -//! Each `check_*` returns `Ok(())` or `Err(String)`. The bin maps to exit 0/1; -//! `ExecuteCommand` reads only the exit code. - -use std::io::Write; -use std::path::PathBuf; -use std::process::{Command, Stdio}; -use std::sync::atomic::{AtomicUsize, Ordering}; - -use crate::compile_to_dag; -use crate::emit::emit_python_text; -use crate::emit_rust::emit_rust_module; - -const M2_PROBE_DAG: &str = "\ -module test.emit.multi_field_struct_variant - -import std.substrate { Declaration, TypeConnective, ArrowBody } - -fn is_arrow_pending(decl: Declaration) -> Bool = - match decl.connective { - Atom(payload) => false - Conj(c) => false - Disj(d) => false - Arrow(a) => is_pending(a.body) - Cardinality(c) => false - Instantiation(i) => false - } - -fn is_pending(body: ArrowBody) -> Bool = - match body { - UserDefined(n) => false - ExternalRealization(e) => false - Pending => true - NoBody => false - Unparsed(s) => false - } -"; - -static ROUNDTRIP_ID: AtomicUsize = AtomicUsize::new(0); - -fn next_roundtrip_dir() -> PathBuf { - let id = ROUNDTRIP_ID.fetch_add(1, Ordering::Relaxed); - std::env::temp_dir().join(format!( - "v3_boundary_emit_roundtrip_{}_{}", - std::process::id(), - id - )) -} - -fn emit_m2_probe_rust() -> Result { - let dag = compile_to_dag(M2_PROBE_DAG, "probe.dag") - .map_err(|e| format!("probe .dag compile failed: {e:?}"))?; - if !dag.diagnostics().is_empty() { - return Err(format!( - "probe .dag must compile cleanly, got {:?}", - dag.diagnostics() - )); - } - emit_rust_module(&dag).map_err(|e| format!("emit Rust module failed: {e:?}")) -} - -/// Host receipt: `m2_emit_multi_field_struct_variant_test::multi_field_struct_variant_match_emits_aliased_field_destructure`. -pub fn check_m2_multi_field_struct_variant_destructure_alias() -> Result<(), String> { - let rust = emit_m2_probe_rust()?; - if !rust.contains("body: __a_body") { - return Err(format!( - "expected `body: __a_body` destructure in emitted Rust; got:\n{rust}" - )); - } - if rust.contains("body: _,") || rust.contains("body: _ }") { - return Err(format!( - "wildcard `body: _` would drop the binding the fix routes through; got:\n{rust}" - )); - } - Ok(()) -} - -/// Host receipt: `m2_emit_multi_field_struct_variant_test::multi_field_struct_variant_arm_body_uses_aliased_reference`. -pub fn check_m2_multi_field_struct_variant_arm_aliased_ref() -> Result<(), String> { - let rust = emit_m2_probe_rust()?; - if !rust.contains("__a_body") { - return Err(format!( - "emitted arm body must reference the aliased `__a_body`; got:\n{rust}" - )); - } - if rust.contains("(a).body") || rust.contains("((a).body)") { - return Err(format!( - "pre-fix `(a).body` access must not appear in emitted Rust; got:\n{rust}" - )); - } - Ok(()) -} - -/// Host receipt: `m2_emit_multi_field_struct_variant_test::multi_field_struct_variant_emitted_rust_is_valid_syntax`. -pub fn check_m2_multi_field_struct_variant_rustfmt_valid() -> Result<(), String> { - let rust = emit_m2_probe_rust()?; - let mut child = Command::new("rustfmt") - .arg("--emit") - .arg("stdout") - .stdin(Stdio::piped()) - .stdout(Stdio::piped()) - .stderr(Stdio::piped()) - .spawn() - .map_err(|e| format!("spawn rustfmt: {e}"))?; - child - .stdin - .as_mut() - .ok_or_else(|| "rustfmt stdin".to_string())? - .write_all(rust.as_bytes()) - .map_err(|e| format!("write to rustfmt: {e}"))?; - let output = child - .wait_with_output() - .map_err(|e| format!("wait rustfmt: {e}"))?; - if !output.status.success() { - return Err(format!( - "emitted Rust did not parse through rustfmt; stderr:\n{}", - String::from_utf8_lossy(&output.stderr) - )); - } - Ok(()) -} - -fn python_stdout(source: &str, file_name: &str) -> Result { - let dag = compile_to_dag(source, file_name) - .map_err(|e| format!("compiled python program source: {e:?}"))?; - let rendered = emit_python_text(&dag).map_err(|e| format!("emit python program: {e:?}"))?; - let tmp_dir = next_roundtrip_dir(); - std::fs::create_dir_all(&tmp_dir).map_err(|e| format!("create tmp dir: {e}"))?; - let src_path = tmp_dir.join("main.py"); - std::fs::File::create(&src_path) - .and_then(|mut f| f.write_all(rendered.as_bytes())) - .map_err(|e| format!("write emitted python source: {e}"))?; - - let run = Command::new("python3") - .arg(&src_path) - .output() - .map_err(|e| format!("run python3: {e}"))?; - if !run.status.success() { - return Err(format!( - "python3 failed on emitted source:\n{rendered}\nstderr:\n{}", - String::from_utf8_lossy(&run.stderr) - )); - } - Ok(String::from_utf8_lossy(&run.stdout).trim().to_string()) -} - -/// Host receipt: `m1_4_emit_python_test::emit_python_checked_division_roundtrips_ok_and_errors`. -/// -/// Structural migration target for `t_pb_b_1_execute_command_boundary.dag` (shell smoke only); -/// this check exercises real CPython on emitted division programs. -pub fn check_python_checked_division_roundtrips() -> Result<(), String> { - let ok = python_stdout("let x = 6 / 2\n", "python_div_ok.v3")?; - if ok != "('Ok', 3)" { - return Err(format!("6/2 roundtrip: expected `('Ok', 3)`, got `{ok}`")); - } - let zero = python_stdout("let x = 6 / 0\n", "python_div_zero.v3")?; - if zero != "('Err', )" { - return Err(format!( - "6/0 roundtrip: expected `('Err', )`, got `{zero}`" - )); - } - Ok(()) -} diff --git a/src/v3/compiler/src/bounded_host_command.rs b/src/v3/compiler/src/bounded_host_command.rs deleted file mode 100644 index 7585ad86bd1..00000000000 --- a/src/v3/compiler/src/bounded_host_command.rs +++ /dev/null @@ -1,243 +0,0 @@ -//! Bounded host subprocess execution (P2 process boundary / P4 wall-clock cap). -//! -//! Shared by [`crate::post_emit_verifier::run_post_emit_verifier`] and the W1 / -//! L5 harness in [`crate::test_runner`]. Fail-closed vs unbounded -//! [`std::process::Command::output`] and unbounded `read_to_end` on verbose children. -//! -//! Wall budget covers **child wait and pipe drain**: if the direct child exits while -//! process-group descendants still hold pipe write ends, drain threads get EOF only -//! after the group is killed or the overall deadline trips. - -use std::io::Read; -use std::process::{Child, Command, Output, Stdio}; -use std::thread::JoinHandle; -use std::time::{Duration, Instant}; - -/// Default wall-clock for post-emit verifiers and W1 host children (matches -/// [`crate::test_runner::EXECUTE_COMMAND_WALL_TIMEOUT`]). -pub const DEFAULT_WALL_TIMEOUT: Duration = Duration::from_secs(30); - -const WAIT_POLL: Duration = Duration::from_millis(20); - -const DRAIN_JOIN_GRACE_POLLS: u32 = 50; - -const DRAIN_CHUNK_BYTES: usize = 8192; - -/// Max bytes retained from a host child's **stdout**; drain to EOF after the cap. -pub const CAPTURE_MAX_STDOUT_BYTES: usize = 16 * 1024; - -/// Max bytes retained from a host child's **stderr**; drain to EOF after the cap. -pub const CAPTURE_MAX_STDERR_BYTES: usize = 256 * 1024; - -/// Host child ready to spawn: stdin null, stdout/stderr piped, process group on Unix. -/// -/// Construct only via [`prepare_host_command`]; [`host_command_output`] rejects plain -/// [`Command`] so P2 boundary shape cannot depend on caller call-order convention. -#[must_use] -pub struct PreparedHostCommand(Command); - -#[derive(Debug)] -struct BoundedPipeCapture { - bytes: Vec, - truncated: bool, -} - -fn drain_reader_bounded( - mut r: impl Read, - max_stored: usize, -) -> std::io::Result { - let mut buf = Vec::new(); - let mut truncated = false; - let mut scratch = [0u8; DRAIN_CHUNK_BYTES]; - loop { - let n = r.read(&mut scratch)?; - if n == 0 { - break; - } - if buf.len() >= max_stored { - truncated = true; - continue; - } - let room = max_stored - buf.len(); - if n <= room { - buf.extend_from_slice(&scratch[..n]); - } else { - buf.extend_from_slice(&scratch[..room]); - truncated = true; - } - } - Ok(BoundedPipeCapture { - bytes: buf, - truncated, - }) -} - -fn apply_host_process_boundary(cmd: &mut Command) { - cmd.stdin(Stdio::null()) - .stdout(Stdio::piped()) - .stderr(Stdio::piped()); - #[cfg(unix)] - { - use std::os::unix::process::CommandExt; - unsafe { - cmd.pre_exec(|| { - if libc::setpgid(0, 0) != 0 { - return Err(std::io::Error::last_os_error()); - } - Ok(()) - }); - } - } -} - -/// Apply P2/P4 host-child boundary (null stdin, piped stdout/stderr, process group). -pub fn prepare_host_command(cmd: Command) -> PreparedHostCommand { - let mut cmd = cmd; - apply_host_process_boundary(&mut cmd); - PreparedHostCommand(cmd) -} - -#[derive(Debug, Clone, PartialEq, Eq)] -enum ChildWaitFail { - WallTimeout { wall_time: Duration }, - Io(String), -} - -#[cfg(unix)] -fn kill_process_group(pgid: i32) { - use libc::{kill, SIGKILL}; - if pgid > 0 && unsafe { kill(-pgid, SIGKILL) } < 0 { - // Best-effort: group may already be gone. - } -} - -#[cfg(not(unix))] -fn kill_process_group(_pgid: i32) {} - -fn reap_host_child(child: &mut Child, pgid: i32) { - kill_process_group(pgid); - let _ = child.kill(); - let _ = child.wait(); -} - -fn child_wait_until( - child: &mut Child, - deadline: Instant, - wall_time: Duration, -) -> Result { - loop { - match child.try_wait() { - Ok(Some(status)) => return Ok(status), - Ok(None) => { - if Instant::now() >= deadline { - reap_host_child(child, child.id() as i32); - return Err(ChildWaitFail::WallTimeout { wall_time }); - } - std::thread::sleep(WAIT_POLL); - } - Err(err) => return Err(ChildWaitFail::Io(format!("{err}"))), - } - } -} - -fn join_pipe_capture( - handle: JoinHandle>, - deadline: Instant, - pgid: i32, - stream: &str, - label: &str, -) -> Result { - while !handle.is_finished() { - if Instant::now() >= deadline { - kill_process_group(pgid); - for _ in 0..DRAIN_JOIN_GRACE_POLLS { - if handle.is_finished() { - break; - } - std::thread::sleep(WAIT_POLL); - } - if !handle.is_finished() { - return Err(format!( - "{label}: {stream} drain exceeded wall-clock budget (process group {pgid} killed, fail-closed)" - )); - } - } - std::thread::sleep(WAIT_POLL); - } - handle - .join() - .map_err(|_| format!("{label}: {stream} capture thread panicked"))? - .map_err(|e| format!("{label}: read {stream} failed: {e}")) -} - -/// `spawn` + wall-bounded wait + bounded stdout/stderr capture. -pub fn host_command_output( - label: &str, - wall: Duration, - prepared: PreparedHostCommand, -) -> Result { - let PreparedHostCommand(mut cmd) = prepared; - let started = Instant::now(); - let deadline = started + wall; - - let mut child = cmd - .spawn() - .map_err(|e| format!("{label}: failed to spawn host child: {e}"))?; - let pgid = child.id() as i32; - - let Some(mut stdout) = child.stdout.take() else { - reap_host_child(&mut child, pgid); - return Err(format!( - "{label}: internal error: stdout not piped after prepare_host_command" - )); - }; - let Some(mut stderr) = child.stderr.take() else { - reap_host_child(&mut child, pgid); - return Err(format!( - "{label}: internal error: stderr not piped after prepare_host_command" - )); - }; - - let stdout_handle = - std::thread::spawn(move || drain_reader_bounded(&mut stdout, CAPTURE_MAX_STDOUT_BYTES)); - let stderr_handle = - std::thread::spawn(move || drain_reader_bounded(&mut stderr, CAPTURE_MAX_STDERR_BYTES)); - - let status = match child_wait_until(&mut child, deadline, wall) { - Ok(s) => s, - Err(ChildWaitFail::WallTimeout { wall_time }) => { - let _ = join_pipe_capture(stdout_handle, deadline, pgid, "stdout", label); - let _ = join_pipe_capture(stderr_handle, deadline, pgid, "stderr", label); - return Err(format!( - "{label}: exceeded {:.2}s wall-clock limit (process group killed, fail-closed)", - wall_time.as_secs_f64() - )); - } - Err(ChildWaitFail::Io(err)) => { - reap_host_child(&mut child, pgid); - let _ = join_pipe_capture(stdout_handle, deadline, pgid, "stdout", label); - let _ = join_pipe_capture(stderr_handle, deadline, pgid, "stderr", label); - return Err(format!("{label}: wait on host child failed: {err}")); - } - }; - - let stdout_cap = join_pipe_capture(stdout_handle, deadline, pgid, "stdout", label)?; - let stderr_cap = join_pipe_capture(stderr_handle, deadline, pgid, "stderr", label)?; - - if stdout_cap.truncated || stderr_cap.truncated { - return Err(format!( - "{label}: bounded host I/O exceeded (stdout cap {} B, stderr cap {} B; stdout_trunc={} stderr_trunc={}); child exit={:?}", - CAPTURE_MAX_STDOUT_BYTES, - CAPTURE_MAX_STDERR_BYTES, - stdout_cap.truncated, - stderr_cap.truncated, - status.code(), - )); - } - - Ok(Output { - status, - stdout: stdout_cap.bytes, - stderr: stderr_cap.bytes, - }) -} diff --git a/src/v3/compiler/src/cementing_dispatch.rs b/src/v3/compiler/src/cementing_dispatch.rs deleted file mode 100644 index 82dc5b6053b..00000000000 --- a/src/v3/compiler/src/cementing_dispatch.rs +++ /dev/null @@ -1,644 +0,0 @@ -//! Band-C cementing dispatch — [`crate::test_runner::TestPredicate::CementingDispatchMatchesProjection`]. -//! -//! SG-0 / INVARIANTS P5: hand-authored `src/v3/compiler/src/` module — register the path in -//! `EXPECTED_HAND_AUTHORED_NON_TEST` inside `tests/integration/sg0_census_test.rs` when this -//! file ships or changes materially. -//! -//! Projects `LensRegistryEntry` rows from the bootstrapped `regen.dag` authority against -//! `std.verification` `lens_capability_register_rows` (closed coproduct status axes per -//! `docs/design-tests-as-data-completeness.md` §8.3), then validates the Band-C receipt list -//! in `cementing_dispatch.dag` and on-disk harness artifacts. -//! -//! **Interim host coupling:** validating `temporary-rust` receipts scans `tests/integration.rs` -//! once per predicate evaluation (see `std::fs::read_to_string` below). Dissolution: consume -//! reflected wiring facts at the runner edge so Band-C dispatch does not depend on crate layout -//! + host FS for this check. -//! -//! **Interim projection bridge:** `expected_cementing_receipt_triples` is a fail-closed Rust match -//! from `(registry_name, regen lens_file basename)` to the canonical receipt triples the -//! `cementing_band_c_v2_complete_receipts` list must equal. The basename filter includes -//! v2-oracle-complete rows **and** v3-native behaviorally complete rows (`LensCapabilityV2NoneV3Native`). -//! Dissolution: move that expansion into -//! `.dag` data (fixture or `std.verification`) so the predicate reads a single structural receipt -//! roster keyed off the register ∩ `regen.dag` projection, with no parallel Rust roster. - -use std::collections::{BTreeMap, BTreeSet, HashSet}; -use std::path::Path as FsPath; - -use crate::dag::{Dag, FieldValue, LiteralBits, TypeConnective, ValueBody}; -use crate::integration_rs_wiring_scan::integration_rs_cementing_path_attr_binds_mod_stem; -use crate::r3_gate_87_cementing_regen_runner_suites::r3_gate_87_cementing_regen_pb_b1_dag_module_stems; - -fn record_field<'a>(fields: &'a [(String, FieldValue)], label: &str) -> Option<&'a FieldValue> { - fields - .iter() - .find(|(candidate, _)| candidate == label) - .map(|(_, value)| value) -} - -fn string_field(fields: &[(String, FieldValue)], label: &str) -> Result { - match record_field(fields, label) { - Some(FieldValue::Literal(LiteralBits::String(value))) => Ok(value.clone()), - Some(other) => Err(format!("`{label}` must be a string literal, got {other:?}")), - None => Err(format!("record is missing string field `{label}`")), - } -} - -fn disj_variants( - dag: &Dag, - type_name: &str, -) -> Result, String> { - let sum_decl = dag.declaration_by_name(type_name).ok_or_else(|| { - format!( - "merged DAG missing nullary sum `{type_name}` — expected `std.verification` for lens \ - capability axes, or `tests/dag/cementing_dispatch.dag` for `CementingBandCReceiptKind`" - ) - })?; - let TypeConnective::Disj { variants } = &sum_decl.connective else { - return Err(format!("`{type_name}` must be a Disj coproduct")); - }; - Ok(variants.iter().map(|v| (v.label.clone(), v.ty)).collect()) -} - -fn decode_nullary_sum_variant( - dag: &Dag, - sum_type_name: &str, - value: &FieldValue, - field_label: &str, - record_role: &str, -) -> Result { - let variants = disj_variants(dag, sum_type_name)?; - let allowed: HashSet = variants.iter().map(|(_, id)| *id).collect(); - let FieldValue::Variant { - constructor, - payload, - } = value - else { - return Err(format!( - "{record_role} `{field_label}` must be a closed sum variant of `{sum_type_name}`; got {value:?}" - )); - }; - if !payload.is_empty() { - return Err(format!( - "{record_role} `{field_label}`: unexpected variant payload (expected nullary `{sum_type_name}` arm)" - )); - } - if !allowed.contains(constructor) { - return Err(format!( - "{record_role} `{field_label}`: constructor id {:?} is not a declared variant of `{sum_type_name}`", - constructor - )); - } - variants - .iter() - .find(|(_, id)| id == constructor) - .map(|(label, _)| label.clone()) - .ok_or_else(|| { - format!( - "{record_role} `{field_label}`: internal mismatch resolving `{sum_type_name}` variant" - ) - }) -} - -/// Maps `CementingBandCReceiptKind` variant labels to the stable wire tags used in -/// `expected_cementing_receipt_triples` and on-disk dispatch branches. -fn cementing_receipt_kind_wire_tag(sum_variant_label: &str) -> Result<&'static str, String> { - match sum_variant_label { - "DagHarness" => Ok("dag"), - "TemporaryRustModule" => Ok("temporary-rust"), - other => Err(format!( - "cementing receipt `kind`: unknown `CementingBandCReceiptKind` variant `{other}`" - )), - } -} - -fn decode_cementing_band_c_receipt_kind( - dag: &Dag, - value: &FieldValue, - field_label: &str, -) -> Result<&'static str, String> { - let label = decode_nullary_sum_variant( - dag, - "CementingBandCReceiptKind", - value, - field_label, - "cementing receipt row", - )?; - cementing_receipt_kind_wire_tag(&label) -} - -fn record_fields(value: &FieldValue) -> Option<&[(String, FieldValue)]> { - match value { - FieldValue::Record(fields) => Some(fields.as_slice()), - _ => None, - } -} - -fn resolve_declaration_ref_id( - value: &FieldValue, - field_label: &str, -) -> Result { - match value { - FieldValue::Reference(id) => Ok(*id), - FieldValue::Record(fields) if fields.is_empty() => Err(format!( - "`{field_label}`: DeclarationRef is the empty record literal {{}} — use an identifier \ - so lowering emits FieldValue::Reference(DeclarationId), not an empty record", - )), - other => Err(format!( - "`{field_label}`: expected FieldValue::Reference(DeclarationId) \ - for a DeclarationRef edge, got {other:?}" - )), - } -} - -fn list_items_of_declaration( - dag: &Dag, - id: crate::dag::DeclarationId, - role: &str, -) -> Result, String> { - let decl = dag.declaration(id); - match &decl.value_body { - Some(ValueBody::List(items)) => Ok(items.clone()), - other => Err(format!( - "`{role}` must resolve to a `List<…>` data declaration; got {:?} for `{}`", - other, - decl.name.as_deref().unwrap_or("") - )), - } -} - -fn read_lens_registry_name_lens_file_pairs(dag: &Dag) -> Result, String> { - let entry_type_id = dag - .declaration_by_name("LensRegistryEntry") - .map(|decl| decl.id) - .ok_or_else(|| "bootstrap must declare `LensRegistryEntry` (regen.dag)".to_string())?; - - let mut pairs = Vec::new(); - for decl in dag.declarations() { - if decl.meta_tag != Some(entry_type_id) { - continue; - } - let Some(ValueBody::Structural { fields }) = &decl.value_body else { - return Err(format!( - "lens registry entry `{}` must carry a structural value body", - decl.name.as_deref().unwrap_or("") - )); - }; - let binding = decl - .name - .clone() - .unwrap_or_else(|| "".to_string()); - pairs.push(( - string_field(fields, "name") - .map_err(|e| format!("lens registry entry `{binding}`: {e}"))?, - string_field(fields, "lens_file") - .map_err(|e| format!("lens registry entry `{binding}`: {e}"))?, - )); - } - Ok(pairs) -} - -/// Closed roster of Band-C `(registry_name, module_stem, kind)` receipts implied by the -/// current `regen.dag` × cementing register projection. When a new projected lens lands -/// in `regen.dag`, extend this expansion in the same PR as `cementing_dispatch.dag` -/// receipt rows — otherwise the dispatch predicate fail-closes with an explicit error. -fn expected_cementing_receipt_triples( - registry_pairs: &[(String, String)], - basenames: &BTreeSet, -) -> Result, String> { - let mut out = BTreeSet::new(); - for (name, lens_file) in registry_pairs { - let basename = FsPath::new(lens_file) - .file_name() - .and_then(|s| s.to_str()) - .ok_or_else(|| { - format!("registry entry `{name}` has lens_file without basename: {lens_file}") - })? - .to_string(); - if !basenames.contains(&basename) { - continue; - } - match (name.as_str(), basename.as_str()) { - ("cost", "complexity.dag") => { - out.insert(( - name.clone(), - "t_r3_gate_87_cementing_regen_cost".to_string(), - "dag".to_string(), - )); - out.insert(( - name.clone(), - "complexity_lens_behavioral_completion".to_string(), - "temporary-rust".to_string(), - )); - } - ("cost_symbolic", "cost.dag") => { - out.insert(( - name.clone(), - "t_r3_gate_87_cementing_regen_cost_symbolic".to_string(), - "dag".to_string(), - )); - out.insert(( - name.clone(), - "cost_lens_symbolic_consumer_test".to_string(), - "temporary-rust".to_string(), - )); - } - ("effect_enumeration", "effect_enumeration.dag") => { - out.insert(( - name.clone(), - "t_r3_gate_87_cementing_regen_effect_enumeration".to_string(), - "dag".to_string(), - )); - } - ("idempotency", "idempotency.dag") => { - out.insert(( - name.clone(), - "t_r3_gate_87_cementing_regen_idempotency".to_string(), - "dag".to_string(), - )); - } - ("parallelism", "parallelism.dag") => { - out.insert(( - name.clone(), - "t_r3_gate_87_cementing_regen_parallelism".to_string(), - "dag".to_string(), - )); - } - ("provenance", "provenance.dag") => { - out.insert(( - name.clone(), - "t_r3_gate_87_cementing_regen_provenance".to_string(), - "dag".to_string(), - )); - } - ("structural_resolution", "structural_resolution.dag") => { - out.insert(( - name.clone(), - "t_r3_gate_87_cementing_regen_structural_resolution".to_string(), - "dag".to_string(), - )); - } - ("unused_parameters", "unused_parameters.dag") => { - out.insert(( - name.clone(), - "t_r3_gate_87_cementing_regen_unused_parameters".to_string(), - "dag".to_string(), - )); - } - ("variant_payload", "variant_payload.dag") => { - out.insert(( - name.clone(), - "t_r3_gate_87_cementing_regen_variant_payload".to_string(), - "dag".to_string(), - )); - } - _ => { - return Err(format!( - "Band-C cementing projection includes `LensRegistryEntry` \ - (`name={name}`, `lens_file` basename `{basename}`) but \ - `expected_cementing_receipt_triples` has no receipt expansion — \ - land matching `cementing_band_c_v2_complete_receipts` rows in \ - `cementing_dispatch.dag` and extend the expansion table in \ - `cementing_dispatch.rs` in the same PR." - )); - } - } - } - Ok(out) -} - -fn parse_capability_register_row( - dag: &Dag, - row: &FieldValue, -) -> Result<(String, String, String, String), String> { - let Some(fields) = record_fields(row) else { - return Err(format!( - "capability_register list: expected record row, got {row:?}" - )); - }; - let lens_basename = string_field(fields, "lens_basename")?; - let structural = record_field(fields, "structural").ok_or_else(|| { - "capability_register row: missing `structural` field (expected \ - `LensCapabilityStructuralStatus` variant)" - .to_string() - })?; - let behavioral = record_field(fields, "behavioral").ok_or_else(|| { - "capability_register row: missing `behavioral` field (expected \ - `LensCapabilityBehavioralStatus` variant)" - .to_string() - })?; - let v2 = record_field(fields, "v2_counterpart").ok_or_else(|| { - "capability_register row: missing `v2_counterpart` field (expected \ - `LensCapabilityV2Counterpart` variant)" - .to_string() - })?; - let structural_label = decode_nullary_sum_variant( - dag, - "LensCapabilityStructuralStatus", - structural, - "structural", - "capability_register row", - )?; - let behavioral_label = decode_nullary_sum_variant( - dag, - "LensCapabilityBehavioralStatus", - behavioral, - "behavioral", - "capability_register row", - )?; - let v2_label = decode_nullary_sum_variant( - dag, - "LensCapabilityV2Counterpart", - v2, - "v2_counterpart", - "capability_register row", - )?; - Ok((lens_basename, structural_label, behavioral_label, v2_label)) -} - -fn v2_cementing_basenames_from_capability_rows( - dag: &Dag, - capability_rows: &[FieldValue], -) -> Result, String> { - let mut basenames = BTreeSet::new(); - for row in capability_rows { - let (lens_basename, _structural_label, behavioral_label, v2_label) = - parse_capability_register_row(dag, row)?; - let is_v2_complete = behavioral_label == "LensCapabilityBehavioralComplete" - && v2_label == "LensCapabilityV2RealV2"; - if is_v2_complete { - basenames.insert(lens_basename); - } - } - Ok(basenames) -} - -/// Band-C dispatch projection: `LensCapabilityBehavioralComplete` plus either -/// `LensCapabilityV2RealV2` (v2-oracle cementing) or `LensCapabilityV2NoneV3Native` -/// (v3-native gate-#87 `.dag` harness receipts). -/// -/// **P2 invariant:** every `LensRegistryEntry` whose `lens_file` basename lands in this -/// set must have a matching `(registry_name, module_stem, kind)` expansion in -/// `expected_cementing_receipt_triples` and rows in `cementing_dispatch.dag` — including -/// *all* behaviorally complete v3-native lenses in `regen.dag` (not only a PREFIX subset). -fn band_c_cementing_basenames_from_capability_rows( - dag: &Dag, - capability_rows: &[FieldValue], -) -> Result, String> { - let mut basenames = BTreeSet::new(); - for row in capability_rows { - let (lens_basename, _structural_label, behavioral_label, v2_label) = - parse_capability_register_row(dag, row)?; - let band_c_complete = behavioral_label == "LensCapabilityBehavioralComplete" - && (v2_label == "LensCapabilityV2RealV2" || v2_label == "LensCapabilityV2NoneV3Native"); - if band_c_complete { - basenames.insert(lens_basename); - } - } - Ok(basenames) -} - -/// `lens_basename` → `LensCapabilityBehavioralStatus` variant label for every row in -/// `std.verification` `lens_capability_register_rows`. -/// -/// Used by gate #83 supporting CI to fail-closed on `LensCapabilityBehavioralStub` for the -/// T-Lens-Behavioral-Parity quartet on the **`behavioral` field** of `lens_capability_register_rows` -/// (narrow slice alongside Gap 4 in `docs/r3-actual-close-plan.md`). -pub fn lens_capability_register_behavioral_label_by_basename( - dag: &Dag, -) -> Result, String> { - let reg_decl = dag - .declaration_by_name("lens_capability_register_rows") - .ok_or_else(|| { - "bootstrap must declare `lens_capability_register_rows` (std.verification)".to_string() - })?; - let capability_rows = - list_items_of_declaration(dag, reg_decl.id, "lens_capability_register_rows")?; - let mut out = BTreeMap::new(); - for row in &capability_rows { - let (lens_basename, _structural_label, behavioral_label, _v2_label) = - parse_capability_register_row(dag, row)?; - if out - .insert(lens_basename.clone(), behavioral_label.clone()) - .is_some() - { - return Err(format!( - "duplicate `lens_basename` `{lens_basename}` in `lens_capability_register_rows`" - )); - } - } - Ok(out) -} - -/// Lens basenames in the **markdown v2-oracle slice** ratchet: `LensCapabilityBehavioralComplete` -/// plus `LensCapabilityV2RealV2` only (excludes v3-native Band-C harness rows). -/// -/// `CementingDispatchMatchesProjection` uses the broader Band-C basename filter -/// (behaviorally complete with `LensCapabilityV2RealV2` **or** `LensCapabilityV2NoneV3Native`) -/// before intersecting `regen.dag`. -/// -/// Exposed for integration tests that mechanically ratchet the markdown capability table against -/// this structural authority (`lens_register_correspondence_test`). -pub fn lens_capability_register_v2_cementing_basenames( - dag: &Dag, -) -> Result, String> { - let reg_decl = dag - .declaration_by_name("lens_capability_register_rows") - .ok_or_else(|| { - "bootstrap must declare `lens_capability_register_rows` (std.verification)".to_string() - })?; - let capability_rows = - list_items_of_declaration(dag, reg_decl.id, "lens_capability_register_rows")?; - v2_cementing_basenames_from_capability_rows(dag, &capability_rows) -} - -fn cementing_dispatch_two_refs( - payload: &[FieldValue], -) -> Result<(&FieldValue, &FieldValue), String> { - match payload { - [a, b] => Ok((a, b)), - [FieldValue::Record(fields)] => { - let a = record_field(fields, "capability_register").ok_or_else(|| { - "CementingDispatchMatchesProjection record missing `capability_register`" - .to_string() - })?; - let b = record_field(fields, "cementing_receipts").ok_or_else(|| { - "CementingDispatchMatchesProjection record missing `cementing_receipts`".to_string() - })?; - Ok((a, b)) - } - _ => Err(format!( - "CementingDispatchMatchesProjection payload should be two DeclarationRef edges \ - or a record {{ capability_register, cementing_receipts }}; got {} slot(s)", - payload.len() - )), - } -} - -/// Evaluate `CementingDispatchMatchesProjection` for a claim declared in `declaration_file`. -/// -/// Returns `Ok(())` on pass; `Err(reason)` maps to [`crate::test_runner::ClaimResult::Fail`]. -pub(crate) fn evaluate_cementing_dispatch_projection( - dag: &Dag, - declaration_file: &str, - payload: &[FieldValue], -) -> Result<(), String> { - const CEMENTING_DISPATCH_DECL_PATH: &str = "cementing_dispatch.dag"; - if !declaration_file.ends_with(CEMENTING_DISPATCH_DECL_PATH) { - return Err(format!( - "CementingDispatchMatchesProjection is only accepted for claims declared in `**/{CEMENTING_DISPATCH_DECL_PATH}`; got `{declaration_file}`" - )); - } - - let (reg_ref, recv_ref) = cementing_dispatch_two_refs(payload)?; - let reg_id = resolve_declaration_ref_id(reg_ref, "capability_register")?; - let recv_id = resolve_declaration_ref_id(recv_ref, "cementing_receipts")?; - - let capability_rows = list_items_of_declaration(dag, reg_id, "capability_register")?; - let receipt_rows = list_items_of_declaration(dag, recv_id, "cementing_receipts")?; - - let basenames = band_c_cementing_basenames_from_capability_rows(dag, &capability_rows)?; - - let registry_pairs = read_lens_registry_name_lens_file_pairs(dag)?; - - let mut matched_basenames = BTreeSet::new(); - for (name, lens_file) in ®istry_pairs { - let Some(basename) = FsPath::new(lens_file).file_name().and_then(|s| s.to_str()) else { - return Err(format!( - "registry entry `{name}` has lens_file without basename: {lens_file}" - )); - }; - if basenames.contains(basename) { - matched_basenames.insert(basename.to_string()); - } - } - - let missing: Vec<_> = basenames.difference(&matched_basenames).cloned().collect(); - if !missing.is_empty() { - return Err(format!( - "`lens_capability_register` escalates v2 cementing for lens basenames {missing:?}, \ - but no `LensRegistryEntry` in bootstrap names those files — fix the register data or add registry entries." - )); - } - - let mut receipt_triples = BTreeSet::new(); - - for row in &receipt_rows { - let Some(fields) = record_fields(row) else { - return Err(format!( - "cementing_receipts list: expected record row, got {row:?}" - )); - }; - let registry_name = string_field(fields, "registry_name")?; - let module_stem = string_field(fields, "module_stem")?; - let kind_field = record_field(fields, "kind").ok_or_else(|| { - "cementing receipt row: missing `kind` field (expected `CementingBandCReceiptKind` \ - variant)" - .to_string() - })?; - let kind_str = decode_cementing_band_c_receipt_kind(dag, kind_field, "kind")?; - let triple = ( - registry_name.clone(), - module_stem.clone(), - kind_str.to_string(), - ); - if !receipt_triples.insert(triple.clone()) { - return Err(format!( - "cementing_receipts contains duplicate receipt identity {triple:?}; each \ - `(registry_name, module_stem, kind)` must be unique." - )); - } - } - - let expected_triples = expected_cementing_receipt_triples(®istry_pairs, &basenames)?; - if receipt_triples != expected_triples { - return Err(format!( - "cementing_receipts `(registry_name, module_stem, kind)` triples must exactly match \ - the Band-C expansion of the register ∩ regen projection — expected {expected_triples:?}, \ - got {receipt_triples:?}" - )); - } - - let manifest_dir = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")); - let pb_b1_gate87_dag_stems = r3_gate_87_cementing_regen_pb_b1_dag_module_stems(); - let integration_rs = match std::fs::read_to_string(manifest_dir.join("tests/integration.rs")) { - Ok(text) => text, - Err(err) => { - return Err(format!( - "read tests/integration.rs for cementing wiring ratchet: {err}" - )); - } - }; - - for row in &receipt_rows { - let Some(fields) = record_fields(row) else { - return Err(format!( - "cementing_receipts list: expected record row, got {row:?}" - )); - }; - let registry_name = string_field(fields, "registry_name")?; - let module_stem = string_field(fields, "module_stem")?; - let kind_field = record_field(fields, "kind").ok_or_else(|| { - "cementing receipt row: missing `kind` field (expected `CementingBandCReceiptKind` \ - variant)" - .to_string() - })?; - let kind_str = decode_cementing_band_c_receipt_kind(dag, kind_field, "kind")?; - match kind_str { - "dag" => { - if !pb_b1_gate87_dag_stems.contains(&module_stem) { - return Err(format!( - "registry lens `{registry_name}` lists v2-complete cementing receipt `{module_stem}` \ - as a `.dag` harness, but that stem is not wired in \ - `r3_gate_87_cementing_regen_runner_suites::R3_GATE_87_CEMENTING_REGEN_SUITES` \ - (T-PB-B-1 runner) — extend the shared table or fix the receipt list." - )); - } - let path = manifest_dir - .join("tests") - .join("dag") - .join(format!("{module_stem}.dag")); - if !path.is_file() { - return Err(format!( - "registry lens `{registry_name}` lists v2-complete cementing receipt `{module_stem}` \ - as a `.dag` harness; expected file {}", - path.display() - )); - } - } - "temporary-rust" => { - let path = manifest_dir - .join("tests") - .join("integration") - .join("cementing") - .join(format!("{module_stem}.rs")); - if !path.is_file() { - return Err(format!( - "registry lens `{registry_name}` lists temporary Rust cementing receipt `{module_stem}`; \ - expected file {}", - path.display() - )); - } - if !integration_rs_cementing_path_attr_binds_mod_stem( - &integration_rs, - &module_stem, - )? { - let expected = format!(r#"#[path = "integration/cementing/{module_stem}.rs"]"#); - return Err(format!( - "registry lens `{registry_name}` lists temporary Rust cementing stem `{module_stem}` but \ - tests/integration.rs does not bind `{expected}` to `mod {module_stem};` in the same item \ - (Band-C dispatch)." - )); - } - } - _ => { - return Err( - "cementing receipt `kind`: internal error — wire tag not `dag` or `temporary-rust`" - .to_string(), - ); - } - } - } - - Ok(()) -} diff --git a/src/v3/compiler/src/complexity_lattice.rs b/src/v3/compiler/src/complexity_lattice.rs deleted file mode 100644 index 090827fd13c..00000000000 --- a/src/v3/compiler/src/complexity_lattice.rs +++ /dev/null @@ -1,109 +0,0 @@ -//! **`complexity_enforcement_budget_dominates`** — executable **T-LAS enforcement** -//! ordering on `AsymptoticClass` for `complexity_enforcement_violates` / -//! `EnforcedApplication` (gate #92). It matches `v3.std.algebra::asymptotic_dominates` -//! on every arm including `ClassPolynomial×ClassPolynomial` (Peano `degree` compare). -//! -//! **`asymptotic_dominates`** is a backward-compatible alias for tests and older -//! call sites; new enforcement code should call [`complexity_enforcement_budget_dominates`]. -//! -//! Stay aligned with `complexity.dag` + `complexity_enforcement_violates` comments. - -use crate::dag::{positive_descent_count, AsymptoticClass}; - -pub fn complexity_enforcement_budget_dominates(a: &AsymptoticClass, b: &AsymptoticClass) -> bool { - use AsymptoticClass::*; - match a { - ClassUnknown => true, - ClassExponential => match b { - ClassUnknown => false, - ClassExponential - | ClassPolynomial { .. } // Any `ClassPolynomial` tier is below exponential. - | ClassQuadratic - | ClassLinearithmic - | ClassLinear - | ClassLog - | ClassConstant => true, - }, - ClassPolynomial { degree: da } => match b { - ClassUnknown | ClassExponential => false, - ClassPolynomial { degree: db } => { - positive_descent_count(da) >= positive_descent_count(db) - } - ClassQuadratic | ClassLinearithmic | ClassLinear | ClassLog | ClassConstant => true, - }, - ClassQuadratic => match b { - ClassConstant | ClassLog | ClassLinear | ClassLinearithmic | ClassQuadratic => true, - ClassPolynomial { .. } | ClassExponential | ClassUnknown => false, - }, - ClassLinearithmic => match b { - ClassConstant | ClassLog | ClassLinear | ClassLinearithmic => true, - ClassQuadratic | ClassPolynomial { .. } | ClassExponential | ClassUnknown => false, - }, - ClassLinear => match b { - ClassConstant | ClassLog | ClassLinear => true, - ClassLinearithmic - | ClassQuadratic - | ClassPolynomial { .. } - | ClassExponential - | ClassUnknown => false, - }, - ClassLog => match b { - ClassConstant | ClassLog => true, - ClassLinear - | ClassLinearithmic - | ClassQuadratic - | ClassPolynomial { .. } - | ClassExponential - | ClassUnknown => false, - }, - ClassConstant => match b { - ClassConstant => true, - ClassLog - | ClassLinear - | ClassLinearithmic - | ClassQuadratic - | ClassPolynomial { .. } - | ClassExponential - | ClassUnknown => false, - }, - } -} - -/// Alias of [`complexity_enforcement_budget_dominates`]. Prefer the named helper for -/// new call sites so enforcement-grade poly refinement is not confused with substrate -/// `algebra.dag::asymptotic_dominates` at the documentation layer. -#[inline] -pub fn asymptotic_dominates(a: &AsymptoticClass, b: &AsymptoticClass) -> bool { - complexity_enforcement_budget_dominates(a, b) -} - -#[cfg(test)] -mod asymptotic_dominates_tests { - use super::{asymptotic_dominates, complexity_enforcement_budget_dominates}; - use crate::dag::{positive_amount_from_i64, AsymptoticClass}; - - fn poly(k: i64) -> AsymptoticClass { - AsymptoticClass::ClassPolynomial { - degree: positive_amount_from_i64(k).expect("test degree in range"), - } - } - - #[test] - fn polynomial_degree_orders_within_class_polynomial() { - let p5 = poly(5); - let p3 = poly(3); - assert!(complexity_enforcement_budget_dominates(&p5, &p3)); - assert!(!complexity_enforcement_budget_dominates(&p3, &p5)); - assert!(complexity_enforcement_budget_dominates(&p3, &p3)); - } - - #[test] - fn alias_matches_budget_dominates() { - let p3 = poly(3); - let p5 = poly(5); - assert_eq!( - asymptotic_dominates(&p5, &p3), - complexity_enforcement_budget_dominates(&p5, &p3) - ); - } -} diff --git a/src/v3/compiler/src/complexity_lens_generated.rs b/src/v3/compiler/src/complexity_lens_generated.rs deleted file mode 100644 index ca53bff48ed..00000000000 --- a/src/v3/compiler/src/complexity_lens_generated.rs +++ /dev/null @@ -1,658 +0,0 @@ -// AUTO-GENERATED from `src/v3/lenses/complexity.dag` via -// `emit_rust_module`. Regenerate instead of hand-editing. - -#[derive(Clone, Debug)] -pub enum Certainty { - Proven, - Conservative, -} -#[derive(Clone, Debug)] -pub struct ComplexitySummary { - pub work: SymbolicCost, - pub span: SymbolicCost, - pub asymptotic_class: AsymptoticClass, - pub work_certainty: Certainty, - pub span_certainty: Certainty, -} -#[derive(Clone, Debug)] -pub struct ComplexityEntry { - pub port: PortId, - pub summary: Lookup, -} -#[derive(Clone, Debug)] -pub enum DominanceOutcome { - BothSurvive, - OuterDominates, - BodyDominates, -} -pub fn miss_complexity_summary_lookup() -> Lookup { - Lookup::Miss -} -pub fn hit_complexity_summary_lookup(p0: ComplexitySummary) -> Lookup { - Lookup::Hit(p0).clone() -} -pub fn complexity_of(p0: &Dag, p1: &PortId) -> Lookup { - lookup_summary(&(compute_summaries(p0)), p1) -} -pub fn compute_summaries(p0: &Dag) -> Vec { - ((p0).nodes()) - .iter() - .fold(seed_bind_params((p0).nodes()), |__fold_acc, __fold_item| { - let mut __list = (__fold_acc).clone(); - __list.insert(0, entry_for(p0, &__fold_acc, __fold_item)); - __list - }) -} -pub fn seed_bind_params(p0: &[Behavior]) -> Vec { - (p0).iter().fold(Vec::new(), |__fold_acc, __fold_item| { - let mut __left = params_of(__fold_item); - __left.extend((__fold_acc).clone()); - __left - }) -} -pub fn params_of(p0: &Behavior) -> Vec { - match p0 { - Behavior::Value(_) => Vec::new(), - Behavior::Transform(_) => Vec::new(), - Behavior::Branch(_) => Vec::new(), - Behavior::Loop(_) => Vec::new(), - Behavior::Bind(bind) => param_entries(&((bind).params)), - } -} -pub fn param_entries(p0: &[PortId]) -> Vec { - match p0 { - [] => Vec::new(), - [__list_head, __list_tail @ ..] => { - let mut __list = param_entries(__list_tail); - __list.insert( - 0, - ComplexityEntry { - port: (*(__list_head)), - summary: hit_complexity_summary_lookup(zero_summary()), - }, - ); - __list - } - } -} -pub fn zero_summary() -> ComplexitySummary { - summary_from_costs( - SymbolicCost::ConstantCost { _0: 0 }, - SymbolicCost::ConstantCost { _0: 0 }, - Certainty::Proven, - Certainty::Proven, - ) -} -pub fn unit_summary() -> ComplexitySummary { - summary_from_costs( - SymbolicCost::ConstantCost { _0: 1 }, - SymbolicCost::ConstantCost { _0: 1 }, - Certainty::Proven, - Certainty::Proven, - ) -} -pub fn conservative_unknown_summary(p0: String) -> ComplexitySummary { - summary_from_costs( - SymbolicCost::UnknownCost { _0: (p0).clone() }, - SymbolicCost::UnknownCost { _0: (p0).clone() }, - Certainty::Conservative, - Certainty::Conservative, - ) -} -pub fn summary_from_costs( - p0: SymbolicCost, - p1: SymbolicCost, - p2: Certainty, - p3: Certainty, -) -> ComplexitySummary { - ComplexitySummary { - work: (p0).clone(), - span: (p1).clone(), - asymptotic_class: classify_symbolic_cost(&p0), - work_certainty: (p2).clone(), - span_certainty: (p3).clone(), - } -} -pub fn entry_for(p0: &Dag, p1: &[ComplexityEntry], p2: &Behavior) -> ComplexityEntry { - match p2 { - Behavior::Value(v) => ComplexityEntry { - port: (v).result_port(), - summary: hit_complexity_summary_lookup(zero_summary()), - }, - Behavior::Transform(t) => ComplexityEntry { - port: (t).result_port(), - summary: transform_summary(p0, p1, &((t).id), &((t).inputs)), - }, - Behavior::Branch(b) => ComplexityEntry { - port: (b).result_port(), - summary: branch_summary(p1, &((b).input), &((b).paths)), - }, - Behavior::Loop(l) => ComplexityEntry { - port: (l).result_port(), - summary: loop_summary(p0, p1, l), - }, - Behavior::Bind(bind) => ComplexityEntry { - port: (bind).result_port(), - summary: lookup_summary(p1, &((bind).result_port())), - }, - } -} -pub fn transform_summary( - p0: &Dag, - p1: &[ComplexityEntry], - p2: &NodeId, - p3: &[PortId], -) -> Lookup { - match &(per_call_pattern_at(p0, *p2)) { - None => compose_many_inputs(p1, p3), - Some(pattern) => match &(per_call_descent_operand_port(p0, *p2)) { - None => complexity_when_descent_unknown(pattern), - Some(descent_port) => recursive_transform_summary(p1, pattern, descent_port, p3), - }, - } -} -pub fn complexity_when_descent_unknown(p0: &CallPattern) -> Lookup { - match p0 { - CallPattern::SameArgumentCall => miss_complexity_summary_lookup(), - CallPattern::ArithmeticSubtractCall { - steps: _, - ring_param: _, - } => miss_complexity_summary_lookup(), - CallPattern::ArithmeticDivideCall { - divisor: _, - ring_param: _, - } => miss_complexity_summary_lookup(), - CallPattern::ChildAccessorCall { accessor: _ } => miss_complexity_summary_lookup(), - CallPattern::CollectionShrinkCall { - amount: _, - collection: _, - } => miss_complexity_summary_lookup(), - CallPattern::FoldBodyCall { - outer_collection: _, - } => miss_complexity_summary_lookup(), - CallPattern::ParserAdvanceCall { witness: _ } => miss_complexity_summary_lookup(), - CallPattern::WorklistDrainCall { element: _ } => miss_complexity_summary_lookup(), - } -} -pub fn compose_many_inputs(p0: &[ComplexityEntry], p1: &[PortId]) -> Lookup { - (p1).iter().fold( - hit_complexity_summary_lookup(unit_summary()), - |__fold_acc, __fold_item| { - combine_sequential(&__fold_acc, &(lookup_summary(p0, __fold_item))) - }, - ) -} -pub fn compose_many_inputs_excluding_descent_operand( - p0: &[ComplexityEntry], - p1: &[PortId], - p2: &PortId, -) -> Lookup { - (p1).iter().fold( - hit_complexity_summary_lookup(unit_summary()), - |__fold_acc, __fold_item| { - if ((*(__fold_item)) == (*(p2))) { - __fold_acc - } else { - combine_sequential(&__fold_acc, &(lookup_summary(p0, __fold_item))) - } - }, - ) -} -pub fn recursive_transform_summary( - p0: &[ComplexityEntry], - p1: &CallPattern, - p2: &PortId, - p3: &[PortId], -) -> Lookup { - match p3 { - [] => miss_complexity_summary_lookup(), - [__list_head, __list_tail @ ..] => combine_iterate( - &(summary_from_iter_bound(&(pattern_to_iter_bound(p1, p2)))), - &(combine_sequential( - &(lookup_summary(p0, p2)), - &(compose_many_inputs_excluding_descent_operand(p0, p3, p2)), - )), - ), - } -} -pub fn pattern_to_iter_bound(p0: &CallPattern, p1: &PortId) -> Lookup { - match p0 { - CallPattern::ArithmeticSubtractCall { - steps: _, - ring_param: _, - } => Lookup::Hit(SymbolicCost::LinearCost { - _0: SizeVariable { - source_port: *p1, - display_name: None, - }, - }), - CallPattern::ArithmeticDivideCall { - divisor: _, - ring_param: _, - } => Lookup::Hit(SymbolicCost::LogCost { - _0: SizeVariable { - source_port: *p1, - display_name: None, - }, - }), - CallPattern::ChildAccessorCall { accessor: _ } => Lookup::Hit(SymbolicCost::LinearCost { - _0: SizeVariable { - source_port: *p1, - display_name: None, - }, - }), - CallPattern::CollectionShrinkCall { - amount: _, - collection: _, - } => Lookup::Hit(SymbolicCost::LinearCost { - _0: SizeVariable { - source_port: *p1, - display_name: None, - }, - }), - CallPattern::FoldBodyCall { - outer_collection: _, - } => Lookup::Hit(SymbolicCost::LinearCost { - _0: SizeVariable { - source_port: *p1, - display_name: None, - }, - }), - CallPattern::ParserAdvanceCall { witness: _ } => Lookup::Hit(SymbolicCost::LinearCost { - _0: SizeVariable { - source_port: *p1, - display_name: None, - }, - }), - CallPattern::WorklistDrainCall { element: _ } => Lookup::Hit(SymbolicCost::LinearCost { - _0: SizeVariable { - source_port: *p1, - display_name: None, - }, - }), - CallPattern::SameArgumentCall => Lookup::Miss, - } -} -pub fn summary_from_iter_bound(p0: &Lookup) -> Lookup { - match p0 { - Lookup::Miss => miss_complexity_summary_lookup(), - Lookup::Hit(cost) => match cost { - SymbolicCost::UnknownCost { _0: reason } => { - hit_complexity_summary_lookup(conservative_unknown_summary((reason).clone())) - } - SymbolicCost::ConstantCost { _0: _ } => { - hit_complexity_summary_lookup(summary_from_costs( - (cost).clone(), - (cost).clone(), - Certainty::Proven, - Certainty::Proven, - )) - } - SymbolicCost::LinearCost { _0: _ } => { - hit_complexity_summary_lookup(summary_from_costs( - (cost).clone(), - (cost).clone(), - Certainty::Proven, - Certainty::Proven, - )) - } - SymbolicCost::PolynomialCost { var: _, degree: _ } => { - hit_complexity_summary_lookup(summary_from_costs( - (cost).clone(), - (cost).clone(), - Certainty::Proven, - Certainty::Proven, - )) - } - SymbolicCost::ProductCost { _0: _ } => { - hit_complexity_summary_lookup(summary_from_costs( - (cost).clone(), - (cost).clone(), - Certainty::Proven, - Certainty::Proven, - )) - } - SymbolicCost::SumCost { _0: _ } => hit_complexity_summary_lookup(summary_from_costs( - (cost).clone(), - (cost).clone(), - Certainty::Proven, - Certainty::Proven, - )), - SymbolicCost::LogCost { _0: _ } => hit_complexity_summary_lookup(summary_from_costs( - (cost).clone(), - (cost).clone(), - Certainty::Proven, - Certainty::Proven, - )), - }, - } -} -pub fn loop_summary(p0: &Dag, p1: &[ComplexityEntry], p2: &LoopNode) -> Lookup { - combine_sequential( - &(combine_sequential( - &(lookup_summary(p1, &((p2).source))), - &(lookup_summary(p1, &((p2).init))), - )), - &(combine_iterate( - &(hit_complexity_summary_lookup(summary_from_costs( - SymbolicCost::LinearCost { - _0: SizeVariable { - source_port: ((p2).source), - display_name: None, - }, - }, - SymbolicCost::LinearCost { - _0: SizeVariable { - source_port: ((p2).source), - display_name: None, - }, - }, - Certainty::Proven, - Certainty::Proven, - ))), - &(body_summary(p0, p1, &((p2).body))), - )), - ) -} -pub fn body_summary(p0: &Dag, p1: &[ComplexityEntry], p2: &NodeId) -> Lookup { - match &((p0).node_opt(p2).cloned()) { - None => miss_complexity_summary_lookup(), - Some(body_behavior) => lookup_summary(p1, &(behavior_result_port(body_behavior))), - } -} -pub fn behavior_result_port(p0: &Behavior) -> PortId { - match p0 { - Behavior::Value(v) => (v).result_port(), - Behavior::Transform(t) => (t).result_port(), - Behavior::Branch(br) => (br).result_port(), - Behavior::Loop(lp) => (lp).result_port(), - Behavior::Bind(bind) => (bind).result_port(), - } -} -pub fn branch_summary( - p0: &[ComplexityEntry], - p1: &PortId, - p2: &[Path], -) -> Lookup { - combine_sequential(&(lookup_summary(p0, p1)), &(max_path_summaries(p0, p2))) -} -pub fn max_path_summaries(p0: &[ComplexityEntry], p1: &[Path]) -> Lookup { - (p1).iter().fold( - hit_complexity_summary_lookup(zero_summary()), - |__fold_acc, __fold_item| { - combine_branch( - &__fold_acc, - &(lookup_summary(p0, &((__fold_item).result_port()))), - ) - }, - ) -} -pub fn lookup_summary(p0: &[ComplexityEntry], p1: &PortId) -> Lookup { - (p0).iter().fold( - miss_complexity_summary_lookup(), - |__fold_acc, __fold_item| match &__fold_acc { - Lookup::Hit(_) => __fold_acc, - Lookup::Miss => { - if ((__fold_item).port == (*(p1))) { - ((__fold_item).summary).clone() - } else { - miss_complexity_summary_lookup() - } - } - }, - ) -} -pub fn combine_sequential( - p0: &Lookup, - p1: &Lookup, -) -> Lookup { - match p0 { - Lookup::Miss => miss_complexity_summary_lookup(), - Lookup::Hit(ax) => match p1 { - Lookup::Miss => miss_complexity_summary_lookup(), - Lookup::Hit(bx) => hit_complexity_summary_lookup(compose_summary_sequential(ax, bx)), - }, - } -} -pub fn combine_iterate( - p0: &Lookup, - p1: &Lookup, -) -> Lookup { - match p0 { - Lookup::Miss => miss_complexity_summary_lookup(), - Lookup::Hit(outer_summary) => match p1 { - Lookup::Miss => miss_complexity_summary_lookup(), - Lookup::Hit(body_summary_value) => hit_complexity_summary_lookup( - compose_summary_iterate(outer_summary, body_summary_value), - ), - }, - } -} -pub fn combine_branch( - p0: &Lookup, - p1: &Lookup, -) -> Lookup { - match p0 { - Lookup::Miss => miss_complexity_summary_lookup(), - Lookup::Hit(ax) => match p1 { - Lookup::Miss => miss_complexity_summary_lookup(), - Lookup::Hit(bx) => hit_complexity_summary_lookup(compose_summary_branch_pair(ax, bx)), - }, - } -} -pub fn compose_summary_sequential( - p0: &ComplexitySummary, - p1: &ComplexitySummary, -) -> ComplexitySummary { - summary_from_costs( - sequential(((p0).work).clone(), ((p1).work).clone()), - sequential(((p0).span).clone(), ((p1).span).clone()), - certainty_of_surviving_per_dim( - ((p0).work).clone(), - ((p1).work).clone(), - ((p0).work_certainty).clone(), - ((p1).work_certainty).clone(), - ), - certainty_of_surviving_per_dim( - ((p0).span).clone(), - ((p1).span).clone(), - ((p0).span_certainty).clone(), - ((p1).span_certainty).clone(), - ), - ) -} -pub fn compose_summary_iterate( - p0: &ComplexitySummary, - p1: &ComplexitySummary, -) -> ComplexitySummary { - summary_from_costs( - iterate(((p0).work).clone(), ((p1).work).clone()), - iterate(((p0).work).clone(), ((p1).span).clone()), - certainty_of_surviving_per_dim( - ((p0).work).clone(), - ((p1).work).clone(), - ((p0).work_certainty).clone(), - ((p1).work_certainty).clone(), - ), - certainty_of_surviving_per_dim( - ((p0).work).clone(), - ((p1).span).clone(), - ((p0).work_certainty).clone(), - ((p1).span_certainty).clone(), - ), - ) -} -pub fn compose_summary_branch_pair( - p0: &ComplexitySummary, - p1: &ComplexitySummary, -) -> ComplexitySummary { - summary_from_costs( - max_path( - &({ - let mut __list = { - let mut __list = Vec::new(); - __list.insert(0, ((p1).work).clone()); - __list - }; - __list.insert(0, ((p0).work).clone()); - __list - }), - ), - max_path( - &({ - let mut __list = { - let mut __list = Vec::new(); - __list.insert(0, ((p1).span).clone()); - __list - }; - __list.insert(0, ((p0).span).clone()); - __list - }), - ), - certainty_of_surviving_per_dim( - ((p0).work).clone(), - ((p1).work).clone(), - ((p0).work_certainty).clone(), - ((p1).work_certainty).clone(), - ), - certainty_of_surviving_per_dim( - ((p0).span).clone(), - ((p1).span).clone(), - ((p0).span_certainty).clone(), - ((p1).span_certainty).clone(), - ), - ) -} -pub fn certainty_of_surviving_per_dim( - p0: SymbolicCost, - p1: SymbolicCost, - p2: Certainty, - p3: Certainty, -) -> Certainty { - match &(dominance_outcome((p0).clone(), (p1).clone())) { - DominanceOutcome::BothSurvive => meet_pair(&p2, (p3).clone()), - DominanceOutcome::OuterDominates => p2, - DominanceOutcome::BodyDominates => p3, - } -} -pub fn dominance_outcome(p0: SymbolicCost, p1: SymbolicCost) -> DominanceOutcome { - if dominates(&p0, (p1).clone()) { - if dominates(&p1, (p0).clone()) { - DominanceOutcome::BothSurvive - } else { - DominanceOutcome::OuterDominates - } - } else { - if dominates(&p1, (p0).clone()) { - DominanceOutcome::BodyDominates - } else { - DominanceOutcome::BothSurvive - } - } -} -pub fn meet_pair(p0: &Certainty, p1: Certainty) -> Certainty { - match p0 { - Certainty::Proven => p1, - Certainty::Conservative => Certainty::Conservative, - } -} -pub fn complexity_enforcement_project(p0: &ComplexitySummary) -> AsymptoticClass { - ((p0).asymptotic_class).clone() -} -pub fn complexity_enforcement_violates(p0: &ComplexitySummary, p1: &AsymptoticClass) -> bool { - if asymptotic_dominates(&((p0).asymptotic_class), p1) { - if asymptotic_dominates(p1, &((p0).asymptotic_class)) { - (0 == 1) - } else { - (0 == 0) - } - } else { - (0 == 1) - } -} -pub fn witness_from_complexity_lookup( - p0: &Lookup, - p1: Behavior, -) -> Witness { - match p0 { - Lookup::Hit(summary) => Witness::Inhabits((summary).clone()), - Lookup::Miss => Witness::Violates { - reason: String::from( - "complexity_of: missing ComplexitySummary for behavior result port", - ), - subject: ViolatesSubject::AtBehavior((p1).clone()), - }, - } -} -pub fn complexity_lens_read(p0: &Dag, p1: Behavior) -> Witness { - witness_from_complexity_lookup( - &(complexity_of(p0, &(behavior_result_port(&p1)))), - (p1).clone(), - ) -} -pub fn complexity_lens_sequential_op( - p0: &ComplexitySummary, - p1: &ComplexitySummary, -) -> ComplexitySummary { - compose_summary_sequential(p0, p1) -} -pub fn complexity_lens_branch_op( - p0: &ComplexitySummary, - p1: &ComplexitySummary, -) -> ComplexitySummary { - compose_summary_branch_pair(p0, p1) -} -pub fn complexity_lens_iterate_op(p0: &ComplexitySummary, p1: &LoopBound) -> ComplexitySummary { - match p1 { - LoopBound::Cardinality { count: payload } => compose_summary_iterate( - &(summary_from_costs( - SymbolicCost::LinearCost { - _0: SizeVariable { - source_port: *payload, - display_name: None, - }, - }, - SymbolicCost::LinearCost { - _0: SizeVariable { - source_port: *payload, - display_name: None, - }, - }, - Certainty::Proven, - Certainty::Proven, - )), - p0, - ), - LoopBound::Descent { - cluster: __payload_cluster, - measure: __payload_measure, - } => compose_summary_iterate( - &(summary_from_costs( - SymbolicCost::LinearCost { - _0: SizeVariable { - source_port: *__payload_measure, - display_name: None, - }, - }, - SymbolicCost::LinearCost { - _0: SizeVariable { - source_port: *__payload_measure, - display_name: None, - }, - }, - Certainty::Proven, - Certainty::Proven, - )), - p0, - ), - } -} -pub fn complexity_summary_work_class_consistent(p0: &ComplexitySummary) -> bool { - asymptotic_dominates( - &((p0).asymptotic_class), - &(classify_symbolic_cost(&((p0).work))), - ) -} -pub fn complexity_lens_validate(p0: &Dag, p1: &ComplexitySummary) -> OptionalDiagnostic { - OptionalDiagnostic::NoDiagnostic -} diff --git a/src/v3/compiler/src/cost_basis_declaration.rs b/src/v3/compiler/src/cost_basis_declaration.rs deleted file mode 100644 index bf59e3a404b..00000000000 --- a/src/v3/compiler/src/cost_basis_declaration.rs +++ /dev/null @@ -1,165 +0,0 @@ -//! Materialize [`CostBasisDeclaration`](crate::lens_cost_symbolic::CostBasisDeclaration) from -//! lowered [`Dag`](crate::dag::Dag) facts — interim **consumer boundary** for gate **#93** -//! (`crdt_cost_basis_demonstrated`) **substrate / symbolic-cost slice**; folding authored basis -//! rows into [`compute_symbolic_costs`](crate::lens_cost_symbolic::compute_symbolic_costs) remains follow-on on the same gate. -//! -//! Persisted `.dag` `data` rows and folding declarations into [`compute_symbolic_costs`](crate::lens_cost_symbolic::compute_symbolic_costs) remain follow-on; embedders MUST NOT -//! hand-assemble `CostBasisDeclaration` beside this helper when deriving the same evidence -//! from a compiled DAG (INVARIANTS.md P2). - -use std::fmt; - -use crate::dag::{ - ArrowBody, BindNode, Dag, DeclarationId, Lookup, PortId, SectionRef, SizeVariable, - SymbolicCost, TypeConnective, -}; -use crate::lens_cost_symbolic::{compute_symbolic_costs, CostBasisDeclaration, CostBasisKind}; - -/// [`try_build_per_write_log_cost_basis_declaration`] stops on missing DAG facts instead of -/// panicking (fail-closed consumer boundary; codex gate on PR #2299). -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum CostBasisDeclarationBuildError { - DeclarationNotFound { - name: String, - }, - MergeStepMissingParams { - merge_step_declaration_name: String, - }, - /// Declaration must be a function (`TypeConnective::Arrow`) so the body bind is - /// reachable via [`ArrowBody::UserDefined`] (single authority per P2). - WorkflowDeclarationNotArrow { - name: String, - }, - /// Arrow declaration body is not yet lowered to `UserDefined(BindNodeId)` — cannot read - /// the authoritative body [`BindNode`] for parameters / span / structural parity. - WorkflowBodyNotUserDefinedBind { - name: String, - }, - /// `compute_symbolic_costs` has no `Hit(LogCost)` row keyed to the merge step’s first - /// parameter port — cannot fabricate a per-write log basis without lens evidence of a - /// divide on that port (P2 / fail-closed). - MergeStepLacksLogCostWitness { - merge_step_declaration_name: String, - }, -} - -impl fmt::Display for CostBasisDeclarationBuildError { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - match self { - CostBasisDeclarationBuildError::DeclarationNotFound { name } => { - write!(f, "declaration `{name}` not found") - } - CostBasisDeclarationBuildError::MergeStepMissingParams { - merge_step_declaration_name, - } => write!( - f, - "declaration `{merge_step_declaration_name}` should declare at least one parameter on its body bind" - ), - CostBasisDeclarationBuildError::WorkflowDeclarationNotArrow { name } => write!( - f, - "declaration `{name}` must have Arrow connective (callable)" - ), - CostBasisDeclarationBuildError::WorkflowBodyNotUserDefinedBind { name } => write!( - f, - "declaration `{name}` body is not ArrowBody::UserDefined(BindNodeId); cannot resolve authoritative bind node" - ), - CostBasisDeclarationBuildError::MergeStepLacksLogCostWitness { - merge_step_declaration_name, - } => write!( - f, - "declaration `{merge_step_declaration_name}` first param port has no LogCost witness in `compute_symbolic_costs` (expected divide-on-dividend lowering)" - ), - } - } -} - -impl std::error::Error for CostBasisDeclarationBuildError {} - -fn user_defined_arrow_body_bind<'a>( - dag: &'a Dag, - declaration_name: &str, -) -> Result<(&'a BindNode, DeclarationId), CostBasisDeclarationBuildError> { - let decl = dag.declaration_by_name(declaration_name).ok_or_else(|| { - CostBasisDeclarationBuildError::DeclarationNotFound { - name: declaration_name.to_string(), - } - })?; - let subject = decl.id; - let bind = match &decl.connective { - TypeConnective::Arrow { body, .. } => match body { - ArrowBody::UserDefined(bind_id) => bind_id.bind_opt(dag).ok_or_else(|| { - CostBasisDeclarationBuildError::WorkflowBodyNotUserDefinedBind { - name: declaration_name.to_string(), - } - })?, - _ => { - return Err( - CostBasisDeclarationBuildError::WorkflowBodyNotUserDefinedBind { - name: declaration_name.to_string(), - }, - ); - } - }, - _ => { - return Err( - CostBasisDeclarationBuildError::WorkflowDeclarationNotArrow { - name: declaration_name.to_string(), - }, - ); - } - }; - Ok((bind, subject)) -} - -fn symbolic_table_includes_log_on_port(dag: &Dag, port: PortId) -> bool { - compute_symbolic_costs(dag).iter().any(|e| { - matches!( - &e.cost, - Lookup::Hit(SymbolicCost::LogCost { _0: sv }) if sv.source_port == port - ) - }) -} - -/// **`LogCost` witness:** returns [`MergeStepLacksLogCostWitness`] unless -/// [`compute_symbolic_costs`] already **`Hit`s `LogCost(merge_param_port)`** (divide-on-dividend -/// lowering); does not fabricate basis without lens table evidence. -/// **Subject** is `SectionRef::DeclarationScope { declaration: … }` wrapping the workflow -/// [`DeclarationId`] (T-LAS / audit structural authority — expression-scoped bases use -/// `NodeScope` when authors need it). -/// `merge_step_declaration_name` is the **`fn` declaration id** (same string the author uses for -/// the merge helper, e.g. `crdt_merge_step`); its body [`BindNode`] is read only via -/// [`TypeConnective::Arrow`] → [`ArrowBody::UserDefined`] like the workflow (P2 single authority -/// for both callables). -pub fn try_build_per_write_log_cost_basis_declaration( - dag: &Dag, - workflow_declaration_name: &str, - merge_step_declaration_name: &str, -) -> Result { - let (workflow_bind, subject) = user_defined_arrow_body_bind(dag, workflow_declaration_name)?; - let (merge_bind, _) = user_defined_arrow_body_bind(dag, merge_step_declaration_name)?; - let merge_replicas_port = *merge_bind.params.first().ok_or_else(|| { - CostBasisDeclarationBuildError::MergeStepMissingParams { - merge_step_declaration_name: merge_step_declaration_name.to_string(), - } - })?; - if !symbolic_table_includes_log_on_port(dag, merge_replicas_port) { - return Err( - CostBasisDeclarationBuildError::MergeStepLacksLogCostWitness { - merge_step_declaration_name: merge_step_declaration_name.to_string(), - }, - ); - } - Ok(CostBasisDeclaration { - subject: SectionRef::DeclarationScope { - declaration: subject, - }, - kind: CostBasisKind::PerWrite, - cost: SymbolicCost::LogCost { - _0: SizeVariable { - source_port: merge_replicas_port, - display_name: None, - }, - }, - span: workflow_bind.span.clone(), - }) -} diff --git a/src/v3/compiler/src/cost_symbolic_lens_generated.rs b/src/v3/compiler/src/cost_symbolic_lens_generated.rs deleted file mode 100644 index ecf3cb1747c..00000000000 --- a/src/v3/compiler/src/cost_symbolic_lens_generated.rs +++ /dev/null @@ -1,420 +0,0 @@ -// AUTO-GENERATED from `src/v3/lenses/cost.dag` via -// `emit_rust_module`. Regenerate instead of hand-editing. - -#[derive(Clone, Debug)] -pub enum CostBasisKind { - PerWrite, - PerCall, - PeakMemory, -} -#[derive(Clone, Debug)] -pub struct CostBasisDeclaration { - pub subject: SectionRef, - pub kind: CostBasisKind, - pub cost: SymbolicCost, - pub span: SourceSpan, -} -#[derive(Clone, Debug)] -pub struct SymbolicCostEntry { - pub port: PortId, - pub cost: Lookup, -} -pub fn method_contract_cost_shape(p0: &MethodContract) -> Option { - ((p0).cost_shape).clone() -} -pub fn compute_symbolic_costs(p0: &Dag) -> Vec { - ((p0).nodes()) - .iter() - .fold(seed_bind_params((p0).nodes()), |__fold_acc, __fold_item| { - let mut __list = (__fold_acc).clone(); - __list.insert(0, entry_for(p0, &__fold_acc, __fold_item)); - __list - }) -} -pub fn seed_bind_params(p0: &[Behavior]) -> Vec { - match p0 { - [] => Vec::new(), - [__list_head, __list_tail @ ..] => { - concat_entries(&(params_of(__list_head)), seed_bind_params(__list_tail)) - } - } -} -pub fn params_of(p0: &Behavior) -> Vec { - match p0 { - Behavior::Value(_) => Vec::new(), - Behavior::Transform(_) => Vec::new(), - Behavior::Branch(_) => Vec::new(), - Behavior::Loop(_) => Vec::new(), - Behavior::Bind(bind) => param_entries(&((bind).params)), - } -} -pub fn param_entries(p0: &[PortId]) -> Vec { - match p0 { - [] => Vec::new(), - [__list_head, __list_tail @ ..] => { - let mut __list = param_entries(__list_tail); - __list.insert( - 0, - SymbolicCostEntry { - port: (*(__list_head)), - cost: Lookup::Hit(SymbolicCost::ConstantCost { _0: 0 }), - }, - ); - __list - } - } -} -pub fn concat_entries( - p0: &[SymbolicCostEntry], - p1: Vec, -) -> Vec { - match p0 { - [] => p1, - [__list_head, __list_tail @ ..] => { - let mut __list = concat_entries(__list_tail, (p1).clone()); - __list.insert(0, (__list_head).clone()); - __list - } - } -} -pub fn entry_for(p0: &Dag, p1: &[SymbolicCostEntry], p2: &Behavior) -> SymbolicCostEntry { - match p2 { - Behavior::Value(v) => SymbolicCostEntry { - port: (v).result_port(), - cost: Lookup::Hit(SymbolicCost::ConstantCost { _0: 0 }), - }, - Behavior::Transform(t) => match &(per_call_pattern_at(p0, *&((t).id))) { - None => SymbolicCostEntry { - port: (t).result_port(), - cost: transform_cost_for_target(p1, &((t).target), &((t).inputs)), - }, - Some(pattern) => match &(per_call_descent_operand_port(p0, *&((t).id))) { - None => SymbolicCostEntry { - port: (t).result_port(), - cost: Lookup::Miss, - }, - Some(descent_port) => SymbolicCostEntry { - port: (t).result_port(), - cost: recursive_transform_cost(p1, pattern, descent_port, &((t).inputs)), - }, - }, - }, - Behavior::Branch(b) => SymbolicCostEntry { - port: (b).result_port(), - cost: branch_cost(p1, &((b).input), &((b).paths)), - }, - Behavior::Loop(l) => SymbolicCostEntry { - port: (l).result_port(), - cost: loop_cost(p0, p1, l), - }, - Behavior::Bind(bind) => SymbolicCostEntry { - port: (bind).result_port(), - cost: lookup_cost(p1, &((bind).result_port())), - }, - } -} -pub fn recursive_transform_cost( - p0: &[SymbolicCostEntry], - p1: &CallPattern, - p2: &PortId, - p3: &[PortId], -) -> Lookup { - match p3 { - [] => Lookup::Miss, - [__list_head, __list_tail @ ..] => combine_iterate( - &(pattern_to_iter_bound(p1, p2)), - &(combine_sequential( - &(lookup_cost(p0, p2)), - &(sum_costs_excluding_descent_operand(p0, p3, p2)), - )), - ), - } -} -pub fn pattern_to_iter_bound(p0: &CallPattern, p1: &PortId) -> Lookup { - match p0 { - CallPattern::ArithmeticSubtractCall { - steps: _, - ring_param: _, - } => Lookup::Hit(SymbolicCost::LinearCost { - _0: SizeVariable { - source_port: *p1, - display_name: None, - }, - }), - CallPattern::ArithmeticDivideCall { - divisor: _, - ring_param: _, - } => Lookup::Hit(SymbolicCost::LogCost { - _0: SizeVariable { - source_port: *p1, - display_name: None, - }, - }), - CallPattern::ChildAccessorCall { accessor: _ } => Lookup::Hit(SymbolicCost::LinearCost { - _0: SizeVariable { - source_port: *p1, - display_name: None, - }, - }), - CallPattern::CollectionShrinkCall { - amount: _, - collection: _, - } => Lookup::Hit(SymbolicCost::LinearCost { - _0: SizeVariable { - source_port: *p1, - display_name: None, - }, - }), - CallPattern::FoldBodyCall { - outer_collection: _, - } => Lookup::Hit(SymbolicCost::LinearCost { - _0: SizeVariable { - source_port: *p1, - display_name: None, - }, - }), - CallPattern::ParserAdvanceCall { witness: _ } => Lookup::Hit(SymbolicCost::LinearCost { - _0: SizeVariable { - source_port: *p1, - display_name: None, - }, - }), - CallPattern::WorklistDrainCall { element: _ } => Lookup::Hit(SymbolicCost::LinearCost { - _0: SizeVariable { - source_port: *p1, - display_name: None, - }, - }), - CallPattern::SameArgumentCall => Lookup::Miss, - } -} -pub fn loop_cost(p0: &Dag, p1: &[SymbolicCostEntry], p2: &LoopNode) -> Lookup { - combine_iterate( - &(linear_at(&((p2).source))), - &(body_cost(p0, p1, &((p2).body))), - ) -} -pub fn body_cost(p0: &Dag, p1: &[SymbolicCostEntry], p2: &NodeId) -> Lookup { - match &((p0).node_opt(p2).cloned()) { - None => Lookup::Miss, - Some(body_behavior) => lookup_cost(p1, &(behavior_result_port(body_behavior))), - } -} -pub fn behavior_result_port(p0: &Behavior) -> PortId { - match p0 { - Behavior::Value(v) => (v).result_port(), - Behavior::Transform(t) => (t).result_port(), - Behavior::Branch(br) => (br).result_port(), - Behavior::Loop(lp) => (lp).result_port(), - Behavior::Bind(bind) => (bind).result_port(), - } -} -pub fn linear_at(p0: &PortId) -> Lookup { - Lookup::Hit(SymbolicCost::LinearCost { - _0: SizeVariable { - source_port: *p0, - display_name: None, - }, - }) -} -pub fn combine_iterate( - p0: &Lookup, - p1: &Lookup, -) -> Lookup { - match p0 { - Lookup::Miss => Lookup::Miss, - Lookup::Hit(b) => match p1 { - Lookup::Miss => Lookup::Miss, - Lookup::Hit(y) => Lookup::Hit(iterate((b).clone(), (y).clone())), - }, - } -} -pub fn branch_cost(p0: &[SymbolicCostEntry], p1: &PortId, p2: &[Path]) -> Lookup { - combine_sequential( - &(Lookup::Hit(SymbolicCost::ConstantCost { _0: 1 })), - &(combine_sequential(&(lookup_cost(p0, p1)), &(max_of_paths(p0, p2)))), - ) -} -pub fn max_of_paths(p0: &[SymbolicCostEntry], p1: &[Path]) -> Lookup { - (p1).iter().fold( - Lookup::Hit(SymbolicCost::ConstantCost { _0: 0 }), - |__fold_acc, __fold_item| { - combine_max( - &__fold_acc, - &(lookup_cost(p0, &((__fold_item).result_port()))), - ) - }, - ) -} -pub fn combine_max(p0: &Lookup, p1: &Lookup) -> Lookup { - match p0 { - Lookup::Miss => Lookup::Miss, - Lookup::Hit(ax) => match p1 { - Lookup::Miss => Lookup::Miss, - Lookup::Hit(bx) => Lookup::Hit(dominant((ax).clone(), (bx).clone())), - }, - } -} -pub fn dominant(p0: SymbolicCost, p1: SymbolicCost) -> SymbolicCost { - max_path( - &({ - let mut __list = { - let mut __list = Vec::new(); - __list.insert(0, (p1).clone()); - __list - }; - __list.insert(0, (p0).clone()); - __list - }), - ) -} -pub fn transform_cost_for_target( - p0: &[SymbolicCostEntry], - p1: &TransformTarget, - p2: &[PortId], -) -> Lookup { - match p1 { - TransformTarget::Callable(_) => transform_cost(p0, p2), - TransformTarget::UnresolvedFieldProject { field_label: _ } => transform_cost(p0, p2), - TransformTarget::ResolvedFieldProject { field_label: _ } => transform_cost(p0, p2), - TransformTarget::Operator(op) => match op { - OperatorKind::Arithmetic(arith) => match arith { - ArithmeticOp::Div => match p2 { - [] => Lookup::Miss, - [__list_head, __list_tail @ ..] => combine_sequential( - &(transform_cost(p0, p2)), - &(Lookup::Hit(SymbolicCost::LogCost { - _0: SizeVariable { - source_port: *__list_head, - display_name: None, - }, - })), - ), - }, - ArithmeticOp::Add => transform_cost(p0, p2), - ArithmeticOp::Sub => transform_cost(p0, p2), - ArithmeticOp::Mul => transform_cost(p0, p2), - }, - OperatorKind::Comparison(_) => transform_cost(p0, p2), - OperatorKind::Logical(_) => transform_cost(p0, p2), - }, - } -} -pub fn transform_cost(p0: &[SymbolicCostEntry], p1: &[PortId]) -> Lookup { - combine_sequential( - &(Lookup::Hit(SymbolicCost::ConstantCost { _0: 1 })), - &(sum_costs(p0, p1)), - ) -} -pub fn sum_costs(p0: &[SymbolicCostEntry], p1: &[PortId]) -> Lookup { - (p1).iter().fold( - Lookup::Hit(SymbolicCost::ConstantCost { _0: 0 }), - |__fold_acc, __fold_item| combine_sequential(&__fold_acc, &(lookup_cost(p0, __fold_item))), - ) -} -pub fn sum_costs_excluding_descent_operand( - p0: &[SymbolicCostEntry], - p1: &[PortId], - p2: &PortId, -) -> Lookup { - (p1).iter().fold( - Lookup::Hit(SymbolicCost::ConstantCost { _0: 0 }), - |__fold_acc, __fold_item| { - if ((*(__fold_item)) == (*(p2))) { - __fold_acc - } else { - combine_sequential(&__fold_acc, &(lookup_cost(p0, __fold_item))) - } - }, - ) -} -pub fn combine_sequential( - p0: &Lookup, - p1: &Lookup, -) -> Lookup { - match p0 { - Lookup::Miss => Lookup::Miss, - Lookup::Hit(ax) => match p1 { - Lookup::Miss => Lookup::Miss, - Lookup::Hit(bx) => Lookup::Hit(sequential((ax).clone(), (bx).clone())), - }, - } -} -pub fn lookup_cost(p0: &[SymbolicCostEntry], p1: &PortId) -> Lookup { - match p0 { - [] => Lookup::Miss, - [__list_head, __list_tail @ ..] => { - if ((__list_head).port == (*(p1))) { - ((__list_head).cost).clone() - } else { - lookup_cost(__list_tail, p1) - } - } - } -} -pub fn witness_from_symbolic_cost_lookup( - p0: &Lookup, - p1: Behavior, -) -> Witness { - match p0 { - Lookup::Hit(c) => Witness::Inhabits((c).clone()), - Lookup::Miss => Witness::Violates { - reason: String::from("symbolic_cost_of: missing SymbolicCost for behavior result port"), - subject: ViolatesSubject::AtBehavior((p1).clone()), - }, - } -} -pub fn cost_lens_read(p0: &Dag, p1: Behavior) -> Witness { - witness_from_symbolic_cost_lookup( - &(lookup_cost(&(compute_symbolic_costs(p0)), &(behavior_result_port(&p1)))), - (p1).clone(), - ) -} -pub fn cost_lens_sequential_op(p0: SymbolicCost, p1: SymbolicCost) -> SymbolicCost { - sequential((p0).clone(), (p1).clone()) -} -pub fn cost_lens_branch_op(p0: SymbolicCost, p1: SymbolicCost) -> SymbolicCost { - dominant((p0).clone(), (p1).clone()) -} -pub fn cost_lens_iterate_op(p0: SymbolicCost, p1: &LoopBound) -> SymbolicCost { - match p1 { - LoopBound::Cardinality { count: payload } => iterate( - SymbolicCost::LinearCost { - _0: SizeVariable { - source_port: *payload, - display_name: None, - }, - }, - (p0).clone(), - ), - LoopBound::Descent { - cluster: __payload_cluster, - measure: __payload_measure, - } => iterate( - SymbolicCost::LinearCost { - _0: SizeVariable { - source_port: *__payload_measure, - display_name: None, - }, - }, - (p0).clone(), - ), - } -} -pub fn cost_lens_validate(p0: &Dag, p1: &SymbolicCost) -> OptionalDiagnostic { - OptionalDiagnostic::NoDiagnostic -} -pub fn cost_enforcement_project(p0: SymbolicCost) -> SymbolicCost { - p0 -} -pub fn cost_enforcement_violates(p0: SymbolicCost, p1: SymbolicCost) -> bool { - if dominates(&p0, (p1).clone()) { - if dominates(&p1, (p0).clone()) { - (0 == 1) - } else { - (0 == 0) - } - } else { - (0 == 1) - } -} diff --git a/src/v3/compiler/src/dag.rs b/src/v3/compiler/src/dag.rs deleted file mode 100644 index 5f56bb5fa36..00000000000 --- a/src/v3/compiler/src/dag.rs +++ /dev/null @@ -1,5863 +0,0 @@ -// The v3 substrate: five L1 behaviors, Ports, a Declaration table, and the Dag container. -// -// Two coordinated substrates share one container: -// -// - Computation substrate: five L1 behaviors (Value, Transform, Branch, Loop, Bind) -// wiring PortIds into a DAG of runtime operations. M0-terminal. -// - Type substrate: a Declaration table indexed by DeclarationId, each declaration -// carrying one of six TypeConnective variants (Atom, Conj, Disj, Arrow, Cardinality, -// Instantiation). M1(2.5)-terminal until the convergence note in M1_DESIGN.md §1 -// reopens substrate extension. -// -// The two substrates reference each other by typed ID, not by name. Transform.target -// is a DeclarationId into the Declaration table; ArrowBody::UserDefined holds a -// BindNodeId witness back into the computation substrate. There is no name-based -// dispatch at the substrate layer — operators like `+` resolve to the `add` field of -// an inhabited algebra declaration during inference (via M1_DESIGN §8.9), not at -// parse time. -// -// Dissolution receipt — M0.3 (UPDATED at M1(2.5)): -// -// Checkpoint C2 RESOLVED by deletion and renewed. TransformRule no longer exists; -// Transform is Apply(DeclarationId): one shape that covers operators, primitives, -// and user functions uniformly. The target is a typed edge into the Declaration -// table. C2 is a NEGATIVE guardrail: a new Transform variant triggers the C2 stop -// signal (feedback_checkpoint_dissolution_default, feedback_coproduct_dissolution). -// -// Define (function definition) is a BIND whose params: Vec is non-empty. -// The body is a sub-DAG whose return port is the Bind's value. No TransformRule -// variant. -// -// Dissolution receipt — M1(2.5): -// -// The primitive substrate parallel-representation debt flagged in M0.3 -// (LiteralValue, FunctionRef { name: String }, primitive_signature lookup table, -// Dag.signatures HashMap) dissolves here. Primitives are now Declarations in the -// Declaration table, reached by DeclarationId from Transform.target. Operators -// dispatch via inhabitance walks, not string matching. See M1_DESIGN.md §2, §3, -// §5, §8.9. -// -// Structural refactor — M0.6 (preserved): -// -// Port.state is a three-state PortState enum, not Option. The biconditional -// state == Unresolved iff diagnostics.contains(port.id()) -// holds by construction. Uninferred is the transitional state; the post-infer sweep -// drives every port to Resolved or Unresolved before compile_to_dag returns. -// -// SourceSpan lives on every Behavior and every Declaration structurally. Spans flow -// forward through lowering; no side tables, no reconstruction. - -use std::collections::{HashMap, HashSet}; -use std::sync::LazyLock; - -use crate::bootstrap::BOOTSTRAP_FIXTURE_PATH_KEYS; -use crate::diagnostics::{ - BootstrapAuthorityKey, Diagnostic, DiagnosticAttribution, DiagnosticTable, SourceSpan, -}; -use crate::types::TypeShape; - -mod bootstrap_std_generated { - #![allow(unused_mut)] - - use super::*; - - include!("bootstrap_std_generated.rs"); -} - -mod bootstrap_generated { - #![allow(unused_mut)] - - use super::*; - - include!("bootstrap_generated.rs"); -} - -mod bootstrap_generated_without_parse_surface { - #![allow(unused_mut)] - - use super::*; - - include!("bootstrap_generated_without_parse_surface.rs"); -} - -mod builder; -mod computation { - //! Host lowering projection for Lane E-C (`std.computation`). - //! - //! Authority: `dsl/std/computation.dag` ↔ `src/v3/std/computation.dag`. These Rust - //! spellings stay in structural parity with the `.dag` carriers while std block - //! bodies remain `ArrowBody::Unparsed` at bootstrap. - //! - //! **Scope:** structural isolation only — the same host projections previously - //! lived inline in `dag.rs`; this nested `mod computation` keeps them separate from - //! the E-P induction producer in the parent module without adding a new SG-0 - //! hand-authored file path. This is **not** R3 gate - //! `tier3_computation_mirror_dissolved` closure (no mirror deletion, no evaluator - //! substitution for those bodies); full dissolution remains T-Tier3-Dissolution - //! lane work. - - use super::{ - positive_descent_count, DescentEvidence, PositiveDescentAmount, ProportionalDivisor, - }; - - /// 🟡 SCAFFOLD — `SizeBound` coproduct (`docs/modeling-discipline.md` §4). - /// - /// Authority: `src/v3/std/computation.dag`. Variant taxonomy is durable; `param: String` and - /// other bootstrap bridges dissolve when size parameters become first-class substrate refs. - /// **Named trigger:** evaluated `std.computation` std block bodies (same dissolution wave as - /// the termination lattice mirror). **Ledger:** parity ratchet - /// `m2_substrate_inhabitance_test::computation_size_bound_helpers_match_dag_authority`. - #[derive(Debug, Clone, PartialEq, Eq)] - pub enum SizeBound { - CollectionSize { param: String }, - ParserStreamSize { witness: String }, - WorklistDrainSize { element: String }, - TreeSize { param: String }, - ArithmeticParam { param: String }, - ExplicitCountZero, - ExplicitCountPositive { steps: PositiveDescentAmount }, - Forever, - } - - /// 🟡 SCAFFOLD — `CallPattern` coproduct (`docs/modeling-discipline.md` §4). - /// - /// Authority: `src/v3/std/computation.dag`. Peano shrink payloads are proof-grade (terminal - /// at witness shape); `String` slots on `CallPattern` forward into `SizeBound.param` via - /// `lower_call_pattern` (no fabricated size labels). Dissolves with structural parameter refs - /// (E-P). **Named trigger:** same as [`SizeBound`]. **Ledger:** - /// `m2_substrate_inhabitance_test::computation_lowering_rust_mirror_matches_dag_authority`. - #[derive(Debug, Clone, PartialEq, Eq)] - pub enum CallPattern { - ChildAccessorCall { - accessor: String, - }, - CollectionShrinkCall { - amount: PositiveDescentAmount, - collection: String, - }, - ArithmeticSubtractCall { - steps: PositiveDescentAmount, - ring_param: String, - }, - ArithmeticDivideCall { - divisor: ProportionalDivisor, - ring_param: String, - }, - ParserAdvanceCall { - witness: String, - }, - WorklistDrainCall { - element: String, - }, - FoldBodyCall { - outer_collection: String, - }, - SameArgumentCall, - } - - /// 🟢 TERMINAL — `ShrinkFactor` coproduct (`docs/modeling-discipline.md` §4). - /// - /// Authority: `src/v3/std/computation.dag`. Only unit / Peano constant / Peano proportional - /// shrink — illegal rates stay unrepresentable at the carrier. **Ledger:** exercised through - /// the same `m2_substrate_inhabitance_test` computation rows as [`CallPattern`]. - #[derive(Debug, Clone, PartialEq, Eq, Hash)] - pub enum ShrinkFactor { - UnitShrink, - ConstantShrink { steps: PositiveDescentAmount }, - ProportionalShrink { divisor: ProportionalDivisor }, - } - - /// 🟢 TERMINAL — `IterationPrimitive` coproduct (`docs/modeling-discipline.md` §4). - /// - /// Closed `{Fold, Descend, Repeat}` behavioral alphabet (MODELING.md M9). Authority: - /// `src/v3/std/computation.dag`. - #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] - pub enum IterationPrimitive { - Fold, - Descend, - Repeat, - } - - #[derive(Debug, Clone, PartialEq, Eq)] - pub struct LoweringTarget { - pub primitive: IterationPrimitive, - pub bound: SizeBound, - pub evidence: DescentEvidence, - pub factor: Option, - } - - pub fn lower_call_pattern(pattern: CallPattern) -> LoweringTarget { - match pattern { - CallPattern::ChildAccessorCall { accessor } => LoweringTarget { - primitive: IterationPrimitive::Descend, - bound: SizeBound::TreeSize { param: accessor }, - evidence: DescentEvidence::Strict, - factor: None, - }, - CallPattern::CollectionShrinkCall { amount, collection } => LoweringTarget { - primitive: IterationPrimitive::Fold, - bound: SizeBound::CollectionSize { param: collection }, - evidence: DescentEvidence::Strict, - factor: Some(ShrinkFactor::ConstantShrink { steps: amount }), - }, - CallPattern::ArithmeticSubtractCall { steps, ring_param } => LoweringTarget { - primitive: IterationPrimitive::Repeat, - bound: SizeBound::ArithmeticParam { param: ring_param }, - evidence: DescentEvidence::Strict, - factor: Some(ShrinkFactor::ConstantShrink { steps }), - }, - CallPattern::ArithmeticDivideCall { - divisor, - ring_param, - } => LoweringTarget { - primitive: IterationPrimitive::Repeat, - bound: SizeBound::ArithmeticParam { param: ring_param }, - evidence: DescentEvidence::Strict, - factor: Some(ShrinkFactor::ProportionalShrink { divisor }), - }, - CallPattern::ParserAdvanceCall { witness } => LoweringTarget { - primitive: IterationPrimitive::Fold, - bound: SizeBound::ParserStreamSize { witness }, - evidence: DescentEvidence::Strict, - factor: None, - }, - CallPattern::WorklistDrainCall { element } => LoweringTarget { - primitive: IterationPrimitive::Fold, - bound: SizeBound::WorklistDrainSize { element }, - evidence: DescentEvidence::Strict, - factor: None, - }, - CallPattern::FoldBodyCall { outer_collection } => LoweringTarget { - primitive: IterationPrimitive::Fold, - bound: SizeBound::CollectionSize { - param: outer_collection, - }, - evidence: DescentEvidence::NonIncreasing, - factor: None, - }, - CallPattern::SameArgumentCall => LoweringTarget { - primitive: IterationPrimitive::Repeat, - bound: SizeBound::Forever, - evidence: DescentEvidence::NonIncreasing, - factor: None, - }, - } - } - - pub fn size_bound_param(bound: &SizeBound) -> Option<&str> { - match bound { - SizeBound::TreeSize { param } => Some(param.as_str()), - SizeBound::CollectionSize { param } => Some(param.as_str()), - SizeBound::ParserStreamSize { witness } => Some(witness.as_str()), - SizeBound::WorklistDrainSize { element } => Some(element.as_str()), - SizeBound::ArithmeticParam { param } => Some(param.as_str()), - SizeBound::ExplicitCountZero - | SizeBound::ExplicitCountPositive { .. } - | SizeBound::Forever => None, - } - } - - pub fn is_constant_bound(bound: &SizeBound) -> bool { - matches!( - bound, - SizeBound::ExplicitCountZero - | SizeBound::ExplicitCountPositive { .. } - | SizeBound::Forever - ) - } - - /// `None` when `bound` is not constant (`ExplicitCount*` / `Forever` only). - /// - /// `Forever` materializes as signed-`Int` top (`i64::MAX`) per `std.computation` - /// `repeat(max_int)`; the prior `forever_iteration_bound()` Rust mirror was retired - /// (Tier3 gate #2 narrow slice — see `tier3_computation_mirror_trivial_constructors_dissolved`). - pub fn constant_bound_value(bound: &SizeBound) -> Option { - match bound { - SizeBound::ExplicitCountZero => Some(0), - SizeBound::ExplicitCountPositive { steps } => Some(positive_descent_count(steps)), - SizeBound::Forever => Some(i64::MAX), - _ => None, - } - } - - /// 🟢 TERMINAL — `IterationDimension` coproduct (`docs/modeling-discipline.md` §4). - /// - /// Three-way projection from kernel algebra profiles onto iteration regimes. Authority: - /// `src/v3/std/computation.dag`. - #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] - pub enum IterationDimension { - TreeDescent, - CollectionFold, - ArithmeticRepeat, - } - - /// 🟢 TERMINAL — `AlgebraProfile` coproduct (`docs/modeling-discipline.md` §4). - /// - /// Closed seven-variant mirror of `dsl/std/algebra.dag` `AlgebraProfile`. - /// The profile table itself is read from the lowered `kernel_algebra_profile` - /// `ValueBody::Map`, not from a hand-maintained Rust lookup table. - #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] - pub enum AlgebraProfile { - OrderedRingProfile, - ApproximateFieldProfile, - BooleanAlgebraProfile, - BooleanAlgebraCollectionProfile, - FreeMonoidScalarProfile, - FreeMonoidCollectionProfile, - PartialFunctionProfile, - } - - pub fn algebra_profile_to_dimension(profile: AlgebraProfile) -> Option { - match profile { - AlgebraProfile::FreeMonoidCollectionProfile - | AlgebraProfile::FreeMonoidScalarProfile - | AlgebraProfile::BooleanAlgebraCollectionProfile - | AlgebraProfile::PartialFunctionProfile => Some(IterationDimension::CollectionFold), - AlgebraProfile::OrderedRingProfile | AlgebraProfile::ApproximateFieldProfile => { - Some(IterationDimension::ArithmeticRepeat) - } - AlgebraProfile::BooleanAlgebraProfile => None, - } - } - - pub fn type_iteration_dimension(type_name: &str) -> Option { - if type_name == "Node" { - return Some(IterationDimension::TreeDescent); - } - - super::BOOTSTRAPPED_DAG - .kernel_algebra_profile(type_name) - .and_then(algebra_profile_to_dimension) - } -} -mod effects; -mod ports; - -pub use computation::{ - algebra_profile_to_dimension, constant_bound_value, is_constant_bound, lower_call_pattern, - size_bound_param, type_iteration_dimension, AlgebraProfile, CallPattern, IterationDimension, - IterationPrimitive, LoweringTarget, ShrinkFactor, SizeBound, -}; - -pub(crate) use effects::{ - classify_operation_effect, compose_operation_effects, EffectClassificationFailure, -}; - -pub use effects::{ - lane2_workflow_idempotency_report, operation_effect_shape, report_unsupported_workflow_variant, - BranchArm, BreakingShape, CallableRef, CompositionVerdict, CreateCause, EffectShape, - HttpMethodScalar, IdempotencyUnsupportedDetail, IdempotentShape, InputField, KeySource, - Operation, ParallelismUnsupportedDetail, ParallelismUnsupportedKind, PathTemplate, - RestEndpointBinding, UrlPathToken, WorkflowEffect, WorkflowIdempotencyReport, - WorkflowParallelismReport, -}; -pub use ports::{ - BoolPortRef, ElementRef, NonEmptyList, NonSingletonList, ParamRef, Port, TransformRef, -}; -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -pub struct NodeId(u32); - -impl NodeId { - fn index(self) -> usize { - self.0 as usize - } - - pub(crate) fn raw(self) -> u32 { - self.0 - } - - /// Constructs a [`NodeId`] from the dense node-table index (substrate `NodeId` encoding). - /// - /// Not every index names a [`Behavior`] in every [`Dag`]: [`crate::enforced_lens_application`] - /// validates `SectionRef::NodeScope` payloads against [`Dag::node_opt`] and declared-body - /// membership (`node_scope_subject_within_arrow_declaration`). - pub(crate) fn from_table_index(raw: u32) -> Self { - Self(raw) - } -} - -/// Typed witness that a `NodeId` identifies a [`BindNode`]. -/// -/// `ArrowBody::UserDefined` means "the declaration body is this bind." Keeping the -/// witness here prevents every emitter/lens/inference consumer from revalidating the -/// same raw `NodeId -> BindNode` invariant with `as_bind().expect(...)`. -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -pub struct BindNodeId(NodeId); - -impl BindNodeId { - fn new_unchecked(id: NodeId) -> Self { - Self(id) - } - - pub(crate) fn from_bind_node(dag: &Dag, id: NodeId) -> Option { - dag.node_opt(&id).and_then(Behavior::as_bind)?; - Some(Self::new_unchecked(id)) - } - - pub fn node_id(self) -> NodeId { - self.0 - } - - pub fn bind_opt(self, dag: &Dag) -> Option<&BindNode> { - dag.node_opt(&self.0)?.as_bind() - } - - pub fn bind(self, dag: &Dag) -> &BindNode { - self.bind_opt(dag).expect("BindNodeId must point at a Bind") - } -} - -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -pub struct PortId(u32); - -impl PortId { - pub fn raw(self) -> u32 { - self.0 - } -} - -#[cfg(test)] -impl PortId { - pub(crate) const fn test_raw(raw: u32) -> Self { - Self(raw) - } -} - -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -pub struct DeclarationId(u32); - -impl DeclarationId { - fn index(self) -> usize { - self.0 as usize - } - - pub fn raw(self) -> u32 { - self.0 - } -} - -#[cfg(test)] -impl DeclarationId { - pub(crate) const fn test_raw(raw: u32) -> Self { - Self(raw) - } -} - -#[cfg(feature = "declaration-id-raw-test-witness")] -impl DeclarationId { - /// Builds an opaque id without validating substrate indexing — **dependent test witness only** - /// (feature **`declaration-id-raw-test-witness`**; row-count gates that never read ids). - #[doc(hidden)] - pub const fn declaration_id_raw_for_testing(raw: u32) -> Self { - Self(raw) - } -} - -/// Structural reference to a lens-application section. -/// -/// Authority: `src/v3/std/lens_application.dag` (`SectionRef`). Emitted lens code -/// (`lens_cost_symbolic`) references this `dag` mirror so cost-basis subjects align with -/// `EnforcedApplication.section` / design doc §2 (`DeclarationScope` / `NodeScope`). -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -pub enum SectionRef { - DeclarationScope { - declaration: DeclarationId, - }, - NodeScope { - declaration: DeclarationId, - node: NodeId, - }, -} - -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -pub struct ClusterId(u32); - -impl ClusterId { - fn index(self) -> usize { - self.0 as usize - } - - pub fn raw(self) -> u32 { - self.0 - } -} - -/// `std.error_primitives` declares canonical `Result = Ok { value: ok } | Err { value: err }`. -/// Emitters lower it to a target-native `Result` / `struct { Ok; Err }` carrier and must -/// not also emit a second substrate `type Result`. -/// -/// Suppression keys off the **resolved structural fingerprint** of that declaration -/// (name + type-parameter identities + `Ok`/`Err` payload wiring), not `span.file` -/// suffixes — so unrelated modules named `errors.dag` cannot collide, and renaming -/// the std file alone does not silently retarget suppression. -/// -/// **Policy:** the fingerprint is **global**, not std-scoped: any other declaration -/// named `Result` that matches this exact shape is also suppressed (intentional — the -/// substrate owns one canonical `Result` carrier; a user-defined twin with -/// the same fingerprint would not emit as a separate `type Result`). -pub(crate) fn substrate_result_type_decl_suppressed_for_emit( - dag: &Dag, - decl: &Declaration, -) -> bool { - if decl.name.as_deref() != Some("Result") { - return false; - } - let [ok_param, err_param] = match decl.type_params.as_slice() { - [a, b] => [*a, *b], - _ => return false, - }; - let ok_decl = dag.declaration(ok_param); - let err_decl = dag.declaration(err_param); - let ok_param_ok = matches!( - &ok_decl.connective, - TypeConnective::Atom(AtomPayload::TypeParam(name)) if name == "ok" - ); - let err_param_ok = matches!( - &err_decl.connective, - TypeConnective::Atom(AtomPayload::TypeParam(name)) if name == "err" - ); - if !ok_param_ok || !err_param_ok { - return false; - } - let TypeConnective::Disj { variants } = &decl.connective else { - return false; - }; - if variants.len() != 2 { - return false; - } - let Some(ok_field) = variants.iter().find(|v| v.label == "Ok") else { - return false; - }; - let Some(err_field) = variants.iter().find(|v| v.label == "Err") else { - return false; - }; - substrate_result_variant_payload_is_value_of(dag, ok_field.ty, ok_param) - && substrate_result_variant_payload_is_value_of(dag, err_field.ty, err_param) -} - -fn substrate_result_variant_payload_is_value_of( - dag: &Dag, - payload_ty: DeclarationId, - type_param: DeclarationId, -) -> bool { - let payload = dag.declaration(payload_ty); - let TypeConnective::Conj { children } = &payload.connective else { - return false; - }; - children.len() == 1 && children[0].label == "value" && children[0].ty == type_param -} - -/// `std.error_primitives` declares canonical `DivError = DivideByZero | Overflow`. -/// Like `Result`, emit suppression keys off the resolved structural fingerprint, -/// not the declaration source path. A declaration with this exact global shape is -/// the substrate-owned integer-division error carrier and is materialized by the -/// target division prelude when a program actually needs it. -pub(crate) fn substrate_div_error_type_decl_suppressed_for_emit( - dag: &Dag, - decl: &Declaration, -) -> bool { - if decl.name.as_deref() != Some("DivError") || !decl.type_params.is_empty() { - return false; - } - matches!(&decl.connective, TypeConnective::Disj { variants } if { - variants.len() == 2 - && variants.iter().any(|variant| { - variant.label == "DivideByZero" - && substrate_div_error_variant_payload_is_unit(dag, variant.ty) - }) - && variants.iter().any(|variant| { - variant.label == "Overflow" - && substrate_div_error_variant_payload_is_unit(dag, variant.ty) - }) - }) -} - -fn substrate_div_error_variant_payload_is_unit(dag: &Dag, payload_ty: DeclarationId) -> bool { - matches!( - &dag.declaration(payload_ty).connective, - TypeConnective::Conj { children } if children.is_empty() - ) -} - -/// A type-system declaration. The unit of the type substrate. -/// -/// Every named declaration (primitive, algebra, user type, type alias) lives in -/// `Dag.declarations` under a stable DeclarationId. Anonymous declarations (the -/// inner types of Cardinality bounds, Arrow inputs, etc.) also live here; only the -/// `name` field distinguishes them. -/// -/// `type_params`, `phantom_params`, `meta_tag`, `specialization_parent`, `inhabits`, and -/// `value_body` are separate edges with distinct semantics: -/// - `type_params`: the canonical carrier for generic parameters declared on -/// `type Foo { ... }` / sum / alias items. Each entry is a -/// DeclarationId whose connective is `Atom(TypeParam(name))`. Keeping type -/// params off the connective axis means `Conj.children` stays pure record -/// fields and `Disj.variants` stays pure sum alternatives — type params no -/// longer share a slot with either. Empty for most declarations. -/// - `phantom_params`: the subset of `type_params` that must be preserved for -/// type checking but do not correspond to runtime fields. Each entry also -/// names the algebra that governs closure for that phantom value. The initial -/// R2 Dimensions consumer needs only abelian-group closure, carried as a -/// typed edge to the substrate algebra declaration: matching phantom values -/// compose, mismatched values fail closed as a unit mismatch. -/// - `meta_tag`: "this Conj's shape is constrained by the linked meta-type -/// declaration." Used for value construction (records, services, -/// transports) per M1_DESIGN.md §Q0. Empty across the M1(2.5) bootstrap -/// set except for the §6.5 realization stub. -/// - `specialization_parent`: optional lowering-only back-pointer from a -/// **materialized** declaration produced by `lower::specialize_decl_for_lowering` -/// to the declaration id that was specialized (the immediate template before -/// substitution). Today only anonymous specialized `Disj` sums set this so -/// Rust emit can walk to the named template without cloning `Declaration::name` -/// (P2 / `Dag::declaration_by_name`). `None` for every other declaration. -/// - `inhabits`: "this declaration additionally satisfies the linked -/// algebra's laws." Used for secondary algebra inhabitance on declarations -/// with their own primary structure. Empty across M1(2.5). -/// - `value_body`: "this declaration is a data value of the declared type, -/// not a type alias." Distinguishes `data foo: Int = {...}` from -/// `type foo = Int` at the substrate level. `None` for type -/// declarations; `Some(ValueBody::Unparsed(span))` for data items whose -/// body source is preserved but not yet lowered to a value sub-DAG. -/// See M1(2.7) QW2 resolution in DOWNSTREAM_REQUIREMENTS.md. -#[derive(Debug, Clone)] -pub struct Declaration { - pub id: DeclarationId, - pub name: Option, - pub connective: TypeConnective, - pub type_params: Vec, - pub phantom_params: Vec, - pub meta_tag: Option, - pub specialization_parent: Option, - pub inhabits: Option, - pub value_body: Option, - /// DB-11 (3a.3): optional refinement predicate. `None` for - /// ordinary declarations; `Some(pred_id)` for refined parameter - /// types where `pred_id` points at a predicate `Declaration` - /// whose connective is `Arrow { inputs: [base], output: Bool, - /// body: UserDefined(bind) }`. The `Bind`'s `params[0]` is the - /// refinement's parameter slot; walking from `Bind.value` through - /// the predicate's node sub-DAG reaches the Bool output. Two - /// refinements are structurally equal iff their predicate - /// expression DAGs walk equal via - /// `infer::predicates_structurally_equal` — no interning, no SMT - /// entailment. - /// - /// **Consumers.** `infer::decide_transform` consults - /// `refinement` on the callee's parameter type declaration via - /// `check_refinement_discharge` after structural equivalence - /// passes; argument-side ports carry the refined declaration id - /// through `declaration_to_port_shape` and `signature_type_shape` - /// (which stops at refinement carriers so the alias walk doesn't - /// strip the edge). `lower::narrow_scope_for_predicate` creates - /// refined declarations for arm-local narrowing when an `if` - /// cond is a single-parameter predicate. - pub refinement: Option, - /// Nominal-opacity carrier (T-Substrate nominal-opaque-for-Secret - /// subset, carrier-only staging). When `Some`, the listed - /// `permitted_accessors` are the intended sealed-accessor boundary - /// for generic structural walks. The fail-closed walker consumer + - /// std `Secret` marking + carry-forward through specialization are - /// the named follow-up enforcement work; this field is staging - /// surface only and must either gain a real walker consumer or be - /// removed before T-Modeling Secret graduation can dispatch. - pub nominal_opacity: Option, - pub span: SourceSpan, -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub struct PhantomParameter { - pub parameter: DeclarationId, - pub algebra: DeclarationId, -} - -/// Sealed-accessor carrier (carrier-only staging). Lists the -/// `DeclarationId`s intended as the only permitted descent path into -/// a nominal-opaque declaration's interior. The fail-closed walker -/// consumer is the named follow-up enforcement work. -#[derive(Debug, Clone, PartialEq, Eq)] -pub struct NominalOpacity { - pub permitted_accessors: Vec, -} - -// Value-body shape for `data foo: T = ...` declarations. -// -// Dissolution ledger: `Unparsed` is the bounded scaffold (named dissolution -// trigger: M2+ parser extensions close class-5 gap #3); structural variants -// carry lowered record/scalar/list/map data bodies. Keep the enum itself in the -// generated include below so `src/v3/std/substrate.dag` remains the carrier -// authority. Map payloads are wrapped in `FieldMap` on the Rust side to -// preserve duplicate-key rejection. -include!("dag_value_body_generated.rs"); - -/// Ordered string-keyed structural map entries with duplicate keys rejected at -/// construction. The ordered storage is deliberate: `.dag` data maps preserve -/// authored order for deterministic bootstrap/regeneration output, while the -/// constructor enforces map key uniqueness once at the substrate boundary. -#[derive(Debug, Clone, PartialEq, Eq)] -pub struct FieldMap { - entries: Vec<(String, FieldValue)>, -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub struct DuplicateFieldMapKey { - pub key: String, -} - -impl FieldMap { - pub fn from_entries(entries: Vec<(String, FieldValue)>) -> Result { - let mut seen = HashSet::new(); - for (key, _) in &entries { - if !seen.insert(key.clone()) { - return Err(DuplicateFieldMapKey { key: key.clone() }); - } - } - Ok(Self { entries }) - } - - pub fn entries(&self) -> &[(String, FieldValue)] { - &self.entries - } - - pub fn into_entries(self) -> Vec<(String, FieldValue)> { - self.entries - } -} - -/// Per-field value payload inside a `ValueBody::Structural`. -/// Scalar literals, declaration references, nested records, nested -/// lists, and structural sum constructors each carry distinct -/// payload shapes, so the discriminant remains load-bearing. -/// -/// **Why both variants exist.** PR-B's initial payload was -/// `LiteralBits` only, which forced `src/v3/spec/rust.dag` -/// to encode declaration identities as strings (`target_name: -/// "Int"`) — and that pushed string-dispatch back into -/// `emit_rust.rs`, undoing the M1(2.7) cleanup at the inference -/// layer one layer down. The unwind adds the `Reference` variant -/// so target spec files write `target: Int` (typed edge to the -/// `Int` declaration in std/integer.dag) and downstream consumers -/// read a `DeclarationId` directly. -/// -/// Lowering recognizes when a record-literal field's declared type -/// walks to the `DeclarationRef` sentinel marker (declared in -/// `src/v3/spec/v3_l1.dag`) and accepts identifier / dotted-path -/// expressions as field values, resolving them to declaration ids. -/// For non-`DeclarationRef` field types lowering requires a literal. -/// -/// 4-pattern check: -/// - Pattern 1 (fact placement): fails. Each variant has a -/// distinct payload type; the discriminant is load-bearing for -/// downstream readers (the realization index, the cost lens, etc). -/// - Pattern 2 (variant-is-data): fails. `Literal(LiteralBits)`, -/// `Reference(DeclarationId)`, `Record(Vec<...>)`, -/// `List(Vec<...>)`, `Map(FieldMap)`, and `Variant { .. }` inhabit different -/// structural spaces. -/// - Pattern 3 (algebraic form): fails. The six variants are not -/// points in one algebra; they are the minimal carrier set needed -/// for nested structural data bodies. -/// - Pattern 4 (dimensional): fails. -/// -/// Verdict: terminal at the current structural-data layer. Any new -/// `FieldValue` variant still requires its own 4-pattern receipt at -/// extension time. -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum FieldValue { - /// A scalar primitive value: Int, Bool, or String. Validated - /// at lowering time against the declared field type via the - /// primitive cache. - Literal(LiteralBits), - /// A typed reference to another declaration. The - /// `DeclarationId` was resolved at lowering time from a - /// `SurfaceExpr::Var` or `SurfaceExpr::Path`. Used by - /// per-target language spec files (e.g. rust.dag) to point at - /// realization targets without going through string keys. - Reference(DeclarationId), - /// Nested structural record value. Used by staged spec files - /// whose structural data bodies contain record-valued fields. - Record(Vec<(String, FieldValue)>), - /// Structural list value. Used by staged spec files whose - /// structural data bodies contain list-valued fields. - List(Vec), - /// Structural string-keyed map value. Used by staged spec files whose - /// structural data bodies contain `Map` fields. The carrier is - /// validated so duplicate keys are not representable after construction. - Map(FieldMap), - /// Structural sum constructor with positional payload fields. - /// The exact variant child declaration is preserved explicitly - /// so downstream consumers can recover variant identity without - /// string bridges. - Variant { - constructor: DeclarationId, - payload: Vec, - }, -} - -// Terminal literal/cardinality/template/port-state mirrors are generated -// from `std/substrate.dag`; keep the substrate authority there, not here. -include!("dag_scalar_generated.rs"); - -/// Construct [`LiteralBits::Int`] from a host `i64` (tests, staging, internal seeds). -#[inline] -pub fn literal_bits_int(i: i64) -> LiteralBits { - LiteralBits::Int(i.to_string()) -} - -/// Parse a signed decimal [`LiteralBits::Int`] payload as `i64` (evaluator / emit paths). -#[inline] -pub fn literal_decimal_i64(s: &str) -> Option { - s.parse().ok() -} - -/// Parse a nonnegative decimal [`LiteralBits::Int`] payload as `usize` (emit slot indices, …). -#[inline] -pub fn literal_decimal_usize(s: &str) -> Option { - if s.starts_with('-') { - return None; - } - s.parse().ok() -} - -impl CardinalityBound { - pub fn interval(self) -> Interval { - match self { - Self::Exact(value) => Interval::BoundedInterval { - lower: value, - width: IntervalWidth::ZeroWidth, - }, - Self::AtMostOne => Interval::BoundedInterval { - lower: 0, - width: IntervalWidth::PositiveWidth(PositiveIntervalWidth::OneUnit), - }, - Self::Unbounded => Interval::Unbounded, - } - } -} - -mod cardinality_payload; -pub use cardinality_payload::CardinalityPayload; - -/// The six-variant type substrate. Terminal at M1(2.5). -/// -/// Dissolution ledger (4-pattern check per THESIS §"Structural decompression"): -/// - **Pattern 1 (fact placement)**: fails. Each variant carries a -/// structurally distinct shape (Atom is a payload enum, Conj holds a -/// labeled product, Disj a labeled coproduct, Arrow a typed function, -/// Cardinality a repetition, Instantiation a template reference). -/// Scattering them into per-variant side tables duplicates dispatch. -/// - **Pattern 2 (variant-is-data)**: fails. Different variants have -/// different payload types; a unified representation would be a tagged -/// union (which is what we already have). -/// - **Pattern 3 (algebraic form)**: passes. The six variants map to the -/// six category-theoretic forms of a type algebra (intro + AND + OR + -/// function + repetition + parametric specialization). The substrate -/// matches the thesis's type-substrate shape exactly. -/// - **Pattern 4 (dimensional)**: fails. No shared coordinate space -/// underlies all six variants. -/// -/// Verdict: terminal at M1(2.5). Extension requires the C1-class stop -/// signal in M1_DESIGN.md §8.10 — all four patterns must be re-run -/// before adding a 7th variant. See also the related §8.11 Pending -/// elimination ratchet that dissolves `ArrowBody::Pending` (not a -/// TypeConnective variant) by M3. -#[derive(Debug, Clone)] -pub enum TypeConnective { - /// Irreducible leaf. See AtomPayload. - Atom(AtomPayload), - /// Labeled product — logical AND. All children present together. - Conj { children: Vec }, - /// Labeled coproduct — logical OR. Exactly one variant active. - Disj { variants: Vec }, - /// Function type — directional flow from inputs to an output. `body` covers - /// user sub-DAGs, extdeps-declared realizations, and the Pending bootstrap - /// state. See M1_DESIGN.md §Q7. - Arrow { - inputs: Vec, - output: DeclarationId, - body: ArrowBody, - }, - /// Repetition over an element type with a bound. Unifies v2's Required/Optional - /// with list cardinality. - Cardinality(CardinalityPayload), - /// Specialization of a parameterized template with concrete template arguments. - /// For pure aliases like `Int = OrderedRing`, Int's connective IS - /// Instantiation directly — inhabitance collapses into this form. See - /// M1_DESIGN.md §Q0, §Q1. - Instantiation { - template: DeclarationId, - arguments: Vec, - }, -} - -/// Maximum alias / resolution hops when peeling before cardinality idempotence. -const CARDINALITY_IDEMPOTENCE_PEEL_DEPTH: usize = 64; - -/// Peel `ResolvedBy*` atoms and zero-argument `Instantiation` aliases (surface -/// `type Alias = Target` lowering) to the denoted declaration. Stops at the -/// first non-transparent connective or at [`CARDINALITY_IDEMPOTENCE_PEEL_DEPTH`]. -fn peel_alias_for_cardinality_idempotence( - dag: &Dag, - current: DeclarationId, - depth: usize, -) -> DeclarationId { - if depth >= CARDINALITY_IDEMPOTENCE_PEEL_DEPTH { - return current; - } - match &dag.declaration(current).connective { - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - peel_alias_for_cardinality_idempotence(dag, *next, depth + 1) - } - TypeConnective::Instantiation { - template, - arguments, - } if arguments.is_empty() => { - peel_alias_for_cardinality_idempotence(dag, *template, depth + 1) - } - _ => current, - } -} - -/// `AtMostOne ∧ AtMostOne` idempotence: nested optional uses the inner declaration. -/// -/// Single rule authority for T-ImpossibleBugs nested-optional flatten. Applies -/// after peeling zero-arg instantiation / resolved-atom indirection so -/// `type Opt = Int?; type Alias = Opt; … Alias?` collapses like `Opt?`. -pub(crate) fn cardinality_idempotent_target( - dag: &Dag, - element: DeclarationId, - bound: CardinalityBound, -) -> Option { - if bound != CardinalityBound::AtMostOne { - return None; - } - let subject = peel_alias_for_cardinality_idempotence(dag, element, 0); - match &dag.declaration(subject).connective { - TypeConnective::Cardinality(p) if p.bound() == CardinalityBound::AtMostOne => Some(subject), - _ => None, - } -} - -/// `TypeConnective::Cardinality` for contexts that do not allocate a declaration -/// (e.g. type-alias connective). Reuses the same -/// [`cardinality_idempotent_target`] / nested-`AtMostOne` rule as -/// [`Dag::alloc_cardinality_decl`]: if `element` is already -/// `Cardinality(AtMostOne, …)` with matching `bound`, the existing connective is -/// returned unchanged instead of minting `Cardinality(AtMostOne, that_decl)`. -pub(crate) fn type_connective_cardinality( - dag: &Dag, - element: DeclarationId, - bound: CardinalityBound, -) -> TypeConnective { - if let Some(keep) = cardinality_idempotent_target(dag, element, bound) { - return dag.declaration(keep).connective.clone(); - } - TypeConnective::Cardinality(CardinalityPayload::new_unchecked_bypassing_idempotence( - element, bound, - )) -} - -#[derive(Debug, Clone)] -pub struct Field { - pub label: String, - pub ty: DeclarationId, -} - -impl AtomPayload { - pub fn resolved_id(&self) -> Option { - match self { - Self::ResolvedByStructure(id) | Self::ResolvedByName(id) => Some(*id), - _ => None, - } - } -} - -/// Dissolution ledger (per M1_DESIGN.md §Q7 "ArrowBody dissolution ledger"): -/// ArrowBody is a **mixed-lifecycle coproduct**. Terminal shape is 2 -/// variants (`UserDefined`, `ExternalRealization`); the two -/// scaffold variants (`Pending`, `Unparsed`) dissolve via separate -/// ratchets with distinct triggers. -/// -/// 4-pattern check on the terminal pair (UserDefined, ExternalRealization): -/// - Pattern 1 (fact placement): fails. Both are Arrow-level facts with -/// different structural targets (NodeId vs DeclarationId). -/// - Pattern 2 (variant-is-data): fails. Different payload types. -/// - Pattern 3 (algebraic form): partial. Both are "realization -/// reference" but with structurally different reference types; -/// collapsing would require a sum over NodeId/DeclarationId — a -/// worse coproduct. -/// - Pattern 4 (dimensional): fails. No shared coordinate space. -/// -/// Scaffold variants with their dissolution triggers: -/// -/// - **`Pending`** — "body to come, transient." Two production sites -/// write Pending today, both transient: -/// -/// 1. **Executable-fn seeding (declarations).** `seed_function_signature` -/// writes `Pending` for `fn foo(x) -> T = body` declarations as -/// the initial substrate state. `lower_fn_item` is responsible -/// for patching every such declaration to -/// `ArrowBody::UserDefined(BindNodeId::from_bind_node(dag, bind_id))` before the Dag is frozen -/// — including on error paths (R13 fix in `lower.rs`). A -/// final `Arrow(Pending)` surviving into the Dag is -/// structurally equivalent to "body lowering missed a path," -/// which is exactly what `lens_structural_resolution` detects. -/// -/// 2. **Operator fallback bridge (transient `ResolvedArrow`).** -/// `infer::resolve_operator_arrow` falls back to a synthetic -/// `(T, T) -> T` / `(T, T) -> Bool` signature with `body: -/// Pending` when the structural algebra walk can't find an -/// algebra Conj (Bool, collection-level algebras — class-5 -/// gaps #1 and #2 in DOWNSTREAM_REQUIREMENTS.md). This shape -/// lives in inference-only `ResolvedArrow` values, never in -/// `Dag.declarations`, so the lens cannot see it. Dissolves -/// when those class-5 gaps close. -/// -/// **History.** Earlier rounds wrote Pending at four additional -/// sites (anonymous nested Arrow type expressions, type-alias -/// targets, data-item type annotations, variant constructor -/// synthesis), all of which represented "no body by construction" -/// rather than "body to come." Those sites migrated to `NoBody` -/// in the (a)/broader-migration work — see the per-site comments -/// at `lower.rs` (`type_to_connective`, anonymous nested Arrow synthesis), -/// and `infer.rs:1893` -/// (`resolve_direct_target_signature`). -/// -/// - **`NoBody`** — terminal "no body by construction." Used wherever -/// an Arrow signature exists but the declaration carries no -/// executable body and never will. Production sites: -/// -/// 1. **Type aliases / data items** with Arrow targets -/// (`type Callback = fn(Int) -> Int`, `data x: fn(Int) -> Int = ...`) -/// via `lower_type_alias` / `lower_data_item` → -/// `type_to_connective`. -/// -/// 2. **Anonymous nested Arrow declarations** synthesized inside -/// larger type expressions (`fn handler(cb: fn(Int) -> Int)`, -/// bootstrap algebra arrows like `add: fn(T, T) -> T`) via -/// `type_to_declaration_id`'s Arrow arm. -/// -/// 3. **Variant constructor signatures** synthesized by -/// `infer::resolve_direct_target_signature` for `Variant(payload)` -/// direct-construction calls (transient `ResolvedArrow`, never -/// stored in `Dag.declarations`). -/// -/// `decide_transform` treats `NoBody` identically to `Pending` -/// (signature inhabitance, body-walking skipped). The variant -/// distinction exists to make the substrate predicate -/// "`Arrow(Pending)` in the final Dag = R13-class regression" -/// structurally exact, with no `name`-based proxy in the lens. -/// -/// No dissolution trigger — terminal at the substrate level. -/// -/// - **`Unparsed`** — surface-grammar lag (**case 1**) and **case 2c** the -/// `pipeline.dag` **`compile`** orchestrator (ordering authority). Used at -/// M1(2.7) for block-bodied `fn foo(x) -> T { body }` declarations in std/ -/// files where the body contains match/pipe/lambda/ etc. **Parser note -/// (Prereq-2 / #1248):** authority `.dag` sources still surface these as -/// `SurfaceItem::FnExternalBody` (brace-skip) so bootstrap snapshots stay -/// stable; user `.v3` modules may surface `SurfaceItem::Fn` for single- -/// expression brace bodies instead. **`pipeline.dag` -/// per-stage fns (case 2a)** parse as `FnExternalBody` → `Unparsed`, then -/// bootstrap rewrites those Arrow bodies to `ExternalRealization` before -/// inference — so `Unparsed` does not persist for those stages in a -/// bootstrapped DAG. **`fn compile` (case 2c)** has no `PipelineStageBinding`: -/// **`Unparsed` persists** on its Arrow body. Pipeline **runtime** ordering -/// authority is the declaration order of the `PipelineStageBinding` records -/// in the Dag — `ordered_pipeline_stages` reads that structural order only. -/// The human-readable `compile` body remains a second **authored** surface; -/// fail-closed drift detection between it and the bindings is **suspended** -/// (PR #1171 disposition, 2026-04-29): the lowered Dag does not carry an -/// ordered stage list inside `compile`, and neither compile-time embed nor -/// runtime source-file read satisfies R3 `bridge_include_str_side_channels_retired` -/// for that check — see `pipeline_authority::ordered_pipeline_stages`. Until -/// derivation, review/regen discipline keeps the two carriers aligned. PR #637 -/// narrowed the prior body-span-as-authority shape; scheduled debt remains -/// (see `docs/history/roadmap-scheduled-deletions.md` case 2c). The signature -/// still flows forward through the -/// declaration table so callers can type-check against it, and the body -/// source span is preserved so M2+ parser extensions can reach in for case 1. -/// **User-range boundary:** `reject_user_unparsed_scaffolds` in -/// `src/v3/compiler/src/lower.rs` fails-closed any user-range -/// declaration carrying this variant (R14 + M1(2.8) Scaffold -/// Boundaries invariant). Bootstrap-range declarations stay -/// tolerated. **Case 1** dissolution: M2 surface-grammar extension — when -/// every relevant std/ block body becomes parseable, case-1 `Unparsed` is -/// removed via a reverse substrate-extension PR. **Case 2c** is not waiting on -/// that grammar milestone. -/// -/// Verdict: terminal form is 3 variants (`UserDefined`, -/// `ExternalRealization`, `NoBody`). The 5-variant shape is a -/// transition state: `Pending` and **case-1** `Unparsed` are scaffolds with -/// named dissolution (M3 / M2 grammar). **`Unparsed` on `pipeline.dag`'s -/// `compile` (DB-16 case 2c)** is different — a **bootstrap-range carrier -/// in bridge shape**: body span is no longer the ordering authority -/// (structural binding order is), but two authored carriers still exist until -/// derivation; runtime reconcile is suspended pending a structural witness, so -/// 2c remains scheduled debt with its own dissolution trigger (derivation, not the M2 parser -/// milestone). User-range -/// `Unparsed` stays gated (R14). -#[derive(Debug, Clone)] -pub enum ArrowBody { - /// User-defined function. BindNodeId is the root bind of a sub-DAG of L1 - /// behavior nodes in `Dag.nodes`. Inference walks the sub-DAG and checks - /// the body against the declared inputs/output. - UserDefined(BindNodeId), - /// Primitive whose realization is declared in an extdeps language spec. - /// DeclarationId points at the realization declaration via a typed edge; - /// inference verifies signature compatibility. - ExternalRealization(DeclarationId), - /// Transient "body to come." Signature type-checks via inhabitance; - /// body-walking is skipped. Two production sites write `Pending`: - /// - /// 1. `seed_function_signature` for `fn foo(x) -> T = body` - /// declarations — the initial substrate state before - /// `lower_fn_item` patches the body into `UserDefined(bind_id)`. - /// A final `Arrow(Pending)` surviving into the Dag is - /// structurally a missed body-patching path: the R13-class - /// regression `lens_structural_resolution` watches for. - /// 2. `infer::resolve_operator_arrow` for transient `ResolvedArrow` - /// fallback signatures (class-5 gap; never stored in - /// `Dag.declarations`, so the lens cannot see them). - /// - /// All "no body by construction" sites that earlier wrote `Pending` - /// (anonymous nested Arrows, type aliases, data items, variant - /// constructor synthesis) now write `NoBody` instead. - Pending, - /// Terminal "no body by construction." The Arrow signature exists but - /// the declaration carries no executable body and never will. Used at - /// every "Arrow-as-data" production site: - /// - /// - `lower_type_alias` / `lower_data_item` → `type_to_connective` - /// for named type aliases (`type Callback = fn(Int) -> Int`) and - /// data items. - /// - `type_to_declaration_id` for anonymous nested Arrow - /// declarations inside larger type expressions (parameter types, - /// field types, bootstrap algebra arrows). - /// - `infer::resolve_direct_target_signature` for variant - /// constructor `ResolvedArrow` synthesis (transient). - /// - /// `decide_transform` treats `NoBody` identically to `Pending` at - /// dispatch time (signature inhabitance, body-walking skipped). The - /// variant distinction exists so `lens_structural_resolution` can - /// match `Arrow(Pending)` directly as the structural fact for - /// "executable-fn body patching missed a path." - NoBody, - /// Surface-grammar scaffold. The arrow's signature is resolved and - /// callers can type-check against it, but the body source is not - /// yet parseable under the M1(2.7) surface grammar. Used by - /// block-bodied `fn` declarations in std/ files whose bodies - /// contain match/pipe/lambda/etc. The `SourceSpan` points at the - /// unparsed body range so M2+ can complete the lowering. - /// Dissolves when the surface grammar adopts those forms. - Unparsed(SourceSpan), -} - -// Port, port-reference carriers, and the non-trivial-arity list helpers -// live in `dag/ports.rs`. See re-exports at the top of this module. - -// Termination carriers for `src/v3/std/termination.dag`. -// -// The `.dag` declarations are the carrier authority. Gate -// `tier3_termination_mirror_dissolved` retired the public Rust mirror of the -// `DescentEvidence` lattice operations (`evidence_rank`, `merge_evidence`, -// `join_evidence`, `promote_to_strict`, `optional_evidence_meet`, and -// `map_evidence_merge_at`). The std declarations still preserve their -// `ArrowBody::Unparsed` spans in bootstrap; consumers must not add a second -// host-side executable copy while evaluator-backed std body execution lands. - -/// 🟢 TERMINAL at termination-proof scope. -/// -/// Rust mirror of the durable evidence lattice declared in -/// `src/v3/std/termination.dag`. -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -pub enum DescentEvidence { - Strict, - NonIncreasing, - DescentUnknown, -} - -/// 🟡 SCAFFOLD. -/// -/// Ranking dimensions are durable, but the `String` parameter bridge dissolves -/// once function parameters can be referenced structurally. -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum RankingDimension { - TreeSize { param: String }, - ListLength { param: String }, - ArithmeticValue { param: String }, - TokenPosition { param: String }, - SetCardinality { param: String }, -} - -/// 🟢 TERMINAL at descent-witness scope. -/// -/// Structural positive amount used so zero/negative shrink witnesses are not -/// representable in proof carriers. -#[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub enum PositiveDescentAmount { - OneStep, - AdditionalStep { - previous: Box, - }, -} - -/// Integer ≥ 2 — proportional-divisor witnesses for divide-and-conquer descent. -#[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub enum ProportionalDivisor { - DivideByTwo, - StrictlyLarger { inner: Box }, -} - -pub fn positive_descent_count(steps: &PositiveDescentAmount) -> i64 { - match steps { - PositiveDescentAmount::OneStep => 1, - PositiveDescentAmount::AdditionalStep { previous } => { - 1 + positive_descent_count(previous.as_ref()) - } - } -} - -pub fn proportional_divisor_to_int(d: &ProportionalDivisor) -> i64 { - match d { - ProportionalDivisor::DivideByTwo => 2, - ProportionalDivisor::StrictlyLarger { inner } => { - 1 + proportional_divisor_to_int(inner.as_ref()) - } - } -} - -/// Maximum Peano links materialized from a single `i64` literal (M9 / P4). -/// -/// Must stay numerically aligned with `dsl/std/termination.dag` -/// `peano_literal_materialization_cap()` (P2 single authority). Larger requests fail closed with -/// [`None`] instead of deep recursive materialization. -pub const MAX_PEANO_MATERIALIZATION: i64 = 256; - -/// Builds a Peano witness with **iterative** construction (no deep recursion). -/// Returns [`None`] when `k` is out of range or exceeds [`MAX_PEANO_MATERIALIZATION`]. -pub fn positive_amount_from_i64(k: i64) -> Option { - if !(1..=MAX_PEANO_MATERIALIZATION).contains(&k) { - return None; - } - let mut cur = PositiveDescentAmount::OneStep; - for _ in 1..k { - cur = PositiveDescentAmount::AdditionalStep { - previous: Box::new(cur), - }; - } - Some(cur) -} - -/// Iterative construction; `k` must be ≥ 2 and ≤ [`MAX_PEANO_MATERIALIZATION`]. -pub fn proportional_divisor_from_i64(k: i64) -> Option { - if !(2..=MAX_PEANO_MATERIALIZATION).contains(&k) { - return None; - } - let mut cur = ProportionalDivisor::DivideByTwo; - for _ in 2..k { - cur = ProportionalDivisor::StrictlyLarger { - inner: Box::new(cur), - }; - } - Some(cur) -} - -/// 🟡 SCAFFOLD. -/// -/// The witness taxonomy is durable for E-T; String payloads dissolve when -/// accessor, operation, witness, and element references become first-class -/// substrate values. -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum DescentSource { - ChildAccessor { accessor: String }, - ListShrink { amount: PositiveDescentAmount }, - ArithmeticSubtractDescent { steps: PositiveDescentAmount }, - ArithmeticDivideDescent { divisor: ProportionalDivisor }, - ParserAdvance { witness: String }, - SetRemoval { element: String }, - FoldIteration, -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub struct TerminationProof { - pub dimensions: Vec, -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub struct ProofEdge { - pub caller: String, - pub callee: String, - pub evidence: Vec, -} - -/// 🟢 TERMINAL at E-I inductive-shape scope. -/// -/// Runtime mirror of `std.induction::RecursionShape`: the closed partition of -/// recursive field wrappers in the .dag language. This mirrors the `.dag` -/// classification directly; adding a new recursive container type requires a -/// new authoritative `.dag` variant and matching mirror/test update. -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -pub enum RecursionShape { - DirectRecursion, - ListRecursion, - OptionalRecursion, - SetRecursion, - MapValueRecursion, -} - -/// Runtime mirror of `std.induction::InductiveField` for E-P provenance. -/// -/// Keep this aligned with `src/v3/std/induction.dag`: -/// - `type RecursionShape` -/// - `type InductiveField` -/// - `type SubValueRelation` -/// -/// 🟡 SCAFFOLD. String identity matches the current `.dag` carrier and dissolves -/// when reflected declaration/field references replace the string bridge. -#[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub struct InductiveField { - pub type_name: String, - pub variant_name: String, - pub field_name: String, - pub shape: RecursionShape, - pub element_type: String, -} - -/// Runtime mirror of `std.induction::SubValueRelation` for E-P provenance. -/// -/// 🟡 SCAFFOLD. The `.dag` type remains the authority; this mirror exists so the -/// native DAG lens can expose per-call evidence while std block bodies still -/// lower as `ArrowBody::Unparsed`. Dissolution trigger: generated/reflected -/// lens execution can construct `std.induction::SubValueRelation` directly. -#[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub enum SubValueRelation { - StrictSubValue { - field: InductiveField, - factor: ShrinkFactor, - }, - IteratedSubValue { - field: InductiveField, - }, - ArithmeticDescent { - param: String, - factor: ShrinkFactor, - }, - PreservedValue, - NonIncreasingValue, - StrictAxisErased, - MixedTop, - SubValueUnknown, -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub struct CallDescentEvidence { - pub call: NodeId, - pub caller: String, - pub callee: String, - pub evidence: Vec, -} - -/// E-P per-call descent evidence side table. -/// -/// This is option P-c from `docs/design-substrate-carrier-port-program.md`: keep -/// `TransformNode` minimal and derive a named side table from lowered call -/// structure. The producer emits one row per live callable transform and one -/// [`SubValueRelation`] per argument: [`SubValueRelation::ArithmeticDescent`], -/// structural [`SubValueRelation::StrictSubValue`] for match payload / -/// field-projection descents, [`SubValueRelation::PreservedValue`], and -/// fail-closed unknowns for edges whose descent cannot be proven from the -/// lowered graph. -pub fn per_call_descent_evidence(dag: &Dag) -> Vec { - let mut entries = Vec::new(); - - for caller_decl in dag.declarations() { - let Some(caller) = declaration_body_bind(dag, caller_decl) else { - continue; - }; - let caller_template = callable_target_template_for_provenance(dag, caller_decl.id); - let owned_transforms = bind_body_transform_ids(dag, caller); - - for transform in dag.nodes().iter().filter_map(Behavior::as_transform) { - if !owned_transforms.contains(&transform.id) { - continue; - } - let TransformTarget::Callable(target_decl) = transform.target else { - continue; - }; - let callee_template = callable_target_template_for_provenance(dag, target_decl); - let evidence = match (caller_template, callee_template) { - ( - CallableProvenance::Resolved(caller_template), - CallableProvenance::Resolved(callee_template), - ) if caller_template == callee_template => transform - .inputs - .iter() - .enumerate() - .map(|(idx, arg)| classify_call_argument(dag, caller, idx, *arg)) - .collect(), - (CallableProvenance::Resolved(_), CallableProvenance::Resolved(_)) => { - vec![SubValueRelation::SubValueUnknown; transform.inputs.len()] - } - (CallableProvenance::Resolved(_), CallableProvenance::Unresolved) - | (CallableProvenance::Unresolved, _) => { - vec![SubValueRelation::SubValueUnknown; transform.inputs.len()] - } - }; - entries.push(CallDescentEvidence { - call: transform.id, - caller: caller.name.clone(), - callee: callee_name_for_provenance(dag, target_decl, callee_template), - evidence, - }); - } - } - - entries -} - -/// E-P typed CallPattern query over the per-call evidence authority. -/// -/// This is the query surface named by the cost/complexity design docs. It -/// deliberately projects from [`per_call_descent_evidence`] instead of walking -/// call nodes independently, so producer broadening does not create a second -/// callable-edge authority. This first bounded broadening slice adds the -/// locally provable `PreservedValue -> SameArgumentCall` projection for -/// self-calls that pass their argument through unchanged. Existing -/// `SubValueRelation -> CallPattern` projections from `std.induction` remain -/// preserved here; multi-argument composition and lowered/lens consumers -/// remain separate E-P gates. -pub fn per_call_pattern_at(dag: &Dag, call_site: NodeId) -> Option { - per_call_pattern_and_descent_operand_index(dag, call_site).map(|(p, _)| p) -} - -/// Same projection as [`per_call_pattern_at`], plus the evidence index (crate-internal). -/// -/// Only [`per_call_descent_operand_port`] may publish substrate coupling to callers: -/// it maps this index through [`TransformNode::inputs`] on the `Dag`. Keeping the -/// index off the public API avoids consumers re-aligning evidence rows against a -/// stale parallel port list (P2). -fn per_call_pattern_and_descent_operand_index( - dag: &Dag, - call_site: NodeId, -) -> Option<(CallPattern, usize)> { - let entry = per_call_descent_evidence(dag) - .into_iter() - .find(|entry| entry.call == call_site)?; - call_pattern_from_relations_with_index(&entry.evidence) -} - -/// [`PortId`] for the [`TransformNode::inputs`] slot that carried the [`SubValueRelation`] -/// selected by [`per_call_pattern_at`]. -/// -/// `call_site` must identify a [`Behavior::Transform`] in `dag`; input ports are read from that -/// transform only (P2: no parallel list from the consumer that could desync from substrate). -/// -/// **`SameArgumentCall`:** returns [`None`]. Preserved-value rows classify as same-argument for the -/// [`CallPattern`] projection, but there is **no** arithmetic-descent witness — publishing an input -/// index would fabricate a descent operand (P3). -pub fn per_call_descent_operand_port(dag: &Dag, call_site: NodeId) -> Option { - let (pattern, idx) = per_call_pattern_and_descent_operand_index(dag, call_site)?; - if matches!(pattern, CallPattern::SameArgumentCall) { - return None; - } - let transform = dag.node_opt(&call_site).and_then(Behavior::as_transform)?; - transform.inputs.get(idx).copied() -} - -fn declaration_id_owning_bind_root(dag: &Dag, bind_node_id: NodeId) -> Option { - for decl in dag.declarations() { - let TypeConnective::Arrow { - body: ArrowBody::UserDefined(bind_id), - .. - } = &decl.connective - else { - continue; - }; - if bind_id.node_id() == bind_node_id { - return Some(decl.id); - } - } - None -} - -/// Collapses an accidental `ProductCost(Linear, Linear)` on **unary-parameter** binds when one -/// factor keys off the formal parameter port and the other keys off the **descent operand port** -/// for a **self-call** in this bind’s body — the same duplicate-induction artifact described in -/// gate **#78** (`iterate` multiplies loop-bound `Linear(param)` with `pattern_to_iter_bound` on the -/// descent wire; distinct `PortId`s, same chain). -/// -/// **Does not** collapse `Linear(param) × Linear(other)` from descent-port coincidence alone: -/// [`unary_bind_duplicate_iter_alias_evidence`] requires the same joint witness as `cost.dag` -/// (`Loop.source` iteration carrier × per-call `combine_iterate`) — a **param-sourced** [`LoopNode`] -/// whose **body** contains the self-call, and `other` is that call’s [`per_call_descent_operand_port`]. -/// -/// **Residual flow (why this exists):** `recursive_transform_cost` / `sum_costs_excluding_descent_operand` -/// already prevent double-counting **within** the recursive call’s operand list. They do **not** -/// merge the **outer** `LoopNode` bound (`linear_at(loop.source)`, usually the parameter port) with -/// the **inner** `pattern_to_iter_bound` keyed on `per_call_descent_operand_port` (the call’s input -/// port — a different `PortId` than the formal parameter). `iterate` in `algebra.dag` multiplies -/// those two `LinearCost` shells structurally, yielding a binary `ProductCost` that overstates the -/// asymptotic carrier until alias-aware folding exists in the algebra. -/// -/// **Soundness scope (P2 / modeling-discipline Practice 5):** This pass does **not** read provenance -/// bits inside [`SymbolicCost`] — it matches the **structural** coincidence `Product(Linear(param), -/// Linear(descent))` at a unary bind **result** port (`bind_value_port == BindNode::value`) together -/// with [`unary_bind_duplicate_iter_alias_evidence`] (joint self-call + descent operand port + -/// param-sourced loop envelope). That aligns with the **only** lens emission path for this product -/// shape in today’s `cost.dag` wiring for gate **#78** tail recursion (outer loop iterate × inner -/// recurrence). A future producer that introduced an **independent** multiplicative -/// `Linear(param) × Linear(other)` at the same port **without** that iterate-alias genesis would -/// require narrowing this pass or dissolving it into `.dag` algebra per the ROADMAP trigger below. -/// -/// **P5:** transitional host pass until dissolution — explicit ROADMAP row **“R3 gate #78 — unary-bind -/// `SymbolicCost` iterate alias collapse post-pass”** (`ROADMAP.md`, Post-merge debt 2026-05-08). -/// -/// **Bind resolution:** `bind_value_port` is the bind's **result** port (`entry_for` row port). The -/// helper scans [`Dag::nodes`] for the [`BindNode`] with [`BindNode::value`] equal to that port; in -/// the lowered substrate each port has a single producer, so at most one bind matches (same class of -/// uniqueness as other port-keyed walks — not a name table keyed off parallel string lists). -pub fn collapse_unary_bind_tail_iterate_linear_product_if_duplicate_induction( - dag: &Dag, - bind_value_port: PortId, - cost: SymbolicCost, -) -> SymbolicCost { - let Some(bind) = dag - .nodes() - .iter() - .find_map(|node| Behavior::as_bind(node).filter(|bind| bind.value == bind_value_port)) - else { - return cost; - }; - if bind.params.len() != 1 { - return cost; - } - let param = bind.params[0]; - - let SymbolicCost::ProductCost { _0: terms } = &cost else { - return cost; - }; - if !terms.rest.is_empty() { - return cost; - } - - match (terms.first.as_ref(), terms.second.as_ref()) { - (SymbolicCost::LinearCost { _0: va }, SymbolicCost::LinearCost { _0: vb }) => { - let non_param_port = if va.source_port == param && vb.source_port != param { - vb.source_port - } else if vb.source_port == param && va.source_port != param { - va.source_port - } else { - return cost; - }; - if !unary_bind_duplicate_iter_alias_evidence(dag, bind, param, non_param_port) { - return cost; - } - SymbolicCost::LinearCost { - _0: SizeVariable { - source_port: param, - display_name: None, - }, - } - } - _ => cost, - } -} - -// Tracked-bridge debt (R3 follow-up, T-Tier3-Dissolution): -// the inlined match below is the last hand-Rust residue of the -// `std.induction::sub_value_to_call_pattern` projection. The R3 gate -// `tier3_induction_mirror_dissolved` retired the public mirror surface -// (`sub_value_relation_to_call_pattern`) and the named private helper; -// fully routing this lookup through `std/induction.dag` requires -// `per_call_pattern_at` lens-emission to consume the .dag projection -// directly (substrate-tier work tracked under T-E-P-Producer-Broadening). -// Until that producer landing, the inlined match below is the bridge. -fn call_pattern_from_relations_with_index( - relations: &[SubValueRelation], -) -> Option<(CallPattern, usize)> { - let project = |relation: &SubValueRelation| -> Option { - match relation { - SubValueRelation::ArithmeticDescent { param, factor } => match factor { - ShrinkFactor::ConstantShrink { steps } => { - Some(CallPattern::ArithmeticSubtractCall { - steps: steps.clone(), - ring_param: param.clone(), - }) - } - ShrinkFactor::ProportionalShrink { divisor } => { - Some(CallPattern::ArithmeticDivideCall { - divisor: divisor.clone(), - ring_param: param.clone(), - }) - } - ShrinkFactor::UnitShrink => Some(CallPattern::ArithmeticSubtractCall { - steps: PositiveDescentAmount::OneStep, - ring_param: param.clone(), - }), - }, - SubValueRelation::StrictSubValue { field, .. } - | SubValueRelation::IteratedSubValue { field } => { - Some(CallPattern::ChildAccessorCall { - accessor: field.field_name.clone(), - }) - } - SubValueRelation::PreservedValue => Some(CallPattern::SameArgumentCall), - // Lawful non-structural inhabitants have no specific call pattern to project — - // same fail-closed posture as `SubValueUnknown` for downstream consumers; matches - // the dsl/std/induction.dag `sub_value_to_call_pattern` mapping for these arms. - SubValueRelation::NonIncreasingValue => None, - SubValueRelation::StrictAxisErased => None, - SubValueRelation::MixedTop => None, - SubValueRelation::SubValueUnknown => None, - } - }; - - for (i, relation) in relations.iter().enumerate() { - if matches!(relation, SubValueRelation::PreservedValue) { - continue; - } - if let Some(pattern) = project(relation) { - return Some((pattern, i)); - } - } - - if relations - .iter() - .any(|relation| matches!(relation, SubValueRelation::SubValueUnknown)) - { - return None; - } - - for (i, relation) in relations.iter().enumerate() { - if let Some(pattern) = project(relation) { - return Some((pattern, i)); - } - } - - None -} - -fn declaration_body_bind<'a>(dag: &'a Dag, decl: &Declaration) -> Option<&'a BindNode> { - // Use the lowered structural authority: function declarations point at - // their owning body bind through `ArrowBody::UserDefined`. - let TypeConnective::Arrow { - body: ArrowBody::UserDefined(bind_id), - .. - } = &decl.connective - else { - return None; - }; - Some((*bind_id).bind(dag)) -} - -/// Structural validation for authored `SectionRef::NodeScope` pairs: [`Dag::node_opt`] admits -/// `subject`, and either `subject` is `fn_decl`'s lowered [`ArrowBody::UserDefined`] root bind node -/// or it appears in that bind body's result subgraph (`collect_body_port` walk). Consumers must -/// fail closed on payloads that weld unrelated declarations and raw indices — silent collapse into -/// ordinary Lane‑2 observations is forbidden (`INVARIANTS.md` P2/P3). -pub(crate) fn node_scope_subject_within_arrow_declaration( - dag: &Dag, - fn_decl: DeclarationId, - subject: NodeId, -) -> bool { - if dag.node_opt(&subject).is_none() { - return false; - } - let Some(body_bind) = declaration_body_bind(dag, dag.declaration(fn_decl)) else { - return false; - }; - subject == body_bind.id || bind_body_reachable_nodes(dag, body_bind).contains(&subject) -} - -fn bind_body_transform_ids(dag: &Dag, bind: &BindNode) -> HashSet { - let mut transforms = HashSet::new(); - let mut visited_ports = HashSet::new(); - let mut visited_nodes = HashSet::new(); - collect_body_port( - dag, - bind.value, - &mut visited_ports, - &mut visited_nodes, - true, - &mut transforms, - ); - transforms -} - -fn bind_body_reachable_nodes(dag: &Dag, bind: &BindNode) -> HashSet { - let mut transforms = HashSet::new(); - let mut visited_ports = HashSet::new(); - let mut visited_nodes = HashSet::new(); - collect_body_port( - dag, - bind.value, - &mut visited_ports, - &mut visited_nodes, - false, - &mut transforms, - ); - visited_nodes -} - -/// True when `call_site` lies in the subgraph rooted at [`LoopNode::body`] for some [`LoopNode`] -/// in `bind`'s body whose [`LoopNode::source`] is the unary formal `param`. -/// -/// This is the spatial half of the gate **#78** duplicate-induction witness: `cost.dag` composes -/// `loop_cost` (`Linear(loop.source)`) with `combine_iterate` only along this lowered shape — so we -/// must not collapse param×descent products arising from unrelated linear work outside that loop -/// envelope. -fn self_call_under_param_bound_loop( - dag: &Dag, - bind: &BindNode, - param: PortId, - call_site: NodeId, -) -> bool { - for node_id in bind_body_reachable_nodes(dag, bind) { - let Some(Behavior::Loop(loop_node)) = dag.node_opt(&node_id) else { - continue; - }; - if loop_node.source != param { - continue; - } - let mut transforms = HashSet::new(); - let mut visited_ports = HashSet::new(); - let mut visited_nodes = HashSet::new(); - collect_body_node( - dag, - loop_node.body, - &mut visited_ports, - &mut visited_nodes, - false, - &mut transforms, - ); - if visited_nodes.contains(&call_site) { - return true; - } - } - false -} - -/// Joint structural witness for gate **#78** iterate-alias collapse: same owning declaration -/// self-call as [`per_call_descent_evidence`], `other_port` as [`per_call_descent_operand_port`], and -/// that call appears under a param-sourced loop body (links [`LoopNode::source`] with per-call -/// recurrence wiring — not descent-port coincidence alone). This is **not** "any self-call -/// anywhere": [`bind_body_transform_ids`] limits candidates to transforms in the bind body, and -/// [`self_call_under_param_bound_loop`] requires the call site to sit under a `Loop` whose -/// `source` is the unary `param`, matching the `loop_cost` × `combine_iterate` join that produced -/// the spurious `ProductCost` in the first place. -fn unary_bind_duplicate_iter_alias_evidence( - dag: &Dag, - bind: &BindNode, - param: PortId, - other_port: PortId, -) -> bool { - let Some(owning_decl) = declaration_id_owning_bind_root(dag, bind.id) else { - return false; - }; - let caller_template = callable_target_template_for_provenance(dag, owning_decl); - let CallableProvenance::Resolved(caller_tpl) = caller_template else { - return false; - }; - - for call_site in bind_body_transform_ids(dag, bind) { - let Some(transform) = dag.node_opt(&call_site).and_then(Behavior::as_transform) else { - continue; - }; - let TransformTarget::Callable(target_decl) = transform.target else { - continue; - }; - let callee_template = callable_target_template_for_provenance(dag, target_decl); - let CallableProvenance::Resolved(callee_tpl) = callee_template else { - continue; - }; - if caller_tpl != callee_tpl { - continue; - } - if per_call_descent_operand_port(dag, call_site) != Some(other_port) { - continue; - } - if self_call_under_param_bound_loop(dag, bind, param, call_site) { - return true; - } - } - false -} - -fn collect_body_port( - dag: &Dag, - port: PortId, - visited_ports: &mut HashSet, - visited_nodes: &mut HashSet, - record_transform_ids: bool, - transform_ids: &mut HashSet, -) { - if !visited_ports.insert(port) { - return; - } - let Some(producer) = dag.port_opt(&port).and_then(|p| p.produced_by) else { - return; - }; - collect_body_node( - dag, - producer, - visited_ports, - visited_nodes, - record_transform_ids, - transform_ids, - ); -} - -fn collect_body_node( - dag: &Dag, - node: NodeId, - visited_ports: &mut HashSet, - visited_nodes: &mut HashSet, - record_transform_ids: bool, - transform_ids: &mut HashSet, -) { - if !visited_nodes.insert(node) { - return; - } - let Some(behavior) = dag.node_opt(&node) else { - return; - }; - match behavior { - Behavior::Value(_) => {} - Behavior::Transform(transform) => { - if record_transform_ids { - transform_ids.insert(transform.id); - } - for input in &transform.inputs { - collect_body_port( - dag, - *input, - visited_ports, - visited_nodes, - record_transform_ids, - transform_ids, - ); - } - } - Behavior::Branch(branch) => { - collect_body_port( - dag, - branch.input, - visited_ports, - visited_nodes, - record_transform_ids, - transform_ids, - ); - for path in &branch.paths { - collect_body_node( - dag, - path.body, - visited_ports, - visited_nodes, - record_transform_ids, - transform_ids, - ); - collect_body_port( - dag, - path.output, - visited_ports, - visited_nodes, - record_transform_ids, - transform_ids, - ); - } - } - Behavior::Loop(loop_node) => { - collect_body_port( - dag, - loop_node.source, - visited_ports, - visited_nodes, - record_transform_ids, - transform_ids, - ); - collect_body_port( - dag, - loop_node.init, - visited_ports, - visited_nodes, - record_transform_ids, - transform_ids, - ); - if let Some(count) = loop_node.bound.count_port() { - collect_body_port( - dag, - count, - visited_ports, - visited_nodes, - record_transform_ids, - transform_ids, - ); - } - collect_body_node( - dag, - loop_node.body, - visited_ports, - visited_nodes, - record_transform_ids, - transform_ids, - ); - } - Behavior::Bind(inner) => { - // Local value binds are part of the current body graph. Function binds - // own a separate `ArrowBody::UserDefined` body and are scanned through - // their declaration, not through an enclosing span/body walk. - if inner.params.is_empty() { - collect_body_port( - dag, - inner.value, - visited_ports, - visited_nodes, - record_transform_ids, - transform_ids, - ); - } - } - } -} - -/// 🟢 TERMINAL private proof-state. -/// -/// Local E-P producer state: either callable template provenance was resolved -/// to a declaration, or it was not. This is not a substrate carrier; it keeps -/// the bounded instantiation peel fail-closed before emitting side-table facts. -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -enum CallableProvenance { - Resolved(DeclarationId), - Unresolved, -} - -const CALLABLE_PROVENANCE_TEMPLATE_DEPTH_LIMIT: usize = 16; - -fn callable_target_template_for_provenance( - dag: &Dag, - mut decl: DeclarationId, -) -> CallableProvenance { - // Bounded peel over materialized instantiations. Hitting the cap means the - // producer cannot prove self-vs-non-self provenance, so callers emit - // `SubValueUnknown` rather than silently dropping the call edge. - for _ in 0..CALLABLE_PROVENANCE_TEMPLATE_DEPTH_LIMIT { - match &dag.declaration(decl).connective { - TypeConnective::Instantiation { template, .. } => decl = *template, - _ => return CallableProvenance::Resolved(decl), - } - } - CallableProvenance::Unresolved -} - -fn callee_name_for_provenance( - dag: &Dag, - target: DeclarationId, - provenance: CallableProvenance, -) -> String { - let label = match provenance { - CallableProvenance::Resolved(template) => template, - CallableProvenance::Unresolved => target, - }; - dag.declaration(label) - .name - .clone() - .unwrap_or_else(|| format!("decl#{}", label.raw())) -} - -fn classify_call_argument( - dag: &Dag, - caller: &BindNode, - idx: usize, - arg: PortId, -) -> SubValueRelation { - let Some(param) = caller.params.get(idx).copied() else { - return SubValueRelation::SubValueUnknown; - }; - - if arg == param { - return SubValueRelation::PreservedValue; - } - - if let Some(relation) = arithmetic_descent_relation(dag, idx, param, arg) { - return relation; - } - - if let Some(relation) = match_payload_descent_relation(dag, param, arg) { - return relation; - } - - if let Some(relation) = match_payload_field_projection_descent_relation(dag, param, arg) { - return relation; - } - - SubValueRelation::SubValueUnknown -} - -/// Phase-1 broadening: classify recursive-call arguments that name a match-arm -/// payload binding whose scrutinee is the caller's parameter directly. The -/// surface shape this catches is the canonical positional cons-tail recursion: -/// -/// ```ignore -/// type List = Nil | Cons(List) -/// fn length(xs: List) -> Int = match xs { Cons(tail) => length(tail), Nil => 0 } -/// ``` -/// -/// The `tail` argument port equals the `Path.binding.payload_port` of a path -/// whose enclosing `BranchNode.input` is the parameter port. Field-projection -/// patterns (`Cons { tail }`) and transitive scrutinee tracing (scrutinee -/// reached through identity-ish nodes) are deferred to later slices — same -/// fail-closed discipline as the existing arithmetic slice (left-operand only, -/// integer literal only) keeps producer broadening incrementally provable. -/// -/// **Substrate-fact discipline.** `InductiveField` is consumer-facing -/// substrate provenance (cost / complexity lenses project this through -/// `std.induction::sub_value_to_call_pattern → ChildAccessorCall`; -/// the hand-Rust mirror has dissolved per gate `tier3_induction_mirror_dissolved`). -/// The producer therefore derives every field from authoritative DAG state: -/// - `type_name` / `variant_name` from the parent-Disj lookup of the variant -/// declaration the post-infer `resolve_branch_patterns` pass installed on -/// the path (`crate::infer::resolve_branch_patterns` — `BranchPattern::ResolvedVariant`). -/// - `field_name` from the variant `Conj`'s sole `_0` positional field -/// label, **not** from the user-chosen pattern binding name. The binding -/// name is a user-scope identifier (`Cons(tail) => length(tail)` and -/// `Cons(t) => length(t)` are structurally identical descents); using it -/// would publish an unstable accessor as substrate provenance. -/// - `element_type` from the resolved name of the variant's payload type. -/// -/// When any of those facts is unavailable — `UnresolvedVariant`, parent-Disj -/// lookup miss, multi-field variant Conj on a positional pattern, anonymous -/// payload type — the producer fails closed (`SubValueUnknown` upstream). -fn match_payload_descent_relation( - dag: &Dag, - param: PortId, - arg: PortId, -) -> Option { - for branch in dag.nodes().iter().filter_map(Behavior::as_branch) { - if !scrutinee_traces_to_param(dag, branch.input, param) { - continue; - } - for path in &branch.paths { - let Some(binding) = &path.binding else { - continue; - }; - if binding.payload_port != arg { - continue; - } - let facts = variant_structural_facts(dag, &path.pattern)?; - // Positional payload (`VariantWith`): variant Conj has exactly - // one `_0`-style field. Multi-field variants are - // `VariantFields` lowering territory (record-payload slice) and - // are outside this helper's positional-payload contract. - let [(field_name, payload_ty)] = facts.payload_fields.as_slice() else { - return None; - }; - let element_type = named_type_name(dag, *payload_ty)?; - return Some(SubValueRelation::StrictSubValue { - field: InductiveField { - type_name: facts.type_name, - variant_name: facts.variant_name, - field_name: field_name.clone(), - shape: RecursionShape::DirectRecursion, - element_type, - }, - factor: ShrinkFactor::UnitShrink, - }); - } - } - None -} - -/// Phase-1 broadening Slice 2: classify recursive-call arguments produced by -/// a single `FieldProject` transform whose input is the payload port of a -/// match arm whose scrutinee is the parameter directly. This is the -/// record-payload sibling of [`match_payload_descent_relation`]'s -/// positional-payload case. -/// -/// Surface shape: -/// -/// ```ignore -/// type EpRec = EpLeaf | EpNode { left: EpRec } -/// fn ep_depth(t: EpRec) -> Int = -/// match t { EpNode { left: l } => ep_depth(l), EpLeaf => 0 } -/// ``` -/// -/// `lower.rs` lowers `EpNode { left: l }` by allocating a payload binding -/// and synthesizing a `FieldProject { field_label: "left", .. }` transform -/// whose input is the payload port (see `lower_field_projection_from_port`). -/// The recursive call's argument is therefore the projection's output port, -/// not the payload port itself — Slice 1's direct-equality check misses it. -/// -/// Same fail-closed discipline + structural-fact derivation as Slice 1. -/// `field_name` here is the `FieldProject.field_label` — already structural, -/// established by the lowering, NOT a user-pattern-binding name. The label -/// must also appear in the variant's `Conj` children (validation; if not, the -/// projection isn't on this variant's payload). Cross-slice invariants -/// preserved: no new `CallPattern` variant, no `TransformNode` widening, -/// fail-closed discipline. -fn match_payload_field_projection_descent_relation( - dag: &Dag, - param: PortId, - arg: PortId, -) -> Option { - let Behavior::Transform(transform) = dag.resolve_producer_opt(&arg)? else { - return None; - }; - if transform.inputs.len() != 1 { - return None; - } - let projected_input = transform.inputs[0]; - - for branch in dag.nodes().iter().filter_map(Behavior::as_branch) { - if !scrutinee_traces_to_param(dag, branch.input, param) { - continue; - } - for path in &branch.paths { - let Some(binding) = &path.binding else { - continue; - }; - if binding.payload_port != projected_input { - continue; - } - let facts = variant_structural_facts(dag, &path.pattern)?; - let (field_name, payload_ty) = match &transform.target { - TransformTarget::UnresolvedFieldProject { field_label } => facts - .payload_fields - .iter() - .find(|(label, _)| label == field_label) - .map(|(label, ty)| (label.clone(), *ty))?, - TransformTarget::ResolvedFieldProject { field_label } => facts - .payload_fields - .iter() - .find(|(label, _)| label == field_label) - .map(|(label, ty)| (label.clone(), *ty))?, - _ => return None, - }; - let element_type = named_type_name(dag, payload_ty)?; - return Some(SubValueRelation::StrictSubValue { - field: InductiveField { - type_name: facts.type_name, - variant_name: facts.variant_name, - field_name, - shape: RecursionShape::DirectRecursion, - element_type, - }, - factor: ShrinkFactor::UnitShrink, - }); - } - } - None -} - -/// Phase-1 broadening Slice 3: bounded transitive trace from a match -/// scrutinee back to the caller's parameter port through nested-match -/// payload-binding chains. -/// -/// Surface shape this enables (sibling of Slices 1 + 2; the recursive call -/// is two structural peels away from the parameter): -/// -/// ```ignore -/// type EpListN = EpNilN | EpConsN(EpListN) -/// fn ep_count2(xs: EpListN) -> Int = -/// match xs { -/// EpConsN(t1) => match t1 { -/// EpConsN(t2) => ep_count2(t2), // arg traces param via nested match -/// EpNilN => 0 -/// }, -/// EpNilN => 0 -/// } -/// ``` -/// -/// The inner `Branch.input` is `t1` — a payload binding from the outer -/// match — not the parameter. Slices 1 / 2's direct -/// `branch.input == param` check rejects this; the tracer walks one or more -/// payload-binding levels to confirm structural descent before classifying. -/// -/// The trace is bounded by a fixed depth (`SCRUTINEE_TRACE_DEPTH_LIMIT`) -/// for the same reason `callable_target_template_for_provenance` bounds its -/// instantiation peel: hitting the cap means the producer can no longer -/// prove the structural relation, so the caller fails closed -/// (`SubValueUnknown` upstream). `StrictSubValue` is sound at any positive -/// depth — every level peels one constructor — so the helper does not -/// distinguish depth in its boolean answer. -const SCRUTINEE_TRACE_DEPTH_LIMIT: usize = 16; - -fn scrutinee_traces_to_param(dag: &Dag, scrutinee: PortId, param: PortId) -> bool { - let mut current = scrutinee; - for _ in 0..SCRUTINEE_TRACE_DEPTH_LIMIT { - if current == param { - return true; - } - // Walk one FieldProject indirection: record-payload variant patterns - // (`EpNodeN { left: a }`) bind the user-scope name to the OUTPUT - // port of a synthesized FieldProject whose input is the match arm's - // payload port (see `lower_field_projection_from_port`). When such - // a binding is itself an inner-match scrutinee, the tracer must - // peel the projection before climbing payload-binding chains. - if let Some(proj_input) = field_project_input_for_port(dag, current) { - current = proj_input; - continue; - } - if let Some(parent_input) = enclosing_branch_input_for_payload(dag, current) { - current = parent_input; - continue; - } - return false; - } - false -} - -/// If `port` is the output of a single-input `FieldProject` transform, -/// return the projected-from input port. Used by [`scrutinee_traces_to_param`] -/// to walk past variant-record-pattern FieldProject indirections. -fn field_project_input_for_port(dag: &Dag, port: PortId) -> Option { - let Behavior::Transform(transform) = dag.resolve_producer_opt(&port)? else { - return None; - }; - let (TransformTarget::UnresolvedFieldProject { .. } - | TransformTarget::ResolvedFieldProject { .. }) = &transform.target - else { - return None; - }; - if transform.inputs.len() != 1 { - return None; - } - Some(transform.inputs[0]) -} - -/// If `port` is the payload binding port of some `Path`, return the -/// enclosing `BranchNode.input`. Used by [`scrutinee_traces_to_param`] to -/// climb one nested-match level. `None` indicates the chain bottoms out -/// (port isn't a payload binding) — the tracer's fail-closed signal. -fn enclosing_branch_input_for_payload(dag: &Dag, port: PortId) -> Option { - dag.nodes() - .iter() - .filter_map(Behavior::as_branch) - .find_map(|b| { - b.paths.iter().find_map(|p| { - let binding = p.binding.as_ref()?; - if binding.payload_port == port { - Some(b.input) - } else { - None - } - }) - }) -} - -/// Authoritative variant-structural facts derived from a resolved variant -/// declaration. Returns `None` for `UnresolvedVariant` and for `ResolvedVariant` -/// whose parent `Disj` cannot be located by scanning declarations — same -/// fail-closed discipline as the rest of the per-call producer. -struct VariantStructuralFacts { - type_name: String, - variant_name: String, - payload_fields: Vec<(String, DeclarationId)>, -} - -fn variant_structural_facts(dag: &Dag, pattern: &BranchPattern) -> Option { - let variant_decl_id = match pattern { - BranchPattern::ResolvedVariant(id) => *id, - BranchPattern::UnresolvedVariant { .. } => return None, - }; - let (parent_decl, variants) = dag.declarations().iter().find_map(|decl| { - if let TypeConnective::Disj { variants } = &decl.connective { - if variants.iter().any(|f| f.ty == variant_decl_id) { - return Some((decl, variants)); - } - } - None - })?; - let type_name = parent_decl.name.clone()?; - let variant_name = variants - .iter() - .find(|f| f.ty == variant_decl_id) - .map(|f| f.label.clone())?; - let payload_fields = match &dag.declaration(variant_decl_id).connective { - TypeConnective::Conj { children } => children - .iter() - .map(|f| (f.label.clone(), f.ty)) - .collect::>(), - _ => return None, - }; - Some(VariantStructuralFacts { - type_name, - variant_name, - payload_fields, - }) -} - -/// Walk a declaration through `Instantiation` / structural-alias edges to a -/// named declaration. Returns `None` when the chain bottoms out without a name -/// (anonymous template fields, unresolved atoms, depth-limit hit). -fn named_type_name(dag: &Dag, mut current: DeclarationId) -> Option { - for _ in 0..CALLABLE_PROVENANCE_TEMPLATE_DEPTH_LIMIT { - let decl = dag.declaration(current); - if let Some(name) = &decl.name { - return Some(name.clone()); - } - match &decl.connective { - TypeConnective::Instantiation { template, .. } => current = *template, - _ => return None, - } - } - None -} - -fn arithmetic_descent_relation( - dag: &Dag, - idx: usize, - param: PortId, - arg: PortId, -) -> Option { - let Behavior::Transform(transform) = dag.resolve_producer_opt(&arg)? else { - return None; - }; - let TransformTarget::Operator(OperatorKind::Arithmetic(op)) = transform.target else { - return None; - }; - // First E-P slice recognizes the same left-operand convention as the v3 - // recursive termination gate: `param - k` and `param / k`, not `k - param`. - if transform.inputs.len() != 2 || transform.inputs[0] != param { - return None; - } - let literal = literal_int_at(dag, transform.inputs[1])?; - let factor = match op { - ArithmeticOp::Sub => ShrinkFactor::ConstantShrink { - steps: positive_amount_from_i64(literal)?, - }, - ArithmeticOp::Div => ShrinkFactor::ProportionalShrink { - divisor: proportional_divisor_from_i64(literal)?, - }, - ArithmeticOp::Add | ArithmeticOp::Mul => return None, - }; - Some(SubValueRelation::ArithmeticDescent { - param: ordinal_param_label(idx), - factor, - }) -} - -fn literal_int_at(dag: &Dag, port: PortId) -> Option { - let s = match dag.resolve_producer_opt(&port)? { - Behavior::Value(value) => match &value.data { - LiteralBits::Int(s) => s.as_str(), - _ => return None, - }, - _ => return None, - }; - s.parse().ok() -} - -/// 🟡 SCAFFOLD. `BindNode` currently carries parameter ports but not parameter -/// names, so the side table uses stable ordinal labels. Dissolves when E-P can -/// read reflected parameter names or when `SubValueRelation::ArithmeticDescent` -/// carries a structural `ParamRef`. -fn ordinal_param_label(idx: usize) -> String { - format!("param_{idx}") -} - -#[derive(Debug, Clone)] -pub struct ValueNode { - pub id: NodeId, - pub data: LiteralBits, - pub output: PortId, - pub span: SourceSpan, - /// Lane 2 Stage 2b: idempotency projection for this node. - /// - /// **Single authority:** the workflow fact lives only in this field (and the - /// analogous field on [`BindNode`]). There is no separate `Dag`-level map. - /// Reflected `ValueNode` / `BindNode` in `src/v3/std/substrate.dag` and - /// [`Dag::lane2_workflow_effect_at`] are read-only projections of the same - /// storage. The sole mutating constructor for tests/staging is - /// [`Dag::try_register_lane2_workflow_effect`]; lowering fills this field when - /// it exists. [`crate::analyze_workflow`] reads through - /// [`Dag::lane2_workflow_effect_at`]. - pub(crate) lane2_workflow: Option>, -} - -impl ValueNode { - pub fn result_port(&self) -> PortId { - self.output - } - - /// Reflected substrate optional `WorkflowEffect?`: unboxes staged storage so - /// Rust realization does not surface `Option>` at the - /// reflection boundary (`rust.dag` uses `AccessorMethod("lane2_workflow")`). - pub fn lane2_workflow(&self) -> Option<&WorkflowEffect> { - self.lane2_workflow.as_deref() - } -} - -/// Dispatch target of a `TransformNode`. Structural coproduct that -/// replaces the old single `target: DeclarationId` field. -/// -/// **🟡 Mixed-lifecycle coproduct — M1(2.7).** `Callable` is -/// terminal (the long-term shape for all user function calls and -/// resolved named declarations). `Operator` is a **scaffold** -/// with a named dissolution trigger: the M2+ parser / desugarer -/// replaces `SurfaceExpr::Operator` with direct algebra-field -/// `Call`s, and this variant disappears back into -/// `Callable(DeclarationId)`. Terminal form is 1 variant. -/// -/// **Dissolution receipt — Q3 + R9 operator dispatch.** Before -/// M1(2.7) the target was always a `DeclarationId` and primitive -/// operators were represented by an anonymous declaration whose -/// connective was `Atom(UnresolvedIdentifier("+"))`. Infer.rs then -/// string-matched the identifier payload to decide operator vs -/// callable. The string was the discriminator for a phase/job -/// coproduct hiding inside `UnresolvedIdentifier`. M1(2.7) split -/// the discriminator onto the `TransformTarget` variant itself, -/// and the operator walk in `infer::resolve_operator_arrow` reads -/// the operator's signature from the actual -/// `std/algebra.dag` field (e.g., `OrderedRing.add`) — the Rust -/// `OperatorKind` enum is only a lookup key, not a parallel -/// authority. -/// -/// 4-pattern check on (Callable, FieldProject, Operator): -/// - Pattern 1 (fact placement): fails. Callable dispatches via -/// the declaration's Arrow body; unresolved FieldProject dispatches -/// via the input port's resolved Conj + field label; Operator -/// dispatches via the operand type's algebra walk. -/// - Pattern 2 (variant-is-data): fails. Callable carries a -/// DeclarationId; resolved FieldProject carries the projected field -/// label resolved against the parent Conj; Operator carries an -/// OperatorKind. -/// - Pattern 3 (algebraic form): fails. -/// - Pattern 4 (dimensional): fails. -/// -/// Verdict: mixed lifecycle. `Callable` and `ResolvedFieldProject` -/// are terminal; `UnresolvedFieldProject` is pre-infer only. -/// `Operator` is 🟡 scaffold with an explicit M2+ dissolution -/// trigger (surface grammar adoption of direct algebra field -/// access or a parse-time desugaring pass). -#[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub enum TransformTarget { - /// A user function or resolved declaration. Inference walks the - /// referenced declaration's `Arrow` connective via `resolve_arrow`. - Callable(DeclarationId), - /// Pre-infer structural projection on a Conj-typed parent value. - /// Inference is the only authority allowed to turn this label into - /// a projected child declaration. - UnresolvedFieldProject { field_label: String }, - /// Post-infer structural projection. The field label is the single - /// authority; inference and emit resolve it against the parent Conj - /// so duplicate-typed fields cannot collapse to the same child id. - ResolvedFieldProject { field_label: String }, - /// A primitive binary operator. Inference dispatches on the - /// `OperatorKind` variant directly: arithmetic returns the operand - /// type, comparison returns Bool, and logical is Bool-monomorphic. - /// No declaration is allocated. - Operator(OperatorKind), -} - -#[derive(Debug, Clone)] -pub struct TransformNode { - pub id: NodeId, - /// The dispatch target of this transform. Either a user function / - /// resolved declaration (`Callable(DeclarationId)`) or a primitive - /// operator (`Operator(OperatorKind)`). Discriminated structurally, - /// not by a string payload. See `TransformTarget`. - pub target: TransformTarget, - pub inputs: Vec, - pub output: PortId, - pub span: SourceSpan, -} - -impl TransformNode { - pub fn result_port(&self) -> PortId { - self.output - } -} - -/// B4.3 — authority at lowering: user `match` Branch nodes, not `if` on Bool. -/// See [`BranchEmitParticipation`] and `INVARIANTS.md` P2 (no `span.file` as contract). -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum BranchEmitParticipation { - UserMatch, -} - -#[derive(Debug, Clone)] -pub struct BranchNode { - pub id: NodeId, - pub input: PortId, - pub paths: Vec, - pub output: PortId, - pub span: SourceSpan, - /// B4.3: `Some(UserMatch)` iff lowered from a surface `match` (not `if`). - pub(crate) emit_participation: Option, -} - -impl BranchNode { - pub fn result_port(&self) -> PortId { - self.output - } - - pub fn emit_participation(&self) -> Option { - self.emit_participation - } -} - -// Branch-pattern/path mirrors are generated from `std/substrate.dag`. -// The host keeps only the `Path.output` field rename plus impl behavior below. -include!("dag_branch_generated.rs"); - -impl Path { - pub fn result_port(&self) -> PortId { - self.output - } -} - -// ParamRef / TransformRef / ElementRef / BoolPortRef / -// NonEmptyList / NonSingletonList live in `dag/ports.rs`. See -// re-exports at the top of this module. - -// The `std.effects` mirror (DB-18 / Lane 2 Stage 2b) lives in -// `dag/effects.rs`. See re-exports at the top of this module. - -// ── end std.effects mirror (DB-18) ─────────────────────────────────── -// Cluster / loop-bound carriers below are Track 9 mutual-recursion -// witnesses — not part of the Lane 2 Stage 2b effects algebra. - -// Cluster/loop-bound mirrors are generated from `std/substrate.dag`; -// keep only host helper behavior in Rust. -include!("dag_cluster_generated.rs"); - -impl LoopBound { - pub fn count_port(&self) -> Option { - match self { - Self::Cardinality { count } => Some(*count), - Self::Descent { .. } => None, - } - } -} - -include!("dag_lookup_generated.rs"); - -include!("dag_cost_generated.rs"); - -#[derive(Debug, Clone)] -pub struct LoopNode { - pub id: NodeId, - pub source: PortId, - pub init: PortId, - pub body: NodeId, - pub bound: LoopBound, - pub output: PortId, - pub span: SourceSpan, -} - -impl LoopNode { - pub fn result_port(&self) -> PortId { - self.output - } -} - -/// B4.3 — authority at lowering: user `fn` and lambda `Arrow` body binds; not -/// refinement predicates, `let`, or builder-only Binds. See -/// `primitive_type_id_for_port_shared` and `INVARIANTS.md` P2. -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum BindEmitParticipation { - UserCallable, -} - -#[derive(Debug, Clone)] -pub struct BindNode { - pub id: NodeId, - pub name: String, - pub value: PortId, - /// Parameter ports for function bindings. Empty for value bindings. A - /// non-empty `params` is the structural distinction between a function - /// definition and a value definition — no Optional marker, no coproduct, - /// no type tag. See the C2 dissolution receipt at the top of this file. - pub params: Vec, - pub span: SourceSpan, - /// Lane 2 Stage 2b: idempotency projection for this bind — same authority as - /// [`ValueNode::lane2_workflow`] (see that comment: one native field, reflected - /// substrate + `lane2_workflow_effect_at`, writers via - /// [`Dag::try_register_lane2_workflow_effect`] or lowering). - pub(crate) lane2_workflow: Option>, - /// B4.3: set for user `fn` / lambda bodies that participate in named-type-alias - /// emission; `None` for refinement, `let`, and synthetic Binds. Same visibility - /// contract as [`Self::lane2_workflow`]: crate-private storage; reads go through - /// [`Self::emit_participation`]. - pub(crate) emit_participation: Option, -} - -impl BindNode { - /// Structural alias for `self.value`. `std/substrate.dag` names this - /// field `result_port` across all behavior variants; the Rust struct - /// kept the historical name `value` for BindNode only. `.dag`-generated - /// lenses read `bind.result_port` (see `lenses/complexity.dag` Bind - /// branch); hand-written Rust reads `bind.value` (see - /// `tests/m2_lens_cost_migration_test.rs`). This method is the single - /// point of agreement between the two. - pub fn result_port(&self) -> PortId { - self.value - } - - /// Reflected substrate optional `WorkflowEffect?` — same contract as - /// [`ValueNode::lane2_workflow`]. - pub fn lane2_workflow(&self) -> Option<&WorkflowEffect> { - self.lane2_workflow.as_deref() - } - - /// B4.3 emit authority: `Some(UserCallable)` iff this bind participates in the - /// named-type-alias emission path. Reflected in `src/v3/std/substrate.dag`; - /// writers are lowering / inference / `dag::builder` only. - pub fn emit_participation(&self) -> Option { - self.emit_participation - } -} - -// Checkpoint C1. -// -// Five L1 behaviors from docs/v3-spec.md lines 22-218. The thesis claim is that -// these are terminal — the irreducible decomposition of computation. M0 -// validated the claim; M1(2.5) did not add a 6th variant. -// -// Dissolution-patterns check (all four attempted at M0.1, preserved at M1(2.5)): -// -// - Pattern 1 (fact placement): fails. Every consumer dispatches on behavior -// first — cost adds for sequence, multiplies for Loop, maxes for Branch. -// - Pattern 2 (variant-is-data): fails. Value has `data`, Transform has -// `inputs + target`, Branch has `paths`, Loop has `bound + source + init + -// body`, Bind has `value + params`. Structurally different, not one shape -// with a tag. -// - Pattern 3 (algebraic-form): confirms terminality. -// Value = Terminal intro -// Transform= morphism application (Apply(DeclarationId)) -// Branch = Coproduct elim -// Loop = well-founded recursion -// Bind = let-abstraction (with params for function defs) -// - Pattern 4 (dimensional): fails. No common M-dim coordinate space generates -// all five. -// -// STOP SIGNAL: wanting a 6th variant. Pause and escalate rather than silently -// extending. -#[derive(Debug, Clone)] -pub enum Behavior { - Value(ValueNode), - Transform(TransformNode), - Branch(BranchNode), - Loop(LoopNode), - Bind(BindNode), -} - -/// Workflow-root identification — Rust mirror of -/// [`crate::dag::WorkflowRoot`]'s declaration in -/// `src/v3/std/substrate.dag`. -/// -/// 🟡 SCAFFOLD coproduct (mirroring the .dag receipt). The three arms -/// partition every legitimate `Dag` exactly once: -/// -/// - `SingleRoot(p)` — α (last topological `Bind`) selected `p`. -/// Emitted whenever the Dag contains at least one `Bind`; multiple -/// Binds are NOT ambiguous under α — linear `d.nodes` picks -/// exactly one last element by definition. -/// - `NoRoot` — zero `Bind` behaviors in `d.nodes`. Lens fold short- -/// circuits to `DimensionFail`; runtime evaluation rejects. -/// - `AmbiguousRoot { candidates }` — reserved for the future -/// enumerate-all-eligible-entries rule that R2-Evaluator's -/// `evaluate(program, entry, args)` consumes for multi-entry -/// programs (per Items 4+5 / #1176 §3.2). The α / γ "last X Bind" -/// rules cannot populate this arm; today's α implementation never -/// emits it. Carried as `NonSingletonList` to make the -/// pre-disambiguation 1-candidate case structurally -/// unrepresentable — `AmbiguousRoot` requires ≥2 candidates by -/// construction. -/// -/// Dissolution: γ refinement and the enumerate-all rule both reuse -/// this same partition behind the `workflow_root_port` accessor; no -/// carrier change required when those rules wire. -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum WorkflowRoot { - SingleRoot(PortId), - NoRoot, - AmbiguousRoot { - candidates: NonSingletonList, - }, -} - -impl Behavior { - pub fn id(&self) -> NodeId { - match self { - Behavior::Value(v) => v.id, - Behavior::Transform(t) => t.id, - Behavior::Branch(b) => b.id, - Behavior::Loop(l) => l.id, - Behavior::Bind(b) => b.id, - } - } - - pub fn span(&self) -> &SourceSpan { - match self { - Behavior::Value(v) => &v.span, - Behavior::Transform(t) => &t.span, - Behavior::Branch(b) => &b.span, - Behavior::Loop(l) => &l.span, - Behavior::Bind(b) => &b.span, - } - } - - pub fn as_value(&self) -> Option<&ValueNode> { - if let Behavior::Value(v) = self { - Some(v) - } else { - None - } - } - - pub fn as_transform(&self) -> Option<&TransformNode> { - if let Behavior::Transform(t) = self { - Some(t) - } else { - None - } - } - - pub fn as_branch(&self) -> Option<&BranchNode> { - if let Behavior::Branch(b) = self { - Some(b) - } else { - None - } - } - - pub fn as_loop(&self) -> Option<&LoopNode> { - if let Behavior::Loop(l) = self { - Some(l) - } else { - None - } - } - - pub fn as_bind(&self) -> Option<&BindNode> { - if let Behavior::Bind(b) = self { - Some(b) - } else { - None - } - } -} - -/// Substrate-level pointers to declarations that the compiler asks -/// about by role rather than by name. Populated at the end of -/// `bootstrap()` by `Dag::populate_primitive_cache` after every std/ -/// file has been lowered and cross-file stubs have been resolved. -/// Before that point every field is `None`. -/// -/// **Dissolution receipt.** The cache exists to remove per-call -/// `declaration_by_name("Int")` / `"Bool"` / `"String"` lookups from -/// the hot path. It is NOT a parallel authority — the -/// `DeclarationId`s it stores are already in `Dag.declarations`, and -/// the cache is a typed index over the same table. Adding a new role -/// to this cache is a C1-class stop signal: if the compiler wants to -/// ask "which declaration is the canonical X?", that question -/// belongs as a structural edge on the declaration, not as a role -/// slot here. The three roles cached today (the user-facing -/// primitives `Int`/`Bool`/`String`) are the substrate's built-in -/// roles and cannot dissolve into declaration-level edges because -/// they answer "which declaration is Int?" — a question about -/// *identity*, not *relationship*. -/// -/// **Round-10 correction.** Earlier revisions included a -/// `realization_meta` field pointing at a cached `Realization` -/// declaration. Production bootstrap doesn't load a `Realization` -/// declaration (realization facts live in `dsl/extdeps/languages/*` -/// per the thesis, not in the M1(2.7) std/ set), so the cache was -/// always `None` and the downstream `is_realization_shape` check -/// always failed. The check now validates structural shape (Conj + -/// `meta_tag.is_some()`) directly — no cache needed. -#[derive(Debug, Default, Clone)] -pub(crate) struct PrimitiveCache { - pub int: Option, - pub bool: Option, - pub string: Option, -} - -/// Substrate-marker handles populated at bootstrap end. Each field -/// resolves a marker declaration from `src/v3/spec/v3_l1.dag` to its -/// `DeclarationId`. The handles are the typed dispatch keys that -/// `lower_record_to_structural` and `emit_rust` use to recognize -/// behavior templates and the `DeclarationRef` sentinel meta-type -/// without round-tripping through string names. -/// -/// **Why this is not a name-bridge regression.** PrimitiveCache's -/// dissolution ledger says "adding a new role to this cache is a -/// C1-class stop signal." SubstrateMarkers is a separate cache for -/// a different category of role: not "which declaration is the -/// canonical X" (which the primitive cache answers for user-facing -/// types) but "which declaration is the structural marker for v3's -/// L1 behavior X" — a substrate-internal question that consumers -/// (lower, emit) need to answer at every dispatch site. The cache -/// turns those dispatch sites into typed `decl_id == cache.bind` -/// comparisons instead of `decl.name.as_deref() == Some("Bind")` -/// string matches. The name lookup happens once at bootstrap end -/// from the standard module path; every consumer downstream reads -/// the typed handle. -/// -/// **Why one cache per category.** Mixing "user primitive" and -/// "substrate marker" roles in a single cache would conflate two -/// distinct stability classes. Primitives change with v3's user- -/// facing type system; substrate markers change with v3's L1 -/// behavior set. Splitting the caches keeps each one's invariants -/// independent. -#[derive(Debug, Default, Clone)] -pub(crate) struct RealizationMetaCache { - /// `TypeRealization` meta-type. Declared in - /// `src/v3/spec/rust.dag` (and any future per-target spec - /// file) as the meta-tag for `data rust_*: TypeRealization - /// = { ... }` items. Cached typed handle so that consumers - /// like `emit_rust::RealizationIndexes::build` filter by - /// `meta_tag == Some(this)` without going through - /// `declaration_by_name("TypeRealization")` at hot-path - /// time. - pub type_realization: Option, - /// `OperatorRealization` meta-type. Same role as `type_realization` - /// for operator realizations. - pub operator_realization: Option, - /// `BehaviorRealization` meta-type. Same role for behavior - /// template realizations (Bind/Branch/Main). - pub behavior_realization: Option, - /// `CallableRealization` meta-type. Same role for callable - /// render strategies (currently staged std.list helpers). - pub callable_realization: Option, - /// `TypeInstantiationRealization` meta-type. Same role for - /// generic template carriers such as `List -> Vec`. - pub type_instantiation_realization: Option, - /// `PatternRealization` meta-type. Same role for carrier-specific - /// pattern lowering facts (currently staged `List -> Vec` - /// destructuring). - pub pattern_realization: Option, -} - -#[derive(Debug, Default, Clone)] -pub(crate) struct TargetSyntaxCache { - /// `rust_language` syntax bundle declaration loaded from - /// `src/v3/spec/rust.dag`. This is the target-language - /// authority the Rust emitter reads for expression/control-flow/ - /// function/type/value syntax templates. - pub rust_language: Option, - /// `rust_rendering` ownership-model declaration loaded from - /// `src/v3/spec/rust.dag`. This is the target-language - /// authority the Rust emitter reads for borrow-vs-construct - /// rendering policy at use sites. - pub rust_rendering: Option, - /// `rust_execution_model` declaration loaded from - /// `src/v3/spec/rust.dag`. Used by emitters to gate the - /// ownership stage on the target memory model. - pub rust_execution_model: Option, - /// `rust_source_filtering` declaration loaded from - /// `src/v3/spec/rust.dag`. - pub rust_source_filtering: Option, - /// `rust_execution_requirement` declaration loaded from - /// `src/v3/spec/rust.dag`. - pub rust_execution_requirement: Option, - /// `dag_model` declaration loaded from - /// `src/v3/std/computation_model.dag`. The source-side - /// computation-model fact the emitter reads alongside the - /// target execution model. - pub dag_model: Option, - /// `go_language` syntax bundle declaration loaded from - /// `src/v3/spec/go.dag`. - pub go_language: Option, - /// `go_execution_model` declaration loaded from - /// `src/v3/spec/go.dag`. - pub go_execution_model: Option, - /// `go_source_filtering` declaration loaded from - /// `src/v3/spec/go.dag`. - pub go_source_filtering: Option, - /// `go_execution_requirement` declaration loaded from - /// `src/v3/spec/go.dag`. - pub go_execution_requirement: Option, - /// `python_language` syntax bundle declaration loaded from - /// `src/v3/spec/python.dag`. - pub python_language: Option, - /// `python_target` execution-model declaration loaded from - /// `src/v3/spec/python.dag`. - pub python_target: Option, - /// `python_source_filtering` declaration loaded from - /// `src/v3/spec/python.dag`. - pub python_source_filtering: Option, - /// `python_execution_requirement` declaration loaded from - /// `src/v3/spec/python.dag`. - pub python_execution_requirement: Option, - /// Shared target-authority bindings scanned from - /// `TargetCleanEmissionBinding` data items. This is the single - /// cached bridge from `LanguageSpec` to `CleanEmissionContract`; - /// adding a new target extends the spec surface, not compiler - /// branches. - pub clean_emission_by_language: HashMap, -} - -/// Shared target-authority bundle tying one `LanguageSpec` -/// declaration to the `CleanEmissionContract` that governs how code -/// for that language must render. This keeps the pairing as a typed -/// carrier instead of asking downstream consumers to reconstruct it -/// from parallel per-target caches. -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub struct TargetSyntaxBundle { - pub language_spec: DeclarationId, - pub clean_emission_spec: DeclarationId, -} - -#[derive(Debug, Default, Clone)] -pub(crate) struct StdlibTypeCache { - /// `std.list.List` template declaration. Resolved once at - /// bootstrap end so downstream consumers compare typed - /// declaration ids instead of reconstructing stdlib identity - /// through `declaration_by_name("List")`. - pub list: Option, - /// The `Map = PartialFunction<…>` template head (`PartialFunction` in - /// `dsl/std`). The underlying record carries algebra `Arrow`+`NoBody` fields - /// for operations, not first-class `fn` **values** — emit must not recurse - /// the template in `decl_includes_first_class_arrow_data` the way it does - /// for a user `G` (PR #676). - pub partial_function: Option, -} - -/// Substrate declarations emitters used to resolve via -/// `declaration_by_name("...")` at call time. Populated once at -/// bootstrap end in [`Dag::populate_primitive_cache`]; downstream code -/// reads typed [`DeclarationId`] handles (ROADMAP P3 — name-keyed emit -/// lookups). -#[derive(Debug, Default, Clone)] -pub(crate) struct EmitAnchorCache { - /// `OrderedRing` algebra Conj — canonical fallback for operator fields. - pub ordered_ring: Option, - /// `AbelianGroup` algebra Conj — canonical authority for phantom-unit closure. - pub abelian_group: Option, - /// `SubstrateAccessorBinding` meta-type for substrate accessor data items. - pub substrate_accessor_binding: Option, - /// `Dag` graph type (`src/v3/std/substrate.dag`). - pub dag_type: Option, - /// `fold` from `src/v3/std/list.dag` (list catamorphism). - pub std_list_fold: Option, - /// `rust_functions` syntax record — resolved to the v3 spec copy in - /// `src/v3/spec/rust.dag` (bootstrap name resolution prefers `src/v3/` - /// over the duplicate carrier in `dsl/std/languages.dag`). - pub rust_functions: Option, - /// `MethodEmitTemplate` coproduct parent used to map a method-template - /// constructor id back to its variant label during target emission. - pub method_emit_template: Option, - /// `MethodTemplateContract` meta-type used by fold-method contract checks. - pub method_template_contract: Option, - /// `std.list.concat_method` method declaration. - pub concat_method: Option, - /// `std.list.length_method` method declaration. - pub length_method: Option, - /// `std.list.fold_method` method declaration. - pub fold_method: Option, - /// `std.list.is_empty_method` method declaration. - pub is_empty_method: Option, - /// `std.list.filter_method` method declaration. - pub filter_method: Option, - /// `std.list.flat_map_method` method declaration. - pub flat_map_method: Option, - /// `std.list.any_method` method declaration. - pub any_method: Option, - /// `std.list.all_method` method declaration. - pub all_method: Option, - /// `std.list.map_method` method declaration. - pub map_method: Option, -} - -#[derive(Debug, Default, Clone)] -pub(crate) struct PatternStrategyVariants { - pub vector_list: Option, -} - -#[derive(Debug, Default, Clone)] -pub(crate) struct FieldAccessVariants { - pub direct_field: Option, - pub accessor_method: Option, -} - -#[derive(Debug, Default, Clone)] -pub(crate) struct ParameterDispositionVariants { - pub borrowed: Option, - pub consumed: Option, -} - -#[derive(Debug, Default, Clone)] -pub(crate) struct MemoryModelVariants { - pub value_only: Option, - pub garbage_collected: Option, - pub ref_counted: Option, - pub ownership_based: Option, -} - -#[derive(Debug, Default, Clone)] -pub(crate) struct ScopeModelVariants { - pub lexical_scoping: Option, - pub dynamic_scoping: Option, -} - -#[derive(Debug, Default, Clone)] -pub(crate) struct ReadStrategyVariants { - pub borrow: Option, - pub pass_by_value: Option, -} - -#[derive(Debug, Default, Clone)] -pub(crate) struct ConstructStrategyVariants { - pub copy_or_clone: Option, - pub pass_by_value: Option, -} - -#[derive(Debug, Default, Clone)] -pub(crate) struct MutabilityVariants { - pub immutable: Option, - pub mutable: Option, -} - -#[derive(Debug, Default, Clone)] -pub(crate) struct PurityVariants { - pub pure: Option, - pub effectful: Option, -} - -#[derive(Debug, Default, Clone)] -pub(crate) struct StructureVariants { - pub explicit_dag: Option, - pub arbitrary: Option, -} - -#[derive(Debug, Default, Clone)] -pub(crate) struct IterationVariants { - pub bounded: Option, - pub unbounded: Option, -} - -/// Cached variant DeclarationIds for fixed emit-model coproducts. -/// Populated once at bootstrap end so emitters dispatch on typed -/// constructors instead of resolving parent/variant names at parse time. -#[derive(Debug, Default, Clone)] -pub(crate) struct EmitModelVariants { - pub pattern_strategy: PatternStrategyVariants, - pub field_access: FieldAccessVariants, - pub parameter_disposition: ParameterDispositionVariants, - pub memory_model: MemoryModelVariants, - pub scope_model: ScopeModelVariants, - pub read_strategy: ReadStrategyVariants, - pub construct_strategy: ConstructStrategyVariants, - pub mutability: MutabilityVariants, - pub purity: PurityVariants, - pub structure: StructureVariants, - pub iteration: IterationVariants, -} - -#[derive(Debug, Default, Clone)] -pub(crate) struct SubstrateMarkers { - /// `src/v3/spec/v3_l1.dag` `ValueBehavior` marker (L1 Value-shaped - /// behavior). Targets literals in target language realizations. - /// Bare `Value` is reserved for PB-Runtime union types, not this marker. - pub value: Option, - /// `Transform` marker. Targets generic transform-shaped - /// emissions (currently unused — operators dispatch via the - /// algebra field walk). - pub transform: Option, - /// `Branch` marker. Targets the per-target if/else template. - pub branch: Option, - /// `Loop` marker. Targets per-target loop emission templates - /// (M2+ once recursion lowers to Loop). - pub r#loop: Option, - /// `Bind` marker. Targets the per-target let-statement - /// template. - pub bind: Option, - /// `Main` marker. Targets the per-target program-entry-point - /// wrapper template. - pub main: Option, - /// `DeclarationRef` sentinel meta-type. When a record-literal - /// field's declared type walks to this declaration, the - /// lowerer accepts identifier / dotted-path expressions as the - /// field value and emits `FieldValue::Reference(decl_id)` - /// instead of `FieldValue::Literal(...)`. This is the - /// structural escape hatch that lets target spec files write - /// typed declaration references inside data bodies. - pub declaration_ref: Option, -} - -/// Typed handles for the four `PatternBindingRule` variants declared -/// in `src/v3/std/clean_emission.dag`. Populated at bootstrap end. -/// -/// Every per-target emitter (`emit_rust`, `emit_go`, future -/// `emit_python`) parses the `pattern_bindings` field of its -/// `CleanEmissionContract` by comparing the field's constructor id -/// against these handles. Caching once at bootstrap end is the -/// single bridge from the variant names in `clean_emission.dag` to -/// declaration ids; every consumer downstream dispatches on the -/// typed id. Without this cache, each emitter would re-resolve the -/// same four names on every contract parse — the exact anti-pattern -/// `feedback_substrate_principle_audit` Q5 calls out ("multiple -/// call sites independently reconstructing the same fact"). -#[derive(Debug, Default, Clone)] -pub(crate) struct PatternBindingRuleVariants { - /// `EmitBindingAlways` — the emitter always writes the binding, - /// even when the body does not consume it. Used by targets - /// whose native compilers do not warn on unused pattern - /// bindings. - pub emit_always: Option, - /// `EmitUnderscoreWhenUnused` — the emitter replaces the - /// binding name with `_` (Rust) or elides the binding - /// statement (Go) when the body does not consume it. - pub emit_underscore: Option, - /// `EmitPrefixedUnderscoreWhenUnused` — the emitter keeps the - /// binding but prefixes its name with `_` (Python-style). - pub emit_prefixed: Option, - /// `NotApplicablePatternBinding` — targets without structural - /// pattern matching (no variant applicable). - pub not_applicable: Option, -} - -/// Cached `VariantPayloadFieldAccessRule` variant DeclarationIds -/// resolved from `src/v3/std/clean_emission.dag`. Populated at -/// bootstrap end and consumed by emitters when parsing -/// `CleanEmissionContract.variant_payload_field_access`. -/// -/// Like `PatternBindingRuleVariants`, this central cache is the sole -/// bridge from `clean_emission.dag`'s variant labels to typed -/// `DeclarationId`s. That keeps the "how do target specs classify -/// variant-payload field access?" fact in one place instead of letting -/// three emitters re-resolve the same names independently (Q5 -/// construction authority). -#[derive(Debug, Default, Clone)] -pub(crate) struct VariantPayloadFieldAccessRuleVariants { - /// `AccessFromPayloadBinding` — the bound payload expression is a - /// whole carrier whose fields can be projected directly. - pub access_from_payload_binding: Option, - /// `OverrideNamedFieldsAtBindingSite` — named payload fields must - /// be broken into per-field bindings at the match site. - pub override_named_fields_at_binding_site: Option, -} - -/// Cached `VerifierOutputPolicy` variant DeclarationIds resolved -/// from `src/v3/std/clean_emission.dag`. Populated at bootstrap -/// end alongside `PatternBindingRuleVariants`. The -/// `post_emit_verifier` harness dispatches on the cached typed -/// ids when parsing `CleanEmissionContract.post_emit_verifier -/// .output_policy`. Lives here for the same §Layer opacity / -/// §Semantic authority reasons as `PatternBindingRuleVariants`: -/// compiler-side consumers must compare constructor -/// `DeclarationId`s, not variant label strings. -#[derive(Debug, Default, Clone)] -pub(crate) struct VerifierOutputPolicyVariants { - /// `IgnoreVerifierOutput` — the verdict hinges entirely on - /// `expected_exit_code`; stdout / stderr are informational. - pub ignore_output: Option, - /// `RequireEmptyStdout` — the declared verifier (e.g. `gofmt - /// -l`) reports dirty files on stdout while exiting 0, so - /// empty stdout is the load-bearing signal. - pub require_empty_stdout: Option, - /// `RequireEmptyStderr` — exit code and stdout are - /// informational; stderr carries the verdict. - pub require_empty_stderr: Option, - /// `RequireEmptyStdoutAndStderr` — both streams must be empty - /// in addition to the expected exit code. - pub require_empty_stdout_and_stderr: Option, -} - -/// Cached `CallableStrategy` variant DeclarationIds resolved from -/// `src/v3/std/emit_model.dag`. Populated at bootstrap end and -/// consumed by the shared Go emitter plus the Rust/Python target -/// emitters when parsing `CallableRealization.strategy`. -/// -/// This mirrors `PatternBindingRuleVariants`: one bootstrap-time -/// name walk through the Disj, then downstream consumers compare -/// typed `DeclarationId`s only. Without the cache, each emitter -/// re-resolves the same ten variant labels independently at parse -/// time, recreating the "multiple call sites reconstruct the same -/// fact" bridge. -#[derive(Debug, Default, Clone)] -pub(crate) struct CallableStrategyVariants { - pub list_empty: Option, - pub list_singleton: Option, - pub list_cons: Option, - pub list_concat: Option, - pub list_length: Option, - pub list_is_empty: Option, - pub list_fold: Option, - pub list_map: Option, - pub list_filter: Option, - pub list_contains: Option, -} - -#[derive(Debug, Clone)] -pub struct Dag { - /// Behaviors in construction order. NodeId(k) lives at `nodes[k]`; a forward - /// walk visits dependencies before dependents (load-bearing for inference). - nodes: Vec, - /// Declarations in allocation order. DeclarationId(k) lives at - /// `declarations[k]` by the same invariant. - declarations: Vec, - ports: HashMap, - diagnostics: DiagnosticTable, - next_node_id: u32, - next_declaration_id: u32, - next_port_id: u32, - /// Cached typed pointers to declarations the compiler asks about by - /// role. Populated at the end of `bootstrap()`; empty before then. - primitives: PrimitiveCache, - /// Cached substrate marker DeclarationIds resolved from - /// `dsl/std/v3_l1.dag`. Populated alongside the primitive - /// cache at bootstrap end. See `SubstrateMarkers` for the - /// rationale behind splitting markers from primitives. - substrate_markers: SubstrateMarkers, - /// Cached realization meta-type DeclarationIds resolved - /// from `src/v3/spec/rust.dag` (and other per-target spec - /// files). Populated at bootstrap end. Lets downstream - /// consumers like `emit_rust::RealizationIndexes::build` - /// filter by typed meta-tag handle instead of doing a name - /// lookup at hot-path time. - realization_metas: RealizationMetaCache, - /// Cached target-language syntax bundle declarations. - target_syntax: TargetSyntaxCache, - /// Cached stdlib type-template declarations. - stdlib_types: StdlibTypeCache, - /// Cached emit-time substrate anchors (operator fallback, accessors, - /// std list fold, Rust function-syntax bundle). - emit_anchors: EmitAnchorCache, - /// Cached `PatternBindingRule` variant DeclarationIds resolved - /// from `src/v3/std/clean_emission.dag`. Populated at bootstrap - /// end alongside `SubstrateMarkers` / `RealizationMetaCache`. - /// Every per-target emitter dispatches on the cached typed ids - /// when parsing its `CleanEmissionContract.pattern_bindings` - /// field — see `PatternBindingRuleVariants` for why one - /// central cache is the right shape instead of per-emitter - /// name lookups. - pattern_binding_rule_variants: PatternBindingRuleVariants, - /// Cached `VariantPayloadFieldAccessRule` variant DeclarationIds - /// resolved from `src/v3/std/clean_emission.dag`. Every emitter - /// reads these typed ids when parsing - /// `CleanEmissionContract.variant_payload_field_access`. - variant_payload_field_access_rule_variants: VariantPayloadFieldAccessRuleVariants, - /// Cached `VerifierOutputPolicy` variant DeclarationIds - /// resolved from `src/v3/std/clean_emission.dag`. The - /// `post_emit_verifier` harness dispatches on the cached typed - /// ids when parsing `CleanEmissionContract.post_emit_verifier - /// .output_policy` — same §Layer opacity shape as - /// `pattern_binding_rule_variants`. - verifier_output_policy_variants: VerifierOutputPolicyVariants, - /// Cached `CallableStrategy` variant DeclarationIds resolved - /// from `src/v3/std/emit_model.dag`. Consumed by the shared Go - /// emitter plus Rust/Python target emitters when parsing - /// `CallableRealization.strategy`. - callable_strategy_variants: CallableStrategyVariants, - /// Cached fixed emit-model coproduct variant DeclarationIds used by - /// emit target parsers. - emit_model_variants: EmitModelVariants, - /// Sidecar structural facts for mutually-recursive SCCs. - clusters: Vec, - /// Synthetic match carriers for anonymous `T?` cardinalities. Used when - /// inference needs stable `Some` / `None` variant identities without - /// promoting optionals into named top-level declarations. - optional_match_disjs: HashMap, - /// Exclusive lower bound on [`DeclarationId::raw`] for declarations - /// appended **after** embedded bootstrap fixture construction for this - /// `Dag`. Bootstrap rows use `raw() <` this value; runtime / user-phase - /// allocations use `raw() >=` this value (structural; do not infer from - /// `span.file`). `0` for [`Dag::empty`]; stamped when serving - /// [`Dag::new`] and sibling bootstrap snapshots. - declaration_append_begin_after_bootstrap: u32, -} - -/// Which committed `bootstrap_*_generated` snapshot shape [`Dag::finalize_runtime_bootstrap_from_generated_snapshot`] -/// is finalizing — drives extdeps-only asserts and pilot validation. -#[derive(Debug, Clone, Copy)] -pub(crate) enum RuntimeBootstrapFixtureKind { - /// `bootstrap_generated` / `bootstrap_generated_without_parse_surface`. - FullExtdepsPipelineSnapshot, - /// `bootstrap_std_generated` (std-only; no extdeps fixture-key assert / pilot walk). - StdOnlySnapshot, -} - -static BOOTSTRAPPED_DAG: LazyLock = LazyLock::new(|| { - let mut dag = bootstrap_generated::bootstrapped_fixture_dag(); - dag.finalize_runtime_bootstrap_from_generated_snapshot( - RuntimeBootstrapFixtureKind::FullExtdepsPipelineSnapshot, - ); - dag -}); - -// Generated bootstrap snapshots are performance caches over the checked-in -// `.dag` authorities, not independent authorities. `regen_bootstrap` is the -// sole writer and the PB-1 equivalence tests ratchet generated == runtime. -static BOOTSTRAPPED_STD_FIXTURE_DAG: LazyLock = LazyLock::new(|| { - let mut dag = bootstrap_std_generated::bootstrapped_std_fixture_dag(); - dag.finalize_runtime_bootstrap_from_generated_snapshot( - RuntimeBootstrapFixtureKind::StdOnlySnapshot, - ); - dag -}); - -static BOOTSTRAPPED_DAG_WITHOUT_PARSE_SURFACE_FIXTURE: LazyLock = LazyLock::new(|| { - let mut dag = - bootstrap_generated_without_parse_surface::bootstrapped_fixture_without_parse_surface_dag(); - dag.finalize_runtime_bootstrap_from_generated_snapshot( - RuntimeBootstrapFixtureKind::FullExtdepsPipelineSnapshot, - ); - dag -}); - -/// Typed result of a Bind-chain producer walk. Discriminates -/// **legitimate absence** (parameter port with no producer) from -/// **malformed-substrate** states (missing port, missing node, cyclic -/// Bind chain). INVARIANTS P3 fail-closed: consumers must not collapse -/// the malformed variants into the legitimate-absence path — see -/// `Dag::resolve_producer_opt` for the compat wrapper that does -/// collapse, and `lens_declaration_apply.rs::eligibility_walk_port` for the -/// canonical typed consumer. -pub enum ProducerLookup<'a> { - /// Legitimate: the port has no `produced_by` link (e.g., a - /// parameter port bound by the interpreter at evaluation time). - NoProducer, - /// A non-Bind producer reached after walking through any number of - /// Bind hops. - Found(&'a Behavior), - /// Malformed substrate: the `PortId` does not resolve in the DAG. - MissingPort { port: PortId }, - /// Malformed substrate: a `produced_by` link references a `NodeId` - /// that is not in the DAG. - MissingNode { producer: NodeId }, - /// Malformed substrate: a cycle was detected while walking the - /// Bind chain — the walk would not terminate. - BindCycle { detected_at: NodeId }, -} - -/// Verify-first upsert for native `lane2_workflow` storage on `Value`/`Bind`. -/// -/// **P5 Mechanism (b) — explicit deferral (PR #3923, work-item `adhoc-342cfea2-653`):** lane -/// **T-PB-A**, concrete row `_internal/ROADMAP_OPS.md` § **Nine lanes** / -/// `pb_hand_rust_at_shim_floor` (existing SG-0 non-test path -/// `src/v3/compiler/src/dag.rs`; amended INVARIANTS_OPS receipt row in same PR). Interim change: -/// fail-closed remediation of audit stray **S-register** — verify-first upsert per -/// `dsl/std/patterns.dag` canon (no silent overwrite). **SG-0:** no new census paths. Checkable -/// behavior: `try_register_lane2_workflow_effect_upserts_without_silent_overwrite` below. -fn upsert_lane2_workflow_on_node( - slot: &mut Option>, - workflow: WorkflowEffect, -) -> bool { - match slot.as_deref() { - None => { - *slot = Some(Box::new(workflow)); - true - } - Some(existing) if *existing == workflow => true, - Some(_) => false, - } -} - -impl Dag { - // Only `bootstrap_regen_fresh` constructs an empty Dag for regen; omitting - // that module without `bootstrap-regen-fresh` would otherwise trip `dead_code`. - // If a **default-feature** caller needs `empty()`, do not grow `allow(dead_code)` — - // revisit the PB-1-e regen-vs-runtime authority split instead. - #[cfg_attr(not(feature = "bootstrap-regen-fresh"), allow(dead_code))] - pub(crate) fn empty() -> Self { - Self { - nodes: Vec::new(), - declarations: Vec::new(), - ports: HashMap::new(), - diagnostics: DiagnosticTable::new(), - next_node_id: 0, - next_declaration_id: 0, - next_port_id: 0, - primitives: PrimitiveCache::default(), - substrate_markers: SubstrateMarkers::default(), - realization_metas: RealizationMetaCache::default(), - target_syntax: TargetSyntaxCache::default(), - stdlib_types: StdlibTypeCache::default(), - emit_anchors: EmitAnchorCache::default(), - pattern_binding_rule_variants: PatternBindingRuleVariants::default(), - variant_payload_field_access_rule_variants: - VariantPayloadFieldAccessRuleVariants::default(), - verifier_output_policy_variants: VerifierOutputPolicyVariants::default(), - callable_strategy_variants: CallableStrategyVariants::default(), - emit_model_variants: EmitModelVariants::default(), - clusters: Vec::new(), - optional_match_disjs: HashMap::new(), - declaration_append_begin_after_bootstrap: 0, - } - } - - pub fn new() -> Self { - (*BOOTSTRAPPED_DAG).clone() - } - - /// Declaration graph with **no** embedded bootstrap fixture. - /// - /// Cross-crate **tests** only (e.g. E-6 witnesses that compare bootstrap-full vs empty graphs). - /// Production paths must use [`Dag::new`]. - /// - /// Gated behind feature `empty-substrate-for-tests` so normal library builds do not expose a - /// public constructor for substrate-invalid empty graphs ([`Dag::new`] remains the production entry). - #[cfg(feature = "empty-substrate-for-tests")] - pub fn new_empty_for_testing() -> Self { - Self::empty() - } - - /// First [`DeclarationId::raw`] reserved for declarations appended after - /// embedded bootstrap construction. Values strictly below this bound index - /// bootstrap fixture rows; values at or above were allocated afterward - /// (user compile / lowering), without consulting `span.file`. - pub fn post_bootstrap_declaration_append_begin(&self) -> u32 { - self.declaration_append_begin_after_bootstrap - } - - /// `true` when `id` was allocated after bootstrap for this `Dag` (same - /// predicate as `id.raw() >= self.post_bootstrap_declaration_append_begin()`). - pub fn is_runtime_appended_declaration(&self, id: DeclarationId) -> bool { - id.raw() >= self.declaration_append_begin_after_bootstrap - } - - /// After embedding additional non-user fixtures (e.g. `complexity.dag` for T-LAS), - /// re-stamp the append boundary so those declarations are treated like bootstrap for - /// strict identifier / scaffold sweeps. - pub(crate) fn seal_prepended_authority_fixture_range(&mut self) { - self.stamp_declaration_append_begin_after_bootstrap(); - } - - fn stamp_declaration_append_begin_after_bootstrap(&mut self) { - self.declaration_append_begin_after_bootstrap = self.next_declaration_id; - } - - /// Invariant steps for every `Dag` materialized from a committed - /// `bootstrap_*_generated` snapshot before it is cached or cloned for - /// [`Dag::new`]. Centralizes bootstrap finalization so the append boundary - /// is not tied ad hoc to each `LazyLock` closure. - pub(crate) fn finalize_runtime_bootstrap_from_generated_snapshot( - &mut self, - kind: RuntimeBootstrapFixtureKind, - ) { - self.assert_user_defined_arrow_bodies_point_at_binds(); - if matches!( - kind, - RuntimeBootstrapFixtureKind::FullExtdepsPipelineSnapshot - ) { - assert_bootstrap_fixture_paths_match_regen_keys(self); - } - self.populate_primitive_cache(); - crate::bootstrap::ensure_kernel_bool_lane1e2b_bootstrap_witness(self); - if matches!( - kind, - RuntimeBootstrapFixtureKind::FullExtdepsPipelineSnapshot - ) { - crate::int_literal_ranges::validate_rust_grounding_integer_primitives(self); - } - self.stamp_declaration_append_begin_after_bootstrap(); - } - - fn assert_user_defined_arrow_bodies_point_at_binds(&self) { - for declaration in &self.declarations { - let TypeConnective::Arrow { - body: ArrowBody::UserDefined(bind_id), - .. - } = &declaration.connective - else { - continue; - }; - let node_id = bind_id.node_id(); - if !matches!(self.node_opt(&node_id), Some(Behavior::Bind(_))) { - let name = declaration.name.as_deref().unwrap_or(""); - panic!( - "generated bootstrap invariant violation: declaration {name:?} ({:?}) has \ - ArrowBody::UserDefined({node_id:?}), but that NodeId does not point at \ - Behavior::Bind", - declaration.id - ); - } - } - } - - /// Clone of the bootstrapped Dag used by [`crate::compile_parse_surface_std_authority_dag`]: - /// every fixture except `src/v3/std/parse_surface.dag`, so that file can be - /// parsed and lowered again without duplicate top-level names. - pub(crate) fn new_without_parse_surface_staged_fixture_bootstrap() -> Self { - (*BOOTSTRAPPED_DAG_WITHOUT_PARSE_SURFACE_FIXTURE).clone() - } - - pub(crate) fn std_fixture_bootstrap_snapshot() -> Self { - (*BOOTSTRAPPED_STD_FIXTURE_DAG).clone() - } - - /// Typed accessor for the cached `Int` primitive `TypeShape`. `None` - /// only when bootstrap failed to load `dsl/std/integer.dag` — a - /// diagnostic is already on `Dag.diagnostics` in that case and the - /// compile fails through the ordinary channel. - pub fn int_shape(&self) -> Option { - self.primitives.int - } - - /// Typed accessor for the cached `Bool` primitive `TypeShape`. Same - /// bootstrap-failure semantics as `int_shape`. - pub fn bool_shape(&self) -> Option { - self.primitives.bool - } - - /// Runtime/substrate Bool reification authority for branch dispatch. - /// - /// Bool remains a scalar [`LiteralBits::Bool`] for ordinary literal data, - /// comparisons, and spec fields. When a Bool value is used as a Branch - /// scrutinee, however, the runtime must compare against the same - /// declaration-id identity that inference resolved for `True` / `False` - /// patterns. This helper is the transitional single lookup point for that - /// reification. - /// - /// Retirement trigger: delete this helper once Bool runtime production is - /// uniformly represented as `VariantValue { tag: True/False, .. }` at the - /// producer boundary instead of at branch consumers. - pub fn bool_runtime_variant_id(&self, value: bool) -> Option { - let bool_decl = self.declaration_by_name("Bool")?; - let TypeConnective::Disj { variants } = &bool_decl.connective else { - return None; - }; - let label = if value { "True" } else { "False" }; - variants - .iter() - .find(|variant| variant.label == label) - .map(|variant| variant.ty) - } - - /// Typed accessor for the cached `String` primitive `TypeShape`. Same - /// bootstrap-failure semantics as `int_shape`. - pub fn string_shape(&self) -> Option { - self.primitives.string - } - - /// The std **scalar** `TypeShape` roots used to prune algebra / ring - /// `TypeConnective::Arrow` from the first-class-`fn` *data* walk in - /// `emit::rust_target` (`decl_includes_first_class_arrow_data` and related). - /// **Tied to** `Dag`’s `int` / `bool` / `string` fields in `primitives` — when a - /// new bootstrap primitive (e.g. `Float`) gains a `float_shape` accessor, extend - /// this to `[TypeShape; 4]` (or equivalent) in the same change as the emit - /// predicate so the allowlist cannot drift silently (PR #676, Opus review). - pub fn first_class_fn_walk_bootstrap_prune_type_shapes(&self) -> [TypeShape; 3] { - [ - self.int_shape() - .expect("bootstrap `Int` (dsl/std) required for this helper"), - self.bool_shape() - .expect("bootstrap `Bool` (dsl/std) required for this helper"), - self.string_shape() - .expect("bootstrap `String` (dsl/std) required for this helper"), - ] - } - - /// Typed accessor for the v3_l1 `Bind` marker. `None` only when - /// bootstrap failed to load `dsl/std/v3_l1.dag`. Used by emit - /// passes to look up the per-target Bind realization without a - /// name string. - pub fn bind_marker(&self) -> Option { - self.substrate_markers.bind - } - - /// Typed accessor for the v3_l1 `Branch` marker. Same bootstrap- - /// failure semantics as `bind_marker`. - pub fn branch_marker(&self) -> Option { - self.substrate_markers.branch - } - - /// Typed accessor for the v3_l1 `Loop` marker. Same bootstrap- - /// failure semantics as `bind_marker`. - pub fn loop_marker(&self) -> Option { - self.substrate_markers.r#loop - } - - /// Typed accessor for the v3_l1 `Transform` marker. Same - /// bootstrap-failure semantics as `bind_marker`. - pub fn transform_marker(&self) -> Option { - self.substrate_markers.transform - } - - /// Typed accessor for the v3_l1 `ValueBehavior` marker. Same bootstrap- - /// failure semantics as `bind_marker`. (Rust name `value_marker` is - /// stable; the underlying declaration is `ValueBehavior`, not bare `Value`.) - pub fn value_marker(&self) -> Option { - self.substrate_markers.value - } - - /// Typed accessor for the v3_l1 `Main` marker. Same bootstrap- - /// failure semantics as `bind_marker`. - pub fn main_marker(&self) -> Option { - self.substrate_markers.main - } - - /// Typed accessor for the `DeclarationRef` sentinel meta-type - /// declared in `src/v3/spec/v3_l1.dag`. Used by - /// `lower_record_to_structural` to recognize record-literal - /// fields whose declared type means "any declaration reference" - /// (and therefore accept identifier / dotted-path expressions - /// as field values instead of requiring scalar literals). - pub fn declaration_ref_marker(&self) -> Option { - self.substrate_markers.declaration_ref - } - - /// Typed accessor for the `TypeRealization` meta-type declared - /// in `src/v3/spec/rust.dag`. `None` only when bootstrap - /// failed to load the file. Used by - /// `emit_rust::RealizationIndexes::build` to filter declarations - /// by `meta_tag == Some(this)` without name lookup. - pub fn type_realization_meta(&self) -> Option { - self.realization_metas.type_realization - } - - /// Typed accessor for the `OperatorRealization` meta-type. - /// Same bootstrap-failure semantics as `type_realization_meta`. - pub fn operator_realization_meta(&self) -> Option { - self.realization_metas.operator_realization - } - - /// Typed accessor for the `BehaviorRealization` meta-type. - /// Same bootstrap-failure semantics as `type_realization_meta`. - pub fn behavior_realization_meta(&self) -> Option { - self.realization_metas.behavior_realization - } - - /// Typed accessor for the `CallableRealization` meta-type. - /// Same bootstrap-failure semantics as `type_realization_meta`. - pub fn callable_realization_meta(&self) -> Option { - self.realization_metas.callable_realization - } - - /// Typed accessor for the `TypeInstantiationRealization` - /// meta-type. Same bootstrap-failure semantics as - /// `type_realization_meta`. - pub fn type_instantiation_realization_meta(&self) -> Option { - self.realization_metas.type_instantiation_realization - } - - /// Same bootstrap-failure semantics as `type_realization_meta`. - pub fn pattern_realization_meta(&self) -> Option { - self.realization_metas.pattern_realization - } - - /// Typed accessor for the Rust target-language syntax bundle - /// declared in `src/v3/spec/rust.dag`. - pub fn rust_language_spec(&self) -> Option { - self.target_syntax.rust_language - } - - /// Typed accessor for the Rust target-language ownership model - /// declared in `src/v3/spec/rust.dag`. - pub fn rust_rendering_spec(&self) -> Option { - self.target_syntax.rust_rendering - } - - /// Typed accessor for the Rust `CleanEmissionContract` - /// declaration loaded from `src/v3/spec/rust.dag` (E-5). Callers - /// parse the structural fields via - /// `structural_fields_for_decl` and dispatch on the rule - /// variants. `None` before bootstrap completes or when the spec - /// file has been altered so the data item is missing — the - /// latter is a spec-file drift and surfaces at emit time as - /// `EmitError::MissingTargetSyntax`. - pub fn rust_clean_emission_spec(&self) -> Option { - self.rust_target_syntax_bundle() - .map(|bundle| bundle.clean_emission_spec) - } - - /// Typed accessor for the Rust target authority bundle pairing - /// `rust_language` with its `CleanEmissionContract`. - pub fn rust_target_syntax_bundle(&self) -> Option { - let language_spec = self.target_syntax.rust_language?; - Some(TargetSyntaxBundle { - language_spec, - clean_emission_spec: *self - .target_syntax - .clean_emission_by_language - .get(&language_spec)?, - }) - } - - /// Typed accessor for the Rust target execution model - /// declaration loaded from `src/v3/spec/rust.dag`. - pub fn rust_execution_model_spec(&self) -> Option { - self.target_syntax.rust_execution_model - } - - pub fn rust_source_filtering_spec(&self) -> Option { - self.target_syntax.rust_source_filtering - } - - pub fn rust_execution_requirement_spec(&self) -> Option { - self.target_syntax.rust_execution_requirement - } - - /// Typed accessor for the source computation-model declaration - /// declared in `src/v3/std/computation_model.dag`. - pub fn computation_model_spec(&self) -> Option { - self.target_syntax.dag_model - } - - /// Typed accessor for the Go target-language syntax bundle - /// declared in `src/v3/spec/go.dag`. - pub fn go_language_spec(&self) -> Option { - self.target_syntax.go_language - } - - /// Typed accessor for the Go target execution model - /// declaration loaded from `src/v3/spec/go.dag`. - pub fn go_execution_model_spec(&self) -> Option { - self.target_syntax.go_execution_model - } - - pub fn go_source_filtering_spec(&self) -> Option { - self.target_syntax.go_source_filtering - } - - pub fn go_execution_requirement_spec(&self) -> Option { - self.target_syntax.go_execution_requirement - } - - /// Typed accessor for the Go `CleanEmissionContract` - /// declaration loaded from `src/v3/spec/go.dag` (E-5 / Lane 1 - /// Stage 1c PR 2). Mirrors `rust_clean_emission_spec`; emitter - /// parses the structural fields and dispatches on the rule - /// variants. - pub fn go_clean_emission_spec(&self) -> Option { - self.go_target_syntax_bundle() - .map(|bundle| bundle.clean_emission_spec) - } - - /// Typed accessor for the Go target authority bundle pairing - /// `go_language` with its `CleanEmissionContract`. - pub fn go_target_syntax_bundle(&self) -> Option { - let language_spec = self.target_syntax.go_language?; - Some(TargetSyntaxBundle { - language_spec, - clean_emission_spec: *self - .target_syntax - .clean_emission_by_language - .get(&language_spec)?, - }) - } - - /// Typed accessor for the Python target-language syntax bundle - /// declared in `src/v3/spec/python.dag`. - pub fn python_language_spec(&self) -> Option { - self.target_syntax.python_language - } - - /// Typed accessor for the Python target execution model - /// declaration loaded from `src/v3/spec/python.dag`. - pub fn python_target_spec(&self) -> Option { - self.target_syntax.python_target - } - - pub fn python_source_filtering_spec(&self) -> Option { - self.target_syntax.python_source_filtering - } - - pub fn python_execution_requirement_spec(&self) -> Option { - self.target_syntax.python_execution_requirement - } - - /// Typed accessor for the Python `CleanEmissionContract` - /// declaration loaded from `src/v3/spec/python.dag` (E-5 / Lane - /// 1 Stage 1c PR 3). Mirrors `rust_clean_emission_spec` and - /// `go_clean_emission_spec`; emitter parses the structural - /// fields and dispatches on the rule variants. - pub fn python_clean_emission_spec(&self) -> Option { - self.python_target_syntax_bundle() - .map(|bundle| bundle.clean_emission_spec) - } - - /// Typed accessor for the Python target authority bundle pairing - /// `python_language` with its `CleanEmissionContract`. - pub fn python_target_syntax_bundle(&self) -> Option { - let language_spec = self.target_syntax.python_language?; - Some(TargetSyntaxBundle { - language_spec, - clean_emission_spec: *self - .target_syntax - .clean_emission_by_language - .get(&language_spec)?, - }) - } - - /// Shared target-authority lookup keyed by the target's - /// `LanguageSpec` declaration id. Consumers that already traffic - /// in the shared emit-model language surface should resolve the - /// language first, then ask for the corresponding target bundle - /// through this accessor rather than reconstructing the - /// `LanguageSpec -> CleanEmissionContract` pairing themselves. - pub fn target_syntax_bundle_for_language( - &self, - language_spec: DeclarationId, - ) -> Option { - Some(TargetSyntaxBundle { - language_spec, - clean_emission_spec: *self - .target_syntax - .clean_emission_by_language - .get(&language_spec)?, - }) - } - - /// Shared clean-emission lookup keyed by the target's - /// `LanguageSpec` declaration id. This is the - /// `TargetSyntaxBundle` projection for consumers that only need - /// the clean-emission side of the pair. - pub fn clean_emission_spec_for_language( - &self, - language_spec: DeclarationId, - ) -> Option { - self.target_syntax_bundle_for_language(language_spec) - .map(|bundle| bundle.clean_emission_spec) - } - - /// Typed accessor for the cached `std.list.List` template. - pub fn list_template(&self) -> Option { - self.stdlib_types.list - } - - /// The `Map` type constructor’s underlying `PartialFunction` record template - /// (`Map = Inst(PartialFunction, [K, V])` in `dsl/std`). See - /// [`Dag::list_template`]. - pub fn partial_function_template(&self) -> Option { - self.stdlib_types.partial_function - } - - /// Typed accessor for the canonical `OrderedRing` algebra declaration. - /// Used by emitters for operator-field fallback without per-call name lookup. - pub fn ordered_ring_decl(&self) -> Option { - self.emit_anchors.ordered_ring - } - - /// Typed accessor for the canonical `AbelianGroup` algebra declaration. - pub fn abelian_group_decl(&self) -> Option { - self.emit_anchors.abelian_group - } - - /// Meta-type declaration id for `SubstrateAccessorBinding` data items. - pub fn substrate_accessor_binding_meta(&self) -> Option { - self.emit_anchors.substrate_accessor_binding - } - - /// The substrate `Dag` graph type declaration id. - pub fn dag_type_decl(&self) -> Option { - self.emit_anchors.dag_type - } - - /// `std.list.fold` — list catamorphism callable declaration. - pub fn std_list_fold_decl(&self) -> Option { - self.emit_anchors.std_list_fold - } - - /// `rust_functions` syntax record from `src/v3/spec/rust.dag`. - pub fn rust_functions_syntax_decl(&self) -> Option { - self.emit_anchors.rust_functions - } - - /// `MethodEmitTemplate` coproduct parent. - pub(crate) fn method_emit_template_decl(&self) -> Option { - self.emit_anchors.method_emit_template - } - - /// `MethodTemplateContract` meta-type. - pub(crate) fn method_template_contract_decl(&self) -> Option { - self.emit_anchors.method_template_contract - } - - /// `fold_method` method declaration. - pub(crate) fn fold_method_decl(&self) -> Option { - self.emit_anchors.fold_method - } - - /// `concat_method` method declaration. - pub(crate) fn concat_method_decl(&self) -> Option { - self.emit_anchors.concat_method - } - - /// `length_method` method declaration. - pub(crate) fn length_method_decl(&self) -> Option { - self.emit_anchors.length_method - } - - /// `is_empty_method` method declaration. - pub(crate) fn is_empty_method_decl(&self) -> Option { - self.emit_anchors.is_empty_method - } - - /// `filter_method` method declaration. - pub(crate) fn filter_method_decl(&self) -> Option { - self.emit_anchors.filter_method - } - - /// `flat_map_method` method declaration. - pub(crate) fn flat_map_method_decl(&self) -> Option { - self.emit_anchors.flat_map_method - } - - /// `any_method` method declaration. - pub(crate) fn any_method_decl(&self) -> Option { - self.emit_anchors.any_method - } - - /// `all_method` method declaration. - pub(crate) fn all_method_decl(&self) -> Option { - self.emit_anchors.all_method - } - - /// `map_method` method declaration. - pub(crate) fn map_method_decl(&self) -> Option { - self.emit_anchors.map_method - } - - /// Typed accessor for the cached `PatternBindingRule` variant - /// handles resolved from `src/v3/std/clean_emission.dag` at - /// bootstrap end. Consumed by per-target emitters when - /// dispatching on their `CleanEmissionContract.pattern_bindings` - /// field — see `PatternBindingRuleVariants` for the rationale. - pub(crate) fn pattern_binding_rule_variants(&self) -> &PatternBindingRuleVariants { - &self.pattern_binding_rule_variants - } - - /// Typed accessor for the cached `VariantPayloadFieldAccessRule` - /// variant handles resolved from - /// `src/v3/std/clean_emission.dag`. Consumed by per-target - /// emitters when parsing - /// `CleanEmissionContract.variant_payload_field_access`. - pub(crate) fn variant_payload_field_access_rule_variants( - &self, - ) -> &VariantPayloadFieldAccessRuleVariants { - &self.variant_payload_field_access_rule_variants - } - - /// Typed accessor for the cached `VerifierOutputPolicy` variant - /// handles resolved from `src/v3/std/clean_emission.dag` at - /// bootstrap end. Consumed by the shared `post_emit_verifier` - /// harness when parsing - /// `CleanEmissionContract.post_emit_verifier.output_policy`. - pub(crate) fn verifier_output_policy_variants(&self) -> &VerifierOutputPolicyVariants { - &self.verifier_output_policy_variants - } - - /// Typed accessor for the cached `CallableStrategy` variant - /// handles resolved from `src/v3/std/emit_model.dag` at - /// bootstrap end. Consumed by emiters when parsing - /// `CallableRealization.strategy`. - pub(crate) fn callable_strategy_variants(&self) -> &CallableStrategyVariants { - &self.callable_strategy_variants - } - - /// Typed accessor for fixed emit-model coproduct variant handles. - pub(crate) fn emit_model_variants(&self) -> &EmitModelVariants { - &self.emit_model_variants - } - - pub fn nodes(&self) -> &[Behavior] { - &self.nodes - } - - pub fn nodes_owned(&self) -> Vec { - self.nodes.clone() - } - - pub fn declarations(&self) -> &[Declaration] { - &self.declarations - } - - pub fn declarations_owned(&self) -> Vec { - self.declarations.clone() - } - - pub fn ports(&self) -> Vec { - let mut ports: Vec = self.ports.values().cloned().collect(); - ports.sort_by_key(|port| port.id().raw()); - ports - } - - pub fn clusters(&self) -> &[Cluster] { - &self.clusters - } - - pub(crate) fn optional_match_disjs(&self) -> &HashMap { - &self.optional_match_disjs - } - - pub fn cluster(&self, id: ClusterId) -> &Cluster { - &self.clusters[id.index()] - } - - /// Upserts a [`WorkflowEffect`] on [`Behavior`] nodes at `root` (`Value` or - /// `Bind` only). Writes the same `lane2_workflow` field reflected in - /// `substrate.dag` for `ValueNode` / `BindNode`. - /// - /// **UPSERT semantics** (`dsl/std/patterns.dag` canon): verify-first on the - /// existing carrier; create-if-missing; no silent overwrite when a different - /// effect is already staged. Returns `false` if `root` is missing, not - /// `Value`/`Bind`, or an incompatible `lane2_workflow` is already present. - pub fn try_register_lane2_workflow_effect( - &mut self, - root: NodeId, - workflow: WorkflowEffect, - ) -> bool { - let Some(behavior) = self.nodes.get_mut(root.index()) else { - return false; - }; - match behavior { - Behavior::Value(v) => upsert_lane2_workflow_on_node(&mut v.lane2_workflow, workflow), - Behavior::Bind(b) => upsert_lane2_workflow_on_node(&mut b.lane2_workflow, workflow), - Behavior::Transform(_) | Behavior::Branch(_) | Behavior::Loop(_) => false, - } - } - - /// Takes `&NodeId` (not by value) so emitted Rust lens code and substrate - /// accessor carriers agree with `node_opt` / `port_opt` — transform inputs - /// render as borrows at the explicit boundary. - pub fn lane2_workflow_effect_at(&self, root: &NodeId) -> Option<&WorkflowEffect> { - match self.node_opt(root)? { - Behavior::Value(v) => v.lane2_workflow(), - Behavior::Bind(b) => b.lane2_workflow(), - Behavior::Transform(_) | Behavior::Branch(_) | Behavior::Loop(_) => None, - } - } - - /// Workflow-root accessor (Director-locked α implementation per - /// `docs/design-lens-fold-prerequisites.md` §"Prereq-3a"). Walks - /// `d.nodes` (which is topologically ordered) backwards and returns: - /// - /// - `WorkflowRoot::SingleRoot(p)` for the last `Behavior::Bind`'s - /// `result_port`, when at least one `Bind` exists. - /// - `WorkflowRoot::NoRoot` when zero `Bind` behaviors are present - /// (lens fold short-circuits to `DimensionFail`; runtime evaluation - /// rejects). - /// - `WorkflowRoot::AmbiguousRoot { .. }` is intentionally never - /// emitted by this α implementation — the linear `d.nodes` order - /// cannot tie. The variant is reserved at the type level for the - /// future enumerate-all-eligible-entries rule that R2-Evaluator's - /// `evaluate(program, entry, args)` consumes. - pub fn workflow_root_port(&self) -> WorkflowRoot { - for behavior in self.nodes.iter().rev() { - if let Behavior::Bind(b) = behavior { - return WorkflowRoot::SingleRoot(b.result_port()); - } - } - WorkflowRoot::NoRoot - } - - /// Node id of the last [`Behavior::Bind`] in this DAG (same reverse scan as [`Self::workflow_root_port`]). - /// - /// [`Dag::try_register_lane2_workflow_effect`] accepts [`Behavior::Value`] and [`Behavior::Bind`] - /// only. The workflow root **port**'s `produced_by` may be a [`Behavior::Loop`] or - /// [`Behavior::Transform`] (e.g. `std.list.fold` lowering); staging `lane2_workflow` must target - /// this **Bind shell** so registration cannot silently no-op while the sequential indicator still - /// reads `0`. - pub fn workflow_lane2_subject(&self) -> Option { - for behavior in self.nodes.iter().rev() { - if let Behavior::Bind(_) = behavior { - return Some(behavior.id()); - } - } - None - } - - pub fn optional_match_disj(&self, cardinality_decl_id: DeclarationId) -> Option { - self.optional_match_disjs.get(&cardinality_decl_id).copied() - } - - pub fn set_optional_match_disj( - &mut self, - cardinality_decl_id: DeclarationId, - disj_decl_id: DeclarationId, - ) { - self.optional_match_disjs - .insert(cardinality_decl_id, disj_decl_id); - } - - /// O(1) lookup by NodeId. Relies on the dense-sequential allocation invariant. - pub fn node(&self, id: NodeId) -> &Behavior { - let node = &self.nodes[id.index()]; - debug_assert_eq!( - node.id(), - id, - "Dag::node: NodeId desync — topological invariant broken" - ); - node - } - - /// Option-returning variant for the .dag substrate accessor - /// `node(d, id) -> Behavior?`. Same pattern as `port_opt`. - pub fn node_opt(&self, id: &NodeId) -> Option<&Behavior> { - self.nodes.get(id.index()) - } - - /// Producer walk for the .dag substrate accessor - /// Typed Bind-chain producer walk. See `ProducerLookup` for the - /// four discriminated outcomes; each malformed variant is a - /// substrate-integrity violation that consumers MUST handle - /// explicitly (do not collapse into `NoProducer`). - pub fn resolve_producer_lookup(&self, port_id: &PortId) -> ProducerLookup<'_> { - let bound = self.nodes.len(); - let mut current_port = *port_id; - let mut last_producer: Option = None; - for _ in 0..=bound { - let Some(port) = self.port_opt(¤t_port) else { - return ProducerLookup::MissingPort { port: current_port }; - }; - let Some(producer_id) = port.produced_by else { - return ProducerLookup::NoProducer; - }; - let Some(behavior) = self.node_opt(&producer_id) else { - return ProducerLookup::MissingNode { - producer: producer_id, - }; - }; - last_producer = Some(producer_id); - match behavior { - Behavior::Bind(bind) => { - current_port = bind.value; - continue; - } - _ => return ProducerLookup::Found(behavior), - } - } - // Walk exceeded `nodes.len()` hops — only possible on a cyclic - // Bind chain. Report the last Bind node visited. - ProducerLookup::BindCycle { - detected_at: last_producer.expect("walk visited at least one Bind"), - } - } - - /// Compat wrapper over `resolve_producer_lookup`: maps the typed - /// result to `Option<&Behavior>`, **collapsing** all malformed - /// states (`MissingPort`, `MissingNode`, `BindCycle`) into `None` - /// alongside legitimate `NoProducer`. Only use when malformed- - /// substrate equivalence to absence is the intended semantics - /// (e.g., callers that already wrap `None` in a fail-closed - /// diagnostic via `ok_or`); prefer `resolve_producer_lookup` when - /// the consumer must distinguish the five variants. - pub fn resolve_producer_opt(&self, port_id: &PortId) -> Option<&Behavior> { - match self.resolve_producer_lookup(port_id) { - ProducerLookup::Found(b) => Some(b), - ProducerLookup::NoProducer - | ProducerLookup::MissingPort { .. } - | ProducerLookup::MissingNode { .. } - | ProducerLookup::BindCycle { .. } => None, - } - } - - /// O(1) lookup by DeclarationId. Same dense-sequential invariant as nodes. - pub fn declaration(&self, id: DeclarationId) -> &Declaration { - let decl = &self.declarations[id.index()]; - debug_assert_eq!( - decl.id, id, - "Dag::declaration: DeclarationId desync — allocation invariant broken" - ); - decl - } - - /// Option-returning variant for the .dag substrate accessor - /// `declaration_by_id(d, id) -> Declaration?`. Same pattern as `node_opt` - /// / `port_opt`: permissive at the reflected-substrate boundary; C-8 - /// fail-closed is enforced at the lens consumer that treats `None` as a - /// substrate-integrity violation (valid ids can't legitimately miss). - pub fn declaration_opt(&self, id: &DeclarationId) -> Option<&Declaration> { - self.declarations.get(id.index()) - } - - /// **🟡 Scaffold — v3 migration preference rank.** Ranks declarations by - /// source-tree location so that same-named declarations in `src/v3/` win - /// over `dsl/` duplicates during the bootstrap window. This rule is a - /// ratified-parallel-authority pattern (P2 Boundary Discipline), kept - /// as a scaffold rather than deleted because the duplicates it resolves - /// carry v3-only content (`v3.std.substrate` imports, `ElementRef` / - /// `PortId` references, partitioned `EffectShape`, substrate-coupled - /// diagnostic surface) that cannot yet be hosted under `dsl/std/` — v2 - /// CI still recursively ingests `dsl/` and cannot parse v3 grammar. - /// - /// **Dissolution trigger.** When every module currently duplicated - /// between `dsl/std/` and `src/v3/std/` (or `src/v3/spec/`) has - /// converged to a single canonical home, delete this preference rule - /// and the mirrored policy in `lower.rs::collect_symbols`. After - /// convergence there must be no rank-based duplicate-authority bridge: - /// lookup either resolves against the single surviving authority or - /// fails closed on multiple matches. Convergence checklist tracked in - /// ROADMAP.md "Post-merge debt" under the file-preference scaffold row: - /// - `module std.effects` (`dsl/std/effects.dag` ↔ `src/v3/std/effects.dag`) - /// - `module std.verification` (`dsl/std/verification.dag` ↔ `src/v3/std/verification.dag`) - /// - embedded `http_path` mirror inside `src/v3/std/effects.dag:118-260` - /// - `module std.computation` (`dsl/std/computation.dag` ↔ `src/v3/std/computation.dag`) - /// - `module std.induction` (`dsl/std/induction.dag` ↔ `src/v3/std/induction.dag`) - /// - `module std.termination` (`dsl/std/termination.dag` ↔ `src/v3/std/termination.dag`) - fn declaration_name_preference_rank(file: &str) -> usize { - if file.starts_with("src/v3/") { - 2 - } else if file.starts_with("dsl/") { - 0 - } else { - 1 - } - } - - /// Find a top-level declaration by name. During the duplicate-authority - /// bootstrap window this applies the temporary preference scaffold: - /// `src/v3/` declarations outrank legacy `dsl/` duplicates; equal-rank - /// ties remain deterministic by scan order but are not a semantic rule. - /// - /// **The preference bias is a v3-migration scaffold**, not a durable - /// lookup policy — see `declaration_name_preference_rank` for the - /// dissolution trigger. Once duplicate `std.effects` / - /// `std.verification` authorities converge to a single home this - /// function should drop the rank-based bridge and require - /// single-authority lookup, failing closed on multiple matches. - /// - /// **Dissolution trigger.** Once duplicate authorities converge, - /// delete the preference scaffold and require single-authority - /// lookup; multiple surviving matches become a fail-closed error. - /// - /// **This scan only finds declarations that carry a surface- - /// visible name** — TypeParams, sum variants, and realization - /// scaffolds are allocated with `name: None` and are intentionally - /// unreachable here. Referring to a type parameter, variant - /// constructor, or realization instance by name outside its - /// parent's body is a compile error, not silent mis-resolution. - pub fn declaration_by_name(&self, name: &str) -> Option<&Declaration> { - self.declarations - .iter() - .filter(|d| d.name.as_deref() == Some(name)) - .max_by_key(|decl| { - ( - Self::declaration_name_preference_rank(&decl.span.file), - std::cmp::Reverse(decl.id.raw()), - ) - }) - } - - /// Typed accessor for the `rust_grounding_primitives` data declaration - /// from `dsl/extdeps/languages/rust/primitives.dag` (path authorized by - /// B4.4 `bootstrap_fixture_authority` and the regen host's - /// `BOOTSTRAP_FIXTURE_PATH_KEYS` filter over `EXTDEPS_FILES`). Returns the - /// top-level `List` declaration whose *type* the - /// target-grounding engine walks structurally (`RustPrimitive = - /// IntegerPrimitive | NonIntegerPrimitive {target_name, algebra, - /// carrier, is_copy[, overflow]}`). - /// - /// **Path 2 satisfaction.** The returned declaration's `value_body` - /// is `ValueBody::List(_)`, so both the sum type shape and the - /// 10-element pilot enumeration are structurally walkable. Map-shaped - /// bootstrap data such as `kernel_algebra_profile` now lowers through - /// `ValueBody::Map`; the remaining debt is retiring Rust mirrors that - /// still read those maps through hand-authored accessors. - /// - /// Returns `None` only when bootstrap failed to load - /// `rust/primitives.dag`, in which case a diagnostic is already on - /// `Dag.diagnostics`. - pub fn rust_grounding_primitives(&self) -> Option<&Declaration> { - self.declaration_by_name("rust_grounding_primitives") - } - - /// Typed accessor for `data kernel_algebra_profile` in - /// `dsl/std/algebra.dag`. - /// - /// This is the v3-side substrate authority for kernel algebra enrichment: - /// the map is lowered as [`ValueBody::Map`], keys are kernel type names, - /// and values are zero-payload `AlgebraProfile` variants. Returning `None` - /// means either the key is absent or the lowered declaration is malformed; - /// callers treat both as "no kernel algebra profile for this type". - pub fn kernel_algebra_profile(&self, type_name: &str) -> Option { - let decl = self.declaration_by_name("kernel_algebra_profile")?; - let ValueBody::Map(entries) = decl.value_body.as_ref()? else { - return None; - }; - let (_, value) = entries.entries().iter().find(|(key, _)| key == type_name)?; - self.algebra_profile_from_field_value(value) - } - - fn algebra_profile_from_field_value(&self, value: &FieldValue) -> Option { - let FieldValue::Variant { - constructor, - payload, - } = value - else { - return None; - }; - if !payload.is_empty() { - return None; - } - - let profile_decl = self.declaration_by_name("AlgebraProfile")?; - let TypeConnective::Disj { variants } = &profile_decl.connective else { - return None; - }; - let label = variants - .iter() - .find(|variant| variant.ty == *constructor)? - .label - .as_str(); - match label { - "OrderedRingProfile" => Some(AlgebraProfile::OrderedRingProfile), - "ApproximateFieldProfile" => Some(AlgebraProfile::ApproximateFieldProfile), - "BooleanAlgebraProfile" => Some(AlgebraProfile::BooleanAlgebraProfile), - "BooleanAlgebraCollectionProfile" => { - Some(AlgebraProfile::BooleanAlgebraCollectionProfile) - } - "FreeMonoidScalarProfile" => Some(AlgebraProfile::FreeMonoidScalarProfile), - "FreeMonoidCollectionProfile" => Some(AlgebraProfile::FreeMonoidCollectionProfile), - "PartialFunctionProfile" => Some(AlgebraProfile::PartialFunctionProfile), - _ => None, - } - } - - /// Virtual paths from the B4.4 extdeps-bootstrap fixture carrier - /// (`bootstrap_fixture_authority` in - /// `src/v3/std/extdeps_bootstrap_fixtures.dag`), in the order fields - /// appear on the lowered `ValueBody::Structural` body. - /// - /// Returns `None` if the declaration is missing, has no structural body, or - /// any fixture slot fails shape checks. Returns `Some` even when the product - /// has zero fields (degenerate); callers that require a non-empty set should - /// assert separately. - /// - /// Used to keep the regen host's `BOOTSTRAP_FIXTURE_PATH_KEYS` filter - /// aligned with the substrate declaration (compared in this module's bootstrap - /// `LazyLock` initializers). - pub fn bootstrap_fixture_virtual_paths(&self) -> Option> { - let decl = self.declaration_by_name("bootstrap_fixture_authority")?; - let body = decl.value_body.as_ref()?; - let ValueBody::Structural { fields } = body else { - return None; - }; - let mut out = Vec::with_capacity(fields.len()); - for (_slot, fv) in fields { - out.push(extdeps_fixture_entry_virtual_path(fv)?); - } - Some(out) - } - - /// DB-10 (3a.2): read the compile-time value body attached to a - /// declaration. Returns `None` for declarations without a - /// value body (type aliases, bare type declarations, function - /// declarations); returns `Some(&ValueBody)` for every `data` - /// declaration — including `ValueBody::Unparsed` scaffolds - /// whose body shape wasn't recognizable. Consumers that need - /// an inhabitance-checked body must match on the variant - /// directly and handle `Unparsed` explicitly; this accessor - /// does not filter scaffolds. - /// - /// Used by dotted-path lowering (to inline record-field values - /// at use sites) and by any future emission-time consumer that - /// wants to render a declared constant directly. - pub fn data_value_at(&self, id: DeclarationId) -> Option<&ValueBody> { - self.declaration(id).value_body.as_ref() - } - - pub fn port(&self, id: PortId) -> &Port { - self.ports.get(&id).expect("PortId not in dag") - } - - /// Option-returning variant for the .dag substrate accessor - /// `port(d, id) -> DagPort?`. DB-14 wires this to the generated - /// Rust via a carrier template; callers that need fail-closed - /// carriers use this instead of `port`. - pub fn port_opt(&self, id: &PortId) -> Option<&Port> { - self.ports.get(id) - } - - pub fn all_ports(&self) -> impl Iterator { - self.ports.values() - } - - pub fn diagnostics(&self) -> &DiagnosticTable { - &self.diagnostics - } - - // --- crate-private mutators: construction + inference --- - - pub(crate) fn alloc_node_id(&mut self) -> NodeId { - let id = NodeId(self.next_node_id); - self.next_node_id += 1; - id - } - - pub(crate) fn alloc_declaration_id(&mut self) -> DeclarationId { - let id = DeclarationId(self.next_declaration_id); - self.next_declaration_id += 1; - id - } - - pub(crate) fn alloc_port(&mut self, produced_by: Option) -> PortId { - let id = PortId(self.next_port_id); - self.next_port_id += 1; - self.ports.insert( - id, - Port { - id, - state: PortState::Uninferred, - produced_by, - }, - ); - id - } - - pub(crate) fn push_node(&mut self, behavior: Behavior) { - debug_assert_eq!( - behavior.id().index(), - self.nodes.len(), - "push_node out of sequence — topological invariant broken" - ); - self.nodes.push(behavior); - } - - pub(crate) fn push_cluster(&mut self, cluster: Cluster) -> ClusterId { - let id = ClusterId(self.clusters.len() as u32); - self.clusters.push(cluster); - id - } - - /// Mutable access to the computation-graph node vector. Scoped to - /// the post-infer pattern resolution pass that rewrites - /// `BranchPattern::UnresolvedVariant` entries into - /// `ResolvedVariant(DeclarationId)` — a localized structural - /// update, not a general mutation channel. - pub(crate) fn nodes_mut(&mut self) -> &mut [Behavior] { - &mut self.nodes - } - - pub(crate) fn push_declaration(&mut self, declaration: Declaration) { - debug_assert_eq!( - declaration.id.index(), - self.declarations.len(), - "push_declaration out of sequence — allocation invariant broken" - ); - self.declarations.push(declaration); - } - - /// Mutable access to a declaration, scoped to lowering's second pass where - /// Identifier atoms get their `resolved: Some(_)` slot filled in. No - /// external mutator; resolution is an internal phase of lowering. - pub(crate) fn declaration_mut(&mut self, id: DeclarationId) -> &mut Declaration { - &mut self.declarations[id.index()] - } - - pub(crate) fn patch_bind_value(&mut self, bind_id: NodeId, value: PortId) { - let Some(Behavior::Bind(bind_node)) = self.nodes.get_mut(bind_id.index()) else { - return; - }; - bind_node.value = value; - } - - pub(crate) fn set_port_producer(&mut self, port: PortId, produced_by: Option) { - let Some(existing) = self.ports.get_mut(&port) else { - return; - }; - existing.produced_by = produced_by; - } - - /// Transition a port from Uninferred to Resolved. Idempotent when the new - /// type matches the existing Resolved type. Skips Unresolved ports — once - /// Unresolved, stays so (otherwise the biconditional breaks). - pub(crate) fn set_port_type(&mut self, id: PortId, ty: TypeShape) { - if let Some(port) = self.ports.get_mut(&id) { - if matches!(port.state, PortState::Unresolved) { - return; - } - port.state = PortState::Resolved(ty); - } - } - - /// Enforced public API for transitioning a port to Unresolved. Atomically: - /// marks the port AND records the diagnostic. There is NO other way to - /// construct an Unresolved port state. - /// - /// Biconditional invariant, held by construction: - /// port.state == Unresolved iff diagnostics.contains(port_id) - pub(crate) fn mark_unresolved(&mut self, port: PortId, diagnostic: Diagnostic) { - self.mark_unresolved_with_attribution( - port, - diagnostic, - DiagnosticAttribution::Unattributed, - ); - } - - /// `mark_unresolved` carrying an explicit - /// [`DiagnosticAttribution`]. The diagnostic is recorded against - /// the same fail-closed biconditional as ordinary - /// `mark_unresolved`; the attribution rides alongside on - /// [`DiagnosticTable`] so consumers can dispatch bootstrap-vs-user - /// origins without scanning `SourceSpan.file`. - pub(crate) fn mark_unresolved_with_attribution( - &mut self, - port: PortId, - diagnostic: Diagnostic, - attribution: DiagnosticAttribution, - ) { - if let Some(p) = self.ports.get_mut(&port) { - p.state = PortState::Unresolved; - } - self.diagnostics.insert(port, diagnostic, attribution); - } - - /// Attach a diagnostic to the Dag without a pre-existing port anchor. - /// Allocates a detached phantom port as the diagnostic carrier so the - /// existing fail-closed biconditional still holds. Used by - /// bootstrap / lowering for failures that don't have a natural - /// PortId (unresolved declarations, tokenize/parse errors on - /// bootstrap fixtures, duplicate top-level declarations, etc.). - /// `compile_to_dag` surfaces these through `Err(CompileError::Semantic)`. - /// - /// Records [`DiagnosticAttribution::Unattributed`]. Bootstrap - /// loaders attaching tokenize/parse/fixture failures against a - /// substrate `bootstrap_authority` row should call - /// [`Self::attach_bootstrap_diagnostic`] instead so verification - /// consumers get a structural witness rather than a path string. - pub(crate) fn attach_diagnostic(&mut self, diagnostic: Diagnostic) { - let port = self.alloc_port(None); - self.mark_unresolved(port, diagnostic); - } - - /// Sibling of [`Self::attach_diagnostic`] for diagnostics raised - /// while loading or patching a substrate `bootstrap_authority` row. - /// Allocates the same detached phantom port (no fabricated producer - /// node) but records - /// [`DiagnosticAttribution::BootstrapAuthority(key)`] so consumers - /// can recover bootstrap origin via witness identity instead of a - /// `SourceSpan.file` string compare. - pub(crate) fn attach_bootstrap_diagnostic( - &mut self, - authority: BootstrapAuthorityKey, - diagnostic: Diagnostic, - ) { - let port = self.alloc_port(None); - self.mark_unresolved_with_attribution( - port, - diagnostic, - DiagnosticAttribution::BootstrapAuthority(authority), - ); - } - - /// Populate `primitives` by reading the declaration table for the - /// three canonical primitive roles. Called once at the end of - /// `bootstrap()` after all std/ modules are loaded and cross-file - /// references are resolved. Any role not found stays `None` — - /// the bootstrap failure is already on the diagnostic table and - /// downstream consumers surface the missing role through the - /// ordinary channel. - pub(crate) fn populate_primitive_cache(&mut self) { - self.primitives.int = self - .declaration_by_name("Int") - .map(|d| TypeShape::new(d.id)); - self.primitives.bool = self - .declaration_by_name("Bool") - .map(|d| TypeShape::new(d.id)); - self.primitives.string = self - .declaration_by_name("String") - .map(|d| TypeShape::new(d.id)); - - // Substrate marker resolution. Pulls each marker - // declaration from `src/v3/spec/v3_l1.dag` by its declared - // name and stores the typed handle. The lookup happens - // once at bootstrap end; downstream consumers - // (`lower_record_to_structural`, `emit_rust`) read the - // typed handle via `bind_marker()` / `branch_marker()` / - // etc. without any runtime name strings. - self.substrate_markers.value = self.declaration_by_name("ValueBehavior").map(|d| d.id); - self.substrate_markers.transform = self.declaration_by_name("Transform").map(|d| d.id); - self.substrate_markers.branch = self.declaration_by_name("Branch").map(|d| d.id); - self.substrate_markers.r#loop = self.declaration_by_name("Loop").map(|d| d.id); - self.substrate_markers.bind = self.declaration_by_name("Bind").map(|d| d.id); - self.substrate_markers.main = self.declaration_by_name("Main").map(|d| d.id); - self.substrate_markers.declaration_ref = - self.declaration_by_name("DeclarationRef").map(|d| d.id); - - // Realization meta-type resolution. Pulls each realization - // category meta-type from `src/v3/spec/rust.dag` (and any - // future per-target spec file) by its declared name and - // stores the typed handle. Same one-time-at-bootstrap-end - // pattern as substrate markers above. The lookup is the - // single bridge from name space to id space; every - // downstream consumer reads the typed accessor. - self.realization_metas.type_realization = - self.declaration_by_name("TypeRealization").map(|d| d.id); - self.realization_metas.operator_realization = self - .declaration_by_name("OperatorRealization") - .map(|d| d.id); - self.realization_metas.behavior_realization = self - .declaration_by_name("BehaviorRealization") - .map(|d| d.id); - self.realization_metas.callable_realization = self - .declaration_by_name("CallableRealization") - .map(|d| d.id); - self.realization_metas.type_instantiation_realization = self - .declaration_by_name("TypeInstantiationRealization") - .map(|d| d.id); - self.realization_metas.pattern_realization = - self.declaration_by_name("PatternRealization").map(|d| d.id); - self.target_syntax.rust_language = self.declaration_by_name("rust_language").map(|d| d.id); - self.target_syntax.rust_rendering = - self.declaration_by_name("rust_rendering").map(|d| d.id); - self.target_syntax.rust_execution_model = self - .declaration_by_name("rust_execution_model") - .map(|d| d.id); - self.target_syntax.rust_source_filtering = self - .declaration_by_name("rust_source_filtering") - .map(|d| d.id); - self.target_syntax.rust_execution_requirement = self - .declaration_by_name("rust_execution_requirement") - .map(|d| d.id); - self.target_syntax.dag_model = self.declaration_by_name("dag_model").map(|d| d.id); - self.target_syntax.go_language = self.declaration_by_name("go_language").map(|d| d.id); - self.target_syntax.go_execution_model = - self.declaration_by_name("go_execution_model").map(|d| d.id); - self.target_syntax.go_source_filtering = self - .declaration_by_name("go_source_filtering") - .map(|d| d.id); - self.target_syntax.go_execution_requirement = self - .declaration_by_name("go_execution_requirement") - .map(|d| d.id); - self.target_syntax.python_language = - self.declaration_by_name("python_language").map(|d| d.id); - self.target_syntax.python_target = self.declaration_by_name("python_target").map(|d| d.id); - self.target_syntax.python_source_filtering = self - .declaration_by_name("python_source_filtering") - .map(|d| d.id); - self.target_syntax.python_execution_requirement = self - .declaration_by_name("python_execution_requirement") - .map(|d| d.id); - self.populate_target_clean_emission_bindings(); - self.stdlib_types.list = self.declaration_by_name("List").map(|d| d.id); - self.stdlib_types.partial_function = - self.declaration_by_name("PartialFunction").map(|d| d.id); - - self.emit_anchors.ordered_ring = self.declaration_by_name("OrderedRing").map(|d| d.id); - self.emit_anchors.abelian_group = self.declaration_by_name("AbelianGroup").map(|d| d.id); - self.emit_anchors.substrate_accessor_binding = self - .declaration_by_name("SubstrateAccessorBinding") - .map(|d| d.id); - self.emit_anchors.dag_type = self.declaration_by_name("Dag").map(|d| d.id); - self.emit_anchors.std_list_fold = self.declaration_by_name("fold").map(|d| d.id); - self.emit_anchors.rust_functions = self.declaration_by_name("rust_functions").map(|d| d.id); - self.emit_anchors.method_emit_template = - self.declaration_by_name("MethodEmitTemplate").map(|d| d.id); - self.emit_anchors.method_template_contract = self - .declaration_by_name("MethodTemplateContract") - .map(|d| d.id); - self.emit_anchors.concat_method = self.declaration_by_name("concat_method").map(|d| d.id); - self.emit_anchors.length_method = self.declaration_by_name("length_method").map(|d| d.id); - self.emit_anchors.fold_method = self.declaration_by_name("fold_method").map(|d| d.id); - self.emit_anchors.is_empty_method = - self.declaration_by_name("is_empty_method").map(|d| d.id); - self.emit_anchors.filter_method = self.declaration_by_name("filter_method").map(|d| d.id); - self.emit_anchors.flat_map_method = - self.declaration_by_name("flat_map_method").map(|d| d.id); - self.emit_anchors.any_method = self.declaration_by_name("any_method").map(|d| d.id); - self.emit_anchors.all_method = self.declaration_by_name("all_method").map(|d| d.id); - self.emit_anchors.map_method = self.declaration_by_name("map_method").map(|d| d.id); - - // `PatternBindingRule` variant resolution. Walks the - // `std/clean_emission.dag` declaration's `Disj` variants - // once at bootstrap end and caches the typed id per label. - // Consumers in `emit_rust` / `emit_go` / (future) - // `emit_python` read these typed handles instead of each - // calling `named_variant_id` four times per contract parse. - let mut pattern_binding_variants = PatternBindingRuleVariants::default(); - if let Some(parent) = self.declaration_by_name("PatternBindingRule") { - if let TypeConnective::Disj { variants } = &parent.connective { - for variant in variants { - match variant.label.as_str() { - "EmitBindingAlways" => { - pattern_binding_variants.emit_always = Some(variant.ty); - } - "EmitUnderscoreWhenUnused" => { - pattern_binding_variants.emit_underscore = Some(variant.ty); - } - "EmitPrefixedUnderscoreWhenUnused" => { - pattern_binding_variants.emit_prefixed = Some(variant.ty); - } - "NotApplicablePatternBinding" => { - pattern_binding_variants.not_applicable = Some(variant.ty); - } - _ => {} - } - } - } - } - self.pattern_binding_rule_variants = pattern_binding_variants; - - let mut variant_payload_field_access_variants = - VariantPayloadFieldAccessRuleVariants::default(); - if let Some(parent) = self.declaration_by_name("VariantPayloadFieldAccessRule") { - if let TypeConnective::Disj { variants } = &parent.connective { - for variant in variants { - match variant.label.as_str() { - "AccessFromPayloadBinding" => { - variant_payload_field_access_variants.access_from_payload_binding = - Some(variant.ty); - } - "OverrideNamedFieldsAtBindingSite" => { - variant_payload_field_access_variants - .override_named_fields_at_binding_site = Some(variant.ty); - } - _ => {} - } - } - } - } - self.variant_payload_field_access_rule_variants = variant_payload_field_access_variants; - - // `VerifierOutputPolicy` variant resolution. Same shape as - // the pattern-binding cache above: one walk of the Disj's - // variants at bootstrap end, then every downstream consumer - // (`post_emit_verifier::parse_output_policy` today; Lane 1e - // generic walker tomorrow) dispatches on cached typed ids. - // Resolving by variant.label at parse time would reintroduce - // the same name-bridge pattern PR 2.5 removed from the - // PatternBindingRule path. - let mut verifier_policy_variants = VerifierOutputPolicyVariants::default(); - if let Some(parent) = self.declaration_by_name("VerifierOutputPolicy") { - if let TypeConnective::Disj { variants } = &parent.connective { - for variant in variants { - match variant.label.as_str() { - "IgnoreVerifierOutput" => { - verifier_policy_variants.ignore_output = Some(variant.ty); - } - "RequireEmptyStdout" => { - verifier_policy_variants.require_empty_stdout = Some(variant.ty); - } - "RequireEmptyStderr" => { - verifier_policy_variants.require_empty_stderr = Some(variant.ty); - } - "RequireEmptyStdoutAndStderr" => { - verifier_policy_variants.require_empty_stdout_and_stderr = - Some(variant.ty); - } - _ => {} - } - } - } - } - self.verifier_output_policy_variants = verifier_policy_variants; - - let mut callable_strategy_variants = CallableStrategyVariants::default(); - if let Some(parent) = self.declaration_by_name("CallableStrategy") { - if let TypeConnective::Disj { variants } = &parent.connective { - for variant in variants { - match variant.label.as_str() { - "ListEmpty" => { - callable_strategy_variants.list_empty = Some(variant.ty); - } - "ListSingleton" => { - callable_strategy_variants.list_singleton = Some(variant.ty); - } - "ListCons" => { - callable_strategy_variants.list_cons = Some(variant.ty); - } - "ListConcat" => { - callable_strategy_variants.list_concat = Some(variant.ty); - } - "ListLength" => { - callable_strategy_variants.list_length = Some(variant.ty); - } - "ListIsEmpty" => { - callable_strategy_variants.list_is_empty = Some(variant.ty); - } - "ListFold" => { - callable_strategy_variants.list_fold = Some(variant.ty); - } - "ListMap" => { - callable_strategy_variants.list_map = Some(variant.ty); - } - "ListFilter" => { - callable_strategy_variants.list_filter = Some(variant.ty); - } - "ListContains" => { - callable_strategy_variants.list_contains = Some(variant.ty); - } - _ => {} - } - } - } - } - self.callable_strategy_variants = callable_strategy_variants; - - let mut emit_model_variants = EmitModelVariants::default(); - if let Some(parent) = self.declaration_by_name("PatternStrategy") { - if let TypeConnective::Disj { variants } = &parent.connective { - for variant in variants { - if variant.label == "VectorList" { - emit_model_variants.pattern_strategy.vector_list = Some(variant.ty); - } - } - } - } - if let Some(parent) = self.declaration_by_name("FieldAccess") { - if let TypeConnective::Disj { variants } = &parent.connective { - for variant in variants { - match variant.label.as_str() { - "DirectField" => { - emit_model_variants.field_access.direct_field = Some(variant.ty); - } - "AccessorMethod" => { - emit_model_variants.field_access.accessor_method = Some(variant.ty); - } - _ => {} - } - } - } - } - if let Some(parent) = self.declaration_by_name("ParameterDisposition") { - if let TypeConnective::Disj { variants } = &parent.connective { - for variant in variants { - match variant.label.as_str() { - "Borrowed" => { - emit_model_variants.parameter_disposition.borrowed = Some(variant.ty); - } - "Consumed" => { - emit_model_variants.parameter_disposition.consumed = Some(variant.ty); - } - _ => {} - } - } - } - } - if let Some(parent) = self.declaration_by_name("MemoryModel") { - if let TypeConnective::Disj { variants } = &parent.connective { - for variant in variants { - match variant.label.as_str() { - "ValueOnly" => { - emit_model_variants.memory_model.value_only = Some(variant.ty); - } - "GarbageCollected" => { - emit_model_variants.memory_model.garbage_collected = Some(variant.ty); - } - "RefCounted" => { - emit_model_variants.memory_model.ref_counted = Some(variant.ty); - } - "OwnershipBased" => { - emit_model_variants.memory_model.ownership_based = Some(variant.ty); - } - _ => {} - } - } - } - } - if let Some(parent) = self.declaration_by_name("ScopeModel") { - if let TypeConnective::Disj { variants } = &parent.connective { - for variant in variants { - match variant.label.as_str() { - "LexicalScoping" => { - emit_model_variants.scope_model.lexical_scoping = Some(variant.ty); - } - "DynamicScoping" => { - emit_model_variants.scope_model.dynamic_scoping = Some(variant.ty); - } - _ => {} - } - } - } - } - if let Some(parent) = self.declaration_by_name("ReadStrategy") { - if let TypeConnective::Disj { variants } = &parent.connective { - for variant in variants { - match variant.label.as_str() { - "Borrow" => { - emit_model_variants.read_strategy.borrow = Some(variant.ty); - } - "PassByValue" => { - emit_model_variants.read_strategy.pass_by_value = Some(variant.ty); - } - _ => {} - } - } - } - } - if let Some(parent) = self.declaration_by_name("ConstructStrategy") { - if let TypeConnective::Disj { variants } = &parent.connective { - for variant in variants { - match variant.label.as_str() { - "CopyOrClone" => { - emit_model_variants.construct_strategy.copy_or_clone = Some(variant.ty); - } - "PassByValue" => { - emit_model_variants.construct_strategy.pass_by_value = Some(variant.ty); - } - _ => {} - } - } - } - } - if let Some(parent) = self.declaration_by_name("Mutability") { - if let TypeConnective::Disj { variants } = &parent.connective { - for variant in variants { - match variant.label.as_str() { - "Immutable" => { - emit_model_variants.mutability.immutable = Some(variant.ty); - } - "Mutable" => { - emit_model_variants.mutability.mutable = Some(variant.ty); - } - _ => {} - } - } - } - } - if let Some(parent) = self.declaration_by_name("Purity") { - if let TypeConnective::Disj { variants } = &parent.connective { - for variant in variants { - match variant.label.as_str() { - "Pure" => { - emit_model_variants.purity.pure = Some(variant.ty); - } - "Effectful" => { - emit_model_variants.purity.effectful = Some(variant.ty); - } - _ => {} - } - } - } - } - if let Some(parent) = self.declaration_by_name("Structure") { - if let TypeConnective::Disj { variants } = &parent.connective { - for variant in variants { - match variant.label.as_str() { - "ExplicitDAG" => { - emit_model_variants.structure.explicit_dag = Some(variant.ty); - } - "Arbitrary" => { - emit_model_variants.structure.arbitrary = Some(variant.ty); - } - _ => {} - } - } - } - } - if let Some(parent) = self.declaration_by_name("Iteration") { - if let TypeConnective::Disj { variants } = &parent.connective { - for variant in variants { - match variant.label.as_str() { - "Bounded" => { - emit_model_variants.iteration.bounded = Some(variant.ty); - } - "Unbounded" => { - emit_model_variants.iteration.unbounded = Some(variant.ty); - } - _ => {} - } - } - } - } - self.emit_model_variants = emit_model_variants; - } - - fn populate_target_clean_emission_bindings(&mut self) { - self.target_syntax.clean_emission_by_language.clear(); - let Some(binding_meta) = self - .declaration_by_name("TargetCleanEmissionBinding") - .map(|d| d.id) - else { - return; - }; - let language_spec_meta = self.declaration_by_name("LanguageSpec").map(|d| d.id); - let clean_emission_meta = self - .declaration_by_name("CleanEmissionContract") - .map(|d| d.id); - let mut clean_emission_by_language = HashMap::new(); - let mut duplicate_languages = HashSet::new(); - let mut diagnostics = Vec::new(); - - for declaration in &self.declarations { - if declaration.meta_tag != Some(binding_meta) { - continue; - } - let Some(ValueBody::Structural { fields }) = declaration.value_body.as_ref() else { - diagnostics.push(malformed_target_clean_emission_binding( - declaration, - "must carry a structural value_body", - )); - continue; - }; - let Some(language) = binding_reference_field(fields, "language") else { - diagnostics.push(malformed_target_clean_emission_binding( - declaration, - "is missing `language: DeclarationRef`", - )); - continue; - }; - let Some(clean_emission) = binding_reference_field(fields, "clean_emission") else { - diagnostics.push(malformed_target_clean_emission_binding( - declaration, - "is missing `clean_emission: DeclarationRef`", - )); - continue; - }; - if language_spec_meta - .is_some_and(|meta| self.declaration(language).meta_tag != Some(meta)) - { - diagnostics.push(malformed_target_clean_emission_binding( - declaration, - "`language` must reference a LanguageSpec declaration", - )); - continue; - } - if clean_emission_meta - .is_some_and(|meta| self.declaration(clean_emission).meta_tag != Some(meta)) - { - diagnostics.push(malformed_target_clean_emission_binding( - declaration, - "`clean_emission` must reference a CleanEmissionContract declaration", - )); - continue; - } - if duplicate_languages.contains(&language) { - continue; - } - if clean_emission_by_language - .insert(language, clean_emission) - .is_some() - { - clean_emission_by_language.remove(&language); - duplicate_languages.insert(language); - diagnostics.push(duplicate_target_clean_emission_binding( - self, - declaration, - language, - )); - } - } - - self.target_syntax.clean_emission_by_language = clean_emission_by_language; - for diagnostic in diagnostics { - self.attach_diagnostic(diagnostic); - } - } - - pub fn param_of(&self, member: NodeId, slot: usize) -> Option { - let bind = self.node(member).as_bind()?; - bind.params.get(slot)?; - Some(ParamRef { member, slot }) - } - - /// Sole Bool-validating constructor: returns a [`BoolPortRef`] when `port` - /// resolves to the `Bool` primitive (Track 9 parity with [`Dag::param_of`] - /// / [`Dag::as_transform_ref`]). Build [`BranchArm`] with [`BranchArm::new`]. - pub fn bool_port_of(&self, port: PortId) -> Option { - let bool_ty = self.bool_shape()?; - let p = self.port_opt(&port)?; - let ty = p.value_type()?; - if *ty != bool_ty { - return None; - } - Some(BoolPortRef { port }) - } - - /// Fail-closed wrapper for data-declaration lowering: on success returns the - /// same witness as [`Dag::bool_port_of`]; on failure records - /// [`Diagnostic::BranchConditionNotBool`] (C-8) and returns `None`. - pub fn bool_port_for_branch_condition_or_diagnose( - &mut self, - port: PortId, - condition_span: SourceSpan, - ) -> Option { - if let Some(r) = self.bool_port_of(port) { - return Some(r); - } - let actual_type = self.port_opt(&port).and_then(|p| p.value_type().cloned()); - self.attach_diagnostic(Diagnostic::BranchConditionNotBool { - port, - actual_type, - span: condition_span, - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "BranchConditionNotBool", - ), - }); - None - } - - /// Convenience wrapper over [`Dag::bool_port_of`] + [`BranchArm::new`]. - pub fn branch_arm_of(&self, port: PortId, body: WorkflowEffect) -> Option { - let condition = self.bool_port_of(port)?; - Some(BranchArm::new(condition, body)) - } - - pub fn as_transform_ref(&self, node: NodeId) -> Option { - self.node(node).as_transform()?; - Some(TransformRef(node)) - } -} - -impl Default for Dag { - fn default() -> Self { - Self::new() - } -} - -/// PB-1-e B4.4: the substrate `bootstrap_fixture_authority` carrier and -/// [`BOOTSTRAP_FIXTURE_PATH_KEYS`](crate::bootstrap::BOOTSTRAP_FIXTURE_PATH_KEYS) -/// must list the same virtual paths in the same order — the const is the regen -/// filter; the `.dag` declaration is runtime authority. -fn assert_bootstrap_fixture_paths_match_regen_keys(dag: &Dag) { - let Some(paths) = dag.bootstrap_fixture_virtual_paths() else { - panic!( - "bootstrap snapshot must expose `bootstrap_fixture_authority` as a \ - structural `ValueBody` with well-formed `virtual_path` fields on each fixture \ - slot (missing declaration, non-structural body, or malformed fixture records). \ - Regenerate via `regen_bootstrap` after editing \ - `src/v3/std/extdeps_bootstrap_fixtures.dag`." - ); - }; - if !paths - .iter() - .map(String::as_str) - .eq(BOOTSTRAP_FIXTURE_PATH_KEYS.iter().copied()) - { - panic!( - "`BOOTSTRAP_FIXTURE_PATH_KEYS` must match `bootstrap_fixture_authority` \ - virtual_path fields in order.\n substrate: {paths:?}\n regen keys: {BOOTSTRAP_FIXTURE_PATH_KEYS:?}" - ); - } -} - -fn extdeps_fixture_entry_virtual_path(fv: &FieldValue) -> Option { - let FieldValue::Record(fields) = fv else { - return None; - }; - let (_, vp) = fields.iter().find(|(l, _)| l == "virtual_path")?; - match vp { - FieldValue::Literal(LiteralBits::String(s)) => Some(s.clone()), - _ => None, - } -} - -fn binding_reference_field(fields: &[(String, FieldValue)], label: &str) -> Option { - fields.iter().find_map(|(field_label, value)| { - if field_label != label { - return None; - } - match value { - FieldValue::Reference(id) => Some(*id), - _ => None, - } - }) -} - -fn malformed_target_clean_emission_binding(declaration: &Declaration, detail: &str) -> Diagnostic { - Diagnostic::ResolveError { - name: format!( - "TargetCleanEmissionBinding `{}` {detail}", - declaration - .name - .as_deref() - .unwrap_or("") - ), - span: declaration.span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "MalformedTargetCleanEmissionBinding", - ), - } -} - -fn duplicate_target_clean_emission_binding( - dag: &Dag, - declaration: &Declaration, - language: DeclarationId, -) -> Diagnostic { - let language_name = dag - .declaration(language) - .name - .as_deref() - .unwrap_or(""); - Diagnostic::ResolveError { - name: format!( - "TargetCleanEmissionBinding `{}` duplicates the clean-emission authority for language `{language_name}`", - declaration - .name - .as_deref() - .unwrap_or("") - ), - span: declaration.span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "DuplicateTargetCleanEmissionBinding", - ), - } -} - -#[cfg(test)] -mod tests { - use super::*; - - /// P5 checkable receipt for `upsert_lane2_workflow_on_node` (see helper doc above). - #[test] - fn try_register_lane2_workflow_effect_upserts_without_silent_overwrite() { - let mut dag = - crate::compile_to_dag("let _: Int = 0", "lane2_upsert_unit.v3").expect("compile shell"); - let root = dag.workflow_lane2_subject().expect("bind shell"); - let wf_a = WorkflowEffect::LinearEffect { ops: vec![] }; - let wf_b = WorkflowEffect::LoopEffect { - body: Box::new(WorkflowEffect::LinearEffect { ops: vec![] }), - }; - assert!(dag.try_register_lane2_workflow_effect(root, wf_a.clone())); - assert!(dag.try_register_lane2_workflow_effect(root, wf_a)); - assert!(!dag.try_register_lane2_workflow_effect(root, wf_b)); - assert_eq!( - dag.lane2_workflow_effect_at(&root), - Some(&WorkflowEffect::LinearEffect { ops: vec![] }) - ); - } - - #[test] - fn call_pattern_from_relations_fails_closed_for_mixed_unknown_and_preserved_evidence() { - assert_eq!( - call_pattern_from_relations_with_index(&[ - SubValueRelation::PreservedValue, - SubValueRelation::SubValueUnknown - ]), - None, - "mixed unknown + preserved evidence must not fabricate SameArgumentCall" - ); - } - - #[test] - fn call_pattern_from_relations_skips_leading_preserved_rows_for_descent_bound_index() { - let relations = [ - SubValueRelation::PreservedValue, - SubValueRelation::ArithmeticDescent { - param: "param_1".to_string(), - factor: ShrinkFactor::ConstantShrink { - steps: PositiveDescentAmount::OneStep, - }, - }, - ]; - let (pattern, idx) = call_pattern_from_relations_with_index(&relations) - .expect("expected pattern from the first non-preserved, mapped row"); - assert_eq!( - idx, 1, - "lenses must key `per_call_descent_operand_port` off the evidence index that produced the \ - CallPattern, not `0` / first input heuristics" - ); - assert!( - matches!(pattern, CallPattern::ArithmeticSubtractCall { .. }), - "expected arithmetic descent pattern, got {pattern:?}" - ); - } - - #[test] - fn collapse_unary_bind_product_requires_joint_iter_alias_witness() { - let dag = crate::compile_to_dag( - "fn countdown(n: Int) -> Int =\n if n == 0 then 0 else countdown(n - 1)", - "collapse_evidence_unit.v3", - ) - .expect("compile countdown fixture"); - - let bind = dag - .nodes() - .iter() - .filter_map(Behavior::as_bind) - .find(|b| b.name == "countdown") - .expect("countdown bind"); - let param = bind.params[0]; - - let descent_port = per_call_descent_evidence(&dag) - .into_iter() - .filter(|e| e.caller == bind.name) - .find_map(|e| per_call_descent_operand_port(&dag, e.call)) - .expect("self-call descent operand port"); - - let mk_product = |other: PortId| SymbolicCost::ProductCost { - _0: NonSingletonList::from_vec(vec![ - Box::new(SymbolicCost::LinearCost { - _0: SizeVariable { - source_port: param, - display_name: None, - }, - }), - Box::new(SymbolicCost::LinearCost { - _0: SizeVariable { - source_port: other, - display_name: None, - }, - }), - ]) - .expect("two linear factors"), - }; - - let collapsed = collapse_unary_bind_tail_iterate_linear_product_if_duplicate_induction( - &dag, - bind.value, - mk_product(descent_port), - ); - assert!( - matches!(collapsed, SymbolicCost::LinearCost { .. }), - "gate #78 duplicate iterate-alias (param loop × descent operand, call under loop body) \ - should collapse: {collapsed:?}" - ); - - let bogus = PortId::test_raw(999_999); - let unchanged = collapse_unary_bind_tail_iterate_linear_product_if_duplicate_induction( - &dag, - bind.value, - mk_product(bogus), - ); - assert!( - matches!(unchanged, SymbolicCost::ProductCost { .. }), - "bogus second factor must not collapse without joint witness: {unchanged:?}" - ); - } - - #[test] - fn workflow_root_zero_bind_returns_no_root() { - // V3 surface syntax always lowers each top-level decl to a - // Bind, so the zero-Bind case is structurally unreachable from - // `compile_to_dag` fixtures. The α path's `NoRoot` arm is - // defensive-only at the substrate boundary; this unit test - // exercises it via the crate-private `Dag::empty()` constructor. - let dag = Dag::empty(); - let root = dag.workflow_root_port(); - assert_eq!( - root, - WorkflowRoot::NoRoot, - "Dag with no Bind behaviors must fail closed with NoRoot" - ); - } - - fn binding_fields(language: DeclarationId, clean_emission: DeclarationId) -> ValueBody { - ValueBody::Structural { - fields: vec![ - ("language".to_string(), FieldValue::Reference(language)), - ( - "clean_emission".to_string(), - FieldValue::Reference(clean_emission), - ), - ], - } - } - - /// Ratchet: [`Dag::populate_primitive_cache`] must resolve every - /// [`EmitAnchorCache`] role on the bootstrapped std/spec surface. If a - /// substrate name moves or a fixture omits a declaration, accessors - /// flip to `None` and emit paths lose typed anchors (ROADMAP P3). - #[test] - fn post_bootstrap_declaration_append_begin_is_zero_on_empty() { - let dag = Dag::empty(); - assert_eq!(dag.post_bootstrap_declaration_append_begin(), 0); - } - - #[test] - fn dag_new_bootstrap_declaration_ids_are_below_append_begin() { - let dag = Dag::new(); - let begin = dag.post_bootstrap_declaration_append_begin(); - assert_eq!(begin as usize, dag.declarations().len()); - for d in dag.declarations() { - assert!( - d.id.raw() < begin, - "expected bootstrap id {:?} < {}", - d.id, - begin - ); - assert!( - !dag.is_runtime_appended_declaration(d.id), - "bootstrap decl {:?} must not classify as runtime-appended", - d.id - ); - } - } - - #[test] - fn runtime_appended_declaration_is_detected() { - let mut dag = Dag::new(); - let begin = dag.post_bootstrap_declaration_append_begin(); - let binding_meta = dag - .declaration_by_name("TargetCleanEmissionBinding") - .expect("binding meta") - .id; - let rust_language = dag.rust_language_spec().expect("rust language"); - let new_id = dag.alloc_declaration_id(); - assert_eq!(new_id.raw(), begin); - dag.push_declaration(Declaration { - id: new_id, - name: Some("append_boundary_probe_decl".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(binding_meta)), - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: Some(binding_meta), - specialization_parent: None, - inhabits: None, - value_body: Some(binding_fields( - rust_language, - dag.go_clean_emission_spec().expect("go clean emission"), - )), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("append_boundary_probe.v3", 0, 1), - }); - assert!(new_id.raw() >= begin); - assert!(dag.is_runtime_appended_declaration(new_id)); - } - - #[test] - fn emit_anchor_cache_populated_after_bootstrap() { - let dag = Dag::new(); - assert!( - dag.ordered_ring_decl().is_some(), - "OrderedRing algebra anchor" - ); - assert!( - dag.substrate_accessor_binding_meta().is_some(), - "SubstrateAccessorBinding meta anchor" - ); - assert!(dag.dag_type_decl().is_some(), "Dag graph type anchor"); - assert!(dag.std_list_fold_decl().is_some(), "std.list fold anchor"); - assert!( - dag.rust_functions_syntax_decl().is_some(), - "rust_functions syntax anchor" - ); - assert!( - dag.method_emit_template_decl().is_some(), - "MethodEmitTemplate anchor" - ); - assert!( - dag.method_template_contract_decl().is_some(), - "MethodTemplateContract anchor" - ); - assert!(dag.fold_method_decl().is_some(), "fold_method anchor"); - assert!(dag.concat_method_decl().is_some(), "concat_method anchor"); - assert!(dag.length_method_decl().is_some(), "length_method anchor"); - assert!( - dag.is_empty_method_decl().is_some(), - "is_empty_method anchor" - ); - } - - #[test] - fn callable_strategy_variants_populated_after_bootstrap() { - let dag = Dag::new(); - let variants = dag.callable_strategy_variants(); - assert!(variants.list_empty.is_some(), "CallableStrategy.ListEmpty"); - assert!( - variants.list_singleton.is_some(), - "CallableStrategy.ListSingleton" - ); - assert!(variants.list_cons.is_some(), "CallableStrategy.ListCons"); - assert!( - variants.list_concat.is_some(), - "CallableStrategy.ListConcat" - ); - assert!( - variants.list_length.is_some(), - "CallableStrategy.ListLength" - ); - assert!( - variants.list_is_empty.is_some(), - "CallableStrategy.ListIsEmpty" - ); - assert!(variants.list_fold.is_some(), "CallableStrategy.ListFold"); - assert!(variants.list_map.is_some(), "CallableStrategy.ListMap"); - assert!( - variants.list_filter.is_some(), - "CallableStrategy.ListFilter" - ); - assert!( - variants.list_contains.is_some(), - "CallableStrategy.ListContains" - ); - } - - #[test] - fn emit_model_variants_populated_after_bootstrap() { - let dag = Dag::new(); - let variants = dag.emit_model_variants(); - assert!( - variants.pattern_strategy.vector_list.is_some(), - "PatternStrategy.VectorList" - ); - assert!( - variants.field_access.direct_field.is_some(), - "FieldAccess.DirectField" - ); - assert!( - variants.field_access.accessor_method.is_some(), - "FieldAccess.AccessorMethod" - ); - assert!( - variants.parameter_disposition.borrowed.is_some(), - "ParameterDisposition.Borrowed" - ); - assert!( - variants.parameter_disposition.consumed.is_some(), - "ParameterDisposition.Consumed" - ); - assert!( - variants.memory_model.value_only.is_some(), - "MemoryModel.ValueOnly" - ); - assert!( - variants.memory_model.garbage_collected.is_some(), - "MemoryModel.GarbageCollected" - ); - assert!( - variants.memory_model.ref_counted.is_some(), - "MemoryModel.RefCounted" - ); - assert!( - variants.memory_model.ownership_based.is_some(), - "MemoryModel.OwnershipBased" - ); - assert!( - variants.scope_model.lexical_scoping.is_some(), - "ScopeModel.LexicalScoping" - ); - assert!( - variants.scope_model.dynamic_scoping.is_some(), - "ScopeModel.DynamicScoping" - ); - assert!( - variants.read_strategy.borrow.is_some(), - "ReadStrategy.Borrow" - ); - assert!( - variants.read_strategy.pass_by_value.is_some(), - "ReadStrategy.PassByValue" - ); - assert!( - variants.construct_strategy.copy_or_clone.is_some(), - "ConstructStrategy.CopyOrClone" - ); - assert!( - variants.construct_strategy.pass_by_value.is_some(), - "ConstructStrategy.PassByValue" - ); - assert!( - variants.mutability.immutable.is_some(), - "Mutability.Immutable" - ); - assert!(variants.mutability.mutable.is_some(), "Mutability.Mutable"); - assert!(variants.purity.pure.is_some(), "Purity.Pure"); - assert!(variants.purity.effectful.is_some(), "Purity.Effectful"); - assert!( - variants.structure.explicit_dag.is_some(), - "Structure.ExplicitDAG" - ); - assert!( - variants.structure.arbitrary.is_some(), - "Structure.Arbitrary" - ); - assert!(variants.iteration.bounded.is_some(), "Iteration.Bounded"); - assert!( - variants.iteration.unbounded.is_some(), - "Iteration.Unbounded" - ); - } - - #[test] - fn bridge_mark_bootstrap_secret_nominal_opacity_retired() { - fn assert_secret_marked(dag: Dag, label: &str) { - let secret = dag - .declaration_by_name("Secret") - .unwrap_or_else(|| panic!("{label} must include std Secret")); - assert!( - secret.nominal_opacity.is_some(), - "{label} must carry Secret nominal opacity in the generated snapshot" - ); - } - - assert_secret_marked( - bootstrap_std_generated::bootstrapped_std_fixture_dag(), - "std bootstrap snapshot", - ); - assert_secret_marked( - bootstrap_generated::bootstrapped_fixture_dag(), - "full bootstrap snapshot", - ); - assert_secret_marked( - bootstrap_generated_without_parse_surface::bootstrapped_fixture_without_parse_surface_dag( - ), - "bootstrap-without-parse-surface snapshot", - ); - } - - #[test] - fn bootstrap_secret_is_nominal_opaque() { - let dag = Dag::new(); - let secret = dag - .declaration_by_name("Secret") - .expect("bootstrap fixture must include std Secret"); - - assert!( - secret.nominal_opacity.is_some(), - "Secret must carry nominal opacity from std source authority" - ); - } - - #[test] - #[should_panic(expected = "generated bootstrap invariant violation")] - fn generated_bootstrap_rejects_user_defined_body_that_is_not_a_bind() { - let mut dag = bootstrap_generated::bootstrapped_fixture_dag(); - let non_bind = dag - .nodes - .iter() - .find_map(|behavior| { - if matches!(behavior, Behavior::Bind(_)) { - None - } else { - Some(behavior.id()) - } - }) - .expect("generated bootstrap fixture should include a non-Bind behavior"); - let declaration = dag - .declarations - .iter_mut() - .find(|declaration| { - matches!( - &declaration.connective, - TypeConnective::Arrow { - body: ArrowBody::UserDefined(_), - .. - } - ) - }) - .expect("generated bootstrap fixture should include a user-defined arrow body"); - let TypeConnective::Arrow { body, .. } = &mut declaration.connective else { - unreachable!("declaration was selected by arrow body shape") - }; - *body = ArrowBody::UserDefined(BindNodeId::new_unchecked(non_bind)); - - dag.finalize_runtime_bootstrap_from_generated_snapshot( - RuntimeBootstrapFixtureKind::FullExtdepsPipelineSnapshot, - ); - } - - #[test] - fn malformed_target_clean_emission_binding_fails_closed() { - let mut dag = Dag::new(); - let binding = dag - .declaration_by_name("rust_clean_emission_binding") - .expect("rust binding exists") - .id; - let rust_language = dag.rust_language_spec().expect("rust language"); - dag.declaration_mut(binding).value_body = - Some(binding_fields(rust_language, rust_language)); - - dag.populate_primitive_cache(); - - assert!( - dag.target_syntax_bundle_for_language(rust_language) - .is_none(), - "malformed binding should not populate a target authority bundle" - ); - assert!( - dag.rust_clean_emission_spec().is_none(), - "target-specific clean-emission accessor must also fail closed on malformed bindings" - ); - assert!( - dag.diagnostics().iter().any(|(_, diagnostic)| matches!( - diagnostic, - Diagnostic::ResolveError { name, .. } - if name.contains("rust_clean_emission_binding") - && name.contains("CleanEmissionContract") - )), - "expected malformed TargetCleanEmissionBinding diagnostic, got {:?}", - dag.diagnostics().iter().collect::>() - ); - } - - #[test] - fn duplicate_target_clean_emission_binding_fails_closed() { - let mut dag = Dag::new(); - let binding_meta = dag - .declaration_by_name("TargetCleanEmissionBinding") - .expect("binding meta exists") - .id; - let rust_language = dag.rust_language_spec().expect("rust language"); - let go_clean_emission = dag.go_clean_emission_spec().expect("go clean emission"); - let duplicate = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: duplicate, - name: Some("duplicate_rust_clean_emission_binding".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(binding_meta)), - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: Some(binding_meta), - specialization_parent: None, - inhabits: None, - value_body: Some(binding_fields(rust_language, go_clean_emission)), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("duplicate_binding_test.v3", 0, 1), - }); - - dag.populate_primitive_cache(); - - assert!( - dag.target_syntax_bundle_for_language(rust_language) - .is_none(), - "duplicate language bindings should remove the ambiguous authority" - ); - assert!( - dag.rust_clean_emission_spec().is_none(), - "target-specific clean-emission accessor must project the same ambiguous authority as None" - ); - assert!( - dag.diagnostics().iter().any(|(_, diagnostic)| matches!( - diagnostic, - Diagnostic::ResolveError { name, .. } - if name.contains("duplicate_rust_clean_emission_binding") - && name.contains("duplicates the clean-emission authority") - )), - "expected duplicate TargetCleanEmissionBinding diagnostic, got {:?}", - dag.diagnostics().iter().collect::>() - ); - } - - #[test] - fn cardinality_idempotent_target_peels_empty_instantiation_alias() { - let mut dag = Dag::new(); - dag.populate_primitive_cache(); - let int_decl = dag.int_shape().expect("bootstrap Int").declaration; - let opt_decl = dag.alloc_cardinality_decl( - int_decl, - CardinalityBound::AtMostOne, - SourceSpan::new("cardinality_alias_peel_test", 0, 0), - ); - let alias_decl = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: alias_decl, - name: Some("Alias".to_string()), - connective: TypeConnective::Instantiation { - template: opt_decl, - arguments: Vec::new(), - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("cardinality_alias_peel_test", 0, 0), - }); - - assert_eq!( - cardinality_idempotent_target(&dag, alias_decl, CardinalityBound::AtMostOne), - Some(opt_decl), - "Alias = Opt (Instantiation with empty args) should peel to Opt before idempotence" - ); - } - - #[test] - fn cardinality_idempotent_target_peels_chained_instantiation_aliases() { - let mut dag = Dag::new(); - dag.populate_primitive_cache(); - let int_decl = dag.int_shape().expect("bootstrap Int").declaration; - let int_opt_decl = dag.alloc_cardinality_decl( - int_decl, - CardinalityBound::AtMostOne, - SourceSpan::new("cardinality_chain_peel_test", 0, 0), - ); - // type Alias = Int? → empty-arg alias to the `Int?` declaration - let alias_decl = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: alias_decl, - name: Some("Alias".to_string()), - connective: TypeConnective::Instantiation { - template: int_opt_decl, - arguments: Vec::new(), - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("cardinality_chain_peel_test", 0, 0), - }); - // type Wrap = Alias → second empty-arg alias - let wrap_decl = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: wrap_decl, - name: Some("Wrap".to_string()), - connective: TypeConnective::Instantiation { - template: alias_decl, - arguments: Vec::new(), - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("cardinality_chain_peel_test", 0, 0), - }); - - assert_eq!( - cardinality_idempotent_target(&dag, wrap_decl, CardinalityBound::AtMostOne), - Some(int_opt_decl), - "Wrap = Alias; Alias = Int? should peel through both Instantiations to the \ - canonical `Int?` decl (recursive alias chain, not one step)" - ); - } - - #[test] - fn cardinality_idempotence_does_not_collapse_non_at_most_one_inner_bound() { - let mut dag = Dag::new(); - dag.populate_primitive_cache(); - let int_decl = dag.int_shape().expect("bootstrap Int").declaration; - let exact_two = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: exact_two, - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence( - int_decl, - CardinalityBound::Exact(2), - ), - ), - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("cardinality_exact_spoof_test", 0, 0), - }); - - assert_eq!( - cardinality_idempotent_target(&dag, exact_two, CardinalityBound::AtMostOne), - None, - "AtMostOne over Exact(2) is optional fixed-cardinality, not nested optional" - ); - - let optional_exact_two = dag.alloc_cardinality_decl( - exact_two, - CardinalityBound::AtMostOne, - SourceSpan::new("cardinality_exact_spoof_test", 0, 0), - ); - let TypeConnective::Cardinality(payload) = &dag.declaration(optional_exact_two).connective - else { - panic!("optional Exact(2) should remain a Cardinality declaration"); - }; - assert_eq!(payload.element(), exact_two); - assert_eq!(payload.bound(), CardinalityBound::AtMostOne); - } - - /// Cementing test for issue #2463: `resolve_producer_lookup` must - /// discriminate the five variants (`NoProducer`, `Found`, - /// `MissingPort`, `MissingNode`, `BindCycle`) so consumers can - /// fail-closed on malformed substrate per INVARIANTS P3. - /// `resolve_producer_opt` (compat wrapper) collapses the four - /// miss shapes (legitimate `NoProducer` plus three malformed) into - /// `None`; the typed surface preserves the distinction. - #[test] - fn resolve_producer_lookup_discriminates_malformed_substrate() { - let dag = Dag::new(); - // MissingPort: a `PortId` past the allocated range cannot - // resolve. The compat wrapper hides this as `None`; the typed - // surface surfaces it as `MissingPort`. - let bogus = PortId::test_raw(u32::MAX); - assert!( - matches!( - dag.resolve_producer_lookup(&bogus), - ProducerLookup::MissingPort { .. } - ), - "out-of-range PortId must surface as MissingPort, not collapse to NoProducer" - ); - assert!( - dag.resolve_producer_opt(&bogus).is_none(), - "compat wrapper collapses MissingPort to None" - ); - } -} diff --git a/src/v3/compiler/src/dag/builder.rs b/src/v3/compiler/src/dag/builder.rs deleted file mode 100644 index bb4c990ede3..00000000000 --- a/src/v3/compiler/src/dag/builder.rs +++ /dev/null @@ -1,1529 +0,0 @@ -use super::*; -use crate::operators::OperatorKind; -use crate::types::TypeShape; - -const BUILDER_TYPE_WALK_DEPTH_LIMIT: usize = 32; - -#[allow(dead_code)] -impl Dag { - /// Test-facing builder: allocate a detached port that already carries a - /// resolved shape. This keeps unit-style graph construction on the same - /// Port-state invariant as post-infer dags. - pub(crate) fn alloc_port_with_shape(&mut self, shape: TypeShape) -> PortId { - let port = self.alloc_port(None); - self.set_port_type(port, shape); - port - } - - /// Test-facing builder: append a `Value` node and return its output port. - /// The output port is resolved to the corresponding primitive shape. - pub(crate) fn push_value(&mut self, bits: LiteralBits, span: SourceSpan) -> PortId { - let node_id = self.alloc_node_id(); - let output = self.alloc_port(Some(node_id)); - let output_shape = self.literal_shape(&bits); - self.push_node(Behavior::Value(ValueNode { - id: node_id, - data: bits, - output, - span, - lane2_workflow: None, - })); - self.set_port_type(output, output_shape); - output - } - - /// Test-facing builder: append a `Transform` node and return its output - /// port. The builder validates referenced input ports and seeds the output - /// port shape when the target carries enough structural information. - pub(crate) fn push_transform( - &mut self, - target: TransformTarget, - inputs: Vec, - span: SourceSpan, - ) -> PortId { - self.assert_transform_inputs(&target, &inputs); - let node_id = self.alloc_node_id(); - let output = self.alloc_port(Some(node_id)); - let output_shape = self.transform_output_shape(&target, &inputs); - self.push_node(Behavior::Transform(TransformNode { - id: node_id, - target, - inputs, - output, - span, - })); - if let Some(shape) = output_shape { - self.set_port_type(output, shape); - } - output - } - - /// Test-facing builder: append a `Bind` node and return its `NodeId`. - /// `Bind` reuses the supplied value port as its result port rather than - /// synthesizing a parallel output edge. - pub(crate) fn push_bind( - &mut self, - name: impl Into, - value: PortId, - params: Vec, - span: SourceSpan, - ) -> NodeId { - self.assert_port_exists(value, "push_bind(value)"); - self.assert_ports_exist(¶ms, "push_bind(params)"); - let node_id = self.alloc_node_id(); - self.push_node(Behavior::Bind(BindNode { - id: node_id, - name: name.into(), - value, - params, - span, - lane2_workflow: None, - emit_participation: None, - })); - node_id - } - - /// Test-facing builder: append a `Branch` node and return its output port. - /// Every path body/output reference is validated before the node is pushed. - /// The output port is resolved when every arm output already has the same - /// resolved shape. - pub(crate) fn push_branch( - &mut self, - input: PortId, - paths: Vec, - span: SourceSpan, - ) -> PortId { - assert!(!paths.is_empty(), "push_branch requires at least one path"); - self.assert_port_exists(input, "push_branch(input)"); - for path in &paths { - self.assert_node_exists(path.body, "push_branch(path.body)"); - self.assert_port_exists(path.output, "push_branch(path.output)"); - if let BranchPattern::ResolvedVariant(variant) = path.pattern { - self.assert_declaration_exists(variant, "push_branch(path.pattern)"); - } - if let Some(binding) = &path.binding { - self.assert_port_exists( - binding.payload_port, - "push_branch(path.binding.payload_port)", - ); - } - } - let node_id = self.alloc_node_id(); - let output = self.alloc_port(Some(node_id)); - let output_shape = self.common_resolved_shape(paths.iter().map(|path| path.output)); - self.push_node(Behavior::Branch(BranchNode { - id: node_id, - input, - paths, - output, - span, - emit_participation: None, - })); - if let Some(shape) = output_shape { - self.set_port_type(output, shape); - } - output - } - - /// Test-facing builder: append a `Loop` node and return its output port. - /// The output port inherits the init-port shape when that shape is already - /// resolved on the supplied graph fragment. - pub(crate) fn push_loop( - &mut self, - source: PortId, - init: PortId, - body: NodeId, - bound: LoopBound, - span: SourceSpan, - ) -> PortId { - self.assert_port_exists(source, "push_loop(source)"); - self.assert_port_exists(init, "push_loop(init)"); - self.assert_node_exists(body, "push_loop(body)"); - match bound { - LoopBound::Cardinality { count } => { - self.assert_port_exists(count, "push_loop(bound.count)"); - } - LoopBound::Descent { cluster, measure } => { - assert!( - self.clusters.get(cluster.index()).is_some(), - "push_loop(bound.cluster): unknown cluster {:?}", - cluster - ); - self.assert_port_exists(measure, "push_loop(bound.measure)"); - assert_eq!( - source, measure, - "push_loop(source) must match LoopBound::Descent.measure during migration" - ); - } - } - let node_id = self.alloc_node_id(); - let output = self.alloc_port(Some(node_id)); - let output_shape = self.resolved_port_shape(init); - self.push_node(Behavior::Loop(LoopNode { - id: node_id, - source, - init, - body, - bound, - output, - span, - })); - if let Some(shape) = output_shape { - self.set_port_type(output, shape); - } - output - } - - /// Test-facing builder: append a `Conj` declaration and return its - /// `DeclarationId`. - pub(crate) fn push_conj( - &mut self, - name: Option, - children: Vec, - span: SourceSpan, - ) -> DeclarationId { - self.assert_fields_exist(&children, "push_conj(children)"); - let id = self.alloc_declaration_id(); - self.push_declaration(Declaration { - id, - name, - connective: TypeConnective::Conj { children }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span, - }); - id - } - - /// Test-facing builder: append an `Atom` declaration and return its - /// `DeclarationId`. - pub(crate) fn push_atom( - &mut self, - name: Option, - payload: AtomPayload, - span: SourceSpan, - ) -> DeclarationId { - if let Some(target) = payload.resolved_id() { - self.assert_declaration_exists(target, "push_atom(payload)"); - } - let id = self.alloc_declaration_id(); - self.push_declaration(Declaration { - id, - name, - connective: TypeConnective::Atom(payload), - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span, - }); - id - } - - /// Single constructor authority for cardinality declarations (`Option`, lists, …). - /// - /// Nested `AtMostOne` wraps collapse to the inner declaration (T-ImpossibleBugs - /// nested-optional flatten). - pub(crate) fn alloc_cardinality_decl( - &mut self, - element: DeclarationId, - bound: CardinalityBound, - span: SourceSpan, - ) -> DeclarationId { - if let Some(existing) = super::cardinality_idempotent_target(self, element, bound) { - self.debug_assert_alloc_cardinality_result_not_nested_at_most_one(existing); - return existing; - } - let id = self.alloc_declaration_id(); - self.push_declaration(Declaration { - id, - name: None, - connective: TypeConnective::Cardinality( - CardinalityPayload::new_unchecked_bypassing_idempotence(element, bound), - ), - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span, - }); - self.debug_assert_alloc_cardinality_result_not_nested_at_most_one(id); - id - } - - /// Debug-only: for a returned `AtMostOne` cardinal, the inner `element` must not - /// still pass `cardinality_idempotent_target` (else we would have `Option` of - /// `Option` without the allocator having collapsed it). The idempotent rule forbids - /// that shape; this rechecks it in debug builds. - fn debug_assert_alloc_cardinality_result_not_nested_at_most_one(&self, id: DeclarationId) { - if let TypeConnective::Cardinality(p) = &self.declaration(id).connective { - if p.bound() == CardinalityBound::AtMostOne { - let inner = p.element(); - debug_assert!( - super::cardinality_idempotent_target(self, inner, CardinalityBound::AtMostOne) - .is_none(), - "alloc_cardinality_decl: result {id:?} = AtMostOne(…, {inner:?}) but inner still \ - admits idempotent AtMostOne collapse (nested option stack)", - ); - } - } - } - - fn literal_shape(&self, bits: &LiteralBits) -> TypeShape { - match bits { - LiteralBits::Int(_) => self - .int_shape() - .expect("push_value requires bootstrap Int shape"), - LiteralBits::Bool(_) => self - .bool_shape() - .expect("push_value requires bootstrap Bool shape"), - LiteralBits::String(_) => self - .string_shape() - .expect("push_value requires bootstrap String shape"), - LiteralBits::Symbol(_) => TypeShape::new( - self.declaration_by_name("Symbol") - .expect("push_value requires bootstrap Symbol declaration") - .id, - ), - } - } - - fn transform_output_shape( - &self, - target: &TransformTarget, - inputs: &[PortId], - ) -> Option { - match target { - TransformTarget::Callable(target) => self.callable_output_shape(*target), - TransformTarget::UnresolvedFieldProject { .. } => None, - TransformTarget::ResolvedFieldProject { field_label } => { - self.field_project_output_shape(field_label, inputs) - } - TransformTarget::Operator(kind) => self.operator_output_shape(*kind, inputs), - } - } - - fn field_project_output_shape( - &self, - field_label: &str, - inputs: &[PortId], - ) -> Option { - let input_shape = self.resolved_port_shape(*inputs.first()?)?; - let mut subst = Vec::new(); - let conj_id = self.walk_to_conj_decl_with_subst(input_shape.declaration, &mut subst, 0)?; - let TypeConnective::Conj { children } = &self.declaration(conj_id).connective else { - return None; - }; - let field_ty = children - .iter() - .find(|field| field.label == field_label) - .map(|field| field.ty)?; - self.signature_type_shape(field_ty, &subst, 0) - } - - fn callable_output_shape(&self, decl_id: DeclarationId) -> Option { - let mut subst = Vec::new(); - self.callable_output_shape_with_subst(decl_id, &mut subst, 0) - } - - fn callable_runtime_arity(&self, target: DeclarationId) -> Option { - let (template, mut arguments) = self.callable_template_arguments(target); - arguments = self.retained_template_arguments_for_target(template, &arguments); - let mut subst = vec![arguments]; - if let Some(raw_inputs) = self.resolve_arrow_decl_inputs(template, &mut subst, 0) { - return Some( - raw_inputs - .into_iter() - .filter(|input| !self.declaration_is_callable(*input, 0)) - .count(), - ); - } - match &self.declaration(template).connective { - TypeConnective::Conj { children } => Some(children.len()), - _ => None, - } - } - - fn callable_template_arguments( - &self, - target: DeclarationId, - ) -> (DeclarationId, Vec) { - match &self.declaration(target).connective { - TypeConnective::Instantiation { - template, - arguments, - } => (*template, arguments.clone()), - _ => (target, Vec::new()), - } - } - - fn retained_template_arguments_for_target( - &self, - template: DeclarationId, - arguments: &[TemplateArgument], - ) -> Vec { - let mut allowed: HashSet = self - .declaration(template) - .type_params - .iter() - .copied() - .collect(); - if let Some(raw_inputs) = self.resolve_arrow_decl_inputs(template, &mut Vec::new(), 0) { - for input in raw_inputs { - if self.declaration_is_callable(input, 0) { - allowed.insert(input); - } - } - } - - let mut retained = Vec::new(); - for argument in arguments { - if !allowed.contains(&argument.parameter) { - continue; - } - let resolved_value = self.resolve_template_argument_value(arguments, argument.value, 0); - if let Some(existing) = retained - .iter_mut() - .find(|existing: &&mut TemplateArgument| existing.parameter == argument.parameter) - { - existing.value = resolved_value; - continue; - } - retained.push(TemplateArgument { - parameter: argument.parameter, - value: resolved_value, - }); - } - retained - } - - fn resolve_template_argument_value( - &self, - arguments: &[TemplateArgument], - current: DeclarationId, - depth: usize, - ) -> DeclarationId { - if depth >= BUILDER_TYPE_WALK_DEPTH_LIMIT { - return current; - } - let Some(next) = arguments - .iter() - .find(|arg| arg.parameter == current) - .map(|arg| arg.value) - else { - return current; - }; - if next == current { - return current; - } - self.resolve_template_argument_value(arguments, next, depth + 1) - } - - fn resolve_arrow_decl_inputs( - &self, - current: DeclarationId, - subst: &mut Vec>, - depth: usize, - ) -> Option> { - if depth >= BUILDER_TYPE_WALK_DEPTH_LIMIT { - return None; - } - let decl = self.declaration(current); - match &decl.connective { - TypeConnective::Arrow { inputs, .. } => Some(inputs.clone()), - TypeConnective::Instantiation { - template, - arguments, - } => { - subst.push(arguments.clone()); - let result = self.resolve_arrow_decl_inputs(*template, subst, depth + 1); - subst.pop(); - result - } - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - self.resolve_arrow_decl_inputs(*next, subst, depth + 1) - } - TypeConnective::Atom(AtomPayload::TypeParam(_)) => { - let bound = self.lookup_template_argument(current, subst)?; - self.resolve_arrow_decl_inputs(bound, subst, depth + 1) - } - TypeConnective::Atom(AtomPayload::UnresolvedIdentifier(_)) - | TypeConnective::Atom(AtomPayload::Literal(_)) - | TypeConnective::Conj { .. } - | TypeConnective::Disj { .. } - | TypeConnective::Cardinality(_) => None, - } - } - - fn walk_to_conj_decl_with_subst( - &self, - current: DeclarationId, - subst: &mut Vec>, - depth: usize, - ) -> Option { - if depth >= BUILDER_TYPE_WALK_DEPTH_LIMIT { - return None; - } - match &self.declaration(current).connective { - TypeConnective::Conj { .. } => Some(current), - TypeConnective::Instantiation { - template, - arguments, - } => { - subst.push(arguments.clone()); - let result = self.walk_to_conj_decl_with_subst(*template, subst, depth + 1); - if result.is_none() { - subst.pop(); - } - result - } - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - self.walk_to_conj_decl_with_subst(*next, subst, depth + 1) - } - TypeConnective::Atom(AtomPayload::TypeParam(_)) => { - let bound = self.lookup_template_argument(current, subst)?; - self.walk_to_conj_decl_with_subst(bound, subst, depth + 1) - } - TypeConnective::Atom(AtomPayload::Literal(_)) - | TypeConnective::Atom(AtomPayload::UnresolvedIdentifier(_)) - | TypeConnective::Arrow { .. } - | TypeConnective::Disj { .. } - | TypeConnective::Cardinality(_) => None, - } - } - - fn callable_output_shape_with_subst( - &self, - decl_id: DeclarationId, - subst: &mut Vec>, - depth: usize, - ) -> Option { - if depth >= BUILDER_TYPE_WALK_DEPTH_LIMIT { - return None; - } - match &self.declaration(decl_id).connective { - TypeConnective::Arrow { output, .. } => { - self.signature_type_shape(*output, subst, depth + 1) - } - TypeConnective::Instantiation { - template, - arguments, - } => { - subst.push(arguments.clone()); - let result = self.callable_output_shape_with_subst(*template, subst, depth + 1); - subst.pop(); - result - } - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - self.callable_output_shape_with_subst(*next, subst, depth + 1) - } - TypeConnective::Atom(AtomPayload::Literal(_)) - | TypeConnective::Atom(AtomPayload::UnresolvedIdentifier(_)) - | TypeConnective::Atom(AtomPayload::TypeParam(_)) - | TypeConnective::Conj { .. } - | TypeConnective::Disj { .. } - | TypeConnective::Cardinality(_) => None, - } - } - - fn declaration_is_callable(&self, current: DeclarationId, depth: usize) -> bool { - if depth >= BUILDER_TYPE_WALK_DEPTH_LIMIT { - return false; - } - match &self.declaration(current).connective { - TypeConnective::Arrow { .. } => true, - TypeConnective::Instantiation { template, .. } => { - self.declaration_is_callable(*template, depth + 1) - } - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - self.declaration_is_callable(*next, depth + 1) - } - TypeConnective::Atom(AtomPayload::UnresolvedIdentifier(_)) - | TypeConnective::Atom(AtomPayload::TypeParam(_)) - | TypeConnective::Atom(AtomPayload::Literal(_)) - | TypeConnective::Conj { .. } - | TypeConnective::Disj { .. } - | TypeConnective::Cardinality(_) => false, - } - } - - fn operator_output_shape(&self, kind: OperatorKind, inputs: &[PortId]) -> Option { - match kind { - OperatorKind::Arithmetic(_) => inputs - .first() - .copied() - .and_then(|port| self.resolved_port_shape(port)), - OperatorKind::Comparison(_) | OperatorKind::Logical(_) => self.bool_shape(), - } - } - - fn resolved_port_shape(&self, port: PortId) -> Option { - match self.port(port).state() { - PortState::Resolved(shape) => Some(*shape), - PortState::Uninferred | PortState::Unresolved => None, - } - } - - fn signature_type_shape( - &self, - current: DeclarationId, - subst: &[Vec], - depth: usize, - ) -> Option { - if depth >= BUILDER_TYPE_WALK_DEPTH_LIMIT { - return None; - } - let decl = self.declaration(current); - if decl.name.is_some() || decl.refinement.is_some() { - // The builder is read-only: unlike inference, it does not - // materialize substituted refined carriers. If this refined - // identity still depends on active template arguments, do not seed - // a stale template shape onto the output port. - if decl.refinement.is_some() - && self.refinement_base_requires_substitution(current, subst, depth + 1) - { - return None; - } - return Some(TypeShape::new(current)); - } - match &decl.connective { - TypeConnective::Instantiation { .. } => self - .resolve_decl_with_subst(current, subst, depth + 1) - .map(TypeShape::new) - .or_else(|| Some(TypeShape::new(current))), - TypeConnective::Atom(AtomPayload::TypeParam(_)) => { - if let Some(bound) = self.lookup_template_argument(current, subst) { - self.signature_type_shape(bound, subst, depth + 1) - } else { - Some(TypeShape::new(current)) - } - } - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - self.signature_type_shape(*next, subst, depth + 1) - } - TypeConnective::Cardinality(_) => Some(TypeShape::new(current)), - TypeConnective::Atom(AtomPayload::UnresolvedIdentifier(_)) - | TypeConnective::Atom(AtomPayload::Literal(_)) - | TypeConnective::Conj { .. } - | TypeConnective::Disj { .. } - | TypeConnective::Arrow { .. } => None, - } - } - - fn resolve_decl_with_subst( - &self, - current: DeclarationId, - subst: &[Vec], - depth: usize, - ) -> Option { - if depth >= BUILDER_TYPE_WALK_DEPTH_LIMIT { - return None; - } - let decl = self.declaration(current); - match &decl.connective { - TypeConnective::Atom(AtomPayload::TypeParam(_)) => self - .lookup_template_argument(current, subst) - .and_then(|bound| self.resolve_decl_with_subst(bound, subst, depth + 1)) - .or(Some(current)), - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - self.resolve_decl_with_subst(*next, subst, depth + 1) - } - TypeConnective::Instantiation { - template, - arguments, - } => { - let specialized_arguments: Vec = arguments - .iter() - .map(|arg| { - Some(TemplateArgument { - parameter: arg.parameter, - value: self.resolve_decl_with_subst(arg.value, subst, depth + 1)?, - }) - }) - .collect::>()?; - if specialized_arguments - .iter() - .zip(arguments.iter()) - .all(|(lhs, rhs)| lhs.parameter == rhs.parameter && lhs.value == rhs.value) - { - return Some(current); - } - self.find_equivalent_decl_instantiation(*template, &specialized_arguments) - .or(Some(current)) - } - TypeConnective::Cardinality(p) => { - let element = p.element(); - let bound = p.bound(); - let specialized_element = - self.resolve_decl_with_subst(element, subst, depth + 1)?; - // Before `specialized_element == element` (substitution was a no-op on the - // element id): if the element is already an optional, the canonical - // declaration matches `alloc_cardinality_decl` / `cardinality_idempotent_target` - // (e.g. T? with T = U? must not keep a stale outer `Cardinality` wrapper). - if bound == CardinalityBound::AtMostOne { - if let Some(idem) = - super::cardinality_idempotent_target(self, specialized_element, bound) - { - return Some(idem); - } - } - if specialized_element == element { - return Some(current); - } - self.find_equivalent_decl_cardinality(specialized_element, bound) - .or(Some(current)) - } - _ => Some(current), - } - } - - fn lookup_template_argument( - &self, - parameter: DeclarationId, - subst: &[Vec], - ) -> Option { - for frame in subst.iter().rev() { - for arg in frame { - if arg.parameter == parameter { - if arg.value == parameter { - return None; - } - return Some(arg.value); - } - } - } - None - } - - fn refinement_base_requires_substitution( - &self, - current: DeclarationId, - subst: &[Vec], - depth: usize, - ) -> bool { - let decl = self.declaration(current); - let TypeConnective::Atom( - AtomPayload::ResolvedByStructure(base) | AtomPayload::ResolvedByName(base), - ) = &decl.connective - else { - return false; - }; - self.refinement_base_walk(*base, subst, depth) - } - - fn refinement_base_walk( - &self, - current: DeclarationId, - subst: &[Vec], - depth: usize, - ) -> bool { - if depth >= BUILDER_TYPE_WALK_DEPTH_LIMIT { - return false; - } - let decl = self.declaration(current); - match &decl.connective { - TypeConnective::Atom(AtomPayload::TypeParam(_)) => { - self.lookup_template_argument(current, subst).is_some() - } - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - self.refinement_base_walk(*next, subst, depth + 1) - } - TypeConnective::Instantiation { arguments, .. } => arguments - .iter() - .any(|arg| self.refinement_base_walk(arg.value, subst, depth + 1)), - TypeConnective::Cardinality(p) => { - self.refinement_base_walk(p.element(), subst, depth + 1) - } - _ => false, - } - } - - fn find_equivalent_decl_instantiation( - &self, - template: DeclarationId, - arguments: &[TemplateArgument], - ) -> Option { - self.declarations().iter().find_map(|decl| { - let TypeConnective::Instantiation { - template: existing_template, - arguments: existing_arguments, - } = &decl.connective - else { - return None; - }; - (template == *existing_template - && existing_arguments.len() == arguments.len() - && existing_arguments - .iter() - .zip(arguments.iter()) - .all(|(lhs, rhs)| lhs.parameter == rhs.parameter && lhs.value == rhs.value)) - .then_some(decl.id) - }) - } - - fn find_equivalent_decl_cardinality( - &self, - element: DeclarationId, - bound: CardinalityBound, - ) -> Option { - self.declarations().iter().find_map(|decl| { - let TypeConnective::Cardinality(existing) = &decl.connective else { - return None; - }; - (element == existing.element() && bound == existing.bound()).then_some(decl.id) - }) - } - - fn common_resolved_shape(&self, ports: impl IntoIterator) -> Option { - let mut iter = ports.into_iter(); - let first = self.resolved_port_shape(iter.next()?)?; - for port in iter { - if self.resolved_port_shape(port)? != first { - return None; - } - } - Some(first) - } - - fn assert_transform_inputs(&self, target: &TransformTarget, inputs: &[PortId]) { - self.assert_ports_exist(inputs, "push_transform(inputs)"); - match target { - TransformTarget::Callable(target_decl) => { - self.assert_declaration_exists(*target_decl, "push_transform(target)"); - if let Some(expected_runtime_arity) = self.callable_runtime_arity(*target_decl) { - assert!( - expected_runtime_arity == inputs.len(), - "push_transform(Callable) requires exactly {} runtime input port(s), got {}", - expected_runtime_arity, - inputs.len(), - ); - } - } - TransformTarget::UnresolvedFieldProject { .. } - | TransformTarget::ResolvedFieldProject { .. } => { - assert!( - inputs.len() == 1, - "push_transform(FieldProject) requires exactly one input port" - ); - } - TransformTarget::Operator(_) => { - assert!( - inputs.len() == 2, - "push_transform(Operator) requires exactly two input ports" - ); - } - } - } - - fn assert_fields_exist(&self, fields: &[Field], context: &str) { - for field in fields { - self.assert_declaration_exists(field.ty, context); - } - } - - fn assert_ports_exist(&self, ports: &[PortId], context: &str) { - for port in ports { - self.assert_port_exists(*port, context); - } - } - - fn assert_port_exists(&self, port: PortId, context: &str) { - assert!( - self.port_opt(&port).is_some(), - "{context}: unknown port {:?}", - port - ); - } - - fn assert_node_exists(&self, node: NodeId, context: &str) { - assert!( - self.node_opt(&node).is_some(), - "{context}: unknown node {:?}", - node - ); - } - - fn assert_declaration_exists(&self, decl: DeclarationId, context: &str) { - assert!( - self.declarations.get(decl.index()).is_some(), - "{context}: unknown declaration {:?}", - decl - ); - } -} - -#[cfg(test)] -mod tests { - use super::*; - use crate::dag::literal_bits_int; - use crate::operators::{ArithmeticOp, ComparisonOp, OperatorKind}; - - fn span() -> SourceSpan { - SourceSpan::new("", 0, 0) - } - - fn push_test_declaration( - dag: &mut Dag, - name: Option<&str>, - connective: TypeConnective, - type_params: Vec, - ) -> DeclarationId { - let id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id, - name: name.map(str::to_string), - connective, - type_params, - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span(), - }); - id - } - - #[test] - fn alloc_port_with_shape_marks_port_resolved() { - let mut dag = Dag::new(); - let int_shape = dag.int_shape().expect("bootstrap Int"); - let port = dag.alloc_port_with_shape(int_shape); - let port_ref = dag.port(port); - assert_eq!(port_ref.produced_by, None); - assert_eq!(port_ref.state(), &PortState::Resolved(int_shape)); - } - - #[test] - fn push_value_sets_output_shape_and_producer() { - let mut dag = Dag::new(); - let output = dag.push_value(literal_bits_int(7), span()); - let producer = dag.port(output).produced_by.expect("value producer"); - let value = dag.node(producer).as_value().expect("value node"); - assert_eq!(value.output, output); - assert_eq!(value.data, literal_bits_int(7)); - assert_eq!( - dag.port(output).state(), - &PortState::Resolved(dag.int_shape().expect("bootstrap Int")) - ); - } - - /// Hand-built substrate receipt for `+` as `TransformTarget::Operator`: - /// resolved `Int` output without the compile pipeline. Lowering coverage - /// for surface `+` stays in `m1_substrate_test::m17_operator_lowers_to_structural_transform_target`. - #[test] - fn hand_built_operator_add_transform_carries_structural_target_and_int_shape() { - let mut dag = Dag::new(); - let a = dag.push_value(literal_bits_int(1), span()); - let b = dag.push_value(literal_bits_int(2), span()); - let out = dag.push_transform( - TransformTarget::Operator(OperatorKind::Arithmetic(ArithmeticOp::Add)), - vec![a, b], - span(), - ); - let int_shape = dag.int_shape().expect("bootstrap Int"); - assert_eq!(dag.port(out).state(), &PortState::Resolved(int_shape)); - let producer = dag.port(out).produced_by.expect("transform producer"); - let t = dag.node(producer).as_transform().expect("transform node"); - assert!(matches!( - t.target, - TransformTarget::Operator(OperatorKind::Arithmetic(ArithmeticOp::Add)) - )); - } - - #[test] - fn push_transform_seeds_callable_output_shape() { - let mut dag = Dag::new(); - let int_decl = dag - .declaration_by_name("Int") - .expect("bootstrap Int declaration") - .id; - let input = dag.alloc_port_with_shape(TypeShape::new(int_decl)); - let arrow = push_test_declaration( - &mut dag, - Some("test_arrow"), - TypeConnective::Arrow { - inputs: vec![int_decl], - output: int_decl, - body: ArrowBody::NoBody, - }, - Vec::new(), - ); - let callable = dag.push_atom( - Some("test_callable".to_string()), - AtomPayload::ResolvedByStructure(arrow), - span(), - ); - - let output = dag.push_transform(TransformTarget::Callable(callable), vec![input], span()); - let producer = dag.port(output).produced_by.expect("transform producer"); - let transform = dag.node(producer).as_transform().expect("transform node"); - assert_eq!(transform.output, output); - assert_eq!(transform.inputs, vec![input]); - assert_eq!( - dag.port(output).state(), - &PortState::Resolved(TypeShape::new(int_decl)) - ); - } - - #[test] - fn push_transform_specializes_instantiated_callable_output_shape() { - let mut dag = Dag::new(); - let int_decl = dag - .declaration_by_name("Int") - .expect("bootstrap Int declaration") - .id; - let input = dag.alloc_port_with_shape(TypeShape::new(int_decl)); - let type_param = push_test_declaration( - &mut dag, - None, - TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - Vec::new(), - ); - let generic_callable = push_test_declaration( - &mut dag, - Some("generic_identity"), - TypeConnective::Arrow { - inputs: vec![type_param], - output: type_param, - body: ArrowBody::NoBody, - }, - vec![type_param], - ); - let specialized_callable = push_test_declaration( - &mut dag, - None, - TypeConnective::Instantiation { - template: generic_callable, - arguments: vec![TemplateArgument { - parameter: type_param, - value: int_decl, - }], - }, - Vec::new(), - ); - - let output = dag.push_transform( - TransformTarget::Callable(specialized_callable), - vec![input], - span(), - ); - - assert_eq!( - dag.port(output).state(), - &PortState::Resolved(TypeShape::new(int_decl)) - ); - } - - #[test] - fn push_transform_specializes_nested_instantiated_output_shape() { - let mut dag = Dag::new(); - let int_decl = dag - .declaration_by_name("Int") - .expect("bootstrap Int declaration") - .id; - let input = dag.alloc_port_with_shape(TypeShape::new(int_decl)); - let type_param = push_test_declaration( - &mut dag, - None, - TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - Vec::new(), - ); - let list_template = push_test_declaration( - &mut dag, - Some("TestList"), - TypeConnective::Cardinality(CardinalityPayload::new_unchecked_bypassing_idempotence( - type_param, - CardinalityBound::Unbounded, - )), - vec![type_param], - ); - let list_of_t = push_test_declaration( - &mut dag, - None, - TypeConnective::Instantiation { - template: list_template, - arguments: vec![TemplateArgument { - parameter: type_param, - value: type_param, - }], - }, - Vec::new(), - ); - let list_of_int = push_test_declaration( - &mut dag, - None, - TypeConnective::Instantiation { - template: list_template, - arguments: vec![TemplateArgument { - parameter: type_param, - value: int_decl, - }], - }, - Vec::new(), - ); - let generic_callable = push_test_declaration( - &mut dag, - Some("generic_wrap"), - TypeConnective::Arrow { - inputs: vec![type_param], - output: list_of_t, - body: ArrowBody::NoBody, - }, - vec![type_param], - ); - let specialized_callable = push_test_declaration( - &mut dag, - None, - TypeConnective::Instantiation { - template: generic_callable, - arguments: vec![TemplateArgument { - parameter: type_param, - value: int_decl, - }], - }, - Vec::new(), - ); - - let output = dag.push_transform( - TransformTarget::Callable(specialized_callable), - vec![input], - span(), - ); - - assert_eq!( - dag.port(output).state(), - &PortState::Resolved(TypeShape::new(list_of_int)) - ); - } - - #[test] - fn push_transform_leaves_refined_generic_output_uninferred_without_materialized_carrier() { - let mut dag = Dag::new(); - let int_decl = dag - .declaration_by_name("Int") - .expect("bootstrap Int declaration") - .id; - let bool_decl = dag - .declaration_by_name("Bool") - .expect("bootstrap Bool declaration") - .id; - let input = dag.alloc_port_with_shape(TypeShape::new(int_decl)); - let type_param = push_test_declaration( - &mut dag, - None, - TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - Vec::new(), - ); - let predicate = push_test_declaration( - &mut dag, - None, - TypeConnective::Arrow { - inputs: vec![type_param], - output: bool_decl, - body: ArrowBody::NoBody, - }, - Vec::new(), - ); - let refined_type_param = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: refined_type_param, - name: None, - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(type_param)), - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(predicate), - nominal_opacity: None, - span: span(), - }); - let generic_callable = push_test_declaration( - &mut dag, - Some("generic_refined"), - TypeConnective::Arrow { - inputs: vec![type_param], - output: refined_type_param, - body: ArrowBody::NoBody, - }, - vec![type_param], - ); - let specialized_callable = push_test_declaration( - &mut dag, - None, - TypeConnective::Instantiation { - template: generic_callable, - arguments: vec![TemplateArgument { - parameter: type_param, - value: int_decl, - }], - }, - Vec::new(), - ); - - let output = dag.push_transform( - TransformTarget::Callable(specialized_callable), - vec![input], - span(), - ); - - assert_eq!(dag.port(output).state(), &PortState::Uninferred); - } - - #[test] - fn push_transform_resolved_field_project_seeds_output_from_label_authority() { - let mut dag = Dag::new(); - let int_ty = dag - .declaration_by_name("Int") - .expect("bootstrap Int declaration") - .id; - let bool_ty = dag - .declaration_by_name("Bool") - .expect("bootstrap Bool declaration") - .id; - let point_ty = push_test_declaration( - &mut dag, - Some("Point"), - TypeConnective::Conj { - children: vec![ - Field { - label: "x".to_string(), - ty: int_ty, - }, - Field { - label: "y".to_string(), - ty: bool_ty, - }, - ], - }, - Vec::new(), - ); - let parent = dag.alloc_port_with_shape(TypeShape::new(point_ty)); - - let output = dag.push_transform( - TransformTarget::ResolvedFieldProject { - field_label: "y".to_string(), - }, - vec![parent], - span(), - ); - - assert_eq!( - dag.port(output).state(), - &PortState::Resolved(TypeShape::new(bool_ty)) - ); - } - - #[test] - fn push_transform_unresolved_field_project_does_not_seed_output_shape() { - let mut dag = Dag::new(); - let int_ty = dag - .declaration_by_name("Int") - .expect("bootstrap Int declaration") - .id; - let point_ty = push_test_declaration( - &mut dag, - Some("Point"), - TypeConnective::Conj { - children: vec![Field { - label: "x".to_string(), - ty: int_ty, - }], - }, - Vec::new(), - ); - let parent = dag.alloc_port_with_shape(TypeShape::new(point_ty)); - - let output = dag.push_transform( - TransformTarget::UnresolvedFieldProject { - field_label: "x".to_string(), - }, - vec![parent], - span(), - ); - - assert_eq!(dag.port(output).state(), &PortState::Uninferred); - } - - #[test] - fn push_bind_reuses_supplied_value_port() { - let mut dag = Dag::new(); - let value = dag.push_value(LiteralBits::Bool(true), span()); - let param = dag.alloc_port_with_shape(dag.bool_shape().expect("bootstrap Bool")); - - let bind_id = dag.push_bind("flag", value, vec![param], span()); - let bind = dag.node(bind_id).as_bind().expect("bind node"); - assert_eq!(bind.name, "flag"); - assert_eq!(bind.value, value); - assert_eq!(bind.params, vec![param]); - assert_eq!(bind.result_port(), value); - } - - #[test] - fn push_branch_reuses_arm_shapes_for_output() { - let mut dag = Dag::new(); - let cond = dag.push_value(LiteralBits::Bool(true), span()); - let lhs = dag.push_value(literal_bits_int(1), span()); - let rhs = dag.push_value(literal_bits_int(2), span()); - let lhs_body = dag.push_bind("lhs", lhs, Vec::new(), span()); - let rhs_body = dag.push_bind("rhs", rhs, Vec::new(), span()); - - let output = dag.push_branch( - cond, - vec![ - Path { - body: lhs_body, - output: lhs, - pattern: BranchPattern::UnresolvedVariant { - name: "Left".to_string(), - span: span(), - }, - binding: None, - }, - Path { - body: rhs_body, - output: rhs, - pattern: BranchPattern::UnresolvedVariant { - name: "Right".to_string(), - span: span(), - }, - binding: None, - }, - ], - span(), - ); - - let producer = dag.port(output).produced_by.expect("branch producer"); - let branch = dag.node(producer).as_branch().expect("branch node"); - assert_eq!(branch.input, cond); - assert_eq!(branch.output, output); - assert_eq!(branch.paths.len(), 2); - assert_eq!( - dag.port(output).state(), - &PortState::Resolved(dag.int_shape().expect("bootstrap Int")) - ); - } - - #[test] - fn push_loop_reuses_init_shape_for_output() { - let mut dag = Dag::new(); - let source = dag.push_value(literal_bits_int(4), span()); - let count = dag.push_value(literal_bits_int(8), span()); - let init = dag.push_value(literal_bits_int(0), span()); - let body = dag.push_bind("loop_body", init, Vec::new(), span()); - let bound = LoopBound::Cardinality { count }; - - let output = dag.push_loop(source, init, body, bound, span()); - - let producer = dag.port(output).produced_by.expect("loop producer"); - let loop_node = dag.node(producer).as_loop().expect("loop node"); - assert_eq!(loop_node.source, source); - assert_eq!(loop_node.init, init); - assert_eq!(loop_node.body, body); - assert_eq!(loop_node.bound, LoopBound::Cardinality { count }); - assert_eq!( - dag.port(output).state(), - &PortState::Resolved(dag.int_shape().expect("bootstrap Int")) - ); - } - - #[test] - fn push_conj_allocates_named_record_declaration() { - let mut dag = Dag::new(); - let int_decl = dag - .declaration_by_name("Int") - .expect("bootstrap Int declaration") - .id; - let decl_id = dag.push_conj( - Some("Point".to_string()), - vec![ - Field { - label: "x".to_string(), - ty: int_decl, - }, - Field { - label: "y".to_string(), - ty: int_decl, - }, - ], - span(), - ); - - let decl = dag.declaration(decl_id); - assert_eq!(decl.name.as_deref(), Some("Point")); - let TypeConnective::Conj { children } = &decl.connective else { - panic!("expected Conj declaration"); - }; - assert_eq!(children.len(), 2); - assert_eq!(children[0].label, "x"); - assert_eq!(children[1].label, "y"); - } - - #[test] - fn push_atom_allocates_named_atom_declaration() { - let mut dag = Dag::new(); - let int_decl = dag - .declaration_by_name("Int") - .expect("bootstrap Int declaration") - .id; - let decl_id = dag.push_atom( - Some("IntAlias".to_string()), - AtomPayload::ResolvedByStructure(int_decl), - span(), - ); - - let decl = dag.declaration(decl_id); - assert_eq!(decl.name.as_deref(), Some("IntAlias")); - let TypeConnective::Atom(AtomPayload::ResolvedByStructure(target)) = &decl.connective - else { - panic!("expected Atom(ResolvedByStructure(_)) declaration"); - }; - assert_eq!(*target, int_decl); - } - - #[test] - #[should_panic(expected = "push_transform(Operator) requires exactly two input ports")] - fn push_transform_rejects_wrong_operator_arity() { - let mut dag = Dag::new(); - let lhs = dag.push_value(literal_bits_int(1), span()); - let _ = dag.push_transform( - TransformTarget::Operator(OperatorKind::Arithmetic(ArithmeticOp::Add)), - vec![lhs], - span(), - ); - } - - #[test] - fn push_transform_comparison_uses_bool_shape() { - let mut dag = Dag::new(); - let lhs = dag.push_value(literal_bits_int(1), span()); - let rhs = dag.push_value(literal_bits_int(2), span()); - - let output = dag.push_transform( - TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Lt)), - vec![lhs, rhs], - span(), - ); - - assert_eq!( - dag.port(output).state(), - &PortState::Resolved(dag.bool_shape().expect("bootstrap Bool")) - ); - } - - #[test] - #[should_panic( - expected = "push_transform(Callable) requires exactly 1 runtime input port(s), got 0" - )] - fn push_transform_rejects_wrong_callable_arity() { - let mut dag = Dag::new(); - let int_decl = dag - .declaration_by_name("Int") - .expect("bootstrap Int declaration") - .id; - let callable = push_test_declaration( - &mut dag, - Some("unary"), - TypeConnective::Arrow { - inputs: vec![int_decl], - output: int_decl, - body: ArrowBody::NoBody, - }, - Vec::new(), - ); - - let _ = dag.push_transform(TransformTarget::Callable(callable), Vec::new(), span()); - } - - #[test] - #[should_panic(expected = "push_transform(FieldProject) requires exactly one input port")] - fn push_transform_rejects_resolved_field_project_bad_arity() { - let mut dag = Dag::new(); - - let _ = dag.push_transform( - TransformTarget::ResolvedFieldProject { - field_label: "nodes".to_string(), - }, - vec![], - span(), - ); - } - - /// If substitution leaves the `Cardinality` *element* id unchanged, we must still - /// apply the nested-`AtMostOne` idempotence rule (same as `alloc_cardinality_decl`) - /// *before* returning the outer declaration, or a redundant optional wrapper - /// persists through specialization. - #[test] - fn resolve_decl_with_subst_uses_idempotence_before_noop_subst() { - let mut dag = Dag::new(); - let int_decl = dag.declaration_by_name("Int").expect("bootstrap Int").id; - let opt_int = push_test_declaration( - &mut dag, - None, - TypeConnective::Cardinality(CardinalityPayload::new_unchecked_bypassing_idempotence( - int_decl, - CardinalityBound::AtMostOne, - )), - Vec::new(), - ); - let outer_stale = push_test_declaration( - &mut dag, - None, - TypeConnective::Cardinality(CardinalityPayload::new_unchecked_bypassing_idempotence( - opt_int, - CardinalityBound::AtMostOne, - )), - Vec::new(), - ); - let no_subst: &[Vec] = &[]; - assert_eq!( - dag.resolve_decl_with_subst(outer_stale, no_subst, 0), - Some(opt_int) - ); - } - - #[test] - #[should_panic(expected = "push_branch(path.pattern): unknown declaration")] - fn push_branch_rejects_unknown_resolved_variant() { - let mut dag = Dag::new(); - let cond = dag.push_value(LiteralBits::Bool(true), span()); - let arm_output = dag.push_value(literal_bits_int(1), span()); - let arm_body = dag.push_bind("arm", arm_output, Vec::new(), span()); - - let _ = dag.push_branch( - cond, - vec![Path { - body: arm_body, - output: arm_output, - pattern: BranchPattern::ResolvedVariant(DeclarationId(u32::MAX)), - binding: None, - }], - span(), - ); - } -} diff --git a/src/v3/compiler/src/dag/cardinality_payload.rs b/src/v3/compiler/src/dag/cardinality_payload.rs deleted file mode 100644 index 53bb0e86525..00000000000 --- a/src/v3/compiler/src/dag/cardinality_payload.rs +++ /dev/null @@ -1,38 +0,0 @@ -use super::{CardinalityBound, DeclarationId}; - -/// Payload for [`super::TypeConnective::Cardinality`]. -/// -/// Construction is restricted to `crate::dag::builder` (`alloc_cardinality_decl`) -/// and `bootstrap_*_generated` modules under `dag` -/// (`CardinalityPayload::new_unchecked_bypassing_idempotence`). Any call-site -/// using the constructor by name is, by name, declaring that it is *not* going -/// through `alloc_cardinality_decl`'s nested-`AtMostOne` idempotence rule — -/// either the caller has already applied the rule (e.g. `alloc_cardinality_decl` -/// itself, `type_connective_cardinality`), or the caller is a generated/test -/// surface intentionally minting a raw payload. -#[derive(Debug, Clone)] -pub struct CardinalityPayload { - element: DeclarationId, - bound: CardinalityBound, -} - -impl CardinalityPayload { - /// Bypass-discipline visible at call-site (T-ImpossibleBugs nested-optional - /// codegen-bypass closure, Path B / Director #828): callers MUST either - /// have already applied the `cardinality_idempotent_target` rule, or be a - /// generated/test surface. - pub(in crate::dag) fn new_unchecked_bypassing_idempotence( - element: DeclarationId, - bound: CardinalityBound, - ) -> Self { - Self { element, bound } - } - - pub fn element(&self) -> DeclarationId { - self.element - } - - pub fn bound(&self) -> CardinalityBound { - self.bound - } -} diff --git a/src/v3/compiler/src/dag/effects.rs b/src/v3/compiler/src/dag/effects.rs deleted file mode 100644 index 81f7b892f79..00000000000 --- a/src/v3/compiler/src/dag/effects.rs +++ /dev/null @@ -1,516 +0,0 @@ -//! `std.effects` mirror (DB-18 / Lane 2 Stage 2b). -//! -//! Structural carriers aligned with `src/v3/std/effects.dag` — the -//! compiler-side authority for `compose_effects`, [`WorkflowEffect`], and -//! [`BranchArm`] until the self-hosted pipeline consumes the `.dag` forms -//! directly. -//! -//! Each coproduct / boundary carrier below carries its own 🟢/🟡 -//! dissolution stamp (modeling-discipline principle 4); do not rely on -//! the module banner alone. 🔴 does not appear in this block — there is -//! no intentionally-wrong deferred carrier here; unsupported control -//! flow is modeled via explicit sums, not silent placeholders. -//! -//! The L4b extraction has since grown the native Stage 2 bridge for -//! `Operation`-based effect classification; see `operation_effect_shape` for -//! the live transitional contract and dissolution receipt. - -use std::collections::BTreeMap; -use std::fmt; - -use super::{BoolPortRef, Dag, DeclarationId, ElementRef, NonSingletonList}; - -/// 🟢 **TERMINAL.** HTTP verb literals — 1:1 with `std.effects` `HttpMethod`; -/// naming authority is `effects.dag`. -#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -pub enum HttpMethodScalar { - Get, - Post, - Put, - Patch, - Delete, - Head, - Options, -} - -impl HttpMethodScalar { - pub fn token(self) -> &'static str { - match self { - Self::Get => "GET", - Self::Post => "POST", - Self::Put => "PUT", - Self::Patch => "PATCH", - Self::Delete => "DELETE", - Self::Head => "HEAD", - Self::Options => "OPTIONS", - } - } - - pub fn from_token(token: &str) -> Option { - match token { - "GET" => Some(Self::Get), - "POST" => Some(Self::Post), - "PUT" => Some(Self::Put), - "PATCH" => Some(Self::Patch), - "DELETE" => Some(Self::Delete), - "HEAD" => Some(Self::Head), - "OPTIONS" => Some(Self::Options), - _ => None, - } - } -} - -impl fmt::Display for HttpMethodScalar { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.write_str(self.token()) - } -} - -/// 🟢 **TERMINAL.** Where a stable idempotency key comes from — mirrors -/// `KeySource` in `effects.dag`; no parallel spelling. -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum KeySource { - PathParam { param: String }, - InputField { field: String }, -} - -/// 🟢 **TERMINAL.** Why a create-shaped op is classified breaking — mirrors -/// `CreateCause` in `effects.dag`. -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum CreateCause { - PostAlways, - KeylessFallback { method: HttpMethodScalar }, -} - -/// 🟢 **TERMINAL.** Idempotent-side effect shapes — mirrors `IdempotentShape` -/// in `effects.dag`. -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum IdempotentShape { - ReadEffect, - UpsertEffect { key_source: KeySource }, - DeleteEffect { key_source: KeySource }, -} - -/// 🟢 **TERMINAL.** Breaking-side effect shapes — mirrors `BreakingShape` in -/// `effects.dag`. -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum BreakingShape { - CreateEffect { cause: CreateCause }, - AppendEffect, -} - -/// 🟢 **TERMINAL.** Classified per-op shape — sum of idempotent vs breaking -/// carriers; mirrors `EffectShape` in `effects.dag`. -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum EffectShape { - IsIdempotent(IdempotentShape), - IsBreaking(BreakingShape), -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum EffectClassificationFailure { - StdMethodAnchorResolutionFailed, - UnknownOperationCallable, -} - -/// 🟢 **TERMINAL.** Path token used by `Operation.endpoint.path`; mirrors the -/// path-template authority imported by `services.dag`. -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum UrlPathToken { - LiteralToken { text: String }, - ParamToken { name: String }, -} - -/// 🟢 **TERMINAL.** REST path template carried by `Operation.endpoint`. -#[derive(Debug, Clone, PartialEq, Eq, Default)] -pub struct PathTemplate { - pub tokens: Vec, -} - -/// 🟢 **TERMINAL.** Per-input metadata slot keyed by `Operation.inputs`. -#[derive(Debug, Clone, PartialEq, Eq, Default)] -pub struct InputField {} - -/// 🟡 **TRANSITIONAL.** Native mirror of `services.dag::CallableRef`. -#[derive(Debug, Clone, PartialEq, Eq)] -pub struct CallableRef { - pub decl: DeclarationId, -} - -/// 🟢 **TERMINAL.** Native mirror of `services.dag::RestEndpointBinding`. -#[derive(Debug, Clone, PartialEq, Eq)] -pub struct RestEndpointBinding { - pub method: HttpMethodScalar, - pub path: PathTemplate, -} - -/// 🟢 **TERMINAL.** Canonical service operation row. -/// -/// This intentionally has no authored effect-shape field. Stage 2 derives the -/// effect partition from `endpoint` until callable inhabitance facts are -/// executable through the bootstrapped evaluator. -#[derive(Debug, Clone, PartialEq, Eq)] -pub struct Operation { - pub callable: CallableRef, - pub inputs: BTreeMap, - pub endpoint: RestEndpointBinding, -} - -/// 🟢 **TERMINAL at current Stage 2b scope.** Result of linear -/// `compose_effects` — mirrors `CompositionVerdict` in `effects.dag`. -/// `ElementRef` closes the "copied standalone breaker -/// record" hole by replacing the copied payload with a validated index, -/// but it does not by itself preserve the owner list identity or prove -/// the pointed operation is breaking. Those facts are still established -/// by [`compose_operation_effects`] and by callers resolving against the -/// matching workflow evidence chain, and are tracked as the same -/// constructor-validation asymmetry class as other reflected handles until -/// the substrate grows an owner-bound, breaking-only witness. -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum CompositionVerdict { - IdempotentComposition, - BrokenBy { - first_breaker: ElementRef, - }, -} - -/// 🟢 **TERMINAL.** Branch arm: [`BoolPortRef`] condition + nested workflow body. -/// Construct with [`BranchArm::new`] once [`super::Dag::bool_port_of`] has validated the -/// predicate port. -#[derive(Debug, Clone, PartialEq, Eq)] -pub struct BranchArm { - condition: BoolPortRef, - body: Box, -} - -/// 🟢 **TERMINAL.** Four-variant workflow sum aligned with `effects.dag`; -/// Stage 2b analyzes `LinearEffect` only — non-linear variants surface -/// `IdempotencyUnsupported` until branch-wise algebra lands. -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum WorkflowEffect { - LinearEffect { - ops: Vec, - }, - BranchEffect { - arms: NonSingletonList, - }, - LoopEffect { - body: Box, - }, - ParallelEffect { - branches: NonSingletonList>, - }, -} - -impl BranchArm { - pub fn new(condition: BoolPortRef, body: WorkflowEffect) -> Self { - Self { - condition, - body: Box::new(body), - } - } - - pub fn bool_port(&self) -> BoolPortRef { - self.condition - } - - /// Back-compat alias for the condition field name used in early DB-18 tests. - pub fn branch_predicate(&self) -> BoolPortRef { - self.condition - } - - pub fn body(&self) -> &WorkflowEffect { - &self.body - } -} - -impl WorkflowEffect { - pub fn operation_at(&self, element: ElementRef) -> Option<&Operation> { - match self { - Self::LinearEffect { ops } => element.get(ops), - Self::ParallelEffect { branches } => { - let mut remaining = element.index_of(); - for branch in branches.iter() { - let Self::LinearEffect { ops } = branch.as_ref() else { - return None; - }; - if let Some(op) = ops.get(remaining) { - return Some(op); - } - remaining = remaining.checked_sub(ops.len())?; - } - None - } - Self::BranchEffect { .. } | Self::LoopEffect { .. } => None, - } - } -} - -/// 🟢 **TERMINAL.** Explicit unsupported payload — names variant + stage + -/// reason; not a silent `Option` alongside a verdict. -#[derive(Debug, Clone, PartialEq, Eq)] -pub struct IdempotencyUnsupportedDetail { - pub variant_name: String, - pub downstream_stage: String, - pub reason: String, -} - -/// 🟢 **TERMINAL.** Stage 2b lens report sum — success path vs explicit -/// unsupported; mirrors `WorkflowIdempotencyReport` in `effects.dag`. -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum WorkflowIdempotencyReport { - WorkflowCompositionVerdict(CompositionVerdict), - IdempotencyUnsupported(IdempotencyUnsupportedDetail), -} - -/// 🟢 **TERMINAL.** Stage 2e parallel-lens unsupported classes — mirrors -/// `ParallelismUnsupportedKind` in `effects.dag` (distinct from Stage 2b -/// `IdempotencyUnsupportedDetail.variant_name`). -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum ParallelismUnsupportedKind { - NoWorkflowProjection, - NotParallelEffectRoot, - NonLinearParallelBranch, - PairwiseNonCommute { left: Operation, right: Operation }, - EffectClassificationUnavailable, - LensSurfacePending, -} - -/// 🟢 **TERMINAL.** Parallelism lens explicit unsupported payload — mirrors -/// `ParallelismUnsupportedDetail` in `effects.dag`. -#[derive(Debug, Clone, PartialEq, Eq)] -pub struct ParallelismUnsupportedDetail { - pub kind: ParallelismUnsupportedKind, - pub downstream_stage: String, - pub reason: String, -} - -/// 🟢 **TERMINAL.** Lane 2 Stage 2e parallelism lens report — mirrors -/// `WorkflowParallelismReport` in `effects.dag` (DB-20). -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum WorkflowParallelismReport { - ParallelCompositionVerdict(CompositionVerdict), - ParallelismUnsupported(ParallelismUnsupportedDetail), -} - -// ── Lane 2 Stage 2b — native `Dag` substrate realization (std.effects shape) ── -// -// Authoritative algebra is **authored** in `src/v3/std/effects.dag` -// (`compose_effects`, `lane2_workflow_idempotency_report`, …). -// -// **R3 gate #4 receipt (codex / inline review 2026-05-11):** the §Acceptance -// clause “crate API consumes **emitted/evaluated** `std.effects` as sole -// authority” is **not** satisfied by this Rust alone: in the bootstrapped -// compiler `Dag`, `lane2_workflow_idempotency_report` is still -// `ArrowBody::Unparsed` (see `lane2_stage_2b_db18_test` ratchet below / snapshot -// `Declaration` for that name). Until that body lowers and a host bridge calls -// through `evaluate_body` (or emitted Rust is `include!`d as the sole -// implementation), the compiler keeps one **native** projection here, -// co-located with the structural carriers — **P5** dissolution receipt for the -// **retired parallel module** `workflow_idempotency.rs` (single **P2** -// co-located realization vs a second hand-authored module), not a claim of full -// evaluator-backed dissolution. - -pub fn operation_effect_shape(dag: &Dag, effect: &Operation) -> Option { - classify_operation_effect(dag, effect).ok() -} - -pub(crate) fn classify_operation_effect( - dag: &Dag, - effect: &Operation, -) -> Result { - let callable = effect.callable.decl; - let Some(methods) = StdEffectMethodAnchors::resolve(dag) else { - return Err(EffectClassificationFailure::StdMethodAnchorResolutionFailed); - }; - if callable == methods.append { - return Ok(EffectShape::IsBreaking(BreakingShape::AppendEffect)); - } - if callable == methods.concat { - return Ok(EffectShape::IsBreaking(BreakingShape::CreateEffect { - cause: CreateCause::PostAlways, - })); - } - if methods.reads.contains(&callable) { - return Ok(EffectShape::IsIdempotent(IdempotentShape::ReadEffect)); - } - if methods.upserts.contains(&callable) { - return Ok(keyed_upsert_or_keyless_break(effect)); - } - if callable == methods.delete { - return Ok(keyed_delete_or_keyless_break(effect)); - } - Err(EffectClassificationFailure::UnknownOperationCallable) -} - -struct StdEffectMethodAnchors { - append: DeclarationId, - concat: DeclarationId, - reads: [DeclarationId; 7], - upserts: [DeclarationId; 3], - delete: DeclarationId, -} - -impl StdEffectMethodAnchors { - fn resolve(dag: &Dag) -> Option { - Some(Self { - append: unique_decl_id(dag, "append_method")?, - concat: unique_decl_id(dag, "concat_method")?, - reads: [ - unique_decl_id(dag, "get_method")?, - unique_decl_id(dag, "lookup_method")?, - unique_decl_id(dag, "map_get_method")?, - unique_decl_id(dag, "has_method")?, - unique_decl_id(dag, "map_has_method")?, - unique_decl_id(dag, "count_method")?, - unique_decl_id(dag, "length_method")?, - ], - upserts: [ - unique_decl_id(dag, "map_insert_method")?, - unique_decl_id(dag, "replace_method")?, - unique_decl_id(dag, "with_method")?, - ], - delete: unique_decl_id(dag, "diff_method")?, - }) - } -} - -fn unique_decl_id(dag: &Dag, name: &str) -> Option { - let mut matches = dag - .declarations() - .iter() - .filter(|decl| decl.name.as_deref() == Some(name)) - .map(|decl| decl.id); - let first = matches.next()?; - if matches.next().is_some() { - return None; - } - Some(first) -} - -fn keyed_upsert_or_keyless_break(effect: &Operation) -> EffectShape { - match operation_resource_key(effect) { - Some(param) => EffectShape::IsIdempotent(IdempotentShape::UpsertEffect { - key_source: KeySource::PathParam { param }, - }), - None => keyless_break(effect), - } -} - -fn keyed_delete_or_keyless_break(effect: &Operation) -> EffectShape { - match operation_resource_key(effect) { - Some(param) => EffectShape::IsIdempotent(IdempotentShape::DeleteEffect { - key_source: KeySource::PathParam { param }, - }), - None => keyless_break(effect), - } -} - -fn keyless_break(effect: &Operation) -> EffectShape { - EffectShape::IsBreaking(BreakingShape::CreateEffect { - cause: CreateCause::KeylessFallback { - method: effect.endpoint.method, - }, - }) -} - -fn operation_resource_key(effect: &Operation) -> Option { - last_path_param(effect) -} - -fn last_path_param(effect: &Operation) -> Option { - effect.endpoint.path.tokens.iter().rev().find_map(|token| { - let UrlPathToken::ParamToken { name } = token else { - return None; - }; - effect.inputs.contains_key(name).then(|| name.clone()) - }) -} - -pub(crate) fn compose_operation_effects( - dag: &Dag, - effects: &[Operation], -) -> Result { - for (index, effect) in effects.iter().enumerate() { - if matches!( - classify_operation_effect(dag, effect)?, - EffectShape::IsBreaking(_) - ) { - let first_breaker = ElementRef::from_slice(effects, index) - .expect("enumerated workflow effect index must stay in-bounds"); - return Ok(CompositionVerdict::BrokenBy { first_breaker }); - } - } - Ok(CompositionVerdict::IdempotentComposition) -} - -/// Pure projection used by Stage 2b — kept aligned with -/// `std.effects::report_unsupported_workflow_variant`. Exported for -/// `emit_rust_module` output from `src/v3/lenses/idempotency.dag` (rustc -/// round-trip in `m2_lens_idempotency_migration_test`). -pub fn report_unsupported_workflow_variant( - variant_name: &str, - downstream_stage: &str, - reason: &str, -) -> WorkflowIdempotencyReport { - WorkflowIdempotencyReport::IdempotencyUnsupported(IdempotencyUnsupportedDetail { - variant_name: variant_name.to_string(), - downstream_stage: downstream_stage.to_string(), - reason: reason.to_string(), - }) -} - -/// Native-Dag entry for the `std.effects::lane2_workflow_idempotency_report` -/// algebra (same cases as the `.dag` `match`). -pub fn lane2_workflow_idempotency_report( - dag: &Dag, - workflow: &WorkflowEffect, -) -> WorkflowIdempotencyReport { - project_workflow_idempotency_report(dag, workflow) -} - -pub(crate) fn project_workflow_idempotency_report( - dag: &Dag, - workflow: &WorkflowEffect, -) -> WorkflowIdempotencyReport { - match workflow { - WorkflowEffect::LinearEffect { ops } => match compose_operation_effects(dag, ops.as_slice()) - { - Ok(verdict) => WorkflowIdempotencyReport::WorkflowCompositionVerdict(verdict), - Err( - EffectClassificationFailure::StdMethodAnchorResolutionFailed - | EffectClassificationFailure::UnknownOperationCallable, - ) => { - WorkflowIdempotencyReport::IdempotencyUnsupported(IdempotencyUnsupportedDetail { - variant_name: "LinearEffect".to_string(), - downstream_stage: "lane2_stage2b_idempotency_lens".to_string(), - reason: "std.effects method anchors are missing or ambiguous; operation effect classification cannot safely produce a CompositionVerdict".to_string(), - }) - } - }, - WorkflowEffect::BranchEffect { .. } => WorkflowIdempotencyReport::IdempotencyUnsupported( - IdempotencyUnsupportedDetail { - variant_name: "BranchEffect".to_string(), - downstream_stage: "lane2_stage2b_idempotency_lens".to_string(), - reason: "non-linear workflow; branch-wise idempotency composition is not in the Stage 2b algebra" - .to_string(), - }, - ), - WorkflowEffect::LoopEffect { .. } => WorkflowIdempotencyReport::IdempotencyUnsupported( - IdempotencyUnsupportedDetail { - variant_name: "LoopEffect".to_string(), - downstream_stage: "lane2_stage2b_idempotency_lens".to_string(), - reason: "non-linear workflow; loop-carried idempotency composition is not in the Stage 2b algebra" - .to_string(), - }, - ), - WorkflowEffect::ParallelEffect { .. } => WorkflowIdempotencyReport::IdempotencyUnsupported( - IdempotencyUnsupportedDetail { - variant_name: "ParallelEffect".to_string(), - downstream_stage: "lane2_stage2b_idempotency_lens".to_string(), - reason: "non-linear workflow; parallel idempotency composition is not in the Stage 2b algebra" - .to_string(), - }, - ), - } -} diff --git a/src/v3/compiler/src/dag/ports.rs b/src/v3/compiler/src/dag/ports.rs deleted file mode 100644 index c2c66da017d..00000000000 --- a/src/v3/compiler/src/dag/ports.rs +++ /dev/null @@ -1,216 +0,0 @@ -//! Port + port-reference carriers extracted from `dag.rs` (L4b). -//! -//! Holds [`Port`] itself plus the small handle/witness structs -//! ([`ParamRef`], [`TransformRef`], [`ElementRef`], [`BoolPortRef`]) and -//! the non-trivial-arity list helpers ([`NonEmptyList`], -//! [`NonSingletonList`]). No behavior change — the re-exports in the -//! `dag` module root preserve the external API. - -use std::marker::PhantomData; - -use crate::types::TypeShape; - -use super::{NodeId, PortId, PortState}; - -/// Three-state port type. Illegal combinations of "has a type" and "has a -/// diagnostic" are unrepresentable by type: -/// -/// - `Uninferred`: port exists but inference has not run on it yet. -/// Transitional state during DAG construction and fixpoint iteration. The -/// post-infer sweep drives every port to Resolved or Unresolved before -/// compile_to_dag returns. -/// - `Resolved(TypeShape)`: inference (or lowering from a declaration) has -/// committed to a type. -/// - `Unresolved`: inference or lowering detected a failure and called -/// `Dag::mark_unresolved`. A diagnostic exists in the DiagnosticTable -/// keyed by this port's id. -/// -/// Biconditional (checked by the invariant audit test): -/// state == Unresolved iff diagnostics.contains(port.id()) -/// -/// **Dissolution receipt: TERMINAL.** PortState is substrate, not an annotation. -/// A Port carries a typed value forward in time. -/// -/// `state` has a single authoritative location: the Port struct stored in -/// Dag.ports. There are no stale copies — behaviors hold PortId references, not -/// embedded Ports. -#[derive(Debug, Clone)] -pub struct Port { - pub(super) id: PortId, - pub(super) state: PortState, - pub produced_by: Option, -} - -impl Port { - pub fn id(&self) -> PortId { - self.id - } - - pub fn state(&self) -> &PortState { - &self.state - } - - pub fn state_value(&self) -> PortState { - self.state.clone() - } - - /// Backward-compat accessor: returns `Some(&TypeShape)` for Resolved ports, - /// `None` for Uninferred or Unresolved. Prefer `state()` when you need to - /// distinguish the three cases. - pub fn value_type(&self) -> Option<&TypeShape> { - match &self.state { - PortState::Resolved(ty) => Some(ty), - PortState::Uninferred | PortState::Unresolved => None, - } - } -} - -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -pub struct ParamRef { - pub(super) member: NodeId, - pub(super) slot: usize, -} - -impl ParamRef { - pub fn member_of(self) -> NodeId { - self.member - } - - pub fn slot_of(self) -> usize { - self.slot - } -} - -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -pub struct TransformRef(pub(super) NodeId); - -impl TransformRef { - pub fn node_id(self) -> NodeId { - self.0 - } -} - -/// 🟢 **TERMINAL at current Track 9 scope.** Generic index witness parallel to -/// [`ParamRef`] / [`TransformRef`]. The only Rust constructor is -/// [`ElementRef::from_slice`], which validates the index against the slice in -/// scope. The handle does not retain owner identity after construction, so -/// read sites must still resolve it against the same authority list they -/// validated it against. The substrate field shape matches -/// `src/v3/std/substrate.dag`; direct `.dag` construction gains the same -/// authority in the Lane 3c cycle (ROADMAP Track 9 debt). -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -pub struct ElementRef { - index: usize, - _marker: PhantomData T>, -} - -impl ElementRef { - pub fn index_of(self) -> usize { - self.index - } - - pub fn from_slice(values: &[T], index: usize) -> Option { - values.get(index)?; - Some(Self { - index, - _marker: PhantomData, - }) - } - - pub fn get(self, values: &[T]) -> Option<&T> { - values.get(self.index) - } -} - -/// 🟢 **TERMINAL.** Bool-typed branch predicate port — Track 9 parallel to -/// [`ParamRef`] / [`TransformRef`]. The only Rust constructor is -/// [`super::Dag::bool_port_of`], which checks the port resolves to `Bool`. The -/// substrate field shape matches `src/v3/std/effects.dag`; direct `.dag` -/// construction gains the same authority in the Lane 3c cycle (ROADMAP Track 9 debt). -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -pub struct BoolPortRef { - pub(super) port: PortId, -} - -impl BoolPortRef { - pub fn port_id(self) -> PortId { - self.port - } -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub struct NonEmptyList { - pub first: T, - pub rest: Vec, -} - -impl NonEmptyList { - pub fn from_vec(values: Vec) -> Option { - let mut iter = values.into_iter(); - let first = iter.next()?; - Some(Self { - first, - rest: iter.collect(), - }) - } - - pub fn to_vec(&self) -> Vec - where - T: Clone, - { - std::iter::once(self.first.clone()) - .chain(self.rest.iter().cloned()) - .collect() - } - - pub fn iter(&self) -> impl Iterator { - std::iter::once(&self.first).chain(self.rest.iter()) - } -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub struct NonSingletonList { - pub first: T, - pub second: T, - pub rest: Vec, -} - -impl NonSingletonList { - pub fn from_vec(values: Vec) -> Option { - let mut iter = values.into_iter(); - let first = iter.next()?; - let second = iter.next()?; - Some(Self { - first, - second, - rest: iter.collect(), - }) - } - - pub fn iter(&self) -> impl Iterator { - std::iter::once(&self.first) - .chain(std::iter::once(&self.second)) - .chain(self.rest.iter()) - } - - pub fn len(&self) -> usize { - 2 + self.rest.len() - } - - /// `NonSingletonList` always has at least two elements by construction; - /// this exists to satisfy clippy's `len_without_is_empty` lint and always - /// returns `false`. - pub fn is_empty(&self) -> bool { - false - } - - pub fn to_vec(&self) -> Vec - where - T: Clone, - { - std::iter::once(self.first.clone()) - .chain(std::iter::once(self.second.clone())) - .chain(self.rest.iter().cloned()) - .collect() - } -} diff --git a/src/v3/compiler/src/dag_branch_generated.rs b/src/v3/compiler/src/dag_branch_generated.rs deleted file mode 100644 index 6abf5d36fd0..00000000000 --- a/src/v3/compiler/src/dag_branch_generated.rs +++ /dev/null @@ -1,25 +0,0 @@ -// AUTO-GENERATED from `src/v3/std/substrate.dag`. -// Regenerate instead of hand-editing. - -#[derive(Debug, Clone)] -pub enum BranchPattern { - UnresolvedVariant { - name: String, - span: SourceSpan, - }, - ResolvedVariant(DeclarationId), -} - -#[derive(Debug, Clone)] -pub struct PayloadBinding { - pub binding_name: String, - pub payload_port: PortId, -} - -#[derive(Debug, Clone)] -pub struct Path { - pub body: NodeId, - pub output: PortId, - pub pattern: BranchPattern, - pub binding: Option, -} diff --git a/src/v3/compiler/src/dag_cluster_generated.rs b/src/v3/compiler/src/dag_cluster_generated.rs deleted file mode 100644 index 0f66e6aad21..00000000000 --- a/src/v3/compiler/src/dag_cluster_generated.rs +++ /dev/null @@ -1,29 +0,0 @@ -// AUTO-GENERATED from `src/v3/std/substrate.dag`. -// Regenerate instead of hand-editing. - -#[derive(Debug, Clone, PartialEq, Eq)] -pub struct MemberDescent { - pub param: ParamRef, -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub struct IntraClusterCall { - pub transform: TransformRef, -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub struct Cluster { - pub members: NonSingletonList, - pub intra_cluster_calls: NonEmptyList, -} - -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum LoopBound { - Cardinality { - count: PortId, - }, - Descent { - cluster: ClusterId, - measure: PortId, - }, -} diff --git a/src/v3/compiler/src/dag_cost_generated.rs b/src/v3/compiler/src/dag_cost_generated.rs deleted file mode 100644 index 12dfc61b4c7..00000000000 --- a/src/v3/compiler/src/dag_cost_generated.rs +++ /dev/null @@ -1,312 +0,0 @@ -// AUTO-GENERATED from `src/v3/std/algebra.dag`. -// Regenerate instead of hand-editing. - -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum CollectionSizeEffect { - ShrinkEffect, - ProjectionEffect, - IdentityEffect, -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum CostShape { - ShapeConstant, - ShapeLinearScan, - ShapeIterateBody, - ShapeSortBody, -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub struct MethodContract { - pub algebra_id: DeclarationId, - pub method_id: DeclarationId, - pub size_effect: Option, - pub cost_shape: Option, - pub callback_element_position: Option, -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum DegreeAtLeastTwo { - DegreeTwo, - DegreeSuccessor { previous: Box }, -} - -impl DegreeAtLeastTwo { - pub const TWO: Self = Self::DegreeTwo; - - pub fn new(value: i64) -> Option { - match value { - 2 => Some(Self::DegreeTwo), - v if v > 2 => Some(Self::DegreeSuccessor { - previous: Box::new(Self::new(v - 1)?), - }), - _ => None, - } - } - - pub fn raw(&self) -> i64 { - match self { - Self::DegreeTwo => 2, - Self::DegreeSuccessor { previous } => previous.raw() + 1, - } - } -} - -type BoxedSymbolicCostList = NonSingletonList>; - -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum SymbolicCost { - ConstantCost { _0: i64 }, - LinearCost { _0: SizeVariable }, - PolynomialCost { - var: SizeVariable, - degree: DegreeAtLeastTwo, - }, - ProductCost { _0: BoxedSymbolicCostList }, - SumCost { _0: BoxedSymbolicCostList }, - LogCost { _0: SizeVariable }, - UnknownCost { _0: String }, -} - -#[derive(Debug, Clone)] -pub struct SizeVariable { - pub source_port: PortId, - pub display_name: Option, -} - -impl PartialEq for SizeVariable { - fn eq(&self, other: &Self) -> bool { - self.source_port == other.source_port - } -} - -impl Eq for SizeVariable {} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum AsymptoticClass { - ClassConstant, - ClassLog, - ClassLinear, - ClassLinearithmic, - ClassQuadratic, - ClassPolynomial { degree: PositiveDescentAmount }, - ClassExponential, - ClassUnknown, -} - -pub fn sequential(a: SymbolicCost, b: SymbolicCost) -> SymbolicCost { - normalize(SymbolicCost::SumCost { - _0: boxed_cost_list_pair(a, b), - }) -} - -pub fn iterate(bound: SymbolicCost, body: SymbolicCost) -> SymbolicCost { - normalize(SymbolicCost::ProductCost { - _0: boxed_cost_list_pair(bound, body), - }) -} - -pub fn max_path(paths: &[SymbolicCost]) -> SymbolicCost { - paths - .iter() - .fold(SymbolicCost::ConstantCost { _0: 0 }, |acc, candidate| { - if dominates(candidate, &acc) { - candidate.clone() - } else if dominates(&acc, candidate) { - acc - } else { - sequential(acc, candidate.clone()) - } - }) -} - -pub fn normalize(cost: SymbolicCost) -> SymbolicCost { - match cost { - SymbolicCost::SumCost { _0: terms } => { - reduce_sum(drop_additive_zero_terms(boxed_terms_to_vec(&terms))) - } - SymbolicCost::ProductCost { _0: terms } => { - reduce_product(drop_multiplicative_one(collapse_on_multiplicative_zero( - boxed_terms_to_vec(&terms), - ))) - } - other => other, - } -} - -fn boxed_cost_list_pair(a: SymbolicCost, b: SymbolicCost) -> BoxedSymbolicCostList { - BoxedSymbolicCostList { - first: Box::new(a), - second: Box::new(b), - rest: Vec::new(), - } -} - -fn boxed_terms_to_vec(terms: &BoxedSymbolicCostList) -> Vec { - terms.iter().map(|term| term.as_ref().clone()).collect() -} - -fn drop_additive_zero_terms(terms: Vec) -> Vec { - terms - .into_iter() - .filter(|t| !matches!(t, SymbolicCost::ConstantCost { _0: 0 })) - .collect() -} - -fn collapse_on_multiplicative_zero(terms: Vec) -> Vec { - if terms - .iter() - .any(|t| matches!(t, SymbolicCost::ConstantCost { _0: 0 })) - { - vec![SymbolicCost::ConstantCost { _0: 0 }] - } else { - terms - } -} - -fn drop_multiplicative_one(terms: Vec) -> Vec { - terms - .into_iter() - .filter(|t| !matches!(t, SymbolicCost::ConstantCost { _0: 1 })) - .collect() -} - -fn reduce_sum(mut terms: Vec) -> SymbolicCost { - terms = drop_dominated_in_sum(terms); - match terms.len() { - 0 => SymbolicCost::ConstantCost { _0: 0 }, - 1 => terms.into_iter().next().unwrap(), - _ => SymbolicCost::SumCost { - _0: boxed_cost_list_from_vec(terms), - }, - } -} - -fn reduce_product(terms: Vec) -> SymbolicCost { - match terms.len() { - 0 => SymbolicCost::ConstantCost { _0: 1 }, - 1 => terms.into_iter().next().unwrap(), - 2 => { - let mut iter = terms.into_iter(); - let a = iter.next().unwrap(); - let b = iter.next().unwrap(); - combine_binary_product(a, b) - } - _ => SymbolicCost::ProductCost { - _0: boxed_cost_list_from_vec(terms), - }, - } -} - -fn boxed_cost_list_from_vec(terms: Vec) -> BoxedSymbolicCostList { - NonSingletonList::from_vec(terms.into_iter().map(Box::new).collect()).unwrap() -} - -fn combine_binary_product(a: SymbolicCost, b: SymbolicCost) -> SymbolicCost { - if let (SymbolicCost::LinearCost { _0: va }, SymbolicCost::LinearCost { _0: vb }) = (&a, &b) { - if va == vb { - return SymbolicCost::PolynomialCost { - var: va.clone(), - degree: DegreeAtLeastTwo::TWO, - }; - } - } - SymbolicCost::ProductCost { - _0: boxed_cost_list_pair(a, b), - } -} - -fn drop_dominated_in_sum(terms: Vec) -> Vec { - let mut keep: Vec = Vec::with_capacity(terms.len()); - for term in terms { - let term_dominated = keep.iter().any(|k| dominates(k, &term)); - if term_dominated { - continue; - } - keep.retain(|k| !dominates(&term, k)); - keep.push(term); - } - keep -} - -/// Structural mirror of composite `dominates` in `v3.std.algebra` (`.dag`: -/// `nsl_to_list` + `fold` / `dominate_scan_init` / `fold_or_dominate_scan`; there is -/// no separate `any_dominates` in the `.dag` surface). The Rust helper is the same -/// semantics as an explicit NSL walk over `first` / `second` / `rest`, not a second -/// authority. `ProductCost` / `SumCost` dominate `b` iff any NSL child dominates `b`. -fn any_dominates(terms: &BoxedSymbolicCostList, b: &SymbolicCost) -> bool { - if dominates(terms.first.as_ref(), b) { - return true; - } - if dominates(terms.second.as_ref(), b) { - return true; - } - terms - .rest - .iter() - .any(|child| dominates(child.as_ref(), b)) -} - -pub fn dominates(a: A, b: B) -> bool -where - A: std::borrow::Borrow, - B: std::borrow::Borrow, -{ - let a = a.borrow(); - let b = b.borrow(); - match a { - SymbolicCost::UnknownCost { .. } => true, - SymbolicCost::ConstantCost { .. } => matches!(b, SymbolicCost::ConstantCost { .. }), - SymbolicCost::LinearCost { _0: va } => match b { - SymbolicCost::ConstantCost { .. } | SymbolicCost::LogCost { .. } => true, - SymbolicCost::LinearCost { _0: vb } => va == vb, - SymbolicCost::PolynomialCost { var: _, degree: _ } => false, - _ => false, - }, - SymbolicCost::PolynomialCost { - var: va, - degree: ka, - } => match b { - SymbolicCost::ConstantCost { .. } | SymbolicCost::LogCost { .. } => true, - SymbolicCost::LinearCost { _0: vb } => va == vb, - SymbolicCost::PolynomialCost { - var: vb, - degree: kb, - } => va == vb && ka.raw() >= kb.raw(), - _ => false, - }, - SymbolicCost::LogCost { _0: va } => match b { - SymbolicCost::ConstantCost { .. } => true, - SymbolicCost::LogCost { _0: vb } => va == vb, - _ => false, - }, - SymbolicCost::ProductCost { _0: terms } | SymbolicCost::SumCost { _0: terms } => { - any_dominates(terms, b) - } - } -} - -pub fn classify_symbolic_cost(cost: C) -> AsymptoticClass -where - C: std::borrow::Borrow, -{ - match cost.borrow() { - SymbolicCost::ConstantCost { .. } => AsymptoticClass::ClassConstant, - SymbolicCost::LinearCost { .. } => AsymptoticClass::ClassLinear, - SymbolicCost::LogCost { .. } => AsymptoticClass::ClassLog, - SymbolicCost::PolynomialCost { degree, .. } => { - let raw = degree.raw(); - if raw == 2 { - AsymptoticClass::ClassQuadratic - } else { - match positive_amount_from_i64(raw) { - Some(pos) => AsymptoticClass::ClassPolynomial { degree: pos }, - None => AsymptoticClass::ClassUnknown, - } - } - } - SymbolicCost::ProductCost { .. } - | SymbolicCost::SumCost { .. } - | SymbolicCost::UnknownCost { .. } => AsymptoticClass::ClassUnknown, - } -} diff --git a/src/v3/compiler/src/dag_lookup_generated.rs b/src/v3/compiler/src/dag_lookup_generated.rs deleted file mode 100644 index cba3584cf36..00000000000 --- a/src/v3/compiler/src/dag_lookup_generated.rs +++ /dev/null @@ -1,23 +0,0 @@ -// AUTO-GENERATED from `src/v3/std/lookup.dag`. -// Regenerate instead of hand-editing. - -// Mirror of `v3.std.lookup` — see `DAG_LOOKUP_TEMPLATE` in -// `regen_runtime_mirrors.py`. - -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum Lookup { - Miss, - Hit(T), -} - -/// `v3.std.lookup::miss_int_lookup` (`.dag` authority). -#[inline] -pub fn miss_int_lookup() -> Lookup { - Lookup::Miss -} - -/// `v3.std.lookup::hit_int_lookup` (`.dag` authority). -#[inline] -pub fn hit_int_lookup(n: i64) -> Lookup { - Lookup::Hit(n) -} diff --git a/src/v3/compiler/src/dag_scalar_generated.rs b/src/v3/compiler/src/dag_scalar_generated.rs deleted file mode 100644 index ce0d5e36e84..00000000000 --- a/src/v3/compiler/src/dag_scalar_generated.rs +++ /dev/null @@ -1,96 +0,0 @@ -// AUTO-GENERATED from `src/v3/std/substrate.dag`. -// Regenerate instead of hand-editing. - -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum LiteralBits { - Int(String), - Bool(bool), - String(String), - Symbol(String), -} - -#[derive(Debug, Clone)] -pub enum AtomPayload { - Literal(LiteralBits), - UnresolvedIdentifier(String), - ResolvedByStructure(DeclarationId), - ResolvedByName(DeclarationId), - TypeParam(String), -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum Interval { - BoundedInterval { - lower: D, - width: IntervalWidth, - }, - Unbounded, -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum PositiveIntervalWidth { - OneUnit, - AdditionalUnit { - previous: Box, - }, - UnitCount { - units: i64, - }, -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum IntervalWidth { - ZeroWidth, - PositiveWidth(PositiveIntervalWidth), -} - -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum CardinalityBound { - Exact(u32), - AtMostOne, - Unbounded, -} - -#[derive(Debug, Clone)] -pub struct TemplateArgument { - pub parameter: DeclarationId, - pub value: DeclarationId, -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum PortState { - Uninferred, - Resolved(TypeShape), - Unresolved, -} - -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -pub enum ArithmeticOp { - Add, - Sub, - Mul, - Div, -} - -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -pub enum ComparisonOp { - Eq, - Ne, - Lt, - Le, - Gt, - Ge, -} - -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -pub enum LogicalOp { - And, - Or, -} - -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -pub enum OperatorKind { - Arithmetic(ArithmeticOp), - Comparison(ComparisonOp), - Logical(LogicalOp), -} diff --git a/src/v3/compiler/src/dag_value_body_generated.rs b/src/v3/compiler/src/dag_value_body_generated.rs deleted file mode 100644 index ef36bb73db6..00000000000 --- a/src/v3/compiler/src/dag_value_body_generated.rs +++ /dev/null @@ -1,13 +0,0 @@ -// AUTO-GENERATED from `src/v3/std/substrate.dag`. -// Regenerate instead of hand-editing. - -#[derive(Debug, Clone)] -pub enum ValueBody { - Unparsed(SourceSpan), - Structural { - fields: Vec<(String, FieldValue)>, - }, - Scalar(LiteralBits), - List(Vec), - Map(FieldMap), -} diff --git a/src/v3/compiler/src/diagnostics.rs b/src/v3/compiler/src/diagnostics.rs deleted file mode 100644 index 2a38e7bb49b..00000000000 --- a/src/v3/compiler/src/diagnostics.rs +++ /dev/null @@ -1,1631 +0,0 @@ -// Diagnostics and the enforced mark_unresolved API. -// -// The load-bearing guarantee: -// Port.value_type == None iff DiagnosticTable contains PortId -// -// Enforcement is structural: Dag::clear_port_type is pub(crate) and -// is ONLY called from Dag::mark_unresolved (which also writes the -// diagnostic entry atomically). No other call path can null a port. -// -// G2 guardrail: SourceSpan always carries a non-empty `file` field. -// Cross-artifact diagnostics (M2+ multi-file, multi-language) rely -// on spans being addressable across files. Do NOT replace this with -// a bare (line, col) pair — that forecloses the thesis goal. -// -// ──────────────────────────────────────────────────────────────── -// DEFERRED DISSOLUTION: Diagnostic enum is a scaffold. -// -// Current variants (M0.5): TokenizerError, ParseError, TypeMismatch, -// ArityMismatch, ResolveError. The v3 target shape per -// docs/v3-modeling-analysis.md §CompilerDiagnostic is a 5-field -// record: -// -// Diagnostic { -// span: SourceSpan, -// category: DiagnosticCategory, // Type | Cardinality | ... -// subject: DiagnosticSubject, // typed ref to thing flagged -// detail: DiagnosticDetail, // category-specific payload -// correction: Correction, // live fixed code or explicit deferral -// producing_node: Option, -// } -// -// The `correction` field is the thesis claim "show the correct code" -// (THESIS.md §"Error handling"). Every diagnostic that can structurally -// compute a fix must carry one. Design: SELF_HOSTING.md §14.6. -// Roundtrip test pattern: break → diagnose → apply correction → -// recompile → zero diagnostics. Lands at L1.5. -// -// TRIGGER for dissolution: when typed DeclarationId / FieldRef references -// replace the name + span carriers below. M1(2.5) delivered the -// DeclarationId substrate; the subject/detail refactor is next. -// -// Extension from 3→5 variants at M0.5 is deferred dissolution with -// justification: the fail-closed invariant (C-8) requires that every -// detectable failure produces a diagnostic, and M0's infer + lower -// stages reach failure categories (arity, resolve) that TypeMismatch -// does not cover. Until Subject/Detail infrastructure exists, -// extension is the least-bad interim form. -// -// DO NOT add a severity field. C-8: all diagnostics are errors. -// DO NOT add a warning variant. DO NOT add a "maybe wrong" state. -// If a condition is detected and it's wrong, emit the diagnostic -// and fail. If it's not wrong, emit nothing. There is no middle. -// ──────────────────────────────────────────────────────────────── - -use std::collections::HashMap; - -use crate::dag::{ - AtomPayload, CardinalityBound, Dag, DeclarationId, Field, FieldValue, PortId, TypeConnective, - ValueBody, -}; -use crate::types::TypeShape; - -// `SourceSpan` / `Correction` are generated mirrors of std-owned -// substrate/diagnostic carriers. The compiler-local `Diagnostic` -// taxonomy below remains a narrow host shim until the staged compiler -// adopts the shared std diagnostic record directly. -include!("diagnostics_generated.rs"); - -impl Correction { - pub fn live( - description: impl Into, - span: SourceSpan, - new_source: impl Into, - ) -> Self { - Self::LiveCorrection { - witness: CorrectionWitness { - description: description.into(), - span, - new_source: new_source.into(), - }, - } - } - - pub fn deferred( - reason: impl Into, - owner: impl Into, - exit_condition: impl Into, - ) -> Self { - Self::DeferredCorrection { - reason: reason.into(), - retirement_plan: RetirementPlan { - owner: owner.into(), - exit_condition: exit_condition.into(), - }, - } - } - - pub fn deferred_for_diagnostic_class(class: &'static str) -> Self { - Self::deferred( - format!("{class} does not yet compute a source-level live correction witness"), - "R3 Gap 9 row #106 diagnostic roundtrip coverage", - format!( - "replace this deferral with a generated/data-backed LiveCorrection for {class}" - ), - ) - } - - pub fn live_witness(&self) -> Result<&CorrectionWitness, CorrectionApplyError> { - match self { - Correction::LiveCorrection { witness } => Ok(witness), - Correction::DeferredCorrection { reason, .. } => Err(CorrectionApplyError::Deferred { - reason: reason.clone(), - }), - } - } - - pub fn description(&self) -> &str { - match self { - Correction::LiveCorrection { witness } => &witness.description, - Correction::DeferredCorrection { reason, .. } => reason, - } - } - - pub fn span(&self) -> Option<&SourceSpan> { - match self { - Correction::LiveCorrection { witness } => Some(&witness.span), - Correction::DeferredCorrection { .. } => None, - } - } - - pub fn new_source(&self) -> Option<&str> { - match self { - Correction::LiveCorrection { witness } => Some(&witness.new_source), - Correction::DeferredCorrection { .. } => None, - } - } -} - -/// Stable `ResolveError.name` for a negative `PositiveIntervalWidth.UnitCount.units` payload when -/// lowering bypasses the normal `Nat` literal gate (e.g. tests calling `enforce_non_negative_unit_count_payload` directly). -/// -/// Wording is centralized for tests that assert on [`Diagnostic::ResolveError`] directly (see repo -/// `TESTING.md`, behavior-driven). Primary authoring rejects `-1` via [`Diagnostic::MagnitudeOutOfRange`] -/// against `Nat`'s decimal range facts. -#[doc(hidden)] -pub fn positive_interval_width_unit_count_requires_nonnegative_units_literal_message( - units: &str, -) -> String { - format!("PositiveIntervalWidth.UnitCount requires nonnegative `units` literal; got {units}") -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum CorrectionApplyError { - InvalidSpan { - start: u32, - end: u32, - source_len: usize, - }, - NonCharBoundary { - offset: u32, - }, - Deferred { - reason: String, - }, -} - -#[derive(Debug, Clone)] -pub enum CorrectionValidationError { - Apply(CorrectionApplyError), - Tokenize(Diagnostic), - Parse(Diagnostic), -} - -pub fn apply_correction( - source: &str, - correction: &Correction, -) -> Result { - let witness = correction.live_witness()?; - let start = witness.span.byte_start as usize; - let end = witness.span.byte_end as usize; - if start > end || end > source.len() { - return Err(CorrectionApplyError::InvalidSpan { - start: witness.span.byte_start, - end: witness.span.byte_end, - source_len: source.len(), - }); - } - if !source.is_char_boundary(start) { - return Err(CorrectionApplyError::NonCharBoundary { - offset: witness.span.byte_start, - }); - } - if !source.is_char_boundary(end) { - return Err(CorrectionApplyError::NonCharBoundary { - offset: witness.span.byte_end, - }); - } - - let mut updated = String::with_capacity(source.len() + witness.new_source.len()); - updated.push_str(&source[..start]); - updated.push_str(&witness.new_source); - updated.push_str(&source[end..]); - Ok(updated) -} - -pub fn apply_correction_and_reparse( - source: &str, - file: &str, - correction: &Correction, -) -> Result { - let updated = apply_correction(source, correction).map_err(CorrectionValidationError::Apply)?; - let tokens = - crate::tokenize::tokenize(&updated, file).map_err(CorrectionValidationError::Tokenize)?; - crate::parse::parse(&tokens, file).map_err(CorrectionValidationError::Parse)?; - Ok(updated) -} - -#[derive(Debug, Clone)] -pub enum Diagnostic { - TokenizerError { - message: String, - span: SourceSpan, - correction: Correction, - }, - ParseError { - message: String, - span: SourceSpan, - correction: Correction, - }, - TypeMismatch { - expected: TypeShape, - actual: TypeShape, - span: SourceSpan, - correction: Correction, - }, - ArityMismatch { - function: String, - expected: usize, - actual: usize, - span: SourceSpan, - correction: Correction, - }, - ResolveError { - name: String, - span: SourceSpan, - correction: Correction, - }, - UnitMismatch { - operator: String, - parameter: String, - expected: TypeShape, - actual: TypeShape, - span: SourceSpan, - correction: Correction, - }, - BranchConditionNotBool { - port: PortId, - actual_type: Option, - span: SourceSpan, - correction: Correction, - }, - MagnitudeOutOfRange { - literal: String, - target: String, - range_min_inclusive: String, - range_max_inclusive: String, - expected: TypeShape, - span: SourceSpan, - correction: Correction, - }, - MalformedIntegerRangeFact { - message: String, - span: SourceSpan, - correction: Correction, - }, - NominalOpacityViolation { - declaration: DeclarationId, - accessor: Option, - span: SourceSpan, - correction: Correction, - }, -} - -/// Layer-1 compiler diagnostic kind labels in **declaration order** of [`Diagnostic`]. -/// -/// This is the **only** source of label strings for [`Diagnostic::layer1_kind_label`], which -/// indexes this slice using an exhaustive per-variant index match (no wildcard). Crate tests assert -/// the declaration-order fixture matches those indices; integration tests ratchet -/// `CompilerDiagnosticKind` / `std.verification.DiagnosticKind` in the bootstrap DAG against this -/// slice. When adding a [`Diagnostic`] variant, extend this list, add an index arm next to -/// `layer1_kind_label`, and update the `.dag` closed sums — lens-instance kinds stay on the -/// Layer-2 path (Q6.5), not here. -pub const LAYER1_DIAGNOSTIC_KIND_LABELS: &[&str] = &[ - "TokenizerError", - "ParseError", - "TypeMismatch", - "ArityMismatch", - "ResolveError", - "UnitMismatch", - "BranchConditionNotBool", - "MagnitudeOutOfRange", - "MalformedIntegerRangeFact", - "NominalOpacityViolation", -]; - -impl Diagnostic { - /// Zero-based declaration index for Layer-1 kind strings (same order as [`Diagnostic`] and - /// [`LAYER1_DIAGNOSTIC_KIND_LABELS`]). - /// - /// This match is **exhaustive with no wildcard**: adding a [`Diagnostic`] variant is a compile - /// error until a new arm is authored here **and** [`LAYER1_DIAGNOSTIC_KIND_LABELS`] is extended - /// by one entry. [`Diagnostic::layer1_kind_label`] reads only from that slice, so the label - /// strings have a single authority. - fn layer1_declaration_index(&self) -> usize { - match self { - Diagnostic::TokenizerError { .. } => 0, - Diagnostic::ParseError { .. } => 1, - Diagnostic::TypeMismatch { .. } => 2, - Diagnostic::ArityMismatch { .. } => 3, - Diagnostic::ResolveError { .. } => 4, - Diagnostic::UnitMismatch { .. } => 5, - Diagnostic::BranchConditionNotBool { .. } => 6, - Diagnostic::MagnitudeOutOfRange { .. } => 7, - Diagnostic::MalformedIntegerRangeFact { .. } => 8, - Diagnostic::NominalOpacityViolation { .. } => 9, - } - } - - /// Stable Layer-1 kind name for substrate mirrors and test predicates (Q6.5). - /// - /// Labels come only from [`LAYER1_DIAGNOSTIC_KIND_LABELS`]; an exhaustive per-variant index - /// match selects the row so new enum variants cannot compile without extending the const slice - /// and substrate closed sums. - pub fn layer1_kind_label(&self) -> &'static str { - LAYER1_DIAGNOSTIC_KIND_LABELS[self.layer1_declaration_index()] - } - - pub fn span(&self) -> &SourceSpan { - match self { - Diagnostic::TokenizerError { span, .. } - | Diagnostic::ParseError { span, .. } - | Diagnostic::TypeMismatch { span, .. } - | Diagnostic::ArityMismatch { span, .. } - | Diagnostic::ResolveError { span, .. } - | Diagnostic::UnitMismatch { span, .. } - | Diagnostic::BranchConditionNotBool { span, .. } - | Diagnostic::MagnitudeOutOfRange { span, .. } - | Diagnostic::MalformedIntegerRangeFact { span, .. } - | Diagnostic::NominalOpacityViolation { span, .. } => span, - } - } - - pub fn correction(&self) -> &Correction { - match self { - Diagnostic::TokenizerError { correction, .. } - | Diagnostic::ParseError { correction, .. } - | Diagnostic::TypeMismatch { correction, .. } - | Diagnostic::ArityMismatch { correction, .. } - | Diagnostic::ResolveError { correction, .. } - | Diagnostic::UnitMismatch { correction, .. } - | Diagnostic::BranchConditionNotBool { correction, .. } - | Diagnostic::MagnitudeOutOfRange { correction, .. } - | Diagnostic::MalformedIntegerRangeFact { correction, .. } - | Diagnostic::NominalOpacityViolation { correction, .. } => correction, - } - } - - pub fn message(&self) -> String { - match self { - Diagnostic::TokenizerError { message, .. } | Diagnostic::ParseError { message, .. } => { - message.clone() - } - Diagnostic::TypeMismatch { - expected, actual, .. - } => format!("expected {expected:?}, got {actual:?}"), - Diagnostic::ArityMismatch { - function, - expected, - actual, - .. - } => format!("{function} expected {expected}, got {actual}"), - Diagnostic::ResolveError { name, .. } => name.clone(), - Diagnostic::UnitMismatch { - operator, - parameter, - expected, - actual, - .. - } => format!( - "unit mismatch for operator `{operator}` on phantom parameter `{parameter}`: abelian-group closure requires matching units (expected {expected:?}, got {actual:?})" - ), - Diagnostic::BranchConditionNotBool { actual_type, .. } => match actual_type { - Some(ty) => format!("branch condition port is not Bool (got {ty:?})"), - None => "branch condition port is not Bool (type not resolved)".to_string(), - }, - Diagnostic::MagnitudeOutOfRange { - literal, - target, - range_min_inclusive, - range_max_inclusive, - expected, - .. - } => format!( - "integer literal `{literal}` is out of range for `{target}` (expected {range_min_inclusive}..={range_max_inclusive}, declared type {expected:?}); use a wider target" - ), - Diagnostic::MalformedIntegerRangeFact { message, .. } => message.clone(), - Diagnostic::NominalOpacityViolation { - declaration, - accessor, - .. - } => match accessor { - Some(accessor) => format!( - "nominal-opaque declaration `{declaration:?}` may only be structurally accessed through permitted accessor `{accessor:?}`" - ), - None => format!( - "nominal-opaque declaration `{declaration:?}` cannot be structurally descended without a permitted accessor" - ), - }, - } - } -} - -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum DiagnosticStyleTarget { - Rust, - Go, - Python, -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum DiagnosticRenderError { - MissingLanguageSpec(&'static str), - MissingCleanEmissionContract(&'static str), - MalformedCleanEmissionContract { - declaration: DeclarationId, - detail: &'static str, - }, - MissingCorrectionStyle(&'static str), - MalformedCorrectionStyle { - declaration: DeclarationId, - detail: &'static str, - }, -} -#[derive(Debug, Clone, PartialEq, Eq)] -struct CorrectionStyleBinding { - indent_unit: String, - line_ending: String, - string_quote: String, - trailing_semicolon: bool, -} - -impl CorrectionStyleBinding { - fn build(dag: &Dag, declaration: DeclarationId) -> Result { - let fields = match dag.declaration(declaration).value_body.as_ref() { - Some(crate::dag::ValueBody::Structural { fields }) => fields, - _ => { - return Err(DiagnosticRenderError::MalformedCorrectionStyle { - declaration, - detail: "correction_style declaration must carry a Structural value_body", - }); - } - }; - Ok(Self { - indent_unit: require_string(fields, "indent_unit", declaration)?, - line_ending: require_string(fields, "line_ending", declaration)?, - string_quote: require_string(fields, "string_quote", declaration)?.replace("%Q", "\""), - trailing_semicolon: require_bool(fields, "trailing_semicolon", declaration)?, - }) - } -} - -pub fn render_diagnostic_for_target( - dag: &Dag, - target: DiagnosticStyleTarget, - diagnostic: &Diagnostic, -) -> Result { - let language_spec = language_spec_for_target(dag, target)?; - render_diagnostic_for_language_spec(dag, language_spec, diagnostic) -} - -pub fn render_diagnostic_for_language_spec( - dag: &Dag, - language_spec: DeclarationId, - diagnostic: &Diagnostic, -) -> Result { - let declaration = correction_style_for_language_spec(dag, language_spec)?; - let style = CorrectionStyleBinding::build(dag, declaration)?; - Ok(render_diagnostic_with_style(diagnostic, &style)) -} - -fn language_spec_for_target( - dag: &Dag, - target: DiagnosticStyleTarget, -) -> Result { - let (language_spec, missing_name) = match target { - DiagnosticStyleTarget::Rust => (dag.rust_language_spec(), "rust_language"), - DiagnosticStyleTarget::Go => (dag.go_language_spec(), "go_language"), - DiagnosticStyleTarget::Python => (dag.python_language_spec(), "python_language"), - }; - language_spec.ok_or(DiagnosticRenderError::MissingLanguageSpec(missing_name)) -} - -fn correction_style_for_language_spec( - dag: &Dag, - language_spec: DeclarationId, -) -> Result { - let clean_emission_decl = dag - .target_syntax_bundle_for_language(language_spec) - .map(|bundle| bundle.clean_emission_spec) - .ok_or(DiagnosticRenderError::MissingCleanEmissionContract( - "clean_emission.correction_style", - ))?; - let Some(ValueBody::Structural { fields }) = &dag.declaration(clean_emission_decl).value_body - else { - return Err(DiagnosticRenderError::MalformedCleanEmissionContract { - declaration: clean_emission_decl, - detail: "clean emission declaration must carry a structural value_body", - }); - }; - let value = fields - .iter() - .find(|(label, _)| label == "correction_style") - .map(|(_, value)| value) - .ok_or(DiagnosticRenderError::MissingCorrectionStyle( - "clean_emission.correction_style", - ))?; - match value { - FieldValue::Reference(declaration) => Ok(*declaration), - _ => Err(DiagnosticRenderError::MalformedCleanEmissionContract { - declaration: clean_emission_decl, - detail: "clean emission correction_style field must be a declaration reference", - }), - } -} - -fn render_diagnostic_with_style(diagnostic: &Diagnostic, style: &CorrectionStyleBinding) -> String { - let mut lines = vec![format!( - "ERROR at {}:{}-{}: {}", - diagnostic.span().file, - diagnostic.span().byte_start, - diagnostic.span().byte_end, - diagnostic.message() - )]; - if let Correction::LiveCorrection { .. } = diagnostic.correction() { - lines.push(format!("FIX: {}", diagnostic.correction().description())); - lines.push(render_correction_source(diagnostic.correction(), style)); - } else { - lines.push(format!( - "DEFERRED CORRECTION: {}", - diagnostic.correction().description() - )); - } - lines.join(&style.line_ending) -} - -fn render_correction_source(fix: &Correction, style: &CorrectionStyleBinding) -> String { - let Ok(witness) = fix.live_witness() else { - return String::new(); - }; - let suffix = if style.trailing_semicolon { ";" } else { "" }; - let normalized = witness.new_source.replace("\r\n", "\n").replace('\r', "\n"); - if !normalized.contains('\n') { - return format!( - "{}{}{}{}{}", - style.indent_unit, - style.string_quote, - escape_for_string_literal(&normalized, &style.string_quote), - style.string_quote, - suffix - ); - } - - let body = normalized - .split('\n') - .map(|line| { - format!( - "{}{}", - style.indent_unit, - escape_for_string_literal(line, &style.string_quote) - ) - }) - .collect::>() - .join(&style.line_ending); - format!( - "{}{}{}{}", - style.string_quote, style.line_ending, body, style.string_quote - ) + suffix -} - -fn escape_for_string_literal(source: &str, string_quote: &str) -> String { - let escaped = source.replace('\\', "\\\\"); - if string_quote.is_empty() { - return escaped; - } - escaped.replace(string_quote, &format!("\\{string_quote}")) -} - -fn require_string( - fields: &[(String, FieldValue)], - label: &'static str, - declaration: DeclarationId, -) -> Result { - let value = fields - .iter() - .find(|(field_label, _)| field_label == label) - .map(|(_, value)| value) - .ok_or(DiagnosticRenderError::MalformedCorrectionStyle { - declaration, - detail: "correction_style is missing a required String field", - })?; - match value { - FieldValue::Literal(crate::dag::LiteralBits::String(value)) => Ok(value.clone()), - _ => Err(DiagnosticRenderError::MalformedCorrectionStyle { - declaration, - detail: "correction_style String field must be a string literal", - }), - } -} - -fn require_bool( - fields: &[(String, FieldValue)], - label: &'static str, - declaration: DeclarationId, -) -> Result { - let value = fields - .iter() - .find(|(field_label, _)| field_label == label) - .map(|(_, value)| value) - .ok_or(DiagnosticRenderError::MalformedCorrectionStyle { - declaration, - detail: "correction_style is missing a required Bool field", - })?; - match value { - FieldValue::Literal(crate::dag::LiteralBits::Bool(value)) => Ok(*value), - _ => Err(DiagnosticRenderError::MalformedCorrectionStyle { - declaration, - detail: "correction_style Bool field must be a bool literal", - }), - } -} - -pub(crate) fn declaration_display_name(dag: &Dag, declaration: DeclarationId) -> String { - dag.declaration(declaration) - .name - .clone() - .unwrap_or_else(|| format!("declaration#{}", declaration.raw())) -} - -pub(crate) fn example_source_for_decl(dag: &Dag, declaration: DeclarationId) -> Option { - example_source_for_decl_inner(dag, declaration, 0) -} - -fn example_source_for_decl_inner( - dag: &Dag, - declaration: DeclarationId, - depth: usize, -) -> Option { - if depth >= 8 { - return None; - } - if dag.declaration(declaration).refinement.is_some() { - return None; - } - if let Some(example) = builtin_example_source(dag, declaration, depth) { - return Some(example); - } - let decl = dag.declaration(declaration); - match &decl.connective { - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - example_source_for_decl_inner(dag, *next, depth + 1) - } - TypeConnective::Instantiation { template, .. } => { - example_source_for_decl_inner(dag, *template, depth + 1) - } - TypeConnective::Conj { children } => { - let fields: Option> = children - .iter() - .map(|field| { - Some(format!( - "{}: {}", - field.label, - example_source_for_decl_inner(dag, field.ty, depth + 1)? - )) - }) - .collect(); - Some(format!("{{ {} }}", fields?.join(", "))) - } - TypeConnective::Disj { variants } => variants - .iter() - .find_map(|variant| render_variant_witness(dag, variant, depth + 1)), - TypeConnective::Cardinality(p) if p.bound() == CardinalityBound::AtMostOne => { - Some("None".to_string()) - } - _ => None, - } -} - -fn builtin_example_source(dag: &Dag, declaration: DeclarationId, depth: usize) -> Option { - if dag.int_shape().is_some_and(|shape| { - decl_matches_example_identity(dag, declaration, shape.declaration, depth) - }) { - return Some("1".to_string()); - } - if dag.bool_shape().is_some_and(|shape| { - decl_matches_example_identity(dag, declaration, shape.declaration, depth) - }) { - return Some("true".to_string()); - } - if dag.string_shape().is_some_and(|shape| { - decl_matches_example_identity(dag, declaration, shape.declaration, depth) - }) { - return Some("\"x\"".to_string()); - } - if dag.list_template().is_some_and(|list_template| { - decl_matches_example_identity(dag, declaration, list_template, depth) - }) { - return Some("[]".to_string()); - } - None -} - -fn canonical_decl_for_example( - dag: &Dag, - declaration: DeclarationId, - depth: usize, -) -> Option { - if depth >= 8 { - return None; - } - match &dag.declaration(declaration).connective { - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - canonical_decl_for_example(dag, *next, depth + 1) - } - TypeConnective::Instantiation { template, .. } => { - canonical_decl_for_example(dag, *template, depth + 1) - } - _ => Some(declaration), - } -} - -fn decl_matches_example_identity( - dag: &Dag, - actual: DeclarationId, - expected: DeclarationId, - depth: usize, -) -> bool { - canonical_decl_for_example(dag, actual, depth) - == canonical_decl_for_example(dag, expected, depth) -} - -fn render_variant_witness(dag: &Dag, variant: &Field, depth: usize) -> Option { - if dag.declaration(variant.ty).refinement.is_some() { - return None; - } - let TypeConnective::Conj { children } = &dag.declaration(variant.ty).connective else { - return None; - }; - if children.is_empty() { - return Some(variant.label.clone()); - } - // Constructor invocation in the current `.dag` surface is - // positional (`Variant(arg0, arg1)`), even when the payload - // declaration's fields are named. Preserve declaration-derived - // child order here, but do not invent an unsupported - // `Variant { field: value }` surface until lowering accepts that - // shape structurally. - let payload: Option> = children - .iter() - .map(|field| example_source_for_decl_inner(dag, field.ty, depth + 1)) - .collect(); - Some(format!("{}({})", variant.label, payload?.join(", "))) -} - -pub(crate) fn witness_correction_for_decl( - dag: &Dag, - declaration: DeclarationId, - span: SourceSpan, - description: impl Into, -) -> Option { - if dag.declaration(declaration).refinement.is_some() { - return None; - } - Some(Correction::live( - description, - span, - example_source_for_decl(dag, declaration)?, - )) -} - -/// Opaque, validated witness to a path in the substrate -/// `bootstrap_authority` set declared by -/// `src/v3/std/bootstrap_authority.dag`. Held internally as a -/// `&'static str` because the only minters are the bootstrap loader -/// (`bootstrap_regen_fresh::parse_fixture`) and kernel `Bool` Lane-1e-2b -/// inhabitance wiring (`crate::lower::wire_kernel_bool_boolean_algebra_inhabits`), -/// both of which iterate the `&'static`-keyed authority arrays -/// produced by `build.rs` (`STAGED_FILES`/`V3_SPECS`/`COMPILER_FILES`/ -/// `EXTDEPS_FILES`) — derivations of the same substrate -/// `bootstrap_authority` set. -/// -/// The constructor is deliberately `pub(crate)`. Consumers receive -/// minted keys through [`DiagnosticAttribution::BootstrapAuthority`] -/// and dispatch on witness identity (equality / hash). They MUST NOT -/// rebuild a `BootstrapAuthorityKey` from a `SourceSpan.file` string -/// to recover attribution — that would defeat the witness contract. -/// `path()` is exposed for diagnostic display only. -#[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub struct BootstrapAuthorityKey(&'static str); - -impl BootstrapAuthorityKey { - /// Mint a key from a `&'static str` known to be a row in the - /// substrate `bootstrap_authority` set. Bootstrap-only constructor - /// — see type-level doc for the witness contract. - pub(crate) fn new(path: &'static str) -> Self { - Self(path) - } - - /// Typed witness for the kernel-`Bool` `inhabits` patch authority - /// (`dsl/std/types.dag` row of the substrate `bootstrap_authority` - /// set, classified `StdAuthority`). Encapsulates the path-string so - /// `bootstrap.rs` consumers do not name `dsl/std/types.dag` directly - /// — audit-row #2 retirement (bootstrap.rs slice 1 of 2). Reviewers - /// must treat new `for_*` accessors as additions to the witness - /// surface; each one represents a hand-Rust authority site. - pub(crate) fn for_kernel_bool() -> Self { - Self::new("dsl/std/types.dag") - } - - /// Typed witness for the pipeline-authority row - /// (`src/v3/compiler/pipeline.dag` of the substrate - /// `bootstrap_authority` set, classified `CompilerAuthority`). - /// Encapsulates the path-string so `bootstrap.rs` consumers do not - /// name `src/v3/compiler/pipeline.dag` directly — audit-row #6 - /// retirement (bootstrap.rs slice 1 of 2). - pub(crate) fn for_pipeline_authority() -> Self { - Self::new("src/v3/compiler/pipeline.dag") - } - - /// Canonical bootstrap-authority path. **Display only.** Consumers - /// dispatching on attribution must use witness equality, not this - /// string, to decide bootstrap membership; a string compare against - /// `SourceSpan.file` is precisely the path-string bridge this type - /// dissolves. - /// - /// **Egress-only contract.** This accessor is intentionally a - /// one-way door: a consumer may read the path for diagnostic - /// rendering, but the only way *back* to a `BootstrapAuthorityKey` - /// witness is the `pub(crate)` [`Self::new`] constructor that the - /// bootstrap loader owns. Round-tripping `path()` through some - /// other public constructor is a contract-violation that the type - /// system cannot block on its own; reviewers should treat any new - /// `pub fn from_path` / `From<&str>` impl on this type as the same - /// path-string bridge re-introduced and reject it. - pub fn path(&self) -> &'static str { - self.0 - } -} - -/// Where a diagnostic originated in the bootstrap-vs-user dimension. -/// -/// `Unattributed` is the default for diagnostics raised against -/// user-compile sources or against not-yet-classified internal -/// failures. `BootstrapAuthority` carries an opaque witness that the -/// diagnostic was attached while loading or patching one of the -/// substrate `bootstrap_authority` rows. Verification consumers (e.g. -/// the row-82 `diagnostics_empty_after_bootstrap` ratchet) dispatch on -/// this discriminant rather than scanning `Diagnostic.span().file`. -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum DiagnosticAttribution { - Unattributed, - BootstrapAuthority(BootstrapAuthorityKey), -} - -impl DiagnosticAttribution { - /// `true` iff this diagnostic was attached against a known - /// bootstrap-authority row. Verification surfaces should prefer - /// this over `span.file == "src/v3/std/..."` predicates. - pub fn is_bootstrap(&self) -> bool { - matches!(self, Self::BootstrapAuthority(_)) - } - - /// Borrow the bootstrap-authority witness, when present. - pub fn as_bootstrap_authority(&self) -> Option<&BootstrapAuthorityKey> { - match self { - Self::BootstrapAuthority(key) => Some(key), - Self::Unattributed => None, - } - } -} - -#[derive(Debug, Default, Clone)] -pub struct DiagnosticTable { - entries: HashMap, -} - -impl DiagnosticTable { - pub fn new() -> Self { - Self { - entries: HashMap::new(), - } - } - - pub fn is_empty(&self) -> bool { - self.entries.is_empty() - } - - pub fn contains(&self, port: PortId) -> bool { - self.entries.contains_key(&port) - } - - pub fn get(&self, port: PortId) -> Option<&Diagnostic> { - self.entries.get(&port).map(|(d, _)| d) - } - - /// Borrow the structural attribution recorded alongside a - /// diagnostic. `Some(Unattributed)` for ordinary user-compile - /// failures; `Some(BootstrapAuthority(_))` for diagnostics attached - /// while loading or patching a substrate bootstrap-authority row. - pub fn attribution(&self, port: PortId) -> Option<&DiagnosticAttribution> { - self.entries.get(&port).map(|(_, a)| a) - } - - pub fn len(&self) -> usize { - self.entries.len() - } - - /// Iterate `(port, diagnostic)` pairs. Used by tests and callers - /// that need to scan all diagnostics for a specific kind. For - /// attribution-aware iteration use [`Self::iter_attributed`]. - pub fn iter(&self) -> impl Iterator { - self.entries.iter().map(|(p, (d, _))| (*p, d)) - } - - /// Iterate `(port, diagnostic, attribution)` triples. Verification - /// consumers that need to count or filter by bootstrap attribution - /// without touching `SourceSpan.file` use this surface. - pub fn iter_attributed( - &self, - ) -> impl Iterator { - self.entries.iter().map(|(p, (d, a))| (*p, d, a)) - } - - /// Insert a diagnostic entry for a port. pub(crate) because the - /// only callers are Dag::mark_unresolved* (which atomically also - /// clears the port's value_type) and should never be called - /// independently from outside the crate. - pub(crate) fn insert( - &mut self, - port: PortId, - diagnostic: Diagnostic, - attribution: DiagnosticAttribution, - ) { - self.entries.insert(port, (diagnostic, attribution)); - } -} - -#[cfg(test)] -mod tests { - use super::*; - use crate::types::TypeShape; - - fn layer1_diagnostic_examples_in_declaration_order() -> Vec { - let span = SourceSpan::new("layer1_kind_label_ratchets.v3", 0, 0); - let ty = TypeShape::new(DeclarationId::test_raw(0)); - vec![ - Diagnostic::TokenizerError { - message: String::new(), - span: span.clone(), - correction: Correction::deferred_for_diagnostic_class("TokenizerError"), - }, - Diagnostic::ParseError { - message: String::new(), - span: span.clone(), - correction: Correction::deferred_for_diagnostic_class("ParseError"), - }, - Diagnostic::TypeMismatch { - expected: ty, - actual: ty, - span: span.clone(), - correction: Correction::deferred_for_diagnostic_class("TypeMismatch"), - }, - Diagnostic::ArityMismatch { - function: String::new(), - expected: 0, - actual: 0, - span: span.clone(), - correction: Correction::deferred_for_diagnostic_class("ArityMismatch"), - }, - Diagnostic::ResolveError { - name: String::new(), - span: span.clone(), - correction: Correction::deferred_for_diagnostic_class("ResolveError"), - }, - Diagnostic::UnitMismatch { - operator: String::new(), - parameter: String::new(), - expected: ty, - actual: ty, - span: span.clone(), - correction: Correction::deferred_for_diagnostic_class("UnitMismatch"), - }, - Diagnostic::BranchConditionNotBool { - port: PortId::test_raw(0), - actual_type: None, - span: span.clone(), - correction: Correction::deferred_for_diagnostic_class("BranchConditionNotBool"), - }, - Diagnostic::MagnitudeOutOfRange { - literal: String::new(), - target: String::new(), - range_min_inclusive: String::new(), - range_max_inclusive: String::new(), - expected: ty, - span: span.clone(), - correction: Correction::deferred_for_diagnostic_class("MagnitudeOutOfRange"), - }, - Diagnostic::MalformedIntegerRangeFact { - message: String::new(), - span: span.clone(), - correction: Correction::deferred_for_diagnostic_class("MalformedIntegerRangeFact"), - }, - Diagnostic::NominalOpacityViolation { - declaration: DeclarationId::test_raw(0), - accessor: None, - span, - correction: Correction::deferred_for_diagnostic_class("NominalOpacityViolation"), - }, - ] - } - - #[test] - fn layer1_ordered_labels_match_layer1_kind_label() { - let examples = layer1_diagnostic_examples_in_declaration_order(); - assert_eq!( - examples.len(), - LAYER1_DIAGNOSTIC_KIND_LABELS.len(), - "declaration-order fixture must list every Diagnostic variant exactly once" - ); - let mut seen = std::collections::HashSet::new(); - for (i, diag) in examples.iter().enumerate() { - let idx = diag.layer1_declaration_index(); - assert_eq!( - idx, i, - "fixture must stay in declaration order and match layer1_declaration_index()" - ); - let label = diag.layer1_kind_label(); - assert_eq!(label, LAYER1_DIAGNOSTIC_KIND_LABELS[i]); - assert!(seen.insert(label), "duplicate layer1 label: {label}"); - } - } - - #[test] - fn apply_correction_replaces_the_requested_span() { - let updated = apply_correction( - "let x: Int = 1\n", - &Correction::live( - "replace the literal", - SourceSpan::new("apply_fix.v3", 13, 14), - "2", - ), - ) - .expect("correction should apply"); - assert_eq!(updated, "let x: Int = 2\n"); - } - - #[test] - fn apply_correction_uses_span_offsets_not_file_participation() { - let updated = apply_correction( - "let x: Int = 1\n", - &Correction::live( - "replace the literal", - SourceSpan::new("expected.v3", 13, 14), - "2", - ), - ) - .expect("correction application is offset-bounded, not gated by a separate file string"); - assert_eq!(updated, "let x: Int = 2\n"); - } - - #[test] - fn apply_correction_rejects_non_char_boundaries() { - let source = "let x = \"é\"\n"; - let accent = source.find('é').expect("fixture contains accent") as u32; - let error = apply_correction( - source, - &Correction::live( - "split the accent", - SourceSpan::new("utf8_fix.v3", accent, accent + 1), - "e", - ), - ) - .expect_err("mid-codepoint correction must fail closed"); - assert_eq!( - error, - CorrectionApplyError::NonCharBoundary { offset: accent + 1 } - ); - } - - #[test] - fn apply_correction_and_reparse_surfaces_parse_failures() { - let error = apply_correction_and_reparse( - "let x: Int = 1\n", - "broken_fix.v3", - &Correction::live( - "make the expression malformed", - SourceSpan::new("broken_fix.v3", 13, 14), - ")", - ), - ) - .expect_err("malformed correction should fail closed"); - assert!( - matches!(error, CorrectionValidationError::Parse(_)), - "expected parse failure carrier, got {error:?}" - ); - } - - #[test] - fn clean_emission_contracts_reference_named_correction_styles() { - let dag = Dag::new(); - let assert_reference = - |clean_decl: DeclarationId, expected_style_name: &str, expected_name: &str| { - let fields = match dag - .declaration(clean_decl) - .value_body - .as_ref() - .expect("clean emission carries value_body") - { - crate::dag::ValueBody::Structural { fields } => fields, - other => panic!("clean emission must be structural, got {other:?}"), - }; - let value = fields - .iter() - .find(|(label, _)| label == "correction_style") - .map(|(_, value)| value) - .expect("correction_style field exists"); - match value { - FieldValue::Reference(actual) => assert_eq!( - dag.declaration(*actual).name.as_deref(), - Some(expected_style_name), - "{expected_name} should point at its named correction style" - ), - other => panic!("correction_style must be a Reference, got {other:?}"), - } - }; - assert_reference( - dag.rust_clean_emission_spec().expect("rust clean emission"), - "rust_correction_style", - "rust_clean_emission", - ); - assert_reference( - dag.go_clean_emission_spec().expect("go clean emission"), - "go_correction_style", - "go_clean_emission", - ); - assert_reference( - dag.python_clean_emission_spec() - .expect("python clean emission"), - "python_correction_style", - "python_clean_emission", - ); - } - - #[test] - fn target_syntax_bundles_pair_each_language_with_its_clean_emission_contract() { - let dag = Dag::new(); - let assert_bundle = |language_spec: DeclarationId, - expected_clean_emission: DeclarationId| { - let bundle = dag - .target_syntax_bundle_for_language(language_spec) - .expect("bundle should exist for cached language spec"); - assert_eq!(bundle.language_spec, language_spec); - assert_eq!(bundle.clean_emission_spec, expected_clean_emission); - }; - assert_bundle( - dag.rust_language_spec().expect("rust language"), - dag.rust_clean_emission_spec().expect("rust clean emission"), - ); - assert_bundle( - dag.go_language_spec().expect("go language"), - dag.go_clean_emission_spec().expect("go clean emission"), - ); - assert_bundle( - dag.python_language_spec().expect("python language"), - dag.python_clean_emission_spec() - .expect("python clean emission"), - ); - } - - #[test] - fn example_source_for_decl_uses_cached_structural_identities_not_std_names() { - let mut dag = Dag::new(); - let int_decl = dag.int_shape().expect("int shape").declaration; - let bool_decl = dag.bool_shape().expect("bool shape").declaration; - let string_decl = dag.string_shape().expect("string shape").declaration; - let list_decl = dag.list_template().expect("list template"); - - dag.declaration_mut(int_decl).name = Some("WholeNumber".to_string()); - dag.declaration_mut(bool_decl).name = Some("TruthValue".to_string()); - dag.declaration_mut(string_decl).name = Some("Text".to_string()); - dag.declaration_mut(list_decl).name = Some("Sequence".to_string()); - - let list_instantiation = dag.alloc_declaration_id(); - dag.push_declaration(crate::dag::Declaration { - id: list_instantiation, - name: Some("SequenceOfInt".to_string()), - connective: TypeConnective::Instantiation { - template: list_decl, - arguments: Vec::new(), - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("diagnostics_test.v3", 0, 1), - }); - - assert_eq!( - example_source_for_decl(&dag, int_decl).as_deref(), - Some("1") - ); - assert_eq!( - example_source_for_decl(&dag, bool_decl).as_deref(), - Some("true") - ); - assert_eq!( - example_source_for_decl(&dag, string_decl).as_deref(), - Some("\"x\"") - ); - assert_eq!( - example_source_for_decl(&dag, list_decl).as_deref(), - Some("[]") - ); - assert_eq!( - example_source_for_decl(&dag, list_instantiation).as_deref(), - Some("[]") - ); - } - - #[test] - fn example_source_for_decl_fails_closed_on_refined_record_children() { - let mut dag = Dag::new(); - let int_decl = dag.int_shape().expect("int shape").declaration; - let bool_decl = dag.bool_shape().expect("bool shape").declaration; - - let refined_child = dag.alloc_declaration_id(); - dag.push_declaration(crate::dag::Declaration { - id: refined_child, - name: Some("BigInt".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(int_decl)), - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(bool_decl), - nominal_opacity: None, - span: SourceSpan::new("diagnostics_test.v3", 0, 1), - }); - - let record_decl = dag.alloc_declaration_id(); - dag.push_declaration(crate::dag::Declaration { - id: record_decl, - name: Some("NeedsBig".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "value".to_string(), - ty: refined_child, - }], - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("diagnostics_test.v3", 0, 1), - }); - - assert_eq!(example_source_for_decl(&dag, record_decl), None); - } - - #[test] - fn example_source_for_decl_fails_closed_on_refined_sum_payloads() { - let mut dag = Dag::new(); - let int_decl = dag.int_shape().expect("int shape").declaration; - let bool_decl = dag.bool_shape().expect("bool shape").declaration; - - let refined_child = dag.alloc_declaration_id(); - dag.push_declaration(crate::dag::Declaration { - id: refined_child, - name: Some("BigInt".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(int_decl)), - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(bool_decl), - nominal_opacity: None, - span: SourceSpan::new("diagnostics_test.v3", 0, 1), - }); - - let payload_decl = dag.alloc_declaration_id(); - dag.push_declaration(crate::dag::Declaration { - id: payload_decl, - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "value".to_string(), - ty: refined_child, - }], - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("diagnostics_test.v3", 0, 1), - }); - - let sum_decl = dag.alloc_declaration_id(); - dag.push_declaration(crate::dag::Declaration { - id: sum_decl, - name: Some("MaybeBig".to_string()), - connective: TypeConnective::Disj { - variants: vec![Field { - label: "Some".to_string(), - ty: payload_decl, - }], - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("diagnostics_test.v3", 0, 1), - }); - - assert_eq!(example_source_for_decl(&dag, sum_decl), None); - } - - /// Regression: happy-path payloaded disjunct. Fills the coverage gap - /// the PR #554 loop-health meta-review called out — the existing - /// witness tests cover unpayloaded primitives and fail-closed refined - /// payloads, but no test pinned "Disj with a positional-payload variant - /// renders as `Variant(witness_arg0, witness_arg1, …)`". The walk goes - /// through `render_variant_witness` → `example_source_for_decl_inner` - /// on each payload field, so the assertion exercises the full - /// Disj → Conj → primitive recursion path structurally. - #[test] - fn example_source_for_decl_renders_positional_payload_variant() { - let mut dag = Dag::new(); - let int_decl = dag.int_shape().expect("int shape").declaration; - let bool_decl = dag.bool_shape().expect("bool shape").declaration; - - // Positional payload: fields `_0: Int`, `_1: Bool` — mirrors the - // shape lowering produces for `Cons(Int, Bool)` before any named- - // field surface grammar lands. - let payload_decl = dag.alloc_declaration_id(); - dag.push_declaration(crate::dag::Declaration { - id: payload_decl, - name: None, - connective: TypeConnective::Conj { - children: vec![ - Field { - label: "_0".to_string(), - ty: int_decl, - }, - Field { - label: "_1".to_string(), - ty: bool_decl, - }, - ], - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("diagnostics_test.v3", 0, 1), - }); - - let sum_decl = dag.alloc_declaration_id(); - dag.push_declaration(crate::dag::Declaration { - id: sum_decl, - name: Some("Pair".to_string()), - connective: TypeConnective::Disj { - variants: vec![Field { - label: "Paired".to_string(), - ty: payload_decl, - }], - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("diagnostics_test.v3", 0, 1), - }); - - assert_eq!( - example_source_for_decl(&dag, sum_decl).as_deref(), - Some("Paired(1, true)"), - "payloaded variant witness must recurse structurally through each payload field" - ); - } - - #[test] - fn render_rust_diagnostic_uses_rust_correction_style() { - let dag = Dag::new(); - let rendered = render_diagnostic_for_target( - &dag, - DiagnosticStyleTarget::Rust, - &Diagnostic::ResolveError { - name: "field `c` does not exist on `Point`".to_string(), - span: SourceSpan::new("field.v3", 12, 19), - correction: Correction::live( - "did you mean `point.a`?", - SourceSpan::new("field.v3", 12, 19), - "point.a", - ), - }, - ) - .expect("render"); - assert!(rendered.contains("FIX: did you mean `point.a`?")); - assert!(rendered.contains("\n \"point.a\";")); - } - - #[test] - fn render_deferred_correction_does_not_emit_fix_header() { - let dag = Dag::new(); - let rendered = render_diagnostic_for_target( - &dag, - DiagnosticStyleTarget::Rust, - &Diagnostic::ParseError { - message: "not yet live-correctable".to_string(), - span: SourceSpan::new("deferred.v3", 0, 1), - correction: Correction::deferred_for_diagnostic_class("ParseError"), - }, - ) - .expect("render"); - assert!(rendered.contains("ERROR at deferred.v3:0-1")); - assert!( - !rendered.contains("FIX (option"), - "deferred corrections are explicit residual carriers, not user-facing fixes: {rendered}" - ); - assert!( - rendered.contains("DEFERRED CORRECTION: ParseError does not yet compute"), - "deferred corrections should remain visible without rendering as applyable fixes: {rendered}" - ); - } - - #[test] - fn render_go_diagnostic_uses_go_correction_style() { - let dag = Dag::new(); - let rendered = render_diagnostic_for_target( - &dag, - DiagnosticStyleTarget::Go, - &Diagnostic::ResolveError { - name: "field `c` does not exist on `Point`".to_string(), - span: SourceSpan::new("field.v3", 12, 19), - correction: Correction::live( - "did you mean `point.a`?", - SourceSpan::new("field.v3", 12, 19), - "point.a", - ), - }, - ) - .expect("render"); - assert!(rendered.contains("FIX: did you mean `point.a`?")); - assert!(rendered.contains("\n\t\"point.a\"")); - assert!(!rendered.contains("\n\t\"point.a\";")); - } - - #[test] - fn render_python_diagnostic_uses_python_correction_style() { - let dag = Dag::new(); - let rendered = render_diagnostic_for_target( - &dag, - DiagnosticStyleTarget::Python, - &Diagnostic::ResolveError { - name: "field `c` does not exist on `Point`".to_string(), - span: SourceSpan::new("field.v3", 12, 19), - correction: Correction::live( - "did you mean `point.a`?", - SourceSpan::new("field.v3", 12, 19), - "point.a", - ), - }, - ) - .expect("render"); - assert!(rendered.contains("FIX: did you mean `point.a`?")); - assert!(rendered.contains("\n \"point.a\"")); - assert!(!rendered.contains("\n \"point.a\";")); - } - - #[test] - fn render_rust_diagnostic_escapes_quotes_and_backslashes_in_fix_source() { - let dag = Dag::new(); - let rendered = render_diagnostic_for_target( - &dag, - DiagnosticStyleTarget::Rust, - &Diagnostic::ResolveError { - name: "field `path` does not exist on `Config`".to_string(), - span: SourceSpan::new("field.v3", 12, 19), - correction: Correction::live( - "did you mean `config.path`?", - SourceSpan::new("field.v3", 12, 19), - "config[\"path\\\\name\"]", - ), - }, - ) - .expect("render"); - assert!(rendered.contains("\n \"config[\\\"path\\\\\\\\name\\\"]\";")); - } - - #[test] - fn render_multiline_fix_escapes_quotes_and_backslashes_in_each_line() { - let dag = Dag::new(); - let rendered = render_diagnostic_for_target( - &dag, - DiagnosticStyleTarget::Python, - &Diagnostic::ResolveError { - name: "field `path` does not exist on `Config`".to_string(), - span: SourceSpan::new("field.v3", 12, 19), - correction: Correction::live( - "did you mean `config.path`?", - SourceSpan::new("field.v3", 12, 19), - "config[\n\"path\\\\name\"\n]", - ), - }, - ) - .expect("render"); - assert!(rendered.contains("\"\n config[\n \\\"path\\\\\\\\name\\\"\n ]\"")); - } - - #[test] - fn diagnostic_attribution_default_is_unattributed_and_distinguishes_bootstrap() { - let key_a = BootstrapAuthorityKey::new("src/v3/std/induction.dag"); - let key_b = BootstrapAuthorityKey::new("dsl/std/types.dag"); - - let unattributed = DiagnosticAttribution::Unattributed; - let bootstrap_a = DiagnosticAttribution::BootstrapAuthority(key_a.clone()); - let bootstrap_a_again = DiagnosticAttribution::BootstrapAuthority(key_a.clone()); - let bootstrap_b = DiagnosticAttribution::BootstrapAuthority(key_b.clone()); - - assert!(!unattributed.is_bootstrap()); - assert_eq!(unattributed.as_bootstrap_authority(), None); - - assert!(bootstrap_a.is_bootstrap()); - assert_eq!(bootstrap_a.as_bootstrap_authority(), Some(&key_a)); - - // Witness identity (==) is the consumer dispatch path — no - // `span.file` string compare. - assert_eq!(bootstrap_a, bootstrap_a_again); - assert_ne!(bootstrap_a, bootstrap_b); - assert_ne!(bootstrap_a, unattributed); - } - - #[test] - fn diagnostic_table_round_trips_bootstrap_attribution_per_port() { - // Drive through the public dag attach surface so we exercise - // the same biconditional (`Unresolved port iff diagnostic`) as - // production. `attach_diagnostic` is `pub(crate)`, so this - // test stays in-crate. - let mut dag = Dag::empty(); - let key = BootstrapAuthorityKey::new("src/v3/std/python_method_template_contracts.dag"); - let span = SourceSpan::new("src/v3/std/python_method_template_contracts.dag", 0, 0); - - dag.attach_diagnostic(Diagnostic::ResolveError { - name: "user".to_string(), - span: span.clone(), - correction: Correction::deferred_for_diagnostic_class("ResolveError"), - }); - dag.attach_bootstrap_diagnostic( - key.clone(), - Diagnostic::ResolveError { - name: "bootstrap".to_string(), - span, - correction: Correction::deferred_for_diagnostic_class("ResolveError"), - }, - ); - - let mut unattr_seen = 0usize; - let mut bootstrap_seen = 0usize; - for (_port, diag, attribution) in dag.diagnostics().iter_attributed() { - let Diagnostic::ResolveError { name, .. } = diag else { - panic!("unexpected diagnostic kind: {diag:?}"); - }; - match (name.as_str(), attribution) { - ("user", DiagnosticAttribution::Unattributed) => unattr_seen += 1, - ("bootstrap", DiagnosticAttribution::BootstrapAuthority(k)) => { - assert_eq!(k, &key); - bootstrap_seen += 1; - } - other => panic!("unexpected (name, attribution) pair: {other:?}"), - } - } - assert_eq!(unattr_seen, 1); - assert_eq!(bootstrap_seen, 1); - - let bootstrap_count = dag - .diagnostics() - .iter_attributed() - .filter(|(_, _, a)| a.is_bootstrap()) - .count(); - assert_eq!(bootstrap_count, 1); - } -} diff --git a/src/v3/compiler/src/diagnostics_generated.rs b/src/v3/compiler/src/diagnostics_generated.rs deleted file mode 100644 index a63873a1d63..00000000000 --- a/src/v3/compiler/src/diagnostics_generated.rs +++ /dev/null @@ -1,56 +0,0 @@ -// AUTO-GENERATED from `src/v3/std/substrate.dag, src/v3/std/diagnostics.dag`. -// Regenerate instead of hand-editing. - -#[derive(Debug, Clone, PartialEq, Eq)] -pub struct SourceSpan { - pub file: String, - pub byte_start: u32, - pub byte_end: u32, -} - -impl SourceSpan { - pub fn new(file: impl Into, byte_start: u32, byte_end: u32) -> Self { - Self { - file: file.into(), - byte_start, - byte_end, - } - } -} - -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub struct SourceByteSpan { - pub byte_start: u32, - pub byte_end: u32, -} - -impl SourceByteSpan { - pub const fn new(byte_start: u32, byte_end: u32) -> Self { - Self { - byte_start, - byte_end, - } - } -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub struct CorrectionWitness { - pub description: String, - pub span: SourceSpan, - pub new_source: String, -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub struct RetirementPlan { - pub owner: String, - pub exit_condition: String, -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum Correction { - LiveCorrection { witness: CorrectionWitness }, - DeferredCorrection { - reason: String, - retirement_plan: RetirementPlan, - }, -} diff --git a/src/v3/compiler/src/dimension.rs b/src/v3/compiler/src/dimension.rs deleted file mode 100644 index 467cc7f6bee..00000000000 --- a/src/v3/compiler/src/dimension.rs +++ /dev/null @@ -1,667 +0,0 @@ -//! DB-3 dimension analysis — Lane 2 Stage 2f. -//! -//! Type authority: `src/v3/std/dimensions.dag`, spine order: -//! [`behavior_spine_in_node_order`] (`src/v3/std/workflows.dag`). -//! -//! Symbolic-cost dimension is the first migrated lens: it reuses -//! [`crate::lens_cost_symbolic::symbolic_cost_of`] for per-Behavior -//! witnesses and reports the composed carrier at `workflow_root`'s result -//! port (same query the cost lens answers today). -//! -//! Witnesses are collected only for behaviors **reachable backward** from -//! `workflow_root`'s result port (plus `workflow_root` itself). The symbolic -//! cost lens fold only resolves costs along producer chains in `Dag.nodes` -//! construction order; bootstrap declarations outside the active workflow -//! slice routinely carry `Lookup::Miss` on their result ports even though the -//! user program is well-costed — whole-DAG iteration would false-fail. - -use std::collections::HashSet; - -use crate::dag::{Behavior, Dag, NodeId, PortId, SymbolicCost}; -use crate::diagnostics::{Correction, Diagnostic, SourceSpan}; -use crate::lens_cost_symbolic::{lookup_symbolic_cost, SymbolicCostLookup}; - -fn behavior_result_port(b: &Behavior) -> PortId { - match b { - Behavior::Value(v) => v.result_port(), - Behavior::Transform(t) => t.result_port(), - Behavior::Branch(br) => br.result_port(), - Behavior::Loop(l) => l.result_port(), - Behavior::Bind(bind) => bind.result_port(), - } -} - -fn behavior_span(at: &Behavior) -> SourceSpan { - match at { - Behavior::Value(v) => v.span.clone(), - Behavior::Transform(t) => t.span.clone(), - Behavior::Branch(b) => b.span.clone(), - Behavior::Loop(l) => l.span.clone(), - Behavior::Bind(bind) => bind.span.clone(), - } -} - -fn diagnostic_anchor_from_symbolic_cost_query_port( - d: &Dag, - query_port: &PortId, -) -> Option { - let port_ref = d.port_opt(query_port)?; - let producer = port_ref.produced_by?; - d.node_opt(&producer).map(behavior_span) -} - -/// Hint for malformed-producer lookups when emitting [`Diagnostic`] rows from witnesses that only carry -/// [`ViolatesSubject::AtBehavior`] today: the offending behavior's own result [`PortId`] keyed the cost table -/// miss. [`ProducerLookupMissing*`](ViolatesSubject) witnesses have no authoritative query port baked into -/// the substrate residue — callers of [`violates_subject_diagnostic_span`] must pass **`Some(port)`** from -/// the same keyed query as [`lens_cost_symbolic::symbolic_cost_of`](crate::lens_cost_symbolic::symbolic_cost_of). -fn producer_lookup_anchor_hint(subject: &ViolatesSubject) -> Option { - match subject { - ViolatesSubject::AtBehavior(b) => Some(behavior_result_port(b)), - ViolatesSubject::ProducerLookupMissingPort { .. } - | ViolatesSubject::ProducerLookupMissingNode { .. } => None, - } -} - -/// IDE-/diagnostic-facing span for [`Witness::Violates`] when reporting -/// [`ViolatesSubject::ProducerLookupMissingPort`] / -/// [`ViolatesSubject::ProducerLookupMissingNode`]. -/// -/// Substrate residues name only offending [`PortId`] / [`NodeId`] handles — -/// carrying no source location. [`lens_cost_symbolic::symbolic_cost_of`](crate::lens_cost_symbolic::symbolic_cost_of) -/// is **port-keyed**; pass the **same `port`** it was called with here so diagnostics can anchor at the -/// consumer port's declaring [`Behavior`] (parity with [`ViolatesSubject::AtBehavior`]), instead of the -/// placeholder `malformed_substrate_producer_walk` sentinel used when **`lookup_port`** is unavailable. -/// -/// [`ViolatesSubject::AtBehavior`]: ignores **`lookup_port`** and always attributes the offending behavior span. -#[must_use] -pub fn violates_subject_diagnostic_span( - d: &Dag, - lookup_port: Option<&PortId>, - subject: &ViolatesSubject, -) -> SourceSpan { - match subject { - ViolatesSubject::AtBehavior(b) => behavior_span(b), - ViolatesSubject::ProducerLookupMissingPort { .. } - | ViolatesSubject::ProducerLookupMissingNode { .. } => lookup_port - .and_then(|p| diagnostic_anchor_from_symbolic_cost_query_port(d, p)) - .unwrap_or_else(|| SourceSpan::new("malformed_substrate_producer_walk", 0, 0)), - } -} - -/// Evidence partition — mirrors `Witness` in `std/dimensions.dag`. -#[derive(Debug, Clone)] -pub enum Witness { - Inhabits(C), - Violates { - reason: String, - subject: ViolatesSubject, - }, -} - -/// 🟢 TERMINAL coproduct (**Practice 4** / `docs/modeling-discipline.md` §4): -/// hand mirror of `ViolatesSubject` in `src/v3/std/dimensions.dag`. Variants are the discriminated outcomes -/// of the producer walk ([`crate::dag::ProducerLookup`]) paired with lawful `Behavior` attribution — not a -/// decomposable record without collapsing P3 fail-closed residue. **Ledger:** dissolution patterns 1–4 in §4 -/// do not apply; substrate + `Witness::Violates.subject` already name the single authority (gate #104). -#[derive(Debug, Clone)] -pub enum ViolatesSubject { - AtBehavior(Behavior), - ProducerLookupMissingPort { port: PortId }, - ProducerLookupMissingNode { producer: NodeId }, -} - -/// Report carrier — mirrors `DimensionReport` in `std/dimensions.dag`. -/// -/// 🟢 TERMINAL (aggregate from DB-3 dimension evaluation; see `dimensions.dag`). -/// Pass/fail partition: success carries `composed`; failure carries `violations` -/// and must not fabricate a carrier when witnesses violate or root composition -/// misses (R2 fail-closed). -#[derive(Debug, Clone)] -pub enum DimensionReport { - DimensionOk { - dimension_name: String, - composed: C, - witnesses: Vec>, - }, - DimensionFail { - dimension_name: String, - violations: Vec, - witnesses: Vec>, - }, -} - -/// Same `Dag.nodes` order as `lenses/cost.dag::compute_symbolic_costs` / -/// `std/workflows.dag::behavior_spine`. -pub fn behavior_spine_in_node_order(d: &Dag) -> &[Behavior] { - d.nodes() -} - -/// Behaviors on the backward dataflow slice from `workflow_root`'s result -/// port, including `workflow_root` itself (the bind / root may not appear as -/// the `produced_by` target of its own result port). -fn workflow_reachable_behavior_ids(d: &Dag, workflow_root: NodeId) -> HashSet { - let mut visited_nodes = HashSet::new(); - let mut visited_ports: HashSet = HashSet::new(); - let mut frontier: Vec = Vec::new(); - - let root_behavior = d.node(workflow_root); - frontier.push(behavior_result_port(root_behavior)); - - while let Some(port) = frontier.pop() { - if !visited_ports.insert(port) { - continue; - } - let Some(producer) = d.port_opt(&port).and_then(|p| p.produced_by) else { - continue; - }; - expand_behavior_backward(d, producer, &mut frontier, &mut visited_nodes); - } - - // Always include the workflow root itself for dimension witnesses (e.g. a - // `Bind` is never the `produced_by` of its own `value` port). Do **not** - // seed `workflow_root` into `visited_nodes` before the walk: when the root - // is a `Transform`, its result port's producer is that same node — an early - // insert would make `expand_behavior_backward` return without enqueueing the - // transform's inputs, shrinking the slice to `{root}` only. - visited_nodes.insert(workflow_root); - visited_nodes -} - -fn expand_behavior_backward( - d: &Dag, - node: NodeId, - frontier: &mut Vec, - visited_nodes: &mut HashSet, -) { - if !visited_nodes.insert(node) { - return; - } - let Some(behavior) = d.node_opt(&node) else { - return; - }; - match behavior { - Behavior::Value(_) => {} - Behavior::Transform(transform) => { - for input in &transform.inputs { - frontier.push(*input); - } - } - Behavior::Branch(branch) => { - frontier.push(branch.input); - for path in &branch.paths { - expand_behavior_backward(d, path.body, frontier, visited_nodes); - frontier.push(path.output); - } - } - Behavior::Loop(loop_node) => { - frontier.push(loop_node.source); - frontier.push(loop_node.init); - if let Some(count) = loop_node.bound.count_port() { - frontier.push(count); - } - expand_behavior_backward(d, loop_node.body, frontier, visited_nodes); - } - Behavior::Bind(bind) => { - for param in &bind.params { - frontier.push(*param); - } - frontier.push(bind.value); - } - } -} - -/// Symbolic-cost dimension analysis — DB-3 dispatch over the cost lens algebra. -/// -/// On success ([`DimensionReport::DimensionOk`]), `composed` is the asymptotic -/// bound at `workflow_root`'s result port. Witnesses walk every reachable -/// [`Behavior`] in [`behavior_spine_in_node_order`] (construction order, -/// filtered to the backward slice from the workflow root). Failure is only -/// [`DimensionReport::DimensionFail`]: there is no fabricated carrier. -pub fn analyze_symbolic_cost_dimension( - d: &Dag, - workflow_root: NodeId, -) -> DimensionReport { - const DIMENSION_NAME: &str = "symbolic_cost"; - let cost_table = crate::lens_cost_symbolic::compute_symbolic_costs(d); - let scope = workflow_reachable_behavior_ids(d, workflow_root); - let mut witnesses = Vec::new(); - for behavior in d.nodes() { - if !scope.contains(&behavior.id()) { - continue; - } - let port = behavior_result_port(behavior); - match lookup_symbolic_cost(&cost_table, &port) { - SymbolicCostLookup::Miss => witnesses.push(Witness::Violates { - reason: "missing symbolic cost for behavior result port".into(), - subject: ViolatesSubject::AtBehavior(behavior.clone()), - }), - SymbolicCostLookup::Hit(cost) => witnesses.push(Witness::Inhabits(cost)), - } - } - - let root = d.node(workflow_root); - let root_lookup = lookup_symbolic_cost(&cost_table, &behavior_result_port(root)); - - let witness_failure = witnesses - .iter() - .any(|w| matches!(w, Witness::Violates { .. })); - - if !witness_failure { - if let SymbolicCostLookup::Hit(composed) = root_lookup { - return DimensionReport::DimensionOk { - dimension_name: DIMENSION_NAME.to_string(), - composed, - witnesses, - }; - } - } - - let mut violations: Vec = witnesses - .iter() - .filter_map(|w| { - let Witness::Violates { reason, subject } = w else { - return None; - }; - Some(Diagnostic::ParseError { - message: format!("symbolic_cost dimension: {reason}"), - span: violates_subject_diagnostic_span( - d, - producer_lookup_anchor_hint(subject).as_ref(), - subject, - ), - correction: Correction::deferred_for_diagnostic_class( - "SymbolicCostDimensionDiagnostic", - ), - }) - }) - .collect(); - - // Root `Miss` normally duplicates a `Witness::Violates` on the workflow root - // (same port as `behavior_result_port(root)`). Only synthesize a diagnostic - // here if the witness spine and root lookup ever disagree (fail-closed). - if matches!(root_lookup, SymbolicCostLookup::Miss) && violations.is_empty() { - violations.push(Diagnostic::ParseError { - message: "symbolic_cost dimension: missing symbolic cost for workflow root result port" - .into(), - span: behavior_span(root), - correction: Correction::deferred_for_diagnostic_class( - "SymbolicCostDimensionDiagnostic", - ), - }); - } - - DimensionReport::DimensionFail { - dimension_name: DIMENSION_NAME.to_string(), - violations, - witnesses, - } -} - -/// PR-E E7 symbolic-cost-only first executable slice: public -/// complexity-analysis entrypoint per -/// `docs/briefs/r3-evaluator-e7-symbolic-cost-only-follow-on-readiness.md`. -/// -/// **Single authority.** Thin wrapper that delegates to -/// [`analyze_symbolic_cost_dimension`] — the lens-spine path that walks -/// reachable behaviors from `workflow_root` via -/// `workflow_reachable_behavior_ids` and looks up each in-scope behavior's -/// result port in one [`crate::lens_cost_symbolic::compute_symbolic_costs`] -/// table via [`crate::lens_cost_symbolic::lookup_symbolic_cost`] (same facts -/// as [`crate::lens_cost_symbolic::symbolic_cost_of`], without rebuilding the -/// table per port). The wrapper exists so the E7 public surface is named -/// the way the dispatch brief locks it (`analyze_complexity` / -/// `analyze_tenant_flow` / `analyze_ifc`) without introducing a -/// parallel analyzer. -/// -/// **Lens-spine, not body-evaluator-driven.** This entrypoint does -/// **not** depend on `eval_node` / `evaluate_body` at all — the -/// symbolic-cost lens (`cost_symbolic_lens_generated.rs`) walks the -/// program DAG structurally and produces `SymbolicCostLookup::Hit(cost)` -/// for every reachable behavior including `Loop`. Even now that -/// `eval_node` dispatches `Behavior::Loop` (E5 landed), this wrapper -/// remains the single-authority complexity entrypoint until -/// `analyze_with_evaluator` (the body-evaluator-driven form) lands; -/// at that point this lens-spine wrapper either dissolves or stays as -/// the not-evaluator-driven path for cost specifically. -/// -/// **Diagnostics.** `DimensionFail.violations` carries typed -/// [`Diagnostic`] entries; tests must assert by typed pattern match, -/// never by parsing `Witness::Violates.reason` strings. -pub fn analyze_complexity(dag: &Dag, workflow_root: NodeId) -> DimensionReport { - analyze_symbolic_cost_dimension(dag, workflow_root) -} - -#[cfg(test)] -mod analyze_complexity_tests { - use super::*; - use crate::dag::{literal_bits_int, Dag, TransformTarget}; - use crate::operators::{ArithmeticOp, OperatorKind}; - - fn span() -> SourceSpan { - SourceSpan::new("analyze_complexity_test", 0, 0) - } - - fn int_add_dag() -> (Dag, NodeId) { - let mut dag = Dag::new(); - let lhs = dag.push_value(literal_bits_int(1), span()); - let rhs = dag.push_value(literal_bits_int(2), span()); - let add_out = dag.push_transform( - TransformTarget::Operator(OperatorKind::Arithmetic(ArithmeticOp::Add)), - vec![lhs, rhs], - span(), - ); - let root = dag.push_bind("sum", add_out, vec![], span()); - (dag, root) - } - - // E7 §test 1 — single-authority: analyze_complexity must produce - // the same DimensionReport as the live analyze_symbolic_cost_dimension - // for the same (dag, workflow_root). Pins that the wrapper does not - // introduce a parallel analyzer. - #[test] - fn analyze_complexity_matches_analyze_symbolic_cost_dimension_for_known_workflow() { - let (dag, root) = int_add_dag(); - - let wrapped = analyze_complexity(&dag, root); - let direct = analyze_symbolic_cost_dimension(&dag, root); - - match (&wrapped, &direct) { - ( - DimensionReport::DimensionOk { - dimension_name: w_name, - composed: w_composed, - witnesses: w_witnesses, - }, - DimensionReport::DimensionOk { - dimension_name: d_name, - composed: d_composed, - witnesses: d_witnesses, - }, - ) => { - assert_eq!(w_name, d_name); - assert_eq!(w_composed, d_composed); - assert_eq!(w_witnesses.len(), d_witnesses.len()); - } - other => { - panic!("expected both branches DimensionOk with matching content, got {other:?}") - } - } - } - - // E7 §test 1 (returns_ok shape check) — DimensionOk arm carries the - // expected dimension_name and a SymbolicCost composed value. - #[test] - fn analyze_complexity_returns_ok_for_bounded_int_add_workflow() { - let (dag, root) = int_add_dag(); - - let report = analyze_complexity(&dag, root); - - let DimensionReport::DimensionOk { - dimension_name, - composed: _, - witnesses, - } = report - else { - panic!("expected DimensionOk for bounded int-add, got {report:?}"); - }; - assert_eq!(dimension_name, "symbolic_cost"); - assert!( - witnesses - .iter() - .all(|w| !matches!(w, Witness::Violates { .. })), - "no Violates witness expected on the happy path", - ); - } - - // E7 §test 2 — fail-closed on missing cost: program with a - // ghost-input transform produces DimensionFail with at least one - // typed Diagnostic::ParseError in violations. Asserted by typed - // pattern match on the Diagnostic enum, never by string parsing. - #[test] - fn analyze_complexity_fails_closed_with_typed_diagnostic_on_missing_cost() { - let mut dag = Dag::new(); - let int_shape = dag.int_shape().expect("bootstrap Int"); - let lhs = dag.push_value(literal_bits_int(1), span()); - let ghost_input = dag.alloc_port_with_shape(int_shape); - let bad_add = dag.push_transform( - TransformTarget::Operator(OperatorKind::Arithmetic(ArithmeticOp::Add)), - vec![lhs, ghost_input], - span(), - ); - let root = dag.push_bind("x", bad_add, vec![], span()); - - let report = analyze_complexity(&dag, root); - - let DimensionReport::DimensionFail { - dimension_name, - violations, - witnesses: _, - } = report - else { - panic!("expected DimensionFail when the cost lens misses a port, got {report:?}"); - }; - assert_eq!(dimension_name, "symbolic_cost"); - assert!( - !violations.is_empty(), - "DimensionFail must carry at least one typed diagnostic", - ); - assert!( - violations - .iter() - .all(|d| matches!(d, Diagnostic::ParseError { .. })), - "every violation must be a typed Diagnostic enum variant, got {violations:?}", - ); - } - - // E7 §test 3 — DimensionFail does not fabricate a `composed` - // carrier. Pattern-matching the `DimensionFail` arm is enough to - // assert this: the field is unreachable on that arm by - // construction. The wrapper preserves the partition. Reuses the - // ghost-input transform pattern from the existing - // `missing_symbolic_cost_surfaces_as_dimension_fail_with_violates_witnesses` - // test so the workflow is well-formed enough for the lens walk. - #[test] - fn analyze_complexity_fail_arm_has_no_composed_field() { - let mut dag = Dag::new(); - let int_shape = dag.int_shape().expect("bootstrap Int"); - let lhs = dag.push_value(literal_bits_int(1), span()); - let ghost_input = dag.alloc_port_with_shape(int_shape); - let bad_add = dag.push_transform( - TransformTarget::Operator(OperatorKind::Arithmetic(ArithmeticOp::Add)), - vec![lhs, ghost_input], - span(), - ); - let root = dag.push_bind("y", bad_add, vec![], span()); - - let report = analyze_complexity(&dag, root); - - match report { - DimensionReport::DimensionFail { .. } => { - // Exhaustive match on this arm: the only fields are - // dimension_name / violations / witnesses. There is no - // `composed` field to fabricate. Pattern coverage IS - // the assertion. - } - DimensionReport::DimensionOk { .. } => { - panic!("expected DimensionFail on a ghost-input workflow, not DimensionOk") - } - } - } - - // E7 §test 6 — typed-diagnostic discipline: every entry in - // DimensionFail.violations must be inspectable as a typed - // Diagnostic enum variant. No to_string / format / regex on the - // human-facing message field beyond non-empty checks. (Test #5 - // from the brief is a discipline rule enforced by reviewer - // convention, not a runtime assertion.) - #[test] - fn analyze_complexity_violation_entries_are_typed_diagnostic_enums() { - let mut dag = Dag::new(); - let int_shape = dag.int_shape().expect("bootstrap Int"); - let lhs = dag.push_value(literal_bits_int(1), span()); - let ghost_input = dag.alloc_port_with_shape(int_shape); - let bad_add = dag.push_transform( - TransformTarget::Operator(OperatorKind::Arithmetic(ArithmeticOp::Add)), - vec![lhs, ghost_input], - span(), - ); - let root = dag.push_bind("z", bad_add, vec![], span()); - - let report = analyze_complexity(&dag, root); - let DimensionReport::DimensionFail { violations, .. } = report else { - panic!("expected DimensionFail for ghost-port workflow"); - }; - - for diagnostic in &violations { - // Exhaustive enum match: every variant of Diagnostic is a - // structural type the test can pattern-match on without - // parsing message content. Non-`ParseError` variants are - // also acceptable typed inhabitants. - let typed = match diagnostic { - Diagnostic::ParseError { message, .. } => !message.is_empty(), - _ => true, - }; - assert!( - typed, - "Diagnostic must carry a non-empty human-facing message; got {diagnostic:?}", - ); - } - } -} - -#[cfg(test)] -mod fail_closed_tests { - use super::*; - use crate::dag::{literal_bits_int, Dag, TransformTarget}; - use crate::operators::{ArithmeticOp, OperatorKind}; - - #[test] - fn missing_symbolic_cost_surfaces_as_dimension_fail_with_violates_witnesses() { - let mut dag = Dag::new(); - let span = SourceSpan::new("dimension_fail_closed_test", 0, 0); - let int_shape = dag.int_shape().expect("bootstrap Int"); - let lhs = dag.push_value(literal_bits_int(1), span.clone()); - let ghost_input = dag.alloc_port_with_shape(int_shape); - let bad_add = dag.push_transform( - TransformTarget::Operator(OperatorKind::Arithmetic(ArithmeticOp::Add)), - vec![lhs, ghost_input], - span.clone(), - ); - let bind_id = dag.push_bind("x", bad_add, vec![], span); - - let report = analyze_symbolic_cost_dimension(&dag, bind_id); - let DimensionReport::DimensionFail { - violations, - witnesses, - .. - } = report - else { - panic!("expected DimensionFail when cost lens misses an input port, got {report:?}"); - }; - - assert!( - violations - .iter() - .any(|v| matches!(v, Diagnostic::ParseError { .. })), - "expected ParseError diagnostics from dimension proof failure, got {violations:?}" - ); - assert!( - witnesses - .iter() - .any(|w| matches!(w, Witness::Violates { .. })), - "expected at least one Violates witness, got {witnesses:?}" - ); - assert!( - witnesses - .iter() - .all(|w| !matches!(w, Witness::Inhabits(SymbolicCost::UnknownCost { .. }))), - "dimension witnesses must not fabricate UnknownCost carriers" - ); - } - - #[test] - fn transform_workflow_root_still_backward_reaches_operand_ports() { - let mut dag = Dag::new(); - let span = SourceSpan::new("transform_root_reach_test", 0, 0); - let lhs = dag.push_value(literal_bits_int(1), span.clone()); - let rhs = dag.push_value(literal_bits_int(2), span.clone()); - let add_out = dag.push_transform( - TransformTarget::Operator(OperatorKind::Arithmetic(ArithmeticOp::Add)), - vec![lhs, rhs], - span, - ); - let transform_root = dag - .port(add_out) - .produced_by - .expect("transform output port wired to its node"); - - let report = analyze_symbolic_cost_dimension(&dag, transform_root); - let DimensionReport::DimensionOk { witnesses, .. } = report else { - panic!("expected DimensionOk for well-wired Int add, got {report:?}"); - }; - assert!( - witnesses.len() >= 3, - "expected transform + two literal witnesses, got {}", - witnesses.len() - ); - } -} - -#[cfg(test)] -mod violates_subject_diagnostic_span_tests { - use super::*; - use crate::dag::{literal_bits_int, Dag, PortId}; - - #[test] - fn producer_lookup_residue_prefers_consumer_behavior_span_when_keyed_port_given() { - let mut dag = Dag::new(); - let anchored = SourceSpan::new("fixture_cost_port.dag", 11, 19); - let value_out = dag.push_value(literal_bits_int(42), anchored.clone()); - let subject = ViolatesSubject::ProducerLookupMissingPort { - port: PortId::test_raw(999), - }; - - assert_eq!( - violates_subject_diagnostic_span(&dag, Some(&value_out), &subject), - anchored - ); - assert_eq!( - violates_subject_diagnostic_span(&dag, None, &subject), - SourceSpan::new("malformed_substrate_producer_walk", 0, 0), - ); - - let node_miss = ViolatesSubject::ProducerLookupMissingNode { - producer: crate::dag::NodeId::from_table_index(424242), - }; - assert_eq!( - violates_subject_diagnostic_span(&dag, Some(&value_out), &node_miss), - anchored - ); - } - - #[test] - fn at_behavior_always_anchors_the_subject_even_if_lookup_hint_differs() { - let mut dag = Dag::new(); - let s1 = SourceSpan::new("subject_behavior.dag", 1, 4); - let s2 = SourceSpan::new("other_port_noise.dag", 77, 88); - let p_subj = dag.push_value(literal_bits_int(11), s1.clone()); - let p_other = dag.push_value(literal_bits_int(22), s2.clone()); - let nid = dag - .port_opt(&p_subj) - .expect("literal port wired") - .produced_by - .expect("value node should produce output port"); - let b_subj = dag.node(nid).clone(); - - assert_eq!( - violates_subject_diagnostic_span( - &dag, - Some(&p_other), - &ViolatesSubject::AtBehavior(b_subj), - ), - s1, - "hint must not override declared subject behavior attribution", - ); - } -} diff --git a/src/v3/compiler/src/emit.rs b/src/v3/compiler/src/emit.rs deleted file mode 100644 index 36730262e91..00000000000 --- a/src/v3/compiler/src/emit.rs +++ /dev/null @@ -1,3992 +0,0 @@ -//! Shared emit entrypoint and Stage 1e scaffolding. -//! -//! **Invariant D-1 (determinism, DB-8):** for fixed inputs `(dag, target)`, -//! successive calls to [`emit`] / [`emit_module`] must produce **byte-identical** -//! text. Mechanical ratchet: `tests/determinism_test.rs` (5× re-emit per matrix -//! row). Violations include unstable map/set iteration, timestamps or `file!()` / -//! `line!()` in emitted source, and path-dependent emission. Single authority for -//! this claim is the emit pipeline plus those tests (`feedback_substrate_principle_audit` Q5). -//! -//! `emit.rs` is the single dispatch surface for all targets. Each -//! `*_target.rs` sibling still contains one target-monolithic -//! implementation body; the behavior-by-behavior lifts planned in α -//! §10 Stages 1e.2–1e.4 will move logic out of those files into -//! generic walker helpers here. Until that dissolution lands, -//! target-private carriers stay inside their target module and no -//! cross-target code should read them. - -pub(crate) mod collection_ops_method_contract; -pub(crate) mod python_target; -pub(crate) mod rust_target; - -use std::collections::{HashMap, HashSet}; - -/// Shared emitter-side mirror of `std.clean_emission.VariantPayloadFieldAccessRule`. -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub(crate) enum VariantPayloadFieldAccessRuleBinding { - AccessFromPayloadBinding, - OverrideNamedFieldsAtBindingSite, -} - -/// Per-payload-port rendering authority used by the emitters. -#[derive(Debug, Clone)] -pub(crate) enum VariantPayloadBinding { - Direct(T), - Fields(HashMap), -} - -impl VariantPayloadBinding { - pub(crate) fn direct(&self) -> Option<&T> { - match self { - Self::Direct(value) => Some(value), - Self::Fields(_) => None, - } - } - - pub(crate) fn field(&self, label: &str) -> Option<&T> { - match self { - Self::Direct(_) => None, - Self::Fields(fields) => fields.get(label), - } - } -} - -pub use self::python_target::EmitPythonError; -use self::rust_target::{EmitError, RealizationCategory, SubstrateMarkerRole}; -use crate::dag::{ - substrate_div_error_type_decl_suppressed_for_emit, - substrate_result_type_decl_suppressed_for_emit, ArrowBody, AtomPayload, Behavior, BindNode, - BranchNode, BranchPattern, CardinalityBound, Declaration, DeclarationId, Field, FieldValue, - LiteralBits, Path, PortId, TemplateArgument, TransformNode, TransformTarget, TypeConnective, - ValueBody, -}; -use crate::infer::strip_refinement_to_base; -use crate::operators::OperatorKind; -use crate::variant_payload::{ - variant_payload_shape, VariantPayloadShape, VariantPayloadShapeLookup, -}; -use crate::Dag; - -/// Recover `MethodEmitTemplate` sum-variant label for `constructor`. -/// -/// Variant constructor declarations in the Dag often have `name: None`; labels -/// live on the parent `Disj` in `emit_model`. Mirrors -/// `pb_method_template_projection::disj_variant_label` (see comment there). -pub(crate) fn method_emit_template_variant_label( - dag: &Dag, - constructor: DeclarationId, -) -> Option<&str> { - let parent = dag.declaration(dag.method_emit_template_decl()?); - let TypeConnective::Disj { variants } = &parent.connective else { - return None; - }; - variants - .iter() - .find(|v| v.ty == constructor) - .map(|v| v.label.as_str()) -} - -/// Result port of a finished `behavior` subgraph — shared by Go and Rust emit -/// paths for [`port_is_consumed_from`] (including `Behavior::Loop` body walks). -pub(super) fn behavior_result_port(behavior: &Behavior) -> PortId { - match behavior { - Behavior::Value(v) => v.result_port(), - Behavior::Transform(t) => t.result_port(), - Behavior::Branch(b) => b.result_port(), - Behavior::Loop(l) => l.result_port(), - Behavior::Bind(b) => b.result_port(), - } -} - -pub(crate) fn div_prelude_reserved_name_collision<'a>( - dag: &Dag, - type_decls: impl IntoIterator, - function_decls: impl IntoIterator, - top_level_binds: impl IntoIterator, - helper_name: &'static str, -) -> Option<&'static str> { - if type_decls.into_iter().any(|decl| { - decl.name.as_deref() == Some("DivError") - && !substrate_div_error_type_decl_suppressed_for_emit(dag, decl) - }) { - return Some("DivError"); - } - function_decls - .into_iter() - .any(|decl| decl.name.as_deref() == Some(helper_name)) - .then_some(helper_name) - .or_else(|| { - top_level_binds - .into_iter() - .any(|bind| bind.name == helper_name) - .then_some(helper_name) - }) -} - -pub(crate) fn decl_uses_substrate_result_or_div_error( - dag: &Dag, - declaration: DeclarationId, - visited: &mut HashSet, -) -> bool { - if !visited.insert(declaration) { - return false; - } - let decl = dag.declaration(declaration); - if substrate_div_error_type_decl_suppressed_for_emit(dag, decl) { - return true; - } - match &decl.connective { - TypeConnective::Instantiation { - template, - arguments, - } => { - substrate_result_type_decl_suppressed_for_emit(dag, dag.declaration(*template)) - || arguments - .iter() - .any(|arg| decl_uses_substrate_result_or_div_error(dag, arg.value, visited)) - } - TypeConnective::Conj { children } | TypeConnective::Disj { variants: children } => children - .iter() - .any(|field| decl_uses_substrate_result_or_div_error(dag, field.ty, visited)), - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - decl_uses_substrate_result_or_div_error(dag, *next, visited) - } - TypeConnective::Cardinality(payload) => { - decl_uses_substrate_result_or_div_error(dag, payload.element(), visited) - } - TypeConnective::Arrow { inputs, output, .. } => { - inputs - .iter() - .any(|input| decl_uses_substrate_result_or_div_error(dag, *input, visited)) - || decl_uses_substrate_result_or_div_error(dag, *output, visited) - } - _ => false, - } -} - -fn dag_needs_go_result_prelude( - dag: &Dag, - type_decls: &[&Declaration], - top_level_binds: &[&BindNode], - function_decls: &[&Declaration], -) -> bool { - type_decls - .iter() - .any(|decl| decl_uses_substrate_result_or_div_error(dag, decl.id, &mut HashSet::new())) - || top_level_binds - .iter() - .any(|bind| port_uses_substrate_result_or_div_error(dag, bind.value)) - || function_decls - .iter() - .any(|decl| decl_uses_substrate_result_or_div_error(dag, decl.id, &mut HashSet::new())) -} - -pub(crate) fn port_uses_substrate_result_or_div_error(dag: &Dag, port: PortId) -> bool { - let Some(ty) = dag.port(port).value_type() else { - return false; - }; - decl_uses_substrate_result_or_div_error(dag, ty.declaration, &mut HashSet::new()) -} - -fn decl_uses_substrate_div_error( - dag: &Dag, - declaration: DeclarationId, - visited: &mut HashSet, -) -> bool { - if !visited.insert(declaration) { - return false; - } - let decl = dag.declaration(declaration); - if substrate_div_error_type_decl_suppressed_for_emit(dag, decl) { - return true; - } - match &decl.connective { - TypeConnective::Instantiation { arguments, .. } => arguments - .iter() - .any(|arg| decl_uses_substrate_div_error(dag, arg.value, visited)), - TypeConnective::Conj { children } | TypeConnective::Disj { variants: children } => children - .iter() - .any(|field| decl_uses_substrate_div_error(dag, field.ty, visited)), - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - decl_uses_substrate_div_error(dag, *next, visited) - } - TypeConnective::Cardinality(payload) => { - decl_uses_substrate_div_error(dag, payload.element(), visited) - } - TypeConnective::Arrow { inputs, output, .. } => { - inputs - .iter() - .any(|input| decl_uses_substrate_div_error(dag, *input, visited)) - || decl_uses_substrate_div_error(dag, *output, visited) - } - _ => false, - } -} - -fn port_uses_substrate_div_error(dag: &Dag, port: PortId) -> bool { - let Some(ty) = dag.port(port).value_type() else { - return false; - }; - decl_uses_substrate_div_error(dag, ty.declaration, &mut HashSet::new()) -} - -pub(crate) fn dag_needs_div_error_prelude( - dag: &Dag, - type_decls: &[&Declaration], - top_level_binds: &[&BindNode], - function_decls: &[&Declaration], -) -> bool { - dag_uses_arithmetic_div(dag, top_level_binds, function_decls) - || type_decls - .iter() - .any(|decl| decl_uses_substrate_div_error(dag, decl.id, &mut HashSet::new())) - || top_level_binds - .iter() - .any(|bind| port_uses_substrate_div_error(dag, bind.value)) - || function_decls - .iter() - .any(|decl| decl_uses_substrate_div_error(dag, decl.id, &mut HashSet::new())) -} - -/// Structural port-liveness walk. Returns true if `target` appears as any port -/// reachable from `root` via producer→input edges (each behavior visits its -/// inputs once; cost is bounded by the body subgraph). -/// -/// Go and Rust emit use this to answer whether an arm body actually consumes a -/// payload binding — **without** scanning rendered source. The contract is a -/// graph fact, so the check stays structural. -/// -/// Ports with no producer (`produced_by = None`, as payload bindings use) are -/// leaves: the walk either hits `target` there or skips an unrelated parameter -/// port. -pub(super) fn port_is_consumed_from(dag: &Dag, root: PortId, target: PortId) -> bool { - if root == target { - return true; - } - let mut visited: HashSet = HashSet::new(); - let mut queue: Vec = vec![root]; - while let Some(port) = queue.pop() { - if !visited.insert(port) { - continue; - } - if port == target { - return true; - } - let Some(producer) = dag.port(port).produced_by else { - continue; - }; - match dag.node(producer) { - Behavior::Value(_) => {} - Behavior::Transform(t) => { - for input in t.inputs.iter().copied() { - queue.push(input); - } - } - Behavior::Branch(b) => { - queue.push(b.input); - for path in &b.paths { - queue.push(path.output); - } - } - Behavior::Loop(l) => { - queue.push(l.source); - queue.push(l.init); - if let Some(count) = l.bound.count_port() { - queue.push(count); - } - queue.push(behavior_result_port(dag.node(l.body))); - } - Behavior::Bind(b) => { - queue.push(b.value); - } - } - } - false -} - -/// Shared lookup failures for the emitter-internal type/operator walk helpers. -/// -/// **Dissolution note — 🟢 TERMINAL (local helper error coproduct).** Two -/// structurally distinct failure modes remain after consolidating the target -/// walkers: either the queried port has no resolved type yet, or the walk -/// reached a target-unsupported / malformed anchor and carries a diagnostic -/// string. The target emitters immediately map this local coproduct into their -/// own public error surfaces, so this enum is an implementation-layer bridge, -/// not a second user-facing authority. -#[derive(Debug, Clone, PartialEq, Eq)] -pub(super) enum SharedEmitLookupError { - UntypedPort(PortId), - Unsupported(String), -} - -pub(super) fn primitive_type_id_for_port_shared( - dag: &Dag, - port: PortId, -) -> Result { - let ts = dag - .port(port) - .value_type() - .ok_or(SharedEmitLookupError::UntypedPort(port))?; - let mut current = ts.declaration; - for _ in 0..32 { - let decl = dag.declaration(current); - if decl.name.is_some() { - return Ok(current); - } - match &decl.connective { - TypeConnective::Instantiation { template, .. } => current = *template, - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => current = *next, - _ => return Ok(current), - } - } - Err(SharedEmitLookupError::Unsupported( - "port type walk exceeded depth 32 — likely a cycle".to_string(), - )) -} - -pub(super) fn walk_to_disj(dag: &Dag, start: DeclarationId) -> Option { - let mut current = start; - for _ in 0..32 { - match &dag.declaration(current).connective { - TypeConnective::Disj { .. } => return Some(current), - TypeConnective::Cardinality(p) if p.bound() == CardinalityBound::AtMostOne => { - return dag.optional_match_disj(current); - } - TypeConnective::Instantiation { template, .. } => current = *template, - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => current = *next, - _ => return None, - } - } - None -} - -pub(super) fn algebra_field_for_operator_shared( - dag: &Dag, - operand_type_id: DeclarationId, - op: OperatorKind, -) -> Result { - let Some(algebra_conj_id) = walk_to_algebra_conj(dag, operand_type_id) else { - return canonical_operator_field_shared(dag, op); - }; - let field_label = crate::operators::algebra_field_name(op); - let children = match &dag.declaration(algebra_conj_id).connective { - TypeConnective::Conj { children } => children, - _ => unreachable!("walk_to_algebra_conj returned a non-Conj"), - }; - if let Some(field) = children.iter().find(|field| field.label == field_label) { - return Ok(field.ty); - } - canonical_operator_field_shared(dag, op) -} - -fn walk_to_algebra_conj(dag: &Dag, start: DeclarationId) -> Option { - let mut current = start; - for _ in 0..32 { - let decl = dag.declaration(current); - match &decl.connective { - TypeConnective::Conj { .. } => return Some(current), - TypeConnective::Instantiation { template, .. } => current = *template, - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => current = *next, - _ => { - if let Some(inh) = decl.inhabits { - current = inh; - } else { - return None; - } - } - } - } - None -} - -fn canonical_operator_field_shared( - dag: &Dag, - op: OperatorKind, -) -> Result { - let ordered_ring_id = dag.ordered_ring_decl().ok_or_else(|| { - SharedEmitLookupError::Unsupported( - "bootstrap is missing the canonical `OrderedRing` declaration".to_string(), - ) - })?; - let ordered_ring = dag.declaration(ordered_ring_id); - let TypeConnective::Conj { children } = &ordered_ring.connective else { - return Err(SharedEmitLookupError::Unsupported( - "`OrderedRing` does not lower to a Conj declaration".to_string(), - )); - }; - let field_label = crate::operators::algebra_field_name(op); - children - .iter() - .find(|field| field.label == field_label) - .map(|field| field.ty) - .ok_or_else(|| { - SharedEmitLookupError::Unsupported(format!( - "`OrderedRing` has no canonical field labeled {field_label}" - )) - }) -} - -#[derive(Debug, Clone, PartialEq, Eq)] -enum GoFieldAccessBinding { - DirectField(String), - AccessorMethod(String), -} - -#[derive(Debug, Clone)] -struct FieldBindingBinding { - access: GoFieldAccessBinding, -} - -#[derive(Debug, Clone)] -struct TypeRealizationBinding { - carrier: String, - fields: HashMap, -} - -#[derive(Debug, Clone)] -struct TypeInstantiationBinding { - carrier: String, -} - -/// Mirrors emit_rust::ParameterDispositionBinding. Go's GC rendering -/// doesn't make borrow/move decisions, so the emitter doesn't act on -/// the value. The field is still required on every CallableRealization -/// (single shared schema with rust.dag), so we parse and validate it -/// fail-closed — a malformed disposition vector is a spec bug, even -/// when this target ignores the result. -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -enum ParameterDispositionBinding { - Borrowed, - Consumed, -} - -#[allow(clippy::enum_variant_names)] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -enum CallableStrategyBinding { - ListEmpty, - ListSingleton, - ListCons, - ListConcat, - ListLength, - ListIsEmpty, - ListFold, - ListMap, - ListFilter, - ListContains, -} - -#[derive(Debug, Clone)] -struct PatternRealizationBinding { - empty_variant: DeclarationId, - cons_variant: DeclarationId, - scrutinee: String, - empty_pattern: String, - cons_pattern: String, - head_expr: String, - tail_expr: String, -} - -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub(crate) enum PatternStrategyBinding { - VectorList, -} - -#[derive(Debug, Clone)] -struct StatementSyntaxBinding { - let_binding: String, -} - -#[derive(Debug, Clone)] -struct ExpressionSyntaxBinding { - field_access: String, - function_call: String, -} - -#[derive(Debug, Clone)] -struct FunctionSyntaxBinding { - definition: String, - param_with_type: String, - param_separator: String, -} - -#[derive(Debug, Clone)] -struct TypeApplicationSyntaxBinding { - optional: String, -} - -#[derive(Debug, Clone)] -struct TypeDefinitionSyntaxBinding { - struct_def: String, - struct_field: String, -} - -#[derive(Debug, Clone)] -struct ValueConstructionSyntaxBinding { - struct_literal: String, - struct_field_init: String, - struct_field_separator: String, - variant_named_construction: String, -} - -#[derive(Debug, Clone)] -struct LiteralSyntaxBinding { - true_keyword: String, - false_keyword: String, - string_delimiter: String, -} - -#[derive(Debug, Clone)] -struct GoLanguageSyntax { - statements: StatementSyntaxBinding, - expressions: ExpressionSyntaxBinding, - functions: FunctionSyntaxBinding, - type_applications: TypeApplicationSyntaxBinding, - type_definitions: TypeDefinitionSyntaxBinding, - values: ValueConstructionSyntaxBinding, - literals: LiteralSyntaxBinding, -} - -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -enum MemoryModelBinding { - ValueOnly, - GarbageCollected, - RefCounted, - OwnershipBased, -} - -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -enum ScopeModelBinding { - LexicalScoping, - DynamicScoping, -} - -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -struct TargetExecutionModelBinding { - memory: MemoryModelBinding, - scope: ScopeModelBinding, -} - -#[derive(Debug, Clone)] -pub(crate) struct SourceFilteringBinding { - excluded_prefixes: Vec, -} - -/// Typed read of `data go_clean_emission: CleanEmissionContract` -/// from `src/v3/spec/go.dag` — the portion this pilot consumes (E-5 -/// / Lane 1 Stage 1c PR 2). Other contract rules land here as their -/// consumers wire in. -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -struct CleanEmissionContractBinding { - pattern_bindings: PatternBindingRuleBinding, - variant_payload_field_access: VariantPayloadFieldAccessRuleBinding, -} - -/// Go-valid slice of `std.clean_emission.PatternBindingRule`. Parsed -/// in `CleanEmissionContractBinding::build`, which rejects -/// target-invalid constructors instead of letting the renderer -/// normalize them later. Go has no pattern-level underscore -/// convention (blank identifier is statement-level), so -/// `EmitPrefixedUnderscoreWhenUnused` is a Python-shaped choice -/// the Go emitter refuses. -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -enum PatternBindingRuleBinding { - EmitBindingAlways, - EmitUnderscoreWhenUnused, -} - -struct RealizationIndexes { - types: HashMap, - instantiations: HashMap, - operators: HashMap<(DeclarationId, DeclarationId), String>, - behaviors: HashMap, - callables: HashMap, - /// Parsed and validated, but not consulted for Go emission (GC - /// targets don't render borrow/move). Holding the field keeps the - /// shared CallableRealization schema honest: every entry in a - /// CallableRealization must have a well-formed dispositions vector, - /// even when this target ignores the result. - #[allow(dead_code)] - callable_dispositions: HashMap>, - patterns: HashMap, - syntax: GoLanguageSyntax, - execution_model: TargetExecutionModelBinding, - /// Source exclusion policy loaded from - /// `data go_source_filtering: ShapeATargetSourceFiltering`. - source_filtering: SourceFilteringBinding, - /// The Go clean-emission contract loaded from `data - /// go_clean_emission: CleanEmissionContract` (E-5 / Lane 1 Stage - /// 1c PR 2). Rule variants dispatch inside the emitter to shape - /// emitted code so `gofmt -l` stays empty and Go's - /// unused-local compile error never fires. - clean_emission: CleanEmissionContractBinding, -} - -impl RealizationIndexes { - fn build(dag: &Dag) -> Result { - let type_meta = dag - .type_realization_meta() - .ok_or(EmitError::MissingRealizationMeta(RealizationCategory::Type))?; - let type_instantiation_meta = - dag.type_instantiation_realization_meta() - .ok_or(EmitError::MissingRealizationMeta( - RealizationCategory::TypeInstantiation, - ))?; - let op_meta = dag - .operator_realization_meta() - .ok_or(EmitError::MissingRealizationMeta( - RealizationCategory::Operator, - ))?; - let behavior_meta = - dag.behavior_realization_meta() - .ok_or(EmitError::MissingRealizationMeta( - RealizationCategory::Behavior, - ))?; - let callable_meta = - dag.callable_realization_meta() - .ok_or(EmitError::MissingRealizationMeta( - RealizationCategory::Callable, - ))?; - let pattern_meta = - dag.pattern_realization_meta() - .ok_or(EmitError::MissingRealizationMeta( - RealizationCategory::Pattern, - ))?; - - let mut types = HashMap::new(); - let mut instantiations = HashMap::new(); - let mut operators = HashMap::new(); - let mut behaviors = HashMap::new(); - let mut callables = HashMap::new(); - let mut callable_dispositions: HashMap> = - HashMap::new(); - let mut patterns = HashMap::new(); - - // Cache the Go language-spec declaration id once; shared - // realizations reference it via `language: DeclarationRef` - // and this emitter picks up only entries that match. - // Replaces the previous TargetLanguage enum roster with a - // declaration-identity compare (INVARIANTS.md E-6). - let go_language_id = dag - .go_language_spec() - .ok_or(EmitError::MissingTargetSyntax("go_language"))?; - - for decl in dag.declarations() { - let Some(meta_tag) = decl.meta_tag else { - continue; - }; - let category = if meta_tag == type_meta { - RealizationCategory::Type - } else if meta_tag == type_instantiation_meta { - RealizationCategory::TypeInstantiation - } else if meta_tag == op_meta { - RealizationCategory::Operator - } else if meta_tag == behavior_meta { - RealizationCategory::Behavior - } else if meta_tag == callable_meta { - RealizationCategory::Callable - } else if meta_tag == pattern_meta { - RealizationCategory::Pattern - } else { - continue; - }; - let Some(ValueBody::Structural { fields }) = &decl.value_body else { - return Err(EmitError::MalformedRealization { - declaration: decl.id, - detail: - "realization data item has no Structural value_body — bootstrap inhabitance check missed a malformed spec entry", - }); - }; - // Skip realizations declared for other shared targets - // (e.g. Rust) by comparing the typed `language` field to - // this emitter's cached language-spec declaration id. - // Replaces the previous TargetLanguage enum roster; adding - // a new shared target is now a pure spec-file change. - let language_ref = require_field_decl_ref(fields, "language", decl.id)?; - if language_ref != go_language_id { - continue; - } - let target = require_field_decl_ref(fields, "target", decl.id)?; - match category { - RealizationCategory::Type => { - let carrier = require_field_string(fields, "carrier", decl.id)?; - if types - .insert( - target, - TypeRealizationBinding { - carrier, - fields: require_field_bindings(dag, fields, decl.id)?, - }, - ) - .is_some() - { - return Err(EmitError::DuplicateRealization { - declaration: decl.id, - detail: "two TypeRealization data items target the same declaration", - }); - } - } - RealizationCategory::TypeInstantiation => { - let carrier = require_field_string(fields, "carrier", decl.id)?; - if instantiations - .insert(target, TypeInstantiationBinding { carrier }) - .is_some() - { - return Err(EmitError::DuplicateRealization { - declaration: decl.id, - detail: - "two TypeInstantiationRealization data items target the same declaration", - }); - } - } - RealizationCategory::Operator => { - let carrier = require_field_string(fields, "carrier", decl.id)?; - if !carrier.contains("{lhs}") || !carrier.contains("{rhs}") { - return Err(EmitError::MalformedRealization { - declaration: decl.id, - detail: "OperatorRealization carrier must be a full-expression template containing {lhs} and {rhs}", - }); - } - let op = require_field_decl_ref(fields, "op", decl.id)?; - if operators.insert((target, op), carrier).is_some() { - return Err(EmitError::DuplicateRealization { - declaration: decl.id, - detail: - "two OperatorRealization data items share the same (target, op) pair", - }); - } - } - RealizationCategory::Behavior => { - let carrier = require_field_string(fields, "carrier", decl.id)?; - if behaviors.insert(target, carrier).is_some() { - return Err(EmitError::DuplicateRealization { - declaration: decl.id, - detail: - "two BehaviorRealization data items target the same substrate marker", - }); - } - } - RealizationCategory::Callable => { - let strategy = require_callable_strategy(dag, fields, decl.id)?; - let expected_arity = match &dag.declaration(target).connective { - TypeConnective::Arrow { inputs, .. } => inputs.len(), - _ => { - return Err(EmitError::MalformedRealization { - declaration: decl.id, - detail: "CallableRealization target must be an Arrow declaration", - }) - } - }; - let dispositions = - require_parameter_dispositions(dag, fields, decl.id, expected_arity)?; - if callables.insert(target, strategy).is_some() { - return Err(EmitError::DuplicateRealization { - declaration: decl.id, - detail: - "two CallableRealization data items target the same callable declaration", - }); - } - if callable_dispositions.insert(target, dispositions).is_some() { - return Err(EmitError::DuplicateRealization { - declaration: decl.id, - detail: - "two CallableRealization data items target the same callable declaration's parameter dispositions", - }); - } - } - RealizationCategory::Pattern => { - let binding = require_pattern_realization(dag, fields, decl.id)?; - validate_pattern_roles(dag, target, &binding, decl.id)?; - if patterns.insert(target, binding).is_some() { - return Err(EmitError::DuplicateRealization { - declaration: decl.id, - detail: - "two PatternRealization data items target the same structural sum declaration", - }); - } - } - } - } - - let execution_model = TargetExecutionModelBinding::build( - dag, - dag.go_execution_model_spec() - .ok_or(EmitError::MissingTargetSyntax("go_execution_model"))?, - )?; - if execution_model.scope != ScopeModelBinding::LexicalScoping { - return Err(EmitError::UnsupportedBehavior( - "emit_go requires lexical scoping targets".to_string(), - )); - } - let source_filtering = SourceFilteringBinding::build( - dag, - dag.go_source_filtering_spec() - .ok_or(EmitError::MissingTargetSyntax("go_source_filtering"))?, - )?; - let syntax = GoLanguageSyntax::build(dag)?; - let clean_emission = CleanEmissionContractBinding::build(dag)?; - - Ok(Self { - types, - instantiations, - operators, - behaviors, - callables, - callable_dispositions, - patterns, - syntax, - execution_model, - source_filtering, - clean_emission, - }) - } -} - -impl CleanEmissionContractBinding { - /// Parse the portion of `data go_clean_emission: - /// CleanEmissionContract` this emitter consumes. Currently only - /// `pattern_bindings` and `variant_payload_field_access` - /// dispatch; other rules parse when their consumers land. - fn build(dag: &Dag) -> Result { - let declaration = dag - .go_clean_emission_spec() - .ok_or(EmitError::MissingTargetSyntax("go_clean_emission"))?; - let fields = structural_fields_for_decl(dag, declaration)?; - let pattern_bindings_value = fields - .iter() - .find(|(label, _)| label == "pattern_bindings") - .map(|(_, value)| value) - .ok_or(EmitError::MalformedTargetSyntax { - declaration, - detail: "go_clean_emission is missing required `pattern_bindings` field", - })?; - let pattern_bindings = - parse_pattern_binding_rule(dag, pattern_bindings_value, declaration)?; - let variant_payload_field_access_value = fields - .iter() - .find(|(label, _)| label == "variant_payload_field_access") - .map(|(_, value)| value) - .ok_or(EmitError::MalformedTargetSyntax { - declaration, - detail: - "go_clean_emission is missing required `variant_payload_field_access` field", - })?; - let variant_payload_field_access = parse_variant_payload_field_access_rule( - dag, - variant_payload_field_access_value, - declaration, - )?; - Ok(Self { - pattern_bindings, - variant_payload_field_access, - }) - } -} - -fn parse_pattern_binding_rule( - dag: &Dag, - value: &FieldValue, - declaration: DeclarationId, -) -> Result { - let FieldValue::Variant { - constructor, - payload, - } = value - else { - return Err(EmitError::MalformedTargetSyntax { - declaration, - detail: "go_clean_emission.pattern_bindings must be a PatternBindingRule variant", - }); - }; - if !payload.is_empty() { - return Err(EmitError::MalformedTargetSyntax { - declaration, - detail: "PatternBindingRule variants must not carry payload fields", - }); - } - let variants = dag.pattern_binding_rule_variants(); - let emit_always = variants - .emit_always - .ok_or(EmitError::MalformedTargetSyntax { - declaration, - detail: "PatternBindingRule.EmitBindingAlways declaration was not found", - })?; - let emit_underscore = variants - .emit_underscore - .ok_or(EmitError::MalformedTargetSyntax { - declaration, - detail: "PatternBindingRule.EmitUnderscoreWhenUnused declaration was not found", - })?; - let emit_prefixed = variants - .emit_prefixed - .ok_or(EmitError::MalformedTargetSyntax { - declaration, - detail: "PatternBindingRule.EmitPrefixedUnderscoreWhenUnused declaration was not found", - })?; - let not_applicable = variants - .not_applicable - .ok_or(EmitError::MalformedTargetSyntax { - declaration, - detail: "PatternBindingRule.NotApplicablePatternBinding declaration was not found", - })?; - if *constructor == emit_always { - Ok(PatternBindingRuleBinding::EmitBindingAlways) - } else if *constructor == emit_underscore { - Ok(PatternBindingRuleBinding::EmitUnderscoreWhenUnused) - } else if *constructor == emit_prefixed { - Err(EmitError::MalformedTargetSyntax { - declaration, - detail: "go_clean_emission.pattern_bindings cannot use PatternBindingRule.EmitPrefixedUnderscoreWhenUnused; Go only supports EmitBindingAlways or EmitUnderscoreWhenUnused", - }) - } else if *constructor == not_applicable { - Err(EmitError::MalformedTargetSyntax { - declaration, - detail: "go_clean_emission.pattern_bindings cannot use PatternBindingRule.NotApplicablePatternBinding; Go only supports EmitBindingAlways or EmitUnderscoreWhenUnused", - }) - } else { - Err(EmitError::MalformedTargetSyntax { - declaration, - detail: "go_clean_emission.pattern_bindings constructor is not a known PatternBindingRule variant", - }) - } -} - -fn parse_variant_payload_field_access_rule( - dag: &Dag, - value: &FieldValue, - declaration: DeclarationId, -) -> Result { - let FieldValue::Variant { - constructor, - payload, - } = value - else { - return Err(EmitError::MalformedTargetSyntax { - declaration, - detail: - "go_clean_emission.variant_payload_field_access must be a VariantPayloadFieldAccessRule variant", - }); - }; - if !payload.is_empty() { - return Err(EmitError::MalformedTargetSyntax { - declaration, - detail: "VariantPayloadFieldAccessRule variants must not carry payload fields", - }); - } - let variants = dag.variant_payload_field_access_rule_variants(); - let access_from_payload_binding = - variants - .access_from_payload_binding - .ok_or(EmitError::MalformedTargetSyntax { - declaration, - detail: - "VariantPayloadFieldAccessRule.AccessFromPayloadBinding declaration was not found", - })?; - let override_named_fields_at_binding_site = variants - .override_named_fields_at_binding_site - .ok_or(EmitError::MalformedTargetSyntax { - declaration, - detail: "VariantPayloadFieldAccessRule.OverrideNamedFieldsAtBindingSite declaration was not found", - })?; - if *constructor == access_from_payload_binding { - Ok(VariantPayloadFieldAccessRuleBinding::AccessFromPayloadBinding) - } else if *constructor == override_named_fields_at_binding_site { - Err(EmitError::MalformedTargetSyntax { - declaration, - detail: "go_clean_emission.variant_payload_field_access cannot use VariantPayloadFieldAccessRule.OverrideNamedFieldsAtBindingSite; Go requires AccessFromPayloadBinding for native sum payloads", - }) - } else { - Err(EmitError::MalformedTargetSyntax { - declaration, - detail: "go_clean_emission.variant_payload_field_access constructor is not a known VariantPayloadFieldAccessRule variant", - }) - } -} - -impl GoLanguageSyntax { - fn build(dag: &Dag) -> Result { - let language_decl = dag - .go_language_spec() - .ok_or(EmitError::MissingTargetSyntax("go_language"))?; - let fields = structural_fields_for_decl(dag, language_decl)?; - Ok(Self { - statements: parse_statement_syntax( - dag, - require_field_decl_ref(fields, "statements", language_decl)?, - )?, - expressions: parse_expression_syntax( - dag, - require_field_decl_ref(fields, "expressions", language_decl)?, - )?, - functions: parse_function_syntax( - dag, - require_field_decl_ref(fields, "functions", language_decl)?, - )?, - type_applications: parse_type_application_syntax( - dag, - require_field_decl_ref(fields, "type_applications", language_decl)?, - )?, - type_definitions: parse_type_definition_syntax( - dag, - require_field_decl_ref(fields, "type_definitions", language_decl)?, - )?, - values: parse_value_construction_syntax( - dag, - require_field_decl_ref(fields, "values", language_decl)?, - )?, - literals: parse_literal_syntax( - dag, - require_field_decl_ref(fields, "literals", language_decl)?, - )?, - }) - } -} - -impl TargetExecutionModelBinding { - fn build(dag: &Dag, declaration: DeclarationId) -> Result { - let fields = structural_fields_for_decl(dag, declaration)?; - Ok(Self { - memory: require_memory_model(dag, fields, declaration)?, - scope: require_scope_model(dag, fields, declaration)?, - }) - } -} - -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum EmitTarget { - Go, - Rust, - Python, -} - -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum EmitMode { - Program, - Module, -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub struct EmittedSource { - pub text: String, - pub target: EmitTarget, - pub mode: EmitMode, -} - -#[derive(Debug, Clone)] -pub enum EmitDispatchError { - Core(EmitError), - Python(EmitPythonError), -} - -impl From for EmitDispatchError { - fn from(value: EmitError) -> Self { - Self::Core(value) - } -} - -impl From for EmitDispatchError { - fn from(value: EmitPythonError) -> Self { - Self::Python(value) - } -} - -pub fn emit(dag: &Dag, target: EmitTarget) -> Result { - emit_with_mode(dag, target, EmitMode::Program) -} - -pub fn emit_module(dag: &Dag, target: EmitTarget) -> Result { - emit_with_mode(dag, target, EmitMode::Module) -} - -pub fn emit_go_text(dag: &Dag) -> Result { - match emit(dag, EmitTarget::Go) { - Ok(source) => Ok(source.text), - Err(EmitDispatchError::Core(error)) => Err(error), - Err(EmitDispatchError::Python(_)) => { - unreachable!("EmitTarget::Go cannot yield a Python emission error") - } - } -} - -pub fn emit_go_module_text(dag: &Dag) -> Result { - match emit_module(dag, EmitTarget::Go) { - Ok(source) => Ok(source.text), - Err(EmitDispatchError::Core(error)) => Err(error), - Err(EmitDispatchError::Python(_)) => { - unreachable!("EmitTarget::Go cannot yield a Python emission error") - } - } -} - -pub fn emit_rust_text(dag: &Dag) -> Result { - match emit(dag, EmitTarget::Rust) { - Ok(source) => Ok(source.text), - Err(EmitDispatchError::Core(error)) => Err(error), - Err(EmitDispatchError::Python(_)) => { - unreachable!("EmitTarget::Rust cannot yield a Python emission error") - } - } -} - -pub fn emit_rust_module_text(dag: &Dag) -> Result { - match emit_module(dag, EmitTarget::Rust) { - Ok(source) => Ok(source.text), - Err(EmitDispatchError::Core(error)) => Err(error), - Err(EmitDispatchError::Python(_)) => { - unreachable!("EmitTarget::Rust cannot yield a Python emission error") - } - } -} - -pub fn emit_python_text(dag: &Dag) -> Result { - match emit(dag, EmitTarget::Python) { - Ok(source) => Ok(source.text), - Err(EmitDispatchError::Python(error)) => Err(error), - Err(EmitDispatchError::Core(_)) => { - unreachable!("EmitTarget::Python cannot yield a core emission error") - } - } -} - -pub fn emit_python_module_text(dag: &Dag) -> Result { - match emit_module(dag, EmitTarget::Python) { - Ok(source) => Ok(source.text), - Err(EmitDispatchError::Python(error)) => Err(error), - Err(EmitDispatchError::Core(_)) => { - unreachable!("EmitTarget::Python cannot yield a core emission error") - } - } -} - -fn emit_with_mode( - dag: &Dag, - target: EmitTarget, - mode: EmitMode, -) -> Result { - let text = match target { - EmitTarget::Go => emit_go_with_mode(dag, mode).map_err(EmitDispatchError::Core)?, - EmitTarget::Rust => { - rust_target::emit_rust_with_mode(dag, mode).map_err(EmitDispatchError::Core)? - } - EmitTarget::Python => { - python_target::emit_python_with_mode(dag, mode).map_err(EmitDispatchError::Python)? - } - }; - Ok(EmittedSource { text, target, mode }) -} - -pub(crate) fn parse_pattern_strategy( - dag: &Dag, - value: &FieldValue, -) -> Result { - let FieldValue::Variant { - constructor, - payload, - } = value - else { - return Err("PatternRealization.strategy must be a PatternStrategy variant"); - }; - if !payload.is_empty() { - return Err("PatternStrategy variants must not carry payload fields"); - } - let vector_list = dag - .emit_model_variants() - .pattern_strategy - .vector_list - .ok_or("PatternStrategy.VectorList declaration was not found")?; - if *constructor != vector_list { - return Err("PatternStrategy constructor must be VectorList"); - } - Ok(PatternStrategyBinding::VectorList) -} - -pub(crate) fn optional_match_variant_roles( - dag: &Dag, - disj_id: DeclarationId, -) -> Result<(DeclarationId, DeclarationId), &'static str> { - let TypeConnective::Disj { variants } = &dag.declaration(disj_id).connective else { - return Err("optional branch must walk to a Disj"); - }; - let mut empty_variant = None; - let mut payload_variant = None; - for variant in variants { - let shape = match variant_payload_shape(dag, &variant.ty) { - VariantPayloadShapeLookup::DeclarationMissing => { - return Err("optional branch variant references an absent declaration"); - } - VariantPayloadShapeLookup::NotPayloadProduct => { - return Err("optional branch variants must lower to payload products"); - } - VariantPayloadShapeLookup::Found { _0: shape } => shape, - }; - match shape { - VariantPayloadShape::Empty => { - if empty_variant.replace(variant.ty).is_some() { - return Err("optional branch requires exactly one empty variant role"); - } - } - VariantPayloadShape::PositionalSingle | VariantPayloadShape::NamedFields { .. } => { - if payload_variant.replace(variant.ty).is_some() { - return Err( - "optional branch requires exactly one payload-bearing variant role", - ); - } - } - } - } - let empty_variant = empty_variant.ok_or("optional branch requires an empty variant role")?; - let payload_variant = - payload_variant.ok_or("optional branch requires a payload-bearing variant role")?; - Ok((empty_variant, payload_variant)) -} - -fn emit_go_with_mode(dag: &Dag, mode: EmitMode) -> Result { - let indexes = RealizationIndexes::build(dag)?; - if indexes.execution_model.memory == MemoryModelBinding::OwnershipBased { - return Err(EmitError::UnsupportedBehavior( - "emit_go requires a non-ownership execution model".to_string(), - )); - } - let main_marker = dag - .main_marker() - .ok_or(EmitError::MissingSubstrateMarker(SubstrateMarkerRole::Main))?; - let type_decls: Vec<_> = dag - .declarations() - .iter() - .filter(|decl| !indexes.source_filtering.excludes(&decl.span.file)) - .filter(|decl| decl.name.is_some()) - .filter(|decl| !substrate_result_type_decl_suppressed_for_emit(dag, decl)) - .filter(|decl| !substrate_div_error_type_decl_suppressed_for_emit(dag, decl)) - .filter(|decl| { - matches!( - decl.connective, - TypeConnective::Conj { .. } | TypeConnective::Disj { .. } - ) - }) - .collect(); - let function_decls: Vec<_> = dag - .declarations() - .iter() - .filter(|decl| !indexes.source_filtering.excludes(&decl.span.file)) - .filter(|decl| decl.name.is_some()) - .filter(|decl| { - !decl - .name - .as_deref() - .is_some_and(|name| name.starts_with("__anon_lambda_")) - }) - .filter(|decl| { - matches!( - decl.connective, - TypeConnective::Arrow { - body: ArrowBody::UserDefined(_), - .. - } - ) - }) - .collect(); - let top_level_binds = go_program_mode_top_level_value_binds(dag, &indexes); - - if mode == EmitMode::Program && top_level_binds.is_empty() { - return Err(EmitError::UnsupportedBehavior( - "emit_go requires at least one top-level value Bind".to_string(), - )); - } - if mode == EmitMode::Module && !top_level_binds.is_empty() { - return Err(EmitError::UnsupportedBehavior( - "emit_go module mode does not support top-level value Binds".to_string(), - )); - } - - let mut bound_names = HashMap::new(); - for bind in &top_level_binds { - bound_names.insert(bind.value, bind.name.clone()); - } - let ctx = Ctx { - dag, - indexes: &indexes, - bound_names: &bound_names, - mode, - }; - - let mut sections = vec![if mode == EmitMode::Program { - "package main".to_string() - } else { - "package emitted".to_string() - }]; - if mode == EmitMode::Program { - sections.push("import \"fmt\"".to_string()); - } - let needs_int_div_prelude = - dag_needs_div_error_prelude(dag, &type_decls, &top_level_binds, &function_decls); - let needs_result_prelude = needs_int_div_prelude - || dag_needs_go_result_prelude(dag, &type_decls, &top_level_binds, &function_decls); - if let (true, Some(name)) = ( - needs_int_div_prelude, - div_prelude_reserved_name_collision( - dag, - type_decls.iter(), - function_decls.iter(), - top_level_binds.iter(), - "v3intdiv", - ), - ) { - return Err(EmitError::UnsupportedBehavior(format!( - "Go checked-division prelude would collide with user-defined `{name}`" - ))); - } - if needs_result_prelude { - // `DivError` / `Result` are under `dsl/std/`, which `go_source_filtering` omits. Emit - // minimal v3 hooks so `v3Result[T, E]` compiles. - // - // Dissolution trigger (M1 scaffold): delete this prelude when `dsl/std/error_primitives` - // (and friends) emit through the same type-decl path as user code — i.e. std is no - // longer source-filtered for these carriers. - sections.push( - "type v3Result[T any, E any] interface{ isV3Result() }\ntype v3Ok[T any, E any] struct{ Value T }\ntype v3Err[T any, E any] struct{ Value E }\nfunc (v3Ok[T, E]) isV3Result() {}\nfunc (v3Err[T, E]) isV3Result() {}\n".to_string(), - ); - } - if needs_int_div_prelude { - sections.push( - "type DivError int\nconst (\n DivideByZero DivError = iota\n Overflow\n)\n\nfunc v3intdiv(l, r int64) v3Result[int64, DivError] {\n if r == 0 { return v3Err[int64, DivError]{Value: DivideByZero} }\n if l == -9223372036854775808 && r == -1 { return v3Err[int64, DivError]{Value: Overflow} }\n q := l / r; return v3Ok[int64, DivError]{Value: q} }\n".to_string(), - ); - } - - let rendered_types = type_decls - .iter() - .map(|decl| ctx.render_type_declaration(decl)) - .collect::, _>>()?; - if !rendered_types.is_empty() { - sections.push(rendered_types.join("\n\n")); - } - - let rendered_functions = function_decls - .iter() - .map(|decl| ctx.render_function_declaration(decl)) - .collect::, _>>()?; - if !rendered_functions.is_empty() { - sections.push(rendered_functions.join("\n\n")); - } - - if mode == EmitMode::Program { - let body = top_level_binds - .iter() - .map(|bind| { - let ty = ctx.go_type_name_for_port(bind.value)?; - let value = ctx.render_top_level_value(bind.value)?; - Ok(render_named_template( - &ctx.indexes.syntax.statements.let_binding, - &[("name", &bind.name), ("type", &ty), ("value", &value)], - )) - }) - .collect::, EmitError>>()? - .join(";\n"); - let final_bind_name = &top_level_binds.last().expect("guarded").name; - let main_template = - indexes - .behaviors - .get(&main_marker) - .ok_or(EmitError::MissingBehaviorRealization { - marker: main_marker, - })?; - sections.push(render_named_template( - main_template, - &[("body", &body), ("final", final_bind_name)], - )); - } - - Ok(sections.join("\n\n")) -} - -/// Top-level value `Bind` nodes that participate in Go program-mode emission, in `Dag::nodes` -/// order. L5 uses this selector so `ForAllTargets` validates the declared observation against the -/// same bind that emitted Go `main` prints. -fn go_program_mode_top_level_value_binds<'a>( - dag: &'a Dag, - indexes: &RealizationIndexes, -) -> Vec<&'a BindNode> { - dag.nodes() - .iter() - .filter_map(Behavior::as_bind) - .filter(|bind| !indexes.source_filtering.excludes(&bind.span.file)) - .filter(|bind| bind.params.is_empty()) - .collect() -} - -pub(crate) fn last_emit_go_program_top_level_value_bind_name( - dag: &Dag, -) -> Result, EmitError> { - let indexes = RealizationIndexes::build(dag)?; - if indexes.execution_model.memory == MemoryModelBinding::OwnershipBased { - return Err(EmitError::UnsupportedBehavior( - "emit_go requires a non-ownership execution model".to_string(), - )); - } - Ok(go_program_mode_top_level_value_binds(dag, &indexes) - .last() - .map(|b| b.name.clone())) -} - -pub(crate) fn dag_uses_arithmetic_div( - dag: &Dag, - top_level_binds: &[&BindNode], - function_decls: &[&Declaration], -) -> bool { - top_level_binds - .iter() - .any(|bind| port_depends_on_arithmetic_div(dag, bind.value)) - || function_decls.iter().any(|decl| match &decl.connective { - TypeConnective::Arrow { - body: ArrowBody::UserDefined(body), - .. - } => port_depends_on_arithmetic_div(dag, (*body).bind(dag).value), - _ => false, - }) -} - -fn port_depends_on_arithmetic_div(dag: &Dag, root: PortId) -> bool { - let mut visited = HashSet::new(); - let mut queue = vec![root]; - while let Some(port) = queue.pop() { - if !visited.insert(port) { - continue; - } - let Some(producer) = dag.port(port).produced_by else { - continue; - }; - match dag.node(producer) { - Behavior::Value(_) => {} - Behavior::Transform(t) => { - if matches!( - t.target, - TransformTarget::Operator(OperatorKind::Arithmetic( - crate::operators::ArithmeticOp::Div - )) - ) { - return true; - } - queue.extend(t.inputs.iter().copied()); - } - Behavior::Branch(b) => { - queue.push(b.input); - queue.extend(b.paths.iter().map(|path| path.output)); - } - Behavior::Loop(l) => { - queue.push(l.source); - queue.push(l.init); - queue.push(behavior_result_port(dag.node(l.body))); - } - Behavior::Bind(b) => { - queue.push(b.value); - } - } - } - false -} - -struct Ctx<'a> { - dag: &'a Dag, - indexes: &'a RealizationIndexes, - bound_names: &'a HashMap, - mode: EmitMode, -} - -#[derive(Debug, Clone, Default)] -struct RenderLocals { - names: HashMap, - payload_bindings: HashMap>, -} - -impl<'a> Ctx<'a> { - fn render_port(&self, port: PortId, locals: &RenderLocals) -> Result { - if let Some(name) = locals.names.get(&port) { - return Ok(name.clone()); - } - if let Some(name) = locals - .payload_bindings - .get(&port) - .and_then(VariantPayloadBinding::direct) - { - return Ok(name.clone()); - } - if let Some(name) = self.bound_names.get(&port) { - return Ok(name.clone()); - } - self.dispatch_producer(port, locals) - } - - fn render_top_level_value(&self, port: PortId) -> Result { - self.dispatch_producer(port, &RenderLocals::default()) - } - - fn dispatch_producer(&self, port: PortId, locals: &RenderLocals) -> Result { - let Some(node_id) = self.dag.port(port).produced_by else { - return Err(EmitError::UnsupportedBehavior( - "render reached a port with no producer".to_string(), - )); - }; - match self.dag.node(node_id) { - Behavior::Value(v) => Ok(render_value(v, &self.indexes.syntax.literals)), - Behavior::Transform(t) => self.render_transform(t, locals), - Behavior::Branch(b) => self.render_branch(b, locals), - Behavior::Loop(l) => { - // Behavior::Loop has exactly two construction sites in lower.rs, - // both for recursive user functions: - // 1. Cardinality bound (lower.rs ~3631): single recursive fn - // with descent-provable termination; bound.count = first - // param port. - // 2. Descent bound (lower.rs ~382): mutual-recursion cluster. - // - // In both cases `l.body` is the root node of the function's - // body DAG, which already contains recursive self-calls. Go - // supports recursion natively, so rendering the body node's - // result port is semantically correct: the emitted expression - // preserves the recursive structure and terminates for the same - // structural reasons the compiler proved at lower time. - // - // Collection folds (fold/map/filter) route through callable - // realizations and never reach Behavior::Loop. If a future IR - // change adds Loop for non-recursive collection iteration, this - // site must emit explicit iteration instead. - let body_port = behavior_result_port(self.dag.node(l.body)); - self.render_port(body_port, locals) - } - Behavior::Bind(bind) => Ok(bind.name.clone()), - } - } - - fn render_transform( - &self, - t: &TransformNode, - locals: &RenderLocals, - ) -> Result { - match &t.target { - TransformTarget::Operator(op) => self.render_operator(t, *op, locals), - TransformTarget::UnresolvedFieldProject { field_label } => { - Err(EmitError::UnsupportedBehavior(format!( - "field projection .{field_label} is unresolved; emit expects post-infer FieldProject targets" - ))) - } - TransformTarget::ResolvedFieldProject { field_label } => { - self.render_field_project(t, field_label, locals) - } - TransformTarget::Callable(target) => { - let (template, arguments) = callable_template(*target, self.dag); - if let Some(strategy) = self.indexes.callables.get(&template) { - return self.render_realized_callable( - t.output, template, *strategy, &arguments, &t.inputs, locals, - ); - } - self.render_general_callable(template, &t.inputs, locals) - } - } - } - - fn render_field_project( - &self, - t: &TransformNode, - field_label: &str, - locals: &RenderLocals, - ) -> Result { - if t.inputs.len() != 1 { - return Err(EmitError::UnsupportedBehavior( - "field projection expected one input".to_string(), - )); - } - if let Some(binding) = locals - .payload_bindings - .get(&t.inputs[0]) - .and_then(|binding| binding.field(field_label)) - { - return Ok(binding.clone()); - } - let parent = self.render_port(t.inputs[0], locals)?; - let parent_type = primitive_type_id_for_port(self.dag, t.inputs[0])?; - if let Some(type_binding) = self.indexes.types.get(&parent_type) { - if let Some(binding) = type_binding.fields.get(field_label) { - return Ok(match &binding.access { - GoFieldAccessBinding::DirectField(name) => render_named_template( - &self.indexes.syntax.expressions.field_access, - &[("object", &parent), ("field", name)], - ), - GoFieldAccessBinding::AccessorMethod(name) => format!( - "{}()", - render_named_template( - &self.indexes.syntax.expressions.field_access, - &[("object", &parent), ("field", name)], - ) - ), - }); - } - } - Ok(render_named_template( - &self.indexes.syntax.expressions.field_access, - &[("object", &parent), ("field", field_label)], - )) - } - - fn render_operator( - &self, - t: &TransformNode, - op: OperatorKind, - locals: &RenderLocals, - ) -> Result { - if t.inputs.len() != 2 { - return Err(EmitError::UnsupportedBehavior(format!( - "operator {:?} arity {} is not supported", - op, - t.inputs.len() - ))); - } - let operand_type = primitive_type_id_for_port(self.dag, t.inputs[0])?; - let op_decl = algebra_field_for_operator(self.dag, operand_type, op)?; - let carrier = - operator_carrier_realization(&self.indexes.operators, self.dag, operand_type, op_decl) - .ok_or(EmitError::MissingOperatorRealization { - target: operand_type, - op: op_decl, - })?; - let lhs = self.render_port(t.inputs[0], locals)?; - let rhs = self.render_port(t.inputs[1], locals)?; - Ok(render_named_template( - carrier, - &[("lhs", &lhs), ("rhs", &rhs)], - )) - } - - fn render_branch(&self, b: &BranchNode, locals: &RenderLocals) -> Result { - if self.branch_scrutinee_is_bool(b)? { - return self.render_bool_branch(b, locals); - } - if let Some(rendered) = self.render_realized_pattern_branch(b, locals)? { - return Ok(rendered); - } - let scrutinee_type = primitive_type_id_for_port(self.dag, b.input)?; - if matches!( - self.dag.declaration(scrutinee_type).connective, - TypeConnective::Cardinality(ref p) if p.bound() == CardinalityBound::AtMostOne - ) { - return self.render_optional_branch(b, locals); - } - self.render_sum_branch(b, locals) - } - - fn render_bool_branch( - &self, - branch: &BranchNode, - locals: &RenderLocals, - ) -> Result { - let (then_path, else_path) = self.split_bool_paths(branch)?; - let cond = self.render_port(branch.input, locals)?; - let then_expr = self.render_path_body(then_path, locals)?; - let else_expr = self.render_path_body(else_path, locals)?; - let ret = self.go_type_name_for_port(branch.output)?; - Ok(format!( - "func() {ret} {{ if {cond} {{ return {then_expr} }}; return {else_expr} }}()" - )) - } - - fn render_optional_branch( - &self, - branch: &BranchNode, - locals: &RenderLocals, - ) -> Result { - let scrutinee = self.render_port(branch.input, locals)?; - let scrutinee_type = primitive_type_id_for_port(self.dag, branch.input)?; - let disj_id = walk_to_disj(self.dag, scrutinee_type).ok_or_else(|| { - EmitError::UnsupportedBehavior("optional branch must walk to a Disj".to_string()) - })?; - let (none_variant, some_variant) = optional_match_variant_roles(self.dag, disj_id) - .map_err(|detail| EmitError::UnsupportedBehavior(detail.to_string()))?; - let none_path = find_resolved_branch_path(branch, none_variant).ok_or_else(|| { - EmitError::UnsupportedBehavior( - "optional branch missing the empty-variant arm".to_string(), - ) - })?; - let some_path = find_resolved_branch_path(branch, some_variant).ok_or_else(|| { - EmitError::UnsupportedBehavior( - "optional branch missing the payload-bearing arm".to_string(), - ) - })?; - let ret = self.go_type_name_for_port(branch.output)?; - let none_expr = self.render_path_body(none_path, locals)?; - let mut some_locals = locals.clone(); - if let Some(binding) = &some_path.binding { - some_locals - .names - .insert(binding.payload_port, format!("*({scrutinee})")); - } - let some_expr = self.render_port(some_path.output, &some_locals)?; - Ok(format!( - "func() {ret} {{ if ({scrutinee}) == nil {{ return {none_expr} }}; return {some_expr} }}()" - )) - } - - fn render_sum_branch( - &self, - branch: &BranchNode, - locals: &RenderLocals, - ) -> Result { - let scrutinee = self.render_port(branch.input, locals)?; - let ret = self.go_type_name_for_port(branch.output)?; - let mut arms = Vec::new(); - // E-5 / Lane 1 Stage 1c PR 2: track whether any arm actually - // consumes the payload binding. If zero arms do, the type-switch - // header drops `v :=` — otherwise Go would flag `v` as - // `declared and not used`. Structural: driven by port liveness, - // not by scanning the rendered arm text. - let mut any_arm_uses_v = false; - for path in &branch.paths { - let variant_id = match &path.pattern { - BranchPattern::ResolvedVariant(id) => *id, - BranchPattern::UnresolvedVariant { name, .. } => { - return Err(EmitError::UnresolvedBranchPattern { - variant_name: name.clone(), - }); - } - }; - let Some((_parent_name, variant_name)) = variant_parent_info(self.dag, variant_id) - else { - return Err(EmitError::VariantParentNotFound { variant_id }); - }; - let mut arm_locals = locals.clone(); - if let Some(binding) = &path.binding { - let elide = matches!( - self.indexes.clean_emission.pattern_bindings, - PatternBindingRuleBinding::EmitUnderscoreWhenUnused - ) && !self.port_is_consumed_from(path.output, binding.payload_port); - if !elide { - if let Some(payload_binding) = - self.variant_payload_binding_for_variant(variant_id, "v")? - { - arm_locals - .payload_bindings - .insert(binding.payload_port, payload_binding); - any_arm_uses_v = true; - } - } - } - let body = self.render_port(path.output, &arm_locals)?; - arms.push(format!("case {variant_name}: return {body}")); - } - let switch_header = if any_arm_uses_v { - format!("switch v := any({scrutinee}).(type)") - } else { - format!("switch any({scrutinee}).(type)") - }; - Ok(format!( - "func() {ret} {{ {switch_header} {{ {} default: panic(\"non-exhaustive match\") }} }}()", - arms.join(" ") - )) - } - - /// Thin wrapper; rationale lives on the module-level `port_is_consumed_from`. - fn port_is_consumed_from(&self, root: PortId, target: PortId) -> bool { - port_is_consumed_from(self.dag, root, target) - } - - fn render_realized_pattern_branch( - &self, - branch: &BranchNode, - locals: &RenderLocals, - ) -> Result, EmitError> { - let scrutinee_type = primitive_type_id_for_port(self.dag, branch.input)?; - let Some(disj_id) = walk_to_disj(self.dag, scrutinee_type) else { - return Ok(None); - }; - let Some(binding) = self.indexes.patterns.get(&disj_id) else { - return Ok(None); - }; - self.render_vector_list_pattern_branch(branch, disj_id, binding, locals) - .map(Some) - } - - fn render_vector_list_pattern_branch( - &self, - branch: &BranchNode, - _disj_id: DeclarationId, - binding: &PatternRealizationBinding, - locals: &RenderLocals, - ) -> Result { - let empty_path = find_resolved_branch_path(branch, binding.empty_variant).ok_or_else( - || { - EmitError::UnsupportedBehavior( - "vector-list pattern realization requires a branch arm for the declared empty_variant" - .to_string(), - ) - }, - )?; - let cons_path = find_resolved_branch_path(branch, binding.cons_variant).ok_or_else( - || { - EmitError::UnsupportedBehavior( - "vector-list pattern realization requires a branch arm for the declared cons_variant" - .to_string(), - ) - }, - )?; - let ret = self.go_type_name_for_port(branch.output)?; - let scrutinee = self.render_port(branch.input, locals)?; - let empty_body = self.render_path_body(empty_path, locals)?; - let list_name = "__list"; - let realized_scrutinee = render_named_template(&binding.scrutinee, &[("expr", &scrutinee)]); - // Empty/cons branches dispatch on the typed PatternRealization - // fields (`empty_pattern`, `cons_pattern`) rather than a - // hardcoded `len(__list) == 0` check. Go's empty_pattern - // template rendered with `expr=__list` becomes the if - // condition; cons_pattern (a passthrough on Go) becomes the - // list expression head/tail are extracted from. - let empty_predicate = render_named_template(&binding.empty_pattern, &[("expr", list_name)]); - let cons_expr = render_named_template(&binding.cons_pattern, &[("expr", list_name)]); - let head_expr = render_named_template(&binding.head_expr, &[("list", &cons_expr)]); - let tail_expr = render_named_template(&binding.tail_expr, &[("list", &cons_expr)]); - let mut cons_locals = locals.clone(); - if let Some(payload) = &cons_path.binding { - let mut fields = HashMap::new(); - fields.insert("head".to_string(), head_expr); - fields.insert("tail".to_string(), tail_expr); - cons_locals - .payload_bindings - .insert(payload.payload_port, VariantPayloadBinding::Fields(fields)); - } - let cons_body = self.render_port(cons_path.output, &cons_locals)?; - Ok(format!( - "func() {ret} {{ {list_name} := {realized_scrutinee}; if {empty_predicate} {{ return {empty_body} }}; return {cons_body} }}()" - )) - } - - fn render_path_body(&self, path: &Path, locals: &RenderLocals) -> Result { - self.render_port(path.output, locals) - } - - fn render_realized_callable( - &self, - output_port: PortId, - template: DeclarationId, - strategy: CallableStrategyBinding, - arguments: &[TemplateArgument], - inputs: &[PortId], - locals: &RenderLocals, - ) -> Result { - match strategy { - CallableStrategyBinding::ListEmpty => Ok("nil".to_string()), - CallableStrategyBinding::ListSingleton => { - let [input] = inputs else { - return Err(EmitError::UnsupportedBehavior( - "singleton expects one input".to_string(), - )); - }; - let value = self.render_port(*input, locals)?; - let element = self.list_element_type_name_for_list_port(output_port)?; - Ok(format!("[]{element}{{{value}}}")) - } - CallableStrategyBinding::ListCons => { - let [head_port, tail_port] = inputs else { - return Err(EmitError::UnsupportedBehavior( - "cons expects [head, tail]".to_string(), - )); - }; - let head = self.render_port(*head_port, locals)?; - let tail = self.render_port(*tail_port, locals)?; - let element = self.list_element_type_name_for_list_port(*tail_port)?; - Ok(format!("append([]{element}{{{head}}}, {tail}...)")) - } - CallableStrategyBinding::ListConcat => { - let [left_port, right_port] = inputs else { - return Err(EmitError::UnsupportedBehavior( - "concat expects [left, right]".to_string(), - )); - }; - let left = self.render_port(*left_port, locals)?; - let right = self.render_port(*right_port, locals)?; - Ok(format!("append({left}, {right}...)")) - } - CallableStrategyBinding::ListLength => { - let [list_port] = inputs else { - return Err(EmitError::UnsupportedBehavior( - "length expects [list]".to_string(), - )); - }; - let list = self.render_port(*list_port, locals)?; - Ok(format!("int64(len({list}))")) - } - CallableStrategyBinding::ListIsEmpty => { - let [list_port] = inputs else { - return Err(EmitError::UnsupportedBehavior( - "is_empty expects [list]".to_string(), - )); - }; - let list = self.render_port(*list_port, locals)?; - Ok(format!("len({list}) == 0")) - } - CallableStrategyBinding::ListFold => { - let [list_port, init_port] = inputs else { - return Err(EmitError::UnsupportedBehavior( - "fold expects [list, init]".to_string(), - )); - }; - let fn_decl = bound_callable_argument(self.dag, template, arguments, 2)?; - let list = self.render_port(*list_port, locals)?; - let init = self.render_port(*init_port, locals)?; - let ret = self.go_type_name_for_port(output_port)?; - let acc_name = "__foldAcc"; - let item_name = "__foldItem"; - let body = self.render_callable_body( - fn_decl, - &[ - (acc_name.to_string(), acc_name.to_string()), - (item_name.to_string(), item_name.to_string()), - ], - locals, - )?; - Ok(format!( - "func() {ret} {{ {acc_name} := {init}; for _, {item_name} := range {list} {{ _ = {item_name}; {acc_name} = {body} }}; return {acc_name} }}()" - )) - } - CallableStrategyBinding::ListMap => { - let [list_port] = inputs else { - return Err(EmitError::UnsupportedBehavior( - "map expects [list]".to_string(), - )); - }; - let fn_decl = bound_callable_argument(self.dag, template, arguments, 1)?; - let list = self.render_port(*list_port, locals)?; - let ret = self.go_type_name_for_port(output_port)?; - let item_name = "__mapItem"; - let body = self.render_callable_body( - fn_decl, - &[(item_name.to_string(), item_name.to_string())], - locals, - )?; - Ok(format!( - "func() {ret} {{ __out := make({ret}, 0, len({list})); for _, {item_name} := range {list} {{ _ = {item_name}; __out = append(__out, {body}) }}; return __out }}()" - )) - } - CallableStrategyBinding::ListFilter => { - let [list_port] = inputs else { - return Err(EmitError::UnsupportedBehavior( - "filter expects [list]".to_string(), - )); - }; - let fn_decl = bound_callable_argument(self.dag, template, arguments, 1)?; - let list = self.render_port(*list_port, locals)?; - let ret = self.go_type_name_for_port(output_port)?; - let item_name = "__filterItem"; - let predicate = self.render_callable_body( - fn_decl, - &[(item_name.to_string(), item_name.to_string())], - locals, - )?; - Ok(format!( - "func() {ret} {{ __out := make({ret}, 0); for _, {item_name} := range {list} {{ _ = {item_name}; if {predicate} {{ __out = append(__out, {item_name}) }} }}; return __out }}()" - )) - } - CallableStrategyBinding::ListContains => { - let [list_port, item_port] = inputs else { - return Err(EmitError::UnsupportedBehavior( - "contains expects [list, item]".to_string(), - )); - }; - let list = self.render_port(*list_port, locals)?; - let item = self.render_port(*item_port, locals)?; - Ok(format!( - "func() bool {{ for _, __item := range {list} {{ if __item == {item} {{ return true }} }}; return false }}()" - )) - } - } - } - - fn render_general_callable( - &self, - template: DeclarationId, - inputs: &[PortId], - locals: &RenderLocals, - ) -> Result { - if let Some(rendered) = self.render_variant_constructor(template, inputs, locals)? { - return Ok(rendered); - } - if let Some(rendered) = self.render_record_constructor(template, inputs, locals)? { - return Ok(rendered); - } - let func = - self.dag - .declaration(template) - .name - .clone() - .ok_or(EmitError::UnsupportedBehavior( - "callable target is anonymous and cannot be rendered as a direct Go call" - .to_string(), - ))?; - let args = inputs - .iter() - .map(|port| self.render_port(*port, locals)) - .collect::, _>>()?; - Ok(render_named_template( - &self.indexes.syntax.expressions.function_call, - &[("func", &func), ("args", &args.join(", "))], - )) - } - - fn render_record_constructor( - &self, - template: DeclarationId, - inputs: &[PortId], - locals: &RenderLocals, - ) -> Result, EmitError> { - let decl = self.dag.declaration(template); - let Some(type_name) = &decl.name else { - return Ok(None); - }; - let TypeConnective::Conj { children } = &decl.connective else { - return Ok(None); - }; - if children.len() != inputs.len() { - return Err(EmitError::UnsupportedBehavior(format!( - "record constructor `{type_name}` expected {} inputs, got {}", - children.len(), - inputs.len() - ))); - } - let fields = children - .iter() - .zip(inputs.iter()) - .map(|(field, input)| { - let value = self.render_port(*input, locals)?; - Ok(render_named_template( - &self.indexes.syntax.values.struct_field_init, - &[("name", &field.label), ("value", &value)], - )) - }) - .collect::, EmitError>>()?; - Ok(Some(render_named_template( - &self.indexes.syntax.values.struct_literal, - &[ - ("type", type_name), - ( - "fields", - &fields.join(&self.indexes.syntax.values.struct_field_separator), - ), - ], - ))) - } - - fn render_variant_constructor( - &self, - template: DeclarationId, - inputs: &[PortId], - locals: &RenderLocals, - ) -> Result, EmitError> { - let Some((_parent_name, variant_name)) = variant_parent_info(self.dag, template) else { - return Ok(None); - }; - let TypeConnective::Conj { children } = &self.dag.declaration(template).connective else { - return Ok(None); - }; - if children.len() != inputs.len() { - return Err(EmitError::UnsupportedBehavior(format!( - "variant constructor `{variant_name}` expected {} payload field(s), got {}", - children.len(), - inputs.len() - ))); - } - if children.is_empty() { - return Ok(Some(format!("{variant_name}{{}}"))); - } - let fields = children - .iter() - .zip(inputs.iter()) - .map(|(field, input)| { - let value = self.render_port(*input, locals)?; - Ok(render_named_template( - &self.indexes.syntax.values.struct_field_init, - &[("name", &field.label), ("value", &value)], - )) - }) - .collect::, EmitError>>()?; - Ok(Some(render_named_template( - &self.indexes.syntax.values.variant_named_construction, - &[ - ("variant", &variant_name), - ( - "fields", - &fields.join(&self.indexes.syntax.values.struct_field_separator), - ), - ], - ))) - } - - fn render_callable_body( - &self, - callable_decl: DeclarationId, - param_bindings: &[(String, String)], - outer_locals: &RenderLocals, - ) -> Result { - let TypeConnective::Arrow { inputs, body, .. } = - &self.dag.declaration(callable_decl).connective - else { - return Err(EmitError::UnsupportedBehavior( - "callable template binding did not resolve to an Arrow declaration".to_string(), - )); - }; - let ArrowBody::UserDefined(bind_id) = body else { - return Err(EmitError::UnsupportedBehavior( - "external or unparsed callable bodies are not yet supported".to_string(), - )); - }; - let bind = (*bind_id).bind(self.dag); - if inputs.len() != param_bindings.len() { - return Err(EmitError::UnsupportedBehavior( - "callable parameter count does not match requested bindings".to_string(), - )); - } - let capture_count = bind.params.len() - inputs.len(); - let mut locals = RenderLocals::default(); - for capture in bind.params.iter().copied().take(capture_count) { - locals - .names - .insert(capture, self.render_port(capture, outer_locals)?); - } - for (port, (_, binding)) in bind - .params - .iter() - .copied() - .skip(capture_count) - .zip(param_bindings.iter()) - { - locals.names.insert(port, binding.clone()); - } - self.render_port(bind.value, &locals) - } - - fn render_function_declaration( - &self, - declaration: &crate::dag::Declaration, - ) -> Result { - let Some(name) = &declaration.name else { - return Err(EmitError::UnsupportedBehavior( - "anonymous Arrow declarations cannot be emitted".to_string(), - )); - }; - let TypeConnective::Arrow { inputs, body, .. } = &declaration.connective else { - return Err(EmitError::UnsupportedBehavior( - "render_function_declaration expected an Arrow".to_string(), - )); - }; - let ArrowBody::UserDefined(bind_id) = body else { - return Err(EmitError::UnsupportedBehavior( - "external Arrow bodies are not yet supported in function emission".to_string(), - )); - }; - let bind = (*bind_id).bind(self.dag); - let mut locals = RenderLocals::default(); - let params = bind - .params - .iter() - .enumerate() - .map(|(idx, port)| { - let param_name = format!("p{idx}"); - locals.names.insert(*port, param_name.clone()); - let ty = self.go_type_name_for_port(*port)?; - Ok(render_named_template( - &self.indexes.syntax.functions.param_with_type, - &[("name", ¶m_name), ("type", &ty)], - )) - }) - .collect::, EmitError>>()?; - if bind.params.len() != inputs.len() { - return Err(EmitError::UnsupportedBehavior( - "function bind parameter count does not match Arrow inputs".to_string(), - )); - } - let ret = self.go_type_name_for_port(bind.value)?; - let body = self.render_port(bind.value, &locals)?; - let rendered = render_named_template( - &self.indexes.syntax.functions.definition, - &[ - ("name", name), - ( - "params", - ¶ms.join(&self.indexes.syntax.functions.param_separator), - ), - ("ret", &ret), - ("body", &body), - ], - ); - let _ = self.mode; - Ok(rendered) - } - - fn render_type_declaration( - &self, - declaration: &crate::dag::Declaration, - ) -> Result { - let Some(name) = &declaration.name else { - return Err(EmitError::UnsupportedBehavior( - "anonymous type declarations cannot be emitted".to_string(), - )); - }; - match &declaration.connective { - TypeConnective::Conj { children } => { - let fields = children - .iter() - .map(|field| self.render_struct_field(field)) - .collect::, _>>()?; - Ok(render_named_template( - &self.indexes.syntax.type_definitions.struct_def, - &[("name", name), ("fields", &fields.join("; "))], - )) - } - TypeConnective::Disj { variants } => { - let mut parts = vec![format!("type {name} interface {{ is{name}() }}")]; - for variant in variants { - let variant_decl = self.dag.declaration(variant.ty); - let TypeConnective::Conj { children } = &variant_decl.connective else { - return Err(EmitError::UnsupportedBehavior(format!( - "enum variant `{}` does not lower to a product declaration", - variant.label - ))); - }; - if children.is_empty() { - parts.push(format!("type {} struct{{}}", variant.label)); - } else { - let fields = children - .iter() - .map(|field| self.render_struct_field(field)) - .collect::, _>>()?; - parts.push(format!( - "type {} struct {{ {} }}", - variant.label, - fields.join("; ") - )); - } - parts.push(format!("func ({}) is{name}() {{}}", variant.label)); - } - Ok(parts.join("\n")) - } - _ => Err(EmitError::UnsupportedBehavior(format!( - "type declaration `{name}` does not lower to a record or sum shape" - ))), - } - } - - fn render_struct_field(&self, field: &Field) -> Result { - let ty = self.go_type_name_for_decl(field.ty)?; - Ok(render_named_template( - &self.indexes.syntax.type_definitions.struct_field, - &[("name", &field.label), ("type", &ty)], - )) - } - - fn branch_scrutinee_is_bool(&self, branch: &BranchNode) -> Result { - let scrutinee_type = primitive_type_id_for_port(self.dag, branch.input)?; - let Some(bool_shape) = self.dag.bool_shape() else { - return Err(EmitError::MissingTypeRealization { - target: scrutinee_type, - }); - }; - let Some(scrutinee_disj) = walk_to_disj(self.dag, scrutinee_type) else { - return Ok(false); - }; - let Some(bool_disj) = walk_to_disj(self.dag, bool_shape.declaration) else { - return Ok(false); - }; - Ok(scrutinee_disj == bool_disj) - } - - fn split_bool_paths<'p>( - &self, - branch: &'p BranchNode, - ) -> Result<(&'p Path, &'p Path), EmitError> { - let scrutinee_type = primitive_type_id_for_port(self.dag, branch.input)?; - let disj_id = walk_to_disj(self.dag, scrutinee_type).ok_or_else(|| { - EmitError::UnsupportedBehavior( - "branch scrutinee type does not walk to a Disj".to_string(), - ) - })?; - let variants = match &self.dag.declaration(disj_id).connective { - TypeConnective::Disj { variants } => variants, - _ => unreachable!("walk_to_disj returned non-Disj"), - }; - if variants.len() != 2 { - return Err(EmitError::NonBooleanBranch { - variant_ids: variants.iter().map(|variant| variant.ty).collect(), - }); - } - let true_variant = variants[0].ty; - let false_variant = variants[1].ty; - let mut then_path = None; - let mut else_path = None; - for path in &branch.paths { - let resolved = match &path.pattern { - BranchPattern::ResolvedVariant(id) => *id, - BranchPattern::UnresolvedVariant { name, .. } => { - return Err(EmitError::UnresolvedBranchPattern { - variant_name: name.clone(), - }); - } - }; - if resolved == true_variant { - then_path = Some(path); - } else if resolved == false_variant { - else_path = Some(path); - } - } - match (then_path, else_path) { - (Some(t), Some(e)) => Ok((t, e)), - _ => Err(EmitError::UnsupportedBehavior( - "if/else branch must have both True and False arms".to_string(), - )), - } - } - - fn go_type_name_for_port(&self, port: PortId) -> Result { - let ty = self - .dag - .port(port) - .value_type() - .ok_or(EmitError::UntypedPort(port))?; - self.go_type_name_for_decl(ty.declaration) - } - - fn go_type_name_for_decl(&self, declaration: DeclarationId) -> Result { - self.go_type_name_for_decl_at_depth(declaration, 0) - } - - fn go_type_name_for_decl_at_depth( - &self, - declaration: DeclarationId, - depth: usize, - ) -> Result { - if depth >= 32 { - return Err(EmitError::UnsupportedBehavior( - "type-name rendering exceeded depth 32".to_string(), - )); - } - if let Some(binding) = self.indexes.types.get(&declaration) { - return Ok(binding.carrier.clone()); - } - let decl = self.dag.declaration(declaration); - if let Some(name) = &decl.name { - return Ok(name.clone()); - } - match &decl.connective { - TypeConnective::Instantiation { - template, - arguments, - } => { - let Some(binding) = self.indexes.instantiations.get(template) else { - return Err(EmitError::MissingTypeRealization { target: *template }); - }; - match arguments.as_slice() { - [element] => { - let element_name = - self.go_type_name_for_decl_at_depth(element.value, depth + 1)?; - Ok(render_named_template( - &binding.carrier, - &[("element", &element_name)], - )) - } - [key, value] => { - let key_name = self.go_type_name_for_decl_at_depth(key.value, depth + 1)?; - let value_name = - self.go_type_name_for_decl_at_depth(value.value, depth + 1)?; - Ok(render_named_template( - &binding.carrier, - &[("key", &key_name), ("value", &value_name)], - )) - } - [key, value, extra] => { - let key_name = self.go_type_name_for_decl_at_depth(key.value, depth + 1)?; - let value_name = - self.go_type_name_for_decl_at_depth(value.value, depth + 1)?; - let extra_name = - self.go_type_name_for_decl_at_depth(extra.value, depth + 1)?; - Ok(render_named_template( - &binding.carrier, - &[ - ("key", &key_name), - ("value", &value_name), - ("extra", &extra_name), - ], - )) - } - _ => Err(EmitError::UnsupportedBehavior( - "instantiated type carrier only supports arities 1, 2, and 3".to_string(), - )), - } - } - TypeConnective::Cardinality(p) if p.bound() == CardinalityBound::AtMostOne => { - let inner = self.go_type_name_for_decl_at_depth(p.element(), depth + 1)?; - Ok(render_named_template( - &self.indexes.syntax.type_applications.optional, - &[("element", &inner)], - )) - } - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - self.go_type_name_for_decl_at_depth(*next, depth + 1) - } - _ => Err(EmitError::MissingTypeRealization { - target: declaration, - }), - } - } - - fn list_element_type_name_for_list_port(&self, port: PortId) -> Result { - let ty = self - .dag - .port(port) - .value_type() - .ok_or(EmitError::UntypedPort(port))?; - let TypeConnective::Instantiation { - template, - arguments, - } = &self.dag.declaration(ty.declaration).connective - else { - return Err(EmitError::UnsupportedBehavior( - "list type rendering expected instantiated List".to_string(), - )); - }; - if !self - .dag - .list_template() - .is_some_and(|list| list == *template) - { - return Err(EmitError::UnsupportedBehavior( - "list type rendering expected List template".to_string(), - )); - } - let [element] = arguments.as_slice() else { - return Err(EmitError::UnsupportedBehavior( - "List instantiation must carry one type argument".to_string(), - )); - }; - self.go_type_name_for_decl(element.value) - } - - fn variant_payload_binding_for_variant( - &self, - variant_id: DeclarationId, - binding_expr: &str, - ) -> Result>, EmitError> { - let shape = match variant_payload_shape(self.dag, &variant_id) { - VariantPayloadShapeLookup::DeclarationMissing => { - return Err(EmitError::UnsupportedBehavior( - "variant payload references an absent declaration".to_string(), - )); - } - VariantPayloadShapeLookup::NotPayloadProduct => { - return Err(EmitError::UnsupportedBehavior( - "variant payload expected a product declaration".to_string(), - )); - } - VariantPayloadShapeLookup::Found { _0: shape } => shape, - }; - Ok(match shape { - VariantPayloadShape::Empty => None, - VariantPayloadShape::PositionalSingle => { - Some(VariantPayloadBinding::Direct(format!("{binding_expr}._0"))) - } - VariantPayloadShape::NamedFields { _0: field_labels } => { - match self.indexes.clean_emission.variant_payload_field_access { - VariantPayloadFieldAccessRuleBinding::AccessFromPayloadBinding => { - Some(VariantPayloadBinding::Direct(binding_expr.to_string())) - } - VariantPayloadFieldAccessRuleBinding::OverrideNamedFieldsAtBindingSite => { - let fields = field_labels - .into_iter() - .map(|field_label| { - (field_label.clone(), format!("{binding_expr}.{field_label}")) - }) - .collect(); - Some(VariantPayloadBinding::Fields(fields)) - } - } - } - }) - } -} - -fn structural_fields_for_decl( - dag: &Dag, - declaration: DeclarationId, -) -> Result<&[(String, FieldValue)], EmitError> { - let Some(ValueBody::Structural { fields }) = &dag.declaration(declaration).value_body else { - return Err(EmitError::MalformedTargetSyntax { - declaration, - detail: "syntax declaration must carry a structural value body", - }); - }; - Ok(fields) -} - -fn syntax_field_string( - fields: &[(String, FieldValue)], - label: &str, - declaration: DeclarationId, -) -> Result { - require_field_string(fields, label, declaration).map(|s| s.replace("%Q", "\"")) -} - -fn parse_statement_syntax( - dag: &Dag, - declaration: DeclarationId, -) -> Result { - let fields = structural_fields_for_decl(dag, declaration)?; - Ok(StatementSyntaxBinding { - let_binding: syntax_field_string(fields, "let_binding", declaration)?, - }) -} - -fn parse_expression_syntax( - dag: &Dag, - declaration: DeclarationId, -) -> Result { - let fields = structural_fields_for_decl(dag, declaration)?; - Ok(ExpressionSyntaxBinding { - field_access: syntax_field_string(fields, "field_access", declaration)?, - function_call: syntax_field_string(fields, "function_call", declaration)?, - }) -} - -fn parse_function_syntax( - dag: &Dag, - declaration: DeclarationId, -) -> Result { - let fields = structural_fields_for_decl(dag, declaration)?; - Ok(FunctionSyntaxBinding { - definition: syntax_field_string(fields, "definition", declaration)?, - param_with_type: syntax_field_string(fields, "param_with_type", declaration)?, - param_separator: syntax_field_string(fields, "param_separator", declaration)?, - }) -} - -fn parse_type_application_syntax( - dag: &Dag, - declaration: DeclarationId, -) -> Result { - let fields = structural_fields_for_decl(dag, declaration)?; - Ok(TypeApplicationSyntaxBinding { - optional: syntax_field_string(fields, "optional", declaration)?, - }) -} - -fn parse_type_definition_syntax( - dag: &Dag, - declaration: DeclarationId, -) -> Result { - let fields = structural_fields_for_decl(dag, declaration)?; - Ok(TypeDefinitionSyntaxBinding { - struct_def: syntax_field_string(fields, "struct_def", declaration)?, - struct_field: syntax_field_string(fields, "struct_field", declaration)?, - }) -} - -fn parse_value_construction_syntax( - dag: &Dag, - declaration: DeclarationId, -) -> Result { - let fields = structural_fields_for_decl(dag, declaration)?; - Ok(ValueConstructionSyntaxBinding { - struct_literal: syntax_field_string(fields, "struct_literal", declaration)?, - struct_field_init: syntax_field_string(fields, "struct_field_init", declaration)?, - struct_field_separator: syntax_field_string(fields, "struct_field_separator", declaration)?, - variant_named_construction: syntax_field_string( - fields, - "variant_named_construction", - declaration, - )?, - }) -} - -fn parse_literal_syntax( - dag: &Dag, - declaration: DeclarationId, -) -> Result { - let fields = structural_fields_for_decl(dag, declaration)?; - Ok(LiteralSyntaxBinding { - true_keyword: syntax_field_string(fields, "true_keyword", declaration)?, - false_keyword: syntax_field_string(fields, "false_keyword", declaration)?, - string_delimiter: syntax_field_string(fields, "string_delimiter", declaration)?, - }) -} - -fn require_field_decl_ref( - fields: &[(String, FieldValue)], - label: &str, - declaration: DeclarationId, -) -> Result { - fields - .iter() - .find(|(field_label, _)| field_label == label) - .and_then(|(_, value)| match value { - FieldValue::Reference(id) => Some(*id), - _ => None, - }) - .ok_or(EmitError::MalformedRealization { - declaration, - detail: - "realization data item is missing a required Reference field or has wrong shape — see lower_record_to_structural inhabitance check", - }) -} - -fn require_field_string( - fields: &[(String, FieldValue)], - label: &str, - declaration: DeclarationId, -) -> Result { - fields - .iter() - .find(|(field_label, _)| field_label == label) - .and_then(|(_, value)| match value { - FieldValue::Literal(LiteralBits::String(s)) => Some(s.clone()), - _ => None, - }) - .ok_or(EmitError::MalformedRealization { - declaration, - detail: - "realization data item is missing a required String field or has wrong shape — see lower_record_to_structural inhabitance check", - }) -} - -fn require_field_bindings( - dag: &Dag, - fields: &[(String, FieldValue)], - declaration: DeclarationId, -) -> Result, EmitError> { - let value = fields - .iter() - .find(|(label, _)| label == "fields") - .map(|(_, value)| value) - .ok_or(EmitError::MalformedRealization { - declaration, - detail: "TypeRealization is missing required `fields` list", - })?; - let FieldValue::List(entries) = value else { - return Err(EmitError::MalformedRealization { - declaration, - detail: "TypeRealization.fields must be a structural list", - }); - }; - let mut bindings = HashMap::new(); - for entry in entries { - let FieldValue::Record(fields) = entry else { - return Err(EmitError::MalformedRealization { - declaration, - detail: "FieldBinding entries must be structural records", - }); - }; - let dag_name = fields - .iter() - .find(|(label, _)| label == "dag_name") - .and_then(|(_, value)| match value { - FieldValue::Literal(LiteralBits::String(name)) => Some(name.clone()), - _ => None, - }) - .ok_or(EmitError::MalformedRealization { - declaration, - detail: "FieldBinding.dag_name must be a String literal", - })?; - let access = fields - .iter() - .find(|(label, _)| label == "access") - .ok_or(EmitError::MalformedRealization { - declaration, - detail: "FieldBinding.access is required", - }) - .and_then(|(_, value)| parse_field_access(dag, value, declaration))?; - if bindings - .insert(dag_name, FieldBindingBinding { access }) - .is_some() - { - return Err(EmitError::DuplicateRealization { - declaration, - detail: "TypeRealization.fields contains duplicate dag_name entries", - }); - } - } - Ok(bindings) -} - -fn parse_field_access( - dag: &Dag, - value: &FieldValue, - declaration: DeclarationId, -) -> Result { - let FieldValue::Variant { - constructor, - payload, - } = value - else { - return Err(EmitError::MalformedRealization { - declaration, - detail: "FieldBinding.access must be a FieldAccess variant", - }); - }; - if payload.len() != 1 { - return Err(EmitError::MalformedRealization { - declaration, - detail: "FieldAccess variants must carry exactly one String payload", - }); - } - let name = match &payload[0] { - FieldValue::Literal(LiteralBits::String(name)) => name.clone(), - _ => { - return Err(EmitError::MalformedRealization { - declaration, - detail: "FieldAccess payload must be a String literal", - }); - } - }; - let variants = dag.emit_model_variants(); - let direct_field = - variants - .field_access - .direct_field - .ok_or(EmitError::MalformedRealization { - declaration, - detail: "FieldAccess.DirectField declaration was not found", - })?; - let accessor_method = - variants - .field_access - .accessor_method - .ok_or(EmitError::MalformedRealization { - declaration, - detail: "FieldAccess.AccessorMethod declaration was not found", - })?; - if *constructor == direct_field { - Ok(GoFieldAccessBinding::DirectField(name)) - } else if *constructor == accessor_method { - Ok(GoFieldAccessBinding::AccessorMethod(name)) - } else { - Err(EmitError::MalformedRealization { - declaration, - detail: "FieldAccess constructor must be DirectField or AccessorMethod", - }) - } -} - -fn require_callable_strategy( - dag: &Dag, - fields: &[(String, FieldValue)], - declaration: DeclarationId, -) -> Result { - let value = fields - .iter() - .find(|(label, _)| label == "strategy") - .map(|(_, value)| value) - .ok_or(EmitError::MalformedRealization { - declaration, - detail: "CallableRealization is missing required `strategy` field", - })?; - let FieldValue::Variant { - constructor, - payload, - } = value - else { - return Err(EmitError::MalformedRealization { - declaration, - detail: "CallableRealization.strategy must be a CallableStrategy variant", - }); - }; - if !payload.is_empty() { - return Err(EmitError::MalformedRealization { - declaration, - detail: "CallableStrategy variants must not carry payload fields", - }); - } - let variants = dag.callable_strategy_variants(); - let strategies = [ - (variants.list_empty, CallableStrategyBinding::ListEmpty), - ( - variants.list_singleton, - CallableStrategyBinding::ListSingleton, - ), - (variants.list_cons, CallableStrategyBinding::ListCons), - (variants.list_concat, CallableStrategyBinding::ListConcat), - (variants.list_length, CallableStrategyBinding::ListLength), - (variants.list_is_empty, CallableStrategyBinding::ListIsEmpty), - (variants.list_fold, CallableStrategyBinding::ListFold), - (variants.list_map, CallableStrategyBinding::ListMap), - (variants.list_filter, CallableStrategyBinding::ListFilter), - ( - variants.list_contains, - CallableStrategyBinding::ListContains, - ), - ]; - for (variant_id, binding) in strategies { - let Some(variant_id) = variant_id else { - return Err(EmitError::MalformedRealization { - declaration, - detail: "CallableStrategy variant declaration was not found", - }); - }; - if *constructor == variant_id { - return Ok(binding); - } - } - Err(EmitError::MalformedRealization { - declaration, - detail: - "CallableStrategy constructor must be ListEmpty/ListSingleton/ListCons/ListConcat/ListLength/ListIsEmpty/ListFold/ListMap/ListFilter/ListContains", - }) -} - -/// Parse and validate the `parameters` list on a CallableRealization. -/// Mirrors emit_rust::require_parameter_dispositions exactly. Go's GC -/// rendering doesn't act on the result, but the shared schema requires -/// the field and validation makes arity/order drift unrepresentable. -fn require_parameter_dispositions( - dag: &Dag, - fields: &[(String, FieldValue)], - declaration: DeclarationId, - expected_arity: usize, -) -> Result, EmitError> { - let value = fields - .iter() - .find(|(label, _)| label == "parameters") - .map(|(_, value)| value) - .ok_or(EmitError::MalformedRealization { - declaration, - detail: "CallableRealization is missing required `parameters` field", - })?; - let FieldValue::List(entries) = value else { - return Err(EmitError::MalformedRealization { - declaration, - detail: "CallableRealization.parameters must be a structural list", - }); - }; - if entries.len() != expected_arity { - return Err(EmitError::MalformedRealization { - declaration, - detail: "CallableRealization.parameters length does not match the callable's Arrow input arity", - }); - } - let mut filled: Vec> = vec![None; expected_arity]; - for entry in entries { - let (slot, disposition) = parse_callable_parameter(dag, entry, declaration)?; - if slot >= expected_arity { - return Err(EmitError::MalformedRealization { - declaration, - detail: "CallableParameter.slot is out of range for the callable's declared arity", - }); - } - if filled[slot].is_some() { - return Err(EmitError::MalformedRealization { - declaration, - detail: "CallableParameter.slot is duplicated within parameters list", - }); - } - filled[slot] = Some(disposition); - } - filled - .into_iter() - .map(|opt| { - opt.ok_or(EmitError::MalformedRealization { - declaration, - detail: "CallableRealization.parameters does not cover every slot in [0, arity)", - }) - }) - .collect() -} - -fn parse_callable_parameter( - dag: &Dag, - value: &FieldValue, - declaration: DeclarationId, -) -> Result<(usize, ParameterDispositionBinding), EmitError> { - let FieldValue::Record(fields) = value else { - return Err(EmitError::MalformedRealization { - declaration, - detail: "CallableRealization.parameters entries must be CallableParameter records", - }); - }; - let slot = fields - .iter() - .find(|(label, _)| label == "slot") - .map(|(_, value)| value) - .ok_or(EmitError::MalformedRealization { - declaration, - detail: "CallableParameter is missing required `slot` field", - })?; - let FieldValue::Literal(LiteralBits::Int(slot_str)) = slot else { - return Err(EmitError::MalformedRealization { - declaration, - detail: "CallableParameter.slot must be an Int literal", - }); - }; - let Some(slot_int) = crate::dag::literal_decimal_i64(slot_str.as_str()) else { - return Err(EmitError::MalformedRealization { - declaration, - detail: "CallableParameter.slot must be a decimal Int literal", - }); - }; - if slot_int < 0 { - return Err(EmitError::MalformedRealization { - declaration, - detail: "CallableParameter.slot must be non-negative", - }); - } - let disposition_value = fields - .iter() - .find(|(label, _)| label == "disposition") - .map(|(_, value)| value) - .ok_or(EmitError::MalformedRealization { - declaration, - detail: "CallableParameter is missing required `disposition` field", - })?; - let disposition = parse_parameter_disposition(dag, disposition_value, declaration)?; - Ok((slot_int as usize, disposition)) -} - -fn parse_parameter_disposition( - dag: &Dag, - value: &FieldValue, - declaration: DeclarationId, -) -> Result { - let FieldValue::Variant { - constructor, - payload, - } = value - else { - return Err(EmitError::MalformedRealization { - declaration, - detail: "CallableParameter.disposition must be a ParameterDisposition variant", - }); - }; - if !payload.is_empty() { - return Err(EmitError::MalformedRealization { - declaration, - detail: "ParameterDisposition variants must not carry payload fields", - }); - } - let variants = dag.emit_model_variants(); - let borrowed = - variants - .parameter_disposition - .borrowed - .ok_or(EmitError::MalformedRealization { - declaration, - detail: "ParameterDisposition.Borrowed declaration was not found", - })?; - let consumed = - variants - .parameter_disposition - .consumed - .ok_or(EmitError::MalformedRealization { - declaration, - detail: "ParameterDisposition.Consumed declaration was not found", - })?; - if *constructor == borrowed { - Ok(ParameterDispositionBinding::Borrowed) - } else if *constructor == consumed { - Ok(ParameterDispositionBinding::Consumed) - } else { - Err(EmitError::MalformedRealization { - declaration, - detail: "ParameterDisposition constructor must be Borrowed or Consumed", - }) - } -} - -/// Structural boundary check for `PatternRealization.empty_variant` / -/// `cons_variant`. Mirrors the same check in `rust_target` and -/// `python_target` — the typed `DeclarationRef` alone cannot express -/// "must be a variant of `target`", so reject-at-boundary on parse. -fn validate_pattern_roles( - dag: &Dag, - target: DeclarationId, - binding: &PatternRealizationBinding, - declaration: DeclarationId, -) -> Result<(), EmitError> { - let disj_id = walk_to_disj(dag, target).ok_or(EmitError::MalformedRealization { - declaration, - detail: - "PatternRealization.target must resolve to a Disj — empty_variant / cons_variant have no target to range over otherwise", - })?; - let TypeConnective::Disj { variants } = &dag.declaration(disj_id).connective else { - return Err(EmitError::MalformedRealization { - declaration, - detail: "walk_to_disj returned a non-Disj declaration (internal invariant violation)", - }); - }; - if !variants.iter().any(|v| v.ty == binding.empty_variant) { - return Err(EmitError::MalformedRealization { - declaration, - detail: - "PatternRealization.empty_variant must be a variant of `target` — structural boundary check rejects unrelated DeclarationRefs", - }); - } - if !variants.iter().any(|v| v.ty == binding.cons_variant) { - return Err(EmitError::MalformedRealization { - declaration, - detail: - "PatternRealization.cons_variant must be a variant of `target` — structural boundary check rejects unrelated DeclarationRefs", - }); - } - if binding.empty_variant == binding.cons_variant { - return Err(EmitError::MalformedRealization { - declaration, - detail: - "PatternRealization.empty_variant and cons_variant must be distinct variants of `target`", - }); - } - Ok(()) -} - -fn require_pattern_realization( - dag: &Dag, - fields: &[(String, FieldValue)], - declaration: DeclarationId, -) -> Result { - let value = fields - .iter() - .find(|(label, _)| label == "strategy") - .map(|(_, value)| value) - .ok_or(EmitError::MalformedRealization { - declaration, - detail: "PatternRealization is missing required `strategy` field", - })?; - let FieldValue::Variant { - constructor, - payload, - } = value - else { - return Err(EmitError::MalformedRealization { - declaration, - detail: "PatternRealization.strategy must be a PatternStrategy variant", - }); - }; - if !payload.is_empty() { - return Err(EmitError::MalformedRealization { - declaration, - detail: "PatternStrategy variants must not carry payload fields", - }); - } - let vector_list = dag - .emit_model_variants() - .pattern_strategy - .vector_list - .ok_or(EmitError::MalformedRealization { - declaration, - detail: "PatternStrategy.VectorList declaration was not found", - })?; - if *constructor != vector_list { - return Err(EmitError::MalformedRealization { - declaration, - detail: "PatternStrategy constructor must be VectorList", - }); - } - Ok(PatternRealizationBinding { - empty_variant: require_field_decl_ref(fields, "empty_variant", declaration)?, - cons_variant: require_field_decl_ref(fields, "cons_variant", declaration)?, - scrutinee: require_field_string(fields, "scrutinee", declaration)?, - empty_pattern: require_field_string(fields, "empty_pattern", declaration)?, - cons_pattern: require_field_string(fields, "cons_pattern", declaration)?, - head_expr: require_field_string(fields, "head_expr", declaration)?, - tail_expr: require_field_string(fields, "tail_expr", declaration)?, - }) -} - -fn require_memory_model( - dag: &Dag, - fields: &[(String, FieldValue)], - declaration: DeclarationId, -) -> Result { - let value = fields - .iter() - .find(|(label, _)| label == "memory") - .map(|(_, value)| value) - .ok_or(EmitError::MalformedTargetSyntax { - declaration, - detail: "TargetExecutionModel is missing required `memory` field", - })?; - let FieldValue::Variant { - constructor, - payload, - } = value - else { - return Err(EmitError::MalformedTargetSyntax { - declaration, - detail: "TargetExecutionModel.memory must be a MemoryModel variant", - }); - }; - if !payload.is_empty() { - return Err(EmitError::MalformedTargetSyntax { - declaration, - detail: "MemoryModel variants must not carry payload fields", - }); - } - let variants = dag.emit_model_variants(); - let memory_variants = [ - ( - variants.memory_model.value_only, - MemoryModelBinding::ValueOnly, - ), - ( - variants.memory_model.garbage_collected, - MemoryModelBinding::GarbageCollected, - ), - ( - variants.memory_model.ref_counted, - MemoryModelBinding::RefCounted, - ), - ( - variants.memory_model.ownership_based, - MemoryModelBinding::OwnershipBased, - ), - ]; - for (variant_id, binding) in memory_variants { - let Some(variant_id) = variant_id else { - return Err(EmitError::MalformedTargetSyntax { - declaration, - detail: "MemoryModel variant declaration was not found", - }); - }; - if *constructor == variant_id { - return Ok(binding); - } - } - Err(EmitError::MalformedTargetSyntax { - declaration, - detail: - "TargetExecutionModel.memory must be ValueOnly/GarbageCollected/RefCounted/OwnershipBased", - }) -} - -fn require_scope_model( - dag: &Dag, - fields: &[(String, FieldValue)], - declaration: DeclarationId, -) -> Result { - let value = fields - .iter() - .find(|(label, _)| label == "scope") - .map(|(_, value)| value) - .ok_or(EmitError::MalformedTargetSyntax { - declaration, - detail: "TargetExecutionModel is missing required `scope` field", - })?; - let FieldValue::Variant { - constructor, - payload, - } = value - else { - return Err(EmitError::MalformedTargetSyntax { - declaration, - detail: "TargetExecutionModel.scope must be a ScopeModel variant", - }); - }; - if !payload.is_empty() { - return Err(EmitError::MalformedTargetSyntax { - declaration, - detail: "ScopeModel variants must not carry payload fields", - }); - } - let variants = dag.emit_model_variants(); - let scope_variants = [ - ( - variants.scope_model.lexical_scoping, - ScopeModelBinding::LexicalScoping, - ), - ( - variants.scope_model.dynamic_scoping, - ScopeModelBinding::DynamicScoping, - ), - ]; - for (variant_id, binding) in scope_variants { - let Some(variant_id) = variant_id else { - return Err(EmitError::MalformedTargetSyntax { - declaration, - detail: "ScopeModel variant declaration was not found", - }); - }; - if *constructor == variant_id { - return Ok(binding); - } - } - Err(EmitError::MalformedTargetSyntax { - declaration, - detail: "TargetExecutionModel.scope must be LexicalScoping or DynamicScoping", - }) -} - -/// Reads `excluded_prefixes` from a `data …: SourceFiltering` value body. -fn parse_source_filtering_excluded_prefixes( - dag: &Dag, - declaration: DeclarationId, -) -> Result, EmitError> { - let fields = structural_fields_for_decl(dag, declaration)?; - let value = fields - .iter() - .find(|(label, _)| label == "excluded_prefixes") - .map(|(_, value)| value) - .ok_or(EmitError::MalformedTargetSyntax { - declaration, - detail: "SourceFiltering is missing required `excluded_prefixes` field", - })?; - let FieldValue::List(entries) = value else { - return Err(EmitError::MalformedTargetSyntax { - declaration, - detail: "SourceFiltering.excluded_prefixes must be a list", - }); - }; - let mut excluded_prefixes = Vec::with_capacity(entries.len()); - for entry in entries { - let FieldValue::Literal(LiteralBits::String(prefix)) = entry else { - return Err(EmitError::MalformedTargetSyntax { - declaration, - detail: "SourceFiltering.excluded_prefixes entries must be string literals", - }); - }; - excluded_prefixes.push(prefix.clone()); - } - Ok(excluded_prefixes) -} - -impl SourceFilteringBinding { - pub(crate) fn build(dag: &Dag, declaration: DeclarationId) -> Result { - let fields = structural_fields_for_decl(dag, declaration)?; - if fields.iter().any(|(label, _)| label == "internal") { - let internal = require_field_decl_ref(fields, "internal", declaration)?; - let mut excluded_prefixes = parse_source_filtering_excluded_prefixes(dag, internal)?; - let additional = fields - .iter() - .find(|(label, _)| label == "additional_excluded_prefixes") - .map(|(_, value)| value) - .ok_or(EmitError::MalformedTargetSyntax { - declaration, - detail: "ShapeATargetSourceFiltering is missing required `additional_excluded_prefixes` field", - })?; - let FieldValue::List(extra_entries) = additional else { - return Err(EmitError::MalformedTargetSyntax { - declaration, - detail: - "ShapeATargetSourceFiltering.additional_excluded_prefixes must be a list", - }); - }; - for entry in extra_entries { - let FieldValue::Literal(LiteralBits::String(prefix)) = entry else { - return Err(EmitError::MalformedTargetSyntax { - declaration, - detail: "ShapeATargetSourceFiltering.additional_excluded_prefixes entries must be string literals", - }); - }; - excluded_prefixes.push(prefix.clone()); - } - return Ok(Self { excluded_prefixes }); - } - - let excluded_prefixes = parse_source_filtering_excluded_prefixes(dag, declaration)?; - Ok(Self { excluded_prefixes }) - } - - pub(crate) fn excludes(&self, file: &str) -> bool { - let normalized_file = normalize_source_filter_path(file); - self.excluded_prefixes.iter().any(|prefix| { - if normalized_file.starts_with(prefix) { - return true; - } - if *prefix == "src/v3/compiler/" { - return false; - } - normalized_file.contains(&format!("/{prefix}")) - }) - } -} - -fn normalize_source_filter_path(file: &str) -> String { - let mut parts = Vec::new(); - for part in file.split('/') { - match part { - "" | "." => {} - ".." => { - parts.pop(); - } - _ => parts.push(part), - } - } - parts.join("/") -} - -fn render_named_template(template: &str, bindings: &[(&str, &str)]) -> String { - let bindings: HashMap<&str, &str> = bindings.iter().copied().collect(); - let chars: Vec = template.chars().collect(); - let mut rendered = String::with_capacity(template.len()); - let mut i = 0; - while i < chars.len() { - match chars[i] { - '{' => { - let mut j = i + 1; - while j < chars.len() && chars[j] != '}' { - j += 1; - } - if j < chars.len() { - let key: String = chars[i + 1..j].iter().collect(); - if is_template_placeholder_key(&key) { - if let Some(value) = bindings.get(key.as_str()) { - rendered.push_str(value); - } else { - rendered.push('{'); - rendered.push_str(&key); - rendered.push('}'); - } - i = j + 1; - continue; - } - } - rendered.push('{'); - i += 1; - } - ch => { - rendered.push(ch); - i += 1; - } - } - } - rendered -} - -fn is_template_placeholder_key(key: &str) -> bool { - let mut chars = key.chars(); - let Some(first) = chars.next() else { - return false; - }; - if !(first == '_' || first.is_ascii_alphabetic()) { - return false; - } - chars.all(|ch| ch == '_' || ch.is_ascii_alphanumeric()) -} - -fn find_resolved_branch_path(branch: &BranchNode, variant_id: DeclarationId) -> Option<&Path> { - branch.paths.iter().find(|path| match path.pattern { - BranchPattern::ResolvedVariant(id) => id == variant_id, - BranchPattern::UnresolvedVariant { .. } => false, - }) -} - -fn variant_parent_info(dag: &Dag, variant_id: DeclarationId) -> Option<(String, String)> { - dag.declarations().iter().find_map(|decl| { - let enum_name = decl.name.as_ref()?; - let TypeConnective::Disj { variants } = &decl.connective else { - return None; - }; - variants - .iter() - .find(|variant| variant.ty == variant_id) - .map(|variant| (enum_name.clone(), variant.label.clone())) - }) -} - -fn callable_template(target: DeclarationId, dag: &Dag) -> (DeclarationId, Vec) { - match &dag.declaration(target).connective { - TypeConnective::Instantiation { - template, - arguments, - } => (*template, arguments.clone()), - _ => (target, Vec::new()), - } -} - -fn bound_callable_argument( - dag: &Dag, - template: DeclarationId, - arguments: &[TemplateArgument], - input_index: usize, -) -> Result { - let TypeConnective::Arrow { inputs, .. } = &dag.declaration(template).connective else { - return Err(EmitError::UnsupportedBehavior( - "realized callable template did not resolve to an Arrow declaration".to_string(), - )); - }; - let Some(param_decl) = inputs.get(input_index).copied() else { - return Err(EmitError::UnsupportedBehavior(format!( - "realized callable slot {} is missing from the template declaration", - input_index - ))); - }; - arguments - .iter() - .find(|arg| arg.parameter == param_decl) - .map(|arg| arg.value) - .ok_or_else(|| { - EmitError::UnsupportedBehavior( - "realized callable argument did not bind through template instantiation" - .to_string(), - ) - }) -} - -fn render_value(v: &crate::dag::ValueNode, literals: &LiteralSyntaxBinding) -> String { - match &v.data { - LiteralBits::Int(decimal) => decimal.clone(), - LiteralBits::Bool(true) => literals.true_keyword.clone(), - LiteralBits::Bool(false) => literals.false_keyword.clone(), - LiteralBits::String(s) | LiteralBits::Symbol(s) => format!( - "{}{}{}", - literals.string_delimiter, - s.replace('\\', "\\\\").replace('"', "\\\""), - literals.string_delimiter - ), - } -} - -fn primitive_type_id_for_port(dag: &Dag, port: PortId) -> Result { - primitive_type_id_for_port_shared(dag, port).map_err(|err| match err { - SharedEmitLookupError::UntypedPort(port) => EmitError::UntypedPort(port), - SharedEmitLookupError::Unsupported(detail) => EmitError::UnsupportedBehavior(detail), - }) -} - -/// Peel named empty `Instantiation` chains (`type MyBool = Bool` → `Bool`). -/// -/// Used **only after** refinement stripping and **only as a fallback** in -/// [`operator_carrier_realization`]: kernel types like `Int` are also named -/// `Instantiation` rows, so the peeled id must not replace the surface key when -/// the direct lookup succeeds. -pub(crate) fn operator_realization_lookup_type( - dag: &Dag, - mut current: DeclarationId, -) -> DeclarationId { - for _ in 0..32 { - let decl = dag.declaration(current); - let TypeConnective::Instantiation { - template, - arguments, - } = &decl.connective - else { - break; - }; - if !(decl.name.is_some() && arguments.is_empty() && *template != current) { - break; - } - current = *template; - } - current -} - -/// Operand-side lookup for [`crate::operators`] realization keys. Strips -/// refinements via [`crate::infer::strip_refinement_to_base`] (same rule as -/// `resolve_operator_arrow`) before optional named-alias peeling. -pub(crate) fn operator_carrier_realization<'a>( - operators: &'a HashMap<(DeclarationId, DeclarationId), String>, - dag: &Dag, - primitive_operand_decl: DeclarationId, - op_decl: DeclarationId, -) -> Option<&'a String> { - let stripped = strip_refinement_to_base(dag, primitive_operand_decl); - let peeled = operator_realization_lookup_type(dag, stripped); - let mut prev: Option = None; - for candidate in [primitive_operand_decl, stripped, peeled] { - if prev == Some(candidate) { - continue; - } - prev = Some(candidate); - if let Some(carrier) = operators.get(&(candidate, op_decl)) { - return Some(carrier); - } - } - None -} - -fn algebra_field_for_operator( - dag: &Dag, - operand_type_id: DeclarationId, - op: OperatorKind, -) -> Result { - algebra_field_for_operator_shared(dag, operand_type_id, op).map_err(|err| match err { - SharedEmitLookupError::UntypedPort(port) => EmitError::UntypedPort(port), - SharedEmitLookupError::Unsupported(detail) => EmitError::UnsupportedBehavior(detail), - }) -} - -#[cfg(test)] -mod tests { - use super::*; - use crate::compile_to_dag; - use crate::dag::{ - literal_bits_int, BindEmitParticipation, BranchEmitParticipation, TransformTarget, - }; - use crate::diagnostics::SourceSpan; - - // DELETED: go_gc_targets_skip_rendering_model_loading - // - // This test deliberately corrupted `go_rendering` and asserted - // emission succeeded — codifying "declared target fact is - // non-authoritative" as a unit-tested property. That directly - // violates INVARIANTS.md E-6 (no target-spec field without a - // same-PR consumer). Removed so the go_rendering authority is - // allowed to become load-bearing; if a future test needs to - // assert "emission doesn't rely on X for GC targets," it should - // do so by driving emission on a properly-populated spec, not - // by corrupting a field and asserting we ignore it. - - #[test] - fn go_struct_fields_render_with_separators() { - let dag = - compile_to_dag("type Pair { left: Int right: Int }", "pair.v3").expect("compiles"); - let rendered = emit_module(&dag, EmitTarget::Go) - .expect("go emitter should render struct") - .text; - assert!( - rendered.contains("type Pair struct { left int64; right int64 }"), - "got: {rendered}" - ); - } - - #[test] - fn go_program_emission_excludes_internal_pipeline_authority() { - let dag = compile_to_dag( - "fn double(x: Int) -> Int = x + x\nlet result: Int = double(20)\n", - "program.v3", - ) - .expect("compiles"); - let rendered = emit(&dag, EmitTarget::Go) - .expect("go emitter should render program") - .text; - assert!(!rendered.contains("parse_realization"), "got: {rendered}"); - assert!(!rendered.contains("DeclarationRef"), "got: {rendered}"); - } - - #[test] - fn shared_primitive_type_lookup_preserves_named_aliases() { - let dag = compile_to_dag( - "type MyInt = Int\nfn id(x: MyInt) -> MyInt = x", - "named_alias_test.v3", - ) - .expect("compiles"); - let param_port = dag - .nodes() - .iter() - .find_map(|node| match node { - Behavior::Bind(bind) - if bind.name == "id" - && bind.emit_participation() - == Some(BindEmitParticipation::UserCallable) => - { - bind.params.first().copied() - } - _ => None, - }) - .expect("user function param"); - let my_int = dag.declaration_by_name("MyInt").expect("MyInt decl").id; - - assert_eq!( - primitive_type_id_for_port_shared(&dag, param_port), - Ok(my_int), - ); - } - - #[test] - fn shared_walk_to_disj_finds_match_scrutinee_sum_type() { - let dag = compile_to_dag( - "type Sign = Plus | Minus\nfn classify(s: Sign) -> Int = match s { Plus => 0, Minus => 1 }", - "match_test.v3", - ) - .expect("compiles"); - let classify_output = dag - .nodes() - .iter() - .find_map(|node| match node { - Behavior::Bind(bind) - if bind.name == "classify" - && bind.emit_participation() - == Some(BindEmitParticipation::UserCallable) => - { - Some(bind.value) - } - _ => None, - }) - .expect("classify user function output"); - let branch_input = dag - .nodes() - .iter() - .find_map(|node| match node { - Behavior::Branch(branch) - if branch.output == classify_output - && branch.emit_participation() - == Some(BranchEmitParticipation::UserMatch) => - { - Some(branch.input) - } - _ => None, - }) - .expect("user branch input"); - let scrutinee_type = - primitive_type_id_for_port_shared(&dag, branch_input).expect("scrutinee type"); - let sign = dag.declaration_by_name("Sign").expect("Sign decl").id; - - assert_eq!(walk_to_disj(&dag, scrutinee_type), Some(sign)); - } - - #[test] - fn go_fold_marks_loop_item_used_inside_the_loop() { - let dag = compile_to_dag( - "let total: Int = fold(cons(1, singleton(2)), 0, |acc, x| acc + x)", - "fold_item_scope.v3", - ) - .expect("compiles"); - let rendered = emit(&dag, EmitTarget::Go) - .expect("go emitter should render fold") - .text; - assert!( - rendered.contains("for _, __foldItem := range"), - "got: {rendered}" - ); - assert!( - rendered.contains("{ _ = __foldItem; __foldAcc = "), - "got: {rendered}" - ); - assert!( - !rendered.contains("_ = (int64)(__foldItem)"), - "got: {rendered}" - ); - } - - #[test] - fn go_map_and_filter_mark_unused_loop_items_used_inside_the_loop() { - let dag = compile_to_dag( - "let total: Int = length(filter(map(cons(1, singleton(2)), |x| x + 1), |y| y == 2))", - "map_filter_loop_item.v3", - ) - .expect("compiles"); - let rendered = emit(&dag, EmitTarget::Go) - .expect("go emitter should render map/filter") - .text; - assert!( - rendered.contains("for _, __mapItem := range") && rendered.contains("_ = __mapItem;"), - "got: {rendered}" - ); - assert!( - rendered.contains("for _, __filterItem := range") - && rendered.contains("_ = __filterItem;"), - "got: {rendered}" - ); - } - - #[test] - fn go_multi_field_variant_payload_binding_uses_the_variant_value() { - // Originally exercised via a recursive `count`, which lowered - // to `Behavior::Loop` and was silently emitted (the loop-as- - // body-result collapse). emit_go now fail-closes on Loop, so - // we use a non-recursive body that still exercises Cons(payload) - // payload-binding rendering. - let dag = compile_to_dag( - "type IntList = Empty | Cons { head: Int, tail: IntList }\nfn head_or_zero(list: IntList) -> Int = match list { Empty => 0, Cons(payload) => payload.head }\n", - "variant_payload_binding.v3", - ) - .expect("compiles"); - let rendered = emit_module(&dag, EmitTarget::Go) - .expect("go emitter should render match") - .text; - assert!( - rendered.contains("case Cons: return (v).head"), - "got: {rendered}" - ); - assert!(!rendered.contains("payload := v;"), "got: {rendered}"); - } - - #[test] - fn go_named_single_field_variant_payload_binding_uses_the_variant_value() { - let dag = compile_to_dag( - "type Point { x: Int y: Int }\ntype Wrapped = Wrap { inner: Point } | Empty\nfn unwrap_or_zero(w: Wrapped) -> Int = match w { Wrap(payload) => payload.inner.x, Empty => 0 }\n", - "variant_payload_named_single.v3", - ) - .expect("compiles"); - let rendered = emit_module(&dag, EmitTarget::Go) - .expect("go emitter should render match") - .text; - assert!( - rendered.contains("case Wrap: return ((v).inner).x"), - "got: {rendered}" - ); - assert!(!rendered.contains("payload := v.inner;"), "got: {rendered}"); - } - - #[test] - fn go_sum_branch_fails_when_variant_parent_is_missing() { - let mut dag = compile_to_dag( - "type Choice = Left | Right\nfn pick(choice: Choice) -> Int = match choice { Left => 1, Right => 2 }\n", - "missing_variant_parent.v3", - ) - .expect("compiles"); - let choice_decl = dag.declaration_by_name("Choice").expect("Choice decl").id; - let right_variant = match &dag.declaration(choice_decl).connective { - TypeConnective::Disj { variants } => { - variants - .iter() - .find(|v| v.label == "Right") - .expect("Right variant in Choice") - .ty - } - _ => panic!("Choice should lower to a Disj"), - }; - let TypeConnective::Disj { variants } = &mut dag.declaration_mut(choice_decl).connective - else { - panic!("Choice should lower to a Disj"); - }; - variants.retain(|variant| variant.ty != right_variant); - - let err = emit_module(&dag, EmitTarget::Go).expect_err("missing parent must fail closed"); - assert!( - matches!( - err, - EmitDispatchError::Core(EmitError::VariantParentNotFound { variant_id }) - if variant_id == right_variant - ), - "expected VariantParentNotFound for Right, got {err:?}" - ); - } - - #[test] - fn behavior_result_port_returns_the_behavior_output_port() { - let mut dag = Dag::new(); - let file = "emit_port_liveness_test.v3"; - let left = dag.push_value(literal_bits_int(1), SourceSpan::new(file, 0, 1)); - let right = dag.push_value(literal_bits_int(2), SourceSpan::new(file, 0, 1)); - let sum = dag.push_transform( - TransformTarget::Operator(crate::dag::OperatorKind::Arithmetic( - crate::dag::ArithmeticOp::Add, - )), - vec![left, right], - SourceSpan::new(file, 0, 1), - ); - let producer = dag.port(sum).produced_by.expect("transform port"); - let behavior = dag.node(producer); - assert_eq!(super::behavior_result_port(behavior), sum); - } - - #[test] - fn result_and_diverror_emit_suppression_are_structural_not_path_keyed() { - let mut dag = Dag::new(); - let result = dag - .declaration_by_name("Result") - .expect("bootstrap Result") - .id; - let div_error = dag - .declaration_by_name("DivError") - .expect("bootstrap DivError") - .id; - - dag.declaration_mut(result).span.file = "renamed/std/errors.dag".to_string(); - dag.declaration_mut(div_error).span.file = "renamed/std/errors.dag".to_string(); - - assert!(super::substrate_result_type_decl_suppressed_for_emit( - &dag, - dag.declaration(result) - )); - assert!(super::substrate_div_error_type_decl_suppressed_for_emit( - &dag, - dag.declaration(div_error) - )); - } - - #[test] - fn payload_bearing_diverror_is_not_emit_suppressed() { - let mut dag = Dag::new(); - let int = dag.int_shape().expect("bootstrap Int").declaration; - let shadow_div_error = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: shadow_div_error, - name: Some("DivError".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "DivideByZero".to_string(), - ty: int, - }, - Field { - label: "Overflow".to_string(), - ty: int, - }, - ], - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("user/errors.dag", 0, 0), - }); - - assert!(!super::substrate_div_error_type_decl_suppressed_for_emit( - &dag, - dag.declaration(shadow_div_error) - )); - } - - #[test] - fn extra_variant_result_is_not_emit_suppressed() { - let mut dag = Dag::new(); - let int = dag.int_shape().expect("bootstrap Int").declaration; - let ok = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: ok, - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("ok".to_string())), - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("user/result_extra.dag", 0, 0), - }); - let err = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: err, - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("err".to_string())), - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("user/result_extra.dag", 0, 0), - }); - let ok_payload = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: ok_payload, - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "value".to_string(), - ty: ok, - }], - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("user/result_extra.dag", 0, 0), - }); - let err_payload = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: err_payload, - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "value".to_string(), - ty: err, - }], - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("user/result_extra.dag", 0, 0), - }); - let result = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: result, - name: Some("Result".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Ok".to_string(), - ty: ok_payload, - }, - Field { - label: "Err".to_string(), - ty: err_payload, - }, - Field { - label: "Other".to_string(), - ty: int, - }, - ], - }, - type_params: vec![ok, err], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("user/result_extra.dag", 0, 0), - }); - - assert!(!super::substrate_result_type_decl_suppressed_for_emit( - &dag, - dag.declaration(result) - )); - } - - #[test] - fn port_is_consumed_from_reaches_operand_ports_from_add_output() { - let mut dag = Dag::new(); - let file = "emit_port_liveness_test.v3"; - let left = dag.push_value(literal_bits_int(1), SourceSpan::new(file, 0, 1)); - let right = dag.push_value(literal_bits_int(2), SourceSpan::new(file, 0, 1)); - let sum = dag.push_transform( - TransformTarget::Operator(crate::dag::OperatorKind::Arithmetic( - crate::dag::ArithmeticOp::Add, - )), - vec![left, right], - SourceSpan::new(file, 0, 1), - ); - assert!(super::port_is_consumed_from(&dag, sum, left)); - assert!(super::port_is_consumed_from(&dag, sum, right)); - } - - #[test] - fn port_is_consumed_from_is_false_for_unrelated_leaf_port() { - let mut dag = Dag::new(); - let file = "emit_port_liveness_test.v3"; - let left = dag.push_value(literal_bits_int(1), SourceSpan::new(file, 0, 1)); - let right = dag.push_value(literal_bits_int(2), SourceSpan::new(file, 0, 1)); - let sum = dag.push_transform( - TransformTarget::Operator(crate::dag::OperatorKind::Arithmetic( - crate::dag::ArithmeticOp::Add, - )), - vec![left, right], - SourceSpan::new(file, 0, 1), - ); - let int_ty = dag.int_shape().expect("bootstrap Int"); - let stray = dag.alloc_port_with_shape(int_ty); - assert!(!super::port_is_consumed_from(&dag, sum, stray)); - } - - #[test] - fn port_is_consumed_from_reaches_loop_body_result_from_loop_output() { - let mut dag = Dag::new(); - let file = "emit_port_liveness_test.v3"; - let source = dag.push_value(literal_bits_int(0), SourceSpan::new(file, 0, 1)); - let init = dag.push_value(literal_bits_int(0), SourceSpan::new(file, 0, 1)); - let body_out = dag.push_value(literal_bits_int(99), SourceSpan::new(file, 0, 1)); - let body_node = dag - .port(body_out) - .produced_by - .expect("body value output must have a producer node"); - let count = dag.push_value(literal_bits_int(3), SourceSpan::new(file, 0, 1)); - let loop_out = dag.push_loop( - source, - init, - body_node, - crate::dag::LoopBound::Cardinality { count }, - SourceSpan::new(file, 0, 1), - ); - assert!(super::port_is_consumed_from(&dag, loop_out, body_out)); - } -} diff --git a/src/v3/compiler/src/emit/collection_ops_method_contract.rs b/src/v3/compiler/src/emit/collection_ops_method_contract.rs deleted file mode 100644 index 78cadcb422f..00000000000 --- a/src/v3/compiler/src/emit/collection_ops_method_contract.rs +++ /dev/null @@ -1,183 +0,0 @@ -//! `CollectionOps.*_contract` fields cross `DeclarationRef` boundaries. Emit -//! consumers must fail closed on the **algebra identity** (P1): each referenced -//! declaration must be a `MethodTemplateContract` data binding whose -//! `dag_method.decl` resolves to the expected registry `*_method` row. - -use super::method_emit_template_variant_label; -use crate::dag::{Dag, DeclarationId, FieldValue, LiteralBits, TypeConnective, ValueBody}; - -/// 🟢 TERMINAL at the CollectionOps contract-consumer projection boundary. -/// This mirrors the substrate `MethodEmitTemplate` coproduct exactly so Rust -/// CollectionOps can choose the HO inline rendering without flattening or -/// copying template text into a third authority. -#[derive(Debug, Clone, PartialEq, Eq)] -pub(crate) enum MethodTemplateContractEmitTemplate { - SingleTemplate(String), - HigherOrderTemplates { - inline_template: String, - fn_ref_template: String, - }, -} - -/// Fail closed unless `contract_decl` is a `MethodTemplateContract` instance -/// whose `dag_method.decl` resolves to `expected_method_decl`. -pub(crate) fn require_method_template_contract_dag_method( - dag: &Dag, - contract_decl: DeclarationId, - collection_ops_field: &'static str, - expected_method_decl: DeclarationId, -) -> Result<(), &'static str> { - let fields = method_template_contract_fields(dag, contract_decl)?; - require_method_template_contract_fields_dag_method( - fields, - collection_ops_field, - expected_method_decl, - ) -} - -pub(crate) fn method_template_contract_decl_emit_template( - dag: &Dag, - contract_decl: DeclarationId, - collection_ops_field: &'static str, - expected_method_decl: DeclarationId, -) -> Result { - let fields = method_template_contract_fields(dag, contract_decl)?; - require_method_template_contract_fields_dag_method( - fields, - collection_ops_field, - expected_method_decl, - )?; - method_template_contract_fields_emit_template(dag, fields) -} - -fn method_template_contract_fields( - dag: &Dag, - contract_decl: DeclarationId, -) -> Result<&[(String, FieldValue)], &'static str> { - let mtc_type_id = dag - .method_template_contract_decl() - .ok_or("internal: MethodTemplateContract type missing from dag")?; - - let decl = dag.declaration(contract_decl); - let template = match &decl.connective { - TypeConnective::Instantiation { template, .. } => *template, - _ => { - return Err( - "CollectionOps contract must reference a MethodTemplateContract data binding", - ); - } - }; - if template != mtc_type_id { - return Err("CollectionOps contract must instantiate MethodTemplateContract"); - } - - let Some(body) = decl.value_body.as_ref() else { - return Err( - "CollectionOps contract referenced declaration must carry a structural value body", - ); - }; - let fields = match body { - ValueBody::Structural { fields } => fields, - _ => { - return Err( - "CollectionOps contract referenced declaration must be structural MethodTemplateContract data", - ); - } - }; - Ok(fields) -} - -fn require_method_template_contract_fields_dag_method( - fields: &[(String, FieldValue)], - collection_ops_field: &'static str, - expected_method_decl: DeclarationId, -) -> Result<(), &'static str> { - let method_id = method_template_contract_fields_dag_method(fields)?; - if method_id != expected_method_decl { - return Err(match collection_ops_field { - "fold_contract" => "CollectionOps.fold_contract must target fold_method", - "concat_contract" => "CollectionOps.concat_contract must target concat_method", - "length_contract" => "CollectionOps.length_contract must target length_method", - "filter_contract" => "CollectionOps.filter_contract must target filter_method", - "flat_map_contract" => "CollectionOps.flat_map_contract must target flat_map_method", - "any_contract" => "CollectionOps.any_contract must target any_method", - "all_contract" => "CollectionOps.all_contract must target all_method", - "map_contract" => "CollectionOps.map_contract must target map_method", - "is_empty_contract" => { - "CollectionOps.is_empty_contract must target is_empty_method (FreeMonoid.is_empty -> Bool)" - } - _ => "CollectionOps contract dag_method does not match expected registry method", - }); - } - - Ok(()) -} - -fn method_template_contract_fields_dag_method( - fields: &[(String, FieldValue)], -) -> Result { - let dag_method = fields - .iter() - .find(|(l, _)| l == "dag_method") - .map(|(_, v)| v) - .ok_or("MethodTemplateContract missing dag_method field")?; - - let FieldValue::Record(method_ref_fields) = dag_method else { - return Err("MethodTemplateContract.dag_method must be a MethodRef record"); - }; - - let method_id = match method_ref_fields.as_slice() { - [(label, FieldValue::Reference(id))] if label == "decl" => *id, - _ => { - return Err( - "MethodTemplateContract.dag_method must be exactly `{ decl: DeclarationRef }` (MethodRef)", - ); - } - }; - Ok(method_id) -} - -fn method_template_contract_fields_emit_template( - dag: &Dag, - fields: &[(String, FieldValue)], -) -> Result { - let emit_value = fields - .iter() - .find(|(label, _)| label == "emit_template") - .map(|(_, v)| v) - .ok_or("MethodTemplateContract missing emit_template field")?; - let FieldValue::Variant { - constructor, - payload, - } = emit_value - else { - return Err("MethodTemplateContract.emit_template must be a sum variant"); - }; - let ctor_name = method_emit_template_variant_label(dag, *constructor).ok_or( - "MethodTemplateContract.emit_template variant not found under MethodEmitTemplate disj", - )?; - match ctor_name { - "SingleTemplate" => { - let [FieldValue::Literal(LiteralBits::String(template))] = payload.as_slice() else { - return Err("SingleTemplate must carry exactly one string template payload"); - }; - Ok(MethodTemplateContractEmitTemplate::SingleTemplate( - template.replace("%Q", "\""), - )) - } - "HigherOrderTemplates" => { - let [FieldValue::Literal(LiteralBits::String(inline_template)), FieldValue::Literal(LiteralBits::String(fn_ref_template))] = - payload.as_slice() - else { - return Err( - "HigherOrderTemplates must carry inline_template and fn_ref_template strings", - ); - }; - Ok(MethodTemplateContractEmitTemplate::HigherOrderTemplates { - inline_template: inline_template.replace("%Q", "\""), - fn_ref_template: fn_ref_template.replace("%Q", "\""), - }) - } - _ => Err("MethodTemplateContract.emit_template uses an unknown MethodEmitTemplate variant"), - } -} diff --git a/src/v3/compiler/src/emit/python_target.rs b/src/v3/compiler/src/emit/python_target.rs deleted file mode 100644 index c1c3d297242..00000000000 --- a/src/v3/compiler/src/emit/python_target.rs +++ /dev/null @@ -1,2232 +0,0 @@ -use std::collections::HashMap; - -use super::{ - algebra_field_for_operator_shared, - collection_ops_method_contract::require_method_template_contract_dag_method, - dag_needs_div_error_prelude, div_prelude_reserved_name_collision, - method_emit_template_variant_label, optional_match_variant_roles, parse_pattern_strategy, - primitive_type_id_for_port_shared, walk_to_disj, EmitMode, PatternStrategyBinding, - SharedEmitLookupError, SourceFilteringBinding, VariantPayloadBinding, - VariantPayloadFieldAccessRuleBinding, -}; -use crate::dag::{ - ArrowBody, AtomPayload, Behavior, BindNode, BranchNode, BranchPattern, DeclarationId, Field, - FieldValue, LiteralBits, Path, PortId, TemplateArgument, TransformNode, TransformTarget, - TypeConnective, -}; -use crate::operators::OperatorKind; -use crate::variant_payload::{ - variant_payload_shape, VariantPayloadShape, VariantPayloadShapeLookup, -}; -use crate::Dag; - -#[derive(Debug, Clone)] -pub enum EmitPythonError { - MissingMeta(&'static str), - MissingSpec(&'static str), - MissingTypeRealization { - target: DeclarationId, - }, - MissingOperatorRealization { - target: DeclarationId, - op: DeclarationId, - }, - MalformedSpec { - declaration: DeclarationId, - detail: &'static str, - }, - UntypedPort(PortId), - Unsupported(String), - UnresolvedBranchPattern { - variant_name: String, - }, - /// Two realization data items in the loaded spec set targeted the - /// same key (type, (operand_type, op), or callable). The Python - /// loader used to silently overwrite the first entry when this - /// happened. Now fail-closed so spec collisions surface. - DuplicateRealization { - declaration: DeclarationId, - detail: &'static str, - }, -} - -pub(crate) type EmitPythonMode = EmitMode; - -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -enum CallableStrategyBinding { - Empty, - Singleton, - Cons, - Concat, - Length, - IsEmpty, - Fold, - Map, - Filter, - Contains, -} - -#[derive(Debug, Clone)] -struct PythonSyntax { - field_access: String, - function_call: String, - closure: String, - empty_list: String, - list_literal: String, - cons: String, - concat: String, - length: String, - is_empty: String, - fold: String, - map: String, - filter: String, - contains: String, - optional: String, -} - -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -enum MemoryModelBinding { - ValueOnly, - GarbageCollected, - RefCounted, - OwnershipBased, -} - -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -enum ScopeModelBinding { - LexicalScoping, - DynamicScoping, -} - -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -struct PythonTarget { - memory: MemoryModelBinding, - scope: ScopeModelBinding, -} - -/// Typed read of `data python_clean_emission: CleanEmissionContract` -/// from `src/v3/spec/python.dag` — the portion this pilot consumes -/// (E-5 / Lane 1 Stage 1c PR 3). Other contract rules land here as -/// their consumers wire in. -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -struct CleanEmissionContractBinding { - pattern_bindings: PatternBindingRuleBinding, - variant_payload_field_access: VariantPayloadFieldAccessRuleBinding, -} - -/// Python-valid slice of `std.clean_emission.PatternBindingRule`. -/// Parsed in `CleanEmissionContractBinding::build`, which rejects -/// target-invalid constructors instead of letting the renderer -/// normalize them later. emit_python does not emit Python's native -/// `match` statement — it substitutes an extraction expression -/// (`__match._0` / `__match`) at every payload-binding port -/// reference inside the rendered arm body, so no binding identifier -/// is ever written at a pattern site. `NotApplicablePatternBinding` -/// is the only valid rule. -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -enum PatternBindingRuleBinding { - NotApplicable, -} - -#[derive(Debug, Clone)] -struct PatternRealizationBinding { - empty_variant: DeclarationId, - cons_variant: DeclarationId, - scrutinee: String, - empty_pattern: String, - cons_pattern: String, - head_expr: String, - tail_expr: String, -} - -#[derive(Debug, Clone)] -struct PythonIndexes { - types: HashMap, - type_instantiations: HashMap, - operators: HashMap<(DeclarationId, DeclarationId), String>, - callables: HashMap, - patterns: HashMap, - syntax: PythonSyntax, - target: PythonTarget, - /// Source exclusion policy loaded from - /// `data python_source_filtering: ShapeATargetSourceFiltering`. - source_filtering: SourceFilteringBinding, - /// The Python clean-emission contract loaded from `data - /// python_clean_emission: CleanEmissionContract` (E-5 / Lane 1 - /// Stage 1c PR 3). Rule variants dispatch inside the emitter so - /// emitted Python passes `python3 -m py_compile` by - /// construction. For the current pilot only `pattern_bindings` - /// is dispatched on; other fields are authored-but-unread until - /// Lane 1d/1e consolidation. - clean_emission: CleanEmissionContractBinding, -} - -#[derive(Debug, Clone, Default)] -struct RenderLocals { - names: HashMap, - payload_bindings: HashMap>, -} - -struct Ctx<'a> { - dag: &'a Dag, - indexes: &'a PythonIndexes, - bound_names: &'a HashMap, -} - -impl PythonIndexes { - fn build(dag: &Dag) -> Result { - let type_meta = dag - .type_realization_meta() - .ok_or(EmitPythonError::MissingMeta("TypeRealization"))?; - let type_instantiation_meta = dag - .type_instantiation_realization_meta() - .ok_or(EmitPythonError::MissingMeta("TypeInstantiationRealization"))?; - let operator_meta = dag - .operator_realization_meta() - .ok_or(EmitPythonError::MissingMeta("OperatorRealization"))?; - let callable_meta = dag - .callable_realization_meta() - .ok_or(EmitPythonError::MissingMeta("CallableRealization"))?; - let pattern_meta = dag - .pattern_realization_meta() - .ok_or(EmitPythonError::MissingMeta("PatternRealization"))?; - let python_language = dag - .python_language_spec() - .ok_or(EmitPythonError::MissingSpec("python_language"))?; - let mut types = HashMap::new(); - let mut type_instantiations = HashMap::new(); - let mut operators = HashMap::new(); - let mut callables = HashMap::new(); - let mut patterns = HashMap::new(); - - for decl in dag.declarations() { - let Some(meta_tag) = decl.meta_tag else { - continue; - }; - // Only act on declarations tagged with one of the four - // realization meta types. Skip silently when the meta-tag - // is for a different category — that's structural, not a - // spec inconsistency. - let is_realization_meta = meta_tag == type_meta - || meta_tag == type_instantiation_meta - || meta_tag == operator_meta - || meta_tag == callable_meta - || meta_tag == pattern_meta; - if !is_realization_meta { - continue; - } - // A data item tagged with a realization meta-type MUST - // have a Structural value_body. If it's Unparsed, the - // inhabitance check let a malformed spec entry through — - // fail-closed so the spec inconsistency surfaces loudly - // (matches emit_rust + emit_go behavior). - let Some(fields) = structural_fields(decl) else { - return Err(EmitPythonError::MalformedSpec { - declaration: decl.id, - detail: - "realization data item has no Structural value_body — bootstrap inhabitance check missed a malformed spec entry", - }); - }; - let language = require_field_decl_ref(fields, "language", decl.id)?; - if language != python_language { - continue; - } - if meta_tag == type_meta { - let target = require_field_decl_ref(fields, "target", decl.id)?; - let carrier = require_field_string(fields, "carrier", decl.id)?; - if types.insert(target, carrier).is_some() { - return Err(EmitPythonError::DuplicateRealization { - declaration: decl.id, - detail: "two TypeRealization data items target the same declaration", - }); - } - } else if meta_tag == type_instantiation_meta { - let target = require_field_decl_ref(fields, "target", decl.id)?; - let carrier = require_field_string(fields, "carrier", decl.id)?; - if type_instantiations.insert(target, carrier).is_some() { - return Err(EmitPythonError::DuplicateRealization { - declaration: decl.id, - detail: "two TypeInstantiationRealization data items target the same declaration", - }); - } - } else if meta_tag == operator_meta { - let target = require_field_decl_ref(fields, "target", decl.id)?; - let op = require_field_decl_ref(fields, "op", decl.id)?; - let carrier = require_field_string(fields, "carrier", decl.id)?; - if !carrier.contains("{lhs}") || !carrier.contains("{rhs}") { - return Err(EmitPythonError::MalformedSpec { - declaration: decl.id, - detail: "OperatorRealization carrier must be a full-expression template containing {lhs} and {rhs}", - }); - } - if operators.insert((target, op), carrier).is_some() { - return Err(EmitPythonError::DuplicateRealization { - declaration: decl.id, - detail: - "two OperatorRealization data items share the same (target, op) pair", - }); - } - } else if meta_tag == callable_meta { - let target = require_field_decl_ref(fields, "target", decl.id)?; - let strategy = parse_callable_strategy(dag, fields, decl.id)?; - if callables.insert(target, strategy).is_some() { - return Err(EmitPythonError::DuplicateRealization { - declaration: decl.id, - detail: - "two CallableRealization data items target the same callable declaration", - }); - } - } else { - let target = require_field_decl_ref(fields, "target", decl.id)?; - let binding = parse_pattern_realization(dag, fields, decl.id)?; - validate_pattern_roles(dag, target, &binding, decl.id)?; - if patterns.insert(target, binding).is_some() { - return Err(EmitPythonError::DuplicateRealization { - declaration: decl.id, - detail: - "two PatternRealization data items target the same structural sum declaration", - }); - } - } - } - - let language_fields = structural_fields_for_decl(dag, python_language)?; - let expressions = require_field_decl_ref(language_fields, "expressions", python_language)?; - let collections = - require_field_decl_ref(language_fields, "collection_ops", python_language)?; - let type_apps = - require_field_decl_ref(language_fields, "type_applications", python_language)?; - let target_decl = dag - .python_target_spec() - .ok_or(EmitPythonError::MissingSpec("python_target"))?; - let target_fields = structural_fields_for_decl(dag, target_decl)?; - let source_filtering = SourceFilteringBinding::build( - dag, - dag.python_source_filtering_spec() - .ok_or(EmitPythonError::MissingSpec("python_source_filtering"))?, - ) - .map_err(|err| match err { - super::rust_target::EmitError::MalformedTargetSyntax { - declaration, - detail, - } => EmitPythonError::MalformedSpec { - declaration, - detail, - }, - other => EmitPythonError::Unsupported(format!("{other:?}")), - })?; - - let syntax = PythonSyntax { - field_access: require_field_string( - structural_fields_for_decl(dag, expressions)?, - "field_access", - expressions, - )?, - function_call: require_field_string( - structural_fields_for_decl(dag, expressions)?, - "function_call", - expressions, - )?, - closure: require_field_string( - structural_fields_for_decl(dag, expressions)?, - "closure", - expressions, - )?, - empty_list: require_field_string( - structural_fields_for_decl(dag, collections)?, - "empty_list", - collections, - )?, - list_literal: require_field_string( - structural_fields_for_decl(dag, collections)?, - "list_literal", - collections, - )?, - cons: require_field_string( - structural_fields_for_decl(dag, collections)?, - "cons", - collections, - )?, - concat: { - let cfields = structural_fields_for_decl(dag, collections)?; - let concat_method_decl = - dag.concat_method_decl() - .ok_or(EmitPythonError::MalformedSpec { - declaration: collections, - detail: "internal: concat_method missing from std.methods registry", - })?; - let id = require_field_decl_ref(cfields, "concat_contract", collections)?; - require_method_template_contract_dag_method( - dag, - id, - "concat_contract", - concat_method_decl, - ) - .map_err(|detail| EmitPythonError::MalformedSpec { - declaration: id, - detail, - })?; - method_contract_single_emit_template_string(dag, id)? - }, - length: { - let cfields = structural_fields_for_decl(dag, collections)?; - let length_method_decl = - dag.length_method_decl() - .ok_or(EmitPythonError::MalformedSpec { - declaration: collections, - detail: "internal: length_method missing from std.methods registry", - })?; - let id = require_field_decl_ref(cfields, "length_contract", collections)?; - require_method_template_contract_dag_method( - dag, - id, - "length_contract", - length_method_decl, - ) - .map_err(|detail| EmitPythonError::MalformedSpec { - declaration: id, - detail, - })?; - method_contract_single_emit_template_string(dag, id)? - }, - is_empty: { - let cfields = structural_fields_for_decl(dag, collections)?; - let is_empty_method_decl = - dag.is_empty_method_decl() - .ok_or(EmitPythonError::MalformedSpec { - declaration: collections, - detail: "internal: is_empty_method missing from std.methods registry", - })?; - let id = require_field_decl_ref(cfields, "is_empty_contract", collections)?; - require_method_template_contract_dag_method( - dag, - id, - "is_empty_contract", - is_empty_method_decl, - ) - .map_err(|detail| EmitPythonError::MalformedSpec { - declaration: id, - detail, - })?; - method_contract_single_emit_template_string(dag, id)? - }, - fold: { - let cfields = structural_fields_for_decl(dag, collections)?; - let fold_method_decl = - dag.fold_method_decl() - .ok_or(EmitPythonError::MalformedSpec { - declaration: collections, - detail: "internal: fold_method missing from std.methods registry", - })?; - let fold_contract = require_field_decl_ref(cfields, "fold_contract", collections)?; - require_method_template_contract_dag_method( - dag, - fold_contract, - "fold_contract", - fold_method_decl, - ) - .map_err(|detail| EmitPythonError::MalformedSpec { - declaration: fold_contract, - detail, - })?; - method_contract_single_emit_template_string(dag, fold_contract)? - }, - map: { - let cfields = structural_fields_for_decl(dag, collections)?; - let map_method_decl = - dag.map_method_decl() - .ok_or(EmitPythonError::MalformedSpec { - declaration: collections, - detail: "internal: map_method missing from std.methods registry", - })?; - let map_contract = require_field_decl_ref(cfields, "map_contract", collections)?; - require_method_template_contract_dag_method( - dag, - map_contract, - "map_contract", - map_method_decl, - ) - .map_err(|detail| EmitPythonError::MalformedSpec { - declaration: map_contract, - detail, - })?; - method_contract_single_emit_template_string(dag, map_contract)? - }, - filter: require_field_string( - structural_fields_for_decl(dag, collections)?, - "filter", - collections, - )?, - contains: require_field_string( - structural_fields_for_decl(dag, collections)?, - "contains", - collections, - )?, - optional: require_field_string( - structural_fields_for_decl(dag, type_apps)?, - "optional", - type_apps, - )?, - }; - - let target = PythonTarget { - memory: require_memory_model(dag, target_fields, target_decl)?, - scope: require_scope_model(dag, target_fields, target_decl)?, - }; - - let clean_emission = CleanEmissionContractBinding::build(dag)?; - - Ok(Self { - types, - type_instantiations, - operators, - callables, - patterns, - syntax, - target, - source_filtering, - clean_emission, - }) - } -} - -impl CleanEmissionContractBinding { - /// Parse the portion of `data python_clean_emission: - /// CleanEmissionContract` this pilot consumes. Mirrors - /// emit_rust / emit_go's `CleanEmissionContractBinding::build`. - fn build(dag: &Dag) -> Result { - let declaration = dag - .python_clean_emission_spec() - .ok_or(EmitPythonError::MissingSpec("python_clean_emission"))?; - let decl = dag.declaration(declaration); - let fields = structural_fields(decl).ok_or(EmitPythonError::MalformedSpec { - declaration, - detail: "python_clean_emission must be a structural data item", - })?; - let pattern_bindings_value = fields - .iter() - .find(|(label, _)| label == "pattern_bindings") - .map(|(_, value)| value) - .ok_or(EmitPythonError::MalformedSpec { - declaration, - detail: "python_clean_emission is missing required `pattern_bindings` field", - })?; - let pattern_bindings = - parse_pattern_binding_rule(dag, pattern_bindings_value, declaration)?; - let variant_payload_field_access_value = fields - .iter() - .find(|(label, _)| label == "variant_payload_field_access") - .map(|(_, value)| value) - .ok_or(EmitPythonError::MalformedSpec { - declaration, - detail: - "python_clean_emission is missing required `variant_payload_field_access` field", - })?; - let variant_payload_field_access = parse_variant_payload_field_access_rule( - dag, - variant_payload_field_access_value, - declaration, - )?; - Ok(Self { - pattern_bindings, - variant_payload_field_access, - }) - } -} - -/// Parse `python_clean_emission.pattern_bindings` via the typed -/// `PatternBindingRuleVariants` cache on `Dag` (Lane 1 Stage 1c -/// PR 2.5). NOT `named_variant_id` — the typed cache is the single -/// authority that lets emit_rust / emit_go / emit_python share the -/// same resolution path without each reconstructing the same fact. -/// -/// Rejects every variant except `NotApplicablePatternBinding`: the -/// other rules (`EmitBindingAlways` / `EmitUnderscoreWhenUnused` / -/// `EmitPrefixedUnderscoreWhenUnused`) describe pattern-site -/// binding elisions that emit_python has no pattern site to apply -/// them to — the emitter substitutes an extraction expression at -/// every port reference in the rendered arm body, so the binding -/// identifier never appears in source by construction. -fn parse_pattern_binding_rule( - dag: &Dag, - value: &FieldValue, - declaration: DeclarationId, -) -> Result { - let FieldValue::Variant { - constructor, - payload, - } = value - else { - return Err(EmitPythonError::MalformedSpec { - declaration, - detail: "python_clean_emission.pattern_bindings must be a PatternBindingRule variant", - }); - }; - if !payload.is_empty() { - return Err(EmitPythonError::MalformedSpec { - declaration, - detail: "PatternBindingRule variants must not carry payload fields", - }); - } - let variants = dag.pattern_binding_rule_variants(); - let emit_always = variants.emit_always.ok_or(EmitPythonError::MalformedSpec { - declaration, - detail: "PatternBindingRule.EmitBindingAlways declaration was not found", - })?; - let emit_underscore = variants - .emit_underscore - .ok_or(EmitPythonError::MalformedSpec { - declaration, - detail: "PatternBindingRule.EmitUnderscoreWhenUnused declaration was not found", - })?; - let emit_prefixed = variants - .emit_prefixed - .ok_or(EmitPythonError::MalformedSpec { - declaration, - detail: "PatternBindingRule.EmitPrefixedUnderscoreWhenUnused declaration was not found", - })?; - let not_applicable = variants - .not_applicable - .ok_or(EmitPythonError::MalformedSpec { - declaration, - detail: "PatternBindingRule.NotApplicablePatternBinding declaration was not found", - })?; - if *constructor == not_applicable { - Ok(PatternBindingRuleBinding::NotApplicable) - } else if *constructor == emit_always { - Err(EmitPythonError::MalformedSpec { - declaration, - detail: "python_clean_emission.pattern_bindings cannot use PatternBindingRule.EmitBindingAlways; Python only supports NotApplicablePatternBinding", - }) - } else if *constructor == emit_underscore { - Err(EmitPythonError::MalformedSpec { - declaration, - detail: "python_clean_emission.pattern_bindings cannot use PatternBindingRule.EmitUnderscoreWhenUnused; Python only supports NotApplicablePatternBinding", - }) - } else if *constructor == emit_prefixed { - Err(EmitPythonError::MalformedSpec { - declaration, - detail: "python_clean_emission.pattern_bindings cannot use PatternBindingRule.EmitPrefixedUnderscoreWhenUnused; Python only supports NotApplicablePatternBinding", - }) - } else { - Err(EmitPythonError::MalformedSpec { - declaration, - detail: - "python_clean_emission.pattern_bindings constructor is not a known PatternBindingRule variant", - }) - } -} - -fn parse_variant_payload_field_access_rule( - dag: &Dag, - value: &FieldValue, - declaration: DeclarationId, -) -> Result { - let FieldValue::Variant { - constructor, - payload, - } = value - else { - return Err(EmitPythonError::MalformedSpec { - declaration, - detail: - "python_clean_emission.variant_payload_field_access must be a VariantPayloadFieldAccessRule variant", - }); - }; - if !payload.is_empty() { - return Err(EmitPythonError::MalformedSpec { - declaration, - detail: "VariantPayloadFieldAccessRule variants must not carry payload fields", - }); - } - let variants = dag.variant_payload_field_access_rule_variants(); - let access_from_payload_binding = - variants - .access_from_payload_binding - .ok_or(EmitPythonError::MalformedSpec { - declaration, - detail: - "VariantPayloadFieldAccessRule.AccessFromPayloadBinding declaration was not found", - })?; - let override_named_fields_at_binding_site = variants - .override_named_fields_at_binding_site - .ok_or(EmitPythonError::MalformedSpec { - declaration, - detail: "VariantPayloadFieldAccessRule.OverrideNamedFieldsAtBindingSite declaration was not found", - })?; - if *constructor == access_from_payload_binding { - Ok(VariantPayloadFieldAccessRuleBinding::AccessFromPayloadBinding) - } else if *constructor == override_named_fields_at_binding_site { - Err(EmitPythonError::MalformedSpec { - declaration, - detail: "python_clean_emission.variant_payload_field_access cannot use VariantPayloadFieldAccessRule.OverrideNamedFieldsAtBindingSite; Python requires AccessFromPayloadBinding for native match carriers", - }) - } else { - Err(EmitPythonError::MalformedSpec { - declaration, - detail: "python_clean_emission.variant_payload_field_access constructor is not a known VariantPayloadFieldAccessRule variant", - }) - } -} - -pub(crate) fn emit_python_with_mode( - dag: &Dag, - mode: EmitPythonMode, -) -> Result { - let indexes = PythonIndexes::build(dag)?; - if indexes.target.memory != MemoryModelBinding::GarbageCollected { - return Err(EmitPythonError::Unsupported(format!( - "emit_python requires python_target.memory = GarbageCollected, found {:?}", - indexes.target.memory - ))); - } - if indexes.target.scope != ScopeModelBinding::LexicalScoping { - return Err(EmitPythonError::Unsupported(format!( - "emit_python requires python_target.scope = LexicalScoping, found {:?}", - indexes.target.scope - ))); - } - let type_decls: Vec<_> = dag - .declarations() - .iter() - .filter(|decl| !indexes.source_filtering.excludes(&decl.span.file)) - .filter(|decl| decl.name.is_some()) - .filter(|decl| !super::substrate_result_type_decl_suppressed_for_emit(dag, decl)) - .filter(|decl| !super::substrate_div_error_type_decl_suppressed_for_emit(dag, decl)) - .filter(|decl| { - matches!( - decl.connective, - TypeConnective::Conj { .. } | TypeConnective::Disj { .. } - ) - }) - .collect(); - let function_decls: Vec<_> = dag - .declarations() - .iter() - .filter(|decl| !indexes.source_filtering.excludes(&decl.span.file)) - .filter(|decl| decl.name.is_some()) - .filter(|decl| { - !decl - .name - .as_deref() - .is_some_and(|name| name.starts_with("__anon_lambda_")) - }) - .filter(|decl| { - matches!( - decl.connective, - TypeConnective::Arrow { - body: ArrowBody::UserDefined(_), - .. - } - ) - }) - .collect(); - let top_level_binds = python_program_mode_top_level_value_binds(dag, &indexes); - - if mode == EmitPythonMode::Program && top_level_binds.is_empty() { - return Err(EmitPythonError::Unsupported( - "emit_python requires at least one top-level value Bind".to_string(), - )); - } - if mode == EmitPythonMode::Module && !top_level_binds.is_empty() { - return Err(EmitPythonError::Unsupported( - "emit_python module mode does not support top-level value Binds".to_string(), - )); - } - - let mut bound_names = HashMap::new(); - for bind in &top_level_binds { - bound_names.insert(bind.value, bind.name.clone()); - } - let ctx = Ctx { - dag, - indexes: &indexes, - bound_names: &bound_names, - }; - - let mut sections = vec![ - "from __future__ import annotations".to_string(), - "from dataclasses import dataclass".to_string(), - "import enum".to_string(), - "import types".to_string(), - "import typing".to_string(), - format!( - "# ownership skipped: {:?} / {:?}", - indexes.target.memory, indexes.target.scope - ), - "__T = typing.TypeVar(\"__T\")".to_string(), - "__U = typing.TypeVar(\"__U\")".to_string(), - "def __v3_fold(items: list[typing.Any], init: typing.Any, fn: typing.Callable[[typing.Any, typing.Any], typing.Any]) -> typing.Any:\n acc = init\n for item in items:\n acc = fn(acc, item)\n return acc".to_string(), - "def __v3_unreachable(label: str) -> typing.NoReturn:\n raise ValueError(label)".to_string(), - ]; - - let needs_int_div_prelude = - dag_needs_div_error_prelude(dag, &type_decls, &top_level_binds, &function_decls); - if let (true, Some(name)) = ( - needs_int_div_prelude, - div_prelude_reserved_name_collision( - dag, - type_decls.iter(), - function_decls.iter(), - top_level_binds.iter(), - "__v3_idiv", - ), - ) { - return Err(EmitPythonError::Unsupported(format!( - "Python checked-division prelude would collide with user-defined `{name}`" - ))); - } - for decl in type_decls { - sections.push(ctx.render_type_declaration(decl)?); - } - if needs_int_div_prelude { - // `std.error_primitives` is filtered out of `type_decls`; v3 `DivError` + checked `/` are - // prelude-only (names align with `python.dag` / `python_int_div` carrier for `__v3_idiv`). - // - // Dissolution trigger (M1 scaffold): delete when `dsl/std/error_primitives` emits through - // the normal type-decl path (no separate prelude strings). - // - // M2: gate on emitted `__v3_idiv(...)` (or equivalent) so division-free programs skip - // this block. - sections.push( - "class DivError(enum.IntEnum):\n DivideByZero = 0\n Overflow = 1".to_string(), - ); - sections.push( - "def __v3_idiv(a: int, b: int) -> typing.Union[typing.Tuple[typing.Literal['Ok'], int], typing.Tuple[typing.Literal['Err'], DivError]]:\n if b == 0:\n return ('Err', DivError.DivideByZero)\n if a == -2 ** 63 and b == -1:\n return ('Err', DivError.Overflow)\n q, r = divmod(a, b)\n w = q + (1 if r != 0 and (a < 0) != (b < 0) else 0)\n return ('Ok', w)".to_string(), - ); - } - for decl in function_decls { - sections.push(ctx.render_function_declaration(decl)?); - } - if mode == EmitPythonMode::Program { - let mut assignments = Vec::new(); - for bind in &top_level_binds { - assignments.push(format!( - "{} = {}", - bind.name, - ctx.render_top_level_value(bind.value)? - )); - } - let final_name = &top_level_binds.last().expect("guarded above").name; - let mut body = assignments.join("\n"); - body.push_str(&format!("\nprint({final_name})")); - sections.push(format!( - "if __name__ == \"__main__\":\n{}", - indent(&body, 1) - )); - } - - Ok(sections.join("\n\n")) -} - -/// Top-level value `Bind` nodes that participate in Python program-mode emission, in `Dag::nodes` -/// order. L5 uses this selector so `ForAllTargets` validates the declared observation against the -/// same bind that emitted Python `__main__` prints. -fn python_program_mode_top_level_value_binds<'a>( - dag: &'a Dag, - indexes: &PythonIndexes, -) -> Vec<&'a BindNode> { - dag.nodes() - .iter() - .filter_map(Behavior::as_bind) - .filter(|bind| !indexes.source_filtering.excludes(&bind.span.file)) - .filter(|bind| bind.params.is_empty()) - .collect() -} - -pub(crate) fn last_emit_python_program_top_level_value_bind_name( - dag: &Dag, -) -> Result, EmitPythonError> { - let indexes = PythonIndexes::build(dag)?; - Ok(python_program_mode_top_level_value_binds(dag, &indexes) - .last() - .map(|b| b.name.clone())) -} - -impl<'a> Ctx<'a> { - fn render_top_level_value(&self, port: PortId) -> Result { - self.dispatch_producer(port, &RenderLocals::default()) - } - - fn render_port(&self, port: PortId, locals: &RenderLocals) -> Result { - if let Some(name) = locals.names.get(&port) { - return Ok(name.clone()); - } - if let Some(name) = locals - .payload_bindings - .get(&port) - .and_then(VariantPayloadBinding::direct) - { - return Ok(name.clone()); - } - if let Some(name) = self.bound_names.get(&port) { - return Ok(name.clone()); - } - self.dispatch_producer(port, locals) - } - - fn dispatch_producer( - &self, - port: PortId, - locals: &RenderLocals, - ) -> Result { - let Some(node_id) = self.dag.port(port).produced_by else { - return Err(EmitPythonError::Unsupported( - "render reached a port with no producer".to_string(), - )); - }; - match self.dag.node(node_id) { - Behavior::Value(v) => Ok(render_value(v)), - Behavior::Transform(t) => self.render_transform(t, locals), - Behavior::Branch(b) => self.render_branch(b, locals), - Behavior::Loop(l) => self.render_loop(l, locals), - Behavior::Bind(b) => Ok(b.name.clone()), - } - } - - fn render_transform( - &self, - t: &TransformNode, - locals: &RenderLocals, - ) -> Result { - match &t.target { - TransformTarget::Operator(op) => self.render_operator(t, *op, locals), - TransformTarget::UnresolvedFieldProject { field_label } => { - Err(EmitPythonError::Unsupported(format!( - "field projection .{field_label} is unresolved; emit_python expects post-infer FieldProject targets" - ))) - } - TransformTarget::ResolvedFieldProject { field_label } => { - if let Some(binding) = locals - .payload_bindings - .get(&t.inputs[0]) - .and_then(|binding| binding.field(field_label)) - { - return Ok(binding.clone()); - } - let object = self.render_port(t.inputs[0], locals)?; - Ok(render_named_template( - &self.indexes.syntax.field_access, - &[("object", &object), ("field", field_label)], - )) - } - TransformTarget::Callable(target) => self.render_callable_transform(t, *target, locals), - } - } - - fn render_operator( - &self, - t: &TransformNode, - op: OperatorKind, - locals: &RenderLocals, - ) -> Result { - if t.inputs.len() != 2 { - return Err(EmitPythonError::Unsupported(format!( - "python emitter supports only binary operators, got arity {}", - t.inputs.len() - ))); - } - let operand_type = primitive_type_id_for_port(self.dag, t.inputs[0])?; - let op_decl = algebra_field_for_operator(self.dag, operand_type, op)?; - let carrier = super::operator_carrier_realization( - &self.indexes.operators, - self.dag, - operand_type, - op_decl, - ) - .ok_or(EmitPythonError::MissingOperatorRealization { - target: operand_type, - op: op_decl, - })?; - let lhs = self.render_port(t.inputs[0], locals)?; - let rhs = self.render_port(t.inputs[1], locals)?; - Ok(render_named_template( - carrier, - &[("lhs", &lhs), ("rhs", &rhs)], - )) - } - - fn render_branch( - &self, - branch: &BranchNode, - locals: &RenderLocals, - ) -> Result { - if self.branch_scrutinee_is_bool(branch)? { - let (then_path, else_path) = self.split_bool_paths(branch)?; - let cond = self.render_port(branch.input, locals)?; - let then_expr = self.render_path_body(then_path, locals)?; - let else_expr = self.render_path_body(else_path, locals)?; - return Ok(format!("({then_expr} if {cond} else {else_expr})")); - } - if let Some(rendered) = self.render_realized_pattern_branch(branch, locals)? { - return Ok(rendered); - } - self.render_general_match(branch, locals) - } - - fn render_realized_pattern_branch( - &self, - branch: &BranchNode, - locals: &RenderLocals, - ) -> Result, EmitPythonError> { - let scrutinee_type_id = primitive_type_id_for_port(self.dag, branch.input)?; - let Some(disj_id) = walk_to_disj(self.dag, scrutinee_type_id) else { - return Ok(None); - }; - let Some(binding) = self.indexes.patterns.get(&disj_id) else { - return Ok(None); - }; - self.render_vector_list_pattern_branch(branch, disj_id, binding, locals) - .map(Some) - } - - fn render_vector_list_pattern_branch( - &self, - branch: &BranchNode, - _disj_id: DeclarationId, - binding: &PatternRealizationBinding, - locals: &RenderLocals, - ) -> Result { - let empty_path = find_resolved_branch_path(branch, binding.empty_variant).ok_or_else( - || { - EmitPythonError::Unsupported( - "vector-list pattern realization requires a branch arm for the declared empty_variant" - .to_string(), - ) - }, - )?; - let cons_path = find_resolved_branch_path(branch, binding.cons_variant).ok_or_else( - || { - EmitPythonError::Unsupported( - "vector-list pattern realization requires a branch arm for the declared cons_variant" - .to_string(), - ) - }, - )?; - let scrutinee = self.render_port(branch.input, locals)?; - let empty_body = self.render_path_body(empty_path, locals)?; - let realized_scrutinee = render_named_template(&binding.scrutinee, &[("expr", &scrutinee)]); - let empty_predicate = render_named_template(&binding.empty_pattern, &[("expr", "__match")]); - let mut cons_locals = locals.clone(); - if let Some(payload_binding) = &cons_path.binding { - let cons_expr = render_named_template(&binding.cons_pattern, &[("expr", "__match")]); - let head_expr = render_named_template(&binding.head_expr, &[("list", &cons_expr)]); - let tail_expr = render_named_template(&binding.tail_expr, &[("list", &cons_expr)]); - cons_locals.payload_bindings.insert( - payload_binding.payload_port, - VariantPayloadBinding::Direct(format!( - "types.SimpleNamespace(head={head_expr}, tail={tail_expr})" - )), - ); - } - let cons_body = self.render_port(cons_path.output, &cons_locals)?; - Ok(format!( - "(lambda __match: ({empty_body} if {empty_predicate} else {cons_body}))({realized_scrutinee})" - )) - } - - fn render_general_match( - &self, - branch: &BranchNode, - locals: &RenderLocals, - ) -> Result { - let scrutinee = self.render_port(branch.input, locals)?; - let scrutinee_type_id = primitive_type_id_for_port(self.dag, branch.input)?; - let disj_id = walk_to_disj(self.dag, scrutinee_type_id).ok_or_else(|| { - EmitPythonError::Unsupported(format!( - "branch scrutinee {:?} does not walk to a disjunction", - scrutinee_type_id - )) - })?; - let is_optional = is_optional_match_disj(self.dag, disj_id); - let mut rendered = "__v3_unreachable(\"non-exhaustive match\")".to_string(); - for path in branch.paths.iter().rev() { - let cond = self.render_branch_condition(disj_id, is_optional, path)?; - let body = self.render_branch_body_expr(is_optional, path, locals)?; - rendered = format!("({body} if {cond} else {rendered})"); - } - Ok(format!("(lambda __match: {rendered})({scrutinee})")) - } - - fn render_branch_condition( - &self, - disj_id: DeclarationId, - is_optional: bool, - path: &Path, - ) -> Result { - let variant_id = resolved_pattern_id(path)?; - if is_optional { - let (none_variant, some_variant) = optional_match_variant_roles(self.dag, disj_id) - .map_err(|detail| EmitPythonError::Unsupported(detail.to_string()))?; - return Ok(if variant_id == none_variant { - "__match is None".to_string() - } else if variant_id == some_variant { - "__match is not None".to_string() - } else { - return Err(EmitPythonError::Unsupported( - "optional match arm resolved to neither optional role".to_string(), - )); - }); - } - let variant_name = runtime_variant_name_for_decl(self.dag, disj_id, variant_id)?; - Ok(format!("isinstance(__match, {variant_name})")) - } - - /// E-5 / Lane 1 Stage 1c PR 3: dispatch on - /// `python_clean_emission.pattern_bindings`. - /// `NotApplicablePatternBinding` selects the substitute-at- - /// render-time path: for every payload-binding port we map it - /// to an extraction expression (`__match._0` / `__match`), so - /// the binding's identifier never appears in emitted Python at - /// a pattern site. If the arm body does not reference the - /// port, the substitution is never invoked and no dead - /// identifier leaks into the source — py_compile stays silent - /// by construction. Python-invalid contract variants are - /// rejected while building `CleanEmissionContractBinding`, so - /// the renderer only sees Python-valid states. - fn render_branch_body_expr( - &self, - is_optional: bool, - path: &Path, - locals: &RenderLocals, - ) -> Result { - let mut arm_locals = locals.clone(); - if let Some(binding) = &path.binding { - match self.indexes.clean_emission.pattern_bindings { - PatternBindingRuleBinding::NotApplicable => { - if let Some(payload_binding) = - self.render_variant_payload_binding(is_optional, path)? - { - arm_locals - .payload_bindings - .insert(binding.payload_port, payload_binding); - } - } - } - } - self.render_port(path.output, &arm_locals) - } - - fn render_variant_payload_binding( - &self, - is_optional: bool, - path: &Path, - ) -> Result>, EmitPythonError> { - if is_optional { - return Ok(Some(VariantPayloadBinding::Direct("__match".to_string()))); - } - let variant_id = resolved_pattern_id(path)?; - let shape = match variant_payload_shape(self.dag, &variant_id) { - VariantPayloadShapeLookup::DeclarationMissing => { - return Err(EmitPythonError::Unsupported( - "variant payload references an absent declaration".to_string(), - )); - } - VariantPayloadShapeLookup::NotPayloadProduct => { - return Ok(Some(VariantPayloadBinding::Direct("__match".to_string()))); - } - VariantPayloadShapeLookup::Found { _0: shape } => shape, - }; - Ok(match shape { - VariantPayloadShape::Empty => None, - VariantPayloadShape::PositionalSingle => { - Some(VariantPayloadBinding::Direct("__match._0".to_string())) - } - VariantPayloadShape::NamedFields { _0: field_labels } => { - match self.indexes.clean_emission.variant_payload_field_access { - VariantPayloadFieldAccessRuleBinding::AccessFromPayloadBinding => { - Some(VariantPayloadBinding::Direct("__match".to_string())) - } - VariantPayloadFieldAccessRuleBinding::OverrideNamedFieldsAtBindingSite => { - let fields = field_labels - .into_iter() - .map(|field_label| { - (field_label.clone(), format!("__match.{field_label}")) - }) - .collect(); - Some(VariantPayloadBinding::Fields(fields)) - } - } - } - }) - } - - fn render_path_body( - &self, - path: &Path, - locals: &RenderLocals, - ) -> Result { - self.render_port(path.output, locals) - } - - fn render_loop( - &self, - loop_node: &crate::dag::LoopNode, - locals: &RenderLocals, - ) -> Result { - // Behavior::Loop has exactly two construction sites in lower.rs, - // both for recursive user functions: - // 1. Cardinality bound (lower.rs ~3631): single recursive fn with - // descent-provable termination; bound.count = first param port. - // 2. Descent bound (lower.rs ~382): mutual-recursion cluster. - // - // In both cases `loop_node.body` is the root node of the function's - // body DAG, which already contains recursive self-calls to the same - // or mutually-recursive functions. Rendering the body node's result - // port preserves those calls. Python supports recursion natively, so - // the emitted expression is semantically correct without any iteration - // scaffolding. The `source`/`init`/`bound` fields encode the - // termination *proof*, not operational iteration state. - // - // Collection folds (fold/map/filter) route through callable - // realizations (__v3_fold etc.) and never reach Behavior::Loop. - // If a future IR change adds Loop for non-recursive collection - // iteration, this site must be updated to emit explicit iteration. - let body_port = super::behavior_result_port(self.dag.node(loop_node.body)); - self.render_port(body_port, locals) - } - - fn render_callable_transform( - &self, - t: &TransformNode, - target: DeclarationId, - locals: &RenderLocals, - ) -> Result { - let (template, arguments) = callable_template(target, self.dag); - if let Some(strategy) = self.indexes.callables.get(&template) { - return self - .render_realized_callable(template, *strategy, &arguments, &t.inputs, locals); - } - self.render_general_callable(template, &t.inputs, locals) - } - - fn render_realized_callable( - &self, - template: DeclarationId, - strategy: CallableStrategyBinding, - arguments: &[TemplateArgument], - inputs: &[PortId], - locals: &RenderLocals, - ) -> Result { - match strategy { - CallableStrategyBinding::Empty => Ok(self.indexes.syntax.empty_list.clone()), - CallableStrategyBinding::Singleton => { - let value = self.render_port(inputs[0], locals)?; - Ok(render_named_template( - &self.indexes.syntax.list_literal, - &[("elements", &value)], - )) - } - CallableStrategyBinding::Cons => { - let head = self.render_port(inputs[0], locals)?; - let tail = self.render_port(inputs[1], locals)?; - Ok(render_named_template( - &self.indexes.syntax.cons, - &[("head", &head), ("tail", &tail)], - )) - } - CallableStrategyBinding::Concat => { - let left = self.render_port(inputs[0], locals)?; - let right = self.render_port(inputs[1], locals)?; - Ok(render_named_template( - &self.indexes.syntax.concat, - &[("left", &left), ("right", &right)], - )) - } - CallableStrategyBinding::Length => { - let recv = self.render_port(inputs[0], locals)?; - Ok(render_named_template( - &self.indexes.syntax.length, - &[("recv", &recv)], - )) - } - CallableStrategyBinding::IsEmpty => { - let recv = self.render_port(inputs[0], locals)?; - Ok(render_named_template( - &self.indexes.syntax.is_empty, - &[("recv", &recv)], - )) - } - CallableStrategyBinding::Fold => { - let fn_decl = bound_callable_argument(self.dag, template, arguments, 2)?; - let acc = "__fold_acc".to_string(); - let item = "__fold_item".to_string(); - let body = self.render_closure( - fn_decl, - &[(acc.clone(), acc.clone()), (item.clone(), item.clone())], - locals, - )?; - let recv = self.render_port(inputs[0], locals)?; - let init = self.render_port(inputs[1], locals)?; - Ok(render_named_template( - &self.indexes.syntax.fold, - &[("recv", &recv), ("init", &init), ("body", &body)], - )) - } - CallableStrategyBinding::Map => { - let fn_decl = bound_callable_argument(self.dag, template, arguments, 1)?; - let item = "__map_item".to_string(); - let body = - self.render_callable_body(fn_decl, &[(item.clone(), item.clone())], locals)?; - let recv = self.render_port(inputs[0], locals)?; - Ok(render_named_template( - &self.indexes.syntax.map, - &[("recv", &recv), ("item", &item), ("body", &body)], - )) - } - CallableStrategyBinding::Filter => { - let fn_decl = bound_callable_argument(self.dag, template, arguments, 1)?; - let item = "__filter_item".to_string(); - let predicate = - self.render_callable_body(fn_decl, &[(item.clone(), item.clone())], locals)?; - let recv = self.render_port(inputs[0], locals)?; - Ok(render_named_template( - &self.indexes.syntax.filter, - &[ - ("recv", &recv), - ("item", &item), - ("item_push", &item), - ("predicate", &predicate), - ], - )) - } - CallableStrategyBinding::Contains => { - let recv = self.render_port(inputs[0], locals)?; - let item = self.render_port(inputs[1], locals)?; - Ok(render_named_template( - &self.indexes.syntax.contains, - &[("recv", &recv), ("item", &item)], - )) - } - } - } - - fn render_general_callable( - &self, - template: DeclarationId, - inputs: &[PortId], - locals: &RenderLocals, - ) -> Result { - if let Some(rendered) = self.render_variant_constructor(template, inputs, locals)? { - return Ok(rendered); - } - if let Some(rendered) = self.render_record_constructor(template, inputs, locals)? { - return Ok(rendered); - } - let func = self.dag.declaration(template).name.clone().ok_or_else(|| { - EmitPythonError::Unsupported( - "callable target is anonymous and cannot be rendered as a direct Python call" - .to_string(), - ) - })?; - let args = inputs - .iter() - .map(|port| self.render_port(*port, locals)) - .collect::, _>>()?; - Ok(render_named_template( - &self.indexes.syntax.function_call, - &[("func", &func), ("args", &args.join(", "))], - )) - } - - fn render_record_constructor( - &self, - template: DeclarationId, - inputs: &[PortId], - locals: &RenderLocals, - ) -> Result, EmitPythonError> { - let decl = self.dag.declaration(template); - let Some(type_name) = &decl.name else { - return Ok(None); - }; - let TypeConnective::Conj { children } = &decl.connective else { - return Ok(None); - }; - let mut fields = Vec::new(); - for (field, input) in children.iter().zip(inputs.iter()) { - fields.push(format!( - "{}={}", - field.label, - self.render_port(*input, locals)? - )); - } - Ok(Some(format!("{type_name}({})", fields.join(", ")))) - } - - fn render_variant_constructor( - &self, - template: DeclarationId, - inputs: &[PortId], - locals: &RenderLocals, - ) -> Result, EmitPythonError> { - let Some((enum_name, variant_name)) = variant_parent_info(self.dag, template) else { - return Ok(None); - }; - let runtime_name = python_variant_class_name(&enum_name, &variant_name); - let TypeConnective::Conj { children } = &self.dag.declaration(template).connective else { - return Ok(None); - }; - if children.is_empty() { - return Ok(Some(format!("{runtime_name}()"))); - } - let payload_shape = match variant_payload_shape(self.dag, &template) { - VariantPayloadShapeLookup::DeclarationMissing => { - return Err(EmitPythonError::Unsupported( - "variant constructor references an absent declaration".to_string(), - )); - } - VariantPayloadShapeLookup::NotPayloadProduct => return Ok(None), - VariantPayloadShapeLookup::Found { _0: shape } => shape, - }; - if matches!(payload_shape, VariantPayloadShape::PositionalSingle) { - let [input] = inputs else { - return Err(EmitPythonError::Unsupported( - "positional-single variant construction expects exactly one input".to_string(), - )); - }; - let arg = self.render_port(*input, locals)?; - return Ok(Some(format!("{runtime_name}({arg})"))); - } - let mut fields = Vec::new(); - for (field, input) in children.iter().zip(inputs.iter()) { - fields.push(format!( - "{}={}", - field.label, - self.render_port(*input, locals)? - )); - } - Ok(Some(format!("{runtime_name}({})", fields.join(", ")))) - } - - fn render_callable_body( - &self, - callable_decl: DeclarationId, - param_bindings: &[(String, String)], - outer_locals: &RenderLocals, - ) -> Result { - let TypeConnective::Arrow { inputs, body, .. } = - &self.dag.declaration(callable_decl).connective - else { - return Err(EmitPythonError::Unsupported( - "callable template binding did not resolve to an Arrow".to_string(), - )); - }; - let ArrowBody::UserDefined(bind_id) = body else { - return Err(EmitPythonError::Unsupported( - "python emitter only supports user-defined callable bodies".to_string(), - )); - }; - let bind = (*bind_id).bind(self.dag); - if bind.params.len() < inputs.len() { - return Err(EmitPythonError::Unsupported( - "callable bind parameter count does not match arrow inputs".to_string(), - )); - } - let capture_count = bind.params.len() - inputs.len(); - let mut locals = RenderLocals::default(); - for capture in bind.params.iter().copied().take(capture_count) { - locals - .names - .insert(capture, self.render_port(capture, outer_locals)?); - } - for (port, (_, name)) in bind - .params - .iter() - .copied() - .skip(capture_count) - .zip(param_bindings.iter()) - { - locals.names.insert(port, name.clone()); - } - self.render_port(bind.value, &locals) - } - - fn render_closure( - &self, - callable_decl: DeclarationId, - param_bindings: &[(String, String)], - outer_locals: &RenderLocals, - ) -> Result { - let body = self.render_callable_body(callable_decl, param_bindings, outer_locals)?; - let params = param_bindings - .iter() - .map(|(name, _)| name.clone()) - .collect::>() - .join(", "); - Ok(render_named_template( - &self.indexes.syntax.closure, - &[("params", ¶ms), ("body", &body)], - )) - } - - fn render_function_declaration( - &self, - declaration: &crate::dag::Declaration, - ) -> Result { - let name = declaration.name.clone().ok_or_else(|| { - EmitPythonError::Unsupported( - "anonymous arrows cannot be emitted as Python functions".to_string(), - ) - })?; - let TypeConnective::Arrow { - inputs, - output, - body, - } = &declaration.connective - else { - return Err(EmitPythonError::Unsupported( - "render_function_declaration expected Arrow".to_string(), - )); - }; - if !declaration.type_params.is_empty() { - return Err(EmitPythonError::Unsupported(format!( - "generic function `{name}` is not yet supported by emit_python" - ))); - } - let ArrowBody::UserDefined(bind_id) = body else { - return Err(EmitPythonError::Unsupported( - "emit_python only supports user-defined function bodies".to_string(), - )); - }; - let bind = (*bind_id).bind(self.dag); - let mut locals = RenderLocals::default(); - let mut params = Vec::new(); - for (idx, port) in bind.params.iter().enumerate() { - let param_name = format!("p{idx}"); - locals.names.insert(*port, param_name.clone()); - let ty = self.python_type_name_for_port(*port)?; - params.push(format!("{param_name}: {ty}")); - } - if bind.params.len() != inputs.len() { - return Err(EmitPythonError::Unsupported( - "function bind parameter count does not match arrow inputs".to_string(), - )); - } - let ret = self.python_type_name_for_decl(*output)?; - let body_expr = self.render_port(bind.value, &locals)?; - Ok(format!( - "def {name}({}) -> {ret}:\n return {body_expr}", - params.join(", ") - )) - } - - fn render_type_declaration( - &self, - declaration: &crate::dag::Declaration, - ) -> Result { - let name = declaration.name.clone().ok_or_else(|| { - EmitPythonError::Unsupported( - "anonymous type declarations cannot be emitted".to_string(), - ) - })?; - match &declaration.connective { - TypeConnective::Conj { children } => { - if children.is_empty() { - return Ok(format!("@dataclass\nclass {name}:\n pass")); - } - let mut lines = vec!["@dataclass".to_string(), format!("class {name}:")]; - for child in children { - lines.push(format!( - " {}: {}", - child.label, - self.python_type_name_for_decl(child.ty)? - )); - } - Ok(lines.join("\n")) - } - TypeConnective::Disj { variants } => { - let mut blocks = vec![format!("class {name}:\n pass")]; - for variant in variants { - blocks.push(self.render_enum_variant(name.as_str(), variant)?); - } - Ok(blocks.join("\n\n")) - } - _ => Err(EmitPythonError::Unsupported(format!( - "type declaration `{name}` does not lower to a record or sum shape" - ))), - } - } - - fn render_enum_variant( - &self, - enum_name: &str, - variant: &Field, - ) -> Result { - let variant_decl = self.dag.declaration(variant.ty); - let TypeConnective::Conj { children } = &variant_decl.connective else { - return Err(EmitPythonError::Unsupported(format!( - "enum variant `{}` does not lower to a product declaration", - variant.label - ))); - }; - let runtime_name = python_variant_class_name(enum_name, &variant.label); - let mut lines = vec![ - "@dataclass".to_string(), - format!("class {runtime_name}({enum_name}):"), - ]; - if children.is_empty() { - lines.push(" pass".to_string()); - return Ok(lines.join("\n")); - } - for child in children { - lines.push(format!( - " {}: {}", - child.label, - self.python_type_name_for_decl(child.ty)? - )); - } - Ok(lines.join("\n")) - } - - fn python_type_name_for_port(&self, port: PortId) -> Result { - let ty = self - .dag - .port(port) - .value_type() - .ok_or(EmitPythonError::UntypedPort(port))?; - self.python_type_name_for_decl(ty.declaration) - } - - fn python_type_name_for_decl( - &self, - declaration: DeclarationId, - ) -> Result { - self.python_type_name_for_decl_at_depth(declaration, 0) - } - - fn python_type_name_for_decl_at_depth( - &self, - declaration: DeclarationId, - depth: usize, - ) -> Result { - if depth >= 32 { - return Err(EmitPythonError::Unsupported( - "type-name rendering exceeded depth 32".to_string(), - )); - } - if let Some(binding) = self.indexes.types.get(&declaration) { - return Ok(binding.clone()); - } - let decl = self.dag.declaration(declaration); - if let Some(name) = &decl.name { - return Ok(name.clone()); - } - match &decl.connective { - TypeConnective::Instantiation { - template, - arguments, - } => { - let carrier = self - .indexes - .type_instantiations - .get(template) - .ok_or(EmitPythonError::MissingTypeRealization { target: *template })?; - match arguments.as_slice() { - [element] => { - let element_name = - self.python_type_name_for_decl_at_depth(element.value, depth + 1)?; - Ok(render_named_template( - carrier, - &[("element", &element_name)], - )) - } - [key, value] => { - let key_name = - self.python_type_name_for_decl_at_depth(key.value, depth + 1)?; - let value_name = - self.python_type_name_for_decl_at_depth(value.value, depth + 1)?; - Ok(render_named_template( - carrier, - &[("key", &key_name), ("value", &value_name)], - )) - } - [key, value, extra] => { - let key_name = - self.python_type_name_for_decl_at_depth(key.value, depth + 1)?; - let value_name = - self.python_type_name_for_decl_at_depth(value.value, depth + 1)?; - let extra_name = - self.python_type_name_for_decl_at_depth(extra.value, depth + 1)?; - Ok(render_named_template( - carrier, - &[ - ("key", &key_name), - ("value", &value_name), - ("extra", &extra_name), - ], - )) - } - _ => Err(EmitPythonError::Unsupported( - "python type instantiation supports arities 1, 2, and 3".to_string(), - )), - } - } - TypeConnective::Cardinality(p) - if p.bound() == crate::dag::CardinalityBound::AtMostOne => - { - let inner = self.python_type_name_for_decl_at_depth(p.element(), depth + 1)?; - Ok(render_named_template( - &self.indexes.syntax.optional, - &[("element", &inner)], - )) - } - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - self.python_type_name_for_decl_at_depth(*next, depth + 1) - } - _ => Err(EmitPythonError::MissingTypeRealization { - target: declaration, - }), - } - } - - fn branch_scrutinee_is_bool(&self, branch: &BranchNode) -> Result { - let scrutinee_type_id = primitive_type_id_for_port(self.dag, branch.input)?; - let Some(bool_shape) = self.dag.bool_shape() else { - return Ok(false); - }; - Ok(walk_to_disj(self.dag, scrutinee_type_id) - .zip(walk_to_disj(self.dag, bool_shape.declaration)) - .is_some_and(|(left, right)| left == right)) - } - - fn split_bool_paths<'p>( - &self, - branch: &'p BranchNode, - ) -> Result<(&'p Path, &'p Path), EmitPythonError> { - let scrutinee_type_id = primitive_type_id_for_port(self.dag, branch.input)?; - let disj_id = walk_to_disj(self.dag, scrutinee_type_id).ok_or_else(|| { - EmitPythonError::Unsupported( - "bool branch scrutinee does not walk to a Disj".to_string(), - ) - })?; - let TypeConnective::Disj { variants } = &self.dag.declaration(disj_id).connective else { - unreachable!("walk_to_disj returned non-Disj") - }; - if variants.len() != 2 { - return Err(EmitPythonError::Unsupported( - "bool branch must have exactly two variants".to_string(), - )); - } - let true_variant = variants[0].ty; - let false_variant = variants[1].ty; - let then_path = find_resolved_branch_path(branch, true_variant) - .ok_or_else(|| EmitPythonError::Unsupported("missing True branch arm".to_string()))?; - let else_path = find_resolved_branch_path(branch, false_variant) - .ok_or_else(|| EmitPythonError::Unsupported("missing False branch arm".to_string()))?; - Ok((then_path, else_path)) - } -} - -fn render_value(v: &crate::dag::ValueNode) -> String { - match &v.data { - LiteralBits::Int(decimal) => decimal.clone(), - LiteralBits::Bool(true) => "True".to_string(), - LiteralBits::Bool(false) => "False".to_string(), - LiteralBits::String(s) | LiteralBits::Symbol(s) => format!("{:?}", s), - } -} - -fn parse_callable_strategy( - dag: &Dag, - fields: &[(String, FieldValue)], - declaration: DeclarationId, -) -> Result { - let (constructor, payload) = variant_field(fields, "strategy", declaration)?; - if !payload.is_empty() { - return Err(EmitPythonError::MalformedSpec { - declaration, - detail: "CallableStrategy variants must not carry payload", - }); - } - let variants = dag.callable_strategy_variants(); - let strategies = [ - (variants.list_empty, CallableStrategyBinding::Empty), - (variants.list_singleton, CallableStrategyBinding::Singleton), - (variants.list_cons, CallableStrategyBinding::Cons), - (variants.list_concat, CallableStrategyBinding::Concat), - (variants.list_length, CallableStrategyBinding::Length), - (variants.list_is_empty, CallableStrategyBinding::IsEmpty), - (variants.list_fold, CallableStrategyBinding::Fold), - (variants.list_map, CallableStrategyBinding::Map), - (variants.list_filter, CallableStrategyBinding::Filter), - (variants.list_contains, CallableStrategyBinding::Contains), - ]; - for (variant_id, strategy) in strategies { - let Some(variant_id) = variant_id else { - return Err(EmitPythonError::MalformedSpec { - declaration, - detail: "CallableStrategy variant declaration was not found", - }); - }; - if constructor == variant_id { - return Ok(strategy); - } - } - Err(EmitPythonError::MalformedSpec { - declaration, - detail: "unsupported CallableStrategy variant", - }) -} - -/// Structural boundary check for `PatternRealization.empty_variant` / -/// `cons_variant`. Mirrors `rust_target::validate_pattern_roles` — see -/// that comment for rationale. Rejects spec data where the typed -/// `DeclarationRef`s point outside `target`'s variants. -fn validate_pattern_roles( - dag: &Dag, - target: DeclarationId, - binding: &PatternRealizationBinding, - declaration: DeclarationId, -) -> Result<(), EmitPythonError> { - let disj_id = walk_to_disj(dag, target).ok_or(EmitPythonError::MalformedSpec { - declaration, - detail: - "PatternRealization.target must resolve to a Disj — empty_variant / cons_variant have no target to range over otherwise", - })?; - let TypeConnective::Disj { variants } = &dag.declaration(disj_id).connective else { - return Err(EmitPythonError::MalformedSpec { - declaration, - detail: "walk_to_disj returned a non-Disj declaration (internal invariant violation)", - }); - }; - if !variants.iter().any(|v| v.ty == binding.empty_variant) { - return Err(EmitPythonError::MalformedSpec { - declaration, - detail: - "PatternRealization.empty_variant must be a variant of `target` — structural boundary check rejects unrelated DeclarationRefs", - }); - } - if !variants.iter().any(|v| v.ty == binding.cons_variant) { - return Err(EmitPythonError::MalformedSpec { - declaration, - detail: - "PatternRealization.cons_variant must be a variant of `target` — structural boundary check rejects unrelated DeclarationRefs", - }); - } - if binding.empty_variant == binding.cons_variant { - return Err(EmitPythonError::MalformedSpec { - declaration, - detail: - "PatternRealization.empty_variant and cons_variant must be distinct variants of `target`", - }); - } - Ok(()) -} - -fn parse_pattern_realization( - dag: &Dag, - fields: &[(String, FieldValue)], - declaration: DeclarationId, -) -> Result { - let strategy = fields - .iter() - .find(|(label, _)| label == "strategy") - .map(|(_, value)| value) - .ok_or(EmitPythonError::MalformedSpec { - declaration, - detail: "PatternRealization is missing required `strategy` field", - })?; - match parse_pattern_strategy(dag, strategy) { - Ok(PatternStrategyBinding::VectorList) => {} - Err(detail) => { - return Err(EmitPythonError::MalformedSpec { - declaration, - detail, - }); - } - } - Ok(PatternRealizationBinding { - empty_variant: require_field_decl_ref(fields, "empty_variant", declaration)?, - cons_variant: require_field_decl_ref(fields, "cons_variant", declaration)?, - scrutinee: require_field_string(fields, "scrutinee", declaration)?, - empty_pattern: require_field_string(fields, "empty_pattern", declaration)?, - cons_pattern: require_field_string(fields, "cons_pattern", declaration)?, - head_expr: require_field_string(fields, "head_expr", declaration)?, - tail_expr: require_field_string(fields, "tail_expr", declaration)?, - }) -} - -fn method_contract_single_emit_template_string( - dag: &Dag, - contract_decl: DeclarationId, -) -> Result { - let fields = structural_fields_for_decl(dag, contract_decl)?; - let emit_value = fields - .iter() - .find(|(label, _)| label == "emit_template") - .map(|(_, v)| v) - .ok_or(EmitPythonError::MalformedSpec { - declaration: contract_decl, - detail: "MethodTemplateContract missing emit_template field", - })?; - let FieldValue::Variant { - constructor, - ref payload, - } = emit_value - else { - return Err(EmitPythonError::MalformedSpec { - declaration: contract_decl, - detail: "MethodTemplateContract.emit_template must be a sum variant", - }); - }; - let ctor_name = method_emit_template_variant_label(dag, *constructor) - .ok_or(EmitPythonError::MalformedSpec { - declaration: contract_decl, - detail: - "MethodTemplateContract.emit_template variant not found under MethodEmitTemplate disj", - })?; - if ctor_name != "SingleTemplate" { - return Err(EmitPythonError::MalformedSpec { - declaration: contract_decl, - detail: "CollectionOps MethodTemplateContract must use MethodEmitTemplate.SingleTemplate today", - }); - } - let [FieldValue::Literal(LiteralBits::String(template))] = payload.as_slice() else { - return Err(EmitPythonError::MalformedSpec { - declaration: contract_decl, - detail: "SingleTemplate must carry exactly one string template payload", - }); - }; - Ok(template.clone()) -} - -fn structural_fields_for_decl( - dag: &Dag, - declaration: DeclarationId, -) -> Result<&[(String, FieldValue)], EmitPythonError> { - structural_fields(dag.declaration(declaration)).ok_or(EmitPythonError::MalformedSpec { - declaration, - detail: "named Python spec entry must be a structural data item", - }) -} - -fn structural_fields(decl: &crate::dag::Declaration) -> Option<&[(String, FieldValue)]> { - match &decl.value_body { - Some(crate::dag::ValueBody::Structural { fields }) => Some(fields), - _ => None, - } -} - -fn require_field_decl_ref( - fields: &[(String, FieldValue)], - name: &str, - declaration: DeclarationId, -) -> Result { - fields - .iter() - .find(|(label, _)| label == name) - .and_then(|(_, value)| match value { - FieldValue::Reference(target) => Some(*target), - _ => None, - }) - .ok_or(EmitPythonError::MalformedSpec { - declaration, - detail: "required declaration-ref field missing or malformed", - }) -} - -fn require_field_string( - fields: &[(String, FieldValue)], - name: &str, - declaration: DeclarationId, -) -> Result { - fields - .iter() - .find(|(label, _)| label == name) - .and_then(|(_, value)| match value { - FieldValue::Literal(LiteralBits::String(value)) => Some(value.clone()), - _ => None, - }) - .ok_or(EmitPythonError::MalformedSpec { - declaration, - detail: "required string field missing or malformed", - }) -} - -fn variant_field<'a>( - fields: &'a [(String, FieldValue)], - name: &str, - declaration: DeclarationId, -) -> Result<(DeclarationId, &'a [FieldValue]), EmitPythonError> { - let value = fields - .iter() - .find(|(label, _)| label == name) - .map(|(_, value)| value) - .ok_or(EmitPythonError::MalformedSpec { - declaration, - detail: "required variant field missing", - })?; - let FieldValue::Variant { - constructor, - payload, - } = value - else { - return Err(EmitPythonError::MalformedSpec { - declaration, - detail: "required field must be a variant", - }); - }; - Ok((*constructor, payload)) -} - -/// Parse the `memory` field of a TargetExecutionModel into a typed -/// MemoryModelBinding. Mirrors emit_go::require_memory_model — keeps -/// the closed sum closed instead of demoting it to a string. -fn require_memory_model( - dag: &Dag, - fields: &[(String, FieldValue)], - declaration: DeclarationId, -) -> Result { - let (constructor, payload) = variant_field(fields, "memory", declaration)?; - if !payload.is_empty() { - return Err(EmitPythonError::MalformedSpec { - declaration, - detail: "MemoryModel variants must not carry payload fields", - }); - } - let variants = dag.emit_model_variants(); - let memory_variants = [ - ( - variants.memory_model.value_only, - MemoryModelBinding::ValueOnly, - ), - ( - variants.memory_model.garbage_collected, - MemoryModelBinding::GarbageCollected, - ), - ( - variants.memory_model.ref_counted, - MemoryModelBinding::RefCounted, - ), - ( - variants.memory_model.ownership_based, - MemoryModelBinding::OwnershipBased, - ), - ]; - for (variant_id, binding) in memory_variants { - let variant_id = variant_id.ok_or(EmitPythonError::MissingMeta("MemoryModel variant"))?; - if constructor == variant_id { - return Ok(binding); - } - } - Err(EmitPythonError::MalformedSpec { - declaration, - detail: - "TargetExecutionModel.memory must be ValueOnly/GarbageCollected/RefCounted/OwnershipBased", - }) -} - -/// Parse the `scope` field of a TargetExecutionModel. Mirrors -/// emit_go::require_scope_model. -fn require_scope_model( - dag: &Dag, - fields: &[(String, FieldValue)], - declaration: DeclarationId, -) -> Result { - let (constructor, payload) = variant_field(fields, "scope", declaration)?; - if !payload.is_empty() { - return Err(EmitPythonError::MalformedSpec { - declaration, - detail: "ScopeModel variants must not carry payload fields", - }); - } - let variants = dag.emit_model_variants(); - let scope_variants = [ - ( - variants.scope_model.lexical_scoping, - ScopeModelBinding::LexicalScoping, - ), - ( - variants.scope_model.dynamic_scoping, - ScopeModelBinding::DynamicScoping, - ), - ]; - for (variant_id, binding) in scope_variants { - let variant_id = variant_id.ok_or(EmitPythonError::MissingMeta("ScopeModel variant"))?; - if constructor == variant_id { - return Ok(binding); - } - } - Err(EmitPythonError::MalformedSpec { - declaration, - detail: "TargetExecutionModel.scope must be LexicalScoping/DynamicScoping", - }) -} - -fn render_named_template(template: &str, bindings: &[(&str, &str)]) -> String { - let mut rendered = template.to_string(); - for (name, value) in bindings { - rendered = rendered.replace(&format!("{{{name}}}"), value); - } - rendered -} - -fn indent(source: &str, level: usize) -> String { - let prefix = " ".repeat(level); - source - .lines() - .map(|line| { - if line.is_empty() { - line.to_string() - } else { - format!("{prefix}{line}") - } - }) - .collect::>() - .join("\n") -} - -fn primitive_type_id_for_port(dag: &Dag, port: PortId) -> Result { - primitive_type_id_for_port_shared(dag, port).map_err(|err| match err { - SharedEmitLookupError::UntypedPort(port) => EmitPythonError::UntypedPort(port), - SharedEmitLookupError::Unsupported(detail) => { - // Preserve the pre-consolidation Python diagnostic wording while the - // target still owns its public error strings. - EmitPythonError::Unsupported(detail.replace(" — likely a cycle", "")) - } - }) -} - -fn is_optional_match_disj(dag: &Dag, disj_id: DeclarationId) -> bool { - dag.declarations() - .iter() - .filter_map(|decl| dag.optional_match_disj(decl.id)) - .any(|optional_disj| optional_disj == disj_id) -} - -/// Resolve the algebra-field declaration id for a given operand -/// type and `OperatorKind`. Walks the operand type's instantiation -/// chain to its algebra Conj (e.g. Int → ... → OrderedRing instance), -/// then finds the field whose label matches the operator's algebra -/// field name. Returns the field's child declaration id, which the -/// python.dag `op: OrderedRing.add` reference also resolves to via -/// the dotted-path lowering. Mirrors emit_rust::algebra_field_for_operator. -fn algebra_field_for_operator( - dag: &Dag, - operand_type_id: DeclarationId, - op: OperatorKind, -) -> Result { - algebra_field_for_operator_shared(dag, operand_type_id, op).map_err(|err| match err { - SharedEmitLookupError::UntypedPort(port) => EmitPythonError::UntypedPort(port), - // Preserve the pre-consolidation Python diagnostic wording while the - // target still owns its public error strings. - SharedEmitLookupError::Unsupported(detail) => EmitPythonError::Unsupported( - detail - .replace("the canonical `OrderedRing`", "canonical OrderedRing") - .replace( - "`OrderedRing` does not lower to a Conj declaration", - "OrderedRing did not lower to a Conj", - ) - .replace( - "`OrderedRing` has no canonical field labeled", - "OrderedRing has no canonical field labeled", - ), - ), - }) -} - -fn variant_name_for_decl( - dag: &Dag, - disj_id: DeclarationId, - variant_id: DeclarationId, -) -> Result { - let TypeConnective::Disj { variants } = &dag.declaration(disj_id).connective else { - unreachable!("variant_name_for_decl requires a disjunction") - }; - variants - .iter() - .find(|variant| variant.ty == variant_id) - .map(|variant| variant.label.clone()) - .ok_or_else(|| { - EmitPythonError::Unsupported( - "variant id not found under parent disjunction".to_string(), - ) - }) -} - -fn runtime_variant_name_for_decl( - dag: &Dag, - disj_id: DeclarationId, - variant_id: DeclarationId, -) -> Result { - let variant_name = variant_name_for_decl(dag, disj_id, variant_id)?; - Ok(dag - .declaration(disj_id) - .name - .as_deref() - .map(|enum_name| python_variant_class_name(enum_name, &variant_name)) - .unwrap_or(variant_name)) -} - -fn variant_parent_info(dag: &Dag, variant_id: DeclarationId) -> Option<(String, String)> { - dag.declarations().iter().find_map(|decl| { - let enum_name = decl.name.as_ref()?; - let TypeConnective::Disj { variants } = &decl.connective else { - return None; - }; - variants - .iter() - .find(|variant| variant.ty == variant_id) - .map(|variant| (enum_name.clone(), variant.label.clone())) - }) -} - -fn python_variant_class_name(enum_name: &str, variant_name: &str) -> String { - format!("{enum_name}_{variant_name}") -} - -fn callable_template(target: DeclarationId, dag: &Dag) -> (DeclarationId, Vec) { - match &dag.declaration(target).connective { - TypeConnective::Instantiation { - template, - arguments, - } => (*template, arguments.clone()), - _ => (target, Vec::new()), - } -} - -fn bound_callable_argument( - dag: &Dag, - template: DeclarationId, - arguments: &[TemplateArgument], - input_index: usize, -) -> Result { - let TypeConnective::Arrow { inputs, .. } = &dag.declaration(template).connective else { - return Err(EmitPythonError::Unsupported( - "realized callable template did not resolve to an Arrow".to_string(), - )); - }; - let Some(param_decl) = inputs.get(input_index).copied() else { - return Err(EmitPythonError::Unsupported( - "realized callable slot is missing from the template declaration".to_string(), - )); - }; - arguments - .iter() - .find(|arg| arg.parameter == param_decl) - .map(|arg| arg.value) - .ok_or_else(|| { - EmitPythonError::Unsupported( - "callable argument did not bind through template instantiation".to_string(), - ) - }) -} - -fn find_resolved_branch_path(branch: &BranchNode, variant_id: DeclarationId) -> Option<&Path> { - branch.paths.iter().find(|path| match &path.pattern { - BranchPattern::ResolvedVariant(id) => *id == variant_id, - BranchPattern::UnresolvedVariant { .. } => false, - }) -} - -fn resolved_pattern_id(path: &Path) -> Result { - match &path.pattern { - BranchPattern::ResolvedVariant(id) => Ok(*id), - BranchPattern::UnresolvedVariant { name, .. } => { - Err(EmitPythonError::UnresolvedBranchPattern { - variant_name: name.clone(), - }) - } - } -} diff --git a/src/v3/compiler/src/emit/rust_target.rs b/src/v3/compiler/src/emit/rust_target.rs deleted file mode 100644 index 7bbaf09600c..00000000000 --- a/src/v3/compiler/src/emit/rust_target.rs +++ /dev/null @@ -1,6996 +0,0 @@ -// M1(3) PR-B-unwind — Rust emitter with typed declaration dispatch. -// -// **What changed from the initial PR-B cut.** The original -// `emit_rust.rs` built a `HashMap<(String, String), String>` from -// rust.dag's name-style string fields and dispatched via -// `index.lookup(...)` calls keyed on canonical primitive names. -// Every dispatch site embedded a Rust string literal naming a -// substrate concept. That pattern was the M1(2.7) name-bridge -// regression the -// review loop spent fourteen rounds eliminating from the inference -// layer, just at the emit layer. The unwind reshapes both ends: -// -// - rust.dag carries typed `DeclarationRef` field references via -// identifier and dotted-path values resolved at lower time. -// - emit_rust.rs builds typed indexes keyed by -// `DeclarationId` and tuples thereof. Lookups read declaration -// ids straight off ports / nodes / substrate markers; zero -// name strings cross the substrate/emitter boundary. -// -// The end-to-end success criterion is unchanged: -// compile_to_dag("let x: Int = 1 + 2") → emit_rust → rustc → "3" -// -// Scope at PR-B (unchanged): -// - Value literals (Int, Bool, String) -// - Arithmetic + comparison operators on Int -// - if/else branches (as Rust if-expressions) -// - Top-level value Binds (as let statements) -// - Outer fn main wrapper -// - Narrow staged-std list helpers used by Prereq 4 fixtures: -// `empty`, `singleton`, `cons`, `fold`, `map`, `filter` -// -// Out of scope (follow-up work, tracked in DOWNSTREAM_REQUIREMENTS): -// - User-defined functions (Bind with non-empty params) -// - Loops -// - General TransformTarget::Callable dispatch -// - Record / enum construction -// -// Template placeholders the substitution engine recognizes (see -// src/v3/spec/rust.dag for the authoritative list): -// {name} Bind name {cond} branch condition -// {type} Rust type name {then} then-arm body -// {value} bind value expr {else} else-arm body -// {body} list of lets {quote} literal double-quote -// {final} final bind's name - -use std::collections::{HashMap, HashSet}; - -use super::{ - algebra_field_for_operator_shared, - collection_ops_method_contract::{ - method_template_contract_decl_emit_template, MethodTemplateContractEmitTemplate, - }, - dag_needs_div_error_prelude, div_prelude_reserved_name_collision, parse_pattern_strategy, - primitive_type_id_for_port_shared, walk_to_disj, EmitMode, PatternStrategyBinding, - SharedEmitLookupError, SourceFilteringBinding, VariantPayloadBinding, - VariantPayloadFieldAccessRuleBinding, -}; -use crate::dag::{ - ArrowBody, AtomPayload, Behavior, BindNode, BranchNode, BranchPattern, Dag, DeclarationId, - Field, FieldValue, LiteralBits, LoopNode, Path, PortId, TemplateArgument, TransformNode, - TransformTarget, TypeConnective, ValueBody, ValueNode, -}; -use crate::operators::OperatorKind; -use crate::variant_payload::{ - variant_payload_shape, VariantPayloadShape, VariantPayloadShapeLookup, -}; - -/// Errors the Rust emitter surfaces when the DAG reaches a shape it -/// cannot render under the PR-B scope. Each variant names a specific -/// structural cause — no catch-all `Unknown` — so consumers can -/// classify the failure against `src/v3/spec/rust.dag`'s -/// coverage. -/// -/// **Dissolution receipt — 🟢 TERMINAL.** Eleven variants, each -/// classifying a structurally distinct failure mode at a different -/// boundary in the emitter pipeline. The variants partition into -/// four categories: -/// -/// 1. **Realization-table gaps** (`MissingTypeRealization`, -/// `MissingOperatorRealization`, `MissingBehaviorRealization`): -/// the declaration the DAG references has no matching -/// realization in `src/v3/spec/rust.dag`. Each payload is a -/// typed `DeclarationId` (no string keys) so the caller can -/// pinpoint which declaration is uncovered. -/// -/// 2. **Spec consistency failures** (`MissingRealizationMeta`, -/// `MalformedRealization`, `DuplicateRealization`): the -/// per-target spec file (rust.dag) is internally inconsistent -/// — missing meta-types, malformed realization records, or -/// duplicate keys. These are spec-side bugs that -/// `RealizationIndexes::build` fail-closes on at index -/// construction time. The pre-unwind shape silently dropped -/// malformed entries and silently overwrote duplicate keys; -/// the explicit variants are the fail-closed counterpart. -/// -/// 3. **Substrate-side bugs** (`MissingSubstrateMarker`, -/// `UntypedPort`, `UnresolvedBranchPattern`): the substrate -/// handed the emitter a state inference should have driven -/// to a terminal form. Reaching any of these is a bug in -/// bootstrap, infer, or lowering — not a target-language -/// coverage issue. -/// -/// 4. **Out-of-scope DAG shapes** (`UnsupportedBehavior`, -/// `NonBooleanBranch`): the DAG carries a structurally valid -/// shape that PR-B's emit scope doesn't cover yet (Loop, -/// Callable, non-Bool branches). Each is a follow-up boundary, -/// not a substrate gap. -/// -/// 4-pattern check: -/// - **Pattern 1 (fact placement)**: fails. Each variant has a -/// structurally distinct payload: typed `DeclarationId` values -/// for realization-table gaps, a typed `SubstrateMarkerRole` -/// tag for marker absence, a `PortId` for untyped ports, a -/// string-named variant for unresolved branch patterns. Each -/// payload type lives at a different boundary. -/// - **Pattern 2 (variant-is-data)**: fails. Different payload -/// types per variant; no unified record shape. -/// - **Pattern 3 (algebraic form)**: fails. The eight variants do -/// not factor into a smaller algebra — the three categories -/// above are descriptive groupings, not algebraic dimensions. -/// - **Pattern 4 (dimensional)**: fails. No shared coordinate -/// space across the eight failure modes. -/// -/// Verdict: **🟢 TERMINAL** at PR-B-unwind scope. Future emit -/// extensions (Callable dispatch, Loop emission, multi-target -/// emission shared across emit_rust/emit_go/emit_python) may add -/// new variants, each with its own substrate-extension audit per -/// `M1_DESIGN.md` §8.10. The three categories above are stable; -/// new variants slot into the appropriate one. -/// -/// **`UnsupportedBehavior(String)` payload note.** The string -/// payload is a human-readable description of which shape was -/// hit, not a dispatch key. Callers do not match on the string; -/// they match on the variant tag and treat the string as -/// diagnostic detail. The 🟢 verdict above accounts for it as -/// "category 3 — out-of-scope shape" rather than as a string- -/// dispatch axis. -#[derive(Debug, Clone)] -pub enum EmitError { - /// No `TypeRealization` was declared in rust.dag for the given - /// type declaration. Add a `data rust_*: TypeRealization` entry - /// targeting this declaration to close the gap. - MissingTypeRealization { target: DeclarationId }, - /// No `OperatorRealization` was declared in rust.dag for the - /// given (operand_type, algebra_field) pair. - MissingOperatorRealization { - target: DeclarationId, - op: DeclarationId, - }, - /// No `BehaviorRealization` was declared in rust.dag for the - /// given substrate marker (Bind / Branch / Main). - MissingBehaviorRealization { marker: DeclarationId }, - /// A required substrate marker is absent from `src/v3/spec/v3_l1.dag` - /// — bootstrap couldn't populate the typed handle and the - /// emitter has nothing to dispatch on. The variant identifies - /// which marker by enum tag (not by string), keeping the error - /// specific to substrate, not target-language, problems. - MissingSubstrateMarker(SubstrateMarkerRole), - /// A port has no resolved `TypeShape`, so its primitive - /// declaration can't be looked up in the type realization - /// index. Inference should have driven every port to Resolved - /// before emit runs; reaching this arm is a bug. - UntypedPort(PortId), - /// The DAG carries a behavior variant PR-B doesn't render yet - /// (Loop, user-function Bind, TransformTarget::Callable, etc.). - UnsupportedBehavior(String), - /// A Branch arm's pattern stayed `UnresolvedVariant` past - /// inference — either inference didn't run or the scrutinee's - /// Disj has no matching variant. - UnresolvedBranchPattern { variant_name: String }, - /// A Branch arm resolved to a variant declaration that no longer - /// has a Disj parent. Emit must not fabricate a plausible target - /// identifier when the substrate cannot identify the parent enum. - VariantParentNotFound { variant_id: DeclarationId }, - /// A Branch's scrutinee resolved to a Disj that isn't the v3 - /// `Classical` (Bool) sum — PR-B only emits boolean branches. - /// Carries the scrutinee's resolved variant ids so callers can - /// inspect what the substrate handed them. - NonBooleanBranch { variant_ids: Vec }, - /// A required realization meta-type is missing from the cached - /// substrate. Bootstrap should populate all realization categories - /// from `src/v3/spec/rust.dag`; reaching this arm means the - /// spec file failed to load or the meta-type wasn't declared. - MissingRealizationMeta(RealizationCategory), - /// The target-language syntax bundle is absent from rust.dag. - MissingTargetSyntax(&'static str), - /// The target-language syntax bundle or one of its referenced - /// syntax declarations has the wrong structural shape. - MalformedTargetSyntax { - declaration: DeclarationId, - detail: &'static str, - }, - /// A data item tagged with a realization meta-type carried a - /// wrong-shaped value body or a missing required field. The - /// `lower_record_to_structural` inhabitance check should have - /// caught this at lower time; reaching it at index-build time - /// is a fail-open leak that the index builder fail-closes on. - MalformedRealization { - declaration: DeclarationId, - detail: &'static str, - }, - /// Two realizations in the loaded spec set share the same key - /// (e.g. two `data rust_*: TypeRealization` items both - /// targeting `Int`). Single Authority requires the spec to be - /// unambiguous; collisions are spec bugs. - DuplicateRealization { - declaration: DeclarationId, - detail: &'static str, - }, - /// A user-defined callable's Arrow shape doesn't match the - /// structural invariants the ownership analysis depends on — - /// e.g., the body isn't a `Bind`, or `Bind.params` has fewer - /// ports than the Arrow declares inputs. The IR should be - /// well-formed before emit runs; reaching this arm is an - /// upstream bug, not a spec issue. - MalformedUserDefinedCallable { - declaration: DeclarationId, - detail: &'static str, - }, -} - -/// Typed tag identifying which realization category a -/// `MissingRealizationMeta` error refers to. Three variants, one -/// per meta-type declared in the per-target spec file. Replaces -/// what would otherwise be a string label for the missing role. -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum RealizationCategory { - /// `TypeRealization` — primitive type → target type name. - Type, - /// `TypeInstantiationRealization` — generic template - /// declaration → target instantiated carrier syntax. - TypeInstantiation, - /// `OperatorRealization` — (operand type, algebra field) → - /// target operator symbol. - Operator, - /// `BehaviorRealization` — substrate marker → target template. - Behavior, - /// `CallableRealization` — callable declaration → Rust render - /// strategy. - Callable, - /// `PatternRealization` — structural sum declaration → - /// carrier-specific pattern lowering facts. - Pattern, -} - -/// Typed tag identifying which substrate marker is missing in a -/// `MissingSubstrateMarker` error. Replaces the earlier `role: -/// &'static str` payload so that no name string crosses the -/// substrate/emitter boundary even in error reporting. Display -/// formatting is the consumer's job; this tag is dispatch data. -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum SubstrateMarkerRole { - Bind, - Branch, - Main, -} - -/// Three typed realization indexes built once per `emit_rust` call -/// from rust.dag's data declarations. Each index keyed by the -/// `DeclarationId`s that the substrate already carries — no name -/// strings. -#[derive(Debug, Clone, PartialEq, Eq)] -enum RustFieldAccessBinding { - DirectField(String), - AccessorMethod(String), -} - -#[derive(Debug, Clone)] -struct FieldBindingBinding { - access: RustFieldAccessBinding, - borrowed_read: bool, -} - -#[derive(Debug, Clone)] -struct TypeRealizationBinding { - carrier: String, - is_copy: bool, - fields: HashMap, -} - -#[derive(Debug, Clone)] -struct TypeInstantiationBinding { - carrier: String, -} - -#[allow(clippy::enum_variant_names)] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -enum RustCallableStrategyBinding { - ListEmpty, - ListSingleton, - ListCons, - ListConcat, - ListLength, - ListIsEmpty, - ListFold, - ListMap, - ListFilter, - ListContains, -} - -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -enum ParameterDispositionBinding { - Borrowed, - Consumed, -} - -impl ParameterDispositionBinding { - fn merge(self, other: Self) -> Self { - match (self, other) { - (Self::Consumed, _) | (_, Self::Consumed) => Self::Consumed, - _ => Self::Borrowed, - } - } -} - -#[derive(Debug, Clone)] -struct PatternRealizationBinding { - empty_variant: DeclarationId, - cons_variant: DeclarationId, - scrutinee: String, - empty_pattern: String, - cons_pattern: String, - head_expr: String, - tail_expr: String, -} - -#[derive(Debug, Clone)] -struct StatementSyntaxBinding { - let_binding: String, -} - -#[derive(Debug, Clone)] -struct ExpressionSyntaxBinding { - field_access: String, - function_call: String, - closure: String, -} - -#[derive(Debug, Clone)] -struct ControlFlowSyntaxBinding { - if_else: String, -} - -#[derive(Debug, Clone)] -struct LiteralSyntaxBinding { - true_keyword: String, - false_keyword: String, - string_delimiter: String, -} - -#[derive(Debug, Clone)] -struct ModuleSyntaxBinding { - path_separator: String, -} - -#[derive(Debug, Clone)] -struct FunctionSyntaxBinding { - definition: String, - definition_exported: String, - param_with_type: String, - param_separator: String, -} - -#[derive(Debug, Clone)] -struct TypeApplicationSyntaxBinding { - optional: String, -} - -#[derive(Debug, Clone)] -struct TypeDefinitionSyntaxBinding { - struct_def: String, - struct_field: String, - enum_def: String, - enum_unit_variant: String, - enum_data_variant: String, -} - -#[derive(Debug, Clone)] -struct RecordDeriveTemplateBundleBinding { - struct_def_no_debug: String, - enum_def_no_debug: String, -} - -#[derive(Debug, Clone)] -struct PatternMatchSyntaxBinding { - match_expr: String, - match_arm: String, - variant_pattern: String, - variant_pattern_positional: String, - variant_pattern_empty: String, - field_binding: String, - field_binding_separator: String, - // Wildcard pattern (`_`). Declared by every target spec but - // currently unused by the Rust emitter: multi-field struct-variant - // patterns now alias every field for override routing, and - // zero-binding variant patterns flow through - // `variant_pattern_empty`. Kept on the binding so future emit - // paths (other target languages, partial-match forms) can consume - // it without another spec round-trip. - #[allow(dead_code)] - wildcard: String, -} - -#[derive(Debug, Clone)] -struct CollectionOpsBinding { - concat: String, - length: String, - is_empty: String, - fold: String, - map: String, - filter: String, - contains: String, - empty_list: String, - list_literal: String, - cons: String, -} - -#[derive(Debug, Clone)] -struct ValueConstructionSyntaxBinding { - struct_literal: String, - struct_field_init: String, - struct_field_separator: String, - variant_named_construction: String, -} - -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -enum ReadStrategyBinding { - Borrow, - PassByValue, -} - -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -enum ConstructStrategyBinding { - CopyOrClone, - PassByValue, -} - -#[derive(Debug, Clone)] -struct RenderingModelBinding { - read: ReadStrategyBinding, - construct: ConstructStrategyBinding, -} - -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -enum SourceMutabilityBinding { - Immutable, - Mutable, -} - -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -enum SourcePurityBinding { - Pure, - Effectful, -} - -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -enum SourceStructureBinding { - ExplicitDag, - Arbitrary, -} - -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -enum SourceIterationBinding { - Bounded, - Unbounded, -} - -#[derive(Debug, Clone)] -struct ComputationModelBinding { - mutability: SourceMutabilityBinding, - purity: SourcePurityBinding, - structure: SourceStructureBinding, - iteration: SourceIterationBinding, -} - -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -enum MemoryModelBinding { - ValueOnly, - GarbageCollected, - RefCounted, - OwnershipBased, -} - -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -enum ScopeModelBinding { - LexicalScoping, - DynamicScoping, -} - -#[derive(Debug, Clone)] -struct TargetExecutionModelBinding { - memory: MemoryModelBinding, - scope: ScopeModelBinding, -} - -#[derive(Debug, Clone)] -struct RustLanguageSyntax { - statements: StatementSyntaxBinding, - expressions: ExpressionSyntaxBinding, - control_flow: ControlFlowSyntaxBinding, - literals: LiteralSyntaxBinding, - modules: ModuleSyntaxBinding, - functions: FunctionSyntaxBinding, - type_applications: TypeApplicationSyntaxBinding, - type_definitions: TypeDefinitionSyntaxBinding, - /// From `rust_language.record_derive_templates` (`LanguageSpec` in - /// `emit_model.dag`); Rust data is `rust_record_derive_templates` in - /// `rust.dag` — `RecordDeriveTemplateBundle` (target-neutral; Rust consumes). - record_derive_no_debug: RecordDeriveTemplateBundleBinding, - patterns: PatternMatchSyntaxBinding, - collection_ops: CollectionOpsBinding, - values: ValueConstructionSyntaxBinding, -} - -/// Typed read of `data rust_clean_emission: CleanEmissionContract` -/// from `src/v3/spec/rust.dag` — the portion this pilot consumes -/// (E-5 / Lane 1 Stage 1c PR 1). Other contract rules land here as -/// their consumers wire in. -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -struct CleanEmissionContractBinding { - pattern_bindings: PatternBindingRuleBinding, - variant_payload_field_access: VariantPayloadFieldAccessRuleBinding, -} - -/// Rust-valid slice of `std.clean_emission.PatternBindingRule`. -/// Parsed in `CleanEmissionContractBinding::build`, which rejects -/// target-invalid constructors instead of letting the renderer -/// normalize them later. -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -enum PatternBindingRuleBinding { - EmitBindingAlways, - EmitUnderscoreWhenUnused, -} - -struct RealizationIndexes { - /// `target_decl_id → carrier + field bindings`. Built from - /// `data rust_*: TypeRealization` items in rust.dag. - types: HashMap, - /// `generic_template_decl → instantiated carrier syntax`. - /// Built from `data rust_*: TypeInstantiationRealization` - /// items in rust.dag. Used when rendering generic carriers - /// such as `List -> Vec` without template-name string - /// dispatch in Rust. - instantiations: HashMap, - /// `(operand_type_decl, algebra_field_decl) → carrier`. Built - /// from `data rust_*: OperatorRealization` items in rust.dag. - /// Used when emitting a `Transform { target: Operator(_), .. }`. - operators: HashMap<(DeclarationId, DeclarationId), String>, - /// `behavior_marker_decl → carrier`. Built from `data rust_*: - /// BehaviorRealization` items in rust.dag. Used when emitting - /// the substrate behaviors (let / if-else / main wrapper). The - /// key declaration ids come from `src/v3/spec/v3_l1.dag` markers - /// cached in `Dag::substrate_markers` — every dispatch site - /// reads those typed handles instead of looking up by name. - behaviors: HashMap, - /// `callable_decl → render strategy`. Built from `data rust_*: - /// CallableRealization` items in rust.dag. Used when emitting - /// callable transforms without name-keyed builtin dispatch. - callables: HashMap, - /// `callable_decl → per-runtime-input ownership disposition`. - /// External callables read this directly from rust.dag; user- - /// defined callables derive it from their body DAG via a - /// monotone body walk. - callable_dispositions: HashMap>, - /// `structural_sum_decl → carrier pattern lowering facts`. - /// Built from `data rust_*: PatternRealization` items in - /// rust.dag. Used when a structural match lowers against a - /// realized container carrier rather than a native Rust enum. - patterns: HashMap, - /// DB-14: `accessor_decl → realization_decl` for the active - /// Rust target. Built from `data *: SubstrateAccessorBinding` - /// records filtered by `language == rust_language`. Used by - /// `render_substrate_accessor` on every Callable Transform: if - /// the callable's target is in this map, render the - /// realization's `carrier` template; otherwise fall through to - /// normal callable dispatch. Replaces the earlier design that - /// upgraded accessor Arrow bodies to `ExternalRealization` at - /// bootstrap, which silently dropped target selection (review - /// round 1b.3 root cause). - substrate_accessors: HashMap, - /// DB-14 coverage set: every accessor declaration referenced by - /// **any** `SubstrateAccessorBinding` record, across all target - /// languages. `render_substrate_accessor` uses this to - /// distinguish "callable target is not a substrate accessor at - /// all" (fall through to normal dispatch) from "declared - /// substrate accessor, but no binding for the active target" - /// (fail-closed `EmitError::MissingSubstrateAccessorRealization`). - /// Post review round 1b.3: a missing active-target realization - /// must be a hard emit error, not a silent fall-through that - /// would emit `func(args)` for a function Rust doesn't have. - substrate_accessor_universe: HashSet, - /// The Rust target-language syntax bundle loaded from - /// `data rust_language: LanguageSpec`. - syntax: RustLanguageSyntax, - /// The Rust target-language ownership rendering model loaded - /// from `data rust_rendering: RenderingModel`. - rendering: RenderingModelBinding, - /// The source-side `.dag` computation model loaded from - /// `data dag_model: ComputationModel`. - computation: ComputationModelBinding, - /// The target-side Rust execution model loaded from - /// `data rust_execution_model: TargetExecutionModel`. - execution: TargetExecutionModelBinding, - /// Source exclusion policy loaded from - /// `data rust_source_filtering: ShapeATargetSourceFiltering`. - source_filtering: SourceFilteringBinding, - /// The Rust clean-emission contract loaded from - /// `data rust_clean_emission: CleanEmissionContract` (E-5 / - /// Lane 1 Stage 1c). Rule variants dispatch inside the emitter - /// to shape emitted code so it passes `rustc -D warnings` by - /// construction. - clean_emission: CleanEmissionContractBinding, -} - -#[allow(dead_code)] -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -enum InputSlot { - Positional(usize), - BranchInput, - LoopSource, - LoopInit, - LoopBoundCount, -} - -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -struct InputUseKey { - consumer: crate::dag::NodeId, - slot: InputSlot, -} - -#[derive(Debug, Clone, Default)] -struct InputUseFacts { - /// Per-edge total ordering across all input slots in the DAG. - /// Includes every consumer/slot — Borrowed and Consumed alike. - edge_order: HashMap, - /// Per-port, the order of the LAST edge that touches the port — - /// regardless of whether that edge is a Borrow or a Consume. - /// "Safe to move at edge E" requires E's order equal this value: - /// any later use (borrow or consume) makes the move unsafe. - last_use_order_by_port: HashMap, -} - -impl RealizationIndexes { - /// Build the typed indexes from rust.dag's data - /// declarations. **Fail-closed at every step.** Returns - /// `Err(EmitError)` if: - /// - /// - The realization meta-type cache is unpopulated (a - /// bootstrap failure earlier in the pipeline; rust.dag - /// didn't load). - /// - A declaration tagged with one of the realization - /// meta-types is missing a required field (target / op / - /// carrier) or carries a wrong-shaped field value. This - /// is a spec-file consistency error that the lower-time - /// inhabitance check would normally surface — reaching - /// this path here means the inhabitance check let - /// something through and we want a loud failure, not a - /// silent skip. - /// - Two realizations share the same key (e.g. two - /// `data rust_*: TypeRealization` items both targeting - /// `Int`). Single Authority requires the spec to be - /// unambiguous; collisions are spec bugs. - /// - /// The pre-unwind silent-skip + silent-overwrite shape was - /// flagged in PR #445 review as fail-open behavior at the - /// realization boundary. This function is the explicit - /// fail-closed counterpart. - fn build(dag: &Dag) -> Result { - // Read the cached realization meta-type handles. These - // are populated at bootstrap end via - // `populate_primitive_cache` from `src/v3/spec/rust.dag`'s - // top-level `type TypeRealization { ... }` declarations. - // Reading them via the typed accessor keeps emit_rust - // free of any name-string lookup: the meta-type identity - // is a `DeclarationId` from the moment the index builds. - let type_meta = dag - .type_realization_meta() - .ok_or(EmitError::MissingRealizationMeta(RealizationCategory::Type))?; - let type_instantiation_meta = - dag.type_instantiation_realization_meta() - .ok_or(EmitError::MissingRealizationMeta( - RealizationCategory::TypeInstantiation, - ))?; - let op_meta = dag - .operator_realization_meta() - .ok_or(EmitError::MissingRealizationMeta( - RealizationCategory::Operator, - ))?; - let behavior_meta = - dag.behavior_realization_meta() - .ok_or(EmitError::MissingRealizationMeta( - RealizationCategory::Behavior, - ))?; - let callable_meta = - dag.callable_realization_meta() - .ok_or(EmitError::MissingRealizationMeta( - RealizationCategory::Callable, - ))?; - let pattern_meta = - dag.pattern_realization_meta() - .ok_or(EmitError::MissingRealizationMeta( - RealizationCategory::Pattern, - ))?; - - let mut types: HashMap = HashMap::new(); - let mut instantiations: HashMap = HashMap::new(); - let mut operators: HashMap<(DeclarationId, DeclarationId), String> = HashMap::new(); - let mut behaviors: HashMap = HashMap::new(); - let mut callables: HashMap = HashMap::new(); - let mut external_callable_dispositions: HashMap< - DeclarationId, - Vec, - > = HashMap::new(); - let mut patterns: HashMap = HashMap::new(); - - // Cache the Rust language-spec declaration id once; shared - // realizations reference it via `language: DeclarationRef` - // and this emitter picks up only entries that match. - // Replaces the previous TargetLanguage enum roster with a - // declaration-identity compare (INVARIANTS.md E-6: target - // ownership is carried by a typed edge, not a compiler-side - // variant list). - let rust_language_id = dag - .rust_language_spec() - .ok_or(EmitError::MissingTargetSyntax("rust_language"))?; - - for decl in dag.declarations() { - let Some(meta_tag) = decl.meta_tag else { - continue; - }; - // Determine which realization category this declaration - // belongs to (if any). Comparing typed handles, no name - // matching. - let category = if meta_tag == type_meta { - RealizationCategory::Type - } else if meta_tag == type_instantiation_meta { - RealizationCategory::TypeInstantiation - } else if meta_tag == op_meta { - RealizationCategory::Operator - } else if meta_tag == behavior_meta { - RealizationCategory::Behavior - } else if meta_tag == callable_meta { - RealizationCategory::Callable - } else if meta_tag == pattern_meta { - RealizationCategory::Pattern - } else { - continue; - }; - let Some(ValueBody::Structural { fields }) = &decl.value_body else { - // A data item tagged with a realization meta-type - // must have a Structural value_body. If it's - // Unparsed, the inhabitance check let a malformed - // spec entry through — fail-closed so the spec - // inconsistency surfaces loudly. - return Err(EmitError::MalformedRealization { - declaration: decl.id, - detail: - "realization data item has no Structural value_body — bootstrap inhabitance check missed a malformed spec entry", - }); - }; - - // Skip realizations declared for other shared targets - // (e.g. Go) by comparing the typed `language` field to - // this emitter's cached language-spec declaration id. - // Replaces the previous TargetLanguage enum roster; adding - // a new shared target is now a pure spec-file change. - let language_ref = require_field_decl_ref(fields, "language", decl.id)?; - if language_ref != rust_language_id { - continue; - } - - // Required for every category. Missing → fail-closed - // (the inhabitance check would normally surface a - // diagnostic at lower time; reaching this point means - // the spec violates its own meta-type and we should - // refuse to silently skip it). - let target = require_field_decl_ref(fields, "target", decl.id)?; - - match category { - RealizationCategory::Type => { - let carrier = require_field_string(fields, "carrier", decl.id)?; - let field_bindings = require_field_bindings(dag, fields, decl.id)?; - if types - .insert( - target, - TypeRealizationBinding { - carrier, - is_copy: require_field_bool(fields, "is_copy", decl.id)?, - fields: field_bindings, - }, - ) - .is_some() - { - return Err(EmitError::DuplicateRealization { - declaration: decl.id, - detail: - "two TypeRealization data items target the same primitive — single authority requires unique targets", - }); - } - } - RealizationCategory::TypeInstantiation => { - let carrier = require_field_string(fields, "carrier", decl.id)?; - if instantiations - .insert(target, TypeInstantiationBinding { carrier }) - .is_some() - { - return Err(EmitError::DuplicateRealization { - declaration: decl.id, - detail: - "two TypeInstantiationRealization data items target the same generic declaration — single authority requires unique targets", - }); - } - } - RealizationCategory::Operator => { - let carrier = require_field_string(fields, "carrier", decl.id)?; - if !carrier.contains("{lhs}") || !carrier.contains("{rhs}") { - return Err(EmitError::MalformedRealization { - declaration: decl.id, - detail: "OperatorRealization carrier must be a full-expression template containing {lhs} and {rhs}", - }); - } - let op = require_field_decl_ref(fields, "op", decl.id)?; - if operators.insert((target, op), carrier).is_some() { - return Err(EmitError::DuplicateRealization { - declaration: decl.id, - detail: - "two OperatorRealization data items share the same (target, op) pair — single authority requires unique keys", - }); - } - } - RealizationCategory::Behavior => { - let carrier = require_field_string(fields, "carrier", decl.id)?; - if behaviors.insert(target, carrier).is_some() { - return Err(EmitError::DuplicateRealization { - declaration: decl.id, - detail: - "two BehaviorRealization data items target the same substrate marker — single authority requires unique targets", - }); - } - } - RealizationCategory::Callable => { - let strategy = require_callable_strategy(dag, fields, decl.id)?; - let expected_arity = match &dag.declaration(target).connective { - TypeConnective::Arrow { inputs, .. } => inputs.len(), - _ => { - return Err(EmitError::MalformedRealization { - declaration: decl.id, - detail: "CallableRealization target must be an Arrow declaration", - }) - } - }; - let dispositions = - require_parameter_dispositions(dag, fields, decl.id, expected_arity)?; - if callables.insert(target, strategy).is_some() { - return Err(EmitError::DuplicateRealization { - declaration: decl.id, - detail: - "two CallableRealization data items target the same callable declaration — single authority requires unique targets", - }); - } - if external_callable_dispositions - .insert(target, dispositions) - .is_some() - { - return Err(EmitError::DuplicateRealization { - declaration: decl.id, - detail: - "two CallableRealization data items target the same callable declaration's parameter dispositions — single authority requires unique targets", - }); - } - } - RealizationCategory::Pattern => { - let binding = require_pattern_realization(dag, fields, decl.id)?; - validate_pattern_roles(dag, target, &binding, decl.id)?; - if patterns.insert(target, binding).is_some() { - return Err(EmitError::DuplicateRealization { - declaration: decl.id, - detail: - "two PatternRealization data items target the same structural sum declaration — single authority requires unique targets", - }); - } - } - } - } - - let syntax = RustLanguageSyntax::build(dag)?; - let rendering = RenderingModelBinding::build(dag)?; - let computation = ComputationModelBinding::build(dag)?; - let execution = TargetExecutionModelBinding::build(dag)?; - let source_filtering = SourceFilteringBinding::build( - dag, - dag.rust_source_filtering_spec() - .ok_or(EmitError::MissingTargetSyntax("rust_source_filtering"))?, - )?; - let clean_emission = CleanEmissionContractBinding::build(dag)?; - let callable_dispositions = - derive_callable_dispositions(dag, &external_callable_dispositions)?; - let (substrate_accessors, substrate_accessor_universe) = - build_substrate_accessor_index(dag, rust_language_id)?; - - Ok(Self { - types, - instantiations, - operators, - behaviors, - callables, - callable_dispositions, - patterns, - syntax, - rendering, - computation, - execution, - source_filtering, - clean_emission, - substrate_accessors, - substrate_accessor_universe, - }) - } -} - -impl CleanEmissionContractBinding { - /// Parse the portion of `data rust_clean_emission: - /// CleanEmissionContract` this emitter consumes. Currently only - /// `pattern_bindings` and `variant_payload_field_access` - /// dispatch; other rules parse when their consumers land. - fn build(dag: &Dag) -> Result { - let declaration = dag - .rust_clean_emission_spec() - .ok_or(EmitError::MissingTargetSyntax("rust_clean_emission"))?; - let fields = structural_fields_for_decl(dag, declaration)?; - let pattern_bindings_value = fields - .iter() - .find(|(label, _)| label == "pattern_bindings") - .map(|(_, value)| value) - .ok_or(EmitError::MalformedTargetSyntax { - declaration, - detail: "rust_clean_emission is missing required `pattern_bindings` field", - })?; - let pattern_bindings = - parse_pattern_binding_rule(dag, pattern_bindings_value, declaration)?; - let variant_payload_field_access_value = fields - .iter() - .find(|(label, _)| label == "variant_payload_field_access") - .map(|(_, value)| value) - .ok_or(EmitError::MalformedTargetSyntax { - declaration, - detail: - "rust_clean_emission is missing required `variant_payload_field_access` field", - })?; - let variant_payload_field_access = parse_variant_payload_field_access_rule( - dag, - variant_payload_field_access_value, - declaration, - )?; - Ok(Self { - pattern_bindings, - variant_payload_field_access, - }) - } -} - -fn parse_pattern_binding_rule( - dag: &Dag, - value: &FieldValue, - declaration: DeclarationId, -) -> Result { - let FieldValue::Variant { - constructor, - payload, - } = value - else { - return Err(EmitError::MalformedTargetSyntax { - declaration, - detail: "rust_clean_emission.pattern_bindings must be a PatternBindingRule variant", - }); - }; - if !payload.is_empty() { - return Err(EmitError::MalformedTargetSyntax { - declaration, - detail: "PatternBindingRule variants must not carry payload fields", - }); - } - let variants = dag.pattern_binding_rule_variants(); - let emit_always = variants - .emit_always - .ok_or(EmitError::MalformedTargetSyntax { - declaration, - detail: "PatternBindingRule.EmitBindingAlways declaration was not found", - })?; - let emit_underscore = variants - .emit_underscore - .ok_or(EmitError::MalformedTargetSyntax { - declaration, - detail: "PatternBindingRule.EmitUnderscoreWhenUnused declaration was not found", - })?; - let emit_prefixed = variants - .emit_prefixed - .ok_or(EmitError::MalformedTargetSyntax { - declaration, - detail: "PatternBindingRule.EmitPrefixedUnderscoreWhenUnused declaration was not found", - })?; - let not_applicable = variants - .not_applicable - .ok_or(EmitError::MalformedTargetSyntax { - declaration, - detail: "PatternBindingRule.NotApplicablePatternBinding declaration was not found", - })?; - if *constructor == emit_always { - Ok(PatternBindingRuleBinding::EmitBindingAlways) - } else if *constructor == emit_underscore { - Ok(PatternBindingRuleBinding::EmitUnderscoreWhenUnused) - } else if *constructor == emit_prefixed { - Err(EmitError::MalformedTargetSyntax { - declaration, - detail: "rust_clean_emission.pattern_bindings cannot use PatternBindingRule.EmitPrefixedUnderscoreWhenUnused; Rust only supports EmitBindingAlways or EmitUnderscoreWhenUnused", - }) - } else if *constructor == not_applicable { - Err(EmitError::MalformedTargetSyntax { - declaration, - detail: "rust_clean_emission.pattern_bindings cannot use PatternBindingRule.NotApplicablePatternBinding; Rust only supports EmitBindingAlways or EmitUnderscoreWhenUnused", - }) - } else { - Err(EmitError::MalformedTargetSyntax { - declaration, - detail: "rust_clean_emission.pattern_bindings constructor is not a known PatternBindingRule variant", - }) - } -} - -fn parse_variant_payload_field_access_rule( - dag: &Dag, - value: &FieldValue, - declaration: DeclarationId, -) -> Result { - let FieldValue::Variant { - constructor, - payload, - } = value - else { - return Err(EmitError::MalformedTargetSyntax { - declaration, - detail: - "rust_clean_emission.variant_payload_field_access must be a VariantPayloadFieldAccessRule variant", - }); - }; - if !payload.is_empty() { - return Err(EmitError::MalformedTargetSyntax { - declaration, - detail: "VariantPayloadFieldAccessRule variants must not carry payload fields", - }); - } - let variants = dag.variant_payload_field_access_rule_variants(); - let access_from_payload_binding = - variants - .access_from_payload_binding - .ok_or(EmitError::MalformedTargetSyntax { - declaration, - detail: - "VariantPayloadFieldAccessRule.AccessFromPayloadBinding declaration was not found", - })?; - let override_named_fields_at_binding_site = variants - .override_named_fields_at_binding_site - .ok_or(EmitError::MalformedTargetSyntax { - declaration, - detail: "VariantPayloadFieldAccessRule.OverrideNamedFieldsAtBindingSite declaration was not found", - })?; - if *constructor == override_named_fields_at_binding_site { - Ok(VariantPayloadFieldAccessRuleBinding::OverrideNamedFieldsAtBindingSite) - } else if *constructor == access_from_payload_binding { - Err(EmitError::MalformedTargetSyntax { - declaration, - detail: "rust_clean_emission.variant_payload_field_access cannot use VariantPayloadFieldAccessRule.AccessFromPayloadBinding; Rust requires OverrideNamedFieldsAtBindingSite for named payloads", - }) - } else { - Err(EmitError::MalformedTargetSyntax { - declaration, - detail: "rust_clean_emission.variant_payload_field_access constructor is not a known VariantPayloadFieldAccessRule variant", - }) - } -} - -/// DB-14: build `(accessor_decl → realization_decl, universe)` for -/// the active target language. -/// -/// The map is the per-language lookup used by -/// `render_substrate_accessor` when a callable target IS bound for -/// the active target. The universe is every accessor referenced by -/// any `SubstrateAccessorBinding` across all target languages — it -/// lets the emitter distinguish "callable isn't a substrate -/// accessor at all" (fall through) from "declared substrate -/// accessor, but no binding for this target" (fail closed). -/// -/// Single-authority enforcement: duplicate `(accessor × language)` -/// pairs fail closed with `EmitError::DuplicateRealization`. -fn build_substrate_accessor_index( - dag: &Dag, - target_language_id: DeclarationId, -) -> Result< - ( - HashMap, - HashSet, - ), - EmitError, -> { - let mut index: HashMap = HashMap::new(); - let mut universe: HashSet = HashSet::new(); - let Some(binding_meta_id) = dag.substrate_accessor_binding_meta() else { - // No substrate accessor binding type — pre-DB-14 bootstrap - // or a minimal fixture that didn't load substrate.dag. Empty - // universe means render_substrate_accessor falls through on - // every callable, matching pre-DB-14 behavior. - return Ok((index, universe)); - }; - for decl in dag.declarations() { - if decl.meta_tag != Some(binding_meta_id) { - continue; - } - let Some(ValueBody::Structural { fields }) = &decl.value_body else { - return Err(EmitError::MalformedRealization { - declaration: decl.id, - detail: - "SubstrateAccessorBinding data item has no Structural value_body — bootstrap inhabitance check missed a malformed spec entry", - }); - }; - let accessor = require_field_decl_ref(fields, "accessor", decl.id)?; - universe.insert(accessor); - let language = require_field_decl_ref(fields, "language", decl.id)?; - if language != target_language_id { - continue; - } - let realization = require_field_decl_ref(fields, "realization", decl.id)?; - if index.insert(accessor, realization).is_some() { - return Err(EmitError::DuplicateRealization { - declaration: decl.id, - detail: - "two SubstrateAccessorBinding data items target the same accessor × language pair — single authority requires a unique realization per target language", - }); - } - } - Ok((index, universe)) -} - -impl RenderingModelBinding { - fn build(dag: &Dag) -> Result { - let rendering_decl = dag - .rust_rendering_spec() - .ok_or(EmitError::MissingTargetSyntax("rust_rendering"))?; - let fields = structural_fields_for_decl(dag, rendering_decl)?; - Ok(Self { - read: require_read_strategy(dag, fields, "read", rendering_decl)?, - construct: require_construct_strategy(dag, fields, "construct", rendering_decl)?, - }) - } -} - -impl ComputationModelBinding { - fn build(dag: &Dag) -> Result { - let declaration = dag - .computation_model_spec() - .ok_or(EmitError::MissingTargetSyntax("dag_model"))?; - let fields = structural_fields_for_decl(dag, declaration)?; - Ok(Self { - mutability: require_source_mutability(dag, fields, declaration)?, - purity: require_source_purity(dag, fields, declaration)?, - structure: require_source_structure(dag, fields, declaration)?, - iteration: require_source_iteration(dag, fields, declaration)?, - }) - } - - fn is_canonical_dag(&self) -> bool { - self.mutability == SourceMutabilityBinding::Immutable - && self.purity == SourcePurityBinding::Pure - && self.structure == SourceStructureBinding::ExplicitDag - && self.iteration == SourceIterationBinding::Bounded - } -} - -impl TargetExecutionModelBinding { - fn build(dag: &Dag) -> Result { - let declaration = dag - .rust_execution_model_spec() - .ok_or(EmitError::MissingTargetSyntax("rust_execution_model"))?; - let fields = structural_fields_for_decl(dag, declaration)?; - Ok(Self { - memory: require_memory_model(dag, fields, declaration)?, - scope: require_scope_model(dag, fields, declaration)?, - }) - } - - fn is_ownership_based(&self) -> bool { - self.memory == MemoryModelBinding::OwnershipBased - } - - fn is_lexically_scoped(&self) -> bool { - self.scope == ScopeModelBinding::LexicalScoping - } -} - -impl InputUseFacts { - fn build(dag: &Dag, _indexes: &RealizationIndexes) -> Self { - let mut facts = Self::default(); - let mut order = 0usize; - - // Record every edge — Borrowed and Consumed — so the - // last-use check can see borrows that come after consumes - // (a later borrow makes a move unsafe even though it isn't - // itself a consume). - let mut record = |port: PortId, key: InputUseKey, order: &mut usize| { - facts.edge_order.insert(key, *order); - facts.last_use_order_by_port.insert(port, *order); - *order += 1; - }; - - for node in dag.nodes() { - match node { - Behavior::Transform(transform) => { - for (slot, &port) in transform.inputs.iter().enumerate() { - let key = InputUseKey { - consumer: transform.id, - slot: InputSlot::Positional(slot), - }; - record(port, key, &mut order); - } - } - Behavior::Branch(branch) => { - let key = InputUseKey { - consumer: branch.id, - slot: InputSlot::BranchInput, - }; - record(branch.input, key, &mut order); - } - Behavior::Loop(loop_node) => { - for (slot, port) in [ - (InputSlot::LoopSource, Some(loop_node.source)), - (InputSlot::LoopInit, Some(loop_node.init)), - (InputSlot::LoopBoundCount, loop_node.bound.count_port()), - ] { - let Some(port) = port else { - continue; - }; - let key = InputUseKey { - consumer: loop_node.id, - slot, - }; - record(port, key, &mut order); - } - } - Behavior::Value(_) | Behavior::Bind(_) => {} - } - } - - facts - } -} - -impl RustLanguageSyntax { - fn build(dag: &Dag) -> Result { - let language_decl = dag - .rust_language_spec() - .ok_or(EmitError::MissingTargetSyntax("rust_language"))?; - let fields = structural_fields_for_decl(dag, language_decl)?; - Ok(Self { - statements: parse_statement_syntax( - dag, - require_field_decl_ref(fields, "statements", language_decl)?, - )?, - expressions: parse_expression_syntax( - dag, - require_field_decl_ref(fields, "expressions", language_decl)?, - )?, - control_flow: parse_control_flow_syntax( - dag, - require_field_decl_ref(fields, "control_flow", language_decl)?, - )?, - literals: parse_literal_syntax( - dag, - require_field_decl_ref(fields, "literals", language_decl)?, - )?, - modules: parse_module_syntax( - dag, - require_field_decl_ref(fields, "modules", language_decl)?, - )?, - functions: parse_function_syntax( - dag, - require_field_decl_ref(fields, "functions", language_decl)?, - )?, - type_applications: parse_type_application_syntax( - dag, - require_field_decl_ref(fields, "type_applications", language_decl)?, - )?, - type_definitions: parse_type_definition_syntax( - dag, - require_field_decl_ref(fields, "type_definitions", language_decl)?, - )?, - record_derive_no_debug: parse_record_derive_template_bundle( - dag, - require_field_decl_ref(fields, "record_derive_templates", language_decl)?, - )?, - patterns: parse_pattern_match_syntax( - dag, - require_field_decl_ref(fields, "patterns", language_decl)?, - )?, - collection_ops: parse_collection_ops( - dag, - require_field_decl_ref(fields, "collection_ops", language_decl)?, - )?, - values: parse_value_construction_syntax( - dag, - require_field_decl_ref(fields, "values", language_decl)?, - )?, - }) - } -} - -fn structural_fields_for_decl( - dag: &Dag, - declaration: DeclarationId, -) -> Result<&[(String, FieldValue)], EmitError> { - let Some(ValueBody::Structural { fields }) = &dag.declaration(declaration).value_body else { - return Err(EmitError::MalformedTargetSyntax { - declaration, - detail: "syntax declaration must carry a structural value body", - }); - }; - Ok(fields) -} - -fn syntax_field_string( - fields: &[(String, FieldValue)], - label: &str, - declaration: DeclarationId, -) -> Result { - require_field_string(fields, label, declaration).map(|s| s.replace("%Q", "\"")) -} - -fn parse_statement_syntax( - dag: &Dag, - declaration: DeclarationId, -) -> Result { - let fields = structural_fields_for_decl(dag, declaration)?; - Ok(StatementSyntaxBinding { - let_binding: syntax_field_string(fields, "let_binding", declaration)?, - }) -} - -fn parse_expression_syntax( - dag: &Dag, - declaration: DeclarationId, -) -> Result { - let fields = structural_fields_for_decl(dag, declaration)?; - Ok(ExpressionSyntaxBinding { - field_access: syntax_field_string(fields, "field_access", declaration)?, - function_call: syntax_field_string(fields, "function_call", declaration)?, - closure: syntax_field_string(fields, "closure", declaration)?, - }) -} - -fn parse_control_flow_syntax( - dag: &Dag, - declaration: DeclarationId, -) -> Result { - let fields = structural_fields_for_decl(dag, declaration)?; - Ok(ControlFlowSyntaxBinding { - if_else: syntax_field_string(fields, "if_else", declaration)?, - }) -} - -fn parse_literal_syntax( - dag: &Dag, - declaration: DeclarationId, -) -> Result { - let fields = structural_fields_for_decl(dag, declaration)?; - Ok(LiteralSyntaxBinding { - true_keyword: syntax_field_string(fields, "true_keyword", declaration)?, - false_keyword: syntax_field_string(fields, "false_keyword", declaration)?, - string_delimiter: syntax_field_string(fields, "string_delimiter", declaration)?, - }) -} - -fn parse_module_syntax( - dag: &Dag, - declaration: DeclarationId, -) -> Result { - let fields = structural_fields_for_decl(dag, declaration)?; - Ok(ModuleSyntaxBinding { - path_separator: syntax_field_string(fields, "path_separator", declaration)?, - }) -} - -fn parse_function_syntax( - dag: &Dag, - declaration: DeclarationId, -) -> Result { - let fields = structural_fields_for_decl(dag, declaration)?; - Ok(FunctionSyntaxBinding { - definition: syntax_field_string(fields, "definition", declaration)?, - definition_exported: syntax_field_string(fields, "definition_exported", declaration)?, - param_with_type: syntax_field_string(fields, "param_with_type", declaration)?, - param_separator: syntax_field_string(fields, "param_separator", declaration)?, - }) -} - -fn parse_type_application_syntax( - dag: &Dag, - declaration: DeclarationId, -) -> Result { - let fields = structural_fields_for_decl(dag, declaration)?; - Ok(TypeApplicationSyntaxBinding { - optional: syntax_field_string(fields, "optional", declaration)?, - }) -} - -fn parse_type_definition_syntax( - dag: &Dag, - declaration: DeclarationId, -) -> Result { - let fields = structural_fields_for_decl(dag, declaration)?; - Ok(TypeDefinitionSyntaxBinding { - struct_def: syntax_field_string(fields, "struct_def", declaration)?, - struct_field: syntax_field_string(fields, "struct_field", declaration)?, - enum_def: syntax_field_string(fields, "enum_def", declaration)?, - enum_unit_variant: syntax_field_string(fields, "enum_unit_variant", declaration)?, - enum_data_variant: syntax_field_string(fields, "enum_data_variant", declaration)?, - }) -} - -fn parse_record_derive_template_bundle( - dag: &Dag, - declaration: DeclarationId, -) -> Result { - let fields = structural_fields_for_decl(dag, declaration)?; - Ok(RecordDeriveTemplateBundleBinding { - struct_def_no_debug: syntax_field_string(fields, "struct_def_no_debug", declaration)?, - enum_def_no_debug: syntax_field_string(fields, "enum_def_no_debug", declaration)?, - }) -} - -fn parse_pattern_match_syntax( - dag: &Dag, - declaration: DeclarationId, -) -> Result { - let fields = structural_fields_for_decl(dag, declaration)?; - Ok(PatternMatchSyntaxBinding { - match_expr: syntax_field_string(fields, "match_expr", declaration)?, - match_arm: syntax_field_string(fields, "match_arm", declaration)?, - variant_pattern: syntax_field_string(fields, "variant_pattern", declaration)?, - variant_pattern_positional: syntax_field_string( - fields, - "variant_pattern_positional", - declaration, - )?, - variant_pattern_empty: syntax_field_string(fields, "variant_pattern_empty", declaration)?, - field_binding: syntax_field_string(fields, "field_binding", declaration)?, - field_binding_separator: syntax_field_string( - fields, - "field_binding_separator", - declaration, - )?, - wildcard: syntax_field_string(fields, "wildcard", declaration)?, - }) -} - -fn parse_collection_ops( - dag: &Dag, - declaration: DeclarationId, -) -> Result { - let fields = structural_fields_for_decl(dag, declaration)?; - - let concat_method_decl = dag - .concat_method_decl() - .ok_or(EmitError::MalformedTargetSyntax { - declaration, - detail: "internal: concat_method missing from std.methods registry", - })?; - let length_method_decl = dag - .length_method_decl() - .ok_or(EmitError::MalformedTargetSyntax { - declaration, - detail: "internal: length_method missing from std.methods registry", - })?; - let fold_method_decl = dag - .fold_method_decl() - .ok_or(EmitError::MalformedTargetSyntax { - declaration, - detail: "internal: fold_method missing from std.methods registry", - })?; - let is_empty_method_decl = - dag.is_empty_method_decl() - .ok_or(EmitError::MalformedTargetSyntax { - declaration, - detail: "internal: is_empty_method missing from std.methods registry", - })?; - let filter_method_decl = dag - .filter_method_decl() - .ok_or(EmitError::MalformedTargetSyntax { - declaration, - detail: "internal: filter_method missing from std.methods registry", - })?; - let flat_map_method_decl = - dag.flat_map_method_decl() - .ok_or(EmitError::MalformedTargetSyntax { - declaration, - detail: "internal: flat_map_method missing from std.methods registry", - })?; - let any_method_decl = dag - .any_method_decl() - .ok_or(EmitError::MalformedTargetSyntax { - declaration, - detail: "internal: any_method missing from std.methods registry", - })?; - let all_method_decl = dag - .all_method_decl() - .ok_or(EmitError::MalformedTargetSyntax { - declaration, - detail: "internal: all_method missing from std.methods registry", - })?; - - let concat_contract = require_field_decl_ref(fields, "concat_contract", declaration)?; - let concat_template = method_template_contract_decl_emit_template( - dag, - concat_contract, - "concat_contract", - concat_method_decl, - ) - .map_err(|detail| EmitError::MalformedTargetSyntax { - declaration: concat_contract, - detail, - })?; - let concat = require_single_template(concat_template, concat_contract)?; - - let length_contract = require_field_decl_ref(fields, "length_contract", declaration)?; - let length_template = method_template_contract_decl_emit_template( - dag, - length_contract, - "length_contract", - length_method_decl, - ) - .map_err(|detail| EmitError::MalformedTargetSyntax { - declaration: length_contract, - detail, - })?; - let length = require_single_template(length_template, length_contract)?; - - let is_empty_contract = require_field_decl_ref(fields, "is_empty_contract", declaration)?; - let is_empty_template = method_template_contract_decl_emit_template( - dag, - is_empty_contract, - "is_empty_contract", - is_empty_method_decl, - ) - .map_err(|detail| EmitError::MalformedTargetSyntax { - declaration: is_empty_contract, - detail, - })?; - let is_empty = require_single_template(is_empty_template, is_empty_contract)?; - - let fold_contract = require_field_decl_ref(fields, "fold_contract", declaration)?; - let fold_template = method_template_contract_decl_emit_template( - dag, - fold_contract, - "fold_contract", - fold_method_decl, - ) - .map_err(|detail| EmitError::MalformedTargetSyntax { - declaration: fold_contract, - detail, - })?; - let fold = require_single_template(fold_template, fold_contract)?; - - let filter_contract = require_field_decl_ref(fields, "filter_contract", declaration)?; - let filter_template = method_template_contract_decl_emit_template( - dag, - filter_contract, - "filter_contract", - filter_method_decl, - ) - .map_err(|detail| EmitError::MalformedTargetSyntax { - declaration: filter_contract, - detail, - })?; - let filter = require_higher_order_inline_template(filter_template, filter_contract)?; - - let flat_map_contract = require_field_decl_ref(fields, "flat_map_contract", declaration)?; - let flat_map_template = method_template_contract_decl_emit_template( - dag, - flat_map_contract, - "flat_map_contract", - flat_map_method_decl, - ) - .map_err(|detail| EmitError::MalformedTargetSyntax { - declaration: flat_map_contract, - detail, - })?; - require_higher_order_inline_template(flat_map_template, flat_map_contract)?; - - let any_contract = require_field_decl_ref(fields, "any_contract", declaration)?; - let any_template = method_template_contract_decl_emit_template( - dag, - any_contract, - "any_contract", - any_method_decl, - ) - .map_err(|detail| EmitError::MalformedTargetSyntax { - declaration: any_contract, - detail, - })?; - require_higher_order_inline_template(any_template, any_contract)?; - - let all_contract = require_field_decl_ref(fields, "all_contract", declaration)?; - let all_template = method_template_contract_decl_emit_template( - dag, - all_contract, - "all_contract", - all_method_decl, - ) - .map_err(|detail| EmitError::MalformedTargetSyntax { - declaration: all_contract, - detail, - })?; - require_higher_order_inline_template(all_template, all_contract)?; - - let map_method_decl = dag - .map_method_decl() - .ok_or(EmitError::MalformedTargetSyntax { - declaration, - detail: "internal: map_method missing from std.methods registry", - })?; - let map_contract = require_field_decl_ref(fields, "map_contract", declaration)?; - let map_template = method_template_contract_decl_emit_template( - dag, - map_contract, - "map_contract", - map_method_decl, - ) - .map_err(|detail| EmitError::MalformedTargetSyntax { - declaration: map_contract, - detail, - })?; - let map = require_single_template(map_template, map_contract)?; - - Ok(CollectionOpsBinding { - concat, - length, - is_empty, - fold, - map, - filter, - contains: syntax_field_string(fields, "contains", declaration)?, - empty_list: syntax_field_string(fields, "empty_list", declaration)?, - list_literal: syntax_field_string(fields, "list_literal", declaration)?, - cons: syntax_field_string(fields, "cons", declaration)?, - }) -} - -fn require_single_template( - template: MethodTemplateContractEmitTemplate, - declaration: DeclarationId, -) -> Result { - match template { - MethodTemplateContractEmitTemplate::SingleTemplate(template) => Ok(template), - MethodTemplateContractEmitTemplate::HigherOrderTemplates { .. } => { - Err(EmitError::MalformedTargetSyntax { - declaration, - detail: "CollectionOps MethodTemplateContract must use MethodEmitTemplate.SingleTemplate", - }) - } - } -} - -fn require_higher_order_inline_template( - template: MethodTemplateContractEmitTemplate, - declaration: DeclarationId, -) -> Result { - match template { - MethodTemplateContractEmitTemplate::HigherOrderTemplates { - inline_template, .. - } => Ok(inline_template), - MethodTemplateContractEmitTemplate::SingleTemplate(_) => { - Err(EmitError::MalformedTargetSyntax { - declaration, - detail: - "Rust CollectionOps higher-order MethodTemplateContract must use MethodEmitTemplate.HigherOrderTemplates", - }) - } - } -} - -fn parse_value_construction_syntax( - dag: &Dag, - declaration: DeclarationId, -) -> Result { - let fields = structural_fields_for_decl(dag, declaration)?; - Ok(ValueConstructionSyntaxBinding { - struct_literal: syntax_field_string(fields, "struct_literal", declaration)?, - struct_field_init: syntax_field_string(fields, "struct_field_init", declaration)?, - struct_field_separator: syntax_field_string(fields, "struct_field_separator", declaration)?, - variant_named_construction: syntax_field_string( - fields, - "variant_named_construction", - declaration, - )?, - }) -} - -fn render_named_template(template: &str, bindings: &[(&str, &str)]) -> String { - let bindings: HashMap<&str, &str> = bindings.iter().copied().collect(); - let chars: Vec = template.chars().collect(); - let mut rendered = String::with_capacity(template.len()); - let mut i = 0; - - while i < chars.len() { - match chars[i] { - '{' => { - if i + 1 < chars.len() && chars[i + 1] == '{' { - rendered.push('{'); - i += 2; - continue; - } - - let mut j = i + 1; - while j < chars.len() && chars[j] != '}' { - j += 1; - } - if j < chars.len() { - let key: String = chars[i + 1..j].iter().collect(); - if is_template_placeholder_key(&key) { - if let Some(value) = bindings.get(key.as_str()) { - rendered.push_str(value); - } else { - rendered.push('{'); - rendered.push_str(&key); - rendered.push('}'); - } - i = j + 1; - continue; - } - } - - rendered.push('{'); - i += 1; - } - '}' => { - if i + 1 < chars.len() && chars[i + 1] == '}' { - rendered.push('}'); - i += 2; - } else { - rendered.push('}'); - i += 1; - } - } - ch => { - rendered.push(ch); - i += 1; - } - } - } - - rendered -} - -/// Local name for a destructured field of a multi-field struct-variant -/// payload. Used by both the pattern emitter and the arm-body renderer -/// so the aliased destructure and the payload-binding field routing -/// stay in lockstep. The leading `__` avoids colliding with user -/// identifiers and silences unused-binding warnings on fields the arm -/// body never references. -fn destructured_field_alias(binding_name: &str, field_label: &str) -> String { - format!("__{binding_name}_{field_label}") -} - -fn find_resolved_branch_path(branch: &BranchNode, variant_id: DeclarationId) -> Option<&Path> { - branch.paths.iter().find(|path| match path.pattern { - BranchPattern::ResolvedVariant(id) => id == variant_id, - BranchPattern::UnresolvedVariant { .. } => false, - }) -} - -fn is_template_placeholder_key(key: &str) -> bool { - let mut chars = key.chars(); - let Some(first) = chars.next() else { - return false; - }; - if !(first == '_' || first.is_ascii_alphabetic()) { - return false; - } - chars.all(|ch| ch == '_' || ch.is_ascii_alphanumeric()) -} - -fn join_rendered(values: &[String], separator: &str) -> String { - values.join(separator) -} - -/// Required-field lookup: returns `Err` if the field is absent or -/// not a `FieldValue::Reference`. Used at realization-index build -/// time to fail-closed on spec entries that should have been -/// rejected by `lower_record_to_structural`'s inhabitance check. -fn require_field_decl_ref( - fields: &[(String, FieldValue)], - label: &str, - declaration: DeclarationId, -) -> Result { - fields - .iter() - .find(|(l, _)| l == label) - .and_then(|(_, v)| match v { - FieldValue::Reference(id) => Some(*id), - _ => None, - }) - .ok_or(EmitError::MalformedRealization { - declaration, - detail: - "realization data item is missing a required Reference field or has wrong shape — see lower_record_to_structural inhabitance check", - }) -} - -/// Required-field lookup: returns `Err` if the field is absent or -/// not a `FieldValue::Literal(LiteralBits::String)`. Same -/// fail-closed semantics as `require_field_decl_ref`. -fn require_field_string( - fields: &[(String, FieldValue)], - label: &str, - declaration: DeclarationId, -) -> Result { - fields - .iter() - .find(|(l, _)| l == label) - .and_then(|(_, v)| match v { - FieldValue::Literal(LiteralBits::String(s)) => Some(s.clone()), - _ => None, - }) - .ok_or(EmitError::MalformedRealization { - declaration, - detail: - "realization data item is missing a required String field or has wrong shape — see lower_record_to_structural inhabitance check", - }) -} - -fn require_field_bool( - fields: &[(String, FieldValue)], - label: &str, - declaration: DeclarationId, -) -> Result { - fields - .iter() - .find(|(l, _)| l == label) - .and_then(|(_, v)| match v { - FieldValue::Literal(LiteralBits::Bool(b)) => Some(*b), - _ => None, - }) - .ok_or(EmitError::MalformedRealization { - declaration, - detail: - "realization data item is missing a required Bool field or has wrong shape — see lower_record_to_structural inhabitance check", - }) -} - -fn require_field_bindings( - dag: &Dag, - fields: &[(String, FieldValue)], - declaration: DeclarationId, -) -> Result, EmitError> { - let value = fields - .iter() - .find(|(label, _)| label == "fields") - .map(|(_, value)| value) - .ok_or(EmitError::MalformedRealization { - declaration, - detail: "TypeRealization is missing required `fields` list", - })?; - let FieldValue::List(entries) = value else { - return Err(EmitError::MalformedRealization { - declaration, - detail: "TypeRealization.fields must be a structural list", - }); - }; - let mut bindings = HashMap::new(); - for entry in entries { - let FieldValue::Record(fields) = entry else { - return Err(EmitError::MalformedRealization { - declaration, - detail: "FieldBinding entries must be structural records", - }); - }; - let dag_name = fields - .iter() - .find(|(label, _)| label == "dag_name") - .and_then(|(_, value)| match value { - FieldValue::Literal(LiteralBits::String(name)) => Some(name.clone()), - _ => None, - }) - .ok_or(EmitError::MalformedRealization { - declaration, - detail: "FieldBinding.dag_name must be a String literal", - })?; - let rust_access = fields - .iter() - .find(|(label, _)| label == "access") - .ok_or(EmitError::MalformedRealization { - declaration, - detail: "FieldBinding.access is required", - }) - .and_then(|(_, value)| parse_rust_field_access(dag, value, declaration))?; - let borrowed_read = fields - .iter() - .find(|(label, _)| label == "borrowed_read") - .and_then(|(_, value)| match value { - FieldValue::Literal(LiteralBits::Bool(value)) => Some(*value), - _ => None, - }) - .unwrap_or(false); - if bindings - .insert( - dag_name, - FieldBindingBinding { - access: rust_access, - borrowed_read, - }, - ) - .is_some() - { - return Err(EmitError::DuplicateRealization { - declaration, - detail: "TypeRealization.fields contains duplicate dag_name entries", - }); - } - } - Ok(bindings) -} - -fn parse_rust_field_access( - dag: &Dag, - value: &FieldValue, - declaration: DeclarationId, -) -> Result { - let FieldValue::Variant { - constructor, - payload, - } = value - else { - return Err(EmitError::MalformedRealization { - declaration, - detail: "FieldBinding.access must be a FieldAccess variant", - }); - }; - if payload.len() != 1 { - return Err(EmitError::MalformedRealization { - declaration, - detail: "FieldAccess variants must carry exactly one String payload", - }); - } - let name = match &payload[0] { - FieldValue::Literal(LiteralBits::String(name)) => name.clone(), - _ => { - return Err(EmitError::MalformedRealization { - declaration, - detail: "FieldAccess payload must be a String literal", - }); - } - }; - let variants = dag.emit_model_variants(); - let direct_field = - variants - .field_access - .direct_field - .ok_or(EmitError::MalformedRealization { - declaration, - detail: "FieldAccess.DirectField declaration was not found", - })?; - let accessor_method = - variants - .field_access - .accessor_method - .ok_or(EmitError::MalformedRealization { - declaration, - detail: "FieldAccess.AccessorMethod declaration was not found", - })?; - if *constructor == direct_field { - Ok(RustFieldAccessBinding::DirectField(name)) - } else if *constructor == accessor_method { - Ok(RustFieldAccessBinding::AccessorMethod(name)) - } else { - Err(EmitError::MalformedRealization { - declaration, - detail: "RustFieldAccess constructor must be DirectField or AccessorMethod", - }) - } -} - -fn require_callable_strategy( - dag: &Dag, - fields: &[(String, FieldValue)], - declaration: DeclarationId, -) -> Result { - let value = fields - .iter() - .find(|(label, _)| label == "strategy") - .map(|(_, value)| value) - .ok_or(EmitError::MalformedRealization { - declaration, - detail: "CallableRealization is missing required `strategy` field", - })?; - let FieldValue::Variant { - constructor, - payload, - } = value - else { - return Err(EmitError::MalformedRealization { - declaration, - detail: "CallableRealization.strategy must be a CallableStrategy variant", - }); - }; - if !payload.is_empty() { - return Err(EmitError::MalformedRealization { - declaration, - detail: "CallableStrategy variants must not carry payload fields", - }); - } - let variants = dag.callable_strategy_variants(); - let strategies = [ - (variants.list_empty, RustCallableStrategyBinding::ListEmpty), - ( - variants.list_singleton, - RustCallableStrategyBinding::ListSingleton, - ), - (variants.list_cons, RustCallableStrategyBinding::ListCons), - ( - variants.list_concat, - RustCallableStrategyBinding::ListConcat, - ), - ( - variants.list_length, - RustCallableStrategyBinding::ListLength, - ), - ( - variants.list_is_empty, - RustCallableStrategyBinding::ListIsEmpty, - ), - (variants.list_fold, RustCallableStrategyBinding::ListFold), - (variants.list_map, RustCallableStrategyBinding::ListMap), - ( - variants.list_filter, - RustCallableStrategyBinding::ListFilter, - ), - ( - variants.list_contains, - RustCallableStrategyBinding::ListContains, - ), - ]; - for (variant_id, binding) in strategies { - let Some(variant_id) = variant_id else { - return Err(EmitError::MalformedRealization { - declaration, - detail: "CallableStrategy variant declaration was not found", - }); - }; - if *constructor == variant_id { - return Ok(binding); - } - } - Err(EmitError::MalformedRealization { - declaration, - detail: - "RustCallableStrategy constructor must be ListEmpty/ListSingleton/ListCons/ListConcat/ListLength/ListIsEmpty/ListFold/ListMap/ListFilter/ListContains", - }) -} - -/// Parse and validate the `parameters` list on a CallableRealization. -/// Each entry is a `CallableParameter` record with `slot: Int` and -/// `disposition: ParameterDisposition`. Returns a Vec indexed by slot -/// (length == `expected_arity`). Validation makes arity and order -/// drift unrepresentable: any missing slot, duplicate slot, or -/// out-of-range slot fails closed at build time instead of silently -/// defaulting to Borrowed at use time. -fn require_parameter_dispositions( - dag: &Dag, - fields: &[(String, FieldValue)], - declaration: DeclarationId, - expected_arity: usize, -) -> Result, EmitError> { - let value = fields - .iter() - .find(|(label, _)| label == "parameters") - .map(|(_, value)| value) - .ok_or(EmitError::MalformedRealization { - declaration, - detail: "CallableRealization is missing required `parameters` field", - })?; - let FieldValue::List(entries) = value else { - return Err(EmitError::MalformedRealization { - declaration, - detail: "CallableRealization.parameters must be a structural list", - }); - }; - if entries.len() != expected_arity { - return Err(EmitError::MalformedRealization { - declaration, - detail: "CallableRealization.parameters length does not match the callable's Arrow input arity", - }); - } - let mut filled: Vec> = vec![None; expected_arity]; - for entry in entries { - let (slot, disposition) = parse_callable_parameter(dag, entry, declaration)?; - if slot >= expected_arity { - return Err(EmitError::MalformedRealization { - declaration, - detail: "CallableParameter.slot is out of range for the callable's declared arity", - }); - } - if filled[slot].is_some() { - return Err(EmitError::MalformedRealization { - declaration, - detail: "CallableParameter.slot is duplicated within parameters list", - }); - } - filled[slot] = Some(disposition); - } - filled - .into_iter() - .map(|opt| { - opt.ok_or(EmitError::MalformedRealization { - declaration, - detail: "CallableRealization.parameters does not cover every slot in [0, arity)", - }) - }) - .collect() -} - -fn parse_callable_parameter( - dag: &Dag, - value: &FieldValue, - declaration: DeclarationId, -) -> Result<(usize, ParameterDispositionBinding), EmitError> { - let FieldValue::Record(fields) = value else { - return Err(EmitError::MalformedRealization { - declaration, - detail: "CallableRealization.parameters entries must be CallableParameter records", - }); - }; - let slot = fields - .iter() - .find(|(label, _)| label == "slot") - .map(|(_, value)| value) - .ok_or(EmitError::MalformedRealization { - declaration, - detail: "CallableParameter is missing required `slot` field", - })?; - let FieldValue::Literal(LiteralBits::Int(slot_str)) = slot else { - return Err(EmitError::MalformedRealization { - declaration, - detail: "CallableParameter.slot must be an Int literal", - }); - }; - let Some(slot_int) = crate::dag::literal_decimal_i64(slot_str.as_str()) else { - return Err(EmitError::MalformedRealization { - declaration, - detail: "CallableParameter.slot must be a decimal Int literal", - }); - }; - if slot_int < 0 { - return Err(EmitError::MalformedRealization { - declaration, - detail: "CallableParameter.slot must be non-negative", - }); - } - let disposition_value = fields - .iter() - .find(|(label, _)| label == "disposition") - .map(|(_, value)| value) - .ok_or(EmitError::MalformedRealization { - declaration, - detail: "CallableParameter is missing required `disposition` field", - })?; - let disposition = parse_parameter_disposition(dag, disposition_value, declaration)?; - Ok((slot_int as usize, disposition)) -} - -fn parse_parameter_disposition( - dag: &Dag, - value: &FieldValue, - declaration: DeclarationId, -) -> Result { - let FieldValue::Variant { - constructor, - payload, - } = value - else { - return Err(EmitError::MalformedRealization { - declaration, - detail: "CallableParameter.disposition must be a ParameterDisposition variant", - }); - }; - if !payload.is_empty() { - return Err(EmitError::MalformedRealization { - declaration, - detail: "ParameterDisposition variants must not carry payload fields", - }); - } - let variants = dag.emit_model_variants(); - let borrowed = - variants - .parameter_disposition - .borrowed - .ok_or(EmitError::MalformedRealization { - declaration, - detail: "ParameterDisposition.Borrowed declaration was not found", - })?; - let consumed = - variants - .parameter_disposition - .consumed - .ok_or(EmitError::MalformedRealization { - declaration, - detail: "ParameterDisposition.Consumed declaration was not found", - })?; - if *constructor == borrowed { - Ok(ParameterDispositionBinding::Borrowed) - } else if *constructor == consumed { - Ok(ParameterDispositionBinding::Consumed) - } else { - Err(EmitError::MalformedRealization { - declaration, - detail: "ParameterDisposition constructor must be Borrowed or Consumed", - }) - } -} - -/// Structural boundary check for `PatternRealization.empty_variant` / -/// `cons_variant`. These fields carry typed `DeclarationRef`s, but -/// `DeclarationRef` alone cannot express the shape constraint "must be -/// a variant of `target`'s Disj" — so the spec grammar admits -/// `empty_variant: Int` even though it is nonsensical. -/// -/// Reject-at-boundary: after parsing a realization, walk `target` to -/// its Disj and verify both role refs match one of the variants' `ty`, -/// and that they are distinct. A malformed spec surfaces loudly via -/// `MalformedRealization` instead of silently producing emitter output -/// that never finds the named branch arm at render time. -fn validate_pattern_roles( - dag: &Dag, - target: DeclarationId, - binding: &PatternRealizationBinding, - declaration: DeclarationId, -) -> Result<(), EmitError> { - let disj_id = walk_to_disj(dag, target).ok_or(EmitError::MalformedRealization { - declaration, - detail: - "PatternRealization.target must resolve to a Disj — empty_variant / cons_variant have no target to range over otherwise", - })?; - let TypeConnective::Disj { variants } = &dag.declaration(disj_id).connective else { - return Err(EmitError::MalformedRealization { - declaration, - detail: "walk_to_disj returned a non-Disj declaration (internal invariant violation)", - }); - }; - let has_empty = variants.iter().any(|v| v.ty == binding.empty_variant); - if !has_empty { - return Err(EmitError::MalformedRealization { - declaration, - detail: - "PatternRealization.empty_variant must be a variant of `target` — structural boundary check rejects unrelated DeclarationRefs", - }); - } - let has_cons = variants.iter().any(|v| v.ty == binding.cons_variant); - if !has_cons { - return Err(EmitError::MalformedRealization { - declaration, - detail: - "PatternRealization.cons_variant must be a variant of `target` — structural boundary check rejects unrelated DeclarationRefs", - }); - } - if binding.empty_variant == binding.cons_variant { - return Err(EmitError::MalformedRealization { - declaration, - detail: - "PatternRealization.empty_variant and cons_variant must be distinct variants of `target`", - }); - } - Ok(()) -} - -fn require_pattern_realization( - dag: &Dag, - fields: &[(String, FieldValue)], - declaration: DeclarationId, -) -> Result { - let value = fields - .iter() - .find(|(label, _)| label == "strategy") - .map(|(_, value)| value) - .ok_or(EmitError::MalformedRealization { - declaration, - detail: "PatternRealization is missing required `strategy` field", - })?; - match parse_pattern_strategy(dag, value) { - Ok(PatternStrategyBinding::VectorList) => {} - Err(detail) => { - return Err(EmitError::MalformedRealization { - declaration, - detail, - }); - } - } - Ok(PatternRealizationBinding { - empty_variant: require_field_decl_ref(fields, "empty_variant", declaration)?, - cons_variant: require_field_decl_ref(fields, "cons_variant", declaration)?, - scrutinee: require_field_string(fields, "scrutinee", declaration)?, - empty_pattern: require_field_string(fields, "empty_pattern", declaration)?, - cons_pattern: require_field_string(fields, "cons_pattern", declaration)?, - head_expr: require_field_string(fields, "head_expr", declaration)?, - tail_expr: require_field_string(fields, "tail_expr", declaration)?, - }) -} - -fn require_read_strategy( - dag: &Dag, - fields: &[(String, FieldValue)], - label: &str, - declaration: DeclarationId, -) -> Result { - let value = fields - .iter() - .find(|(field_label, _)| field_label == label) - .map(|(_, value)| value) - .ok_or(EmitError::MalformedTargetSyntax { - declaration, - detail: "RenderingModel is missing a required field", - })?; - let FieldValue::Variant { - constructor, - payload, - } = value - else { - return Err(EmitError::MalformedTargetSyntax { - declaration, - detail: "RenderingModel.read must be a ReadStrategy variant", - }); - }; - if !payload.is_empty() { - return Err(EmitError::MalformedTargetSyntax { - declaration, - detail: "ReadStrategy variants must not carry payload fields", - }); - } - let variants = dag.emit_model_variants(); - let borrow_variant = variants - .read_strategy - .borrow - .ok_or(EmitError::MalformedTargetSyntax { - declaration, - detail: "ReadStrategy.Borrow declaration was not found", - })?; - let pass_variant = - variants - .read_strategy - .pass_by_value - .ok_or(EmitError::MalformedTargetSyntax { - declaration, - detail: "ReadStrategy.PassByValue declaration was not found", - })?; - if *constructor == borrow_variant { - Ok(ReadStrategyBinding::Borrow) - } else if *constructor == pass_variant { - Ok(ReadStrategyBinding::PassByValue) - } else { - Err(EmitError::MalformedTargetSyntax { - declaration, - detail: "RenderingModel.read must be Borrow or PassByValue", - }) - } -} - -fn require_construct_strategy( - dag: &Dag, - fields: &[(String, FieldValue)], - label: &str, - declaration: DeclarationId, -) -> Result { - let value = fields - .iter() - .find(|(field_label, _)| field_label == label) - .map(|(_, value)| value) - .ok_or(EmitError::MalformedTargetSyntax { - declaration, - detail: "RenderingModel is missing a required field", - })?; - let FieldValue::Variant { - constructor, - payload, - } = value - else { - return Err(EmitError::MalformedTargetSyntax { - declaration, - detail: "RenderingModel.construct must be a ConstructStrategy variant", - }); - }; - if !payload.is_empty() { - return Err(EmitError::MalformedTargetSyntax { - declaration, - detail: "ConstructStrategy variants must not carry payload fields", - }); - } - let variants = dag.emit_model_variants(); - let copy_or_clone = - variants - .construct_strategy - .copy_or_clone - .ok_or(EmitError::MalformedTargetSyntax { - declaration, - detail: "ConstructStrategy.CopyOrClone declaration was not found", - })?; - let pass_variant = - variants - .construct_strategy - .pass_by_value - .ok_or(EmitError::MalformedTargetSyntax { - declaration, - detail: "ConstructStrategy.PassByValue declaration was not found", - })?; - if *constructor == copy_or_clone { - Ok(ConstructStrategyBinding::CopyOrClone) - } else if *constructor == pass_variant { - Ok(ConstructStrategyBinding::PassByValue) - } else { - Err(EmitError::MalformedTargetSyntax { - declaration, - detail: "RenderingModel.construct must be CopyOrClone or PassByValue", - }) - } -} - -fn require_source_mutability( - dag: &Dag, - fields: &[(String, FieldValue)], - declaration: DeclarationId, -) -> Result { - let value = require_unit_variant_field(fields, "mutability", declaration)?; - let variants = dag.emit_model_variants(); - let immutable = variants - .mutability - .immutable - .ok_or(EmitError::MalformedTargetSyntax { - declaration, - detail: "Mutability.Immutable declaration was not found", - })?; - let mutable = variants - .mutability - .mutable - .ok_or(EmitError::MalformedTargetSyntax { - declaration, - detail: "Mutability.Mutable declaration was not found", - })?; - if value == immutable { - Ok(SourceMutabilityBinding::Immutable) - } else if value == mutable { - Ok(SourceMutabilityBinding::Mutable) - } else { - Err(EmitError::MalformedTargetSyntax { - declaration, - detail: "ComputationModel.mutability must be Immutable or Mutable", - }) - } -} - -fn require_source_purity( - dag: &Dag, - fields: &[(String, FieldValue)], - declaration: DeclarationId, -) -> Result { - let value = require_unit_variant_field(fields, "purity", declaration)?; - let variants = dag.emit_model_variants(); - let pure = variants - .purity - .pure - .ok_or(EmitError::MalformedTargetSyntax { - declaration, - detail: "Purity.Pure declaration was not found", - })?; - let effectful = variants - .purity - .effectful - .ok_or(EmitError::MalformedTargetSyntax { - declaration, - detail: "Purity.Effectful declaration was not found", - })?; - if value == pure { - Ok(SourcePurityBinding::Pure) - } else if value == effectful { - Ok(SourcePurityBinding::Effectful) - } else { - Err(EmitError::MalformedTargetSyntax { - declaration, - detail: "ComputationModel.purity must be Pure or Effectful", - }) - } -} - -fn require_source_structure( - dag: &Dag, - fields: &[(String, FieldValue)], - declaration: DeclarationId, -) -> Result { - let value = require_unit_variant_field(fields, "structure", declaration)?; - let variants = dag.emit_model_variants(); - let explicit = variants - .structure - .explicit_dag - .ok_or(EmitError::MalformedTargetSyntax { - declaration, - detail: "Structure.ExplicitDAG declaration was not found", - })?; - let arbitrary = variants - .structure - .arbitrary - .ok_or(EmitError::MalformedTargetSyntax { - declaration, - detail: "Structure.Arbitrary declaration was not found", - })?; - if value == explicit { - Ok(SourceStructureBinding::ExplicitDag) - } else if value == arbitrary { - Ok(SourceStructureBinding::Arbitrary) - } else { - Err(EmitError::MalformedTargetSyntax { - declaration, - detail: "ComputationModel.structure must be ExplicitDAG or Arbitrary", - }) - } -} - -fn require_source_iteration( - dag: &Dag, - fields: &[(String, FieldValue)], - declaration: DeclarationId, -) -> Result { - let value = require_unit_variant_field(fields, "iteration", declaration)?; - let bounded = - dag.emit_model_variants() - .iteration - .bounded - .ok_or(EmitError::MalformedTargetSyntax { - declaration, - detail: "Iteration.Bounded declaration was not found", - })?; - let unbounded = - dag.emit_model_variants() - .iteration - .unbounded - .ok_or(EmitError::MalformedTargetSyntax { - declaration, - detail: "Iteration.Unbounded declaration was not found", - })?; - if value == bounded { - Ok(SourceIterationBinding::Bounded) - } else if value == unbounded { - Ok(SourceIterationBinding::Unbounded) - } else { - Err(EmitError::MalformedTargetSyntax { - declaration, - detail: "ComputationModel.iteration must be Bounded or Unbounded", - }) - } -} - -fn require_memory_model( - dag: &Dag, - fields: &[(String, FieldValue)], - declaration: DeclarationId, -) -> Result { - let value = require_unit_variant_field(fields, "memory", declaration)?; - let variants = dag.emit_model_variants(); - let memory_variants = [ - ( - variants.memory_model.value_only, - MemoryModelBinding::ValueOnly, - "MemoryModel.ValueOnly declaration was not found", - ), - ( - variants.memory_model.garbage_collected, - MemoryModelBinding::GarbageCollected, - "MemoryModel.GarbageCollected declaration was not found", - ), - ( - variants.memory_model.ref_counted, - MemoryModelBinding::RefCounted, - "MemoryModel.RefCounted declaration was not found", - ), - ( - variants.memory_model.ownership_based, - MemoryModelBinding::OwnershipBased, - "MemoryModel.OwnershipBased declaration was not found", - ), - ]; - for (variant, binding, detail) in memory_variants { - let variant = variant.ok_or(EmitError::MalformedTargetSyntax { - declaration, - detail, - })?; - if value == variant { - return Ok(binding); - } - } - Err(EmitError::MalformedTargetSyntax { - declaration, - detail: - "TargetExecutionModel.memory must be ValueOnly/GarbageCollected/RefCounted/OwnershipBased", - }) -} - -fn require_scope_model( - dag: &Dag, - fields: &[(String, FieldValue)], - declaration: DeclarationId, -) -> Result { - let value = require_unit_variant_field(fields, "scope", declaration)?; - let variants = dag.emit_model_variants(); - let scope_variants = [ - ( - variants.scope_model.lexical_scoping, - ScopeModelBinding::LexicalScoping, - "ScopeModel.LexicalScoping declaration was not found", - ), - ( - variants.scope_model.dynamic_scoping, - ScopeModelBinding::DynamicScoping, - "ScopeModel.DynamicScoping declaration was not found", - ), - ]; - for (variant, binding, detail) in scope_variants { - let variant = variant.ok_or(EmitError::MalformedTargetSyntax { - declaration, - detail, - })?; - if value == variant { - return Ok(binding); - } - } - Err(EmitError::MalformedTargetSyntax { - declaration, - detail: "TargetExecutionModel.scope must be LexicalScoping or DynamicScoping", - }) -} - -fn require_unit_variant_field( - fields: &[(String, FieldValue)], - label: &str, - declaration: DeclarationId, -) -> Result { - let value = fields - .iter() - .find(|(field_label, _)| field_label == label) - .map(|(_, value)| value) - .ok_or(EmitError::MalformedTargetSyntax { - declaration, - detail: "target-model declaration is missing a required field", - })?; - let FieldValue::Variant { - constructor, - payload, - } = value - else { - return Err(EmitError::MalformedTargetSyntax { - declaration, - detail: "target-model field must be a unit variant", - }); - }; - if !payload.is_empty() { - return Err(EmitError::MalformedTargetSyntax { - declaration, - detail: "target-model variants must not carry payload fields", - }); - } - Ok(*constructor) -} - -fn derive_callable_dispositions( - dag: &Dag, - external: &HashMap>, -) -> Result>, EmitError> { - let mut dispositions = external.clone(); - let user_defined: Vec = dag - .declarations() - .iter() - .filter_map(|decl| match &decl.connective { - TypeConnective::Arrow { - body: ArrowBody::UserDefined(_), - .. - } => Some(decl.id), - _ => None, - }) - .collect(); - - for declaration in &user_defined { - let TypeConnective::Arrow { inputs, .. } = &dag.declaration(*declaration).connective else { - continue; - }; - dispositions - .entry(*declaration) - .or_insert_with(|| vec![ParameterDispositionBinding::Borrowed; inputs.len()]); - } - - loop { - let mut changed = false; - for declaration in &user_defined { - let next = analyze_user_defined_callable(dag, *declaration, &dispositions)?; - let entry = dispositions - .entry(*declaration) - .or_insert_with(|| next.clone()); - let merged: Vec<_> = entry - .iter() - .copied() - .zip(next.iter().copied()) - .map(|(current, observed)| current.merge(observed)) - .collect(); - if *entry != merged { - *entry = merged; - changed = true; - } - } - if !changed { - return Ok(dispositions); - } - } -} - -fn analyze_user_defined_callable( - dag: &Dag, - declaration: DeclarationId, - dispositions: &HashMap>, -) -> Result, EmitError> { - let TypeConnective::Arrow { inputs, body, .. } = &dag.declaration(declaration).connective - else { - return Err(EmitError::MalformedUserDefinedCallable { - declaration, - detail: "callable declaration is not an Arrow", - }); - }; - let ArrowBody::UserDefined(bind_id) = body else { - return Err(EmitError::MalformedUserDefinedCallable { - declaration, - detail: "user-defined callable does not have a UserDefined Arrow body", - }); - }; - let Some(bind) = (*bind_id).bind_opt(dag) else { - return Err(EmitError::MalformedUserDefinedCallable { - declaration, - detail: "user-defined callable body does not point to a Bind node", - }); - }; - if bind.params.len() < inputs.len() { - return Err(EmitError::MalformedUserDefinedCallable { - declaration, - detail: "Bind.params has fewer ports than the Arrow declares inputs", - }); - } - - let runtime_params = &bind.params[bind.params.len() - inputs.len()..]; - let runtime_index: HashMap = runtime_params - .iter() - .copied() - .enumerate() - .map(|(idx, port)| (port, idx)) - .collect(); - let mut observed = vec![ParameterDispositionBinding::Borrowed; inputs.len()]; - let mut queue = vec![bind.value]; - if let Some(&index) = runtime_index.get(&bind.value) { - observed[index] = observed[index].merge(ParameterDispositionBinding::Consumed); - } - let mut expanded = HashSet::new(); - - while let Some(port) = queue.pop() { - if !expanded.insert(port) { - continue; - } - let Some(producer) = dag.port(port).produced_by else { - continue; - }; - match dag.node(producer) { - Behavior::Value(_) => {} - Behavior::Transform(t) => { - for (slot, input) in t.inputs.iter().copied().enumerate() { - let disposition = transform_input_disposition(dag, t, slot, dispositions); - if let Some(&index) = runtime_index.get(&input) { - observed[index] = observed[index].merge(disposition); - } - queue.push(input); - } - } - Behavior::Branch(b) => { - if let Some(&index) = runtime_index.get(&b.input) { - observed[index] = observed[index].merge(ParameterDispositionBinding::Borrowed); - } - queue.push(b.input); - for path in &b.paths { - if let Some(&index) = runtime_index.get(&path.output) { - observed[index] = - observed[index].merge(ParameterDispositionBinding::Consumed); - } - queue.push(path.output); - } - } - Behavior::Loop(l) => { - for input in [Some(l.source), Some(l.init), l.bound.count_port()] { - let Some(input) = input else { - continue; - }; - if let Some(&index) = runtime_index.get(&input) { - observed[index] = - observed[index].merge(ParameterDispositionBinding::Borrowed); - } - queue.push(input); - } - let body_port = super::behavior_result_port(dag.node(l.body)); - if let Some(&index) = runtime_index.get(&body_port) { - observed[index] = observed[index].merge(ParameterDispositionBinding::Consumed); - } - queue.push(body_port); - } - Behavior::Bind(b) => { - // Bind is a naming node (thesis: let-bindings give a - // name to a value, they do not consume it). The - // disposition of the bound value is determined by the - // downstream consumer of the bound name, not by the - // Bind itself. Walk through transparently. - queue.push(b.value); - } - } - } - - Ok(observed) -} - -fn transform_input_disposition( - dag: &Dag, - transform: &TransformNode, - slot: usize, - dispositions: &HashMap>, -) -> ParameterDispositionBinding { - match &transform.target { - TransformTarget::Operator(_) - | TransformTarget::UnresolvedFieldProject { .. } - | TransformTarget::ResolvedFieldProject { .. } => ParameterDispositionBinding::Borrowed, - TransformTarget::Callable(target) => { - callable_input_disposition_for_target(dag, *target, slot, dispositions) - } - } -} - -fn callable_input_disposition_for_target( - dag: &Dag, - target: DeclarationId, - slot: usize, - dispositions: &HashMap>, -) -> ParameterDispositionBinding { - let (template, _) = callable_template(target, dag); - let decl = dag.declaration(template); - match &decl.connective { - TypeConnective::Arrow { inputs, .. } => dispositions - .get(&template) - .and_then(|values| values.get(slot).copied()) - .unwrap_or({ - if slot < inputs.len() { - ParameterDispositionBinding::Borrowed - } else { - ParameterDispositionBinding::Consumed - } - }), - TypeConnective::Conj { children } => { - if slot < children.len() { - ParameterDispositionBinding::Consumed - } else { - ParameterDispositionBinding::Borrowed - } - } - TypeConnective::Disj { variants } => { - let Some(variant_decl) = variants.first().map(|variant| variant.ty) else { - return ParameterDispositionBinding::Borrowed; - }; - match &dag.declaration(variant_decl).connective { - TypeConnective::Conj { children } if slot < children.len() => { - ParameterDispositionBinding::Consumed - } - _ => ParameterDispositionBinding::Borrowed, - } - } - _ => ParameterDispositionBinding::Borrowed, - } -} - -pub(crate) type EmitRustMode = EmitMode; - -fn scheduling_behavior_inputs(dag: &Dag, behavior: &Behavior) -> Vec { - match behavior { - Behavior::Value(_) => Vec::new(), - Behavior::Transform(t) => t.inputs.clone(), - Behavior::Branch(b) => { - let mut inputs = vec![b.input]; - inputs.extend(b.paths.iter().map(|path| path.output)); - inputs - } - Behavior::Loop(l) => { - let mut inputs = vec![l.source, l.init]; - if let Some(count) = l.bound.count_port() { - inputs.push(count); - } - inputs.push(loop_body_result_port(dag, l)); - inputs - } - Behavior::Bind(b) => vec![b.value], - } -} - -fn loop_body_result_port(dag: &Dag, l: &LoopNode) -> PortId { - match dag.node(l.body) { - Behavior::Value(v) => v.output, - Behavior::Transform(t) => t.output, - Behavior::Branch(b) => b.output, - Behavior::Loop(inner) => inner.output, - Behavior::Bind(b) => b.value, - } -} - -/// Walk upstream from `from_port` through producer→input edges; returns true when `to_port` is reachable. -fn port_reaches_upstream(dag: &Dag, from_port: PortId, to_port: PortId) -> bool { - let mut seen: HashSet = HashSet::new(); - let mut queue = vec![from_port]; - while let Some(port) = queue.pop() { - if !seen.insert(port) { - continue; - } - if port == to_port { - return true; - } - let Some(producer) = dag.port(port).produced_by else { - continue; - }; - queue.extend(scheduling_behavior_inputs(dag, dag.node(producer))); - } - false -} - -/// True when every pair of top-level binds has no value→value dependency in either direction. -/// -/// Used for R3 free-consequence auto-parallelism: only **pairwise** independent clusters emit a -/// single `std::thread::scope` batch (wave scheduling across dependent layers is deferred). -fn top_level_binds_pairwise_independent(dag: &Dag, binds: &[&BindNode]) -> bool { - if binds.len() < 2 { - return false; - } - for i in 0..binds.len() { - for j in (i + 1)..binds.len() { - if port_reaches_upstream(dag, binds[i].value, binds[j].value) - || port_reaches_upstream(dag, binds[j].value, binds[i].value) - { - return false; - } - } - } - true -} - -/// Top-level value `Bind` nodes that participate in Rust program-mode emission, in `Dag::nodes` -/// order. **Single selector** for `emit_rust_with_mode` and W1 (`last_emit_rust_program_top_level_value_bind_name`). -fn program_mode_top_level_value_binds<'a>( - dag: &'a Dag, - indexes: &RealizationIndexes, -) -> Vec<&'a crate::dag::BindNode> { - let callable_body_binds: std::collections::HashSet<_> = dag - .declarations() - .iter() - .filter_map(|decl| match &decl.connective { - TypeConnective::Arrow { - body: ArrowBody::UserDefined(bind_id), - .. - } => Some(bind_id.node_id()), - _ => None, - }) - .collect(); - dag.nodes() - .iter() - .filter_map(Behavior::as_bind) - .filter(|bind| !indexes.source_filtering.excludes(&bind.span.file)) - .filter(|bind| !callable_body_binds.contains(&bind.id)) - .filter(|b| b.params.is_empty()) - .collect() -} - -pub(crate) fn emit_rust_with_mode(dag: &Dag, mode: EmitRustMode) -> Result { - let indexes = RealizationIndexes::build(dag)?; - if !indexes.execution.is_lexically_scoped() { - return Err(EmitError::UnsupportedBehavior( - "emit_rust requires rust_execution_model.scope = LexicalScoping".to_string(), - )); - } - let input_use_facts = InputUseFacts::build(dag, &indexes); - - // Resolve the substrate markers we need ONCE up front. Each - // marker is a typed `DeclarationId` cached at bootstrap end - // from `src/v3/spec/v3_l1.dag`; if any is missing, the file - // failed to load and emit can't proceed. Rendering downstream - // uses the bound handles, never a name string. - let main_marker = dag - .main_marker() - .ok_or(EmitError::MissingSubstrateMarker(SubstrateMarkerRole::Main))?; - let type_decls: Vec<_> = dag - .declarations() - .iter() - .filter(|decl| !indexes.source_filtering.excludes(&decl.span.file)) - .filter(|decl| decl.name.is_some()) - // `type Result = ...` in `error_primitives.dag` is - // type-checking authority; Rust - // materializes it as `::core::result::Result<…>`. Generic `Result` is not - // emitted as a Rust `enum` (and would collide with the prelude if it were). - .filter(|decl| !super::substrate_result_type_decl_suppressed_for_emit(dag, decl)) - .filter(|decl| !super::substrate_div_error_type_decl_suppressed_for_emit(dag, decl)) - .filter(|decl| { - matches!( - decl.connective, - TypeConnective::Conj { .. } | TypeConnective::Disj { .. } - ) - }) - .collect(); - let function_decls: Vec<_> = dag - .declarations() - .iter() - .filter(|decl| !indexes.source_filtering.excludes(&decl.span.file)) - .filter(|decl| decl.name.is_some()) - .filter(|decl| { - !decl - .name - .as_deref() - .is_some_and(|name| name.starts_with("__anon_lambda_")) - }) - .filter(|decl| { - matches!( - decl.connective, - TypeConnective::Arrow { - body: ArrowBody::UserDefined(_), - .. - } - ) - }) - .collect(); - let top_level_binds = program_mode_top_level_value_binds(dag, &indexes); - - if mode == EmitRustMode::Program && top_level_binds.is_empty() { - return Err(EmitError::UnsupportedBehavior( - "emit_rust requires at least one top-level value Bind".to_string(), - )); - } - if mode == EmitRustMode::Module && !top_level_binds.is_empty() { - return Err(EmitError::UnsupportedBehavior( - "emit_rust module mode does not support top-level value Binds".to_string(), - )); - } - - // Build the port→bind-name index. When `render_port` recurses - // into a sub-expression and lands on a port that an earlier - // top-level Bind already named, it uses the name instead of - // re-rendering the sub-DAG. This is the structural difference - // between "the value" and "the named binding pointing at the - // value" — the substrate stores both pieces and the emitter - // chooses based on whether the consumer crossed a Bind boundary - // upstream. Top-level value rendering uses - // `render_top_level_value` which intentionally bypasses the - // index for its own bind's value (otherwise every let statement - // would render as `let x: i64 = x;`). - let mut bound_names: HashMap = HashMap::new(); - for bind in &top_level_binds { - bound_names.insert(bind.value, LocalBinding::Owned(bind.name.clone())); - } - - let ctx = Ctx { - dag, - indexes: &indexes, - bound_names: &bound_names, - input_use_facts: &input_use_facts, - mode, - }; - - let rendered_types: Vec = type_decls - .iter() - .map(|decl| ctx.render_type_declaration(decl)) - .collect::, _>>()?; - let rendered_functions: Vec = function_decls - .iter() - .map(|decl| ctx.render_function_declaration(decl)) - .collect::, _>>()?; - let needs_int_div_prelude = - dag_needs_div_error_prelude(dag, &type_decls, &top_level_binds, &function_decls); - if let (true, Some(name)) = ( - needs_int_div_prelude, - div_prelude_reserved_name_collision( - dag, - type_decls.iter(), - function_decls.iter(), - top_level_binds.iter(), - "__v3_int_div", - ), - ) { - return Err(EmitError::UnsupportedBehavior(format!( - "Rust checked-division prelude would collide with user-defined `{name}`" - ))); - } - - // `DivError` and other `dsl/std` types are excluded from `type_decls` (see - // `rust_source_filtering`); the division helper must still compile, so the - // v3 error enum + `__v3_int_div` are emitted as a small prelude. Names - // align with `std.error_primitives.DivError` for `Result<…, DivError>` / `rust_int_div`. - // - // Dissolution trigger (M1 scaffold): delete when `dsl/std/error_primitives` emits through - // the normal filtered-type path (no separate string prelude). - const RUST_V3_INT_OP_PRELUDE: &str = r#"#[derive(Copy, Clone, Debug, PartialEq, Eq)] -pub enum DivError { DivideByZero, Overflow } -pub fn __v3_int_div(l: i64, r: i64) -> ::core::result::Result { - if r == 0 { - return ::core::result::Result::Err(DivError::DivideByZero); - } - if l == i64::MIN && r == -1 { - return ::core::result::Result::Err(DivError::Overflow); - } - ::core::result::Result::Ok(l / r) -} -"#; - - let type_defs = join_rendered(&rendered_types, " "); - let function_defs = join_rendered(&rendered_functions, " "); - let mut sections: Vec = Vec::new(); - if needs_int_div_prelude { - sections.push(RUST_V3_INT_OP_PRELUDE.to_string()); - } - if !type_defs.is_empty() { - sections.push(type_defs); - } - if !function_defs.is_empty() { - sections.push(function_defs); - } - if mode == EmitRustMode::Program { - let body_joined = if top_level_binds.len() >= 2 - && top_level_binds_pairwise_independent(dag, &top_level_binds) - && ctx.top_level_binds_parallel_spawn_send_safe(&top_level_binds)? - { - let mut ty_parts: Vec = Vec::with_capacity(top_level_binds.len()); - let mut expr_parts: Vec = Vec::with_capacity(top_level_binds.len()); - let mut names: Vec<&str> = Vec::with_capacity(top_level_binds.len()); - for bind in &top_level_binds { - ty_parts.push(ctx.rust_type_name_for_port(bind.value)?); - expr_parts.push(ctx.render_top_level_value(bind.value)?); - names.push(bind.name.as_str()); - } - let tuple_ty = format!("({})", ty_parts.join(", ")); - let tuple_pat = format!("({})", names.join(", ")); - let mut spawn_stmts: Vec = Vec::with_capacity(expr_parts.len()); - let mut join_elems: Vec = Vec::with_capacity(expr_parts.len()); - for (idx, expr) in expr_parts.iter().enumerate() { - spawn_stmts.push(format!("let h{idx} = s.spawn(|| {{ {expr} }});")); - join_elems.push(format!("h{idx}.join().unwrap()")); - } - let spawn_block = spawn_stmts.join(" "); - let joined = join_elems.join(", "); - format!( - "let {tuple_pat}: {tuple_ty} = ::std::thread::scope(|s| {{ {spawn_block} ({joined}) }});" - ) - } else { - let mut rendered_binds: Vec = Vec::with_capacity(top_level_binds.len()); - for bind in &top_level_binds { - let ty_name = ctx.rust_type_name_for_port(bind.value)?; - let value_expr = ctx.render_top_level_value(bind.value)?; - let rendered = render_named_template( - &indexes.syntax.statements.let_binding, - &[ - ("name", &bind.name), - ("type", &ty_name), - ("value", &value_expr), - ], - ); - rendered_binds.push(rendered); - } - join_rendered(&rendered_binds, " ") - }; - let final_bind = top_level_binds.last().expect("guarded above"); - let final_bind_name = final_bind.name.clone(); - let final_display_expr = if ctx.port_is_substrate_result(final_bind.value)? { - // `std.error_primitives.Result` lowers to Rust's core Result, which - // does not implement Display. Keep the substrate Main template - // unchanged and pass it a displayable String. - // - // Dissolution trigger (M1 scaffold): delete this Debug wrapper when - // Result has a target-owned display realization consumed by Main emission. - format!("format!(\"{{:?}}\", {final_bind_name})") - } else { - final_bind_name - }; - - let main_template = - indexes - .behaviors - .get(&main_marker) - .ok_or(EmitError::MissingBehaviorRealization { - marker: main_marker, - })?; - let main_program = render_named_template( - main_template, - &[ - ("body", &body_joined), - ("final", &final_display_expr), - ("quote", &indexes.syntax.literals.string_delimiter), - ], - ); - sections.push(main_program); - } - Ok(join_rendered(§ions, " ")) -} - -/// Name of the last top-level **value** `Bind` that `emit_rust` program-mode `main` prints — uses -/// `program_mode_top_level_value_binds` (same vector construction as `emit_rust_with_mode`). W1 -/// `rust_emit_output` consults this so the runner cannot drift from emission. -pub(crate) fn last_emit_rust_program_top_level_value_bind_name( - dag: &Dag, -) -> Result, EmitError> { - let indexes = RealizationIndexes::build(dag)?; - Ok(program_mode_top_level_value_binds(dag, &indexes) - .last() - .map(|b| b.name.clone())) -} - -/// Conservative P3 realizability gate for [`emit_rust`] parallel scheduling: each `spawn` closure -/// must be [`Send`]. Until Send/Sync are modeled structurally, reject the parallel path when the -/// lowered Rust type string names known non-`Send`-friendly surfaces (`Rc`, -/// `impl Fn + Clone`, interior mutability carriers the emitter spells explicitly). -/// -/// **Fail closed:** return `false` → caller emits sequential `let` binds instead of scheduling Rust -/// that `rustc` rejects at `spawn`. -fn rust_type_name_parallel_spawn_send_safe(ty: &str) -> bool { - // Callable-storage carriers (`arrow_rust_emit_policy_for_arrow_decl`, api-review #676). - if ty.contains("dyn Fn") || ty.contains("impl Fn") { - return false; - } - if ty.contains("RefCell") || ty.contains("UnsafeCell") { - return false; - } - true -} - -/// Bundled emission context. Carries the typed indexes, substrate -/// marker handles, and bound-name index through the recursive -/// render walk. Replaces the pre-unwind multi-arg threading where -/// every helper took `dag, index, bound_names, ...` separately. -/// -struct Ctx<'a> { - dag: &'a Dag, - indexes: &'a RealizationIndexes, - bound_names: &'a HashMap, - input_use_facts: &'a InputUseFacts, - mode: EmitRustMode, -} - -#[derive(Debug, Clone)] -enum LocalBinding { - Owned(String), - Borrowed(String), -} - -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -enum RenderMode { - BorrowedRead, - CopyRead, - OwnedConstruct, - OwnedConstructLastUse, -} - -#[derive(Debug, Clone, Default)] -struct RenderLocals { - names: HashMap, - payload_bindings: HashMap>, -} - -/// Policy for lowering anonymous `TypeConnective::Arrow` (`fn(..)->_` types) -/// to Rust text. `impl Trait` spellings and `Rc` are only legal in -/// explicit, position-specific emit paths (blocking api-review on #676). -/// -/// **Dissolution trigger:** when position-specific Arrow carrier spellings are -/// modeled as `rust.dag` realization rows (or equivalent single-authority data), -/// delete this enum and route both `impl Fn + Clone` and `Rc` through -/// those rows instead of emitter-local policy. -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -enum ArrowRustEmitPolicy { - /// Reserved for fail-closed paths in future context-free seams. Not - /// selected by any current public entry point — all wired call sites pass - /// `StorageRcDynFn` (or route to `impl Fn + Clone` for user-fn params). - // This variant is never *constructed*; the `NoBody` + `match` arm is live if it were. - #[allow(dead_code)] - RejectFirstClassFn, - /// `std::rc::Rc` — struct fields, collection instantiations, - /// top-level `let` annotations, inferred return slots, and nested - /// callable types inside `impl Fn` parameter lists. - StorageRcDynFn, -} - -/// Machine-width slot in `Compose>`: gate-#60 may allocate a fresh -/// literal-nat id per occurrence while std aliases reuse a different id for the same bit width. -/// Compare widths via [`crate::int_literal_ranges::gate60_machine_width_bits`], not raw -/// `DeclarationId` equality. -fn gate60_compose_machine_width_slots_equal(dag: &Dag, a: DeclarationId, b: DeclarationId) -> bool { - if a == b { - return true; - } - match ( - crate::int_literal_ranges::gate60_machine_width_bits(dag, a), - crate::int_literal_ranges::gate60_machine_width_bits(dag, b), - ) { - (Some(ba), Some(bb)) => ba == bb, - _ => false, - } -} - -/// Structural equivalence for the two `Compose` template arguments: algebra slot (position 0) -/// must match by declaration identity; width slot (position 1) matches by gate-#60 bit width. -fn gate60_compose_template_args_equivalent( - dag: &Dag, - left: &[TemplateArgument], - right: &[TemplateArgument], -) -> bool { - if left.len() != 2 || right.len() != 2 { - return false; - } - left[0].parameter == right[0].parameter - && left[1].parameter == right[1].parameter - && left[0].value == right[0].value - && gate60_compose_machine_width_slots_equal(dag, left[1].value, right[1].value) -} - -/// Named substrate alias (`type Int32 = Compose<…>` / `Real64`, …) that **instantiates `Compose` -/// with the same template-argument spine** as `declaration` after gate-#60 peeling, and owns a -/// `TypeRealization` row in `rust.dag`. -/// -/// This bridges anonymous `Compose` ids to [`RealizationIndexes::types`] without an emitter-local -/// algebra×width mirror (INVARIANTS P2/P5 — carrier authority is the DAG + realization rows). -fn gate60_realized_named_compose_peer( - dag: &Dag, - types: &HashMap, - declaration: DeclarationId, -) -> Option { - let compose = crate::int_literal_ranges::compose_carrier_template_declaration_id(dag)?; - let peeled = - crate::int_literal_ranges::peel_decl_head_for_integral_float_seed(dag, declaration); - let d = dag.declaration(peeled); - let TypeConnective::Instantiation { - template, - arguments, - } = &d.connective - else { - return None; - }; - if *template != compose || arguments.len() != 2 { - return None; - } - let mut matches: Vec = Vec::new(); - for decl in dag.declarations() { - if decl.id == peeled { - continue; - } - if decl.name.is_none() { - continue; - } - if !types.contains_key(&decl.id) { - continue; - } - let TypeConnective::Instantiation { - template: other_template, - arguments: other_args, - } = &decl.connective - else { - continue; - }; - if *other_template != compose || other_args.len() != arguments.len() { - continue; - } - if !gate60_compose_template_args_equivalent(dag, other_args, arguments) { - continue; - } - matches.push(decl.id); - } - match matches.as_slice() { - [one] => Some(*one), - _ => None, - } -} - -#[allow(dead_code)] -#[derive(Debug, Clone, Copy)] -enum InputConsumer<'a> { - Transform(&'a TransformNode), - Branch(&'a BranchNode), - Loop(&'a crate::dag::LoopNode), -} - -impl<'a> Ctx<'a> { - /// P3 parallel-schedule realizability: [`std::thread::spawn`] requires `Send` closures. - /// Fail closed to sequential `let` emission when any bind's lowered Rust type may include - /// non-`Send` callable surfaces (`Rc`, `impl Fn + Clone`, …). - fn top_level_binds_parallel_spawn_send_safe( - &self, - binds: &[&BindNode], - ) -> Result { - for bind in binds { - let ty = self.rust_type_name_for_port(bind.value)?; - if !rust_type_name_parallel_spawn_send_safe(&ty) { - return Ok(false); - } - } - Ok(true) - } - - fn elide_explicit_borrow(&self, expr: &str) -> String { - expr.strip_prefix('&').unwrap_or(expr).to_string() - } - - fn borrowed_list_literal(&self, expr: &str) -> Option { - if expr == self.indexes.syntax.collection_ops.empty_list { - return Some("&[]".to_string()); - } - expr.strip_prefix("vec![") - .and_then(|tail| tail.strip_suffix(']')) - .map(|elements| format!("&[{elements}]")) - } - - fn render_borrowed_expr(&self, port: PortId, expr: String) -> Result { - match self.read_strategy() { - ReadStrategyBinding::Borrow => { - if self.port_is_list(port)? { - if let Some(slice) = self.borrowed_list_literal(&expr) { - return Ok(slice); - } - } - Ok(format!("&({expr})")) - } - ReadStrategyBinding::PassByValue => Ok(expr), - } - } - - fn render_collection_receiver( - &self, - consumer: InputConsumer<'_>, - slot: InputSlot, - locals: &RenderLocals, - ) -> Result { - let recv = self.render_input_use(consumer, slot, locals)?; - Ok(self.elide_explicit_borrow(&recv)) - } - - fn read_strategy(&self) -> ReadStrategyBinding { - self.indexes.rendering.read - } - - fn construct_strategy(&self) -> ConstructStrategyBinding { - self.indexes.rendering.construct - } - - fn callable_param_dispositions( - &self, - declaration: DeclarationId, - input_count: usize, - ) -> Vec { - self.indexes - .callable_dispositions - .get(&declaration) - .cloned() - .unwrap_or_else(|| vec![ParameterDispositionBinding::Borrowed; input_count]) - } - - fn ownership_edge_rendering_enabled(&self) -> bool { - self.indexes.computation.is_canonical_dag() && self.indexes.execution.is_ownership_based() - } - - fn render_binding( - &self, - port: PortId, - binding: &LocalBinding, - mode: RenderMode, - ) -> Result { - match mode { - RenderMode::BorrowedRead => match self.read_strategy() { - ReadStrategyBinding::Borrow => match binding { - LocalBinding::Owned(name) => Ok(format!("&{name}")), - LocalBinding::Borrowed(expr) => Ok(expr.clone()), - }, - ReadStrategyBinding::PassByValue => match binding { - LocalBinding::Owned(name) => { - if self.port_is_copy(port)? { - Ok(name.clone()) - } else { - Ok(format!("({name}).clone()")) - } - } - LocalBinding::Borrowed(expr) => self.construct_from_borrowed_expr(port, expr), - }, - }, - RenderMode::CopyRead => match binding { - LocalBinding::Owned(name) => Ok(name.clone()), - LocalBinding::Borrowed(expr) => Ok(format!("(*({expr}))")), - }, - RenderMode::OwnedConstruct | RenderMode::OwnedConstructLastUse => match binding { - LocalBinding::Owned(name) => match self.construct_strategy() { - ConstructStrategyBinding::CopyOrClone => { - if mode == RenderMode::OwnedConstructLastUse || self.port_is_copy(port)? { - Ok(name.clone()) - } else { - Ok(format!("({name}).clone()")) - } - } - ConstructStrategyBinding::PassByValue => { - if mode == RenderMode::OwnedConstructLastUse || self.port_is_copy(port)? { - Ok(name.clone()) - } else { - Err(EmitError::UnsupportedBehavior( - "rust_rendering.construct = PassByValue is not yet supported for non-Copy owned bindings" - .to_string(), - )) - } - } - }, - LocalBinding::Borrowed(expr) => self.construct_from_borrowed_expr(port, expr), - }, - } - } - - fn construct_from_borrowed_expr(&self, port: PortId, expr: &str) -> Result { - match self.construct_strategy() { - ConstructStrategyBinding::CopyOrClone => { - if self.port_is_copy(port)? { - Ok(format!("(*({expr}))")) - } else if self.port_is_list(port)? { - Ok(format!("({expr}).to_vec()")) - } else { - Ok(format!("({expr}).clone()")) - } - } - ConstructStrategyBinding::PassByValue => { - if self.port_is_copy(port)? { - Ok(format!("(*({expr}))")) - } else { - Err(EmitError::UnsupportedBehavior( - "rust_rendering.construct = PassByValue is not yet supported for borrowed non-Copy values" - .to_string(), - )) - } - } - } - } - - fn render_port( - &self, - port: PortId, - locals: &RenderLocals, - mode: RenderMode, - ) -> Result { - if let Some(binding) = locals.names.get(&port) { - return self.render_binding(port, binding, mode); - } - if let Some(binding) = locals - .payload_bindings - .get(&port) - .and_then(VariantPayloadBinding::direct) - { - return self.render_binding(port, binding, mode); - } - if let Some(binding) = self.bound_names.get(&port) { - return self.render_binding(port, binding, mode); - } - self.dispatch_producer(port, locals, mode) - } - - fn render_input_use( - &self, - consumer: InputConsumer<'_>, - slot: InputSlot, - locals: &RenderLocals, - ) -> Result { - let port = self.input_port(consumer, slot)?; - if !self.ownership_edge_rendering_enabled() { - return self.render_port(port, locals, RenderMode::BorrowedRead); - } - match self.input_disposition(consumer, slot) { - ParameterDispositionBinding::Borrowed => { - self.render_port(port, locals, RenderMode::BorrowedRead) - } - ParameterDispositionBinding::Consumed => { - // Conservative: always render as OwnedConstruct (clone) for - // Consumed disposition. The OwnedConstructLastUse optimization - // (skip the clone if this is the last use) requires the - // last-use ordering to match the *rendered* code's evaluation - // order, but rendered templates can reorder evaluation - // relative to dag.nodes() iteration order — e.g., - // `cons(entry_for(acc, _), acc)` renders as - // `let mut __list = acc; __list.insert(0, entry_for(&acc, _))`, - // which moves `acc` (slot 1) before borrowing it (slot 0). - // Until is_last_use accounts for template-induced reordering, - // skipping the clone is unsound. The is_last_use facts are - // still computed and tracked (B3) so the lookup is correct; - // we just don't act on it here yet. - let _ = self.is_last_use(port, consumer, slot); - self.render_port(port, locals, RenderMode::OwnedConstruct) - } - } - } - - fn render_copy_input_use( - &self, - consumer: InputConsumer<'_>, - slot: InputSlot, - locals: &RenderLocals, - ) -> Result { - let port = self.input_port(consumer, slot)?; - self.render_port(port, locals, RenderMode::CopyRead) - } - - fn input_port( - &self, - consumer: InputConsumer<'_>, - slot: InputSlot, - ) -> Result { - match (consumer, slot) { - (InputConsumer::Transform(transform), InputSlot::Positional(slot)) => { - transform.inputs.get(slot).copied().ok_or_else(|| { - EmitError::UnsupportedBehavior(format!( - "transform input slot {slot} is out of bounds" - )) - }) - } - (InputConsumer::Branch(branch), InputSlot::BranchInput) => Ok(branch.input), - (InputConsumer::Loop(loop_node), InputSlot::LoopSource) => Ok(loop_node.source), - (InputConsumer::Loop(loop_node), InputSlot::LoopInit) => Ok(loop_node.init), - (InputConsumer::Loop(loop_node), InputSlot::LoopBoundCount) => { - loop_node.bound.count_port().ok_or_else(|| { - EmitError::UnsupportedBehavior( - "loop does not carry a cardinality-bound input".to_string(), - ) - }) - } - _ => Err(EmitError::UnsupportedBehavior( - "input-slot kind does not match the selected consumer".to_string(), - )), - } - } - - fn input_disposition( - &self, - consumer: InputConsumer<'_>, - slot: InputSlot, - ) -> ParameterDispositionBinding { - match consumer { - InputConsumer::Transform(transform) => match slot { - InputSlot::Positional(index) => transform_input_disposition( - self.dag, - transform, - index, - &self.indexes.callable_dispositions, - ), - _ => ParameterDispositionBinding::Borrowed, - }, - InputConsumer::Branch(_) | InputConsumer::Loop(_) => { - ParameterDispositionBinding::Borrowed - } - } - } - - /// True iff the edge identified by `(consumer, slot)` is the - /// last edge that touches `port` in the total ordering — meaning - /// no later borrow or consume references this port. Only when - /// this holds is it safe to render a Consumed edge as a move - /// (`OwnedConstructLastUse`); otherwise we must clone. - fn is_last_use(&self, port: PortId, consumer: InputConsumer<'_>, slot: InputSlot) -> bool { - let key = match consumer { - InputConsumer::Transform(transform) => InputUseKey { - consumer: transform.id, - slot, - }, - InputConsumer::Branch(branch) => InputUseKey { - consumer: branch.id, - slot, - }, - InputConsumer::Loop(loop_node) => InputUseKey { - consumer: loop_node.id, - slot, - }, - }; - self.input_use_facts - .edge_order - .get(&key) - .zip(self.input_use_facts.last_use_order_by_port.get(&port)) - .is_some_and(|(edge, last)| edge == last) - } - - /// Render the value for a top-level let binding. Bypasses - /// `bound_names` for `port` itself (otherwise every let would - /// render as `let x: i64 = x;`); recursive sub-walks still use - /// `render_port` and DO consult `bound_names`. - fn render_top_level_value(&self, port: PortId) -> Result { - self.dispatch_producer(port, &RenderLocals::default(), RenderMode::OwnedConstruct) - } - - /// Integer literals lowered from surface `Real = ` (R3 gate #67) retain - /// `LiteralBits::Int` but resolve to `f32`/`f64` Rust types — rustc rejects `let x: f64 = 0`. - fn render_value_with_port_rust_type( - &self, - port: PortId, - v: &ValueNode, - ) -> Result { - if let LiteralBits::Int(decimal) = &v.data { - let rust_ty = self.rust_type_name_for_port(port)?; - if rust_ty == "f32" || rust_ty == "f64" { - return Ok(format!("{decimal}.0")); - } - } - Ok(render_value(v, &self.indexes.syntax.literals)) - } - - fn dispatch_producer( - &self, - port: PortId, - locals: &RenderLocals, - mode: RenderMode, - ) -> Result { - let Some(node_id) = self.dag.port(port).produced_by else { - return Err(EmitError::UnsupportedBehavior( - "render reached a port with no producer (parameter?)".to_string(), - )); - }; - match self.dag.node(node_id) { - Behavior::Value(v) => match mode { - RenderMode::BorrowedRead => { - let expr = self.render_value_with_port_rust_type(port, v)?; - self.render_borrowed_expr(port, expr) - } - RenderMode::CopyRead - | RenderMode::OwnedConstruct - | RenderMode::OwnedConstructLastUse => { - self.render_value_with_port_rust_type(port, v) - } - }, - Behavior::Transform(t) => self.render_transform(t, locals, mode), - Behavior::Branch(b) => { - let expr = self.render_branch(b, locals)?; - match mode { - RenderMode::BorrowedRead => self.render_borrowed_expr(port, expr), - RenderMode::CopyRead - | RenderMode::OwnedConstruct - | RenderMode::OwnedConstructLastUse => Ok(expr), - } - } - Behavior::Loop(l) => { - let expr = self.render_loop(l, locals)?; - match mode { - RenderMode::BorrowedRead => self.render_borrowed_expr(port, expr), - RenderMode::CopyRead - | RenderMode::OwnedConstruct - | RenderMode::OwnedConstructLastUse => Ok(expr), - } - } - Behavior::Bind(b) => { - self.render_binding(port, &LocalBinding::Owned(b.name.clone()), mode) - } - } - } - - fn render_transform( - &self, - t: &TransformNode, - locals: &RenderLocals, - mode: RenderMode, - ) -> Result { - match &t.target { - TransformTarget::Operator(op) => { - let expr = self.render_operator(t, *op, locals)?; - self.adjust_owned_expr(t.output, expr, mode) - } - TransformTarget::UnresolvedFieldProject { field_label } => { - Err(EmitError::UnsupportedBehavior(format!( - "field projection .{field_label} is unresolved; emit_rust expects post-infer FieldProject targets" - ))) - } - TransformTarget::ResolvedFieldProject { field_label } => { - self.render_field_project(t, field_label, locals, mode) - } - TransformTarget::Callable(target) => { - let expr = self.render_callable_transform(t, *target, locals)?; - self.adjust_owned_expr(t.output, expr, mode) - } - } - } - - fn adjust_owned_expr( - &self, - port: PortId, - expr: String, - mode: RenderMode, - ) -> Result { - match mode { - RenderMode::BorrowedRead => self.render_borrowed_expr(port, expr), - RenderMode::CopyRead => { - if self.port_is_copy(port)? { - Ok(expr) - } else { - Ok(format!("({expr}).clone()")) - } - } - RenderMode::OwnedConstruct | RenderMode::OwnedConstructLastUse => Ok(expr), - } - } - - fn render_field_project( - &self, - t: &TransformNode, - field_label: &str, - locals: &RenderLocals, - mode: RenderMode, - ) -> Result { - if t.inputs.len() != 1 { - return Err(EmitError::UnsupportedBehavior(format!( - "field projection arity {} is not supported; expected exactly one parent input", - t.inputs.len() - ))); - } - if let Some(binding) = locals - .payload_bindings - .get(&t.inputs[0]) - .and_then(|binding| binding.field(field_label)) - { - return self.render_binding(t.output, binding, mode); - } - let parent_expr = self.render_input_use( - InputConsumer::Transform(t), - InputSlot::Positional(0), - locals, - )?; - let parent_access = self.elide_explicit_borrow(&parent_expr); - let parent_type_id = primitive_type_id_for_port(self.dag, t.inputs[0])?; - if let Some(type_binding) = self.indexes.types.get(&parent_type_id) { - let binding = type_binding - .fields - .get(field_label) - .ok_or_else(|| { - EmitError::UnsupportedBehavior(format!( - "field projection .{field_label} has no FieldBinding entry on the parent TypeRealization" - )) - })?; - let access_expr = match &binding.access { - RustFieldAccessBinding::DirectField(name) => render_named_template( - &self.indexes.syntax.expressions.field_access, - &[("object", &parent_access), ("field", name)], - ), - RustFieldAccessBinding::AccessorMethod(name) => format!( - "{}()", - render_named_template( - &self.indexes.syntax.expressions.field_access, - &[("object", &parent_access), ("field", name)], - ) - ), - }; - return match mode { - RenderMode::BorrowedRead => match self.read_strategy() { - ReadStrategyBinding::Borrow => { - if binding.borrowed_read { - Ok(access_expr) - } else { - self.render_borrowed_expr(t.output, access_expr) - } - } - ReadStrategyBinding::PassByValue => { - if binding.borrowed_read { - self.construct_from_borrowed_expr(t.output, &access_expr) - } else { - Ok(access_expr) - } - } - }, - RenderMode::CopyRead => Ok(access_expr), - RenderMode::OwnedConstruct | RenderMode::OwnedConstructLastUse => { - if binding.borrowed_read { - self.construct_from_borrowed_expr(t.output, &access_expr) - } else if self.port_is_copy(t.output)? { - Ok(access_expr) - } else if self.port_is_list(t.output)? { - Ok(format!("({access_expr}).to_vec()")) - } else { - Ok(format!("({access_expr}).clone()")) - } - } - }; - } - let Some(conj_id) = walk_to_conj(self.dag, parent_type_id) else { - return Err(EmitError::MissingTypeRealization { - target: parent_type_id, - }); - }; - if !matches!( - self.dag.declaration(conj_id).connective, - TypeConnective::Conj { .. } - ) { - return Err(EmitError::MissingTypeRealization { - target: parent_type_id, - }); - } - let access_expr = render_named_template( - &self.indexes.syntax.expressions.field_access, - &[("object", &parent_access), ("field", field_label)], - ); - match mode { - RenderMode::BorrowedRead => self.render_borrowed_expr(t.output, access_expr), - RenderMode::CopyRead => Ok(access_expr), - RenderMode::OwnedConstruct | RenderMode::OwnedConstructLastUse => { - if self.port_is_copy(t.output)? { - Ok(access_expr) - } else { - Ok(format!("({access_expr}).clone()")) - } - } - } - } - - fn render_operator( - &self, - t: &TransformNode, - op: OperatorKind, - locals: &RenderLocals, - ) -> Result { - if t.inputs.len() != 2 { - return Err(EmitError::UnsupportedBehavior(format!( - "operator {:?} arity {} is not supported; only binary operators", - op, - t.inputs.len() - ))); - } - // Resolve the operand type's declaration id by walking the - // input port's TypeShape through aliases / instantiations. - let operand_type_id = primitive_type_id_for_port(self.dag, t.inputs[0])?; - // Resolve the algebra field's declaration id by walking - // the operand type's algebra chain. The OperatorKind-to- - // field-name lookup inside the helper is the SAME bridge - // that infer.rs already uses to dispatch operator - // signatures (see `infer::resolve_operator_arrow`); both - // sides agree because they read the same algebra field - // from the substrate. - let op_decl_id = algebra_field_for_operator(self.dag, operand_type_id, op)?; - let carrier = super::operator_carrier_realization( - &self.indexes.operators, - self.dag, - operand_type_id, - op_decl_id, - ) - .ok_or(EmitError::MissingOperatorRealization { - target: operand_type_id, - op: op_decl_id, - })? - .clone(); - let lhs = self.render_copy_input_use( - InputConsumer::Transform(t), - InputSlot::Positional(0), - locals, - )?; - let rhs = self.render_copy_input_use( - InputConsumer::Transform(t), - InputSlot::Positional(1), - locals, - )?; - Ok(render_named_template( - &carrier, - &[("lhs", &lhs), ("rhs", &rhs)], - )) - } - - fn render_branch(&self, b: &BranchNode, locals: &RenderLocals) -> Result { - if self.branch_scrutinee_is_bool(b)? { - let (then_path, else_path) = self.split_bool_paths(b)?; - let cond = self.render_copy_input_use( - InputConsumer::Branch(b), - InputSlot::BranchInput, - locals, - )?; - let then_expr = self.render_path_body(then_path, locals)?; - let else_expr = self.render_path_body(else_path, locals)?; - return Ok(render_named_template( - &self.indexes.syntax.control_flow.if_else, - &[("cond", &cond), ("then", &then_expr), ("else", &else_expr)], - )); - } - if let Some(rendered) = self.render_realized_pattern_branch(b, locals)? { - return Ok(rendered); - } - - let expr = - self.render_input_use(InputConsumer::Branch(b), InputSlot::BranchInput, locals)?; - let arms = b - .paths - .iter() - .map(|path| { - let pattern = self.render_branch_pattern(b, path)?; - let body = self.render_path_body(path, locals)?; - Ok(render_named_template( - &self.indexes.syntax.patterns.match_arm, - &[("pattern", &pattern), ("body", &body)], - )) - }) - .collect::, EmitError>>()?; - let arms_joined = join_rendered(&arms, " "); - Ok(render_named_template( - &self.indexes.syntax.patterns.match_expr, - &[("expr", &expr), ("arms", &arms_joined)], - )) - } - - fn render_realized_pattern_branch( - &self, - branch: &BranchNode, - locals: &RenderLocals, - ) -> Result, EmitError> { - let scrutinee_type_id = primitive_type_id_for_port(self.dag, branch.input)?; - let Some(disj_id) = walk_to_disj(self.dag, scrutinee_type_id) else { - return Ok(None); - }; - let Some(binding) = self.indexes.patterns.get(&disj_id) else { - return Ok(None); - }; - self.render_vector_list_pattern_branch(branch, disj_id, binding, locals) - .map(Some) - } - - fn render_vector_list_pattern_branch( - &self, - branch: &BranchNode, - _disj_id: DeclarationId, - binding: &PatternRealizationBinding, - locals: &RenderLocals, - ) -> Result { - // Role identity is a spec fact: `PatternRealization.empty_variant` / - // `cons_variant` are typed `DeclarationRef`s to the sum's variants - // (`List.Empty` / `List.Cons` in `rust.dag`). The emitter reads them - // — no label-matching on variant strings. - let empty_path = find_resolved_branch_path(branch, binding.empty_variant).ok_or_else( - || { - EmitError::UnsupportedBehavior( - "vector-list pattern realization requires a branch arm for the declared empty_variant" - .to_string(), - ) - }, - )?; - let cons_path = find_resolved_branch_path(branch, binding.cons_variant).ok_or_else( - || { - EmitError::UnsupportedBehavior( - "vector-list pattern realization requires a branch arm for the declared cons_variant" - .to_string(), - ) - }, - )?; - let scrutinee = self.render_input_use( - InputConsumer::Branch(branch), - InputSlot::BranchInput, - locals, - )?; - let realized_scrutinee = render_named_template(&binding.scrutinee, &[("expr", &scrutinee)]); - let empty_body = self.render_path_body(empty_path, locals)?; - - let head_name = "__list_head"; - let tail_name = "__list_tail"; - let cons_pattern = render_named_template( - &binding.cons_pattern, - &[("head", head_name), ("tail", tail_name)], - ); - let mut cons_locals = locals.clone(); - if let Some(payload) = &cons_path.binding { - let mut fields = HashMap::new(); - fields.insert( - "head".to_string(), - LocalBinding::Borrowed(render_named_template( - &binding.head_expr, - &[("head", head_name)], - )), - ); - fields.insert( - "tail".to_string(), - LocalBinding::Borrowed(render_named_template( - &binding.tail_expr, - &[("tail", tail_name)], - )), - ); - cons_locals - .payload_bindings - .insert(payload.payload_port, VariantPayloadBinding::Fields(fields)); - } - let cons_body = self.render_port( - cons_path.output, - &cons_locals, - RenderMode::OwnedConstructLastUse, - )?; - - let arms = vec![ - render_named_template( - &self.indexes.syntax.patterns.match_arm, - &[("pattern", &binding.empty_pattern), ("body", &empty_body)], - ), - render_named_template( - &self.indexes.syntax.patterns.match_arm, - &[("pattern", &cons_pattern), ("body", &cons_body)], - ), - ]; - Ok(render_named_template( - &self.indexes.syntax.patterns.match_expr, - &[ - ("expr", &realized_scrutinee), - ("arms", &join_rendered(&arms, " ")), - ], - )) - } - - fn render_path_body(&self, path: &Path, locals: &RenderLocals) -> Result { - let mut arm_locals = locals.clone(); - if let Some(binding) = &path.binding { - if let Some(payload_binding) = self.render_variant_payload_binding(path, binding)? { - arm_locals - .payload_bindings - .insert(binding.payload_port, payload_binding); - } - } - self.render_port(path.output, &arm_locals, RenderMode::OwnedConstructLastUse) - } - - fn render_branch_pattern(&self, branch: &BranchNode, path: &Path) -> Result { - let scrutinee_type_id = primitive_type_id_for_port(self.dag, branch.input)?; - let disj_id = walk_to_disj(self.dag, scrutinee_type_id).ok_or_else(|| { - EmitError::UnsupportedBehavior(format!( - "branch scrutinee type at {scrutinee_type_id:?} does not walk to a Disj" - )) - })?; - let resolved_id = match &path.pattern { - BranchPattern::ResolvedVariant(id) => *id, - BranchPattern::UnresolvedVariant { name, .. } => { - return Err(EmitError::UnresolvedBranchPattern { - variant_name: name.clone(), - }); - } - }; - - if self.branch_scrutinee_is_bool(branch)? { - return self.render_bool_pattern(disj_id, resolved_id); - } - - let variant_name = variant_name_for_decl(self.dag, disj_id, resolved_id)?; - let is_optional_match = is_optional_match_disj(self.dag, disj_id); - let qualified_name = if is_optional_match { - variant_name.clone() - } else { - let enum_name = named_disj_enum_name_for_rust_match_emit(self.dag, disj_id) - .ok_or_else(|| { - EmitError::UnsupportedBehavior( - "match on anonymous sum declarations is not yet supported in Rust emission" - .to_string(), - ) - })?; - self.qualified_name(&enum_name, &variant_name) - }; - let Some(binding) = &path.binding else { - return Ok(render_named_template( - &self.indexes.syntax.patterns.variant_pattern_empty, - &[("name", &qualified_name)], - )); - }; - let payload_shape = match variant_payload_shape(self.dag, &resolved_id) { - VariantPayloadShapeLookup::DeclarationMissing => { - return Err(EmitError::UnsupportedBehavior(format!( - "matched variant `{variant_name}` references an absent declaration" - ))); - } - VariantPayloadShapeLookup::NotPayloadProduct => { - return Err(EmitError::UnsupportedBehavior(format!( - "matched variant `{variant_name}` does not lower to a payload product" - ))); - } - VariantPayloadShapeLookup::Found { _0: shape } => shape, - }; - let rendered_binding = self.render_payload_binding_name(path, binding); - if let Some(rendered) = self.render_multi_field_variant_pattern( - &qualified_name, - binding, - &rendered_binding, - &payload_shape, - )? { - return Ok(rendered); - } - if let Some(rendered) = self.render_single_field_variant_pattern( - disj_id, - is_optional_match, - &qualified_name, - &rendered_binding, - &payload_shape, - ) { - return Ok(rendered); - } - match payload_shape { - VariantPayloadShape::Empty => Ok(render_named_template( - &self.indexes.syntax.patterns.variant_pattern_empty, - &[("name", &qualified_name)], - )), - VariantPayloadShape::PositionalSingle | VariantPayloadShape::NamedFields { .. } => { - unreachable!("single-field patterns return above") - } - } - } - - fn render_multi_field_variant_pattern( - &self, - qualified_name: &str, - binding: &crate::dag::PayloadBinding, - rendered_binding: &str, - payload_shape: &VariantPayloadShape, - ) -> Result, EmitError> { - // Substrate still models `Cardinality` as `{ element, bound }`, but the - // hand-authored Rust enum is `Cardinality(CardinalityPayload)` (tuple). - if qualified_name == "TypeConnective::Cardinality" { - return Ok(Some(render_named_template( - &self.indexes.syntax.patterns.variant_pattern_positional, - &[("name", qualified_name), ("binding", rendered_binding)], - ))); - } - if !matches!( - payload_shape, - VariantPayloadShape::NamedFields { _0: ref fields } if fields.len() > 1 - ) { - return Ok(None); - } - let VariantPayloadShape::NamedFields { _0: field_labels } = payload_shape else { - unreachable!("guarded above") - }; - let wildcard = self.indexes.syntax.patterns.wildcard.clone(); - let payload_unused = rendered_binding == wildcard; - let field_bindings = field_labels - .iter() - .map(|child| { - let binding_text = if payload_unused { - wildcard.clone() - } else { - destructured_field_alias(&binding.binding_name, child) - }; - Ok(render_named_template( - &self.indexes.syntax.patterns.field_binding, - &[("field", child), ("binding", &binding_text)], - )) - }) - .collect::, EmitError>>()?; - Ok(Some(render_named_template( - &self.indexes.syntax.patterns.variant_pattern, - &[ - ("name", qualified_name), - ( - "bindings", - &join_rendered( - &field_bindings, - &self.indexes.syntax.patterns.field_binding_separator, - ), - ), - ], - ))) - } - - fn render_single_field_variant_pattern( - &self, - disj_id: DeclarationId, - is_optional_match: bool, - qualified_name: &str, - rendered_binding: &str, - payload_shape: &VariantPayloadShape, - ) -> Option { - let single_field_label = match payload_shape { - VariantPayloadShape::PositionalSingle => None, - VariantPayloadShape::NamedFields { _0: field_labels } if field_labels.len() == 1 => { - Some(field_labels[0].as_str()) - } - VariantPayloadShape::NamedFields { .. } | VariantPayloadShape::Empty => return None, - }; - if single_field_label.is_none() - && (self.indexes.types.contains_key(&disj_id) || is_optional_match) - { - return Some(render_named_template( - &self.indexes.syntax.patterns.variant_pattern_positional, - &[("name", qualified_name), ("binding", rendered_binding)], - )); - } - let field_name = single_field_label.unwrap_or("_0"); - // `v3.std.lookup::Lookup::Hit` is a Rust tuple variant (`Hit(T)` in - // `dag_lookup_generated`); other single-`_0` sum arms stay struct-style. - // Dissolution trigger: today `Conj` children for a sum arm do not record - // "tuple vs struct payload" for Rust; emit would otherwise use struct - // patterns for every `_0` field. When positionality is a fact on the - // `Declaration` / `Disj` surface (or spec-driven), drop this name-match - // and read it structurally. Paired with `render_variant_constructor`'s - // `Lookup`/`Hit` constructor branch. - let is_lookup_hit = field_name == "_0" - && matches!( - qualified_name.split("::").collect::>().as_slice(), - [a, b] if *a == "Lookup" && *b == "Hit" - ); - if is_lookup_hit { - return Some(render_named_template( - &self.indexes.syntax.patterns.variant_pattern_positional, - &[("name", qualified_name), ("binding", rendered_binding)], - )); - } - // `ViolatesSubject::AtBehavior` is a Rust tuple variant (gate #104 / `dimensions.dag` - // mirrors `ViolatesSubject`); without this arm, emit renders named-field `_0:` patterns for - // the single-payload disj stub. Same dissolution trigger as `Lookup`/`Hit` above: positional - // vs struct payloads are not modeled structurally on the Disj emission surface yet. - let is_violates_subject_at_behavior = field_name == "_0" - && matches!( - qualified_name.split("::").collect::>().as_slice(), - [a, b] if *a == "ViolatesSubject" && *b == "AtBehavior" - ); - if is_violates_subject_at_behavior { - return Some(render_named_template( - &self.indexes.syntax.patterns.variant_pattern_positional, - &[("name", qualified_name), ("binding", rendered_binding)], - )); - } - let bindings = render_named_template( - &self.indexes.syntax.patterns.field_binding, - &[("field", field_name), ("binding", rendered_binding)], - ); - Some(render_named_template( - &self.indexes.syntax.patterns.variant_pattern, - &[("name", qualified_name), ("bindings", &bindings)], - )) - } - - /// E-5 / Lane 1 Stage 1c: render the arm's payload binding name - /// per `rust_clean_emission.pattern_bindings`. When the rule is - /// `EmitUnderscoreWhenUnused` and the arm body does not consume - /// `binding.payload_port`, emit `_` so `rustc -D warnings` does - /// not fire `unused_variables`. Rust-invalid contract variants - /// are rejected while building `CleanEmissionContractBinding`, - /// so the renderer only sees Rust-valid states. - fn render_payload_binding_name( - &self, - path: &Path, - binding: &crate::dag::PayloadBinding, - ) -> String { - match self.indexes.clean_emission.pattern_bindings { - PatternBindingRuleBinding::EmitUnderscoreWhenUnused - if !self.port_is_consumed_from(path.output, binding.payload_port) => - { - self.indexes.syntax.patterns.wildcard.clone() - } - PatternBindingRuleBinding::EmitBindingAlways - | PatternBindingRuleBinding::EmitUnderscoreWhenUnused => binding.binding_name.clone(), - } - } - - fn render_variant_payload_binding( - &self, - path: &Path, - binding: &crate::dag::PayloadBinding, - ) -> Result>, EmitError> { - let BranchPattern::ResolvedVariant(variant_id) = &path.pattern else { - return Ok(None); - }; - let shape = match variant_payload_shape(self.dag, variant_id) { - VariantPayloadShapeLookup::DeclarationMissing => { - return Err(EmitError::UnsupportedBehavior( - "variant payload binding references an absent declaration".to_string(), - )); - } - VariantPayloadShapeLookup::NotPayloadProduct => return Ok(None), - VariantPayloadShapeLookup::Found { _0: shape } => shape, - }; - let payload_binding_name = self.render_payload_binding_name(path, binding); - let wildcard = self.indexes.syntax.patterns.wildcard.clone(); - Ok(match shape { - VariantPayloadShape::Empty => None, - VariantPayloadShape::PositionalSingle => Some(VariantPayloadBinding::Direct( - LocalBinding::Borrowed(payload_binding_name), - )), - VariantPayloadShape::NamedFields { _0: field_labels } => { - match self.indexes.clean_emission.variant_payload_field_access { - VariantPayloadFieldAccessRuleBinding::AccessFromPayloadBinding => Some( - VariantPayloadBinding::Direct(LocalBinding::Borrowed(payload_binding_name)), - ), - VariantPayloadFieldAccessRuleBinding::OverrideNamedFieldsAtBindingSite => { - let multiple_fields = field_labels.len() > 1; - let fields = field_labels - .into_iter() - .map(|field_label| { - let local_name = if payload_binding_name == wildcard { - wildcard.clone() - } else if multiple_fields { - destructured_field_alias(&binding.binding_name, &field_label) - } else { - payload_binding_name.clone() - }; - (field_label, LocalBinding::Borrowed(local_name)) - }) - .collect(); - Some(VariantPayloadBinding::Fields(fields)) - } - } - } - }) - } - - /// Thin wrapper; rationale lives on `crate::emit::port_is_consumed_from`. - fn port_is_consumed_from(&self, root: PortId, target: PortId) -> bool { - super::port_is_consumed_from(self.dag, root, target) - } - - fn render_bool_pattern( - &self, - disj_id: DeclarationId, - variant_id: DeclarationId, - ) -> Result { - let TypeConnective::Disj { variants } = &self.dag.declaration(disj_id).connective else { - unreachable!("walk_to_disj returned non-Disj") - }; - let Some((idx, _)) = variants - .iter() - .enumerate() - .find(|(_, variant)| variant.ty == variant_id) - else { - return Err(EmitError::UnsupportedBehavior(format!( - "bool branch variant {variant_id:?} was not found on its parent disjunction" - ))); - }; - match idx { - 0 => Ok(self.indexes.syntax.literals.true_keyword.clone()), - 1 => Ok(self.indexes.syntax.literals.false_keyword.clone()), - _ => Err(EmitError::NonBooleanBranch { - variant_ids: variants.iter().map(|variant| variant.ty).collect(), - }), - } - } - - fn branch_scrutinee_is_bool(&self, branch: &BranchNode) -> Result { - let scrutinee_type_id = primitive_type_id_for_port(self.dag, branch.input)?; - let Some(bool_shape) = self.dag.bool_shape() else { - return Err(EmitError::MissingTypeRealization { - target: scrutinee_type_id, - }); - }; - let Some(scrutinee_disj) = walk_to_disj(self.dag, scrutinee_type_id) else { - return Ok(false); - }; - let Some(bool_disj) = walk_to_disj(self.dag, bool_shape.declaration) else { - return Ok(false); - }; - Ok(scrutinee_disj == bool_disj) - } - - /// v3.std.lookup / v3.std.algebra constructor shims that are authored in - /// `.dag` but currently cannot be emitted through ordinary expression - /// syntax. `miss_*_lookup` / `hit_*_lookup` lower to `Lookup::Miss` / - /// `Lookup::Hit(...)`; `unnamed_size_variable` lowers the optional - /// display label that `.dag` cannot yet construct inside record literals. - /// Runs before [`Self::render_realized_callable`] so a registered callable - /// strategy does not pre-empt enum lowering. - fn lookup_monomorphized_constructor_emit( - &self, - t: &TransformNode, - template: DeclarationId, - locals: &RenderLocals, - ) -> Result, EmitError> { - let Some(name) = self.dag.declaration(template).name.as_deref() else { - return Ok(None); - }; - let is_miss = name == "miss_int_lookup" - || name == "miss_symbolic_cost_lookup" - || name == "miss_declaration_id_lookup"; - let is_hit = name == "hit_int_lookup" - || name == "hit_symbolic_cost_lookup" - || name == "hit_declaration_id_lookup"; - if is_miss { - if !t.inputs.is_empty() { - return Err(EmitError::UnsupportedBehavior(format!( - "{name}() expects zero arguments" - ))); - } - return Ok(Some("Lookup::Miss".to_string())); - } - if is_hit { - if t.inputs.len() != 1 { - return Err(EmitError::UnsupportedBehavior(format!( - "{name}(v) expected one argument, got {}", - t.inputs.len() - ))); - } - let arg = self.elide_explicit_borrow(&self.render_input_use( - InputConsumer::Transform(t), - InputSlot::Positional(0), - locals, - )?); - let out = if arg.starts_with('(') { - format!("Lookup::Hit{arg}") - } else { - format!("Lookup::Hit({arg})") - }; - return Ok(Some(out)); - } - if name == "unnamed_size_variable" { - if t.inputs.len() != 1 { - return Err(EmitError::UnsupportedBehavior(format!( - "{name}(source_port) expected one argument, got {}", - t.inputs.len() - ))); - } - let arg = self.elide_explicit_borrow(&self.render_input_use( - InputConsumer::Transform(t), - InputSlot::Positional(0), - locals, - )?); - let source_port = if arg - .chars() - .all(|ch| ch.is_ascii_alphanumeric() || ch == '_') - { - format!("*{arg}") - } else { - arg - }; - return Ok(Some(format!( - "SizeVariable {{ source_port: {source_port}, display_name: None }}" - ))); - } - Ok(None) - } - - fn render_callable_transform( - &self, - t: &TransformNode, - target: DeclarationId, - locals: &RenderLocals, - ) -> Result { - let (template, arguments) = callable_template(target, self.dag); - if let Some(rendered) = self.lookup_monomorphized_constructor_emit(t, template, locals)? { - return Ok(rendered); - } - if let Some(rendered) = self.render_substrate_accessor(t, template, locals)? { - return Ok(rendered); - } - if let Some(strategy) = self.indexes.callables.get(&template) { - return self.render_realized_callable(t, template, *strategy, &arguments, locals); - } - self.render_general_callable(t, template, locals) - } - - /// DB-14 substrate-accessor dispatch. If the callable's target - /// decl is in `substrate_accessors` (a binding for the active - /// Rust target exists), render the realization's `carrier` - /// template via positional `{p0}`, `{p1}` substitution with the - /// Transform's input expressions. Otherwise return `None` and - /// let `render_callable_transform` fall through to the standard - /// dispatch. - /// - /// Design: the accessor's Arrow body stays `Unparsed` at bootstrap (the - /// `{ host }` stub) because the accessor → realization mapping is - /// TARGET-specific. The per-target resolution happens here, at emission - /// time, against this emitter's `substrate_accessors` index — which was - /// built from `SubstrateAccessorBinding` records filtered by - /// `language == rust_language`. See `build_substrate_accessor_index`. - fn render_substrate_accessor( - &self, - t: &TransformNode, - template: DeclarationId, - locals: &RenderLocals, - ) -> Result, EmitError> { - let Some(realization_id) = self.indexes.substrate_accessors.get(&template).copied() else { - // If the template IS a declared substrate accessor (in - // the universe of all `SubstrateAccessorBinding` - // records across languages) but has no binding for the - // active target, fail closed rather than fall through - // to generic callable rendering — that would emit - // `func(args)` for a function the target doesn't - // provide. Post review round 1b.4: "no binding for this - // target" on a declared accessor is not a benign miss. - if self.indexes.substrate_accessor_universe.contains(&template) { - let accessor_name = self - .dag - .declaration(template) - .name - .clone() - .unwrap_or_else(|| format!("declaration#{}", template.raw())); - return Err(EmitError::UnsupportedBehavior(format!( - "substrate accessor `{accessor_name}` has no SubstrateAccessorBinding for the active Rust target (`rust_language`); add `data _binding_rust: SubstrateAccessorBinding = {{ accessor: {accessor_name}, realization: , language: rust_language }}` in `src/v3/spec/rust.dag`" - ))); - } - return Ok(None); - }; - let realization = self.dag.declaration(realization_id); - let Some(ValueBody::Structural { fields }) = &realization.value_body else { - return Err(EmitError::UnsupportedBehavior(format!( - "substrate accessor realization for `{}` lacks a structural value body", - self.dag - .declaration(template) - .name - .as_deref() - .unwrap_or("") - ))); - }; - let carrier = fields - .iter() - .find_map(|(label, value)| match (label.as_str(), value) { - ("carrier", FieldValue::Literal(LiteralBits::String(s))) => Some(s.clone()), - _ => None, - }) - .ok_or_else(|| { - EmitError::UnsupportedBehavior(format!( - "substrate accessor realization `{}` is missing required String field `carrier`", - realization.name.as_deref().unwrap_or("") - )) - })?; - let rendered_inputs = t - .inputs - .iter() - .enumerate() - .map(|(slot, _)| { - self.render_input_use( - InputConsumer::Transform(t), - InputSlot::Positional(slot), - locals, - ) - }) - .collect::, _>>()?; - let placeholders: Vec = (0..rendered_inputs.len()) - .map(|i| format!("p{i}")) - .collect(); - let bindings: Vec<(&str, &str)> = placeholders - .iter() - .zip(rendered_inputs.iter()) - .map(|(p, expr)| (p.as_str(), expr.as_str())) - .collect(); - Ok(Some(render_named_template(&carrier, &bindings))) - } - - fn render_realized_callable( - &self, - consumer: &TransformNode, - template: DeclarationId, - strategy: RustCallableStrategyBinding, - arguments: &[TemplateArgument], - locals: &RenderLocals, - ) -> Result { - match strategy { - RustCallableStrategyBinding::ListEmpty => { - Ok(self.indexes.syntax.collection_ops.empty_list.clone()) - } - RustCallableStrategyBinding::ListSingleton => { - if consumer.inputs.len() != 1 { - return Err(EmitError::UnsupportedBehavior(format!( - "singleton arity {} is not supported; expected one runtime input", - consumer.inputs.len() - ))); - } - let value = self.render_input_use( - InputConsumer::Transform(consumer), - InputSlot::Positional(0), - locals, - )?; - Ok(render_named_template( - &self.indexes.syntax.collection_ops.list_literal, - &[("elements", &value)], - )) - } - RustCallableStrategyBinding::ListCons => { - if consumer.inputs.len() != 2 { - return Err(EmitError::UnsupportedBehavior(format!( - "cons arity {} is not supported; expected two runtime inputs", - consumer.inputs.len() - ))); - } - let head = self.render_input_use( - InputConsumer::Transform(consumer), - InputSlot::Positional(0), - locals, - )?; - let tail = self.render_input_use( - InputConsumer::Transform(consumer), - InputSlot::Positional(1), - locals, - )?; - Ok(render_named_template( - &self.indexes.syntax.collection_ops.cons, - &[("head", &head), ("tail", &tail)], - )) - } - RustCallableStrategyBinding::ListConcat => { - if consumer.inputs.len() != 2 { - return Err(EmitError::UnsupportedBehavior(format!( - "concat runtime arity {} is not supported; expected [left, right]", - consumer.inputs.len() - ))); - } - let left = self.render_input_use( - InputConsumer::Transform(consumer), - InputSlot::Positional(0), - locals, - )?; - let right = self.render_input_use( - InputConsumer::Transform(consumer), - InputSlot::Positional(1), - locals, - )?; - Ok(render_named_template( - &self.indexes.syntax.collection_ops.concat, - &[("left", &left), ("right", &right)], - )) - } - RustCallableStrategyBinding::ListLength => { - if consumer.inputs.len() != 1 { - return Err(EmitError::UnsupportedBehavior(format!( - "length runtime arity {} is not supported; expected [list]", - consumer.inputs.len() - ))); - } - let recv = self.render_collection_receiver( - InputConsumer::Transform(consumer), - InputSlot::Positional(0), - locals, - )?; - Ok(render_named_template( - &self.indexes.syntax.collection_ops.length, - &[("recv", &recv)], - )) - } - RustCallableStrategyBinding::ListIsEmpty => { - if consumer.inputs.len() != 1 { - return Err(EmitError::UnsupportedBehavior(format!( - "is_empty runtime arity {} is not supported; expected [list]", - consumer.inputs.len() - ))); - } - let recv = self.render_collection_receiver( - InputConsumer::Transform(consumer), - InputSlot::Positional(0), - locals, - )?; - Ok(render_named_template( - &self.indexes.syntax.collection_ops.is_empty, - &[("recv", &recv)], - )) - } - RustCallableStrategyBinding::ListFold => { - if consumer.inputs.len() != 2 { - return Err(EmitError::UnsupportedBehavior(format!( - "fold runtime arity {} is not supported; expected [list, init]", - consumer.inputs.len() - ))); - } - let fn_decl = bound_callable_argument(self.dag, template, arguments, 2)?; - let acc = "__fold_acc".to_string(); - let item = "__fold_item".to_string(); - let body = self.render_closure( - fn_decl, - &[ - (acc.clone(), LocalBinding::Owned(acc.clone())), - (item.clone(), LocalBinding::Borrowed(item.clone())), - ], - locals, - )?; - let list = self.render_collection_receiver( - InputConsumer::Transform(consumer), - InputSlot::Positional(0), - locals, - )?; - let init = self.render_input_use( - InputConsumer::Transform(consumer), - InputSlot::Positional(1), - locals, - )?; - Ok(render_named_template( - &self.indexes.syntax.collection_ops.fold, - &[("recv", &list), ("init", &init), ("body", &body)], - )) - } - RustCallableStrategyBinding::ListMap => { - if consumer.inputs.len() != 1 { - return Err(EmitError::UnsupportedBehavior(format!( - "map runtime arity {} is not supported; expected [list]", - consumer.inputs.len() - ))); - } - let fn_decl = bound_callable_argument(self.dag, template, arguments, 1)?; - let item = "__map_item".to_string(); - let body = self.render_closure( - fn_decl, - &[(item.clone(), LocalBinding::Borrowed(item.clone()))], - locals, - )?; - let list = self.render_collection_receiver( - InputConsumer::Transform(consumer), - InputSlot::Positional(0), - locals, - )?; - Ok(render_named_template( - &self.indexes.syntax.collection_ops.map, - &[("recv", &list), ("body", &body)], - )) - } - RustCallableStrategyBinding::ListFilter => { - if consumer.inputs.len() != 1 { - return Err(EmitError::UnsupportedBehavior(format!( - "filter runtime arity {} is not supported; expected [list]", - consumer.inputs.len() - ))); - } - let fn_decl = bound_callable_argument(self.dag, template, arguments, 1)?; - let item = "__filter_item".to_string(); - let predicate = self.render_callable_body( - fn_decl, - &[(item.clone(), LocalBinding::Borrowed(item.clone()))], - locals, - )?; - let list = self.render_collection_receiver( - InputConsumer::Transform(consumer), - InputSlot::Positional(0), - locals, - )?; - let iter = format!("&({list})"); - Ok(render_named_template( - &self.indexes.syntax.collection_ops.filter, - &[("iter", &iter), ("param", &item), ("body", &predicate)], - )) - } - RustCallableStrategyBinding::ListContains => { - if consumer.inputs.len() != 2 { - return Err(EmitError::UnsupportedBehavior(format!( - "contains runtime arity {} is not supported; expected [list, item]", - consumer.inputs.len() - ))); - } - let list = self.render_collection_receiver( - InputConsumer::Transform(consumer), - InputSlot::Positional(0), - locals, - )?; - let item = self.render_input_use( - InputConsumer::Transform(consumer), - InputSlot::Positional(1), - locals, - )?; - Ok(render_named_template( - &self.indexes.syntax.collection_ops.contains, - &[("recv", &list), ("item", &item)], - )) - } - } - } - - fn render_general_callable( - &self, - consumer: &TransformNode, - template: DeclarationId, - locals: &RenderLocals, - ) -> Result { - if let Some(rendered) = self.render_variant_constructor(consumer, template, locals)? { - return Ok(rendered); - } - if let Some(rendered) = self.render_record_constructor(consumer, template, locals)? { - return Ok(rendered); - } - let func = - self.dag - .declaration(template) - .name - .clone() - .ok_or(EmitError::UnsupportedBehavior( - "callable target is anonymous and cannot be rendered as a direct Rust call" - .to_string(), - ))?; - let args = consumer - .inputs - .iter() - .enumerate() - .map(|(slot, _)| { - self.render_input_use( - InputConsumer::Transform(consumer), - InputSlot::Positional(slot), - locals, - ) - }) - .collect::, _>>()?; - let joined = join_rendered(&args, ", "); - Ok(render_named_template( - &self.indexes.syntax.expressions.function_call, - &[("func", &func), ("args", &joined)], - )) - } - - fn render_record_constructor( - &self, - consumer: &TransformNode, - template: DeclarationId, - locals: &RenderLocals, - ) -> Result, EmitError> { - let decl = self.dag.declaration(template); - let Some(type_name) = &decl.name else { - return Ok(None); - }; - let TypeConnective::Conj { children } = &decl.connective else { - return Ok(None); - }; - if children.len() != consumer.inputs.len() { - return Err(EmitError::UnsupportedBehavior(format!( - "record constructor `{type_name}` expected {} field input(s), got {}", - children.len(), - consumer.inputs.len() - ))); - } - let fields = children - .iter() - .enumerate() - .map(|(slot, field)| { - let value = self.render_input_use( - InputConsumer::Transform(consumer), - InputSlot::Positional(slot), - locals, - )?; - Ok(render_named_template( - &self.indexes.syntax.values.struct_field_init, - &[("name", &field.label), ("value", &value)], - )) - }) - .collect::, EmitError>>()?; - let joined = join_rendered(&fields, &self.indexes.syntax.values.struct_field_separator); - Ok(Some(render_named_template( - &self.indexes.syntax.values.struct_literal, - &[("type", type_name), ("fields", &joined)], - ))) - } - - fn render_variant_constructor( - &self, - consumer: &TransformNode, - template: DeclarationId, - locals: &RenderLocals, - ) -> Result, EmitError> { - let Some((enum_name, variant_name)) = variant_parent_info(self.dag, template) else { - return Ok(None); - }; - let qualified_name = self.qualified_name(&enum_name, &variant_name); - let TypeConnective::Conj { children } = &self.dag.declaration(template).connective else { - return Ok(None); - }; - if children.len() != consumer.inputs.len() { - return Err(EmitError::UnsupportedBehavior(format!( - "variant constructor `{qualified_name}` expected {} payload field(s), got {}", - children.len(), - consumer.inputs.len() - ))); - } - if children.is_empty() { - return Ok(Some(qualified_name)); - } - // Dissolution: same "tuple `Hit` for `v3.std.lookup` only" bridge as - // `render_single_field_variant_pattern` (pattern side); see long comment - // there. Until variant payload positionality is DAG-carried, keep narrow. - // `ViolatesSubject::AtBehavior` tuple emission matches `dimension.rs`. - if children.len() == 1 - && children[0].label == "_0" - && enum_name == "Witness" - && variant_name == "Inhabits" - { - let value = self.elide_explicit_borrow(&self.render_input_use( - InputConsumer::Transform(consumer), - InputSlot::Positional(0), - locals, - )?); - // `render_input_use` may already clone when moving out of a match arm - // binding; avoid `((x).clone()).clone()` noise (and clone side effects). - let payload = if value.contains(".clone()") { - value - } else { - format!("({value}).clone()") - }; - return Ok(Some(format!("{qualified_name}({payload})"))); - } - if children.len() == 1 - && children[0].label == "_0" - && enum_name == "Lookup" - && variant_name == "Hit" - { - let value = self.elide_explicit_borrow(&self.render_input_use( - InputConsumer::Transform(consumer), - InputSlot::Positional(0), - locals, - )?); - // `elide` may leave a parenthesized value (`(0)`) for literals; do not - // add a second paren layer (`((0))`). - let out = if value.starts_with('(') { - format!("{qualified_name}{value}") - } else { - format!("{qualified_name}({value})") - }; - return Ok(Some(out)); - } - // `ViolatesSubject::AtBehavior(Behavior)` is a Rust **tuple** variant in - // `dimension.rs` (`std/dimensions.dag` unary payload). Default emit would render - // `{ _0: … }` struct init and fail against the hand mirror tuple shape. - if children.len() == 1 - && children[0].label == "_0" - && enum_name == "ViolatesSubject" - && variant_name == "AtBehavior" - { - let value = self.elide_explicit_borrow(&self.render_input_use( - InputConsumer::Transform(consumer), - InputSlot::Positional(0), - locals, - )?); - let payload = if value.contains(".clone()") { - value - } else { - format!("({value}).clone()") - }; - return Ok(Some(format!("{qualified_name}({payload})"))); - } - let fields = children - .iter() - .enumerate() - .map(|(slot, field)| { - let value = self.render_input_use( - InputConsumer::Transform(consumer), - InputSlot::Positional(slot), - locals, - )?; - Ok(render_named_template( - &self.indexes.syntax.values.struct_field_init, - &[("name", &field.label), ("value", &value)], - )) - }) - .collect::, EmitError>>()?; - let joined = join_rendered(&fields, &self.indexes.syntax.values.struct_field_separator); - Ok(Some(render_named_template( - &self.indexes.syntax.values.variant_named_construction, - &[("variant", &qualified_name), ("fields", &joined)], - ))) - } - - fn qualified_name(&self, left: &str, right: &str) -> String { - format!( - "{left}{}{right}", - self.indexes.syntax.modules.path_separator - ) - } - - fn render_callable_body( - &self, - callable_decl: DeclarationId, - param_bindings: &[(String, LocalBinding)], - outer_locals: &RenderLocals, - ) -> Result { - let TypeConnective::Arrow { inputs, body, .. } = - &self.dag.declaration(callable_decl).connective - else { - return Err(EmitError::UnsupportedBehavior( - "callable template binding did not resolve to an Arrow declaration".to_string(), - )); - }; - let ArrowBody::UserDefined(bind_id) = body else { - return Err(EmitError::UnsupportedBehavior( - "external or unparsed callable bodies are not yet supported in staged std.list emission" - .to_string(), - )); - }; - let bind = (*bind_id).bind(self.dag); - if inputs.len() != param_bindings.len() { - return Err(EmitError::UnsupportedBehavior( - "callable parameter count does not match the requested Rust closure parameters" - .to_string(), - )); - } - if bind.params.len() < inputs.len() { - return Err(EmitError::UnsupportedBehavior( - "callable bind parameter count does not match Arrow inputs".to_string(), - )); - } - let capture_count = bind.params.len() - inputs.len(); - let mut locals = RenderLocals::default(); - for capture in bind.params.iter().copied().take(capture_count) { - let value = self.render_port(capture, outer_locals, RenderMode::BorrowedRead)?; - locals.names.insert(capture, LocalBinding::Borrowed(value)); - } - for (port, (_, binding)) in bind - .params - .iter() - .copied() - .skip(capture_count) - .zip(param_bindings.iter()) - { - locals.names.insert(port, binding.clone()); - } - self.render_port(bind.value, &locals, RenderMode::OwnedConstructLastUse) - } - - fn render_closure( - &self, - callable_decl: DeclarationId, - param_bindings: &[(String, LocalBinding)], - outer_locals: &RenderLocals, - ) -> Result { - let body = self.render_callable_body(callable_decl, param_bindings, outer_locals)?; - let joined = join_rendered( - ¶m_bindings - .iter() - .map(|(name, _)| name.clone()) - .collect::>(), - ", ", - ); - Ok(render_named_template( - &self.indexes.syntax.expressions.closure, - &[("params", &joined), ("body", &body)], - )) - } - - fn render_loop( - &self, - l: &crate::dag::LoopNode, - locals: &RenderLocals, - ) -> Result { - let body_port = super::behavior_result_port(self.dag.node(l.body)); - self.render_port(body_port, locals, RenderMode::OwnedConstructLastUse) - } - - fn render_function_declaration( - &self, - declaration: &crate::dag::Declaration, - ) -> Result { - let Some(name) = &declaration.name else { - return Err(EmitError::UnsupportedBehavior( - "anonymous Arrow declarations cannot be emitted as top-level Rust functions" - .to_string(), - )); - }; - let TypeConnective::Arrow { - inputs, - output, - body, - } = &declaration.connective - else { - return Err(EmitError::UnsupportedBehavior( - "render_function_declaration expected an Arrow declaration".to_string(), - )); - }; - if !declaration.type_params.is_empty() { - return Err(EmitError::UnsupportedBehavior( - "generic user-defined functions are not yet supported by emit_rust".to_string(), - )); - } - let ArrowBody::UserDefined(bind_id) = body else { - return Err(EmitError::UnsupportedBehavior( - "external or unparsed Arrow bodies are not yet supported in function emission" - .to_string(), - )); - }; - let bind = (*bind_id).bind(self.dag); - let param_dispositions = self.callable_param_dispositions(declaration.id, inputs.len()); - let mut locals = RenderLocals::default(); - let mut output_callable_walk = HashSet::new(); - // C-8 / #676: there is no separate "return-only" / `AppliedTypeArguments` walk. The - // return slot uses the same `decl_includes_first_class_arrow_data` as struct derives / - // storage — including `Instantiation` (args **and** non-`List` **template**), so - // first-class `fn` living only "under" a template head still sets this flag. That - // unifies with `rust_type_name_for_user_function_parameter` (compose `Rc` when the - // return carries callable data anywhere). - let return_includes_first_class_arrow = - self.decl_includes_first_class_arrow_data(*output, &mut output_callable_walk); - let params = bind - .params - .iter() - .zip(param_dispositions.iter()) - .enumerate() - .map(|(idx, (port, disposition))| { - let param_name = format!("p{idx}"); - let ty_decl = self - .dag - .port(*port) - .value_type() - .ok_or(EmitError::UntypedPort(*port))? - .declaration; - let callable_param_ty = self.type_declaration_peels_to_arrow(ty_decl); - let ty = self.rust_type_name_for_user_function_parameter( - *port, - *disposition, - return_includes_first_class_arrow, - )?; - match disposition { - ParameterDispositionBinding::Borrowed - if self.read_strategy() == ReadStrategyBinding::Borrow - && !callable_param_ty => - { - locals - .names - .insert(*port, LocalBinding::Borrowed(param_name.clone())); - } - _ => { - locals - .names - .insert(*port, LocalBinding::Owned(param_name.clone())); - } - } - Ok(render_named_template( - &self.indexes.syntax.functions.param_with_type, - &[("name", ¶m_name), ("type", &ty)], - )) - }) - .collect::, EmitError>>()?; - if bind.params.len() != inputs.len() { - return Err(EmitError::UnsupportedBehavior( - "function bind parameter count does not match Arrow inputs".to_string(), - )); - } - let params_joined = join_rendered(¶ms, &self.indexes.syntax.functions.param_separator); - let ret = self - .indexes - .types - .get(output) - .map(|binding| binding.carrier.clone()) - .or_else(|| self.rust_type_name_for_port(bind.value).ok()) - .ok_or(EmitError::MissingTypeRealization { target: *output })?; - let body = self.render_port(bind.value, &locals, RenderMode::OwnedConstructLastUse)?; - let rendered = render_named_template( - match self.mode { - EmitRustMode::Program => &self.indexes.syntax.functions.definition, - EmitRustMode::Module => &self.indexes.syntax.functions.definition_exported, - }, - &[ - ("name", name), - ("params", ¶ms_joined), - ("ret", &ret), - ("body", &body), - ], - ); - Ok(rendered) - } - - fn render_type_declaration( - &self, - declaration: &crate::dag::Declaration, - ) -> Result { - let Some(name) = &declaration.name else { - return Err(EmitError::UnsupportedBehavior( - "anonymous type declarations cannot be emitted".to_string(), - )); - }; - if !declaration.type_params.is_empty() { - return Err(EmitError::UnsupportedBehavior(format!( - "generic type declaration `{name}` is not yet supported by emit_rust" - ))); - } - match &declaration.connective { - TypeConnective::Conj { children } => { - // `Rc` fields are not `Debug`. `rust_type_defs.struct_def` still - // carries `#[derive(Clone, Debug)]` for ordinary records — when any field - // transitively holds first-class `fn` data, use `rust_record_derive_templates` - // instead (`struct_def_no_debug`: clone-only). See `decl_includes_first_class_arrow_data` - // and `emit_callable_field_types_use_rc_dyn_fn_storage` (INVARIANTS.md C-8). - let omit_debug = children.iter().any(|field| { - let mut visited = HashSet::new(); - self.decl_includes_first_class_arrow_data(field.ty, &mut visited) - }); - let fields = children - .iter() - .map(|field| self.render_struct_field(field)) - .collect::, _>>()?; - let fields_joined = join_rendered(&fields, " "); - let template = if omit_debug { - &self - .indexes - .syntax - .record_derive_no_debug - .struct_def_no_debug - } else { - &self.indexes.syntax.type_definitions.struct_def - }; - Ok(render_named_template( - template, - &[("name", name), ("fields", &fields_joined)], - )) - } - TypeConnective::Disj { variants } => { - // Same `Debug` omission as records when variant payloads carry `Rc`. - let omit_debug = variants.iter().any(|variant| { - let mut visited = HashSet::new(); - self.decl_includes_first_class_arrow_data(variant.ty, &mut visited) - }); - let rendered_variants = variants - .iter() - .map(|variant| self.render_enum_variant(variant)) - .collect::, _>>()?; - let variants_joined = join_rendered(&rendered_variants, " "); - let template = if omit_debug { - &self.indexes.syntax.record_derive_no_debug.enum_def_no_debug - } else { - &self.indexes.syntax.type_definitions.enum_def - }; - Ok(render_named_template( - template, - &[("name", name), ("variants", &variants_joined)], - )) - } - _ => Err(EmitError::UnsupportedBehavior(format!( - "type declaration `{name}` does not lower to a record or sum shape" - ))), - } - } - - fn render_struct_field(&self, field: &Field) -> Result { - // Record fields are **not** `impl Trait` positions. First-class `fn` - // types use the storage carrier (`Rc`) under - // `ArrowRustEmitPolicy::StorageRcDynFn` — never `rust_arrow_as_parameter_impl_fn_clone` - // (PR #676 inline review / INVARIANTS.md C-8 fail-closed vs plausible Rust). - let ty = self.rust_type_name_for_decl_storage(field.ty)?; - Ok(render_named_template( - &self.indexes.syntax.type_definitions.struct_field, - &[("name", &field.label), ("type", &ty)], - )) - } - - fn render_enum_variant(&self, variant: &Field) -> Result { - let variant_decl = self.dag.declaration(variant.ty); - let TypeConnective::Conj { children } = &variant_decl.connective else { - return Err(EmitError::UnsupportedBehavior(format!( - "enum variant `{}` does not lower to a product declaration", - variant.label - ))); - }; - if children.is_empty() { - return Ok(render_named_template( - &self.indexes.syntax.type_definitions.enum_unit_variant, - &[("name", &variant.label)], - )); - } - let fields = children - .iter() - .map(|field| { - let rendered = self.render_struct_field(field)?; - Ok(rendered.replacen("pub ", "", 1)) - }) - .collect::, _>>()?; - let fields_joined = join_rendered(&fields, " "); - Ok(render_named_template( - &self.indexes.syntax.type_definitions.enum_data_variant, - &[("name", &variant.label), ("fields", &fields_joined)], - )) - } - - /// Sort a Branch's paths into (then, else) for if/else emission. - /// Walks the scrutinee's port type to its Disj children, finds - /// the True/False variants (resolved against `Classical` / Bool) - /// by structural position, and matches each path's - /// ResolvedVariant declaration id against them. Zero name - /// strings — the True/False distinction comes from the - /// scrutinee's Disj order, which is itself a fact of std/logic.dag. - fn split_bool_paths<'p>(&self, b: &'p BranchNode) -> Result<(&'p Path, &'p Path), EmitError> { - // The scrutinee's type tells us which Disj we're branching - // on. For `if cond then ... else ...`, that's `Classical` - // (Bool) and its variants are the True/False markers. - let scrutinee_type_id = primitive_type_id_for_port(self.dag, b.input)?; - let disj_id = walk_to_disj(self.dag, scrutinee_type_id).ok_or_else(|| { - EmitError::UnsupportedBehavior(format!( - "branch scrutinee type at {scrutinee_type_id:?} does not walk to a Disj" - )) - })?; - let variants: Vec<&Field> = match &self.dag.declaration(disj_id).connective { - TypeConnective::Disj { variants } => variants.iter().collect(), - _ => unreachable!("walk_to_disj returned a non-Disj"), - }; - if variants.len() != 2 { - return Err(EmitError::NonBooleanBranch { - variant_ids: variants.iter().map(|v| v.ty).collect(), - }); - } - // Convention: in std/logic.dag's Classical declaration, - // the first variant is True and the second is False - // (`type Classical = True | False`). The emitter uses - // structural position, not the variant labels — same way - // infer.rs reads patterns post-resolution. - let true_variant_id = variants[0].ty; - let false_variant_id = variants[1].ty; - - let mut then_path: Option<&Path> = None; - let mut else_path: Option<&Path> = None; - for path in &b.paths { - let resolved_id = match &path.pattern { - BranchPattern::ResolvedVariant(id) => *id, - BranchPattern::UnresolvedVariant { name, .. } => { - return Err(EmitError::UnresolvedBranchPattern { - variant_name: name.clone(), - }); - } - }; - if resolved_id == true_variant_id { - then_path = Some(path); - } else if resolved_id == false_variant_id { - else_path = Some(path); - } else { - return Err(EmitError::NonBooleanBranch { - variant_ids: vec![resolved_id], - }); - } - } - match (then_path, else_path) { - (Some(t), Some(e)) => Ok((t, e)), - _ => Err(EmitError::UnsupportedBehavior( - "if/else branch must have both True and False arms".to_string(), - )), - } - } - - /// Rust type for a **user `fn` item parameter** only (`render_function_declaration`). - /// Record / enum payload field types never call this helper: they use - /// `render_struct_field` → `rust_type_name_for_decl_storage` (`Rc` - /// for first-class `fn` data; INVARIANTS.md C-8 / PR #676 inline review). - /// - /// Callable-shaped parameters use `impl Fn(...) -> T + Clone` (v2 / PR #650) - /// **unless** the function's declared return type carries first-class `fn` - /// anywhere — then callable parameters use `std::rc::Rc` so - /// pass-through composes with the return type (rustc `E0308` otherwise). - /// Other parameters use `rust_type_name_for_port` / - /// `rust_borrowed_type_name_for_port`. - fn rust_type_name_for_user_function_parameter( - &self, - port: PortId, - disposition: ParameterDispositionBinding, - return_includes_first_class_arrow: bool, - ) -> Result { - let ty_decl = self - .dag - .port(port) - .value_type() - .ok_or(EmitError::UntypedPort(port))? - .declaration; - if self.type_declaration_peels_to_arrow(ty_decl) { - if return_includes_first_class_arrow { - return self.rust_type_name_for_decl_storage(ty_decl); - } - return self.rust_arrow_as_parameter_impl_fn_clone(ty_decl); - } - match disposition { - ParameterDispositionBinding::Borrowed - if self.read_strategy() == ReadStrategyBinding::Borrow => - { - self.rust_borrowed_type_name_for_port(port) - } - _ => self.rust_type_name_for_port(port), - } - } - - /// `impl Fn(...) -> R + Clone` for a first-class `fn` type used **only** - /// in direct user-function parameter position (this is **not** the - /// context-free `rust_type_name_for_decl_with_policy` renderer — record - /// fields / `Vec<…>` / etc. never call here). Nested parameter/return types - /// use `rust_type_name_for_decl_storage` (`Rc`). See - /// `ArrowRustEmitPolicy` and `src/v3/spec/rust.dag` (first-class callable note). - /// Future: lift the two spellings into `rust.dag` `TypeRealization`-style rows - /// for full THESIS “declared target realization” parity (today: policy + spec comment). - fn rust_arrow_as_parameter_impl_fn_clone( - &self, - declaration: DeclarationId, - ) -> Result { - let Some((inputs, output)) = self.peel_resolved_chain_to_first_class_arrow(declaration) - else { - return Err(EmitError::UnsupportedBehavior( - "rust_arrow_as_parameter_impl_fn_clone: declaration does not peel to Arrow" - .to_string(), - )); - }; - let param_types = inputs - .iter() - .map(|i| self.rust_type_name_for_decl_storage(*i)) - .collect::, _>>()?; - let param_str = param_types.join(", "); - let ret_str = self.rust_type_name_for_decl_storage(output)?; - Ok(format!("impl Fn({param_str}) -> {ret_str} + Clone")) - } - - /// Rust type spelling for a port in **storage-class** positions: resolves the - /// port's value type to a declaration id, then `rust_type_name_for_decl_storage` - /// (including the `types` realization index when populated). Not used for user - /// `fn` parameters — those use `rust_type_name_for_user_function_parameter` first. - fn rust_type_name_for_port(&self, port: PortId) -> Result { - let ty = self - .dag - .port(port) - .value_type() - .ok_or(EmitError::UntypedPort(port))?; - self.rust_type_name_for_decl_storage(ty.declaration) - } - - /// Rust type spelling for a port consumed under **borrow** read strategy - /// when the port is **not** a first-class callable (`fn` data) type. - /// Callable-shaped user `fn` parameters are routed in - /// `rust_type_name_for_user_function_parameter` **before** this helper is - /// consulted (`impl Fn + Clone` or `Rc` per return composition). - /// Non-callable ports delegate to `rust_borrowed_type_name_for_decl` (`&T` / - /// `&[U]` only). - fn rust_borrowed_type_name_for_port(&self, port: PortId) -> Result { - let ty = self - .dag - .port(port) - .value_type() - .ok_or(EmitError::UntypedPort(port))?; - self.rust_borrowed_type_name_for_decl(ty.declaration) - } - - fn port_is_substrate_result(&self, port: PortId) -> Result { - let ty = self - .dag - .port(port) - .value_type() - .ok_or(EmitError::UntypedPort(port))?; - let mut visited = HashSet::new(); - Ok(self.decl_is_substrate_result_rec(ty.declaration, &mut visited)) - } - - fn decl_is_substrate_result_rec( - &self, - declaration: DeclarationId, - visited: &mut HashSet, - ) -> bool { - if !visited.insert(declaration) { - return false; - } - let decl = self.dag.declaration(declaration); - match &decl.connective { - TypeConnective::Instantiation { template, .. } => { - super::substrate_result_type_decl_suppressed_for_emit( - self.dag, - self.dag.declaration(*template), - ) || self.decl_is_substrate_result_rec(*template, visited) - } - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - self.decl_is_substrate_result_rec(*next, visited) - } - _ => super::substrate_result_type_decl_suppressed_for_emit(self.dag, decl), - } - } - - /// Peel `ResolvedBy{Structure,Name}` atoms, and **zero-arity - /// `Instantiation` aliases** (`type G = F` lower as `Instantiate(F, []);` - /// not `ResolvedByName`) until a first-class `TypeConnective::Arrow` with - /// `ArrowBody::NoBody` is found. - /// `None` on cycle, on `ArrowBody::UserDefined` / other heads, or when no - /// such arrow is reachable. - fn peel_resolved_chain_to_first_class_arrow( - &self, - mut declaration: DeclarationId, - ) -> Option<(Vec, DeclarationId)> { - let mut visited = HashSet::new(); - loop { - if !visited.insert(declaration) { - return None; - } - let decl = self.dag.declaration(declaration); - match &decl.connective { - TypeConnective::Arrow { - inputs, - output, - body: ArrowBody::NoBody, - } => { - return Some((inputs.clone(), *output)); - } - TypeConnective::Arrow { .. } => return None, - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - declaration = *next; - } - TypeConnective::Instantiation { - template, - arguments, - } if arguments.is_empty() => { - declaration = *template; - } - _ => return None, - } - } - } - - /// True when `declaration` (after peeling `ResolvedBy*` and zero-arity - /// `Instantiation` type aliases) is a first-class function type (`fn(...) -> _` in surface), - /// i.e. a `TypeConnective::Arrow` with `ArrowBody::NoBody` (data `fn`, not a - /// user `fn` item's `ArrowBody::UserDefined`). - fn type_declaration_peels_to_arrow(&self, declaration: DeclarationId) -> bool { - self.peel_resolved_chain_to_first_class_arrow(declaration) - .is_some() - } - - /// Bootstrap `Int` / `Bool` / `String` type roots. Their expanded substrate - /// (rings, algebras) contains `TypeConnective::Arrow` for operations, not - /// first-class `fn` data — we must not confuse that with a user `fn` when - /// classifying a **return** type; see `decl_includes_first_class_arrow_data`. - /// - /// **Extension / dissolve:** a new std primitive with the same - /// algebra-`Arrow` pattern (e.g. `Float`, `Bytes`) must extend - /// `Dag::first_class_fn_walk_bootstrap_prune_type_shapes` in the same PR, or - /// replace with a `Dag`-driven "numeric / algebra" classification. - fn declaration_is_bootstrap_int_bool_string(&self, declaration: DeclarationId) -> bool { - self.dag - .first_class_fn_walk_bootstrap_prune_type_shapes() - .iter() - .any(|s| s.declaration == declaration) - } - - /// True when `declaration` (including nested record / sum / instantiations) - /// carries first-class `fn` (`TypeConnective::Arrow` + `ArrowBody::NoBody`) - /// anywhere, so (a) storage positions use `Rc` and (b) `Debug` - /// is omitted for user `struct` / `enum` derives. Used for return-vs-param - /// callable **carrier** selection (user `fn` params) and for derive - /// templates. - /// - /// For `Instantiation`, we walk type **arguments** and, when the head is - /// not the `List` template, the **template** (so a user `G` can carry - /// callable data on `G` without it appearing in `T`). The `List` head and - /// the `PartialFunction` head (surface `Map`) are skipped: the first - /// is always element-shaped in `T`; the second is a `Conj` of algebra - /// `Arrow`+`NoBody` *operations* (lookup, insert, …) that must not be - /// taken for user first-class `fn` *values* (C-8; #676). - /// The primitive check above **short-circuits** `-> Int` (etc.) so we do - /// not follow those type roots into ring/algebra noise. - fn decl_includes_first_class_arrow_data( - &self, - declaration: DeclarationId, - visited: &mut HashSet, - ) -> bool { - if !visited.insert(declaration) { - return false; - } - if self.declaration_is_bootstrap_int_bool_string(declaration) { - return false; - } - if self.type_declaration_peels_to_arrow(declaration) { - return true; - } - let decl = self.dag.declaration(declaration); - match &decl.connective { - TypeConnective::Conj { children } => children - .iter() - .any(|field| self.decl_includes_first_class_arrow_data(field.ty, visited)), - TypeConnective::Disj { variants } => variants - .iter() - .any(|variant| self.decl_includes_first_class_arrow_data(variant.ty, visited)), - TypeConnective::Instantiation { - template, - arguments, - } => { - let from_args = arguments - .iter() - .any(|arg| self.decl_includes_first_class_arrow_data(arg.value, visited)); - from_args - || (!self.is_list_template(*template) - && !self.is_partial_function_template(*template) - && self.decl_includes_first_class_arrow_data(*template, visited)) - } - TypeConnective::Cardinality(p) => { - self.decl_includes_first_class_arrow_data(p.element(), visited) - } - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - self.decl_includes_first_class_arrow_data(*next, visited) - } - _ => false, - } - } - - /// `&T` / `&[U]` spellings for borrowed emission. **Does not** handle peeled - /// callable `Arrow` types — callers must use - /// `rust_type_name_for_user_function_parameter` for user `fn` parameters - /// (which selects `impl Fn + Clone` vs `Rc` before borrow paths). - fn rust_borrowed_type_name_for_decl( - &self, - declaration: DeclarationId, - ) -> Result { - let decl = self.dag.declaration(declaration); - match &decl.connective { - TypeConnective::Instantiation { - template, - arguments, - } => { - if self.is_list_template(*template) { - let [element] = arguments.as_slice() else { - return Err(EmitError::UnsupportedBehavior( - "borrowed List carrier expects exactly one type argument".to_string(), - )); - }; - let element_name = self.rust_type_name_for_decl_storage(element.value)?; - Ok(format!("&[{element_name}]")) - } else { - Ok(format!( - "&{}", - self.rust_type_name_for_decl_storage(declaration)? - )) - } - } - _ => Ok(format!( - "&{}", - self.rust_type_name_for_decl_storage(declaration)? - )), - } - } - - /// Vetted storage positions (`Rc`) for anonymous `fn` types. - fn rust_type_name_for_decl_storage( - &self, - declaration: DeclarationId, - ) -> Result { - self.rust_type_name_for_decl_with_policy( - declaration, - 0, - ArrowRustEmitPolicy::StorageRcDynFn, - ) - } - - fn rust_type_name_for_decl_with_policy( - &self, - declaration: DeclarationId, - depth: usize, - arrow_policy: ArrowRustEmitPolicy, - ) -> Result { - if depth >= 32 { - return Err(EmitError::UnsupportedBehavior( - "type-name rendering exceeded depth 32 — likely a cycle".to_string(), - )); - } - if let Some(binding) = self.indexes.types.get(&declaration) { - return Ok(binding.carrier.clone()); - } - if let Some(named_peer) = - gate60_realized_named_compose_peer(self.dag, &self.indexes.types, declaration) - { - if let Some(binding) = self.indexes.types.get(&named_peer) { - return Ok(binding.carrier.clone()); - } - return Err(EmitError::MissingTypeRealization { target: named_peer }); - } - let decl = self.dag.declaration(declaration); - if let Some(name) = &decl.name { - // Named user `struct` / `sum` (record or enum) are the Rust name authority - // for a field like `cb: Callback` when `Callback` is its own `type` item, - // even if that record transitively contains first-class `fn` storage — do - // not run the alias-only `decl_includes_first_class_arrow_data` fast-path - // below (codex #676: `Wrapper { cb: Callback }` with `Callback { f: fn… }`). - if matches!( - &decl.connective, - TypeConnective::Conj { .. } | TypeConnective::Disj { .. } - ) { - return Ok(name.clone()); - } - // `type F = fn(...) -> _` is a **named** declaration whose connective is - // `Arrow` + `NoBody`. The Rust layer does not emit a `type F = …` typedef - // for first-class `fn` data, so returning `F` would be plausible but - // invalid (P3 fail-closed; #676). Fall through to the `Arrow` arm for - // `Rc` or `UnsupportedBehavior` per `arrow_policy`. - let is_named_first_class_fn_alias = matches!( - &decl.connective, - TypeConnective::Arrow { - body: ArrowBody::NoBody, - .. - } - ); - // A **chain** `type G = F` with `F = fn..` is lowered as - // `Instantiation(F, [])` (and sometimes `ResolvedByName`); a bare - // `G` is invalid in Rust like a bare `F` (#676, P3, Codex). - // When peeling finds first-class `fn` under the alias, skip this - // return and use the `Instantiation` / `Arrow` path below. - // - // `type L = List` (or `Map<.., fn..>`, etc.) does **not** peel - // to a top-level `Arrow` — but `list` / `value` args still carry - // first-class `fn` data. Emitting the bare `L` would be an undefined - // Rust name (C-8; #676) — `decl_includes_first_class_arrow_data` matches - // the same carrier rules as `decl_includes` on struct fields. - if !is_named_first_class_fn_alias - && self - .peel_resolved_chain_to_first_class_arrow(declaration) - .is_none() - { - let mut first_class_fn_walk = std::collections::HashSet::new(); - if !self.decl_includes_first_class_arrow_data(declaration, &mut first_class_fn_walk) - { - return Ok(name.clone()); - } - } - } - match &decl.connective { - // `type G = F` → `Instantiate(F, [])` (see `type_to_connective`); alias is - // not a `List`/`Map` template realization. - TypeConnective::Instantiation { - template, - arguments, - } if arguments.is_empty() => { - self.rust_type_name_for_decl_with_policy(*template, depth + 1, arrow_policy) - } - TypeConnective::Instantiation { - template, - arguments, - } => self.render_instantiated_type(*template, arguments, depth + 1, arrow_policy), - TypeConnective::Cardinality(p) - if p.bound() == crate::dag::CardinalityBound::AtMostOne => - { - let inner = - self.rust_type_name_for_decl_with_policy(p.element(), depth + 1, arrow_policy)?; - Ok(render_named_template( - &self.indexes.syntax.type_applications.optional, - &[("element", &inner)], - )) - } - // Named user `Conj` / `Disj`: a field may hold first-class `fn` data, so - // `decl_includes_first_class_arrow_data` can block the **alias** fast - // path above — this connective is still a real `pub struct` / `enum` we - // emit, and the bare name is a valid forward reference in other - // parameter / return positions (PR #676 follow-up, claude review). - TypeConnective::Conj { .. } | TypeConnective::Disj { .. } => { - if let Some(n) = &decl.name { - Ok(n.clone()) - } else { - Err(EmitError::MissingTypeRealization { target: declaration }) - } - } - // First-class anonymous `fn` (`ArrowBody::NoBody` only): `impl Fn + Clone` is **not** - // produced here — only `StorageRcDynFn` → `Rc` or - // `RejectFirstClassFn` → `UnsupportedBehavior` (INVARIANTS.md C-8). - // `Arrow` with `UserDefined` / other bodies is a user `fn` item shape, not - // first-class `fn` data — fail closed if it reaches storage rendering (P3). - TypeConnective::Arrow { - inputs, - output, - body: ArrowBody::NoBody, - } => match arrow_policy { - ArrowRustEmitPolicy::RejectFirstClassFn => Err(EmitError::UnsupportedBehavior( - "emit_rust: first-class function type (`fn(...) -> _` / TypeConnective::Arrow) \ - in an unsupported Rust type-name context; supported carriers are: user `fn` \ - parameters via `rust_type_name_for_user_function_parameter` (`impl Fn + \ - Clone`, or `std::rc::Rc` when the return type carries a first-class \ - `fn` so param/ret compose), and struct fields / collection instantiations / \ - top-level `let` / inferred return slots via `rust_type_name_for_decl_storage` \ - (`std::rc::Rc`). See `src/v3/spec/rust.dag` header on first-class callable surfaces." - .to_string(), - )), - ArrowRustEmitPolicy::StorageRcDynFn => { - let param_types = inputs - .iter() - .map(|i| { - self.rust_type_name_for_decl_with_policy( - *i, - depth + 1, - ArrowRustEmitPolicy::StorageRcDynFn, - ) - }) - .collect::, _>>()?; - let param_str = param_types.join(", "); - let ret_str = self.rust_type_name_for_decl_with_policy( - *output, - depth + 1, - ArrowRustEmitPolicy::StorageRcDynFn, - )?; - Ok(format!("std::rc::Rc {ret_str}>")) - } - }, - TypeConnective::Arrow { .. } => Err(EmitError::UnsupportedBehavior( - "emit_rust: TypeConnective::Arrow reached storage type-name rendering with a \ - body other than `ArrowBody::NoBody`; only first-class anonymous `fn` data may \ - use the `std::rc::Rc` carrier here. User-defined function arrows must \ - not be lowered through `rust_type_name_for_decl_storage`." - .to_string(), - )), - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - self.rust_type_name_for_decl_with_policy(*next, depth + 1, arrow_policy) - } - _ => Err(EmitError::MissingTypeRealization { - target: declaration, - }), - } - } - - fn render_instantiated_type( - &self, - template: DeclarationId, - arguments: &[TemplateArgument], - depth: usize, - arrow_policy: ArrowRustEmitPolicy, - ) -> Result { - let Some(binding) = self.indexes.instantiations.get(&template) else { - return Err(EmitError::MissingTypeRealization { target: template }); - }; - match arguments { - [element] => { - let element_name = self.rust_type_name_for_decl_with_policy( - element.value, - depth + 1, - arrow_policy, - )?; - Ok(render_named_template( - &binding.carrier, - &[("element", &element_name)], - )) - } - [key, value] => { - let key_name = - self.rust_type_name_for_decl_with_policy(key.value, depth + 1, arrow_policy)?; - let value_name = self.rust_type_name_for_decl_with_policy( - value.value, - depth + 1, - arrow_policy, - )?; - Ok(render_named_template( - &binding.carrier, - &[("key", &key_name), ("value", &value_name)], - )) - } - [key, value, extra] => { - let key_name = - self.rust_type_name_for_decl_with_policy(key.value, depth + 1, arrow_policy)?; - let value_name = self.rust_type_name_for_decl_with_policy( - value.value, - depth + 1, - arrow_policy, - )?; - let extra_name = self.rust_type_name_for_decl_with_policy( - extra.value, - depth + 1, - arrow_policy, - )?; - Ok(render_named_template( - &binding.carrier, - &[ - ("key", &key_name), - ("value", &value_name), - ("extra", &extra_name), - ], - )) - } - _ => Err(EmitError::UnsupportedBehavior(format!( - "instantiated type carrier for declaration {:?} only supports arities 1, 2, and 3 at PR scope", - template - ))), - } - } - - fn port_is_copy(&self, port: PortId) -> Result { - let ty = self - .dag - .port(port) - .value_type() - .ok_or(EmitError::UntypedPort(port))?; - let mut visited = HashSet::new(); - self.decl_is_copy_rec(ty.declaration, &mut visited) - } - - fn decl_is_copy_rec( - &self, - declaration: DeclarationId, - visited: &mut HashSet, - ) -> Result { - if !visited.insert(declaration) { - // Self-referential cycle. A recursive type holds itself, - // which requires heap indirection on every target we emit — - // it is never Copy. - return Ok(false); - } - let decl = self.dag.declaration(declaration); - if let Some(binding) = self.indexes.types.get(&declaration) { - return Ok(binding.is_copy); - } - match &decl.connective { - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - self.decl_is_copy_rec(*next, visited) - } - // For user-defined Conj/Disj/Instantiation/Cardinality - // types without an explicit TypeRealization, conservatively - // return false. The emitter derives `#[derive(Clone, Debug)]` - // (not Copy) on user-defined types, so recursing through the - // algebra and reporting "all leaves are Copy → composite is - // Copy" mismatches the emitted Rust and produces use-after- - // move errors. The cycle guard above still applies if a - // future user-defined type recursively contains itself. - TypeConnective::Conj { .. } - | TypeConnective::Disj { .. } - | TypeConnective::Instantiation { .. } - | TypeConnective::Cardinality(_) - | TypeConnective::Arrow { .. } => Ok(false), - _ => Ok(false), - } - } - - fn port_is_list(&self, port: PortId) -> Result { - let ty = self - .dag - .port(port) - .value_type() - .ok_or(EmitError::UntypedPort(port))?; - self.decl_is_list(ty.declaration) - } - - fn decl_is_list(&self, declaration: DeclarationId) -> Result { - let decl = self.dag.declaration(declaration); - match &decl.connective { - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => self.decl_is_list(*next), - TypeConnective::Instantiation { template, .. } => Ok(self.is_list_template(*template)), - _ => Ok(self.is_list_template(declaration)), - } - } - - fn is_list_template(&self, declaration: DeclarationId) -> bool { - self.dag - .list_template() - .is_some_and(|list| list == declaration) - } - - /// `Map` instantiates the std `PartialFunction` record; its fields are - /// not user first-class `fn` as in `peel_resolved_chain_to_first_class_arrow`. - fn is_partial_function_template(&self, declaration: DeclarationId) -> bool { - self.dag - .partial_function_template() - .is_some_and(|pfun| pfun == declaration) - } -} - -/// Anonymous specialized `Disj` nodes from `lower::specialize_decl_for_lowering` -/// set `specialization_parent = Some(template_disj_id)` so Rust emit can recover -/// the template enum name without cloning `Declaration::name` onto a second -/// declaration id (P2 / single-authority metadata for `Dag::declaration_by_name`). -/// -/// Returns the template's `Declaration::name` once a named `Disj` is reached. -fn named_disj_enum_name_for_rust_match_emit( - dag: &Dag, - mut disj_id: DeclarationId, -) -> Option { - // Chains are one hop in practice (`specialize_decl_for_lowering`); 32 matches - // `specialize_decl_for_lowering`'s depth bound so a bug cannot spin forever. - for _ in 0..32 { - let decl = dag.declaration(disj_id); - let TypeConnective::Disj { .. } = &decl.connective else { - return None; - }; - if let Some(name) = decl.name.clone() { - return Some(name); - } - disj_id = decl.specialization_parent?; - } - None -} - -fn variant_name_for_decl( - dag: &Dag, - disj_id: DeclarationId, - variant_id: DeclarationId, -) -> Result { - let TypeConnective::Disj { variants } = &dag.declaration(disj_id).connective else { - unreachable!("variant_name_for_decl requires a Disj parent") - }; - variants - .iter() - .find(|variant| variant.ty == variant_id) - .map(|variant| variant.label.clone()) - .ok_or_else(|| { - EmitError::UnsupportedBehavior(format!( - "variant {variant_id:?} was not found under parent disjunction {disj_id:?}" - )) - }) -} - -fn variant_parent_info(dag: &Dag, variant_id: DeclarationId) -> Option<(String, String)> { - dag.declarations().iter().find_map(|decl| { - let enum_name = decl.name.as_ref()?; - let TypeConnective::Disj { variants } = &decl.connective else { - return None; - }; - variants - .iter() - .find(|variant| variant.ty == variant_id) - .map(|variant| (enum_name.clone(), variant.label.clone())) - }) -} - -fn callable_template(target: DeclarationId, dag: &Dag) -> (DeclarationId, Vec) { - match &dag.declaration(target).connective { - TypeConnective::Instantiation { - template, - arguments, - } => (*template, arguments.clone()), - _ => (target, Vec::new()), - } -} - -fn bound_callable_argument( - dag: &Dag, - template: DeclarationId, - arguments: &[TemplateArgument], - input_index: usize, -) -> Result { - let TypeConnective::Arrow { inputs, .. } = &dag.declaration(template).connective else { - return Err(EmitError::UnsupportedBehavior( - "realized callable template did not resolve to an Arrow declaration".to_string(), - )); - }; - let Some(param_decl) = inputs.get(input_index).copied() else { - return Err(EmitError::UnsupportedBehavior(format!( - "realized callable slot {} is missing from the template declaration", - input_index - ))); - }; - arguments - .iter() - .find(|arg| arg.parameter == param_decl) - .map(|arg| arg.value) - .ok_or_else(|| { - EmitError::UnsupportedBehavior( - "realized callable argument did not bind through template instantiation" - .to_string(), - ) - }) -} - -fn rust_string_literal_body(s: &str) -> String { - let mut out = String::new(); - for c in s.chars() { - match c { - '\\' => out.push_str("\\\\"), - '"' => out.push_str("\\\""), - '\n' => out.push_str("\\n"), - '\r' => out.push_str("\\r"), - '\t' => out.push_str("\\t"), - c if c.is_ascii() && !c.is_control() => out.push(c), - c => { - use std::fmt::Write; - let _ = write!(&mut out, "\\u{{{:X}}}", c as u32); - } - } - } - out -} - -fn render_value(v: &ValueNode, literals: &LiteralSyntaxBinding) -> String { - match &v.data { - LiteralBits::Int(decimal) => decimal.clone(), - LiteralBits::Bool(true) => literals.true_keyword.clone(), - LiteralBits::Bool(false) => literals.false_keyword.clone(), - LiteralBits::String(s) | LiteralBits::Symbol(s) => format!( - "String::from({}{}{})", - literals.string_delimiter, - rust_string_literal_body(s), - literals.string_delimiter - ), - } -} - -/// Walk a port's resolved TypeShape declaration through anonymous -/// aliases (`Atom(ResolvedIdentifier)`) and instantiations -/// (`TypeConnective::Instantiation`) until it lands on the first -/// **named** declaration. Returns that declaration's id. -/// -/// **Why named-declaration stop.** The realization indexes are -/// keyed by the canonical declaration ids of the named primitives -/// declared in std/ (`Int`, `Bool`, `String`, etc.). When a port's -/// `TypeShape` points at an anonymous wrapper (e.g. an -/// `Instantiation { template: Int, .. }` allocated by -/// `type_to_declaration_id` for compound types), the walk steps -/// through the wrapper to the named declaration the realization -/// references. When the port's TypeShape is a named alias like -/// `type CommitSha = String`, the walk stops at `CommitSha` — -/// callers see the alias's id directly. If the realization index -/// has no entry for the alias, the lookup fails with -/// `MissingTypeRealization` carrying the alias id, which is the -/// honest signal: the realization spec needs to declare the alias -/// (or M2+ adds an alias-walking dispatch via meta_tag chains). -/// -/// At PR-B scope the walk depth is bounded to 32 to catch any -/// runaway cycles; the std/ types we actually consume bottom out -/// in 1–2 hops. -fn primitive_type_id_for_port(dag: &Dag, port: PortId) -> Result { - primitive_type_id_for_port_shared(dag, port).map_err(|err| match err { - SharedEmitLookupError::UntypedPort(port) => EmitError::UntypedPort(port), - SharedEmitLookupError::Unsupported(detail) => EmitError::UnsupportedBehavior(detail), - }) -} - -fn walk_to_conj(dag: &Dag, start: DeclarationId) -> Option { - let mut current = start; - for _ in 0..32 { - let decl = dag.declaration(current); - match &decl.connective { - TypeConnective::Conj { .. } => return Some(current), - TypeConnective::Instantiation { template, .. } => current = *template, - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => current = *next, - _ => return None, - } - } - None -} - -fn is_optional_match_disj(dag: &Dag, disj_id: DeclarationId) -> bool { - dag.declarations() - .iter() - .filter_map(|decl| dag.optional_match_disj(decl.id)) - .any(|optional_disj| optional_disj == disj_id) -} - -/// Resolve the algebra-field declaration id for a given operand -/// type and `OperatorKind`. Walks the operand type's instantiation -/// chain to the algebra Conj (e.g. OrderedRing for Int), then finds -/// the field whose label matches the operator's algebra field name. -/// Returns the field's child declaration id, which the rust.dag -/// `op: OrderedRing.add` reference also resolves to via the -/// dotted-path lowering. -/// -/// **Why this is acceptable as a thin bridge.** The -/// `OperatorKind::algebra_field_name()` lookup is the substrate's -/// existing operator → field mapping (already used by -/// `infer::resolve_operator_arrow`). It IS a name comparison, but -/// the name lives once in the generated operators authority -/// (`operators_generated.rs`, re-exported via `crate::operators`) -/// and the resolved declaration id is what flows downstream. -/// The emitter doesn't repeat the comparison; it asks this helper -/// for the field id and uses it as a typed index key. -fn algebra_field_for_operator( - dag: &Dag, - operand_type_id: DeclarationId, - op: OperatorKind, -) -> Result { - algebra_field_for_operator_shared(dag, operand_type_id, op).map_err(|err| match err { - SharedEmitLookupError::UntypedPort(port) => EmitError::UntypedPort(port), - SharedEmitLookupError::Unsupported(detail) => EmitError::UnsupportedBehavior(detail), - }) -} - -#[cfg(test)] -mod tests { - use std::collections::HashSet; - - use super::*; - use crate::compile_to_dag; - use crate::diagnostics::SourceSpan; - - #[test] - fn first_class_fn_walk_does_not_confuse_map_partial_function_with_user_fn() { - let dag = compile_to_dag("let _x: Int = 0\n", "t.v3").expect("compiles"); - let map = dag - .declaration_by_name("Map") - .expect("Map from std should load in bootstrap") - .id; - let indexes = RealizationIndexes::build(&dag).expect("indexes build"); - let input_use_facts = InputUseFacts::build(&dag, &indexes); - let bound_names: HashMap = HashMap::new(); - let ctx = Ctx { - dag: &dag, - indexes: &indexes, - bound_names: &bound_names, - input_use_facts: &input_use_facts, - mode: EmitRustMode::Module, - }; - let mut visited = HashSet::new(); - assert!( - !ctx.decl_includes_first_class_arrow_data(map, &mut visited), - "`Map`'s `PartialFunction` head carries `Arrow`+`NoBody` for algebra operations, \ -not user `fn` data; must not set return-carrier / Rc on callable params (PR #676)" - ); - } - - #[test] - fn rust_collection_ops_selects_higher_order_inline_templates() { - let dag = Dag::new(); - let rust_collection_ops = dag - .declaration_by_name("rust_collection_ops") - .expect("rust collection ops spec exists") - .id; - - let binding = parse_collection_ops(&dag, rust_collection_ops) - .expect("rust collection ops binding parses"); - - assert_eq!( - binding.filter, - "{ let __filter_source = {iter}; let mut __result = Vec::new(); for {param} in __filter_source.iter() { if {body} { __result.push((*{param}).clone()); } } __result }" - ); - - let fields = - structural_fields_for_decl(&dag, rust_collection_ops).expect("collection ops fields"); - for (field, method, expected) in [ - ( - "flat_map_contract", - dag.flat_map_method_decl().expect("flat_map_method"), - "{ let mut __result = Vec::new(); for {param} in {iter} { __result.extend({inner_iter}); } __result }", - ), - ( - "any_contract", - dag.any_method_decl().expect("any_method"), - "{ let mut __found = false; for {param} in {iter} { if {body} { __found = true; break; } } __found }", - ), - ( - "all_contract", - dag.all_method_decl().expect("all_method"), - "{ let mut __all = true; for {param} in {iter} { if !({body}) { __all = false; break; } } __all }", - ), - ] { - let contract = - require_field_decl_ref(fields, field, rust_collection_ops).expect("contract ref"); - let template = method_template_contract_decl_emit_template( - &dag, contract, field, method, - ) - .expect("higher-order contract template"); - assert_eq!( - require_higher_order_inline_template(template, contract) - .expect("higher-order inline template"), - expected - ); - } - } - - #[test] - fn rust_collection_ops_rejects_single_template_for_higher_order_selection() { - let dag = Dag::new(); - let rust_collection_ops = dag - .declaration_by_name("rust_collection_ops") - .expect("rust collection ops spec exists") - .id; - let fields = - structural_fields_for_decl(&dag, rust_collection_ops).expect("collection ops fields"); - let length_contract = - require_field_decl_ref(fields, "length_contract", rust_collection_ops) - .expect("length contract ref"); - let length_method = dag - .declaration_by_name("length_method") - .expect("length method registry row exists") - .id; - - let single = method_template_contract_decl_emit_template( - &dag, - length_contract, - "length_contract", - length_method, - ) - .expect("length_contract has a SingleTemplate emit template"); - let err = require_higher_order_inline_template(single, length_contract) - .expect_err("SingleTemplate must not satisfy a higher-order CollectionOps field"); - - assert!(matches!( - err, - EmitError::MalformedTargetSyntax { - declaration, - detail: - "Rust CollectionOps higher-order MethodTemplateContract must use MethodEmitTemplate.HigherOrderTemplates", - } if declaration == length_contract - )); - } - - #[test] - fn render_field_project_reads_borrowed_nodes_without_cloning() { - let mut dag = Dag::new(); - let parent_port = dag.alloc_port(None); - let dag_type = dag - .dag_type_decl() - .expect("Dag type realization target exists"); - let dag_nodes_type = match &dag.declaration(dag_type).connective { - TypeConnective::Conj { children } => { - children - .iter() - .find(|field| field.label == "nodes") - .expect("Dag.nodes field") - .ty - } - other => panic!("Dag must be a Conj, got {other:?}"), - }; - dag.set_port_type(parent_port, crate::types::TypeShape::new(dag_type)); - let node_id = dag.alloc_node_id(); - let output = dag.alloc_port(Some(node_id)); - dag.push_node(Behavior::Transform(TransformNode { - id: node_id, - target: TransformTarget::ResolvedFieldProject { - field_label: "nodes".to_string(), - }, - inputs: vec![parent_port], - output, - span: SourceSpan::new("", 0, 0), - })); - dag.set_port_type(output, crate::types::TypeShape::new(dag_nodes_type)); - - let indexes = RealizationIndexes::build(&dag).expect("indexes build"); - let input_use_facts = InputUseFacts::build(&dag, &indexes); - let mut bound_names = HashMap::new(); - bound_names.insert(parent_port, LocalBinding::Owned("parent".to_string())); - let ctx = Ctx { - dag: &dag, - indexes: &indexes, - bound_names: &bound_names, - input_use_facts: &input_use_facts, - mode: EmitRustMode::Program, - }; - - let rendered = match dag.node(node_id) { - Behavior::Transform(t) => ctx - .render_transform(t, &RenderLocals::default(), RenderMode::BorrowedRead) - .expect("field project renders"), - other => panic!("expected Transform node, got {other:?}"), - }; - assert_eq!(rendered, "(parent).nodes()"); - } - - #[test] - fn render_field_project_constructs_owned_list_from_borrowed_nodes() { - let mut dag = Dag::new(); - let parent_port = dag.alloc_port(None); - let dag_type = dag - .dag_type_decl() - .expect("Dag type realization target exists"); - let dag_nodes_type = match &dag.declaration(dag_type).connective { - TypeConnective::Conj { children } => { - children - .iter() - .find(|field| field.label == "nodes") - .expect("Dag.nodes field") - .ty - } - other => panic!("Dag must be a Conj, got {other:?}"), - }; - dag.set_port_type(parent_port, crate::types::TypeShape::new(dag_type)); - - let mut test_node_ids = Vec::new(); - for _ in 0..2 { - let node_id = dag.alloc_node_id(); - let output = dag.alloc_port(Some(node_id)); - dag.push_node(Behavior::Transform(TransformNode { - id: node_id, - target: TransformTarget::ResolvedFieldProject { - field_label: "nodes".to_string(), - }, - inputs: vec![parent_port], - output, - span: SourceSpan::new("", 0, 0), - })); - dag.set_port_type(output, crate::types::TypeShape::new(dag_nodes_type)); - test_node_ids.push(node_id); - } - - // Query by the specific node we just pushed — earlier Transform - // nodes in `dag.nodes()` belong to bootstrap-loaded std modules - // and have no `parent` binding in `bound_names`, which renders - // as the empty-list fallback rather than the expected projection. - let first_transform = match dag.node(test_node_ids[0]) { - Behavior::Transform(t) => t, - other => panic!("pushed transform went missing, got {other:?}"), - }; - let indexes = RealizationIndexes::build(&dag).expect("indexes build"); - let input_use_facts = InputUseFacts::build(&dag, &indexes); - let mut bound_names = HashMap::new(); - bound_names.insert(parent_port, LocalBinding::Owned("parent".to_string())); - let ctx = Ctx { - dag: &dag, - indexes: &indexes, - bound_names: &bound_names, - input_use_facts: &input_use_facts, - mode: EmitRustMode::Program, - }; - - let rendered = ctx - .render_transform( - first_transform, - &RenderLocals::default(), - RenderMode::OwnedConstruct, - ) - .expect("field project renders"); - assert_eq!(rendered, "((parent).nodes()).to_vec()"); - } - - #[test] - fn render_fold_iterates_named_list_input_by_borrow() { - let dag = compile_to_dag( - "let total: Int = fold(singleton(1), 0, |acc, x| acc + x)", - "test.v3", - ) - .expect("compiles"); - let fold_template = dag.std_list_fold_decl().expect("fold decl"); - let fold_transform = dag - .nodes() - .iter() - .find_map(|node| match node { - Behavior::Transform(t) => match &t.target { - TransformTarget::Callable(target) => { - let (template, _) = callable_template(*target, &dag); - (template == fold_template).then_some(t) - } - _ => None, - }, - _ => None, - }) - .expect("fold transform"); - - let indexes = RealizationIndexes::build(&dag).expect("indexes build"); - let input_use_facts = InputUseFacts::build(&dag, &indexes); - let mut bound_names = HashMap::new(); - bound_names.insert( - fold_transform.inputs[0], - LocalBinding::Owned("xs".to_string()), - ); - let ctx = Ctx { - dag: &dag, - indexes: &indexes, - bound_names: &bound_names, - input_use_facts: &input_use_facts, - mode: EmitRustMode::Program, - }; - - let rendered = ctx - .render_transform( - fold_transform, - &RenderLocals::default(), - RenderMode::OwnedConstruct, - ) - .expect("fold renders"); - assert!( - rendered.contains("(xs).iter().fold("), - "expected named list inputs to be iterated by borrow, got: {rendered}" - ); - } - - #[test] - fn rendering_model_read_strategy_controls_function_parameter_shape() { - let mut dag = compile_to_dag( - "type Sign = Plus | Minus -fn classify(s: Sign) -> Int = match s { Plus => 0, Minus => 1 }", - "test.v3", - ) - .expect("compiles"); - let rendering_decl = dag.rust_rendering_spec().expect("rust_rendering cached"); - let pass_by_value = dag - .emit_model_variants() - .read_strategy - .pass_by_value - .expect("ReadStrategy.PassByValue exists"); - let copy_or_clone = dag - .emit_model_variants() - .construct_strategy - .copy_or_clone - .expect("ConstructStrategy.CopyOrClone exists"); - dag.declaration_mut(rendering_decl).value_body = Some(ValueBody::Structural { - fields: vec![ - ( - "read".to_string(), - FieldValue::Variant { - constructor: pass_by_value, - payload: Vec::new(), - }, - ), - ( - "construct".to_string(), - FieldValue::Variant { - constructor: copy_or_clone, - payload: Vec::new(), - }, - ), - ], - }); - - let rendered = emit_rust_with_mode(&dag, EmitRustMode::Module).expect("emits"); - assert!( - rendered.contains("fn classify(p0: Sign) -> i64 {"), - "expected PassByValue read strategy to render owned function params, got: {rendered}" - ); - } - - #[test] - fn module_function_visibility_comes_from_rust_function_syntax() { - let mut dag = - compile_to_dag("fn classify(s: Int) -> Int = s", "test.v3").expect("compiles"); - let functions_decl = dag - .rust_functions_syntax_decl() - .expect("rust_functions declaration"); - dag.declaration_mut(functions_decl).value_body = Some(ValueBody::Structural { - fields: vec![ - ( - "definition".to_string(), - FieldValue::Literal(LiteralBits::String( - "fn {name}({params}) -> {ret} { {body} }".to_string(), - )), - ), - ( - "definition_exported".to_string(), - FieldValue::Literal(LiteralBits::String( - "pub(crate) fn {name}({params}) -> {ret} { {body} }".to_string(), - )), - ), - ( - "definition_void".to_string(), - FieldValue::Literal(LiteralBits::String( - "fn {name}({params}) { {body} }".to_string(), - )), - ), - ( - "param_with_type".to_string(), - FieldValue::Literal(LiteralBits::String("{name}: {type}".to_string())), - ), - ( - "param_separator".to_string(), - FieldValue::Literal(LiteralBits::String(", ".to_string())), - ), - ], - }); - - let rendered = emit_rust_with_mode(&dag, EmitRustMode::Module).expect("emits"); - assert!( - rendered.contains("pub(crate) fn classify("), - "expected module-mode function visibility to come from rust_functions.definition_exported, got: {rendered}" - ); - assert!( - !rendered.contains("pub fn classify("), - "expected handwritten `pub ` prefix logic to be gone, got: {rendered}" - ); - } - - #[test] - fn clean_emission_rejects_rust_invalid_pattern_binding_variants() { - let assert_rejected = - |pick: fn(&crate::dag::PatternBindingRuleVariants) -> Option, - expected_detail: &'static str| { - let mut dag = compile_to_dag( - "type Sign = Plus | Minus -fn classify(s: Sign) -> Int = match s { Plus => 0, Minus => 1 }", - "test.v3", - ) - .expect("compiles"); - let clean_decl = dag - .rust_clean_emission_spec() - .expect("rust_clean_emission cached"); - let invalid_ctor = pick(dag.pattern_binding_rule_variants()) - .expect("PatternBindingRule variant cached"); - dag.declaration_mut(clean_decl).value_body = Some(ValueBody::Structural { - fields: vec![( - "pattern_bindings".to_string(), - FieldValue::Variant { - constructor: invalid_ctor, - payload: Vec::new(), - }, - )], - }); - - let err = emit_rust_with_mode(&dag, EmitRustMode::Module) - .expect_err("Rust-invalid pattern binding rule must fail closed"); - assert!(matches!( - err, - EmitError::MalformedTargetSyntax { - declaration, - detail, - } if declaration == clean_decl && detail == expected_detail - )); - }; - - assert_rejected( - |v| v.emit_prefixed, - "rust_clean_emission.pattern_bindings cannot use PatternBindingRule.EmitPrefixedUnderscoreWhenUnused; Rust only supports EmitBindingAlways or EmitUnderscoreWhenUnused", - ); - assert_rejected( - |v| v.not_applicable, - "rust_clean_emission.pattern_bindings cannot use PatternBindingRule.NotApplicablePatternBinding; Rust only supports EmitBindingAlways or EmitUnderscoreWhenUnused", - ); - } - - #[test] - fn callable_disposition_derives_direct_return_as_consumed() { - let dag = compile_to_dag("fn id(x: Int) -> Int = x", "direct_return.v3").expect("compiles"); - let indexes = RealizationIndexes::build(&dag).expect("indexes build"); - let id_decl = dag.declaration_by_name("id").expect("id decl").id; - assert_eq!( - indexes.callable_dispositions.get(&id_decl), - Some(&vec![ParameterDispositionBinding::Consumed]), - ); - } - - #[test] - fn callable_disposition_keeps_match_scrutinee_borrowed() { - let dag = compile_to_dag( - "fn head_or_zero(list: List) -> Int = match list { Empty => 0, Cons(payload) => payload.head }", - "match_payload.v3", - ) - .expect("compiles"); - let indexes = RealizationIndexes::build(&dag).expect("indexes build"); - let decl = dag - .declaration_by_name("head_or_zero") - .expect("head_or_zero decl") - .id; - assert_eq!( - indexes.callable_dispositions.get(&decl), - Some(&vec![ParameterDispositionBinding::Borrowed]), - ); - } - - #[test] - fn callable_disposition_keeps_nested_lambda_capture_borrowed() { - let dag = compile_to_dag( - "fn apply_to_three(f: fn(Int) -> Int) -> Int = f(3) -fn use_callback(base: Int) -> Int = apply_to_three(|x| base + x)", - "nested_lambda.v3", - ) - .expect("compiles"); - let indexes = RealizationIndexes::build(&dag).expect("indexes build"); - let decl = dag - .declaration_by_name("use_callback") - .expect("use_callback decl") - .id; - assert_eq!( - indexes.callable_dispositions.get(&decl), - Some(&vec![ParameterDispositionBinding::Borrowed]), - ); - } - - /// B1 — `require_parameter_dispositions` is fail-closed against - /// arity, slot duplication, and out-of-range slots, so a spec - /// CallableRealization can't silently drift from the callable's - /// declared Arrow input arity. - #[test] - fn parameter_dispositions_reject_arity_drift_and_slot_collisions() { - let dag = compile_to_dag("fn id(x: Int) -> Int = x", "arity_drift.v3").expect("compiles"); - let bogus_decl = dag.declaration_by_name("id").expect("id decl").id; - let borrowed = dag - .emit_model_variants() - .parameter_disposition - .borrowed - .expect("Borrowed"); - let consumed = dag - .emit_model_variants() - .parameter_disposition - .consumed - .expect("Consumed"); - let entry = |slot: i64, ctor: DeclarationId| { - FieldValue::Record(vec![ - ( - "slot".to_string(), - FieldValue::Literal(LiteralBits::Int(slot.to_string())), - ), - ( - "disposition".to_string(), - FieldValue::Variant { - constructor: ctor, - payload: vec![], - }, - ), - ]) - }; - let bind = - |entries: Vec| vec![("parameters".to_string(), FieldValue::List(entries))]; - - // Arity too low: 1 entry expected, 0 supplied. - let fields = bind(vec![]); - assert!(matches!( - require_parameter_dispositions(&dag, &fields, bogus_decl, 1), - Err(EmitError::MalformedRealization { .. }), - )); - - // Arity too high: 1 entry expected, 2 supplied. - let fields = bind(vec![entry(0, borrowed), entry(1, borrowed)]); - assert!(matches!( - require_parameter_dispositions(&dag, &fields, bogus_decl, 1), - Err(EmitError::MalformedRealization { .. }), - )); - - // Slot duplication: both entries claim slot 0. - let fields = bind(vec![entry(0, borrowed), entry(0, consumed)]); - assert!(matches!( - require_parameter_dispositions(&dag, &fields, bogus_decl, 2), - Err(EmitError::MalformedRealization { .. }), - )); - - // Out-of-range slot: arity is 1 but entry claims slot 5. - let fields = bind(vec![entry(5, borrowed)]); - assert!(matches!( - require_parameter_dispositions(&dag, &fields, bogus_decl, 1), - Err(EmitError::MalformedRealization { .. }), - )); - - // Negative slot: rejected before the bound check. - let fields = bind(vec![entry(-1, borrowed)]); - assert!(matches!( - require_parameter_dispositions(&dag, &fields, bogus_decl, 1), - Err(EmitError::MalformedRealization { .. }), - )); - - // Well-formed: each slot in [0, arity) exactly once. Returns a - // Vec of length `expected_arity`, indexed by slot. - let fields = bind(vec![entry(1, borrowed), entry(0, consumed)]); - let result = require_parameter_dispositions(&dag, &fields, bogus_decl, 2) - .expect("well-formed parameters parse"); - assert_eq!( - result, - vec![ - ParameterDispositionBinding::Consumed, - ParameterDispositionBinding::Borrowed, - ], - ); - } - - /// B11 (post-refactor) — shared realizations are owned via a - /// typed `language: DeclarationRef` pointing at the target's - /// language-spec declaration, NOT a TargetLanguage enum variant. - /// Each emitter compares the typed reference to its cached - /// language-spec id at index-build time. A realization whose - /// surface name is `rust_*` but whose `language` refers to - /// `go_language` is owned by Go. - #[test] - fn target_language_is_typed_reference_to_language_spec() { - let dag = compile_to_dag("fn id(x: Int) -> Int = x", "lang_ref.v3").expect("compiles"); - let rust_language_id = dag - .rust_language_spec() - .expect("rust_language cached after bootstrap"); - let go_language_id = dag - .go_language_spec() - .expect("go_language cached after bootstrap"); - // Rust and Go have distinct language-spec declaration ids, so - // comparing a realization's `language` field to the cached id - // partitions entries cleanly. This is the structural signal - // that replaced the TargetLanguage enum roster. - assert_ne!(rust_language_id, go_language_id); - } - - /// Boundary check for `PatternRealization.empty_variant` / - /// `cons_variant`. The substrate types these as `DeclarationRef`, - /// which is unconstrained — nothing in the grammar rejects - /// `empty_variant: Int` under `target: List`. `validate_pattern_roles` - /// enforces "must be a variant of `target`" at parse time. This test - /// pins the rejection so later refactors can't silently drop it. - #[test] - fn validate_pattern_roles_rejects_non_variant_empty_ref() { - let dag = Dag::new(); - let bool_id = dag - .bool_shape() - .expect("Bool is a Disj in bootstrap std") - .declaration; - let int_id = dag.int_shape().expect("Int in bootstrap std").declaration; - // Pick a real Bool variant for `cons_variant` so only - // `empty_variant` is the illegal pointer. - let bool_variant_ty = match &dag.declaration(bool_id).connective { - TypeConnective::Disj { variants } => variants[0].ty, - other => panic!("Bool should be a Disj, got {other:?}"), - }; - let binding = PatternRealizationBinding { - empty_variant: int_id, - cons_variant: bool_variant_ty, - scrutinee: "{expr}".into(), - empty_pattern: "[]".into(), - cons_pattern: "[{head}, {tail} @ ..]".into(), - head_expr: "{head}".into(), - tail_expr: "{tail}".into(), - }; - let result = validate_pattern_roles(&dag, bool_id, &binding, bool_id); - match result { - Err(EmitError::MalformedRealization { detail, .. }) => { - assert!( - detail.contains("empty_variant must be a variant"), - "unexpected detail: {detail}" - ); - } - other => { - panic!("expected MalformedRealization for non-variant empty_variant, got {other:?}") - } - } - } - - /// Mirror of the above for `cons_variant`. Distinct test so a future - /// regression on only one of the two role checks is caught narrowly. - #[test] - fn validate_pattern_roles_rejects_non_variant_cons_ref() { - let dag = Dag::new(); - let bool_id = dag - .bool_shape() - .expect("Bool is a Disj in bootstrap std") - .declaration; - let int_id = dag.int_shape().expect("Int in bootstrap std").declaration; - let bool_variant_ty = match &dag.declaration(bool_id).connective { - TypeConnective::Disj { variants } => variants[0].ty, - other => panic!("Bool should be a Disj, got {other:?}"), - }; - let binding = PatternRealizationBinding { - empty_variant: bool_variant_ty, - cons_variant: int_id, - scrutinee: "{expr}".into(), - empty_pattern: "[]".into(), - cons_pattern: "[{head}, {tail} @ ..]".into(), - head_expr: "{head}".into(), - tail_expr: "{tail}".into(), - }; - let result = validate_pattern_roles(&dag, bool_id, &binding, bool_id); - match result { - Err(EmitError::MalformedRealization { detail, .. }) => { - assert!( - detail.contains("cons_variant must be a variant"), - "unexpected detail: {detail}" - ); - } - other => { - panic!("expected MalformedRealization for non-variant cons_variant, got {other:?}") - } - } - } - - /// Distinct-variants check: even if both refs are valid variants of - /// `target`, they must not be the same one — the branch shape needs - /// two distinct arms. Pins the third clause of `validate_pattern_roles`. - #[test] - fn validate_pattern_roles_rejects_aliased_role_refs() { - let dag = Dag::new(); - let bool_id = dag - .bool_shape() - .expect("Bool is a Disj in bootstrap std") - .declaration; - let bool_variant_ty = match &dag.declaration(bool_id).connective { - TypeConnective::Disj { variants } => variants[0].ty, - other => panic!("Bool should be a Disj, got {other:?}"), - }; - let binding = PatternRealizationBinding { - empty_variant: bool_variant_ty, - cons_variant: bool_variant_ty, - scrutinee: "{expr}".into(), - empty_pattern: "[]".into(), - cons_pattern: "[{head}, {tail} @ ..]".into(), - head_expr: "{head}".into(), - tail_expr: "{tail}".into(), - }; - let result = validate_pattern_roles(&dag, bool_id, &binding, bool_id); - match result { - Err(EmitError::MalformedRealization { detail, .. }) => { - assert!( - detail.contains("must be distinct"), - "unexpected detail: {detail}" - ); - } - other => panic!("expected MalformedRealization for aliased role refs, got {other:?}"), - } - } - - #[test] - fn named_disj_enum_name_for_rust_match_emit_follows_specialization_parent_to_named_template() { - use crate::dag::Declaration; - - let mut dag = Dag::new(); - let template_id = dag - .declarations() - .iter() - .find(|d| { - matches!(&d.connective, TypeConnective::Disj { .. }) - && d.name.as_deref() == Some("Classical") - }) - .expect("bootstrap `Classical` sum") - .id; - - let anon_id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: anon_id, - name: None, - connective: TypeConnective::Disj { - variants: Vec::new(), - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: Some(template_id), - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("", 0, 0), - }); - - assert_eq!( - named_disj_enum_name_for_rust_match_emit(&dag, anon_id).as_deref(), - Some("Classical") - ); - assert_eq!( - named_disj_enum_name_for_rust_match_emit(&dag, template_id).as_deref(), - Some("Classical") - ); - } - - #[test] - fn rust_type_name_parallel_spawn_send_safe_accepts_plain_types() { - assert!(rust_type_name_parallel_spawn_send_safe("i64")); - assert!(rust_type_name_parallel_spawn_send_safe("bool")); - assert!(rust_type_name_parallel_spawn_send_safe("Vec")); - } - - #[test] - fn rust_type_name_parallel_spawn_send_safe_rejects_first_class_callable_surfaces() { - assert!(!rust_type_name_parallel_spawn_send_safe( - "std::rc::Rc i64>" - )); - assert!(!rust_type_name_parallel_spawn_send_safe( - "impl Fn(i64) -> i64 + Clone" - )); - } - - #[test] - fn rust_type_name_parallel_spawn_send_safe_rejects_interior_mutability_spellings() { - assert!(!rust_type_name_parallel_spawn_send_safe( - "::std::cell::RefCell" - )); - } -} diff --git a/src/v3/compiler/src/emit_host_bridge.rs b/src/v3/compiler/src/emit_host_bridge.rs deleted file mode 100644 index 5809e31e56d..00000000000 --- a/src/v3/compiler/src/emit_host_bridge.rs +++ /dev/null @@ -1,675 +0,0 @@ -//! Host transport rows for `v4.compiler.emit_host` (`run_emit_host_rust` / `run_emit_host_python` / `run_emit_host_go`). -//! -//! **Modeled authority:** `src/v4/compiler/emit_host.dag` — executable host-process boundary is -//! `tools/emit_host_runner`; substrate `.dag` assembles `EmitHostRunReceipt` from typed host facts. -//! This module is the W3 bridge exercised by integration tests until T-22 substrate eval dispatches -//! host transport directly (dissolves `emit_host_transport_not_wired`). - -use emit_host_runner::{ - host_logical_run_from_exit, run_emit_host_go, run_emit_host_python, run_emit_host_rust, - EmitHostFixtureInputs, EmitHostRunReceipt, HostExit, HostSetupFailure, - RuntimeValueParseFailure, -}; - -/// MVP-2 / `eval_runtime_mvp` alignment: five stdout bytes denote runtime value `5`. -pub const MVP2_RUNTIME_VALUE_FIVE_BYTES: [u8; 5] = [0, 0, 0, 0, 0]; - -/// Rung-4 emit-vs-eval verdict at the Rust transport row (mirrors `run_test_claim_emit_vs_eval`). -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum EmitHostEmitVsEvalVerdict { - Pass, - FailValueMismatch { - host_receipt: EmitHostRunReceipt, - host_stdout: Vec, - expected_bytes: [u8; 5], - }, - FailParse { - host_receipt: EmitHostRunReceipt, - parse: RuntimeValueParseFailure, - }, - FailHostExit { - host_receipt: EmitHostRunReceipt, - }, -} - -/// Release-minimum L2 parity verdict for Rust/Python/Go over one runtime-value fixture. -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum EmitHostCrossTargetParityVerdict { - Pass, - FailSetup { - target: &'static str, - setup: HostSetupFailure, - }, - FailHostExit { - target: &'static str, - host_receipt: EmitHostRunReceipt, - }, - FailParse { - target: &'static str, - host_receipt: EmitHostRunReceipt, - parse: RuntimeValueParseFailure, - }, - FailBehaviorMismatch { - rust_stdout: Vec, - python_stdout: Vec, - go_stdout: Vec, - }, -} - -/// Emit-vs-eval / harness boundary: both fixture pins must be present (fail-closed). -fn validate_emit_vs_eval_fixture_inputs( - inputs: &EmitHostFixtureInputs, -) -> Result<(), emit_host_runner::HostSetupFailure> { - emit_host_runner::validate_emit_host_fixture_inputs(inputs) -} - -/// Host-process transport: compile + run emitted Rust, returning the runner receipt. -pub fn run_emit_host_rust_transport( - source: &str, - inputs: &EmitHostFixtureInputs, - work_dir: &std::path::Path, -) -> Result { - validate_emit_vs_eval_fixture_inputs(inputs)?; - run_emit_host_rust(source, &inputs.transport(), work_dir) -} - -/// Host-process transport: run emitted Python via `python3`, returning the runner receipt. -pub fn run_emit_host_python_transport( - source: &str, - inputs: &EmitHostFixtureInputs, - work_dir: &std::path::Path, -) -> Result { - validate_emit_vs_eval_fixture_inputs(inputs)?; - run_emit_host_python(source, &inputs.transport(), work_dir) -} - -/// Host-process transport: run emitted Go via `go run`, returning the runner receipt. -pub fn run_emit_host_go_transport( - source: &str, - inputs: &EmitHostFixtureInputs, - work_dir: &std::path::Path, -) -> Result { - validate_emit_vs_eval_fixture_inputs(inputs)?; - run_emit_host_go(source, &inputs.transport(), work_dir) -} - -/// True when the host exit witness is `Holds` (logical child succeeded). -pub fn host_exit_holds(exit: &HostExit) -> bool { - exit.exit_holds() -} - -/// Project logical stdout bytes when exit `Holds`; fail-closed otherwise. -pub fn host_stdout_bytes(exit: &HostExit, stdout_bytes: Vec) -> Option> { - host_logical_run_from_exit(exit, stdout_bytes).map(|run| run.stdout_bytes) -} - -fn emit_vs_eval_mvp2_verdict_from_receipt( - receipt: EmitHostRunReceipt, - expected_bytes: [u8; 5], - parse_stdout: fn(&[u8]) -> Result<(), RuntimeValueParseFailure>, -) -> EmitHostEmitVsEvalVerdict { - if !host_exit_holds(&receipt.exit) { - return EmitHostEmitVsEvalVerdict::FailHostExit { - host_receipt: receipt, - }; - } - let stdout = match host_stdout_bytes(&receipt.exit, receipt.stdout_bytes.clone()) { - Some(bytes) => bytes, - None => { - return EmitHostEmitVsEvalVerdict::FailHostExit { - host_receipt: receipt, - }; - } - }; - if let Err(parse) = parse_stdout(&stdout) { - return EmitHostEmitVsEvalVerdict::FailParse { - host_receipt: receipt, - parse, - }; - } - if stdout == expected_bytes { - EmitHostEmitVsEvalVerdict::Pass - } else { - EmitHostEmitVsEvalVerdict::FailValueMismatch { - host_receipt: receipt, - host_stdout: stdout, - expected_bytes, - } - } -} - -/// W3 rung-4 / W3.4 tranche-1 rung-6 rows: real `run_emit_host_rust` transport + MVP-2 five-byte check. -/// -/// Matches `run_test_claim_emit_vs_eval_for_claim` / `run_test_claim_emit_vs_eval_verdict` in -/// `emit_host.dag` for the rust authority pin (host stdout parsed then compared to eval literal `5`). -pub fn run_emit_vs_eval_mvp2_transport( - emitted_source: &str, - inputs: &EmitHostFixtureInputs, - work_dir: &std::path::Path, - expected_bytes: [u8; 5], -) -> Result { - let receipt = run_emit_host_rust_transport(emitted_source, inputs, work_dir)?; - Ok(emit_vs_eval_mvp2_verdict_from_receipt( - receipt, - expected_bytes, - emit_host_runner::runtime_value_parse_rust, - )) -} - -/// W3.4 tranche-1: real `run_emit_host_python` transport + MVP-2 five-byte stdout (same contract -/// as rung-4 rust row). Executable bridge until per-law emit + T-22 substrate dispatch land. -pub fn run_emit_vs_eval_mvp2_python_transport( - emitted_source: &str, - inputs: &EmitHostFixtureInputs, - work_dir: &std::path::Path, - expected_bytes: [u8; 5], -) -> Result { - let receipt = run_emit_host_python_transport(emitted_source, inputs, work_dir)?; - Ok(emit_vs_eval_mvp2_verdict_from_receipt( - receipt, - expected_bytes, - emit_host_runner::runtime_value_parse_python, - )) -} - -/// W3.3: real `run_emit_host_go` transport + MVP-2 five-byte stdout (cross-target parity row). -pub fn run_emit_vs_eval_mvp2_go_transport( - emitted_source: &str, - inputs: &EmitHostFixtureInputs, - work_dir: &std::path::Path, - expected_bytes: [u8; 5], -) -> Result { - let receipt = run_emit_host_go_transport(emitted_source, inputs, work_dir)?; - Ok(emit_vs_eval_mvp2_verdict_from_receipt( - receipt, - expected_bytes, - emit_host_runner::runtime_value_parse_go, - )) -} - -fn cross_target_stdout_bytes( - target: &'static str, - receipt: EmitHostRunReceipt, - parse_stdout: fn(&[u8]) -> Result<(), RuntimeValueParseFailure>, -) -> Result, EmitHostCrossTargetParityVerdict> { - if !host_exit_holds(&receipt.exit) { - return Err(EmitHostCrossTargetParityVerdict::FailHostExit { - target, - host_receipt: receipt, - }); - } - let stdout = match host_stdout_bytes(&receipt.exit, receipt.stdout_bytes.clone()) { - Some(bytes) => bytes, - None => { - return Err(EmitHostCrossTargetParityVerdict::FailHostExit { - target, - host_receipt: receipt, - }); - } - }; - if let Err(parse) = parse_stdout(&stdout) { - return Err(EmitHostCrossTargetParityVerdict::FailParse { - target, - host_receipt: receipt, - parse, - }); - } - Ok(stdout) -} - -fn cross_target_parity_verdict_from_stdout( - rust_stdout: Vec, - python_stdout: Vec, - go_stdout: Vec, -) -> EmitHostCrossTargetParityVerdict { - if rust_stdout == python_stdout && rust_stdout == go_stdout { - EmitHostCrossTargetParityVerdict::Pass - } else { - EmitHostCrossTargetParityVerdict::FailBehaviorMismatch { - rust_stdout, - python_stdout, - go_stdout, - } - } -} - -type EmitHostRunner = fn( - &str, - &EmitHostFixtureInputs, - &std::path::Path, -) -> Result; - -struct CrossTargetMvp2Runners { - rust: EmitHostRunner, - python: EmitHostRunner, - go: EmitHostRunner, -} - -fn run_cross_target_mvp2_python_parity_with_runners( - rust_source: &str, - python_source: &str, - go_source: &str, - inputs: &EmitHostFixtureInputs, - rust_work_dir: &std::path::Path, - python_work_dir: &std::path::Path, - go_work_dir: &std::path::Path, - runners: CrossTargetMvp2Runners, -) -> EmitHostCrossTargetParityVerdict { - let rust_receipt = match (runners.rust)(rust_source, inputs, rust_work_dir) { - Ok(receipt) => receipt, - Err(setup) => { - return EmitHostCrossTargetParityVerdict::FailSetup { - target: "rust", - setup, - }; - } - }; - let python_receipt = match (runners.python)(python_source, inputs, python_work_dir) { - Ok(receipt) => receipt, - Err(setup) => { - return EmitHostCrossTargetParityVerdict::FailSetup { - target: "python", - setup, - }; - } - }; - let go_receipt = match (runners.go)(go_source, inputs, go_work_dir) { - Ok(receipt) => receipt, - Err(setup) => { - return EmitHostCrossTargetParityVerdict::FailSetup { - target: "go", - setup, - }; - } - }; - - let rust_stdout = match cross_target_stdout_bytes( - "rust", - rust_receipt, - emit_host_runner::runtime_value_parse_rust, - ) { - Ok(stdout) => stdout, - Err(verdict) => return verdict, - }; - let python_stdout = match cross_target_stdout_bytes( - "python", - python_receipt, - emit_host_runner::runtime_value_parse_python, - ) { - Ok(stdout) => stdout, - Err(verdict) => return verdict, - }; - let go_stdout = - match cross_target_stdout_bytes("go", go_receipt, emit_host_runner::runtime_value_parse_go) - { - Ok(stdout) => stdout, - Err(verdict) => return verdict, - }; - - cross_target_parity_verdict_from_stdout(rust_stdout, python_stdout, go_stdout) -} - -/// L2 cross-target behavioral parity: Rust, Python, and Go must all execute, parse into the -/// same MVP-2 runtime-value carrier, and agree on observed stdout for the same fixture subject. -pub fn run_cross_target_mvp2_python_parity_transport( - rust_source: &str, - python_source: &str, - go_source: &str, - inputs: &EmitHostFixtureInputs, - rust_work_dir: &std::path::Path, - python_work_dir: &std::path::Path, - go_work_dir: &std::path::Path, -) -> EmitHostCrossTargetParityVerdict { - if let Err(setup) = validate_emit_vs_eval_fixture_inputs(inputs) { - return EmitHostCrossTargetParityVerdict::FailSetup { - target: "rust", - setup, - }; - } - run_cross_target_mvp2_python_parity_with_runners( - rust_source, - python_source, - go_source, - inputs, - rust_work_dir, - python_work_dir, - go_work_dir, - CrossTargetMvp2Runners { - rust: run_emit_host_rust_transport, - python: run_emit_host_python_transport, - go: run_emit_host_go_transport, - }, - ) -} - -#[cfg(test)] -mod tests { - use super::*; - use emit_host_runner::{ - default_work_dir, BuildLog, HostLogicalFailure, HostPhase, HostSetupFailure, HostStream, - }; - - const FIXTURE_SOURCE_PASS: &str = - "fn main() { let _ = std::io::Write::write_all(&mut std::io::stdout(), &[0u8; 5]); }"; - const FIXTURE_SOURCE_MISMATCH: &str = - "fn main() { let _ = std::io::Write::write_all(&mut std::io::stdout(), &[1,2,3,4,5]); }"; - const FIXTURE_SOURCE_PARSE_FAIL: &str = - "fn main() { let _ = std::io::Write::write_all(&mut std::io::stdout(), &[0u8; 3]); }"; - - fn mvp2_inputs() -> EmitHostFixtureInputs { - EmitHostFixtureInputs { - claim_input_root: "bridge_claim_input".into(), - expected_eval_root: "bridge_expected_eval".into(), - } - } - - fn receipt_with_stdout(stdout_bytes: &[u8]) -> EmitHostRunReceipt { - EmitHostRunReceipt { - source_text: "fixture".to_string(), - exit: HostExit::holds(0), - stdout_bytes: stdout_bytes.to_vec(), - stderr_bytes: Vec::new(), - build_log: BuildLog { lines: Vec::new() }, - } - } - - fn receipt_with_exit_failure() -> EmitHostRunReceipt { - EmitHostRunReceipt { - source_text: "fixture".to_string(), - exit: HostExit::logical_violation(HostLogicalFailure::ExitedNonzero { - phase: HostPhase::FixtureRun, - code: Some(1), - }), - stdout_bytes: Vec::new(), - stderr_bytes: b"runtime failure".to_vec(), - build_log: BuildLog { lines: Vec::new() }, - } - } - - fn fake_transport_pass( - _source: &str, - _inputs: &EmitHostFixtureInputs, - _work_dir: &std::path::Path, - ) -> Result { - Ok(receipt_with_stdout(&MVP2_RUNTIME_VALUE_FIVE_BYTES)) - } - - fn fake_transport_python_mismatch( - _source: &str, - _inputs: &EmitHostFixtureInputs, - _work_dir: &std::path::Path, - ) -> Result { - Ok(receipt_with_stdout(&[1, 2, 3, 4, 5])) - } - - fn fake_transport_python_parse_fail( - _source: &str, - _inputs: &EmitHostFixtureInputs, - _work_dir: &std::path::Path, - ) -> Result { - Ok(receipt_with_stdout(&[0, 0, 0])) - } - - fn fake_transport_python_exit_fail( - _source: &str, - _inputs: &EmitHostFixtureInputs, - _work_dir: &std::path::Path, - ) -> Result { - Ok(receipt_with_exit_failure()) - } - - fn fake_transport_python_setup_fail( - _source: &str, - _inputs: &EmitHostFixtureInputs, - _work_dir: &std::path::Path, - ) -> Result { - Err(HostSetupFailure::StreamReadFailed { - phase: HostPhase::FixtureRun, - stream: HostStream::Stdout, - source: "setup failed".to_string(), - }) - } - - fn run_fake_cross_target(runners: CrossTargetMvp2Runners) -> EmitHostCrossTargetParityVerdict { - run_cross_target_mvp2_python_parity_with_runners( - "rust", - "python", - "go", - &mvp2_inputs(), - std::path::Path::new("rust"), - std::path::Path::new("python"), - std::path::Path::new("go"), - runners, - ) - } - - #[test] - fn bridge_runs_fixture_and_holds_exit() { - let work_dir = default_work_dir(&format!("gunbc_emit_host_bridge_{}", std::process::id())); - let receipt = run_emit_host_rust_transport(FIXTURE_SOURCE_PASS, &mvp2_inputs(), &work_dir) - .expect("transport"); - assert!(host_exit_holds(&receipt.exit)); - let stdout = - host_stdout_bytes(&receipt.exit, receipt.stdout_bytes.clone()).expect("logical stdout"); - assert_eq!(stdout.len(), 5); - emit_host_runner::runtime_value_parse_rust(&stdout).expect("parse"); - } - - #[test] - fn emit_vs_eval_mvp2_transport_passes_for_five_zero_bytes() { - let work_dir = default_work_dir(&format!("gunbc_emit_vs_eval_pass_{}", std::process::id())); - let verdict = run_emit_vs_eval_mvp2_transport( - FIXTURE_SOURCE_PASS, - &mvp2_inputs(), - &work_dir, - MVP2_RUNTIME_VALUE_FIVE_BYTES, - ) - .expect("transport setup"); - assert_eq!(verdict, EmitHostEmitVsEvalVerdict::Pass); - } - - #[test] - fn emit_vs_eval_mvp2_transport_fails_with_host_receipt_on_value_mismatch() { - let work_dir = default_work_dir(&format!("gunbc_emit_vs_eval_fail_{}", std::process::id())); - let verdict = run_emit_vs_eval_mvp2_transport( - FIXTURE_SOURCE_MISMATCH, - &mvp2_inputs(), - &work_dir, - MVP2_RUNTIME_VALUE_FIVE_BYTES, - ) - .expect("transport setup"); - match verdict { - EmitHostEmitVsEvalVerdict::FailValueMismatch { - host_receipt, - host_stdout, - expected_bytes, - } => { - assert!(host_exit_holds(&host_receipt.exit)); - assert_eq!(host_stdout, [1, 2, 3, 4, 5]); - assert_eq!(expected_bytes, MVP2_RUNTIME_VALUE_FIVE_BYTES); - } - other => panic!("expected FailValueMismatch with Host evidence, got {other:?}"), - } - } - - #[test] - fn emit_vs_eval_mvp2_transport_fails_on_unparsable_stdout() { - let work_dir = - default_work_dir(&format!("gunbc_emit_vs_eval_parse_{}", std::process::id())); - let verdict = run_emit_vs_eval_mvp2_transport( - FIXTURE_SOURCE_PARSE_FAIL, - &mvp2_inputs(), - &work_dir, - MVP2_RUNTIME_VALUE_FIVE_BYTES, - ) - .expect("transport setup"); - assert!(matches!( - verdict, - EmitHostEmitVsEvalVerdict::FailParse { .. } - )); - } - - const PYTHON_FIXTURE_SOURCE_PASS: &str = "import sys\nsys.stdout.buffer.write(b'\\x00' * 5)\n"; - - #[test] - fn bridge_python_transport_builds_runs_and_parses_stdout() { - let work_dir = - default_work_dir(&format!("gunbc_emit_host_py_bridge_{}", std::process::id())); - let receipt = - run_emit_host_python_transport(PYTHON_FIXTURE_SOURCE_PASS, &mvp2_inputs(), &work_dir) - .expect("transport"); - assert!(host_exit_holds(&receipt.exit)); - let stdout = - host_stdout_bytes(&receipt.exit, receipt.stdout_bytes.clone()).expect("logical stdout"); - emit_host_runner::runtime_value_parse_python(&stdout).expect("parse"); - } - - #[test] - fn emit_vs_eval_mvp2_python_transport_passes_for_five_zero_bytes() { - let work_dir = default_work_dir(&format!( - "gunbc_emit_vs_eval_py_pass_{}", - std::process::id() - )); - let verdict = run_emit_vs_eval_mvp2_python_transport( - PYTHON_FIXTURE_SOURCE_PASS, - &mvp2_inputs(), - &work_dir, - MVP2_RUNTIME_VALUE_FIVE_BYTES, - ) - .expect("transport setup"); - assert_eq!(verdict, EmitHostEmitVsEvalVerdict::Pass); - } - - const GO_FIXTURE_SOURCE_PASS: &str = - "package main\nimport \"os\"\nfunc main() { _, _ = os.Stdout.Write(make([]byte, 5)) }\n"; - - #[test] - fn bridge_go_transport_builds_runs_and_parses_stdout() { - let work_dir = - default_work_dir(&format!("gunbc_emit_host_go_bridge_{}", std::process::id())); - let receipt = run_emit_host_go_transport(GO_FIXTURE_SOURCE_PASS, &mvp2_inputs(), &work_dir) - .expect("transport"); - assert!(host_exit_holds(&receipt.exit)); - let stdout = - host_stdout_bytes(&receipt.exit, receipt.stdout_bytes.clone()).expect("logical stdout"); - emit_host_runner::runtime_value_parse_go(&stdout).expect("parse"); - } - - #[test] - fn emit_vs_eval_mvp2_go_transport_passes_for_five_zero_bytes() { - let work_dir = default_work_dir(&format!( - "gunbc_emit_vs_eval_go_pass_{}", - std::process::id() - )); - let verdict = run_emit_vs_eval_mvp2_go_transport( - GO_FIXTURE_SOURCE_PASS, - &mvp2_inputs(), - &work_dir, - MVP2_RUNTIME_VALUE_FIVE_BYTES, - ) - .expect("transport setup"); - assert_eq!(verdict, EmitHostEmitVsEvalVerdict::Pass); - } - - #[test] - fn cross_target_mvp2_python_parity_classifies_matching_three_target_stdout() { - let verdict = cross_target_parity_verdict_from_stdout( - MVP2_RUNTIME_VALUE_FIVE_BYTES.to_vec(), - MVP2_RUNTIME_VALUE_FIVE_BYTES.to_vec(), - MVP2_RUNTIME_VALUE_FIVE_BYTES.to_vec(), - ); - assert_eq!(verdict, EmitHostCrossTargetParityVerdict::Pass); - } - - #[test] - fn cross_target_mvp2_python_parity_classifies_python_behavior_mismatch() { - let verdict = cross_target_parity_verdict_from_stdout( - MVP2_RUNTIME_VALUE_FIVE_BYTES.to_vec(), - vec![1, 2, 3, 4, 5], - MVP2_RUNTIME_VALUE_FIVE_BYTES.to_vec(), - ); - match verdict { - EmitHostCrossTargetParityVerdict::FailBehaviorMismatch { - rust_stdout, - python_stdout, - go_stdout, - } => { - assert_eq!(rust_stdout, MVP2_RUNTIME_VALUE_FIVE_BYTES); - assert_eq!(python_stdout, [1, 2, 3, 4, 5]); - assert_eq!(go_stdout, MVP2_RUNTIME_VALUE_FIVE_BYTES); - } - other => panic!("expected Python behavior mismatch, got {other:?}"), - } - } - - #[test] - fn cross_target_mvp2_python_parity_transport_passes_when_three_targets_match() { - let verdict = run_fake_cross_target(CrossTargetMvp2Runners { - rust: fake_transport_pass, - python: fake_transport_pass, - go: fake_transport_pass, - }); - assert_eq!(verdict, EmitHostCrossTargetParityVerdict::Pass); - } - - #[test] - fn cross_target_mvp2_python_parity_transport_reports_python_setup_failure() { - let verdict = run_fake_cross_target(CrossTargetMvp2Runners { - rust: fake_transport_pass, - python: fake_transport_python_setup_fail, - go: fake_transport_pass, - }); - assert!(matches!( - verdict, - EmitHostCrossTargetParityVerdict::FailSetup { - target: "python", - .. - } - )); - } - - #[test] - fn cross_target_mvp2_python_parity_transport_reports_python_host_exit_failure() { - let verdict = run_fake_cross_target(CrossTargetMvp2Runners { - rust: fake_transport_pass, - python: fake_transport_python_exit_fail, - go: fake_transport_pass, - }); - assert!(matches!( - verdict, - EmitHostCrossTargetParityVerdict::FailHostExit { - target: "python", - .. - } - )); - } - - #[test] - fn cross_target_mvp2_python_parity_transport_reports_python_parse_failure() { - let verdict = run_fake_cross_target(CrossTargetMvp2Runners { - rust: fake_transport_pass, - python: fake_transport_python_parse_fail, - go: fake_transport_pass, - }); - assert!(matches!( - verdict, - EmitHostCrossTargetParityVerdict::FailParse { - target: "python", - .. - } - )); - } - - #[test] - fn cross_target_mvp2_python_parity_transport_reports_python_behavior_mismatch() { - let verdict = run_fake_cross_target(CrossTargetMvp2Runners { - rust: fake_transport_pass, - python: fake_transport_python_mismatch, - go: fake_transport_pass, - }); - assert!(matches!( - verdict, - EmitHostCrossTargetParityVerdict::FailBehaviorMismatch { .. } - )); - } -} diff --git a/src/v3/compiler/src/emit_host_eval.rs b/src/v3/compiler/src/emit_host_eval.rs deleted file mode 100644 index f7d256f95e7..00000000000 --- a/src/v3/compiler/src/emit_host_eval.rs +++ /dev/null @@ -1,2383 +0,0 @@ -//! T-22 substrate eval dispatch for `v4.compiler.emit_host` → `emit_host_runner`. -//! -//! **Rust row (`run_emit_host_rust`):** runs the runner, then assembles receipts via -//! `emit_host_receipt_from_source` / [`evaluator::eval_callable_declaration`] (substrate eval). -//! -//! **Python row (`run_emit_host_python`):** runs the runner and hand-reifies `v4.std.host_run` -//! carriers on this hook (substrate fn body stays `transport_not_wired`). -//! -//! **Go row (`run_emit_host_go`):** same substrate eval pattern as rust (`emit_host_receipt_from_source`). -//! -//! **P5:** SG-0 census in `sg0_census_test.rs` (T-PB-B); dissolution when substrate owns all rows. - -use std::path::Path; - -use crate::dag::{ArrowBody, AtomPayload, Dag, DeclarationId, LiteralBits, TypeConnective}; -use crate::evaluator::{EvalError, EvalStateStack, EvalStrategy, NamedField, Value}; -use emit_host_runner::{ - EmitHostRunReceipt, EmitHostTransportInputs, ExitWitness, HostExit, HostExitOutcome, - HostLogicalFailure, HostSetupFailure, -}; - -#[cfg(test)] -use emit_host_runner::EmitHostFixtureInputs; - -type HostTransportRun = - fn(&str, &EmitHostTransportInputs, &Path) -> Result; - -/// Modeled carrier authority for `v4.std.diagnostic` (`emit_host.dag` import graph). -const V4_STD_DIAGNOSTIC_AUTHORITY: &str = "src/v4/std/diagnostic.dag"; -/// Modeled carrier authority for `v4.std.witness` (`host_run.dag` / `emit_host.dag` imports). -const V4_STD_WITNESS_AUTHORITY: &str = "src/v4/std/witness.dag"; -/// `List = FreeMonoid` alias authority (`host_run.dag` import graph). -const V4_STD_COLLECTION_AUTHORITY: &str = "src/v4/std/collection.dag"; -/// `FreeMonoid` `Empty`/`Cons` arm authority for list reification. -const V4_STD_ALGEBRA_AUTHORITY: &str = "src/v4/std/algebra.dag"; -/// `Byte` / `List` authority (`host_run` `ByteString = List`). -const V4_STD_MACHINE_AUTHORITY: &str = "src/v4/std/machine.dag"; -/// `String` authority (`host_run` `BuildLog.lines: List`). -const V4_STD_TEXT_AUTHORITY: &str = "src/v4/std/text.dag"; - -/// Canonical substrate authority path for `run_emit_host_*` rows (see `src/v4/compiler/emit_host.dag`). -const EMIT_HOST_DAG_AUTHORITY_PATH: &str = "src/v4/compiler/emit_host.dag"; - -/// Eval-time dispatch for `run_emit_host_rust` (substrate `emit_host.dag` only). -pub fn try_dispatch_emit_host_rust( - dag: &Dag, - callee_decl: DeclarationId, - operands: &[Value], - state: &mut EvalStateStack, - strategy: &EvalStrategy, -) -> Option> { - if !is_run_emit_host_rust_decl(dag, callee_decl) { - return None; - } - if operands.len() != 3 { - return Some(Err(EvalError::TransformArityMismatch { - expected: 3, - got: operands.len(), - })); - } - - let source = match expect_string_operand(&operands[1]) { - Ok(source) => source, - Err(err) => return Some(Err(err)), - }; - let inputs = match emit_host_transport_inputs(dag, &operands[2], state, strategy) { - Ok(inputs) => inputs, - Err(err) => return Some(Err(err)), - }; - let work_dir = emit_host_runner::unique_work_dir("gunbc_eval_emit_host_rust"); - let receipt = match emit_host_runner::run_emit_host_rust(source, &inputs, &work_dir) { - Ok(receipt) => receipt, - Err(setup) => return Some(run_emit_host_setup_rejected(dag, &setup)), - }; - let callee = match find_fn_decl(dag, "emit_host_receipt_from_source") { - Ok(id) => id, - Err(err) => return Some(Err(err)), - }; - let exit = match host_exit_value(dag, &receipt.exit) { - Ok(v) => v, - Err(err) => return Some(Err(err)), - }; - let stdout = match byte_string_value(dag, &receipt.stdout_bytes) { - Ok(v) => v, - Err(err) => return Some(Err(err)), - }; - let stderr = match byte_string_value(dag, &receipt.stderr_bytes) { - Ok(v) => v, - Err(err) => return Some(Err(err)), - }; - let build_log = match build_log_value(dag, &receipt.build_log.lines) { - Ok(v) => v, - Err(err) => return Some(Err(err)), - }; - Some( - crate::evaluator::eval_callable_declaration( - dag, - callee, - vec![ - operands[0].clone(), - Value::LiteralValue(LiteralBits::String(receipt.source_text)), - exit, - stdout, - stderr, - build_log, - ], - state, - strategy, - ) - .and_then(|value| accepted_variant(dag, value)), - ) -} - -/// Eval-time dispatch for `run_emit_host_go` (substrate `emit_host.dag` only). -pub fn try_dispatch_emit_host_go( - dag: &Dag, - callee_decl: DeclarationId, - operands: &[Value], - state: &mut EvalStateStack, - strategy: &EvalStrategy, -) -> Option> { - if !is_run_emit_host_go_decl(dag, callee_decl) { - return None; - } - if operands.len() != 3 { - return Some(Err(EvalError::TransformArityMismatch { - expected: 3, - got: operands.len(), - })); - } - - let source = match expect_string_operand(&operands[1]) { - Ok(source) => source, - Err(err) => return Some(Err(err)), - }; - let inputs = match emit_host_transport_inputs(dag, &operands[2], state, strategy) { - Ok(inputs) => inputs, - Err(err) => return Some(Err(err)), - }; - let work_dir = emit_host_runner::unique_work_dir("gunbc_eval_emit_host_go"); - let receipt = match emit_host_runner::run_emit_host_go(source, &inputs, &work_dir) { - Ok(receipt) => receipt, - Err(setup) => return Some(run_emit_host_setup_rejected(dag, &setup)), - }; - let callee = match find_fn_decl(dag, "emit_host_receipt_from_source") { - Ok(id) => id, - Err(err) => return Some(Err(err)), - }; - let exit = match host_exit_value(dag, &receipt.exit) { - Ok(v) => v, - Err(err) => return Some(Err(err)), - }; - let stdout = match byte_string_value(dag, &receipt.stdout_bytes) { - Ok(v) => v, - Err(err) => return Some(Err(err)), - }; - let stderr = match byte_string_value(dag, &receipt.stderr_bytes) { - Ok(v) => v, - Err(err) => return Some(Err(err)), - }; - let build_log = match build_log_value(dag, &receipt.build_log.lines) { - Ok(v) => v, - Err(err) => return Some(Err(err)), - }; - Some( - crate::evaluator::eval_callable_declaration( - dag, - callee, - vec![ - operands[0].clone(), - Value::LiteralValue(LiteralBits::String(receipt.source_text)), - exit, - stdout, - stderr, - build_log, - ], - state, - strategy, - ) - .and_then(|value| accepted_variant(dag, value)), - ) -} - -/// B3 omni-emission — generic `run_host_process` substrate row (`emit_host.dag`). -pub fn try_dispatch_run_host_process( - dag: &Dag, - callee_decl: DeclarationId, - operands: &[Value], - state: &mut EvalStateStack, - strategy: &EvalStrategy, -) -> Option> { - if !is_run_host_process_decl(dag, callee_decl) { - return None; - } - if operands.len() != 4 { - return Some(Err(EvalError::TransformArityMismatch { - expected: 4, - got: operands.len(), - })); - } - - let descriptor_identity = match host_transport_descriptor_identity(&operands[0]) { - Some(identity) => identity, - None => { - return Some(Err(EvalError::BadTransformOperands { - reason: "run_host_process descriptor missing identity", - })); - } - }; - let source = match expect_string_operand(&operands[2]) { - Ok(source) => source, - Err(err) => return Some(Err(err)), - }; - let inputs = match emit_host_transport_inputs(dag, &operands[3], state, strategy) { - Ok(inputs) => inputs, - Err(err) => return Some(Err(err)), - }; - let work_dir = emit_host_runner::unique_work_dir("gunbc_eval_run_host_process"); - let receipt = match emit_host_runner::run_host_process( - &descriptor_identity, - source, - &inputs, - &work_dir, - ) { - Ok(receipt) => receipt, - Err(setup) => return Some(run_emit_host_setup_rejected(dag, &setup)), - }; - let callee = match find_fn_decl(dag, "emit_host_receipt_from_source") { - Ok(id) => id, - Err(err) => return Some(Err(err)), - }; - let exit = match host_exit_value(dag, &receipt.exit) { - Ok(v) => v, - Err(err) => return Some(Err(err)), - }; - let stdout = match byte_string_value(dag, &receipt.stdout_bytes) { - Ok(v) => v, - Err(err) => return Some(Err(err)), - }; - let stderr = match byte_string_value(dag, &receipt.stderr_bytes) { - Ok(v) => v, - Err(err) => return Some(Err(err)), - }; - let build_log = match build_log_value(dag, &receipt.build_log.lines) { - Ok(v) => v, - Err(err) => return Some(Err(err)), - }; - Some( - crate::evaluator::eval_callable_declaration( - dag, - callee, - vec![ - operands[1].clone(), - Value::LiteralValue(LiteralBits::String(receipt.source_text)), - exit, - stdout, - stderr, - build_log, - ], - state, - strategy, - ) - .and_then(|value| accepted_variant(dag, value)), - ) -} - -/// Decode `SignedI32Le` runtime primitive bytes (codec-driven, not target-specific). -pub fn try_dispatch_runtime_value_signed_i32_le_as_int( - dag: &Dag, - callee_decl: DeclarationId, - operands: &[Value], - _state: &mut EvalStateStack, - _strategy: &EvalStrategy, -) -> Option> { - if !is_runtime_value_signed_i32_le_as_int_decl(dag, callee_decl) { - return None; - } - if operands.len() != 1 { - return Some(Err(EvalError::TransformArityMismatch { - expected: 1, - got: operands.len(), - })); - } - let bytes = match runtime_value_primitive_bytes(dag, &operands[0]) { - Ok(bytes) => bytes, - Err(err) => return Some(Err(err)), - }; - let parsed = match emit_host_runner::runtime_value_parse_signed_i32_le(&bytes) { - Ok(n) => n, - Err(_) => { - let diagnostic = match emit_host_parse_failure_diagnostic(dag) { - Ok(v) => v, - Err(err) => return Some(Err(err)), - }; - let diagnostics = match non_empty_diagnostics_singleton(dag, diagnostic) { - Ok(v) => v, - Err(err) => return Some(Err(err)), - }; - return match rejected_outcome_variant(dag, diagnostics) { - Ok(v) => Some(Ok(v)), - Err(err) => Some(Err(err)), - }; - } - }; - match accepted_variant( - dag, - Value::LiteralValue(LiteralBits::Int(parsed.to_string())), - ) { - Ok(v) => Some(Ok(v)), - Err(err) => Some(Err(err)), - } -} - -fn is_run_host_process_decl(dag: &Dag, callee_decl: DeclarationId) -> bool { - is_emit_host_fn_decl(dag, callee_decl, "run_host_process", 4) -} - -fn is_runtime_value_signed_i32_le_as_int_decl(dag: &Dag, callee_decl: DeclarationId) -> bool { - is_emit_host_fn_decl(dag, callee_decl, "runtime_value_signed_i32_le_as_int", 1) -} - -fn is_emit_host_fn_decl(dag: &Dag, callee_decl: DeclarationId, name: &str, arity: usize) -> bool { - let Some(callee) = dag.declaration_opt(&callee_decl) else { - return false; - }; - if callee.name.as_deref() != Some(name) { - return false; - } - if !callee.span.file.ends_with(EMIT_HOST_DAG_AUTHORITY_PATH) { - return false; - } - let TypeConnective::Arrow { inputs, body, .. } = &callee.connective else { - return false; - }; - inputs.len() == arity && matches!(body, ArrowBody::UserDefined(_)) -} - -fn host_transport_descriptor_identity(value: &Value) -> Option { - record_fields(value).and_then(|fields| { - fields - .iter() - .find(|f| f.label == "identity") - .and_then(|f| atom_identity_literal(&f.value)) - }) -} - -fn runtime_value_primitive_bytes(dag: &Dag, value: &Value) -> Result, EvalError> { - let payload = match value { - Value::VariantValue { payload, .. } => payload.as_ref(), - _ => { - return Err(EvalError::BadTransformOperands { - reason: "runtime value is not a variant", - }); - } - }; - let prim_fields = record_fields(payload).ok_or(EvalError::BadTransformOperands { - reason: "RuntimePrimitive payload is not a record", - })?; - let value_field = - prim_fields - .iter() - .find(|f| f.label == "value") - .ok_or(EvalError::BadTransformOperands { - reason: "RuntimePrimitiveValue missing value field", - })?; - let inner = record_fields(&value_field.value).ok_or(EvalError::BadTransformOperands { - reason: "RuntimePrimitiveValue is not a record", - })?; - let bytes_field = - inner - .iter() - .find(|f| f.label == "bytes") - .ok_or(EvalError::BadTransformOperands { - reason: "RuntimePrimitiveValue missing bytes field", - })?; - byte_list_to_vec(dag, &bytes_field.value) -} - -fn byte_list_to_vec(dag: &Dag, list: &Value) -> Result, EvalError> { - let byte_ty = v4_carrier_decl_id(dag, V4_STD_MACHINE_AUTHORITY, "Byte")?; - let list_ty = list_instantiation_for_element(dag, byte_ty)?; - let empty_tag = find_list_variant_tag(dag, list_ty, "Empty")?; - let cons_tag = find_list_variant_tag(dag, list_ty, "Cons")?; - let mut out = Vec::new(); - let mut current = list; - loop { - let Value::VariantValue { tag, payload } = current else { - return Err(EvalError::BadTransformOperands { - reason: "byte list is not a variant", - }); - }; - if *tag == empty_tag { - break; - } - if *tag != cons_tag { - return Err(EvalError::BadTransformOperands { - reason: "byte list variant is not Empty or Cons", - }); - } - let fields = record_fields(payload).ok_or(EvalError::BadTransformOperands { - reason: "byte list Cons is not a record", - })?; - let head = - fields - .iter() - .find(|f| f.label == "head") - .ok_or(EvalError::BadTransformOperands { - reason: "byte list Cons missing head", - })?; - out.push(byte_value_to_u8(dag, &head.value)?); - let tail = - fields - .iter() - .find(|f| f.label == "tail") - .ok_or(EvalError::BadTransformOperands { - reason: "byte list Cons missing tail", - })?; - current = &tail.value; - } - Ok(out) -} - -fn byte_value_to_u8(dag: &Dag, value: &Value) -> Result { - let fields = record_fields(value).ok_or(EvalError::BadTransformOperands { - reason: "byte is not a record", - })?; - let bits_value = - fields - .iter() - .find(|f| f.label == "bits") - .ok_or(EvalError::BadTransformOperands { - reason: "byte missing bits field", - })?; - let bits = bit_list_to_bools(dag, &bits_value.value)?; - if bits.len() != 8 { - return Err(EvalError::BadTransformOperands { - reason: "byte bits length is not 8", - }); - } - let mut byte = 0u8; - for (shift, bit) in bits.iter().enumerate() { - if *bit { - byte |= 1 << (7 - shift); - } - } - Ok(byte) -} - -fn bit_list_to_bools(dag: &Dag, list: &Value) -> Result, EvalError> { - let bit_ty = v4_carrier_decl_id(dag, V4_STD_MACHINE_AUTHORITY, "Bit")?; - let list_ty = list_instantiation_for_element(dag, bit_ty)?; - let empty_tag = find_list_variant_tag(dag, list_ty, "Empty")?; - let cons_tag = find_list_variant_tag(dag, list_ty, "Cons")?; - let mut out = Vec::new(); - let mut current = list; - loop { - let Value::VariantValue { tag, payload } = current else { - return Err(EvalError::BadTransformOperands { - reason: "bit list is not a variant", - }); - }; - if *tag == empty_tag { - break; - } - if *tag != cons_tag { - return Err(EvalError::BadTransformOperands { - reason: "bit list variant is not Empty or Cons", - }); - } - let fields = record_fields(payload).ok_or(EvalError::BadTransformOperands { - reason: "bit list Cons is not a record", - })?; - let head = - fields - .iter() - .find(|f| f.label == "head") - .ok_or(EvalError::BadTransformOperands { - reason: "bit list Cons missing head", - })?; - match &head.value { - Value::LiteralValue(LiteralBits::Bool(bit)) => out.push(*bit), - _ => { - return Err(EvalError::BadTransformOperands { - reason: "bit list head is not Bool", - }); - } - } - let tail = - fields - .iter() - .find(|f| f.label == "tail") - .ok_or(EvalError::BadTransformOperands { - reason: "bit list Cons missing tail", - })?; - current = &tail.value; - } - Ok(out) -} - -fn emit_host_parse_failure_diagnostic(dag: &Dag) -> Result { - emit_host_port_diagnostic(dag, "emit_host_parse_failure") -} - -fn is_run_emit_host_rust_decl(dag: &Dag, callee_decl: DeclarationId) -> bool { - is_run_emit_host_decl(dag, callee_decl, "run_emit_host_rust") -} - -fn is_run_emit_host_go_decl(dag: &Dag, callee_decl: DeclarationId) -> bool { - is_run_emit_host_decl(dag, callee_decl, "run_emit_host_go") -} - -fn is_run_emit_host_decl(dag: &Dag, callee_decl: DeclarationId, name: &str) -> bool { - let Some(callee) = dag.declaration_opt(&callee_decl) else { - return false; - }; - if callee.name.as_deref() != Some(name) { - return false; - } - if !callee.span.file.ends_with(EMIT_HOST_DAG_AUTHORITY_PATH) { - return false; - } - let TypeConnective::Arrow { inputs, body, .. } = &callee.connective else { - return false; - }; - inputs.len() == 3 && matches!(body, ArrowBody::UserDefined(_)) -} - -fn find_fn_decl(dag: &Dag, name: &str) -> Result { - dag.declarations() - .iter() - .find(|decl| { - decl.name.as_deref() == Some(name) - && decl.span.file.ends_with(EMIT_HOST_DAG_AUTHORITY_PATH) - }) - .map(|decl| decl.id) - .ok_or(EvalError::BadTransformOperands { - reason: "substrate fn declaration not found in eval dag", - }) -} - -/// Eval-time dispatch chain for remaining substrate `run_emit_host_*` rows. -/// -/// Rust and Go use dedicated entrypoints in `lib.rs` (`emit_host_receipt_from_source`); -/// this wrapper keeps python on the same extension point if additional rows later share -/// the hand-reify transport path. -pub fn try_dispatch_emit_host( - dag: &Dag, - callee_decl: DeclarationId, - operands: &[Value], - state: &mut EvalStateStack, - strategy: &EvalStrategy, -) -> Option> { - if let Some(result) = try_dispatch_emit_host_python(dag, callee_decl, operands, state, strategy) - { - return Some(result); - } - None -} - -/// Eval-time dispatch for `run_emit_host_python` in `emit_host.dag`. -pub fn try_dispatch_emit_host_python( - dag: &Dag, - callee_decl: DeclarationId, - operands: &[Value], - state: &mut EvalStateStack, - strategy: &EvalStrategy, -) -> Option> { - try_dispatch_emit_host_transport( - dag, - callee_decl, - operands, - state, - strategy, - "run_emit_host_python", - "gunbc_eval_emit_host_python", - emit_host_runner::run_emit_host_python, - ) -} - -fn try_dispatch_emit_host_transport( - dag: &Dag, - callee_decl: DeclarationId, - operands: &[Value], - state: &mut EvalStateStack, - strategy: &EvalStrategy, - fn_name: &str, - work_dir_prefix: &str, - run: HostTransportRun, -) -> Option> { - let callee = dag.declaration_opt(&callee_decl)?; - if callee.name.as_deref() != Some(fn_name) - || !callee.span.file.ends_with(EMIT_HOST_DAG_AUTHORITY_PATH) - { - return None; - } - if operands.len() != 3 { - return Some(Err(EvalError::TransformArityMismatch { - expected: 3, - got: operands.len(), - })); - } - - let source = match expect_string_operand(&operands[1]) { - Ok(source) => source, - Err(err) => return Some(Err(err)), - }; - let inputs = match emit_host_transport_inputs(dag, &operands[2], state, strategy) { - Ok(inputs) => inputs, - Err(err) => return Some(Err(err)), - }; - let work_dir = emit_host_runner::unique_work_dir(work_dir_prefix); - let receipt = match run(source, &inputs, &work_dir) { - Ok(receipt) => receipt, - Err(setup) => { - return Some(run_emit_host_setup_rejected(dag, &setup)); - } - }; - Some( - emit_host_receipt_value(dag, &operands[0], receipt) - .and_then(|value| accepted_variant(dag, value)), - ) -} - -fn run_emit_host_setup_rejected(dag: &Dag, setup: &HostSetupFailure) -> Result { - rejected_outcome_variant( - dag, - non_empty_diagnostics_singleton(dag, host_setup_failure_diagnostic(dag, setup)?)?, - ) -} - -fn expect_string_operand(value: &Value) -> Result<&str, EvalError> { - match value { - Value::LiteralValue(LiteralBits::String(s)) => Ok(s), - _ => Err(EvalError::BadTransformOperands { - reason: "expected String operand", - }), - } -} - -#[cfg(test)] -fn emit_host_fixture_inputs( - dag: &Dag, - value: &Value, - state: &mut EvalStateStack, - strategy: &EvalStrategy, -) -> Result { - let claim_root = inputs_root_field(value)?; - let claim_pin_source = - inputs_optional_present_node_field(dag, value, "host_claim_pin")?.unwrap_or(claim_root); - let claim_pin = host_pin_from_inputs_root(dag, claim_pin_source, state, strategy)?; - let expected_root = inputs_expected_eval_root_field(dag, value)?; - let expected_pin = host_pin_from_inputs_root(dag, expected_root, state, strategy)?; - Ok(EmitHostFixtureInputs { - claim_input_root: claim_pin, - expected_eval_root: expected_pin, - }) -} - -fn inputs_root_field(inputs: &Value) -> Result<&Value, EvalError> { - inputs_record_field(inputs, "root", "expected Inputs.root field") -} - -#[cfg(test)] -fn inputs_expected_eval_root_field<'a>( - dag: &Dag, - inputs: &'a Value, -) -> Result<&'a Value, EvalError> { - let optional = inputs_record_field( - inputs, - "expected_eval_root", - "expected Inputs.expected_eval_root field", - )?; - optional_node_payload(dag, optional)?.ok_or(EvalError::BadTransformOperands { - reason: "emit host dispatch requires Inputs.expected_eval_root Present", - }) -} - -fn inputs_optional_present_node_field<'a>( - dag: &Dag, - inputs: &'a Value, - label: &str, -) -> Result, EvalError> { - let Some(optional) = inputs_optional_record_field(inputs, label)? else { - return Ok(None); - }; - optional_node_payload(dag, optional) -} - -fn inputs_optional_record_field<'a>( - inputs: &'a Value, - label: &str, -) -> Result, EvalError> { - match inputs { - Value::RecordValue(fields) => Ok(fields - .iter() - .find(|field| field.label == label) - .map(|field| &field.value)), - _ => Err(EvalError::BadTransformOperands { - reason: "expected Inputs record", - }), - } -} - -fn inputs_record_field<'a>( - inputs: &'a Value, - label: &str, - missing_reason: &'static str, -) -> Result<&'a Value, EvalError> { - match inputs { - Value::RecordValue(fields) => fields - .iter() - .find(|field| field.label == label) - .map(|field| &field.value) - .ok_or(EvalError::BadTransformOperands { - reason: missing_reason, - }), - _ => Err(EvalError::BadTransformOperands { - reason: "expected Inputs record", - }), - } -} - -fn optional_node_payload<'a>(dag: &Dag, value: &'a Value) -> Result, EvalError> { - let Value::VariantValue { tag, payload } = value else { - return Err(EvalError::BadTransformOperands { - reason: "expected Inputs optional field to be Optional variant", - }); - }; - match variant_label_for_tag(dag, *tag).as_deref() { - Some("Absent" | "None") => Ok(None), - Some("Present" | "Some") => Ok(Some(optional_present_payload_value(payload)?)), - _ => Err(EvalError::BadTransformOperands { - reason: "expected Inputs optional field to be Present or Absent", - }), - } -} - -fn optional_present_payload_value<'a>(payload: &'a Value) -> Result<&'a Value, EvalError> { - match payload { - Value::RecordValue(fields) => fields - .iter() - .find(|field| field.label == "value") - .map(|field| &field.value) - .ok_or(EvalError::BadTransformOperands { - reason: "expected Optional Present { value } payload", - }), - value => Ok(value), - } -} - -/// Project substrate `Node` to a non-empty runner pin (Symbol carrier, Atom identity, or `content_hash`). -fn host_pin_from_inputs_root( - dag: &Dag, - root: &Value, - state: &mut EvalStateStack, - strategy: &EvalStrategy, -) -> Result { - let pin = match root { - Value::LiteralValue(LiteralBits::String(s)) => s.clone(), - node => match node_primary_symbol(dag, node) { - Some(sym) => sym, - None => content_hash_runner_pin(dag, node, state, strategy)?, - }, - }; - if pin.is_empty() { - return Err(EvalError::BadTransformOperands { - reason: "Inputs pin Node projected to empty host runner pin", - }); - } - Ok(pin) -} - -fn content_hash_runner_pin( - dag: &Dag, - node: &Value, - state: &mut EvalStateStack, - strategy: &EvalStrategy, -) -> Result { - let hash_value = eval_substrate_fn1(dag, "content_hash", node.clone(), state, strategy)?; - hash_value_to_runner_pin(dag, &hash_value) -} - -fn eval_substrate_fn1( - dag: &Dag, - name: &str, - arg: Value, - state: &mut EvalStateStack, - strategy: &EvalStrategy, -) -> Result { - let decl = dag - .declaration_by_name(name) - .ok_or(EvalError::BadTransformOperands { - reason: "substrate fn declaration not found in eval dag", - })?; - crate::evaluator::eval_callable_declaration(dag, decl.id, vec![arg], state, strategy) -} - -fn hash_value_to_runner_pin(dag: &Dag, hash: &Value) -> Result { - if let Some(sym) = node_primary_symbol(dag, hash) { - return Ok(sym); - } - match hash { - Value::LiteralValue(LiteralBits::String(s)) => Ok(s.clone()), - Value::LiteralValue(LiteralBits::Int(s)) => Ok(s.clone()), - _ => Err(EvalError::BadTransformOperands { - reason: "content_hash result not projectable to host runner pin", - }), - } -} - -fn variant_label_for_tag(dag: &Dag, tag: DeclarationId) -> Option { - dag.declarations().iter().find_map(|decl| { - let TypeConnective::Disj { variants } = &decl.connective else { - return None; - }; - variants - .iter() - .find(|variant| variant.ty == tag) - .map(|variant| variant.label.clone()) - }) -} - -fn node_primary_symbol(dag: &Dag, value: &Value) -> Option { - let fields = record_fields(value)?; - let kind = fields.iter().find(|f| f.label == "kind")?; - connective_atom_symbol(dag, &kind.value) -} - -fn connective_atom_symbol(dag: &Dag, value: &Value) -> Option { - match value { - Value::RecordValue(fields) => fields - .iter() - .find(|f| f.label == "connective") - .and_then(|f| atom_identity_literal(&f.value)), - Value::VariantValue { tag, payload } => { - let arm = dag.declaration(*tag).name.as_deref()?; - if arm == "Atom" { - atom_identity_literal(payload) - } else { - connective_atom_symbol(dag, payload) - } - } - _ => None, - } -} - -fn atom_identity_literal(value: &Value) -> Option { - match value { - Value::RecordValue(fields) => { - fields - .iter() - .find(|f| f.label == "identity") - .and_then(|f| match &f.value { - Value::LiteralValue(LiteralBits::String(s)) => Some(s.clone()), - _ => None, - }) - } - Value::VariantValue { payload, .. } => atom_identity_literal(payload), - _ => None, - } -} - -fn record_fields(value: &Value) -> Option<&[NamedField]> { - match value { - Value::RecordValue(fields) => Some(fields), - Value::VariantValue { payload, .. } => record_fields(payload), - _ => None, - } -} - -/// Build claim-only transport pins for `run_emit_host_*` substrate rows. -/// -/// Operand `Inputs` at this boundary carries only `root` (claim pin). Expected eval root is -/// modeled separately on emit-vs-eval harness paths via [`emit_host_fixture_inputs`]. -fn emit_host_transport_inputs( - dag: &Dag, - fixture_inputs: &Value, - state: &mut EvalStateStack, - strategy: &EvalStrategy, -) -> Result { - let claim_root = inputs_root_field(fixture_inputs)?; - let claim_pin_source = - inputs_optional_present_node_field(dag, fixture_inputs, "host_claim_pin")? - .unwrap_or(claim_root); - let claim_input_root = host_pin_from_inputs_root(dag, claim_pin_source, state, strategy)?; - Ok(EmitHostTransportInputs { claim_input_root }) -} - -/// Resolve a top-level v4 std carrier by **source file** (not `declaration_by_name` rank). -/// -/// Bootstrap `Dag::new()` also embeds `src/v3/std/dimensions.dag` `Witness` -/// (`Inhabits` / `Violates`). Host-run reification must use `v4.std.witness.Witness` -/// (`Holds` / `Violates`) from the emit-host import graph. -/// -/// When several declarations in the same authority file share `type_name` (alias re-lowers, -/// specialization copies), pick the one with the **lowest** `DeclarationId::raw()` so lookup -/// is deterministic and stable across hermetic stubs and `compile_to_dag_modules_in_order`. -fn v4_carrier_decl_id( - dag: &Dag, - authority_file_suffix: &str, - type_name: &str, -) -> Result { - dag.declarations() - .iter() - .filter(|decl| { - decl.name.as_deref() == Some(type_name) - && decl.span.file.ends_with(authority_file_suffix) - }) - .max_by_key(|decl| std::cmp::Reverse(decl.id.raw())) - .map(|decl| decl.id) - .ok_or(EvalError::BadTransformOperands { - reason: "v4 carrier type not found in modeled authority file", - }) -} - -fn v4_carrier_variant_tag( - dag: &Dag, - authority_file_suffix: &str, - type_name: &str, - variant_name: &str, -) -> Result { - let decl_id = v4_carrier_decl_id(dag, authority_file_suffix, type_name)?; - let TypeConnective::Disj { variants } = &dag.declaration(decl_id).connective else { - return Err(EvalError::BadTransformOperands { - reason: "v4 carrier is not a sum type", - }); - }; - variants - .iter() - .find(|variant| variant.label == variant_name) - .map(|variant| variant.ty) - .ok_or(EvalError::BadTransformOperands { - reason: "v4 carrier variant arm not found in modeled authority file", - }) -} - -fn is_v4_std_authority_file(file: &str) -> bool { - file.contains("src/v4/std/") -} - -fn list_instantiation_for_element( - dag: &Dag, - element_ty: DeclarationId, -) -> Result { - let list_id = v4_carrier_decl_id(dag, V4_STD_COLLECTION_AUTHORITY, "List")?; - dag.declarations() - .iter() - .filter(|decl| is_v4_std_authority_file(&decl.span.file)) - .find_map(|decl| { - let TypeConnective::Instantiation { - template, - arguments, - } = &decl.connective - else { - return None; - }; - (*template == list_id && arguments.len() == 1 && arguments[0].value == element_ty) - .then_some(decl.id) - }) - .ok_or(EvalError::BadTransformOperands { - reason: "v4 List instantiation not found in modeled authority files", - }) -} - -fn list_element_ty(dag: &Dag, list_ty: DeclarationId) -> Result { - let list_id = v4_carrier_decl_id(dag, V4_STD_COLLECTION_AUTHORITY, "List")?; - let free_monoid_id = v4_carrier_decl_id(dag, V4_STD_ALGEBRA_AUTHORITY, "FreeMonoid").ok(); - peel_list_element_ty(dag, list_ty, list_id, free_monoid_id, 0) -} - -fn peel_list_element_ty( - dag: &Dag, - ty: DeclarationId, - list_id: DeclarationId, - free_monoid_id: Option, - depth: usize, -) -> Result { - if depth >= 8 { - return Err(EvalError::BadTransformOperands { - reason: "List alias peel depth exceeded", - }); - } - match &dag.declaration(ty).connective { - TypeConnective::Instantiation { - template, - arguments, - } if arguments.len() == 1 => { - if *template == list_id || free_monoid_id == Some(*template) { - Ok(arguments[0].value) - } else { - peel_list_element_ty(dag, *template, list_id, free_monoid_id, depth + 1) - } - } - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - peel_list_element_ty(dag, *next, list_id, free_monoid_id, depth + 1) - } - _ => Err(EvalError::BadTransformOperands { - reason: "expected List instantiation", - }), - } -} - -/// `Empty` / `Cons` arm type from `v4.std.algebra.FreeMonoid` (not bootstrap `List`). -fn v4_free_monoid_variant_arm_type(dag: &Dag, variant: &str) -> Result { - v4_carrier_variant_tag(dag, V4_STD_ALGEBRA_AUTHORITY, "FreeMonoid", variant) -} - -fn find_list_variant_tag( - dag: &Dag, - list_ty: DeclarationId, - variant: &str, -) -> Result { - let elem_ty = list_element_ty(dag, list_ty)?; - let arm_ty = v4_free_monoid_variant_arm_type(dag, variant)?; - dag.declarations() - .iter() - .filter(|decl| is_v4_std_authority_file(&decl.span.file)) - .find_map(|decl| { - let TypeConnective::Instantiation { - template, - arguments, - } = &decl.connective - else { - return None; - }; - (*template == arm_ty && arguments.len() == 1 && arguments[0].value == elem_ty) - .then_some(decl.id) - }) - .ok_or(EvalError::BadTransformOperands { - reason: "v4 FreeMonoid variant constructor tag not found in modeled authority files", - }) -} - -fn empty_list_value(dag: &Dag, list_ty: DeclarationId) -> Result { - Ok(Value::VariantValue { - tag: find_list_variant_tag(dag, list_ty, "Empty")?, - payload: Box::new(Value::RecordValue(vec![])), - }) -} - -fn cons_list_value( - dag: &Dag, - list_ty: DeclarationId, - head: Value, - tail: Value, -) -> Result { - Ok(Value::VariantValue { - tag: find_list_variant_tag(dag, list_ty, "Cons")?, - payload: Box::new(Value::RecordValue(vec![ - NamedField { - label: "head".to_string(), - value: head, - }, - NamedField { - label: "tail".to_string(), - value: tail, - }, - ])), - }) -} - -fn list_from_values( - dag: &Dag, - list_ty: DeclarationId, - items: Vec, -) -> Result { - let mut list = empty_list_value(dag, list_ty)?; - for item in items.into_iter().rev() { - list = cons_list_value(dag, list_ty, item, list)?; - } - Ok(list) -} - -fn bit_list_ty(dag: &Dag) -> Result { - let bit_ty = v4_carrier_decl_id(dag, V4_STD_MACHINE_AUTHORITY, "Bit")?; - list_instantiation_for_element(dag, bit_ty) -} - -fn byte_list_ty(dag: &Dag) -> Result { - let byte_ty = v4_carrier_decl_id(dag, V4_STD_MACHINE_AUTHORITY, "Byte")?; - list_instantiation_for_element(dag, byte_ty) -} - -fn string_list_ty(dag: &Dag) -> Result { - let string_ty = v4_carrier_decl_id(dag, V4_STD_TEXT_AUTHORITY, "String")?; - list_instantiation_for_element(dag, string_ty) -} - -fn byte_value(dag: &Dag, byte: u8) -> Result { - let bits: Vec = (0..8) - .map(|shift| Value::LiteralValue(LiteralBits::Bool((byte >> (7 - shift)) & 1 != 0))) - .collect(); - let bits_list = list_from_values(dag, bit_list_ty(dag)?, bits)?; - Ok(Value::RecordValue(vec![NamedField { - label: "bits".to_string(), - value: bits_list, - }])) -} - -fn byte_string_value(dag: &Dag, bytes: &[u8]) -> Result { - let elems: Result, EvalError> = - bytes.iter().copied().map(|b| byte_value(dag, b)).collect(); - list_from_values(dag, byte_list_ty(dag)?, elems?) -} - -fn string_list_value(dag: &Dag, lines: &[String]) -> Result { - let elems: Vec = lines - .iter() - .cloned() - .map(|line| Value::LiteralValue(LiteralBits::String(line))) - .collect(); - list_from_values(dag, string_list_ty(dag)?, elems) -} - -fn build_log_value(dag: &Dag, lines: &[String]) -> Result { - Ok(Value::RecordValue(vec![NamedField { - label: "lines".to_string(), - value: string_list_value(dag, lines)?, - }])) -} - -fn diagnostics_none_variant(dag: &Dag) -> Result { - Ok(Value::VariantValue { - tag: v4_carrier_variant_tag(dag, V4_STD_DIAGNOSTIC_AUTHORITY, "Diagnostics", "None")?, - payload: Box::new(Value::RecordValue(Vec::new())), - }) -} - -fn accepted_variant(dag: &Dag, value: Value) -> Result { - Ok(Value::VariantValue { - tag: v4_carrier_variant_tag(dag, V4_STD_DIAGNOSTIC_AUTHORITY, "Outcome", "Accepted")?, - payload: Box::new(Value::RecordValue(vec![ - NamedField { - label: "value".to_string(), - value, - }, - NamedField { - label: "diagnostics".to_string(), - value: diagnostics_none_variant(dag)?, - }, - ])), - }) -} - -fn rejected_outcome_variant(dag: &Dag, diagnostics: Value) -> Result { - Ok(Value::VariantValue { - tag: v4_carrier_variant_tag(dag, V4_STD_DIAGNOSTIC_AUTHORITY, "Outcome", "Rejected")?, - payload: Box::new(Value::RecordValue(vec![NamedField { - label: "diagnostics".to_string(), - value: diagnostics, - }])), - }) -} - -fn diagnostic_list_ty(dag: &Dag) -> Result { - let diagnostic_ty = v4_carrier_decl_id(dag, V4_STD_DIAGNOSTIC_AUTHORITY, "Diagnostic")?; - list_instantiation_for_element(dag, diagnostic_ty) -} - -fn non_empty_diagnostics_singleton(dag: &Dag, diagnostic: Value) -> Result { - Ok(Value::RecordValue(vec![ - NamedField { - label: "head".to_string(), - value: diagnostic, - }, - NamedField { - label: "tail".to_string(), - value: empty_list_value(dag, diagnostic_list_ty(dag)?)?, - }, - ])) -} - -fn correction_unavailable_variant(dag: &Dag) -> Result { - Ok(Value::VariantValue { - tag: v4_carrier_variant_tag( - dag, - V4_STD_DIAGNOSTIC_AUTHORITY, - "Correction", - "Unavailable", - )?, - payload: Box::new(Value::RecordValue(vec![NamedField { - label: "reason".to_string(), - value: Value::VariantValue { - tag: v4_carrier_variant_tag( - dag, - V4_STD_DIAGNOSTIC_AUTHORITY, - "NoCorrectionReason", - "ExternalContractUnknown", - )?, - payload: Box::new(Value::RecordValue(vec![])), - }, - }])), - }) -} - -fn port_locus_value(dag: &Dag, port: &str) -> Result { - Ok(Value::VariantValue { - tag: v4_carrier_variant_tag(dag, V4_STD_DIAGNOSTIC_AUTHORITY, "Locus", "PortLocus")?, - payload: Box::new(Value::RecordValue(vec![NamedField { - label: "anchor".to_string(), - value: Value::RecordValue(vec![NamedField { - label: "at".to_string(), - value: Value::LiteralValue(LiteralBits::String(port.to_string())), - }]), - }])), - }) -} - -fn emit_host_port_diagnostic(dag: &Dag, reason: &str) -> Result { - Ok(Value::RecordValue(vec![ - NamedField { - label: "reason".to_string(), - value: Value::LiteralValue(LiteralBits::String(reason.to_string())), - }, - NamedField { - label: "at".to_string(), - value: port_locus_value(dag, "emit_host_transport_port")?, - }, - NamedField { - label: "correction".to_string(), - value: correction_unavailable_variant(dag)?, - }, - ])) -} - -fn host_logical_failure_diagnostic( - dag: &Dag, - failure: &HostLogicalFailure, -) -> Result { - let reason = match failure { - HostLogicalFailure::TimedOut { .. } => "emit_host_exit_timed_out", - HostLogicalFailure::NoExitStatus { .. } => "emit_host_exit_no_status", - HostLogicalFailure::ExitedNonzero { .. } => "emit_host_exit_nonzero", - }; - emit_host_port_diagnostic(dag, reason) -} - -fn host_setup_failure_reason(failure: &HostSetupFailure) -> &'static str { - match failure { - HostSetupFailure::SpawnFailed { .. } => "emit_host_setup_spawn_failed", - HostSetupFailure::StdoutPipeMissing { .. } => "emit_host_setup_stdout_pipe_missing", - HostSetupFailure::StderrPipeMissing { .. } => "emit_host_setup_stderr_pipe_missing", - HostSetupFailure::TryWaitFailed { .. } => "emit_host_setup_try_wait_failed", - HostSetupFailure::StreamReadFailed { .. } => "emit_host_setup_stream_read_failed", - HostSetupFailure::WorkDirCreateFailed { .. } => "emit_host_setup_work_dir_create_failed", - HostSetupFailure::ManifestWriteFailed { .. } => "emit_host_setup_manifest_write_failed", - HostSetupFailure::SourceWriteFailed { .. } => "emit_host_setup_source_write_failed", - HostSetupFailure::EmptyClaimInputRoot => "emit_host_setup_empty_claim_input_root", - HostSetupFailure::EmptyExpectedEvalRoot => "emit_host_setup_empty_expected_eval_root", - } -} - -fn host_setup_failure_diagnostic( - dag: &Dag, - failure: &HostSetupFailure, -) -> Result { - emit_host_port_diagnostic(dag, host_setup_failure_reason(failure)) -} - -fn witness_holds_variant(dag: &Dag, value: Value) -> Result { - Ok(Value::VariantValue { - tag: v4_carrier_variant_tag(dag, V4_STD_WITNESS_AUTHORITY, "Witness", "Holds")?, - payload: Box::new(Value::RecordValue(vec![NamedField { - label: "value".to_string(), - value, - }])), - }) -} - -fn witness_violates_variant(dag: &Dag, diagnostic: Value) -> Result { - Ok(Value::VariantValue { - tag: v4_carrier_variant_tag(dag, V4_STD_WITNESS_AUTHORITY, "Witness", "Violates")?, - payload: Box::new(Value::RecordValue(vec![NamedField { - label: "diagnostic".to_string(), - value: diagnostic, - }])), - }) -} - -fn host_exit_value(dag: &Dag, exit: &HostExit) -> Result { - Ok(Value::RecordValue(vec![NamedField { - label: "outcome".to_string(), - value: host_exit_outcome_value(dag, exit)?, - }])) -} - -fn host_exit_outcome_value(dag: &Dag, exit: &HostExit) -> Result { - match &exit.outcome { - HostExitOutcome::Accepted(ExitWitness::Holds(ok)) => accepted_variant( - dag, - witness_holds_variant( - dag, - Value::RecordValue(vec![NamedField { - label: "code".to_string(), - value: Value::LiteralValue(LiteralBits::Int(ok.code.to_string())), - }]), - )?, - ), - HostExitOutcome::Accepted(ExitWitness::Violates(failure)) => accepted_variant( - dag, - witness_violates_variant(dag, host_logical_failure_diagnostic(dag, failure)?)?, - ), - HostExitOutcome::Rejected(setup) => rejected_outcome_variant( - dag, - non_empty_diagnostics_singleton(dag, host_setup_failure_diagnostic(dag, setup)?)?, - ), - } -} - -/// Mirrors `host_logical_run_from_exit` in `v4.std.host_run`. -fn host_logical_run_outcome_value( - dag: &Dag, - exit: &HostExit, - stdout_bytes: &[u8], -) -> Result { - match &exit.outcome { - HostExitOutcome::Accepted(ExitWitness::Holds(_)) => { - let stdout = Value::RecordValue(vec![NamedField { - label: "bytes".to_string(), - value: byte_string_value(dag, stdout_bytes)?, - }]); - accepted_variant( - dag, - Value::RecordValue(vec![NamedField { - label: "stdout".to_string(), - value: stdout, - }]), - ) - } - HostExitOutcome::Accepted(ExitWitness::Violates(failure)) => rejected_outcome_variant( - dag, - non_empty_diagnostics_singleton(dag, host_logical_failure_diagnostic(dag, failure)?)?, - ), - HostExitOutcome::Rejected(setup) => rejected_outcome_variant( - dag, - non_empty_diagnostics_singleton(dag, host_setup_failure_diagnostic(dag, setup)?)?, - ), - } -} - -fn emit_host_receipt_value( - dag: &Dag, - target: &Value, - receipt: EmitHostRunReceipt, -) -> Result { - let exit = host_exit_outcome_value(dag, &receipt.exit)?; - let logical_run = host_logical_run_outcome_value(dag, &receipt.exit, &receipt.stdout_bytes)?; - Ok(Value::RecordValue(vec![ - NamedField { - label: "target".to_string(), - value: target.clone(), - }, - NamedField { - label: "source_text".to_string(), - value: Value::LiteralValue(LiteralBits::String(receipt.source_text)), - }, - NamedField { - label: "exit".to_string(), - value: Value::RecordValue(vec![NamedField { - label: "outcome".to_string(), - value: exit, - }]), - }, - NamedField { - label: "logical_run".to_string(), - value: logical_run, - }, - NamedField { - label: "stderr_bytes".to_string(), - value: byte_string_value(dag, &receipt.stderr_bytes)?, - }, - NamedField { - label: "build_log".to_string(), - value: Value::RecordValue(vec![NamedField { - label: "lines".to_string(), - value: string_list_value(dag, &receipt.build_log.lines)?, - }]), - }, - ])) -} - -#[cfg(test)] -mod tests { - use super::*; - use crate::dag::{ - ArrowBody, AtomPayload, BindNodeId, Dag, Declaration, DeclarationId, Field, - TemplateArgument, TypeConnective, - }; - use crate::diagnostics::SourceSpan; - use crate::evaluator::{EvalFrame, EvalStateStack, EvalStrategy, InputEvaluationOrder}; - use emit_host_runner::HostSetupFailure; - - fn optional_variant(dag: &Dag, name: &str, payload: Value) -> Value { - let tag = dag - .declarations() - .iter() - .find_map(|decl| { - let TypeConnective::Disj { variants } = &decl.connective else { - return None; - }; - variants - .iter() - .find(|variant| variant.label == name) - .map(|variant| variant.ty) - }) - .expect(name); - Value::VariantValue { - tag, - payload: Box::new(payload), - } - } - - fn optional_present_value(dag: &Dag, value: Value) -> Value { - optional_variant(dag, "Some", value) - } - - fn span(file: &str) -> SourceSpan { - SourceSpan::new(file, 0, 1) - } - - fn atom_decl(dag: &mut Dag, name: &str, file: &str) -> DeclarationId { - let id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id, - name: Some(name.to_string()), - connective: TypeConnective::Atom(AtomPayload::TypeParam(name.to_string())), - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span(file), - }); - id - } - - fn run_emit_host_decl(dag: &mut Dag, name: &str, file: &str) -> DeclarationId { - let target = atom_decl(dag, "TargetModel", file); - let source = atom_decl(dag, "TargetSource", file); - let inputs = atom_decl(dag, "Inputs", file); - let output = atom_decl(dag, "OutcomeEmitHostRunReceipt", file); - let body_value = dag.push_value(LiteralBits::Bool(false), span(file)); - let bind = dag.push_bind( - "transport_not_wired_body", - body_value, - Vec::new(), - span(file), - ); - let id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id, - name: Some(name.to_string()), - connective: TypeConnective::Arrow { - inputs: vec![target, source, inputs], - output, - body: ArrowBody::UserDefined( - BindNodeId::from_bind_node(dag, bind).expect("bind body"), - ), - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span(file), - }); - id - } - - fn empty_eval_state() -> EvalStateStack { - EvalStateStack::with_root_frame(EvalFrame::empty()) - } - - fn applicative_strategy() -> EvalStrategy { - EvalStrategy::ApplicativeOrder { - input_order: InputEvaluationOrder::LeftFirst, - } - } - - const V4_DIAGNOSTIC_PATH: &str = "src/v4/std/diagnostic.dag"; - const V4_WITNESS_PATH: &str = "src/v4/std/witness.dag"; - const V4_COLLECTION_PATH: &str = "src/v4/std/collection.dag"; - const V4_ALGEBRA_PATH: &str = "src/v4/std/algebra.dag"; - const V4_MACHINE_PATH: &str = "src/v4/std/machine.dag"; - const V4_TEXT_PATH: &str = "src/v4/std/text.dag"; - - fn push_named_decl( - dag: &mut Dag, - name: &str, - connective: TypeConnective, - file: &str, - ) -> DeclarationId { - let id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id, - name: Some(name.to_string()), - connective, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span(file), - }); - id - } - - fn push_anonymous_decl(dag: &mut Dag, connective: TypeConnective, file: &str) -> DeclarationId { - let id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id, - name: None, - connective, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span(file), - }); - id - } - - fn push_disj_type( - dag: &mut Dag, - name: &str, - file: &str, - variants: &[(&str, DeclarationId)], - ) -> DeclarationId { - push_named_decl( - dag, - name, - TypeConnective::Disj { - variants: variants - .iter() - .map(|(label, ty)| Field { - label: (*label).to_string(), - ty: *ty, - }) - .collect(), - }, - file, - ) - } - - fn push_conj_type( - dag: &mut Dag, - name: &str, - file: &str, - fields: &[(&str, DeclarationId)], - ) -> DeclarationId { - push_named_decl( - dag, - name, - TypeConnective::Conj { - children: fields - .iter() - .map(|(label, ty)| Field { - label: (*label).to_string(), - ty: *ty, - }) - .collect(), - }, - file, - ) - } - - fn push_list_instantiation( - dag: &mut Dag, - list_template: DeclarationId, - elem: DeclarationId, - file: &str, - ) -> DeclarationId { - let id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id, - name: None, - connective: TypeConnective::Instantiation { - template: list_template, - arguments: vec![TemplateArgument { - parameter: list_template, - value: elem, - }], - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span(file), - }); - id - } - - fn wire_free_monoid_variant_constructors( - dag: &mut Dag, - free_monoid: DeclarationId, - elem: DeclarationId, - file: &str, - ) { - let TypeConnective::Disj { variants } = dag.declaration(free_monoid).connective.clone() - else { - panic!("FreeMonoid must be a sum type"); - }; - for label in ["Empty", "Cons"] { - let arm_ty = variants - .iter() - .find(|variant| variant.label == label) - .expect(label) - .ty; - let id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id, - name: None, - connective: TypeConnective::Instantiation { - template: arm_ty, - arguments: vec![TemplateArgument { - parameter: arm_ty, - value: elem, - }], - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span(file), - }); - } - } - - /// Hermetic v4 std carrier stubs (authority-qualified by `span.file` suffix). - /// - /// Avoids `compile_to_dag_modules_in_order` on `diagnostic.dag` fn bodies (R3 Gap 9) while - /// exercising the same `v4_carrier_*` lookup paths used by python eval dispatch reification. - fn dag_with_hermetic_v4_emit_host_carriers() -> Dag { - let mut dag = Dag::new(); - let bit_ty = push_named_decl( - &mut dag, - "Bit", - TypeConnective::Atom(AtomPayload::TypeParam("Bit".to_string())), - V4_MACHINE_PATH, - ); - let symbol_ty = push_named_decl( - &mut dag, - "Symbol", - TypeConnective::Atom(AtomPayload::TypeParam("Symbol".to_string())), - V4_DIAGNOSTIC_PATH, - ); - let node_ty = push_named_decl( - &mut dag, - "Node", - TypeConnective::Atom(AtomPayload::TypeParam("Node".to_string())), - V4_DIAGNOSTIC_PATH, - ); - let _diagnostic_ty = push_conj_type( - &mut dag, - "Diagnostic", - V4_DIAGNOSTIC_PATH, - &[ - ("reason", symbol_ty), - ("at", node_ty), - ("correction", node_ty), - ], - ); - let external_contract_unknown = push_anonymous_decl( - &mut dag, - TypeConnective::Atom(AtomPayload::TypeParam( - "ExternalContractUnknown".to_string(), - )), - V4_DIAGNOSTIC_PATH, - ); - let _no_correction_reason = push_disj_type( - &mut dag, - "NoCorrectionReason", - V4_DIAGNOSTIC_PATH, - &[("ExternalContractUnknown", external_contract_unknown)], - ); - let _correction = push_disj_type( - &mut dag, - "Correction", - V4_DIAGNOSTIC_PATH, - &[("Unavailable", external_contract_unknown)], - ); - let _locus = push_disj_type( - &mut dag, - "Locus", - V4_DIAGNOSTIC_PATH, - &[("PortLocus", external_contract_unknown)], - ); - let _diagnostics = push_disj_type( - &mut dag, - "Diagnostics", - V4_DIAGNOSTIC_PATH, - &[("None", external_contract_unknown)], - ); - let _outcome = push_disj_type( - &mut dag, - "Outcome", - V4_DIAGNOSTIC_PATH, - &[ - ("Accepted", external_contract_unknown), - ("Rejected", external_contract_unknown), - ], - ); - let holds_payload = push_conj_type( - &mut dag, - "WitnessHolds", - V4_WITNESS_PATH, - &[("value", external_contract_unknown)], - ); - let violates_payload = push_conj_type( - &mut dag, - "WitnessViolates", - V4_WITNESS_PATH, - &[("diagnostic", external_contract_unknown)], - ); - push_disj_type( - &mut dag, - "Witness", - V4_WITNESS_PATH, - &[("Holds", holds_payload), ("Violates", violates_payload)], - ); - let byte_ty = push_named_decl( - &mut dag, - "Byte", - TypeConnective::Atom(AtomPayload::TypeParam("Byte".to_string())), - V4_MACHINE_PATH, - ); - let string_ty = push_named_decl( - &mut dag, - "String", - TypeConnective::Atom(AtomPayload::TypeParam("String".to_string())), - V4_TEXT_PATH, - ); - let empty_arm = push_anonymous_decl( - &mut dag, - TypeConnective::Atom(AtomPayload::TypeParam("FreeMonoidEmpty".to_string())), - V4_ALGEBRA_PATH, - ); - let elem_param = push_anonymous_decl( - &mut dag, - TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - V4_ALGEBRA_PATH, - ); - let tail_param = push_anonymous_decl( - &mut dag, - TypeConnective::Atom(AtomPayload::TypeParam("FreeMonoidTail".to_string())), - V4_ALGEBRA_PATH, - ); - let cons_payload = push_conj_type( - &mut dag, - "FreeMonoidCons", - V4_ALGEBRA_PATH, - &[("head", elem_param), ("tail", tail_param)], - ); - let free_monoid = push_disj_type( - &mut dag, - "FreeMonoid", - V4_ALGEBRA_PATH, - &[("Empty", empty_arm), ("Cons", cons_payload)], - ); - let list_template = push_named_decl( - &mut dag, - "List", - TypeConnective::Atom(AtomPayload::TypeParam("List".to_string())), - V4_COLLECTION_PATH, - ); - let diagnostic_ty = dag - .declarations() - .iter() - .find(|decl| { - decl.name.as_deref() == Some("Diagnostic") - && decl.span.file.ends_with(V4_DIAGNOSTIC_PATH) - }) - .expect("Diagnostic stub") - .id; - for elem in [bit_ty, byte_ty, string_ty, diagnostic_ty] { - push_list_instantiation(&mut dag, list_template, elem, V4_COLLECTION_PATH); - wire_free_monoid_variant_constructors(&mut dag, free_monoid, elem, V4_ALGEBRA_PATH); - } - dag - } - - fn dag_with_v4_emit_host_carrier_authorities() -> Dag { - dag_with_hermetic_v4_emit_host_carriers() - } - - #[test] - fn emit_host_fixture_inputs_projects_distinct_claim_and_expected_roots() { - let dag = Dag::new(); - let inputs = Value::RecordValue(vec![ - NamedField { - label: "root".to_string(), - value: Value::LiteralValue(LiteralBits::String("claim_pin".to_string())), - }, - NamedField { - label: "expected_eval_root".to_string(), - value: optional_present_value( - &dag, - Value::LiteralValue(LiteralBits::String("expected_eval_pin".to_string())), - ), - }, - ]); - let mut state = empty_eval_state(); - let strategy = applicative_strategy(); - let pins = - emit_host_fixture_inputs(&dag, &inputs, &mut state, &strategy).expect("Inputs pins"); - assert_eq!(pins.claim_input_root, "claim_pin"); - assert_eq!(pins.expected_eval_root, "expected_eval_pin"); - } - - #[test] - fn emit_host_fixture_inputs_uses_present_host_claim_pin() { - let dag = Dag::new(); - let inputs = Value::RecordValue(vec![ - NamedField { - label: "root".to_string(), - value: Value::LiteralValue(LiteralBits::String("eval_root_pin".to_string())), - }, - NamedField { - label: "expected_eval_root".to_string(), - value: optional_present_value( - &dag, - Value::LiteralValue(LiteralBits::String("expected_eval_pin".to_string())), - ), - }, - NamedField { - label: "host_claim_pin".to_string(), - value: optional_present_value( - &dag, - Value::LiteralValue(LiteralBits::String("host_claim_pin".to_string())), - ), - }, - ]); - let mut state = empty_eval_state(); - let strategy = applicative_strategy(); - let pins = - emit_host_fixture_inputs(&dag, &inputs, &mut state, &strategy).expect("Inputs pins"); - assert_eq!(pins.claim_input_root, "host_claim_pin"); - assert_eq!(pins.expected_eval_root, "expected_eval_pin"); - } - - #[test] - fn v4_witness_variant_resolution_uses_witness_dag_not_dimensions() { - let dag = dag_with_v4_emit_host_carrier_authorities(); - assert!( - v4_carrier_variant_tag(&dag, V4_STD_WITNESS_AUTHORITY, "Witness", "Holds").is_ok(), - "v4.std.witness.Witness must expose Holds" - ); - assert!( - v4_carrier_variant_tag(&dag, V4_STD_WITNESS_AUTHORITY, "Witness", "Inhabits").is_err(), - "dimensions.dag Witness must not satisfy Holds lookup" - ); - } - - #[test] - fn try_dispatch_emit_host_python_ignores_unrelated_callable() { - let mut dag = Dag::empty(); - let unrelated_id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: unrelated_id, - name: Some("unrelated_callable".to_string()), - connective: TypeConnective::Atom(AtomPayload::UnresolvedIdentifier( - "probe".to_string(), - )), - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("unrelated.dag", 0, 1), - }); - let mut state = empty_eval_state(); - let strategy = applicative_strategy(); - assert!( - try_dispatch_emit_host_python(&dag, unrelated_id, &[], &mut state, &strategy).is_none(), - "unrelated callable must not intercept eval dispatch" - ); - assert!( - try_dispatch_emit_host_python( - &dag, - DeclarationId::test_raw(999), - &[], - &mut state, - &strategy - ) - .is_none(), - "missing declaration must not intercept eval dispatch" - ); - } - - #[test] - fn emit_host_transport_inputs_carries_claim_only_at_transport_boundary() { - let dag = Dag::new(); - let inputs = Value::RecordValue(vec![NamedField { - label: "root".to_string(), - value: Value::LiteralValue(LiteralBits::String("claim_only".to_string())), - }]); - let mut state = empty_eval_state(); - let strategy = applicative_strategy(); - let pins = - emit_host_transport_inputs(&dag, &inputs, &mut state, &strategy).expect("claim pin"); - assert_eq!(pins.claim_input_root, "claim_only"); - assert!( - emit_host_runner::validate_emit_host_transport_inputs(&pins).is_ok(), - "transport validation must accept claim-only pins" - ); - } - - #[test] - fn emit_host_fixture_inputs_rejects_missing_root_field() { - let inputs = Value::RecordValue(vec![NamedField { - label: "not_root".to_string(), - value: Value::LiteralValue(LiteralBits::String("x".to_string())), - }]); - let dag = Dag::new(); - let mut state = empty_eval_state(); - let strategy = applicative_strategy(); - let err = emit_host_transport_inputs(&dag, &inputs, &mut state, &strategy).unwrap_err(); - assert!(matches!( - err, - EvalError::BadTransformOperands { - reason: "expected Inputs.root field" - } - )); - } - - #[test] - fn emit_host_fixture_inputs_rejects_non_record_operand() { - let dag = Dag::new(); - let mut state = empty_eval_state(); - let strategy = applicative_strategy(); - let err = emit_host_transport_inputs( - &dag, - &Value::LiteralValue(LiteralBits::String("not_inputs".to_string())), - &mut state, - &strategy, - ) - .unwrap_err(); - assert!(matches!( - err, - EvalError::BadTransformOperands { - reason: "expected Inputs record" - } - )); - } - - /// Five-byte MVP-2 stdout (same contract as `v4_emit_host_harness_test`). - const EVAL_DISPATCH_PYTHON_FIXTURE: &str = - "import sys\nsys.stdout.buffer.write(b'\\x00' * 5)\n"; - - fn run_emit_host_python_decl(dag: &mut Dag) -> DeclarationId { - let callee_decl = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: callee_decl, - name: Some("run_emit_host_python".to_string()), - connective: TypeConnective::Atom(AtomPayload::UnresolvedIdentifier( - "run_emit_host_python".to_string(), - )), - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("src/v4/compiler/emit_host.dag", 207, 216), - }); - callee_decl - } - - fn eval_dispatch_operands() -> [Value; 3] { - [ - Value::LiteralValue(LiteralBits::String("eval_target_stub".to_string())), - Value::LiteralValue(LiteralBits::String( - EVAL_DISPATCH_PYTHON_FIXTURE.to_string(), - )), - Value::RecordValue(vec![NamedField { - label: "root".to_string(), - value: Value::LiteralValue(LiteralBits::String("eval_claim_root".to_string())), - }]), - ] - } - - #[test] - fn try_dispatch_emit_host_python_reifies_accepted_receipt_for_pass_fixture() { - let mut dag = dag_with_hermetic_v4_emit_host_carriers(); - let callee_decl = run_emit_host_python_decl(&mut dag); - let mut state = empty_eval_state(); - let strategy = applicative_strategy(); - let operands = eval_dispatch_operands(); - let result = - try_dispatch_emit_host_python(&dag, callee_decl, &operands, &mut state, &strategy) - .expect("python dispatch must claim emit_host.dag row") - .expect("python dispatch must succeed for pass fixture"); - let Value::VariantValue { tag, payload } = &result else { - panic!("expected Outcome variant, got {result:?}"); - }; - assert_eq!( - v4_carrier_variant_tag(&dag, V4_STD_DIAGNOSTIC_AUTHORITY, "Outcome", "Accepted") - .expect("Outcome::Accepted"), - *tag - ); - let Value::RecordValue(outcome_fields) = &**payload else { - panic!("expected Accepted payload record"); - }; - let Value::RecordValue(receipt_fields) = &outcome_fields - .iter() - .find(|field| field.label == "value") - .expect("Accepted.value") - .value - else { - panic!("expected EmitHostRunReceipt record"); - }; - let source = receipt_fields - .iter() - .find(|field| field.label == "source_text") - .expect("receipt.source_text") - .value - .clone(); - assert_eq!( - source, - Value::LiteralValue(LiteralBits::String( - EVAL_DISPATCH_PYTHON_FIXTURE.to_string() - )) - ); - } - - #[test] - fn run_emit_host_python_eval_dispatch_via_evaluator_callable_transform() { - use crate::dag::TransformTarget; - use crate::evaluator::{ - eval_node, EvalFrame, EvalStateStack, EvalStrategy, InputEvaluationOrder, - }; - - let mut dag = dag_with_hermetic_v4_emit_host_carriers(); - let callee_decl = run_emit_host_python_decl(&mut dag); - let span = SourceSpan::new("emit_host_eval_dispatch_test.v3", 0, 1); - let target_port = dag.alloc_port(None); - let source_port = dag.alloc_port(None); - let inputs_port = dag.alloc_port(None); - let call_output = dag.push_transform( - TransformTarget::Callable(callee_decl), - vec![target_port, source_port, inputs_port], - span.clone(), - ); - let entry = dag - .port(call_output) - .produced_by - .expect("callable transform must produce output port"); - let operands = eval_dispatch_operands(); - let frame = EvalFrame::from_bindings([ - (target_port, operands[0].clone()), - (source_port, operands[1].clone()), - (inputs_port, operands[2].clone()), - ]) - .expect("eval operand bindings"); - let mut state = EvalStateStack::with_root_frame(frame); - let strategy = EvalStrategy::ApplicativeOrder { - input_order: InputEvaluationOrder::LeftFirst, - }; - - let via_eval = eval_node(&dag, entry, &mut state, &strategy).expect("eval dispatch"); - assert_eq!( - state.frames_outer_to_inner().len(), - 1, - "eval frame must pop" - ); - - let Value::VariantValue { tag, payload } = &via_eval else { - panic!("expected Outcome variant, got {via_eval:?}"); - }; - assert_eq!( - v4_carrier_variant_tag(&dag, V4_STD_DIAGNOSTIC_AUTHORITY, "Outcome", "Accepted") - .expect("v4.std.diagnostic.Outcome::Accepted"), - *tag, - "evaluator Callable dispatch must reify Accepted host receipt" - ); - let Value::RecordValue(outcome_fields) = &**payload else { - panic!("expected Accepted payload record"); - }; - let Value::RecordValue(receipt_fields) = &outcome_fields - .iter() - .find(|field| field.label == "value") - .expect("Accepted.value") - .value - else { - panic!("expected EmitHostRunReceipt record"); - }; - let source = receipt_fields - .iter() - .find(|field| field.label == "source_text") - .expect("receipt.source_text") - .value - .clone(); - assert_eq!( - source, - Value::LiteralValue(LiteralBits::String( - EVAL_DISPATCH_PYTHON_FIXTURE.to_string() - )), - "eval dispatch must invoke emit_host_runner with the source operand" - ); - } - - #[test] - fn emit_host_fixture_inputs_rejects_malformed_host_claim_pin() { - let dag = Dag::new(); - let inputs = Value::RecordValue(vec![ - NamedField { - label: "root".to_string(), - value: Value::LiteralValue(LiteralBits::String("eval_root_pin".to_string())), - }, - NamedField { - label: "expected_eval_root".to_string(), - value: optional_present_value( - &dag, - Value::LiteralValue(LiteralBits::String("expected_eval_pin".to_string())), - ), - }, - NamedField { - label: "host_claim_pin".to_string(), - value: Value::LiteralValue(LiteralBits::String("not_optional".to_string())), - }, - ]); - let mut state = empty_eval_state(); - let strategy = applicative_strategy(); - let err = emit_host_fixture_inputs(&dag, &inputs, &mut state, &strategy) - .expect_err("malformed host_claim_pin must fail closed"); - assert_eq!( - err, - EvalError::BadTransformOperands { - reason: "expected Inputs optional field to be Optional variant" - } - ); - } - - #[test] - fn host_setup_failure_reason_maps_variant() { - assert_eq!( - host_setup_failure_reason(&HostSetupFailure::EmptyClaimInputRoot), - "emit_host_setup_empty_claim_input_root" - ); - } - - #[test] - fn go_eval_dispatch_claims_only_emit_host_authority_decl() { - let mut dag = Dag::new(); - let go_decl = run_emit_host_decl( - &mut dag, - "run_emit_host_go", - "src/v4/compiler/emit_host.dag", - ); - let lookalike_decl = - run_emit_host_decl(&mut dag, "run_emit_host_go", "src/v4/compiler/other.dag"); - let rust_decl = run_emit_host_decl( - &mut dag, - "run_emit_host_rust", - "src/v4/compiler/emit_host.dag", - ); - let mut state = empty_eval_state(); - let strategy = applicative_strategy(); - - let claimed = - try_dispatch_emit_host_go(&dag, go_decl, &[], &mut state, &strategy).expect("claimed"); - assert_eq!( - claimed, - Err(EvalError::TransformArityMismatch { - expected: 3, - got: 0 - }), - "the Go hook must claim the substrate run_emit_host_go declaration before user-body eval" - ); - assert!( - try_dispatch_emit_host_go(&dag, lookalike_decl, &[], &mut state, &strategy).is_none(), - "same-name declarations outside emit_host.dag must not be intercepted" - ); - assert!( - try_dispatch_emit_host_go(&dag, rust_decl, &[], &mut state, &strategy).is_none(), - "run_emit_host_rust must stay on the Rust dispatch hook" - ); - } - - fn substrate_arrow_fn_decl( - dag: &mut Dag, - name: &str, - inputs: Vec, - file: &str, - ) -> DeclarationId { - let output = atom_decl(dag, "OutcomeStub", file); - let body_value = dag.push_value(LiteralBits::Bool(false), span(file)); - let bind = dag.push_bind( - "transport_not_wired_body", - body_value, - Vec::new(), - span(file), - ); - let id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id, - name: Some(name.to_string()), - connective: TypeConnective::Arrow { - inputs, - output, - body: ArrowBody::UserDefined( - BindNodeId::from_bind_node(dag, bind).expect("bind body"), - ), - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span(file), - }); - id - } - - fn run_host_process_decl(dag: &mut Dag, file: &str) -> DeclarationId { - let descriptor = atom_decl(dag, "HostTransportDescriptor", file); - let target = atom_decl(dag, "TargetModel", file); - let source = atom_decl(dag, "TargetSource", file); - let inputs = atom_decl(dag, "Inputs", file); - substrate_arrow_fn_decl( - dag, - "run_host_process", - vec![descriptor, target, source, inputs], - file, - ) - } - - fn runtime_value_signed_i32_le_as_int_decl(dag: &mut Dag, file: &str) -> DeclarationId { - let runtime_value = atom_decl(dag, "RuntimeValue", file); - substrate_arrow_fn_decl( - dag, - "runtime_value_signed_i32_le_as_int", - vec![runtime_value], - file, - ) - } - - fn signed_i32_le_runtime_value_operand(dag: &Dag, n: i32) -> Value { - let bytes = byte_string_value(dag, &n.to_le_bytes()).expect("byte string"); - let prim_value = Value::RecordValue(vec![ - NamedField { - label: "primitive_type".to_string(), - value: Value::RecordValue(vec![]), - }, - NamedField { - label: "bytes".to_string(), - value: bytes, - }, - ]); - Value::VariantValue { - tag: DeclarationId::test_raw(99), - payload: Box::new(Value::RecordValue(vec![NamedField { - label: "value".to_string(), - value: prim_value, - }])), - } - } - - #[test] - fn b3_run_host_process_eval_dispatch_claims_only_emit_host_authority() { - let mut dag = Dag::new(); - let proc_decl = run_host_process_decl(&mut dag, "src/v4/compiler/emit_host.dag"); - let lookalike_decl = run_host_process_decl(&mut dag, "src/v4/compiler/other.dag"); - let mut state = empty_eval_state(); - let strategy = applicative_strategy(); - - let claimed = try_dispatch_run_host_process(&dag, proc_decl, &[], &mut state, &strategy) - .expect("run_host_process hook must claim emit_host.dag row"); - assert_eq!( - claimed, - Err(EvalError::TransformArityMismatch { - expected: 4, - got: 0 - }), - "hook must claim before arity validation" - ); - assert!( - try_dispatch_run_host_process(&dag, lookalike_decl, &[], &mut state, &strategy) - .is_none(), - "same-name declarations outside emit_host.dag must not be intercepted" - ); - } - - #[test] - fn b3_runtime_value_signed_i32_le_as_int_eval_dispatch_reifies_five() { - let mut dag = dag_with_hermetic_v4_emit_host_carriers(); - let callee_decl = - runtime_value_signed_i32_le_as_int_decl(&mut dag, "src/v4/compiler/emit_host.dag"); - let operand = signed_i32_le_runtime_value_operand(&dag, 5); - let mut state = empty_eval_state(); - let strategy = applicative_strategy(); - - let result = try_dispatch_runtime_value_signed_i32_le_as_int( - &dag, - callee_decl, - &[operand], - &mut state, - &strategy, - ) - .expect("SignedI32Le hook must claim emit_host.dag row") - .expect("four-byte LE payload must reify"); - - let Value::VariantValue { tag, payload } = &result else { - panic!("expected Outcome variant, got {result:?}"); - }; - assert_eq!( - v4_carrier_variant_tag(&dag, V4_STD_DIAGNOSTIC_AUTHORITY, "Outcome", "Accepted") - .expect("Accepted tag"), - *tag - ); - let Value::RecordValue(outcome_fields) = &**payload else { - panic!("expected Accepted payload record"); - }; - let value_field = outcome_fields - .iter() - .find(|field| field.label == "value") - .expect("Accepted.value"); - assert_eq!( - value_field.value, - Value::LiteralValue(LiteralBits::Int("5".to_string())) - ); - } - - #[test] - fn b3_runtime_value_signed_i32_le_as_int_claims_only_emit_host_authority() { - let mut dag = Dag::new(); - let decl = - runtime_value_signed_i32_le_as_int_decl(&mut dag, "src/v4/compiler/emit_host.dag"); - let lookalike = - runtime_value_signed_i32_le_as_int_decl(&mut dag, "src/v4/compiler/other.dag"); - let mut state = empty_eval_state(); - let strategy = applicative_strategy(); - - let claimed = - try_dispatch_runtime_value_signed_i32_le_as_int(&dag, decl, &[], &mut state, &strategy) - .expect("hook must claim emit_host.dag row"); - assert_eq!( - claimed, - Err(EvalError::TransformArityMismatch { - expected: 1, - got: 0 - }) - ); - assert!(try_dispatch_runtime_value_signed_i32_le_as_int( - &dag, - lookalike, - &[], - &mut state, - &strategy - ) - .is_none()); - } -} diff --git a/src/v3/compiler/src/emit_rust.rs b/src/v3/compiler/src/emit_rust.rs deleted file mode 100644 index 74696ee5122..00000000000 --- a/src/v3/compiler/src/emit_rust.rs +++ /dev/null @@ -1,2 +0,0 @@ -pub use crate::emit::rust_target::{EmitError, RealizationCategory, SubstrateMarkerRole}; -pub use crate::emit::{emit_rust_module_text as emit_rust_module, emit_rust_text as emit_rust}; diff --git a/src/v3/compiler/src/emit_rust_bin_shim.rs b/src/v3/compiler/src/emit_rust_bin_shim.rs deleted file mode 100644 index 3168e8fe4a3..00000000000 --- a/src/v3/compiler/src/emit_rust_bin_shim.rs +++ /dev/null @@ -1,92 +0,0 @@ -//! PB-1 — Rust `main.rs` shell for generated `[[bin]]` shims (Item 5). -//! -//! **SG-0 / bounded-seed receipt:** hand-authored path is enumerated in -//! `EXPECTED_HAND_AUTHORED_NON_TEST` in `sg0_census_test.rs` (not -//! `GENERATED_FILES` / `build.rs` output). Narrow host helper for §4.2 shell -//! text only; see `docs/invariants/bounded-substrate-seed.md` (no new -//! substrate primitive — mirrors existing `std.process.ProcessExit`). -//! -//! Authority: `docs/design-pb-runtime-interpreter.md` §4.2 (`main` → -//! `ProcessExit` → `ExitCode`). This module owns **parameterized Rust text** -//! only: it does not resolve `BinShim.entry` `DeclarationRef` targets (row-#1 -//! / host bridge gap — STOP there) and does not wire `cargo`/build.rs. - -/// Formats the `main.rs` wrapper for a `.dag`-authored bin shim. -/// -/// `source_dag_path` is emitted verbatim in the `AUTO-GENERATED` header (one -/// line). `description` is split into `//` comment lines. `entry_fn_qname` is -/// the Rust-qualified symbol for the `.dag` entry function returning -/// [`crate::process_exit::ProcessExit`]. -pub fn format_bin_shim_main_rs( - source_dag_path: &str, - description: &str, - entry_fn_qname: &str, -) -> String { - let mut out = String::new(); - out.push_str("// AUTO-GENERATED from "); - out.push_str(source_dag_path); - out.push_str(" — DO NOT EDIT.\n//\n"); - if description.is_empty() { - out.push_str("//\n"); - } else { - for line in description.lines() { - out.push_str("// "); - out.push_str(line); - out.push('\n'); - } - } - out.push_str( - r#" -use std::io::Write; -use std::process::ExitCode; - -use v3_compiler::dag::Dag; -use v3_compiler::process_exit::ProcessExit; - -fn main() -> ExitCode { - match "#, - ); - out.push_str(entry_fn_qname); - out.push_str( - r#"(&Dag::new()) { - ProcessExit::ExitSuccess => ExitCode::SUCCESS, - ProcessExit::ExitFailure { code, reason } => { - let _ = writeln!(std::io::stderr(), "{reason}"); - // Fail-closed: `ExitFailure` must not map to a successful host exit. - // Non-positive or out-of-range codes remap into 1..=255 (see dsl/std/process.dag). - ExitCode::from((code.max(1).min(255)) as u8) - } - } -} -"#, - ); - out -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn format_bin_shim_main_rs_includes_header_entry_and_process_exit() { - let out = format_bin_shim_main_rs( - "dsl/std/runtime/bin_shims/regen_lens.dag", - "Unified lens-regen driver.", - "std::runtime::bin_shims::regen_lens::regen_lens_main", - ); - assert!(out.contains( - "// AUTO-GENERATED from dsl/std/runtime/bin_shims/regen_lens.dag — DO NOT EDIT." - )); - assert!(out.contains("// Unified lens-regen driver.")); - assert!(out.contains("use v3_compiler::process_exit::ProcessExit;")); - assert!(out.contains("code.max(1).min(255)")); - assert!(!out.contains("code.clamp(0, 255)")); - assert!(out.contains("std::runtime::bin_shims::regen_lens::regen_lens_main(&Dag::new())")); - } - - #[test] - fn format_bin_shim_main_rs_multiline_description() { - let out = format_bin_shim_main_rs("path/to/shim.dag", "line1\nline2", "m::f"); - assert!(out.contains("// line1\n// line2\n")); - } -} diff --git a/src/v3/compiler/src/emit_rust_roundtrip_fixtures.rs b/src/v3/compiler/src/emit_rust_roundtrip_fixtures.rs deleted file mode 100644 index fb87ac7c15a..00000000000 --- a/src/v3/compiler/src/emit_rust_roundtrip_fixtures.rs +++ /dev/null @@ -1,175 +0,0 @@ -//! Emit Rust / omni round-trip fixture tables shared by the host `#[test]` -//! harnesses (`m1_3_*`, `m1_5_*`) and R1C-E `r1c_e_gates::check_*` (the -//! `r1c_e_emit_gates` `ExecuteCommand` bin). **Single source of truth** for -//! `PROGRAM_FIXTURES` / `REFLECTED_FIXTURES` (was `tests/.../determinism_fixtures` -//! + `m1_3` locals). - -/// Self-contained program sources (compile as full programs). -pub struct ProgramFixture { - pub name: &'static str, - pub source: &'static str, - /// Expected stdout from the compiled binary (exact string equality). - pub expected_stdout: &'static str, -} - -pub const PROGRAM_FIXTURES: &[ProgramFixture] = &[ - ProgramFixture { - name: "list_fold_six", - source: "let total: Int = fold(cons(1, cons(2, singleton(3))), 0, |acc, x| acc + x)", - expected_stdout: "6", - }, - ProgramFixture { - name: "generic_list_fold_one", - source: "let total: Int = fold(singleton(1), 0, |acc, x| acc + x)", - expected_stdout: "1", - }, - ProgramFixture { - name: "list_map_then_fold_twelve", - source: "let total: Int = fold(map(cons(1, cons(2, singleton(3))), |x| x * 2), 0, |acc, x| acc + x)", - expected_stdout: "12", - }, - ProgramFixture { - name: "list_filter_then_fold_seven", - source: "let total: Int = fold(filter(cons(1, cons(2, cons(3, singleton(4)))), |x| x > 2), 0, |acc, x| acc + x)", - expected_stdout: "7", - }, - ProgramFixture { - name: "nested_list_builtins_inside_lambda_six", - source: "let total: Int = fold(cons(1, singleton(2)), 0, |acc, x| acc + fold(map(singleton(x), |y| y * 2), 0, |n, y| n + y))", - expected_stdout: "6", - }, - ProgramFixture { - name: "user_function_call_three", - source: "fn add(a: Int, b: Int) -> Int = a + b\nlet total: Int = add(1, 2)", - expected_stdout: "3", - }, - ProgramFixture { - name: "recursive_function_call_six", - source: "fn count_down(n: Int) -> Int = if n == 0 then 0 else n + count_down(n - 1)\nlet total: Int = count_down(3)", - expected_stdout: "6", - }, - ProgramFixture { - name: "record_literal_through_function_one", - source: "type Point { x: Int y: Int }\nfn x_of(p: Point) -> Int = p.x\nlet total: Int = x_of({ x: 1, y: 2 })", - expected_stdout: "1", - }, - ProgramFixture { - name: "user_sum_match_zero", - source: "type Sign = Plus | Minus\nfn classify(s: Sign) -> Int = match s { Plus => 0, Minus => 1 }\nlet total: Int = classify(Plus)", - expected_stdout: "0", - }, -]; - -/// Module-shaped sources for `emit_module` determinism (reflected harness matrix). -pub struct ModuleFixture { - pub name: &'static str, - /// Surface module body (lowers to a module fragment; consumed by `emit_rust_module`). - pub source: &'static str, -} - -// --- DB-8 module surface: one `const` per row so `REFLECTED_FIXTURES` can borrow it. --- - -const MODULE_NODE_COUNT: ModuleFixture = ModuleFixture { - name: "node_count", - source: "fn node_count(d: Dag) -> Int = fold(d.nodes, 0, |n, node| n + 1)", -}; - -const MODULE_BIND_COUNT: ModuleFixture = ModuleFixture { - name: "bind_count", - source: "fn bind_count(d: Dag) -> Int = fold(d.nodes, 0, |n, behavior| match behavior { Value(v) => n, Transform(t) => n, Branch(b) => n, Loop(l) => n, Bind(bind) => n + 1 })", -}; - -const MODULE_SINGLETON_SPAN: ModuleFixture = ModuleFixture { - name: "singleton_span", - source: "fn singleton_span(bind: BindNode) -> List = [bind.span]", -}; - -const MODULE_RESULT_PORT_IS_PARAM: ModuleFixture = ModuleFixture { - name: "result_port_is_param", - source: - "fn result_port_is_param(bind: BindNode) -> Bool = contains(bind.params, bind.result_port)", -}; - -const MODULE_BIND_NAMES: ModuleFixture = ModuleFixture { - name: "bind_names", - source: "type FoundBind { name: String }\n\ - fn bind_names(d: Dag) -> List = \ - fold(d.nodes, empty(), |acc, behavior| \ - match behavior { \ - Value(v) => acc, \ - Transform(t) => acc, \ - Branch(b) => acc, \ - Loop(l) => acc, \ - Bind(bind) => cons({ name: bind.name }, acc) \ - })", -}; - -pub const MODULE_FIXTURES: &[ModuleFixture] = &[ - MODULE_NODE_COUNT, - MODULE_BIND_COUNT, - MODULE_SINGLETON_SPAN, - MODULE_RESULT_PORT_IS_PARAM, - MODULE_BIND_NAMES, -]; - -/// On-disk four-fixture pressure suite (Lane 6 / dependency design). -pub const FOUR_FIXTURE_FILES: &[&str] = &["id.v3", "drop.v3", "wrap.v3", "is_empty.v3"]; - -/// `PROGRAM_FIXTURES` entries excluded from per-target 5× determinism. -/// Empty: Go `Behavior::Loop` emission landed in PR #692. -pub const GO_EMIT_EXCLUDE: &[&str] = &[]; - -/// Program fixtures excluded from Python 5× determinism. -/// Empty: Python `Behavior::Loop` emission landed in PR #692. -pub const PYTHON_EMIT_EXCLUDE: &[&str] = &[]; - -// ── Reflected batched-harness matrix (m1_3 + R1C-E) ───────────────────────── - -/// Expected output shape for a reflected-module roundtrip fixture. -pub enum ReflectedExpected { - /// Exact stdout string (trimmed). - Exact(&'static str), - /// Any positive integer (used for `node_count`, whose exact value is not pinned). - PositiveInt, -} - -/// One reflected-module `rustc` roundtrip: the module surface is **only** in -/// [`ModuleFixture::source`]; this row adds the wrapper that imports `v3_compiler` -/// at runtime and the expected stdout. Points at the same `const` as -/// [`MODULE_FIXTURES`] (no duplicate `source` text). -pub struct ReflectedFixture { - pub module: &'static ModuleFixture, - pub wrapper_body: &'static str, - pub expected_stdout: ReflectedExpected, -} - -pub const REFLECTED_FIXTURES: &[ReflectedFixture] = &[ - ReflectedFixture { - module: &MODULE_NODE_COUNT, - wrapper_body: "let dag = v3_compiler::compile_to_dag(\"let x: Int = 1\\nlet y: Int = x + 2\", \"runtime_reflection.v3\").expect(\"compiles\"); node_count(&dag)", - expected_stdout: ReflectedExpected::PositiveInt, - }, - ReflectedFixture { - module: &MODULE_BIND_COUNT, - // Subtract the bootstrap baseline so the test still pins the - // user-program bind count after Lane 2 Stage 2d std-module binds. - wrapper_body: "let dag = v3_compiler::compile_to_dag(\"let x: Int = 1\\nlet y: Int = x + 2\", \"runtime_reflection.v3\").expect(\"compiles\"); let baseline = v3_compiler::dag::Dag::new(); bind_count(&dag) - bind_count(&baseline)", - expected_stdout: ReflectedExpected::Exact("2"), - }, - ReflectedFixture { - module: &MODULE_SINGLETON_SPAN, - wrapper_body: "let dag = v3_compiler::compile_to_dag(\"let x: Int = 1\\nlet y: Int = x + 2\", \"runtime_reflection.v3\").expect(\"compiles\"); let bind = dag.nodes().iter().find_map(|node| match node { v3_compiler::dag::Behavior::Bind(bind) => Some(bind.clone()), _ => None }).expect(\"bind\"); singleton_span(&bind).len() as i64", - expected_stdout: ReflectedExpected::Exact("1"), - }, - ReflectedFixture { - module: &MODULE_RESULT_PORT_IS_PARAM, - wrapper_body: "let dag = v3_compiler::compile_to_dag(\"fn id(x: Int) -> Int = x\", \"runtime_reflection.v3\").expect(\"compiles\"); let bind = dag.nodes().iter().find_map(|node| match node { v3_compiler::dag::Behavior::Bind(bind) if bind.name == \"id\" && bind.emit_participation() == Some(v3_compiler::dag::BindEmitParticipation::UserCallable) => Some(bind.clone()), _ => None }).expect(\"function bind\"); if result_port_is_param(&bind) { 1 } else { 0 }", - expected_stdout: ReflectedExpected::Exact("1"), - }, - ReflectedFixture { - module: &MODULE_BIND_NAMES, - // Same baseline subtraction as `bind_count`. - wrapper_body: "let dag = v3_compiler::compile_to_dag(\"let x: Int = 1\\nlet y: Int = x + 2\", \"runtime_reflection.v3\").expect(\"compiles\"); let baseline = v3_compiler::dag::Dag::new(); (bind_names(&dag).len() as i64) - (bind_names(&baseline).len() as i64)", - expected_stdout: ReflectedExpected::Exact("2"), - }, -]; diff --git a/src/v3/compiler/src/enforced_lens_application.rs b/src/v3/compiler/src/enforced_lens_application.rs deleted file mode 100644 index 7e0a42d4e52..00000000000 --- a/src/v3/compiler/src/enforced_lens_application.rs +++ /dev/null @@ -1,2072 +0,0 @@ -//! Enforced lens applications (`EnforcedApplication` from `lens_application.dag`). -//! -//! Gate #91 (`enforce_violation_routing_landed`): budget-violation diagnostics are -//! routed through the authored `diagnostic_severity` field — today the single -//! substrate variant `DiagnosticSeverity::Error` maps to [`Diagnostic::ParseError`] -//! (compile-fail / fail-closed), per `lens_application.dag`, design §3, and -//! INVARIANTS C-8. -//! -//! Future extra `DiagnosticSeverity` constructors stay fail-closed at this consumer until -//! an intentional substrate + routing co-update assigns their `Diagnostic::*` shape. -//! -//! Gate #92 (`complexity_violation_compile_error_demonstrated`): when a program -//! authors `EnforcedApplication` referencing -//! `complexity_enforceable`, infer checks the named section using the **same** -//! `LensEnforcement` projection + violation relation as `complexity.dag` -//! (`complexity_enforcement_project` / `complexity_enforcement_violates`, surfaced -//! through `complexity_lens_generated`) and attaches a compile diagnostic on violation. -//! -//! Gate #58 (`apply_lens_self_application_demonstrated`): when a program authors -//! `EnforcedApplication` referencing `timing_enforceable` -//! (`v3.std.timing_lens`), infer reads the **lowered** `TimingMeasurement` from the -//! `DeclarationScope` subject's structural `measurement` field **only after** verifying the -//! subject row's **nominal** `data …: RowTy = …` type declares `measurement: TimingMeasurement` -//! on `RowTy` (API-level contract; avoids unrelated records that merely spell a `measurement` -//! label). The same usage ceiling as `timing_enforcement_project` / `timing_enforcement_violates` -//! in `timing_lens.dag` applies: non-`Observed` reports are enforced via a **variant-shaped** -//! fault path (never compared as ordinary wall-clock `Nat` against the fault sentinel), while -//! `Observed` wall-clock nanoseconds use the same strict `>` edge as gate #94 against -//! `TimingBudget.max`. -//! -//! Gate #95 (`opt_in_iteration_parallelism_via_lens_application_demonstrated`): when a program -//! authors `EnforcedApplication` referencing -//! `parallelism_enforceable` (`lenses.parallelism`) with a [`SectionRef::NodeScope`] section, infer -//! observes **cross-iteration parallel emission** eligibility via authored -//! [`crate::lens_parallelism::parallelism_iteration_observed_mode`] (`parallelism.dag`) on the scope's -//! `NodeId` — identical to lens `parallelism_lens.read`'s substrate surface and the staged -//! `loop_iteration_parallel_emission_indicator`. Budget violations delegate to authored -//! `parallelism_enforcement_violates` via [`crate::lens_declaration_apply::apply_lens_declaration`]; -//! host code does not remap raw indicator integers independently. - -use std::collections::HashMap; - -use crate::dag::{ - literal_decimal_i64, positive_descent_count, ArrowBody, AsymptoticClass, Behavior, Dag, - DeclarationId, FieldValue, LiteralBits, Lookup, NodeId, PortId, PositiveDescentAmount, - TypeConnective, ValueBody, -}; -use crate::diagnostics::{Diagnostic, SourceSpan}; -use crate::lens_cost::{ - complexity_enforcement_project, complexity_enforcement_violates, complexity_of, -}; -use crate::lens_declaration_apply::{apply_lens_declaration, LensApplyError}; - -fn diagnostic_severity_substrate_disj(dag: &Dag) -> Option { - dag.declarations() - .iter() - .find(|d| { - d.name.as_deref() == Some("DiagnosticSeverity") - && d.span.file.ends_with("lens_application.dag") - }) - .map(|d| d.id) -} - -// Fail-closed when `lens_application.dag` does not expose the expected `DiagnosticSeverity` -// substrate row — factored so unit tests can pin the diagnostic without staging a full -// complexity-enforcement DAG (`Dag::new()` omits `complexity_enforceable`). -fn attach_missing_diagnostic_severity_substrate_diagnostic( - dag: &mut Dag, - enforced_template: DeclarationId, -) { - dag.attach_diagnostic(Diagnostic::ParseError { - message: "lens enforcement: could not resolve substrate `DiagnosticSeverity` from \ - `lens_application.dag` (modeled authority missing; fail-closed)" - .to_string(), - span: dag.declaration(enforced_template).span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "EnforcedLensApplicationDiagnostic", - ), - }); -} - -fn timing_lens_gate_58_retirement_correction() -> crate::diagnostics::Correction { - crate::diagnostics::Correction::deferred( - "Gate #58 timing enforcement does not yet retain a source span for a safe timing witness rewrite", - "R3 Gap 9 row #106 timing-lens diagnostic roundtrip", - "thread timing measurement/budget source spans through gate #58 enforcement and replace this scaffold diagnostic with a generated/data-backed LiveCorrection", - ) -} - -/// Reads `timing_enforcement_fault_sentinel_count` from the lowered `timing_lens.dag` declaration -/// body (nullary `fn` → bind → [`ValueNode`]), matching substrate authority instead of duplicating -/// the decimal literal in Rust. -fn timing_enforcement_fault_sentinel_ns_from_substrate(dag: &Dag) -> Option { - let decl = dag.declarations().iter().find(|d| { - d.name.as_deref() == Some("timing_enforcement_fault_sentinel_count") - && d.span.file.ends_with("timing_lens.dag") - })?; - let TypeConnective::Arrow { - body: ArrowBody::UserDefined(bind_id), - .. - } = &decl.connective - else { - return None; - }; - let bind = (*bind_id).bind_opt(dag)?; - let producer = dag.resolve_producer_opt(&bind.value)?; - let Behavior::Value(vn) = producer else { - return None; - }; - let LiteralBits::Int(s) = &vn.data else { - return None; - }; - s.parse().ok() -} - -fn timing_measurement_sum_type_decl_id(dag: &Dag) -> Option { - dag.declarations() - .iter() - .find(|d| { - d.name.as_deref() == Some("TimingMeasurement") - && d.span.file.ends_with("timing_lens.dag") - }) - .map(|d| d.id) -} - -fn peel_type_declaration_head(dag: &Dag, mut id: DeclarationId) -> DeclarationId { - const MAX: usize = 64; - for _ in 0..MAX { - match &dag.declaration(id).connective { - TypeConnective::Instantiation { - template, - arguments, - } if arguments.is_empty() => { - id = *template; - } - TypeConnective::Atom(ap) => { - let Some(next) = ap.resolved_id() else { - break; - }; - id = next; - } - _ => break, - } - } - id -} - -/// Returns the nominal `RowTy` declaration id for a lowered `data row: RowTy = …` value row. -fn data_row_nominal_type_decl_id(dag: &Dag, value_decl_id: DeclarationId) -> Option { - match &dag.declaration(value_decl_id).connective { - TypeConnective::Instantiation { - template, - arguments, - } if arguments.is_empty() => Some(*template), - _ => None, - } -} - -/// True when `RowTy` (after alias peel) is a conj that declares `measurement` with type peeling -/// to the substrate `TimingMeasurement` sum at `tm_disj`. -fn timing_section_row_type_declares_measurement_tm( - dag: &Dag, - section_value_decl_id: DeclarationId, - tm_disj: DeclarationId, -) -> bool { - let Some(row_ty) = data_row_nominal_type_decl_id(dag, section_value_decl_id) else { - return false; - }; - let ty_head = peel_type_declaration_head(dag, row_ty); - let TypeConnective::Conj { children } = &dag.declaration(ty_head).connective else { - return false; - }; - let tm_head = peel_type_declaration_head(dag, tm_disj); - children - .iter() - .any(|f| f.label == "measurement" && peel_type_declaration_head(dag, f.ty) == tm_head) -} - -/// Lowered `TimingMeasurement` usage for timing `EnforcedApplication` enforcement. -/// -/// Separates non-evidence variants from `Observed` wall-clock nanoseconds so a legitimate -/// `Observed` duration equal to the substrate fault sentinel `Nat` cannot be conflated with -/// `Unobserved` / `Ambiguous` / `Stale` (INVARIANTS P2 / modeling-discipline Practice 2). -/// -/// Practice 4 (`docs/modeling-discipline.md`, coproduct checkpoint): **GREEN (terminal)** — mirrors -/// `timing_enforcement_project` / `timing_enforcement_violates` in `timing_lens.dag` on the lowered -/// `TimingMeasurement` witness (substrate `LensEnforcement.violates` now takes `TimingMeasurement` -/// × `TimingBudget` per `lens_application.dag`; gate #58 / codex 10994). -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub(crate) enum TimingMeasurementEnforcementUsage { - NonObservedFault, - ObservedWallNs(u64), -} - -/// Interprets a lowered `TimingMeasurement` value the same way `timing_enforcement_project` does -/// on the substrate (`timing_lens.dag`): `Observed` → wall-clock nanoseconds; other report variants -/// classify as [`TimingMeasurementEnforcementUsage::NonObservedFault`] (not as a raw `Nat`). -fn timing_measurement_enforcement_usage( - dag: &Dag, - tm_disj: DeclarationId, - value: &FieldValue, -) -> Option { - let TypeConnective::Disj { variants } = &dag.declaration(tm_disj).connective else { - return None; - }; - let FieldValue::Variant { - constructor, - payload, - } = value - else { - return None; - }; - let variant = variants.iter().find(|v| v.ty == *constructor)?; - match variant.label.as_str() { - "Observed" => observed_timing_payload_max_ns(payload) - .map(TimingMeasurementEnforcementUsage::ObservedWallNs), - "Unobserved" | "Ambiguous" | "Stale" => { - Some(TimingMeasurementEnforcementUsage::NonObservedFault) - } - _ => None, - } -} - -/// Same reflexive edge as `timing_enforcement_violates` in `timing_lens.dag` on the lowered witness, -/// using the same `>` edge as substrate `Observed` enforcement (no `TimingBudget` sentinel equality -/// on the observed path). -pub(crate) fn timing_enforcement_violates( - declared_max_ns: u64, - usage: TimingMeasurementEnforcementUsage, -) -> bool { - match usage { - TimingMeasurementEnforcementUsage::NonObservedFault => true, - TimingMeasurementEnforcementUsage::ObservedWallNs(ns) => ns > declared_max_ns, - } -} - -fn observed_timing_payload_max_ns(payload: &[FieldValue]) -> Option { - let FieldValue::Record(parts) = payload.first()? else { - return None; - }; - if let Some((_, v)) = parts.iter().find(|(label, _)| label == "duration") { - return field_value_nat_magnitude(v); - } - field_value_nat_magnitude(&FieldValue::Record(parts.clone())) -} - -fn field_value_nat_magnitude(value: &FieldValue) -> Option { - match value { - FieldValue::Literal(LiteralBits::Int(s)) => s.parse().ok(), - FieldValue::Record(parts) => parts - .iter() - .find(|(label, _)| label == "count") - .and_then(|(_, v)| field_value_nat_magnitude(v)), - _ => None, - } -} - -fn field_value_timing_budget_max_ns(value: &FieldValue) -> Option { - let FieldValue::Record(parts) = value else { - return None; - }; - let max = parts - .iter() - .find(|(label, _)| label == "max") - .map(|(_, v)| v)?; - field_value_nat_magnitude(max) -} - -fn is_timing_enforceable_lens_value( - value: &FieldValue, - timing_enforceable_id: Option, - timing_lens_id: Option, - timing_enforcement_id: Option, -) -> bool { - if let (Some(bundle), FieldValue::Reference(id)) = (timing_enforceable_id, value) { - if *id == bundle { - return true; - } - } - let (Some(lens_id), Some(enforcement_id)) = (timing_lens_id, timing_enforcement_id) else { - return false; - }; - let FieldValue::Record(parts) = value else { - return false; - }; - let mut lens_ref: Option = None; - let mut enforcement_ref: Option = None; - for (label, field) in parts { - match (label.as_str(), field) { - ("lens", FieldValue::Reference(r)) => lens_ref = Some(*r), - ("enforcement", FieldValue::Reference(r)) => enforcement_ref = Some(*r), - _ => {} - } - } - lens_ref == Some(lens_id) && enforcement_ref == Some(enforcement_id) -} - -/// Local bookkeeping parallel to authored [`crate::lens_parallelism::ParallelismMode`] for -/// substrate `apply_lens_declaration` witnesses (DSL sum ↔ [`FieldValue::Variant`]). -/// -/// Observations must come only from [`crate::lens_parallelism::parallelism_iteration_observed_mode`]. -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -enum ParallelismIterationBudget { - OptInIndependent, - Sequential, -} - -fn parallelism_iteration_budget_from_substrate( - observed: crate::lens_parallelism::ParallelismMode, -) -> ParallelismIterationBudget { - match observed { - crate::lens_parallelism::ParallelismMode::OptInIndependent => { - ParallelismIterationBudget::OptInIndependent - } - crate::lens_parallelism::ParallelismMode::Sequential => { - ParallelismIterationBudget::Sequential - } - } -} - -fn parallelism_mode_disj_decl_id(dag: &Dag) -> Option { - dag.declarations() - .iter() - .find(|d| { - d.name.as_deref() == Some("ParallelismMode") && d.span.file.ends_with("parallelism.dag") - }) - .map(|d| d.id) -} - -fn parallelism_enforcement_violates_decl_id(dag: &Dag) -> Option { - dag.declarations() - .iter() - .find(|d| { - d.name.as_deref() == Some("parallelism_enforcement_violates") - && d.span.file.ends_with("parallelism.dag") - }) - .map(|d| d.id) -} - -fn parallelism_iteration_budget_as_variant_field_value( - dag: &Dag, - pm_disj: DeclarationId, - budget: ParallelismIterationBudget, -) -> Option { - let TypeConnective::Disj { variants } = &dag.declaration(pm_disj).connective else { - return None; - }; - let label = match budget { - ParallelismIterationBudget::OptInIndependent => "OptInIndependent", - ParallelismIterationBudget::Sequential => "Sequential", - }; - let ctor = variants.iter().find(|v| v.label == label)?.ty; - Some(FieldValue::Variant { - constructor: ctor, - payload: Vec::new(), - }) -} - -fn parallelism_enforcement_violates_via_substrate( - dag: &Dag, - pm_disj: DeclarationId, - observed: ParallelismIterationBudget, - declared: ParallelismIterationBudget, -) -> Result { - let lens_id = parallelism_enforcement_violates_decl_id(dag).ok_or( - LensApplyError::SubstrateReflect("parallelism_enforcement_violates declaration"), - )?; - let observed_fv = parallelism_iteration_budget_as_variant_field_value(dag, pm_disj, observed) - .ok_or(LensApplyError::SubstrateReflect( - "ParallelismMode observed variant", - ))?; - let declared_fv = parallelism_iteration_budget_as_variant_field_value(dag, pm_disj, declared) - .ok_or(LensApplyError::SubstrateReflect( - "ParallelismMode declared variant", - ))?; - let out = apply_lens_declaration(dag, None, lens_id, &[observed_fv, declared_fv])?; - match out { - FieldValue::Literal(LiteralBits::Bool(b)) => Ok(b), - _ => Err(LensApplyError::TypeMismatch( - "parallelism_enforcement_violates Bool output", - )), - } -} - -fn section_ref_node_scope_constructor_id( - dag: &Dag, - section_ref_disj: DeclarationId, -) -> Option { - let TypeConnective::Disj { variants } = &dag.declaration(section_ref_disj).connective else { - return None; - }; - variants - .iter() - .find(|v| v.label == "NodeScope") - .map(|v| v.ty) -} - -fn field_value_parallelism_iteration_budget( - dag: &Dag, - disj: DeclarationId, - value: &FieldValue, -) -> Option { - let FieldValue::Variant { - constructor, - payload, - } = value - else { - return None; - }; - if !payload.is_empty() { - return None; - } - let TypeConnective::Disj { variants } = &dag.declaration(disj).connective else { - return None; - }; - let label = variants - .iter() - .find(|v| v.ty == *constructor)? - .label - .as_str(); - match label { - "OptInIndependent" => Some(ParallelismIterationBudget::OptInIndependent), - "Sequential" => Some(ParallelismIterationBudget::Sequential), - _ => None, - } -} - -fn resolve_node_scope_section( - _dag: &Dag, - section: &FieldValue, - node_scope_conj: DeclarationId, -) -> Option<(DeclarationId, NodeId)> { - let FieldValue::Variant { - constructor, - payload, - } = section - else { - return None; - }; - if *constructor != node_scope_conj { - return None; - } - let parts: &[(String, FieldValue)] = match payload.as_slice() { - [FieldValue::Record(rec)] => rec.as_slice(), - _ => return None, - }; - let mut decl_ref: Option = None; - let mut node_idx: Option = None; - for (k, v) in parts { - if k == "declaration" { - if let FieldValue::Reference(id) = v { - decl_ref = Some(*id); - } - } else if k == "node" { - if let FieldValue::Literal(LiteralBits::Int(s)) = v { - node_idx = s.parse().ok(); - } - } - } - Some((decl_ref?, NodeId::from_table_index(node_idx?))) -} - -/// Returns `true` when an authored **`ParallelismMode::OptInIndependent`** budget violates the -/// observed iteration-parallelism emission contract from authored -/// `parallelism_iteration_observed_mode` (Lane‑2 `loop_iteration_parallel_emission_indicator`: -/// indicator `1` ⇒ `OptInIndependent`; otherwise `Sequential`). -/// -/// **Gate #95 interim surface** (see `docs/design-lens-application-surface.md` §4.4): pairs with -/// [`check_enforced_lens_applications`] for full `EnforcedApplication`/`NodeScope` routing. -/// -/// Requires `dag` to carry lowered `parallelism.dag` (`parallelism_enforcement_violates`); -/// observes via [`crate::lens_parallelism::parallelism_iteration_observed_mode`]. Delegates violation -/// semantics to that substrate via [`apply_lens_declaration`]. -/// -/// Returns [`Err`] when `parallelism.dag` is absent from this [`Dag`] or substrate evaluation fails -/// ([`LensApplyError`]) — no panics on arbitrary caller-supplied graphs (CODING.md § Hidden panic surface). -pub fn parallelism_iteration_opt_in_enforcement_violates( - dag: &Dag, - workflow_root: NodeId, -) -> Result { - let pm_disj = parallelism_mode_disj_decl_id(dag).ok_or(LensApplyError::SubstrateReflect( - "ParallelismMode from parallelism.dag", - ))?; - let observed = parallelism_iteration_budget_from_substrate( - crate::lens_parallelism::parallelism_iteration_observed_mode(dag, workflow_root), - ); - parallelism_enforcement_violates_via_substrate( - dag, - pm_disj, - observed, - ParallelismIterationBudget::OptInIndependent, - ) -} - -/// Fail-closed check for landed complexity, timing, and iteration-opt-in parallelism enforcement -/// applications (`EnforcedApplication` rows). -/// -/// Exported at the crate root (`v3_compiler::check_enforced_lens_applications`) so integration -/// tests can re-invoke the same post-infer pass as `infer::infer` without treating declaration -/// presence as proof the probe ran (gate #58 receipt). -pub fn check_enforced_lens_applications(dag: &mut Dag) { - let Some(enforced_template) = dag - .declarations() - .iter() - .find(|d| { - d.name.as_deref() == Some("EnforcedApplication") - && d.span.file.ends_with("lens_application.dag") - }) - .map(|d| d.id) - else { - return; - }; - let complexity_enforceable_id = dag - .declarations() - .iter() - .find(|d| { - d.name.as_deref() == Some("complexity_enforceable") - && d.span.file.ends_with("complexity.dag") - }) - .map(|d| d.id); - let timing_enforceable_id = dag - .declarations() - .iter() - .find(|d| { - d.name.as_deref() == Some("timing_enforceable") - && d.span.file.ends_with("timing_lens.dag") - }) - .map(|d| d.id); - let timing_lens_id = dag - .declarations() - .iter() - .find(|d| { - d.name.as_deref() == Some("timing_lens") && d.span.file.ends_with("timing_lens.dag") - }) - .map(|d| d.id); - let timing_enforcement_id = dag - .declarations() - .iter() - .find(|d| { - d.name.as_deref() == Some("timing_enforcement") - && d.span.file.ends_with("timing_lens.dag") - }) - .map(|d| d.id); - let asymptotic_disj = dag - .declarations() - .iter() - .find(|d| { - d.name.as_deref() == Some("AsymptoticClass") && d.span.file.ends_with("algebra.dag") - }) - .map(|d| d.id); - let Some(section_ref_disj) = dag - .declarations() - .iter() - .find(|d| { - d.name.as_deref() == Some("SectionRef") && d.span.file.ends_with("lens_application.dag") - }) - .map(|d| d.id) - else { - return; - }; - let Some(declaration_scope_conj) = declaration_scope_payload_conj(dag, section_ref_disj) else { - return; - }; - let Some(node_scope_conj) = section_ref_node_scope_constructor_id(dag, section_ref_disj) else { - return; - }; - let parallelism_enforceable_id = dag - .declarations() - .iter() - .find(|d| { - d.name.as_deref() == Some("parallelism_enforceable") - && d.span.file.ends_with("parallelism.dag") - }) - .map(|d| d.id); - let parallelism_mode_disj = parallelism_mode_disj_decl_id(dag); - let Some(diagnostic_severity_disj) = diagnostic_severity_substrate_disj(dag) else { - attach_missing_diagnostic_severity_substrate_diagnostic(dag, enforced_template); - return; - }; - let positive_descent_disj = dag - .declaration_by_name("PositiveDescentAmount") - .map(|d| d.id); - - let mut violations: Vec = Vec::new(); - - for decl in dag.declarations() { - let Some(body) = decl.value_body.as_ref() else { - continue; - }; - let ValueBody::Structural { fields } = body else { - continue; - }; - let Some(meta_id) = decl.meta_tag else { - continue; - }; - if !matches_enforced_application_instantiation(dag, meta_id, enforced_template) { - continue; - } - let fm = field_map(fields); - let enforceable_lens = match fm.get("enforceable_lens") { - Some(v) => v, - _ => continue, - }; - let section = match fm.get("section") { - Some(v) => *v, - _ => continue, - }; - let budget_val = match fm.get("budget") { - Some(v) => *v, - _ => continue, - }; - let span = match fm.get("span") { - Some(FieldValue::Record(span_fields)) => record_as_source_span(span_fields), - _ => None, - } - .unwrap_or_else(|| decl.span.clone()); - - if let (Some(cid), FieldValue::Reference(ref_id)) = - (complexity_enforceable_id, enforceable_lens) - { - if *ref_id == cid { - let Some(asymptotic_disj) = asymptotic_disj else { - violations.push(Diagnostic::ParseError { - message: - "lens enforcement: could not resolve substrate `AsymptoticClass` from \ - `algebra.dag` (modeled authority missing; fail-closed)" - .to_string(), - span: decl.span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "EnforcedLensApplicationDiagnostic", - ), - }); - continue; - }; - let Some(fn_decl) = resolve_declaration_scope_fn( - dag, - section, - section_ref_disj, - declaration_scope_conj, - ) else { - violations.push(Diagnostic::ParseError { - message: - "lens enforcement: could not resolve function declaration for section" - .to_string(), - span: decl.span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "EnforcedLensApplicationDiagnostic", - ), - }); - continue; - }; - let Some(port) = fn_result_port(dag, fn_decl) else { - violations.push(Diagnostic::ParseError { - message: - "lens enforcement: could not resolve function result port for section" - .to_string(), - span: decl.span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "EnforcedLensApplicationDiagnostic", - ), - }); - continue; - }; - let Some(budget_class) = field_value_asymptotic_class( - dag, - asymptotic_disj, - positive_descent_disj, - budget_val, - ) else { - violations.push(Diagnostic::ParseError { - message: - "lens enforcement: could not read complexity budget `AsymptoticClass` \ - (ill-formed `ClassPolynomial` budgets must use Peano `degree` ≥ 3; \ - use `ClassLinear` / `ClassQuadratic` for sub-cubic tiers)" - .to_string(), - span: decl.span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "EnforcedLensApplicationDiagnostic", - ), - }); - continue; - }; - - let summary = match complexity_of(dag, &port) { - Lookup::Hit(s) => s, - Lookup::Miss => { - violations.push(Diagnostic::ParseError { - message: - "lens enforcement: complexity lens returned Miss for section — \ - cannot enforce budget" - .to_string(), - span: span.clone(), - correction: - crate::diagnostics::Correction::deferred_for_diagnostic_class( - "EnforcedLensApplicationDiagnostic", - ), - }); - continue; - } - }; - if !complexity_enforcement_violates(&summary, &budget_class) { - continue; - } - let observed = complexity_enforcement_project(&summary); - let severity_val = match fm.get("diagnostic_severity") { - Some(v) => *v, - _ => { - violations.push(Diagnostic::ParseError { - message: - "lens enforcement: `EnforcedApplication` missing `diagnostic_severity`" - .to_string(), - span: decl.span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("EnforcedLensApplicationDiagnostic"), - }); - continue; - } - }; - let violation_message = format!( - "lens enforcement violation: complexity budget {budget_class:?} exceeded \ - by observed class {observed:?} (declared `EnforcedApplication` at {})", - decl.name.as_deref().unwrap_or("?") - ); - violations.push(enforced_violation_diagnostic( - dag, - diagnostic_severity_disj, - severity_val, - violation_message, - span, - )); - continue; - } - } - - if is_timing_enforceable_lens_value( - enforceable_lens, - timing_enforceable_id, - timing_lens_id, - timing_enforcement_id, - ) { - let Some(tm_disj) = timing_measurement_sum_type_decl_id(dag) else { - violations.push(Diagnostic::ParseError { - message: - "lens enforcement: could not resolve substrate `TimingMeasurement` from \ - `timing_lens.dag` (modeled authority missing; fail-closed)" - .to_string(), - span: decl.span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "EnforcedLensApplicationDiagnostic", - ), - }); - continue; - }; - let Some(section_decl_id) = - resolve_declaration_scope_declaration_id(section, declaration_scope_conj) - else { - violations.push(Diagnostic::ParseError { - message: "lens enforcement: could not resolve `DeclarationScope` for timing \ - `EnforcedApplication` section" - .to_string(), - span: decl.span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "EnforcedLensApplicationDiagnostic", - ), - }); - continue; - }; - let section_decl = dag.declaration(section_decl_id); - if !timing_section_row_type_declares_measurement_tm(dag, section_decl_id, tm_disj) { - violations.push(Diagnostic::ParseError { - message: format!( - "lens enforcement: timing `EnforcedApplication` section `{}` must be a \ - lowered `data …: RowTy = …` row whose nominal `RowTy` declares \ - `measurement: TimingMeasurement` (same substrate contract as \ - `timing_enforcement_project`)", - section_decl.name.as_deref().unwrap_or("?") - ), - span: decl.span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "EnforcedLensApplicationDiagnostic", - ), - }); - continue; - } - let Some(body) = section_decl.value_body.as_ref() else { - violations.push(Diagnostic::ParseError { - message: format!( - "lens enforcement: timing section `{}` has no lowered value body", - section_decl.name.as_deref().unwrap_or("?") - ), - span: decl.span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "EnforcedLensApplicationDiagnostic", - ), - }); - continue; - }; - let ValueBody::Structural { fields } = body else { - violations.push(Diagnostic::ParseError { - message: format!( - "lens enforcement: timing section `{}` must lower to a structural record body", - section_decl.name.as_deref().unwrap_or("?") - ), - span: decl.span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("EnforcedLensApplicationDiagnostic"), - }); - continue; - }; - let section_fm = field_map(fields); - let Some(measurement) = section_fm.get("measurement") else { - violations.push(Diagnostic::ParseError { - message: format!( - "lens enforcement: timing section `{}` is missing required `measurement` field", - section_decl.name.as_deref().unwrap_or("?") - ), - span: decl.span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("EnforcedLensApplicationDiagnostic"), - }); - continue; - }; - let Some(usage_projection) = - timing_measurement_enforcement_usage(dag, tm_disj, measurement) - else { - violations.push(Diagnostic::ParseError { - message: format!( - "lens enforcement: could not interpret `measurement` as lowered \ - `TimingMeasurement` for section `{}`", - section_decl.name.as_deref().unwrap_or("?") - ), - span: decl.span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "EnforcedLensApplicationDiagnostic", - ), - }); - continue; - }; - let Some(declared_max_ns) = field_value_timing_budget_max_ns(budget_val) else { - violations.push(Diagnostic::ParseError { - message: "lens enforcement: could not read timing budget `TimingBudget.max` \ - nanoseconds (expected `TimingBudget { max: Nanoseconds { count } }`)" - .to_string(), - span: decl.span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "EnforcedLensApplicationDiagnostic", - ), - }); - continue; - }; - if !timing_enforcement_violates(declared_max_ns, usage_projection) { - continue; - }; - let usage_max_ns_for_message = match usage_projection { - TimingMeasurementEnforcementUsage::ObservedWallNs(ns) => ns, - TimingMeasurementEnforcementUsage::NonObservedFault => { - let Some(s) = timing_enforcement_fault_sentinel_ns_from_substrate(dag) else { - violations.push(Diagnostic::ParseError { - message: - "lens enforcement: could not resolve substrate `timing_enforcement_fault_sentinel_count` \ - from `timing_lens.dag` (needed for fault-path diagnostic text; fail-closed)" - .to_string(), - span: decl.span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("EnforcedLensApplicationDiagnostic"), - }); - continue; - }; - s - } - }; - let severity_val = match fm.get("diagnostic_severity") { - Some(v) => *v, - _ => { - violations.push(Diagnostic::ParseError { - message: - "lens enforcement: `EnforcedApplication` missing `diagnostic_severity`" - .to_string(), - span: decl.span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "EnforcedLensApplicationDiagnostic", - ), - }); - continue; - } - }; - let violation_message = format!( - "lens enforcement violation: timing budget ceiling max_ns={declared_max_ns} exceeded \ - by projected wall-clock usage max_ns={usage_max_ns_for_message} (declared `EnforcedApplication` \ - at {})", - decl.name.as_deref().unwrap_or("?") - ); - violations.push(enforced_violation_diagnostic( - dag, - diagnostic_severity_disj, - severity_val, - violation_message, - span.clone(), - )); - } - - if let (Some(peid), FieldValue::Reference(pe_ref)) = - (parallelism_enforceable_id, enforceable_lens) - { - if *pe_ref == peid { - let Some(pm_disj) = parallelism_mode_disj else { - violations.push(Diagnostic::ParseError { - message: - "lens enforcement: could not resolve substrate `ParallelismMode` from \ - `parallelism.dag` (modeled authority missing; fail-closed)" - .to_string(), - span: decl.span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "EnforcedLensApplicationDiagnostic", - ), - }); - continue; - }; - let Some((fn_decl, subject_node)) = - resolve_node_scope_section(dag, section, node_scope_conj) - else { - violations.push(Diagnostic::ParseError { - message: "lens enforcement: parallelism `EnforcedApplication` requires a \ - `SectionRef::NodeScope { declaration, node }` section (see \ - docs/design-lens-application-surface.md §4.4)" - .to_string(), - span: decl.span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "EnforcedLensApplicationDiagnostic", - ), - }); - continue; - }; - let Some(fn_subject) = dag.declaration_opt(&fn_decl) else { - violations.push(Diagnostic::ParseError { - message: - "lens enforcement: parallelism `SectionRef::NodeScope.declaration` \ - names a substrate `DeclarationId` that is absent from this `Dag` \ - (structured reference out of bounds; fail-closed)" - .to_string(), - span: decl.span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "EnforcedLensApplicationDiagnostic", - ), - }); - continue; - }; - if !matches!(&fn_subject.connective, TypeConnective::Arrow { .. }) { - violations.push(Diagnostic::ParseError { - message: - "lens enforcement: parallelism `NodeScope.declaration` must name a \ - function (`Arrow` declaration)" - .to_string(), - span: decl.span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "EnforcedLensApplicationDiagnostic", - ), - }); - continue; - }; - if !crate::dag::node_scope_subject_within_arrow_declaration( - dag, - fn_decl, - subject_node, - ) { - violations.push(Diagnostic::ParseError { - message: - "lens enforcement: parallelism `SectionRef::NodeScope.node` must name a \ - substrate node in the authored `declaration` body's lowered graph \ - (declaring function bind or descendant reachable from its result \ - subgraph); malformed `(declaration, node)` pairs fail closed instead \ - of reading `loop_iteration_parallel_emission_indicator` out-of-scope" - .to_string(), - span: decl.span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "EnforcedLensApplicationDiagnostic", - ), - }); - continue; - } - let Some(budget_host) = - field_value_parallelism_iteration_budget(dag, pm_disj, budget_val) - else { - violations.push(Diagnostic::ParseError { - message: - "lens enforcement: could not read parallelism budget `ParallelismMode` \ - (expected nullary `OptInIndependent` or `Sequential`)" - .to_string(), - span: decl.span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "EnforcedLensApplicationDiagnostic", - ), - }); - continue; - }; - let indicator = - crate::loop_iteration_parallel_emission_indicator(dag, subject_node); - let observed_host = parallelism_iteration_budget_from_substrate( - crate::lens_parallelism::parallelism_iteration_observed_mode(dag, subject_node), - ); - let violates = match parallelism_enforcement_violates_via_substrate( - dag, - pm_disj, - observed_host, - budget_host, - ) { - Ok(v) => v, - Err(e) => { - violations.push(Diagnostic::ParseError { - message: format!( - "lens enforcement: could not evaluate `parallelism_enforcement_violates` \ - from `parallelism.dag` (fail-closed): {e:?}" - ), - span: decl.span.clone(), - correction: - crate::diagnostics::Correction::deferred_for_diagnostic_class( - "EnforcedLensApplicationDiagnostic", - ), - }); - continue; - } - }; - if !violates { - continue; - } - - let severity_val = match fm.get("diagnostic_severity") { - Some(v) => *v, - _ => { - violations.push(Diagnostic::ParseError { - message: - "lens enforcement: `EnforcedApplication` missing `diagnostic_severity`" - .to_string(), - span: decl.span.clone(), - correction: - crate::diagnostics::Correction::deferred_for_diagnostic_class( - "EnforcedLensApplicationDiagnostic", - ), - }); - continue; - } - }; - let violation_message = format!( - "lens enforcement violation: parallelism iteration `ParallelismMode` budget {budget_host:?} inconsistent \ - with `loop_iteration_parallel_emission_indicator={indicator}` observation (declared `EnforcedApplication` \ - at {})", - decl.name.as_deref().unwrap_or("?") - ); - violations.push(enforced_violation_diagnostic( - dag, - diagnostic_severity_disj, - severity_val, - violation_message, - span.clone(), - )); - } - } - } - - for diagnostic in violations { - dag.attach_diagnostic(diagnostic); - } -} - -#[doc(hidden)] -fn gate_58_raise_observed_duration_ns_in_measurement( - value: &mut FieldValue, - duration_ns: u64, -) -> bool { - match value { - FieldValue::Variant { payload, .. } => { - let Some(FieldValue::Record(parts)) = payload.first_mut() else { - return false; - }; - if let Some((_, FieldValue::Record(duration_parts))) = - parts.iter_mut().find(|(label, _)| label == "duration") - { - return gate_58_set_count_field_to_ns(duration_parts, duration_ns); - } - // PB-1 bootstrap lowering: `Observed` payload can flatten to `{ count: Nat }` without - // a nested `duration` record (authoring uses `Observed { duration: { count } }`). - gate_58_set_count_field_to_ns(parts, duration_ns) - } - _ => false, - } -} - -fn gate_58_set_count_field_to_ns(parts: &mut [(String, FieldValue)], duration_ns: u64) -> bool { - for (dlabel, dfield) in parts.iter_mut() { - if dlabel == "count" { - if let FieldValue::Literal(LiteralBits::Int(s)) = dfield { - *s = duration_ns.to_string(); - return true; - } - return false; - } - } - false -} - -/// Integration receipt helper: mutates the PB-1 gate #58 witness row in a bootstrap [`Dag`]. -/// -/// **Not a supported production API** — only the `v3-compiler` integration test -/// `t_gate_58_apply_lens_self_application_test` should call this (exposed so that test binary can -/// link against `v3_compiler` without `cfg(test)` coupling). -#[doc(hidden)] -pub fn gate_58_test_raise_modeled_ci_timing_measurement_duration_ns( - dag: &mut Dag, - duration_ns: u64, -) -> Result<(), &'static str> { - let id = dag - .declarations() - .iter() - .find(|d| { - d.name.as_deref() == Some("gate_58_modeled_ci_timing_measurement") - && d.span.file.ends_with("t_ci_workflow_as_data_demo.dag") - }) - .map(|d| d.id) - .ok_or("missing gate_58_modeled_ci_timing_measurement declaration")?; - let decl = dag.declaration_mut(id); - let Some(ValueBody::Structural { fields }) = decl.value_body.as_mut() else { - return Err("gate_58 witness missing structural value_body"); - }; - for (label, value) in fields.iter_mut() { - if label == "measurement" - && gate_58_raise_observed_duration_ns_in_measurement(value, duration_ns) - { - return Ok(()); - } - } - Err("measurement field missing or not Observed with duration.count shape") -} - -/// Parses `(declared_max_ns, projected_usage_max_ns)` from a timing lens **budget-ceiling** -/// violation message produced by [`check_enforced_lens_applications`]. -/// -/// The template is owned next to [`timing_enforcement_violates`] / `violation_message` formatting -/// in this module (`max_ns=` appears exactly twice: declared ceiling, then projected usage). -/// Integration tests use this instead of pinning English prose (see repo `TESTING.md` anti-pattern). -#[doc(hidden)] -pub fn gate_58_test_parse_timing_budget_violation_max_ns_pair(message: &str) -> Option<(u64, u64)> { - const NEEDLE: &str = "max_ns="; - let mut found: Vec = Vec::with_capacity(2); - let mut rest = message; - while let Some(pos) = rest.find(NEEDLE) { - let after = pos + NEEDLE.len(); - let tail = &rest[after..]; - let digit_len = tail - .chars() - .take_while(|c| c.is_ascii_digit()) - .map(|c| c.len_utf8()) - .sum::(); - if digit_len == 0 { - return None; - } - let n: u64 = tail[..digit_len].parse().ok()?; - found.push(n); - rest = &tail[digit_len..]; - } - if found.len() == 2 { - Some((found[0], found[1])) - } else { - None - } -} - -fn field_map(fields: &[(String, FieldValue)]) -> HashMap<&str, &FieldValue> { - fields.iter().map(|(k, v)| (k.as_str(), v)).collect() -} - -/// Routes an enforce-mode **budget violation** through `EnforcedApplication.diagnostic_severity`. -/// -/// Substrate policy (C-8): only `DiagnosticSeverity::Error` is a valid steady-state choice; unknown -/// constructors, non-nullary `Error` payload, or malformed values fail closed with an explanatory -/// diagnostic. -fn enforced_violation_diagnostic( - dag: &Dag, - diagnostic_severity_disj: DeclarationId, - severity_val: &FieldValue, - violation_message: String, - span: SourceSpan, -) -> Diagnostic { - let TypeConnective::Disj { variants } = &dag.declaration(diagnostic_severity_disj).connective - else { - return Diagnostic::ParseError { - message: "lens enforcement: internal error (DiagnosticSeverity is not a sum type)" - .to_string(), - span, - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "EnforcedLensApplicationDiagnostic", - ), - }; - }; - let Some(error_ctor) = variants.iter().find(|v| v.label == "Error").map(|v| v.ty) else { - return Diagnostic::ParseError { - message: "lens enforcement: internal error (DiagnosticSeverity lacks `Error` variant)" - .to_string(), - span, - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "EnforcedLensApplicationDiagnostic", - ), - }; - }; - let FieldValue::Variant { - constructor, - payload, - } = severity_val - else { - return Diagnostic::ParseError { - message: "lens enforcement: `diagnostic_severity` must be a `DiagnosticSeverity` \ - variant value" - .to_string(), - span, - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "EnforcedLensApplicationDiagnostic", - ), - }; - }; - if *constructor != error_ctor { - return Diagnostic::ParseError { - message: "lens enforcement: `diagnostic_severity` on `EnforcedApplication` must be \ - `Error` (INVARIANTS C-8; fail-closed discipline)" - .to_string(), - span, - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "EnforcedLensApplicationDiagnostic", - ), - }; - } - // `lens_application.dag`: `type DiagnosticSeverity = Error` — the lone variant is nullary. - if !payload.is_empty() { - return Diagnostic::ParseError { - message: "lens enforcement: `DiagnosticSeverity::Error` must be nullary (INVARIANTS \ - P1; malformed variant payload)" - .to_string(), - span, - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "EnforcedLensApplicationDiagnostic", - ), - }; - } - Diagnostic::ParseError { - message: violation_message, - span, - correction: timing_lens_gate_58_retirement_correction(), - } -} - -fn matches_enforced_application_instantiation( - dag: &Dag, - mut meta: DeclarationId, - enforced_template: DeclarationId, -) -> bool { - for _ in 0..16 { - match &dag.declaration(meta).connective { - TypeConnective::Instantiation { - template, - arguments, - } => { - if *template == enforced_template && arguments.len() == 3 { - return true; - } - if arguments.is_empty() { - meta = *template; - continue; - } - return false; - } - _ => return false, - } - } - false -} - -fn declaration_scope_payload_conj( - dag: &Dag, - section_ref_disj: DeclarationId, -) -> Option { - let TypeConnective::Disj { variants } = &dag.declaration(section_ref_disj).connective else { - return None; - }; - let v = variants.iter().find(|f| f.label == "DeclarationScope")?; - Some(v.ty) -} - -fn resolve_declaration_scope_declaration_id( - section: &FieldValue, - declaration_scope_conj: DeclarationId, -) -> Option { - let FieldValue::Variant { - constructor, - payload, - } = section - else { - return None; - }; - if *constructor != declaration_scope_conj { - return None; - } - match payload.as_slice() { - [FieldValue::Reference(id)] => Some(*id), - [FieldValue::Record(parts)] => { - let mut decl_id: Option = None; - for (label, value) in parts { - if label == "declaration" { - if let FieldValue::Reference(id) = value { - decl_id = Some(*id); - } - } - } - decl_id - } - _ => None, - } -} - -fn resolve_declaration_scope_fn( - dag: &Dag, - section: &FieldValue, - section_ref_disj: DeclarationId, - declaration_scope_conj: DeclarationId, -) -> Option { - let _ = section_ref_disj; - let id = resolve_declaration_scope_declaration_id(section, declaration_scope_conj)?; - matches!(dag.declaration(id).connective, TypeConnective::Arrow { .. }).then_some(id) -} - -fn fn_result_port(dag: &Dag, fn_decl: DeclarationId) -> Option { - let decl = dag.declaration(fn_decl); - let TypeConnective::Arrow { - body: ArrowBody::UserDefined(bind_node), - .. - } = &decl.connective - else { - return None; - }; - let bind = bind_node.bind(dag); - Some(bind.result_port()) -} - -fn record_as_source_span(fields: &[(String, FieldValue)]) -> Option { - let mut file: Option = None; - let mut byte_start: Option = None; - let mut byte_end: Option = None; - for (label, value) in fields { - match (label.as_str(), value) { - ("file", FieldValue::Literal(LiteralBits::String(s))) => file = Some(s.clone()), - ("byte_start", FieldValue::Literal(LiteralBits::Int(n))) => { - byte_start = literal_decimal_i64(n.as_str()).and_then(|v| u32::try_from(v).ok()); - } - ("byte_end", FieldValue::Literal(LiteralBits::Int(n))) => { - byte_end = literal_decimal_i64(n.as_str()).and_then(|v| u32::try_from(v).ok()); - } - ("start", FieldValue::Literal(LiteralBits::Int(n))) => { - byte_start = literal_decimal_i64(n.as_str()).and_then(|v| u32::try_from(v).ok()); - } - ("end", FieldValue::Literal(LiteralBits::Int(n))) => { - byte_end = literal_decimal_i64(n.as_str()).and_then(|v| u32::try_from(v).ok()); - } - _ => {} - } - } - Some(SourceSpan::new(file?, byte_start?, byte_end?)) -} - -fn field_value_asymptotic_class( - dag: &Dag, - ac_disj: DeclarationId, - pda_disj: Option, - value: &FieldValue, -) -> Option { - let FieldValue::Variant { - constructor, - payload, - } = value - else { - return None; - }; - let TypeConnective::Disj { variants } = &dag.declaration(ac_disj).connective else { - return None; - }; - let variant = variants.iter().find(|v| v.ty == *constructor)?; - match variant.label.as_str() { - "ClassConstant" => Some(AsymptoticClass::ClassConstant), - "ClassLog" => Some(AsymptoticClass::ClassLog), - "ClassLinear" => Some(AsymptoticClass::ClassLinear), - "ClassLinearithmic" => Some(AsymptoticClass::ClassLinearithmic), - "ClassQuadratic" => Some(AsymptoticClass::ClassQuadratic), - "ClassExponential" => Some(AsymptoticClass::ClassExponential), - "ClassUnknown" => Some(AsymptoticClass::ClassUnknown), - "ClassPolynomial" => { - let pda = pda_disj?; - let degree = decode_positive_descent_amount(dag, pda, payload)?; - // `AsymptoticClass::ClassPolynomial` in `algebra.dag` is k ≥ 3; Peano - // counts 1–2 are `ClassLinear` / `ClassQuadratic` territory — reject as - // an invalid budget shape (fail closed; openai-pro / P1). - if positive_descent_count(°ree) < 3 { - return None; - } - Some(AsymptoticClass::ClassPolynomial { degree }) - } - _ => None, - } -} - -fn decode_positive_descent_amount( - dag: &Dag, - pda_disj: DeclarationId, - poly_payload: &[FieldValue], -) -> Option { - match poly_payload { - [FieldValue::Record(parts)] => { - let value = parts.iter().find(|(k, _)| k == "degree").map(|(_, v)| v)?; - decode_positive_descent_variant(dag, pda_disj, value) - } - [single] => decode_positive_descent_variant(dag, pda_disj, single), - _ => None, - } -} - -fn decode_positive_descent_variant( - dag: &Dag, - pda_disj: DeclarationId, - value: &FieldValue, -) -> Option { - let FieldValue::Variant { - constructor, - payload, - } = value - else { - return None; - }; - let TypeConnective::Disj { variants } = &dag.declaration(pda_disj).connective else { - return None; - }; - let variant = variants.iter().find(|v| v.ty == *constructor)?; - match variant.label.as_str() { - "OneStep" => Some(PositiveDescentAmount::OneStep), - "AdditionalStep" => { - let FieldValue::Record(parts) = payload.first()? else { - return None; - }; - let prev = parts - .iter() - .find(|(k, _)| k == "previous") - .map(|(_, v)| v)?; - let inner = decode_positive_descent_variant(dag, pda_disj, prev)?; - Some(PositiveDescentAmount::AdditionalStep { - previous: Box::new(inner), - }) - } - _ => None, - } -} - -#[cfg(test)] -mod diagnostic_severity_fail_closed_tests { - use super::*; - use crate::dag::{LiteralBits, TypeConnective}; - use crate::diagnostics::Diagnostic; - - fn assert_parse_error_at(diag: Diagnostic, expected_span: &SourceSpan) { - match diag { - Diagnostic::ParseError { - span, correction, .. - } => { - assert_eq!(&span, expected_span); - assert!(matches!( - correction, - crate::diagnostics::Correction::DeferredCorrection { .. } - )); - } - other => panic!("expected ParseError, got {other:?}"), - } - } - - #[test] - fn missing_diagnostic_severity_substrate_records_fail_closed_diagnostic() { - let mut dag = Dag::new(); - let Some(enforced_template) = dag - .declarations() - .iter() - .find(|d| { - d.name.as_deref() == Some("EnforcedApplication") - && d.span.file.ends_with("lens_application.dag") - }) - .map(|d| d.id) - else { - panic!("bootstrap should declare EnforcedApplication in lens_application.dag"); - }; - let expected_span = dag.declaration(enforced_template).span.clone(); - let Some(ds_id) = super::diagnostic_severity_substrate_disj(&dag) else { - panic!("bootstrap should declare DiagnosticSeverity in lens_application.dag"); - }; - dag.declaration_mut(ds_id).name = Some("DiagnosticSeverity__test_unresolvable".to_string()); - assert!( - super::diagnostic_severity_substrate_disj(&dag).is_none(), - "Expected DiagnosticSeverity substrate row to be unresolvable after rename" - ); - super::attach_missing_diagnostic_severity_substrate_diagnostic(&mut dag, enforced_template); - let mut it = dag.diagnostics().iter(); - let (_, d) = it.next().expect("fail-closed diagnostic"); - assert!(it.next().is_none(), "expected exactly one diagnostic"); - assert_parse_error_at(d.clone(), &expected_span); - } - - #[test] - fn enforced_violation_diagnostic_rejects_non_error_severity_constructor() { - let dag = Dag::new(); - let Some(ds_disj) = dag - .declarations() - .iter() - .find(|d| { - d.name.as_deref() == Some("DiagnosticSeverity") - && d.span.file.ends_with("lens_application.dag") - }) - .map(|d| d.id) - else { - panic!("bootstrap should declare DiagnosticSeverity in lens_application.dag"); - }; - let wrong_ctor = dag - .bool_runtime_variant_id(true) - .expect("bootstrap True variant"); - let expected_span = SourceSpan::new("t.v3", 0, 1); - let diag = enforced_violation_diagnostic( - &dag, - ds_disj, - &FieldValue::Variant { - constructor: wrong_ctor, - payload: Vec::new(), - }, - "violation".to_string(), - expected_span.clone(), - ); - assert_parse_error_at(diag, &expected_span); - } - - #[test] - fn enforced_violation_diagnostic_rejects_non_variant_severity_value() { - let dag = Dag::new(); - let Some(ds_disj) = dag - .declarations() - .iter() - .find(|d| { - d.name.as_deref() == Some("DiagnosticSeverity") - && d.span.file.ends_with("lens_application.dag") - }) - .map(|d| d.id) - else { - panic!("bootstrap should declare DiagnosticSeverity in lens_application.dag"); - }; - let expected_span = SourceSpan::new("t.v3", 0, 1); - let diag = enforced_violation_diagnostic( - &dag, - ds_disj, - &FieldValue::Literal(LiteralBits::Int("0".to_string())), - "violation".to_string(), - expected_span.clone(), - ); - assert_parse_error_at(diag, &expected_span); - } - - #[test] - fn enforced_violation_diagnostic_rejects_error_severity_with_non_nullary_payload() { - let dag = Dag::new(); - let Some(ds_disj) = dag - .declarations() - .iter() - .find(|d| { - d.name.as_deref() == Some("DiagnosticSeverity") - && d.span.file.ends_with("lens_application.dag") - }) - .map(|d| d.id) - else { - panic!("bootstrap should declare DiagnosticSeverity in lens_application.dag"); - }; - let TypeConnective::Disj { variants } = &dag.declaration(ds_disj).connective else { - panic!("bootstrap DiagnosticSeverity should be a sum type"); - }; - let error_ctor = variants - .iter() - .find(|v| v.label == "Error") - .map(|v| v.ty) - .expect("bootstrap DiagnosticSeverity should have Error variant"); - let expected_span = SourceSpan::new("t.v3", 0, 1); - let diag = enforced_violation_diagnostic( - &dag, - ds_disj, - &FieldValue::Variant { - constructor: error_ctor, - payload: vec![FieldValue::Literal(LiteralBits::Int("0".to_string()))], - }, - "violation".to_string(), - expected_span.clone(), - ); - assert_parse_error_at(diag, &expected_span); - } - - #[test] - fn enforce_violation_routing_landed_routes_error_severity_to_parse_error() { - let dag = Dag::new(); - let Some(ds_disj) = dag - .declarations() - .iter() - .find(|d| { - d.name.as_deref() == Some("DiagnosticSeverity") - && d.span.file.ends_with("lens_application.dag") - }) - .map(|d| d.id) - else { - panic!("bootstrap should declare DiagnosticSeverity in lens_application.dag"); - }; - let TypeConnective::Disj { variants } = &dag.declaration(ds_disj).connective else { - panic!("bootstrap DiagnosticSeverity should be a sum type"); - }; - let error_ctor = variants - .iter() - .find(|v| v.label == "Error") - .map(|v| v.ty) - .expect("bootstrap DiagnosticSeverity should have Error variant"); - let expected_span = SourceSpan::new("gate_91.dag", 10, 20); - let diag = enforced_violation_diagnostic( - &dag, - ds_disj, - &FieldValue::Variant { - constructor: error_ctor, - payload: Vec::new(), - }, - "lens enforcement violation: gate #91".to_string(), - expected_span.clone(), - ); - match diag { - Diagnostic::ParseError { message, span, .. } => { - assert_eq!(span, expected_span); - assert_eq!(message, "lens enforcement violation: gate #91"); - } - other => panic!("expected ParseError, got {other:?}"), - } - } -} - -#[cfg(test)] -mod polynomial_budget_class_policy_tests { - use crate::dag::{positive_amount_from_i64, positive_descent_count, PositiveDescentAmount}; - - fn polynomial_budget_peano_is_admissible(degree: &PositiveDescentAmount) -> bool { - positive_descent_count(degree) >= 3 - } - - #[test] - fn class_polynomial_enforcement_budget_rejects_sub_cubic_peano_degrees() { - assert_eq!(positive_descent_count(&PositiveDescentAmount::OneStep), 1); - assert!(!polynomial_budget_peano_is_admissible( - &PositiveDescentAmount::OneStep - )); - let deg2 = PositiveDescentAmount::AdditionalStep { - previous: Box::new(PositiveDescentAmount::OneStep), - }; - assert_eq!(positive_descent_count(°2), 2); - assert!(!polynomial_budget_peano_is_admissible(°2)); - let deg3 = positive_amount_from_i64(3).expect("synthetic degree 3"); - assert!(polynomial_budget_peano_is_admissible(°3)); - } -} - -#[cfg(test)] -mod gate_58_timing_enforcement_unit_tests { - use super::{ - gate_58_test_parse_timing_budget_violation_max_ns_pair, - timing_enforcement_fault_sentinel_ns_from_substrate, timing_enforcement_violates, - TimingMeasurementEnforcementUsage, - }; - use crate::dag::Dag; - - #[test] - fn gate_58_parse_max_ns_pair_matches_timing_budget_violation_template() { - let msg = "lens enforcement violation: timing budget ceiling max_ns=1 exceeded \ - by projected wall-clock usage max_ns=999 (declared `EnforcedApplication` \ - at gate_58_enforcement_budget_violation)"; - assert_eq!( - gate_58_test_parse_timing_budget_violation_max_ns_pair(msg), - Some((1, 999)) - ); - } - - #[test] - fn non_observed_fault_always_violates_under_any_finite_budget() { - assert!(timing_enforcement_violates( - 1, - TimingMeasurementEnforcementUsage::NonObservedFault - )); - assert!(timing_enforcement_violates( - u64::MAX - 1, - TimingMeasurementEnforcementUsage::NonObservedFault - )); - } - - #[test] - fn observed_usage_strictly_exceeding_budget_violates() { - assert!(timing_enforcement_violates( - 500, - TimingMeasurementEnforcementUsage::ObservedWallNs(1000) - )); - } - - #[test] - fn observed_usage_within_or_equal_budget_is_clean() { - assert!(!timing_enforcement_violates( - 1000, - TimingMeasurementEnforcementUsage::ObservedWallNs(500) - )); - assert!(!timing_enforcement_violates( - 1000, - TimingMeasurementEnforcementUsage::ObservedWallNs(1000) - )); - } - - #[test] - fn observed_wall_at_substrate_fault_sentinel_is_not_fault_short_circuit() { - let dag = Dag::new(); - let s = timing_enforcement_fault_sentinel_ns_from_substrate(&dag) - .expect("bootstrap should carry timing_lens fault sentinel"); - assert!(!timing_enforcement_violates( - s + 1, - TimingMeasurementEnforcementUsage::ObservedWallNs(s) - )); - assert!(timing_enforcement_violates( - s - 1, - TimingMeasurementEnforcementUsage::ObservedWallNs(s) - )); - } -} - -#[cfg(test)] -mod gate_95_parallelism_iteration_enforcement_tests { - use super::*; - use crate::compile_to_dag; - use crate::dag::{Declaration, DeclarationId, TemplateArgument, TypeConnective, ValueBody}; - use crate::diagnostics::Diagnostic; - - fn push_parallelism_iteration_enforced_declaration( - dag: &mut Dag, - witness_name: &str, - fn_decl: DeclarationId, - subject: NodeId, - ) { - let enforced_template = dag - .declarations() - .iter() - .find(|d| { - d.name.as_deref() == Some("EnforcedApplication") - && d.span.file.ends_with("lens_application.dag") - }) - .expect("EnforcedApplication") - .id; - let pm_disj = dag - .declarations() - .iter() - .find(|d| { - d.name.as_deref() == Some("ParallelismMode") - && d.span.file.ends_with("parallelism.dag") - }) - .expect("ParallelismMode") - .id; - let parallelism_enforceable = dag - .declarations() - .iter() - .find(|d| { - d.name.as_deref() == Some("parallelism_enforceable") - && d.span.file.ends_with("parallelism.dag") - }) - .expect("parallelism_enforceable") - .id; - let section_ref_disj = dag - .declarations() - .iter() - .find(|d| { - d.name.as_deref() == Some("SectionRef") - && d.span.file.ends_with("lens_application.dag") - }) - .expect("SectionRef") - .id; - let node_scope_ctor = - section_ref_node_scope_constructor_id(dag, section_ref_disj).expect("NodeScope"); - let TypeConnective::Disj { - variants: pm_variants, - } = &dag.declaration(pm_disj).connective - else { - panic!("ParallelismMode sum"); - }; - let optin_ctor = pm_variants - .iter() - .find(|v| v.label == "OptInIndependent") - .expect("OptInIndependent ctor") - .ty; - let ds_disj = - diagnostic_severity_substrate_disj(dag).expect("DiagnosticSeverity substrate"); - let TypeConnective::Disj { - variants: ds_variants, - } = &dag.declaration(ds_disj).connective - else { - panic!("DiagnosticSeverity sum"); - }; - let error_ctor = ds_variants - .iter() - .find(|v| v.label == "Error") - .expect("DiagnosticSeverity.Error") - .ty; - - let template_params = dag.declaration(enforced_template).type_params.clone(); - assert_eq!( - template_params.len(), - 3, - "EnforcedApplication exposes Output/Budget/Projected formal parameters" - ); - let instantiation_arguments: Vec = template_params - .into_iter() - .map(|parameter| TemplateArgument { - parameter, - value: pm_disj, - }) - .collect(); - - let new_id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: new_id, - name: Some(witness_name.to_string()), - connective: TypeConnective::Instantiation { - template: enforced_template, - arguments: instantiation_arguments, - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: Some(new_id), - specialization_parent: None, - inhabits: None, - value_body: Some(ValueBody::Structural { - fields: vec![ - ( - "enforceable_lens".to_string(), - FieldValue::Reference(parallelism_enforceable), - ), - ( - "section".to_string(), - FieldValue::Variant { - constructor: node_scope_ctor, - payload: vec![FieldValue::Record(vec![ - ("declaration".to_string(), FieldValue::Reference(fn_decl)), - ( - "node".to_string(), - FieldValue::Literal(LiteralBits::Int( - subject.raw().to_string(), - )), - ), - ])], - }, - ), - ( - "budget".to_string(), - FieldValue::Variant { - constructor: optin_ctor, - payload: Vec::new(), - }, - ), - ( - "diagnostic_severity".to_string(), - FieldValue::Variant { - constructor: error_ctor, - payload: Vec::new(), - }, - ), - ( - "span".to_string(), - FieldValue::Record(vec![ - ( - "file".to_string(), - FieldValue::Literal(LiteralBits::String( - "gate95_injected.dag".to_string(), - )), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int("0".to_string())), - ), - ( - "end".to_string(), - FieldValue::Literal(LiteralBits::Int("1".to_string())), - ), - ]), - ), - ], - }), - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("gate95_injected.dag", 0, 1), - }); - } - - #[test] - fn opt_in_budget_is_clean_when_lane2_reads_parallelizable_indicator() { - let mut dag = compile_to_dag( - "// gunbc::r3_free_consequences::lane2_loop_witness: read_only\n\ - import lenses.parallelism { parallelism_enforceable }\n\ - fn gate95_demo_fn() -> Int = 0\n", - "gate95_iteration_parallelism_clean.v3", - ) - .expect("compile"); - let subject = dag.workflow_lane2_subject().expect("workflow shell bind"); - let fn_decl = dag - .declaration_by_name("gate95_demo_fn") - .expect("fn decl") - .id; - let indicator = crate::loop_iteration_parallel_emission_indicator(&dag, subject); - assert_eq!(indicator, 1); - assert!(!parallelism_iteration_opt_in_enforcement_violates(&dag, subject).unwrap()); - - push_parallelism_iteration_enforced_declaration( - &mut dag, - "gate95_iteration_parallelism_clean_witness", - fn_decl, - subject, - ); - check_enforced_lens_applications(&mut dag); - assert!( - dag.diagnostics().is_empty(), - "unexpected diagnostics: {:?}", - dag.diagnostics() - ); - } - - #[test] - fn opt_in_budget_violates_when_lane2_reads_sequential_indicator() { - let mut dag = compile_to_dag( - "// gunbc::r3_free_consequences::lane2_loop_witness: upsert_dependent\n\ - import lenses.parallelism { parallelism_enforceable }\n\ - fn gate95_demo_fn() -> Int = 0\n", - "gate95_iteration_parallelism_violation.v3", - ) - .expect("compile"); - let subject = dag.workflow_lane2_subject().expect("workflow shell bind"); - let fn_decl = dag - .declaration_by_name("gate95_demo_fn") - .expect("fn decl") - .id; - let indicator = crate::loop_iteration_parallel_emission_indicator(&dag, subject); - assert_eq!(indicator, 0); - assert!(parallelism_iteration_opt_in_enforcement_violates(&dag, subject).unwrap()); - - push_parallelism_iteration_enforced_declaration( - &mut dag, - "gate95_iteration_parallelism_violation_witness", - fn_decl, - subject, - ); - check_enforced_lens_applications(&mut dag); - assert_eq!( - dag.diagnostics().len(), - 1, - "expected iteration-opt-in parallelism violation diagnostic; got {:?}", - dag.diagnostics() - ); - let (_, diagnostic) = dag.diagnostics().iter().next().expect("diagnostic"); - let Diagnostic::ParseError { message, .. } = diagnostic else { - panic!("expected ParseError violation, got {diagnostic:?}"); - }; - assert!( - message.contains("loop_iteration_parallel_emission_indicator=0"), - "message must name the sequential observation; got {message:?}" - ); - } - - #[test] - fn opt_in_rejects_out_of_range_node_scope_subject() { - let mut dag = compile_to_dag( - "// gunbc::r3_free_consequences::lane2_loop_witness: read_only\n\ - import lenses.parallelism { parallelism_enforceable }\n\ - fn gate95_demo_fn() -> Int = 0\n", - "gate95_oob_node_idx.v3", - ) - .expect("compile"); - let fn_decl = dag - .declaration_by_name("gate95_demo_fn") - .expect("fn decl") - .id; - let bogus_subject = NodeId::from_table_index(dag.nodes().len() as u32); - assert!( - dag.node_opt(&bogus_subject).is_none(), - "fixture must use one-past-last node index as nonexistent NodeId witness" - ); - push_parallelism_iteration_enforced_declaration( - &mut dag, - "gate95_oob_witness", - fn_decl, - bogus_subject, - ); - check_enforced_lens_applications(&mut dag); - assert_eq!(dag.diagnostics().len(), 1, "{:?}", dag.diagnostics()); - let (_, diagnostic) = dag.diagnostics().iter().next().expect("diagnostic"); - let Diagnostic::ParseError { message, .. } = diagnostic else { - panic!("expected ParseError coupling failure; got {diagnostic:?}"); - }; - assert!( - message.contains("fail closed") && message.contains("NodeScope"), - "unexpected message: {message:?}" - ); - } - - #[test] - fn opt_in_rejects_absent_declaration_reference_in_node_scope() { - let mut dag = compile_to_dag( - "// gunbc::r3_free_consequences::lane2_loop_witness: read_only\n\ - import lenses.parallelism { parallelism_enforceable }\n\ - fn gate95_demo_fn() -> Int = 0\n", - "gate95_absent_decl_ref.v3", - ) - .expect("compile"); - let subject = dag.workflow_lane2_subject().expect("workflow shell bind"); - let phantom_decl = DeclarationId::test_raw(u32::MAX); - assert!( - dag.declaration_opt(&phantom_decl).is_none(), - "fixture phantom `DeclarationId` must be absent from the declaration table" - ); - push_parallelism_iteration_enforced_declaration( - &mut dag, - "gate95_absent_decl_ref_witness", - phantom_decl, - subject, - ); - check_enforced_lens_applications(&mut dag); - assert_eq!(dag.diagnostics().len(), 1, "{:?}", dag.diagnostics()); - let (_, diagnostic) = dag.diagnostics().iter().next().expect("diagnostic"); - let Diagnostic::ParseError { message, .. } = diagnostic else { - panic!("expected ParseError absent-declaration coupling failure; got {diagnostic:?}"); - }; - assert!( - message.contains("absent") && message.contains("`Dag`"), - "unexpected message: {message:?}" - ); - } - - #[test] - fn opt_in_rejects_node_scope_foreign_to_declaration() { - let mut dag = compile_to_dag( - "// gunbc::r3_free_consequences::lane2_loop_witness: read_only\n\ - import lenses.parallelism { parallelism_enforceable }\n\ - fn gate95_early() -> Int = 0\n\ - fn gate95_last() -> Int = 1\n", - "gate95_foreign_subject.v3", - ) - .expect("compile"); - let fn_early = dag.declaration_by_name("gate95_early").expect("early").id; - let alien_subject = dag.workflow_lane2_subject().expect("last fn bind shell"); - assert!( - !crate::dag::node_scope_subject_within_arrow_declaration(&dag, fn_early, alien_subject), - "fixture ordering invariant: alien subject must be outside gate95_early's lowered body \ - (workflow shell must not alias the early Arrow root)" - ); - push_parallelism_iteration_enforced_declaration( - &mut dag, - "gate95_foreign_subject_witness", - fn_early, - alien_subject, - ); - check_enforced_lens_applications(&mut dag); - assert_eq!(dag.diagnostics().len(), 1, "{:?}", dag.diagnostics()); - let (_, diagnostic) = dag.diagnostics().iter().next().expect("diagnostic"); - let Diagnostic::ParseError { message, .. } = diagnostic else { - panic!("expected boundary ParseError for decoupled subject; got {diagnostic:?}"); - }; - assert!( - message.contains("lowered graph") - && message.contains("loop_iteration_parallel_emission_indicator"), - "unexpected coupling message: {message:?}" - ); - } -} diff --git a/src/v3/compiler/src/infer.rs b/src/v3/compiler/src/infer.rs deleted file mode 100644 index a2e35f06edc..00000000000 --- a/src/v3/compiler/src/infer.rs +++ /dev/null @@ -1,7504 +0,0 @@ -// Type inference: fills Port.state by propagating types forward through -// the DAG. Dispatches on TypeConnective (M1_DESIGN.md §4) instead of the -// old name-based function signature lookup. -// -// Transform.target is a DeclarationId. Inference reads the target's -// Declaration and: -// - Arrow { inputs, output, body }: direct signature from the input and -// output declarations, converted to port-level TypeShape via the -// `declaration_to_type_shape` bridge. -// - Atom(Identifier { name, resolved }): follow the resolved link if set, -// otherwise look up the name in the Dag's declaration table -// (§8.9 inhabitance walk, reduced at M1(2.5) to direct primitive lookup -// pending the full algebra bootstrap in Phase 5). -// - Anything else: not callable. -// -// Fail-closed (invariant C-8): every detectable problem goes through -// Dag::mark_unresolved. After inference, a post-sweep drives any remaining -// Uninferred ports to Unresolved with a generic diagnostic so the -// biconditional -// state == Unresolved iff diagnostics.contains(port_id) -// and the post-invariant -// state != Uninferred after infer completes -// both hold. -// -// **M1 extension — inference mutates `Dag.declarations`:** operator / algebra -// resolution may `push_declaration` for anonymous `Instantiation` shapes (e.g. -// `Result` for totalizing `div`); `find_equivalent_anonymous_instantiation` -// deduplicates so fixpoint growth stays bounded. `decide` takes `&mut Dag` and clones -// each `Behavior` before matching so borrows stay sound — inference is not read-only -// over the declaration table. - -use std::collections::HashSet; - -use crate::dag::{ - substrate_div_error_type_decl_suppressed_for_emit, - substrate_result_type_decl_suppressed_for_emit, ArithmeticOp, ArrowBody, AtomPayload, Behavior, - BindNode, BindNodeId, CardinalityBound, Dag, Declaration, DeclarationId, Field, LiteralBits, - Lookup, NominalOpacity, PhantomParameter, PortId, PortState, TemplateArgument, TransformNode, - TransformTarget, TypeConnective, -}; -use crate::diagnostics::{ - declaration_display_name, example_source_for_decl, witness_correction_for_decl, Correction, - Diagnostic, SourceSpan, -}; -use crate::infer_helpers::{ - behavior_output_port, generated_template_arguments_match, normalize_instantiation_arguments, - payload_binding_span as generated_payload_binding_span, - push_template_argument_binding as generated_push_template_argument_binding, - resolve_template_argument_value as generated_resolve_template_argument_value, - template_argument_value as generated_template_argument_value, NormalizedInstantiationArgs, - TemplateArgumentBinding, TemplateArgumentsMatch, -}; -use std::str::FromStr; - -use num_bigint::BigInt; - -use crate::int_literal_ranges::{ - int_literal_allowed_integral_seed_for_real_decl, int_literal_fits_expected_type, - integer_range_for_decl, literal_bigint_at, magnitude_out_of_range_for_interval, - IntegerRangeLookup, -}; -use crate::lower::{ - clone_predicate_body, int_literal_bigint_statically_discharges_refinement_chain, - outer_predicate_slots, -}; -use crate::operators::{LogicalOp, OperatorKind}; -use crate::types::TypeShape; - -/// Outcome of [`try_reconcile_int_literal_decision_set`]. -enum IntLiteralSetReconciliation { - /// Reconciled without changing the port (narrow annotation already wins over default `Int`). - Keep, - /// Applied `set_port_type` to narrow a default-`Int` literal port to `ty`. - SetNarrow, - /// `mark_unresolved` with a magnitude or other diagnostic. - Marked, -} - -/// Reconcile `Decision::Set` for ports backed by an integer literal when the proposed -/// and existing [`TypeShape`] would otherwise `TypeMismatch`: (a) `let`/`data` -/// pre-seed vs default `Int`, (b) call-sites that propose a callee's narrow -/// type over a default-`Int` argument. -fn try_reconcile_int_literal_decision_set( - dag: &mut Dag, - port: PortId, - existing: TypeShape, - ty: TypeShape, -) -> Option { - let default_int = dag.int_shape()?; - let literal = literal_bigint_at(dag, port)?; - if type_shapes_equivalent(dag, &ty, &default_int) { - match int_literal_fits_expected_type(dag, &literal, existing.declaration) { - Ok(Some(true)) => Some(IntLiteralSetReconciliation::Keep), - Ok(Some(false)) => { - if let IntegerRangeLookup::Found(range) = - integer_range_for_decl(dag, existing.declaration) - { - let span = node_span_for_port(dag, port).unwrap_or_else(synthetic_span); - dag.mark_unresolved( - port, - magnitude_out_of_range_for_interval(&literal, existing, range, span), - ); - Some(IntLiteralSetReconciliation::Marked) - } else { - None - } - } - Ok(None) => { - if int_literal_allowed_integral_seed_for_real_decl( - dag, - &literal, - existing.declaration, - ) { - Some(IntLiteralSetReconciliation::Keep) - } else { - None - } - } - Err(diag) => { - if !matches!(dag.port(port).state(), PortState::Unresolved) { - dag.mark_unresolved(port, diag); - } - Some(IntLiteralSetReconciliation::Marked) - } - } - } else if type_shapes_equivalent(dag, &existing, &default_int) { - match int_literal_fits_expected_type(dag, &literal, ty.declaration) { - Ok(Some(true)) => { - dag.set_port_type(port, ty); - Some(IntLiteralSetReconciliation::SetNarrow) - } - Ok(Some(false)) => { - if let IntegerRangeLookup::Found(range) = - integer_range_for_decl(dag, ty.declaration) - { - let span = node_span_for_port(dag, port).unwrap_or_else(synthetic_span); - dag.mark_unresolved( - port, - magnitude_out_of_range_for_interval(&literal, ty, range, span), - ); - Some(IntLiteralSetReconciliation::Marked) - } else { - None - } - } - Ok(None) => { - if int_literal_allowed_integral_seed_for_real_decl(dag, &literal, ty.declaration) { - dag.set_port_type(port, ty); - Some(IntLiteralSetReconciliation::SetNarrow) - } else { - None - } - } - Err(diag) => { - if !matches!(dag.port(port).state(), PortState::Unresolved) { - dag.mark_unresolved(port, diag); - } - Some(IntLiteralSetReconciliation::Marked) - } - } - } else { - None - } -} - -pub fn infer(dag: &mut Dag) { - // Fixpoint loop. Runs decide for every node, then pattern - // resolution + exhaustiveness + uniqueness for every Branch. - // Pattern resolution is folded into the loop (not run after it) - // so a Branch that gets flipped to Unresolved by - // non-exhaustive/duplicate-arm checks propagates to downstream - // consumers: the next iteration's decide pass sees the upstream - // Unresolved and cascades Decision::Fail through Transform / - // Branch / Loop / Bind consumers. Running pattern resolution - // after the main loop would leave downstream types stale and - // violate FAIL-CLOSED. - loop { - ensure_all_optional_match_disjs(dag); - let mut changed = false; - let node_count = dag.nodes().len(); - for i in 0..node_count { - match decide(dag, i) { - Decision::Set(port, ty) => { - if matches!(dag.port(port).state(), PortState::Unresolved) { - continue; - } - match dag.port(port).state().clone() { - PortState::Uninferred => { - dag.set_port_type(port, ty); - changed = true; - } - PortState::Resolved(existing) - if type_shapes_equivalent(dag, &existing, &ty) => {} - PortState::Resolved(existing) => { - match int_literal_magnitude_narrow_merge(dag, port, &existing, &ty) { - IntLiteralNarrowMerge::Merge => { - dag.set_port_type(port, ty); - changed = true; - continue; - } - IntLiteralNarrowMerge::Reject(diag) => { - dag.mark_unresolved(port, *diag); - changed = true; - continue; - } - IntLiteralNarrowMerge::NotApplicable => {} - } - if is_retryable_generic_decl(dag, existing.declaration) - || is_retryable_generic_decl(dag, ty.declaration) - { - dag.set_port_type(port, ty); - changed = true; - continue; - } - if let Some(outcome) = - try_reconcile_int_literal_decision_set(dag, port, existing, ty) - { - match outcome { - IntLiteralSetReconciliation::Keep => continue, - IntLiteralSetReconciliation::SetNarrow - | IntLiteralSetReconciliation::Marked => { - changed = true; - continue; - } - } - } - let span = node_span_for_port(dag, port).unwrap_or_else(synthetic_span); - let correction = witness_correction_for_decl( - dag, - existing.declaration, - span.clone(), - format!( - "replace this expression with a `{}` value", - declaration_display_name(dag, existing.declaration) - ), - ) - .unwrap_or_else(|| { - Correction::deferred_for_diagnostic_class("InferenceDiagnostic") - }); - let diag = Diagnostic::TypeMismatch { - expected: existing, - actual: ty, - span, - correction, - }; - dag.mark_unresolved(port, diag); - changed = true; - } - PortState::Unresolved => unreachable!("guarded above"), - } - } - Decision::Fail(port, diag) => { - if !matches!(dag.port(port).state(), PortState::Unresolved) { - dag.mark_unresolved(port, *diag); - changed = true; - } - } - Decision::Retry => {} - } - } - if resolve_branch_patterns(dag) { - changed = true; - } - if resolve_branch_payload_bindings(dag) { - changed = true; - } - if resolve_field_project_targets(dag) { - changed = true; - } - if resolve_callable_targets(dag) { - changed = true; - } - if materialize_callable_signature_instantiations(dag) { - changed = true; - } - if resolve_lambda_parameter_types(dag) { - changed = true; - } - if validate_user_defined_function_signatures(dag) { - changed = true; - } - if !changed { - break; - } - } - - // Post-sweep: any port still Uninferred means decide() missed a case. - let uninferred_ports: Vec = dag - .all_ports() - .filter(|p| matches!(p.state(), PortState::Uninferred)) - .map(|p| p.id()) - .collect(); - for port in uninferred_ports { - let span = node_span_for_port(dag, port).unwrap_or_else(synthetic_span); - dag.mark_unresolved( - port, - Diagnostic::ResolveError { - name: "(inference did not resolve this port)".to_string(), - span, - correction: Correction::deferred_for_diagnostic_class("InferenceDiagnostic"), - }, - ); - } - - crate::enforced_lens_application::check_enforced_lens_applications(dag); -} - -/// Walk a declaration through `Instantiation` / `ResolvedIdentifier` -/// edges until it reaches a declaration whose connective is -/// `Disj`. Returns the `DeclarationId` of that Disj declaration — -/// or `None` if no Disj is reachable within `WALK_DEPTH_LIMIT` -/// steps, or the chain terminates at some other connective. -/// -/// Used by both the `decide_transform` Branch gate and the -/// post-infer `resolve_branch_patterns` pass so that aliased or -/// instantiated sum types (`type Hue = Color` where -/// `Color = Red | Green | Blue`) resolve to the same underlying -/// `Disj` fact whether their immediate connective is the Disj -/// itself, an `Instantiation` pointing at it, or an -/// `Atom(ResolvedIdentifier(...))` chain of aliases. The -/// alternative — reading `decl.connective` directly — would -/// reject aliases even though the underlying sum fact survives -/// in the declaration graph, violating Facts Flow Forward. -fn walk_to_disj_decl(dag: &Dag, start: DeclarationId) -> Option { - let mut current = start; - for _ in 0..WALK_DEPTH_LIMIT { - let decl = dag.declaration(current); - match &decl.connective { - TypeConnective::Disj { .. } => return Some(current), - TypeConnective::Cardinality(p) - if p.bound() == crate::dag::CardinalityBound::AtMostOne => - { - return existing_optional_match_disj_decl(dag, current); - } - TypeConnective::Instantiation { template, .. } => { - current = *template; - } - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - current = *next; - } - _ => return None, - } - } - None -} - -fn existing_optional_match_disj_decl( - dag: &Dag, - cardinality_decl_id: DeclarationId, -) -> Option { - dag.optional_match_disj(cardinality_decl_id) -} - -fn walk_to_optional_cardinality_decl(dag: &Dag, start: DeclarationId) -> Option { - let mut current = start; - for _ in 0..WALK_DEPTH_LIMIT { - match &dag.declaration(current).connective { - TypeConnective::Cardinality(p) - if p.bound() == crate::dag::CardinalityBound::AtMostOne => - { - return Some(current); - } - TypeConnective::Instantiation { template, .. } => current = *template, - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => current = *next, - _ => return None, - } - } - None -} - -pub(crate) fn ensure_optional_match_disj( - dag: &mut Dag, - cardinality_decl_id: DeclarationId, -) -> Option { - if let Some(existing) = existing_optional_match_disj_decl(dag, cardinality_decl_id) { - return Some(existing); - } - let (element, span) = match dag.declaration(cardinality_decl_id).connective.clone() { - TypeConnective::Cardinality(p) if p.bound() == crate::dag::CardinalityBound::AtMostOne => ( - p.element(), - dag.declaration(cardinality_decl_id).span.clone(), - ), - _ => return None, - }; - - let some_payload_id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: some_payload_id, - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "_0".to_string(), - ty: element, - }], - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - - let none_payload_id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: none_payload_id, - name: None, - connective: TypeConnective::Conj { - children: Vec::new(), - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - - let disj_id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: disj_id, - name: None, - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Some".to_string(), - ty: some_payload_id, - }, - Field { - label: "None".to_string(), - ty: none_payload_id, - }, - ], - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span, - }); - dag.set_optional_match_disj(cardinality_decl_id, disj_id); - - Some(disj_id) -} - -/// Materialize `Some`/`None` match sums for every `Cardinality(_, AtMostOne)` row so -/// downstream structural consumers (substrate reflection, lenses) can use -/// `Dag::optional_match_disj` without requiring an optional scrutinee on a Branch. -pub(crate) fn ensure_all_optional_match_disjs(dag: &mut Dag) { - let decl_ids: Vec = dag.declarations().iter().map(|d| d.id).collect(); - for decl_id in decl_ids { - if matches!( - &dag.declaration(decl_id).connective, - TypeConnective::Cardinality(p) if p.bound() == CardinalityBound::AtMostOne - ) && existing_optional_match_disj_decl(dag, decl_id).is_none() - { - ensure_optional_match_disj(dag, decl_id).expect( - "AtMostOne cardinality without optional_match_disj should materialize a Some/None disj", - ); - } - } -} - -/// For every Branch node, resolve each Path's `BranchPattern` by -/// matching the arm's variant name against the scrutinee's Disj -/// children and verify exhaustiveness + uniqueness. Mutates the -/// Path in place for successful rewrites, marks the Branch's -/// output port Unresolved (via `Dag::mark_unresolved`) for -/// failures. Skips Branches whose input port is not yet Resolved — -/// those will be revisited on the next fixpoint iteration. -/// -/// Aliases / instantiations of sum types normalize through -/// `walk_to_disj_decl` before variant resolution, so `type Hue = -/// Color` and `Color = Red | Green | Blue` both resolve arms -/// against `Color`'s variants. -/// -/// Returns `true` if any state (Path.pattern rewrite or Branch -/// output port transition) changed, so the calling fixpoint loop -/// knows to keep iterating. Pattern-resolution changes and -/// coverage-check failures both propagate downstream through the -/// normal `decide_transform` cascade in subsequent iterations. -fn resolve_branch_patterns(dag: &mut Dag) -> bool { - let mut changed = false; - let optional_scrutinees: HashSet = dag - .nodes() - .iter() - .filter_map(|node| { - let Behavior::Branch(branch) = node else { - return None; - }; - let PortState::Resolved(ty) = dag.port(branch.input).state() else { - return None; - }; - walk_to_optional_cardinality_decl(dag, ty.declaration) - }) - .collect(); - for decl_id in optional_scrutinees { - if existing_optional_match_disj_decl(dag, decl_id).is_none() - && ensure_optional_match_disj(dag, decl_id).is_some() - { - changed = true; - } - } - // Collect the rewrites first (immutable borrow of nodes + ports + - // declarations), then apply them (mutable borrow of nodes). This - // two-phase pattern avoids borrow conflicts while still reading - // declaration bodies. - struct Rewrite { - node_index: usize, - path_index: usize, - result: Result, - output_port: PortId, - } - let mut rewrites: Vec = Vec::new(); - // Coverage check: for each Branch, after resolving all paths, - // verify the resolved set equals the scrutinee's Disj variant set - // exactly (every variant covered by exactly one arm). Missing or - // duplicated arms are fail-closed diagnostics on the Branch's - // output port. - struct CoverageCheck { - output_port: PortId, - span: SourceSpan, - expected: Vec<(String, DeclarationId)>, - arm_outputs: Vec, - // Parallel vec of (resolved_decl_id, arm_name_for_diagnostic) - // collected in path order. Paths whose resolution failed are - // not included — their error already fires, so coverage is - // reported only on the subset that resolved. - resolved_arms: Vec<(DeclarationId, String)>, - } - let mut coverage_checks: Vec = Vec::new(); - for (node_index, node) in dag.nodes().iter().enumerate() { - let Behavior::Branch(b) = node else { - continue; - }; - let scrutinee_ty = match dag.port(b.input).state() { - PortState::Resolved(ty) => *ty, - PortState::Unresolved | PortState::Uninferred => continue, - }; - // Walk the scrutinee through alias / instantiation edges to - // the underlying Disj. `type Hue = Color` and - // `Color = Red | Green | Blue` both resolve arms against - // `Color`'s variants via this walk. - let Some(disj_decl_id) = walk_to_disj_decl(dag, scrutinee_ty.declaration).or_else(|| { - walk_to_optional_cardinality_decl(dag, scrutinee_ty.declaration) - .and_then(|cardinality| existing_optional_match_disj_decl(dag, cardinality)) - }) else { - // Scrutinee doesn't resolve to a Disj — the main infer - // pass caught this as a TypeMismatch already. Skip. - continue; - }; - let disj_variants: Vec<(String, DeclarationId)> = - match &dag.declaration(disj_decl_id).connective { - TypeConnective::Disj { variants } => { - variants.iter().map(|f| (f.label.clone(), f.ty)).collect() - } - _ => unreachable!("walk_to_disj_decl returned a non-Disj declaration"), - }; - let mut resolved_arms: Vec<(DeclarationId, String)> = Vec::new(); - for (path_index, path) in b.paths.iter().enumerate() { - let result = match &path.pattern { - crate::dag::BranchPattern::ResolvedVariant(id) => { - // Already resolved (e.g., if/else paths on a - // second infer pass). Record for coverage check - // and skip the rewrite. - let arm_name = disj_variants - .iter() - .find(|(_, variant_id)| variant_id == id) - .map(|(label, _)| label.clone()) - .unwrap_or_else(|| format!("declaration#{}", id.raw())); - resolved_arms.push((*id, arm_name)); - continue; - } - crate::dag::BranchPattern::UnresolvedVariant { name, span } => { - match disj_variants.iter().find(|(label, _)| label == name) { - Some((_, ty)) => { - resolved_arms.push((*ty, name.clone())); - Ok(*ty) - } - None if bare_pattern_label_resolves_to_symbol_data(dag, name) => { - Err(Diagnostic::ResolveError { - name: format!( - "bare Symbol constant `{name}` cannot be used as a match pattern; use explicit equality dispatch before this match" - ), - span: span.clone(), - correction: Correction::deferred_for_diagnostic_class( - "InferenceDiagnostic", - ), - }) - } - None => Err(Diagnostic::ResolveError { - name: format!( - "variant `{name}` is not a constructor of this match's scrutinee type" - ), - span: span.clone(), - correction: Correction::deferred_for_diagnostic_class("InferenceDiagnostic"), - }), - } - } - }; - rewrites.push(Rewrite { - node_index, - path_index, - result, - output_port: b.output, - }); - } - coverage_checks.push(CoverageCheck { - output_port: b.output, - span: b.span.clone(), - expected: disj_variants, - arm_outputs: b.paths.iter().map(|path| path.output).collect(), - resolved_arms, - }); - } - for rewrite in rewrites { - match rewrite.result { - Ok(variant_id) => { - if let Behavior::Branch(b) = &mut dag.nodes_mut()[rewrite.node_index] { - b.paths[rewrite.path_index].pattern = - crate::dag::BranchPattern::ResolvedVariant(variant_id); - changed = true; - } - } - Err(diag) => { - if !matches!(dag.port(rewrite.output_port).state(), PortState::Unresolved) { - dag.mark_unresolved(rewrite.output_port, diag); - changed = true; - } - } - } - } - // Coverage pass: for each Branch whose paths resolved (fully or - // partially), verify exhaustiveness (every variant covered) and - // uniqueness (no variant duplicated). Skip if the Branch's output - // already has a diagnostic from a pattern resolution failure — - // coverage is meaningless on a partially-resolved arm set. - for check in coverage_checks { - if matches!(dag.port(check.output_port).state(), PortState::Unresolved) { - continue; - } - // Uniqueness: each resolved DeclarationId appears at most once. - let mut seen: HashSet = HashSet::new(); - let mut duplicate: Option = None; - for (id, name) in &check.resolved_arms { - if !seen.insert(*id) { - duplicate = Some(name.clone()); - break; - } - } - if let Some(name) = duplicate { - dag.mark_unresolved( - check.output_port, - Diagnostic::ResolveError { - name: format!( - "duplicate match arm for variant `{name}` — each variant of a sum type must match exactly once" - ), - span: check.span.clone(), - correction: Correction::deferred_for_diagnostic_class("InferenceDiagnostic"), - }, - ); - changed = true; - continue; - } - // Exhaustiveness: every expected variant must be in the - // resolved set. Surface the first missing variant's name as - // the diagnostic label. - let missing: Vec<&str> = check - .expected - .iter() - .filter(|(_, id)| !seen.contains(id)) - .map(|(label, _)| label.as_str()) - .collect(); - if !missing.is_empty() { - let missing_list = missing.join(", "); - let arm_prefix = if check.resolved_arms.is_empty() { - "" - } else { - ", " - }; - let body = branch_output_example_source(dag, check.output_port, &check.arm_outputs); - let insert_at = check.span.byte_end.saturating_sub(1); - let correction_span = SourceSpan::new(check.span.file.clone(), insert_at, insert_at); - let arms = missing - .iter() - .map(|variant| format!("{variant} => {body}")) - .collect::>() - .join(", "); - dag.mark_unresolved( - check.output_port, - Diagnostic::ResolveError { - name: format!( - "non-exhaustive match: missing arm(s) for variant(s) `{missing_list}` — every constructor of the scrutinee's sum type must be covered" - ), - span: check.span, - correction: Correction::live( - format!("add missing arm(s) for `{missing_list}`"), - correction_span, - format!("{arm_prefix}{arms}"), - ), - }, - ); - changed = true; - } - } - changed -} - -fn bare_pattern_label_resolves_to_symbol_data(dag: &Dag, name: &str) -> bool { - let Some(symbol_decl) = dag.declaration_by_name("Symbol") else { - return false; - }; - dag.declaration_by_name(name) - .is_some_and(|decl| decl.inhabits == Some(symbol_decl.id)) -} - -fn branch_output_example_source(dag: &Dag, output_port: PortId, arm_outputs: &[PortId]) -> String { - std::iter::once(output_port) - .chain(arm_outputs.iter().copied()) - .find_map(|port| match dag.port(port).state() { - PortState::Resolved(output_ty) => example_source_for_decl(dag, output_ty.declaration), - PortState::Uninferred | PortState::Unresolved => None, - }) - .unwrap_or_else(|| "()".to_string()) -} - -fn branch_payload_binding_span(path: &crate::dag::Path, branch_span: &SourceSpan) -> SourceSpan { - let extent = generated_payload_binding_span(path, branch_span); - let file = match &path.pattern { - crate::dag::BranchPattern::UnresolvedVariant { span, .. } => span.file.clone(), - crate::dag::BranchPattern::ResolvedVariant(_) => branch_span.file.clone(), - }; - SourceSpan::new(file, extent.byte_start, extent.byte_end) -} - -fn resolve_branch_payload_bindings(dag: &mut Dag) -> bool { - struct BindingRewrite { - port: PortId, - span: SourceSpan, - result: Result, - } - - let mut rewrites: Vec = Vec::new(); - - for node in dag.nodes() { - let Behavior::Branch(b) = node else { - continue; - }; - - match dag.port(b.input).state() { - PortState::Uninferred => continue, - PortState::Unresolved => { - for path in &b.paths { - let Some(binding) = &path.binding else { - continue; - }; - rewrites.push(BindingRewrite { - port: binding.payload_port, - span: branch_payload_binding_span(path, &b.span), - result: Err(Diagnostic::ResolveError { - name: "(upstream failure in match payload binding)".to_string(), - span: branch_payload_binding_span(path, &b.span), - correction: Correction::deferred_for_diagnostic_class( - "InferenceDiagnostic", - ), - }), - }); - } - } - PortState::Resolved(scrutinee_ty) => { - let mut subst = SubstStack::new(); - let disj_decl_id = - walk_to_disj_decl_with_subst(dag, scrutinee_ty.declaration, &mut subst); - if disj_decl_id.is_none() - && is_retryable_generic_decl(dag, scrutinee_ty.declaration) - { - continue; - } - let variants = disj_decl_id.map(|id| match &dag.declaration(id).connective { - TypeConnective::Disj { variants } => variants - .iter() - .map(|field| (field.label.clone(), field.ty)) - .collect::>(), - _ => { - unreachable!("walk_to_disj_decl_with_subst returned a non-Disj declaration") - } - }); - - for path in &b.paths { - let Some(binding) = &path.binding else { - continue; - }; - let span = branch_payload_binding_span(path, &b.span); - let result = match &variants { - None => Err(Diagnostic::ResolveError { - name: format!( - "cannot bind payload `{}` because the match scrutinee does not walk to a Disj type", - binding.binding_name - ), - span: span.clone(), - correction: Correction::deferred_for_diagnostic_class("InferenceDiagnostic"), - }), - Some(variants) => { - let variant = match &path.pattern { - crate::dag::BranchPattern::ResolvedVariant(id) => { - variants.iter().find(|(_, ty)| *ty == *id) - } - crate::dag::BranchPattern::UnresolvedVariant { name, .. } => { - variants.iter().find(|(label, _)| label == name) - } - }; - match variant { - Some((variant_name, variant_id)) => resolve_payload_binding_type( - dag, - *variant_id, - &subst, - variant_name, - &binding.binding_name, - &span, - ), - None => { - let arm_name = match &path.pattern { - crate::dag::BranchPattern::ResolvedVariant(id) => variants - .iter() - .find(|(_, ty)| *ty == *id) - .map(|(label, _)| label.clone()) - .unwrap_or_else(|| format!("declaration#{}", id.raw())), - crate::dag::BranchPattern::UnresolvedVariant { name, .. } => { - name.clone() - } - }; - Err(Diagnostic::ResolveError { - name: format!( - "variant `{arm_name}` is not a constructor of this match's scrutinee type" - ), - span: span.clone(), - correction: Correction::deferred_for_diagnostic_class("InferenceDiagnostic"), - }) - } - } - } - }; - rewrites.push(BindingRewrite { - port: binding.payload_port, - span, - result, - }); - } - } - } - } - - let mut changed = false; - for rewrite in rewrites { - match rewrite.result { - Ok(resolution) => { - let ty = match resolution { - PayloadBindingResolution::Direct(ty) => ty, - PayloadBindingResolution::SpecializedRecord { - variant_decl_id, - subst, - } => materialize_specialized_payload_record(dag, variant_decl_id, &subst), - }; - match dag.port(rewrite.port).state().clone() { - PortState::Unresolved => {} - PortState::Uninferred => { - dag.set_port_type(rewrite.port, ty); - changed = true; - } - PortState::Resolved(existing) - if type_shapes_equivalent(dag, &existing, &ty) => {} - PortState::Resolved(existing) => { - dag.mark_unresolved( - rewrite.port, - Diagnostic::TypeMismatch { - expected: existing, - actual: ty, - span: rewrite.span, - correction: Correction::deferred_for_diagnostic_class( - "InferenceDiagnostic", - ), - }, - ); - changed = true; - } - } - } - Err(diag) => { - if !matches!(dag.port(rewrite.port).state(), PortState::Unresolved) { - dag.mark_unresolved(rewrite.port, diag); - changed = true; - } - } - } - } - - changed -} - -/// T-Modeling int-lit / PR #806 consumer: allow `i64` default-typed int -/// literal output ports to refine to a range-backed fixed-width `IntegerPrimitive` -/// when the magnitude fits, without treating it as a conflicting resolution. -#[derive(Debug)] -enum IntLiteralNarrowMerge { - /// Narrow to the fixed-width type — caller should `set_port_type` to `to`. - Merge, - /// Not a default-`Int` literal → fixed-width call-site narrow case. - NotApplicable, - /// Preserve typed diagnostics (e.g. [`Diagnostic::MagnitudeOutOfRange`]) like the - /// annotated-`let` value-node path, not a silent fallback to `TypeMismatch`. - Reject(Box), -} - -impl IntLiteralNarrowMerge { - fn reject(diagnostic: Diagnostic) -> Self { - Self::Reject(Box::new(diagnostic)) - } -} - -fn int_literal_magnitude_narrow_merge( - dag: &Dag, - port: PortId, - from: &TypeShape, - to: &TypeShape, -) -> IntLiteralNarrowMerge { - let Some(lit) = literal_bigint_at(dag, port) else { - return IntLiteralNarrowMerge::NotApplicable; - }; - let Some(int_shape) = dag.int_shape() else { - return IntLiteralNarrowMerge::NotApplicable; - }; - if !type_shapes_equivalent(dag, from, &int_shape) { - return IntLiteralNarrowMerge::NotApplicable; - } - let span = node_span_for_port(dag, port).unwrap_or_else(synthetic_span); - match int_literal_fits_expected_type(dag, &lit, to.declaration) { - Ok(Some(true)) => IntLiteralNarrowMerge::Merge, - Ok(Some(false)) => match integer_range_for_decl(dag, to.declaration) { - IntegerRangeLookup::Found(bound) => IntLiteralNarrowMerge::reject( - magnitude_out_of_range_for_interval(&lit, *to, bound, span), - ), - IntegerRangeLookup::Invalid(diag) => IntLiteralNarrowMerge::reject(diag), - IntegerRangeLookup::Missing => { - IntLiteralNarrowMerge::reject(Diagnostic::ResolveError { - name: "(internal: integer literal out of range but no range fact)".to_string(), - span, - correction: Correction::deferred_for_diagnostic_class("InferenceDiagnostic"), - }) - } - }, - Err(diag) => IntLiteralNarrowMerge::reject(diag), - Ok(None) => { - if int_literal_allowed_integral_seed_for_real_decl(dag, &lit, to.declaration) { - IntLiteralNarrowMerge::Merge - } else { - IntLiteralNarrowMerge::NotApplicable - } - } - } -} - -enum Decision { - Set(PortId, TypeShape), - Fail(PortId, Box), - Retry, -} - -impl Decision { - fn fail(port: PortId, diagnostic: Diagnostic) -> Self { - Self::Fail(port, Box::new(diagnostic)) - } -} - -fn decide(dag: &mut Dag, index: usize) -> Decision { - // Clone before matching so `decide_transform` can take `&mut Dag` without - // holding an immutable borrow of `dag.nodes()` across the call. - let behavior = dag.nodes()[index].clone(); - match &behavior { - Behavior::Value(v) => { - // `let x: UInt8 = 5` seeds the value port to `UInt8` after lowering; - // the Int literal Value node would otherwise re-stamp `Int64` here and - // clobber host narrowing. If the port is already a non-`Int` type, only - // defer (Retry) when range facts prove the literal fits that type. - // Otherwise fail closed with `MagnitudeOutOfRange` (same contract as - // call-site narrowing) or fall through so normal mismatch handling - // applies when there is no range-backed check. - if let LiteralBits::Int(lit_str) = &v.data { - let Some(literal) = BigInt::from_str(lit_str.as_str()).ok() else { - return Decision::fail( - v.output, - Diagnostic::ResolveError { - name: "internal: malformed decimal integer literal".to_string(), - span: v.span.clone(), - correction: Correction::deferred_for_diagnostic_class( - "InferenceDiagnostic", - ), - }, - ); - }; - if let PortState::Resolved(existing) = dag.port(v.output).state() { - if let Some(int_sh) = dag.int_shape() { - if !type_shapes_equivalent(dag, existing, &int_sh) { - match int_literal_fits_expected_type( - dag, - &literal, - existing.declaration, - ) { - Ok(Some(true)) => return Decision::Retry, - Ok(Some(false)) => { - match integer_range_for_decl(dag, existing.declaration) { - IntegerRangeLookup::Found(range) => { - return Decision::fail( - v.output, - magnitude_out_of_range_for_interval( - &literal, - *existing, - range, - v.span.clone(), - ), - ); - } - IntegerRangeLookup::Invalid(diag) => { - return Decision::fail(v.output, diag); - } - IntegerRangeLookup::Missing => { - return Decision::fail( - v.output, - Diagnostic::ResolveError { - name: "(internal: integer literal out of range but no range fact)" - .to_string(), - span: v.span.clone(), - correction: Correction::deferred_for_diagnostic_class("InferenceDiagnostic"), - }, - ); - } - } - } - Err(diag) => return Decision::fail(v.output, diag), - Ok(None) => {} - } - // No integer `range(min,max)` facts: allow lossless integral literals to - // seed fixed-width `Real` / `Float` while float lexemes are absent. - if int_literal_allowed_integral_seed_for_real_decl( - dag, - &literal, - existing.declaration, - ) { - return Decision::Set(v.output, *existing); - } - } - } - } - } - let shape_and_name = match &v.data { - // Unconstrained integer literals keep the existing explicit - // default to Int64. Expected-type narrowing happens at - // reconciliation sites below, against range facts. - LiteralBits::Int(_) => (dag.int_shape(), "Int"), - LiteralBits::Bool(_) => (dag.bool_shape(), "Bool"), - LiteralBits::String(_) => (dag.string_shape(), "String"), - LiteralBits::Symbol(_) => ( - dag.declaration_by_name("Symbol") - .map(|decl| TypeShape::new(decl.id)), - "Symbol", - ), - }; - let Some(ty) = shape_and_name.0 else { - return Decision::fail( - v.output, - Diagnostic::ResolveError { - name: format!( - "primitive `{}` missing from declaration table — bootstrap failed", - shape_and_name.1 - ), - span: v.span.clone(), - correction: Correction::deferred_for_diagnostic_class( - "InferenceDiagnostic", - ), - }, - ); - }; - Decision::Set(v.output, ty) - } - Behavior::Transform(t) => decide_transform(dag, t), - Behavior::Branch(b) => { - // Branch dispatches on a sum type. Its input must - // walk through alias/instantiation edges to a - // declaration whose connective is - // `TypeConnective::Disj { .. }`. Bool and Classical are - // Disj declarations (True | False), so `if` lowers here - // naturally. User-defined sums like - // `type Sign = Plus | Minus` also pass. Aliased sums - // (`type Hue = Color` where Color is a sum) pass - // via `walk_to_disj_decl`. String, Int, Float, etc. - // fail this check — the previous M0 "must be Bool" - // rule was the degenerate case of this broader rule. - match dag.port(b.input).state() { - PortState::Uninferred => return Decision::Retry, - PortState::Unresolved => { - return Decision::fail( - b.output, - Diagnostic::ResolveError { - name: "(upstream failure in branch condition)".to_string(), - span: b.span.clone(), - correction: Correction::deferred_for_diagnostic_class( - "InferenceDiagnostic", - ), - }, - ); - } - PortState::Resolved(ty) => { - if walk_to_disj_decl(dag, ty.declaration).is_none() - && walk_to_optional_cardinality_decl(dag, ty.declaration).is_none() - { - if is_retryable_generic_decl(dag, ty.declaration) { - return Decision::Retry; - } - let Some(bool_ty) = dag.bool_shape() else { - return Decision::fail( - b.output, - Diagnostic::ResolveError { - name: "primitive `Bool` missing from declaration table — bootstrap failed" - .to_string(), - span: b.span.clone(), - correction: Correction::deferred_for_diagnostic_class("InferenceDiagnostic"), - }, - ); - }; - return Decision::fail( - b.output, - Diagnostic::TypeMismatch { - expected: bool_ty, - actual: *ty, - span: b.span.clone(), - correction: Correction::deferred_for_diagnostic_class( - "InferenceDiagnostic", - ), - }, - ); - } - } - } - - let mut iter = b.paths.iter(); - let Some(first_path) = iter.next() else { - return Decision::Retry; - }; - let first_type = match dag.port(first_path.output).state() { - PortState::Uninferred => return Decision::Retry, - PortState::Unresolved => { - return Decision::fail( - b.output, - Diagnostic::ResolveError { - name: "(upstream failure in branch path)".to_string(), - span: b.span.clone(), - correction: Correction::deferred_for_diagnostic_class( - "InferenceDiagnostic", - ), - }, - ); - } - PortState::Resolved(t) => *t, - }; - for path in iter { - match dag.port(path.output).state() { - PortState::Uninferred => return Decision::Retry, - PortState::Unresolved => { - return Decision::fail( - b.output, - Diagnostic::ResolveError { - name: "(upstream failure in branch path)".to_string(), - span: b.span.clone(), - correction: Correction::deferred_for_diagnostic_class( - "InferenceDiagnostic", - ), - }, - ); - } - PortState::Resolved(other) - if type_shapes_equivalent(dag, other, &first_type) => {} - PortState::Resolved(other) => { - return Decision::fail( - b.output, - Diagnostic::TypeMismatch { - expected: first_type, - actual: *other, - span: b.span.clone(), - correction: Correction::deferred_for_diagnostic_class( - "InferenceDiagnostic", - ), - }, - ); - } - } - } - Decision::Set(b.output, first_type) - } - Behavior::Loop(l) => { - if l.body == l.id { - return Decision::Retry; - } - let body_node = dag.node(l.body); - let body_output = behavior_output_port(body_node); - match dag.port(body_output).state() { - PortState::Uninferred => Decision::Retry, - PortState::Unresolved => Decision::fail( - l.output, - Diagnostic::ResolveError { - name: "function body is unresolved".to_string(), - span: l.span.clone(), - correction: Correction::deferred_for_diagnostic_class( - "InferenceDiagnostic", - ), - }, - ), - PortState::Resolved(body_ty) => Decision::Set(l.output, *body_ty), - } - } - Behavior::Bind(_) => Decision::Retry, - } -} - -fn decide_transform(dag: &mut Dag, t: &TransformNode) -> Decision { - // Structural dispatch on `TransformTarget`. `Operator` carries the - // resolved `OperatorKind` directly and produces its signature from - // the LHS operand type (arithmetic returns operand type, comparison - // returns Bool). `Callable` points at a DeclarationId and walks - // `resolve_arrow` through any Instantiation / ResolvedIdentifier - // chain to recover the concrete Arrow signature. - let signature = match &t.target { - TransformTarget::UnresolvedFieldProject { field_label } => { - return decide_field_project(dag, t, field_label); - } - TransformTarget::ResolvedFieldProject { field_label } => { - return decide_field_project(dag, t, field_label); - } - TransformTarget::Operator(op_kind) => { - let lhs_type = match t.inputs.first() { - None => { - return Decision::fail( - t.output, - Diagnostic::ArityMismatch { - function: crate::operators::symbol(*op_kind), - expected: 2, - actual: 0, - span: t.span.clone(), - correction: Correction::deferred_for_diagnostic_class( - "InferenceDiagnostic", - ), - }, - ); - } - Some(port) => match dag.port(*port).state() { - PortState::Uninferred => return Decision::Retry, - PortState::Unresolved => { - return Decision::fail( - t.output, - Diagnostic::ResolveError { - name: format!( - "(upstream failure in {})", - crate::operators::symbol(*op_kind) - ), - span: t.span.clone(), - correction: Correction::deferred_for_diagnostic_class( - "InferenceDiagnostic", - ), - }, - ); - } - PortState::Resolved(ty) => *ty, - }, - }; - if is_retryable_generic_decl(dag, lhs_type.declaration) { - return Decision::Retry; - } - match resolve_operator_arrow(dag, *op_kind, &lhs_type) { - Some(sig) => sig, - None => { - if is_retryable_generic_decl(dag, lhs_type.declaration) { - return Decision::Retry; - } - return Decision::fail( - t.output, - Diagnostic::ResolveError { - name: format!( - "cannot dispatch operator `{}` on {lhs_type:?}", - crate::operators::symbol(*op_kind) - ), - span: t.span.clone(), - correction: Correction::deferred_for_diagnostic_class( - "InferenceDiagnostic", - ), - }, - ); - } - } - } - TransformTarget::Callable(target_id) => { - match resolve_callable_target(dag, *target_id, &t.inputs, &t.span) { - CallableTargetResolution::Retry => return Decision::Retry, - CallableTargetResolution::Fail(diag) => return Decision::fail(t.output, diag), - CallableTargetResolution::Resolved { signature, .. } => signature, - } - } - }; - - // Arrow-body state check. The five variants partition into the - // "check something" cases (UserDefined → Bind.value port state, - // ExternalRealization → realization shape) and the "no body to - // walk" cases (Pending/NoBody/Unparsed). Each failure surfaces as - // a fail-closed diagnostic on the call site's output port. - match &signature.body { - ArrowBody::UserDefined(bind_id) => { - // User function: the call site's signature is only trustworthy - // once the function's Bind.value port has reached Resolved. - // Uninferred → Retry; Unresolved → fail the call site. - match dag.port((*bind_id).bind(dag).value).state() { - PortState::Uninferred => return Decision::Retry, - PortState::Unresolved => { - let name = transform_target_display_name(dag, &t.target); - return Decision::fail( - t.output, - Diagnostic::ResolveError { - name: format!("function `{name}` has an invalid body"), - span: t.span.clone(), - correction: Correction::deferred_for_diagnostic_class( - "InferenceDiagnostic", - ), - }, - ); - } - PortState::Resolved(_) => {} - } - } - ArrowBody::ExternalRealization(realization_id) => { - // Primitive realization: the target declaration must be a - // Conj whose `meta_tag` edge points at the cached - // `Realization` meta-type (populated at bootstrap). The - // typed-edge check was asserted at bootstrap construction - // (`assert_realization_shape`); re-validating here catches - // drift from any future mutation path that bypasses the - // construction-time invariant. - if !is_realization_shape(dag, *realization_id) { - let name = transform_target_display_name(dag, &t.target); - return Decision::fail( - t.output, - Diagnostic::ResolveError { - name: format!( - "arrow `{name}` carries an ExternalRealization body whose target is not a realization declaration" - ), - span: t.span.clone(), - correction: Correction::deferred_for_diagnostic_class("InferenceDiagnostic"), - }, - ); - } - } - ArrowBody::Pending | ArrowBody::NoBody => { - // Both shapes mean "no executable body to walk." - // `Pending` is the remaining transient scaffold from - // `seed_function_signature` during lowering; `NoBody` - // is the terminal "no body by construction" form used - // by arrow types and other non-executable carriers. - // `decide_transform` treats them identically: signature - // inhabitance accepts; body walking is skipped. The - // variant distinction exists so - // `lens_structural_resolution` can treat any surviving - // `Arrow(Pending)` in the final Dag as an R13-class body- - // patching regression. - } - ArrowBody::Unparsed(_) => { - // Surface-grammar scaffold: signature type-checks, - // body is not yet parseable under the M1(2.7) grammar. - // Callers can dispatch against the signature; the body - // source span is preserved for M2+ parser extensions. - // Dissolves when block bodies become fully parseable. - } - } - - if signature.inputs.len() != t.inputs.len() { - return Decision::fail( - t.output, - Diagnostic::ArityMismatch { - function: transform_target_display_name(dag, &t.target), - expected: signature.inputs.len(), - actual: t.inputs.len(), - span: t.span.clone(), - correction: Correction::deferred_for_diagnostic_class("InferenceDiagnostic"), - }, - ); - } - for (input_port, expected_ty) in t.inputs.iter().zip(signature.inputs.iter()) { - match dag.port(*input_port).state() { - PortState::Uninferred => return Decision::Retry, - PortState::Unresolved => { - return Decision::fail( - t.output, - Diagnostic::ResolveError { - name: format!( - "(upstream failure in {})", - transform_target_display_name(dag, &t.target) - ), - span: t.span.clone(), - correction: Correction::deferred_for_diagnostic_class( - "InferenceDiagnostic", - ), - }, - ); - } - PortState::Resolved(actual) => { - let types_equivalent = type_shapes_equivalent(dag, actual, expected_ty); - if !types_equivalent - && (is_retryable_generic_decl(dag, actual.declaration) - || is_retryable_generic_decl(dag, expected_ty.declaration)) - { - return Decision::Retry; - } - if let Some(diag) = phantom_unit_mismatch( - dag, - transform_target_display_name(dag, &t.target), - expected_ty, - actual, - &t.span, - ) { - return Decision::fail(t.output, diag); - } - if !types_equivalent { - if let Some(literal) = literal_bigint_at(dag, *input_port) { - match int_literal_fits_expected_type(dag, &literal, expected_ty.declaration) - { - Ok(Some(true)) => { - if let Some(diag) = check_refinement_discharge( - dag, - actual, - expected_ty, - &t.target, - &t.span, - ) { - return Decision::fail(t.output, diag); - } - // Default literal shape is `Int`; align the argument port with - // the callee's narrow range-backed type (same as `let` / `data` - // pre-seed + `Decision::Set` reunion for annotated literals). - return Decision::Set(*input_port, *expected_ty); - } - Ok(None) - if int_literal_allowed_integral_seed_for_real_decl( - dag, - &literal, - expected_ty.declaration, - ) => - { - if let Some(diag) = check_refinement_discharge( - dag, - actual, - expected_ty, - &t.target, - &t.span, - ) { - return Decision::fail(t.output, diag); - } - return Decision::Set(*input_port, *expected_ty); - } - Ok(Some(false)) | Ok(None) => {} - Err(diag) => return Decision::fail(t.output, diag), - } - match integer_range_for_decl(dag, expected_ty.declaration) { - IntegerRangeLookup::Found(range) => { - return Decision::fail( - *input_port, - magnitude_out_of_range_for_interval( - &literal, - *expected_ty, - range, - t.span.clone(), - ), - ); - } - IntegerRangeLookup::Invalid(diag) => { - return Decision::fail(t.output, diag); - } - IntegerRangeLookup::Missing => {} - } - } - return Decision::fail( - t.output, - Diagnostic::TypeMismatch { - expected: *expected_ty, - actual: *actual, - span: t.span.clone(), - correction: Correction::deferred_for_diagnostic_class( - "InferenceDiagnostic", - ), - }, - ); - } - // DB-11 (3a.3) refinement discharge. Structural type - // equivalence just passed; now check that any refinement - // declared on the callee's parameter type is also carried - // by the argument's port type, with structurally-equal - // predicate expression DAGs. No SMT, no implication — if - // the predicates don't walk equal, the caller must - // introduce a narrowing Branch that does satisfy the - // expected refinement. - if let Some(diag) = - check_refinement_discharge(dag, actual, expected_ty, &t.target, &t.span) - { - if let Some(literal) = literal_bigint_at(dag, *input_port) { - if int_literal_bigint_statically_discharges_refinement_chain( - dag, - &literal, - expected_ty.declaration, - ) { - return Decision::Set(*input_port, *expected_ty); - } - } - return Decision::fail(t.output, diag); - } - } - } - } - Decision::Set(t.output, signature.output) -} - -fn phantom_unit_mismatch( - dag: &Dag, - context: String, - expected_ty: &TypeShape, - actual_ty: &TypeShape, - span: &SourceSpan, -) -> Option { - let expected_inst = instantiation_parts(dag, expected_ty.declaration)?; - let actual_inst = instantiation_parts(dag, actual_ty.declaration)?; - let expected_template = dag.declaration(expected_inst.template); - for phantom in &expected_template.phantom_params { - if let Err(diag) = - require_abelian_group_phantom_algebra(dag, phantom.algebra, phantom.parameter, span) - { - return Some(diag); - } - if !expected_template.type_params.contains(&phantom.parameter) { - return Some(malformed_phantom_parameter_diagnostic( - dag, - expected_inst.template, - phantom.parameter, - span, - )); - } - let Some(actual_phantom) = - mapped_phantom_parameter(dag, expected_inst.template, phantom, actual_inst.template) - else { - continue; - }; - if let Err(diag) = require_abelian_group_phantom_algebra( - dag, - actual_phantom.algebra, - actual_phantom.parameter, - span, - ) { - return Some(diag); - } - if !phantom_algebras_equivalent(dag, phantom.algebra, actual_phantom.algebra) { - return Some(unsupported_phantom_algebra_diagnostic( - dag, - actual_phantom.algebra, - actual_phantom.parameter, - span, - )); - } - let Some(expected_arg) = expected_inst - .arguments - .iter() - .find(|arg| arg.parameter == phantom.parameter) - else { - return Some(missing_phantom_argument_diagnostic( - dag, - expected_inst.template, - phantom.parameter, - "expected", - span, - )); - }; - let Some(actual_arg) = actual_inst - .arguments - .iter() - .find(|arg| arg.parameter == actual_phantom.parameter) - else { - return Some(missing_phantom_argument_diagnostic( - dag, - actual_inst.template, - actual_phantom.parameter, - "actual", - span, - )); - }; - if expected_arg.value != actual_arg.value { - return Some(Diagnostic::UnitMismatch { - operator: context, - parameter: phantom_parameter_display_name(dag, phantom.parameter), - expected: TypeShape::new(expected_arg.value), - actual: TypeShape::new(actual_arg.value), - span: span.clone(), - correction: Correction::deferred_for_diagnostic_class("InferenceDiagnostic"), - }); - } - } - None -} - -fn malformed_phantom_parameter_diagnostic( - dag: &Dag, - template: DeclarationId, - parameter: DeclarationId, - span: &SourceSpan, -) -> Diagnostic { - Diagnostic::ResolveError { - name: format!( - "malformed phantom parameter {} on {}: parameter is not in type_params", - phantom_parameter_display_name(dag, parameter), - declaration_display_name(dag, template), - ), - span: span.clone(), - correction: Correction::deferred_for_diagnostic_class("InferenceDiagnostic"), - } -} - -fn missing_phantom_argument_diagnostic( - dag: &Dag, - template: DeclarationId, - parameter: DeclarationId, - side: &str, - span: &SourceSpan, -) -> Diagnostic { - Diagnostic::ResolveError { - name: format!( - "malformed phantom instantiation for {}: missing {side} argument for phantom parameter {}", - declaration_display_name(dag, template), - phantom_parameter_display_name(dag, parameter), - ), - span: span.clone(), - correction: Correction::deferred_for_diagnostic_class("InferenceDiagnostic"), - } -} - -fn unsupported_phantom_algebra_diagnostic( - dag: &Dag, - algebra: DeclarationId, - parameter: DeclarationId, - span: &SourceSpan, -) -> Diagnostic { - Diagnostic::ResolveError { - name: format!( - "unsupported phantom algebra {} for phantom parameter {}", - declaration_display_name(dag, algebra), - phantom_parameter_display_name(dag, parameter), - ), - span: span.clone(), - correction: Correction::deferred_for_diagnostic_class("InferenceDiagnostic"), - } -} - -fn require_abelian_group_phantom_algebra( - dag: &Dag, - algebra: DeclarationId, - parameter: DeclarationId, - span: &SourceSpan, -) -> Result<(), Diagnostic> { - let Some(canonical_abelian_group) = dag.abelian_group_decl() else { - return Err(unsupported_phantom_algebra_diagnostic( - dag, algebra, parameter, span, - )); - }; - let mut current = algebra; - for _ in 0..WALK_DEPTH_LIMIT { - let decl = dag.declaration(current); - if current == canonical_abelian_group { - return Ok(()); - } - match &decl.connective { - TypeConnective::Instantiation { template, .. } => { - current = *template; - } - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - current = *next; - } - _ => { - return Err(unsupported_phantom_algebra_diagnostic( - dag, algebra, parameter, span, - )); - } - } - } - Err(unsupported_phantom_algebra_diagnostic( - dag, algebra, parameter, span, - )) -} - -fn phantom_algebras_equivalent( - dag: &Dag, - lhs_algebra: DeclarationId, - rhs_algebra: DeclarationId, -) -> bool { - lhs_algebra == rhs_algebra || declaration_shapes_equivalent(dag, lhs_algebra, rhs_algebra, 0) -} - -fn mapped_phantom_parameter( - dag: &Dag, - source_template: DeclarationId, - source_phantom: &PhantomParameter, - target_template: DeclarationId, -) -> Option { - let source_decl = dag.declaration(source_template); - let target_decl = dag.declaration(target_template); - let source_index = source_decl - .type_params - .iter() - .position(|parameter| *parameter == source_phantom.parameter)?; - let target_parameter = target_decl.type_params.get(source_index).copied()?; - target_decl - .phantom_params - .iter() - .find(|target_phantom| target_phantom.parameter == target_parameter) - .cloned() -} - -struct InstantiationParts<'a> { - template: DeclarationId, - arguments: &'a [crate::dag::TemplateArgument], -} - -fn instantiation_parts(dag: &Dag, declaration: DeclarationId) -> Option> { - match &dag.declaration(declaration).connective { - TypeConnective::Instantiation { - template, - arguments, - } => Some(InstantiationParts { - template: *template, - arguments, - }), - _ => None, - } -} - -fn phantom_parameter_display_name(dag: &Dag, parameter: DeclarationId) -> String { - match &dag.declaration(parameter).connective { - TypeConnective::Atom(AtomPayload::TypeParam(name)) => name.clone(), - _ => declaration_display_name(dag, parameter), - } -} - -/// DB-11 (3a.3) call-site refinement discharge. Returns `None` when -/// the expected parameter has no refinement (unconditionally OK), or -/// when the actual argument's top-level refinement discharges the -/// expected predicate. Returns a `Diagnostic` otherwise. Pure -/// structural walk — no SMT, no entailment beyond conjunction-member -/// matching against the canonical composite form. -/// -/// Composite-canonical invariant (post-narrowing refactor): every -/// refinement in the DAG is a single predicate Declaration. Narrowing -/// produces a composite `outer_body && new_body` rather than an alias -/// chain of unary refinements, so discharge only has to look at the -/// top-level refinement on `actual.declaration` — no chain walk. The -/// composite-vs-single asymmetry is handled by -/// `predicate_discharges`, which accepts either a full structural -/// match against the expected predicate or a match against a -/// conjunct of `actual`'s composite body. -fn check_refinement_discharge( - dag: &Dag, - actual: &TypeShape, - expected: &TypeShape, - target: &TransformTarget, - span: &SourceSpan, -) -> Option { - let expected_pred = dag.declaration(expected.declaration).refinement?; - let actual_pred = dag.declaration(actual.declaration).refinement; - match actual_pred { - Some(actual_pred) if predicate_discharges(dag, actual_pred, expected_pred, 0) => None, - _ => { - let callee = transform_target_display_name(dag, target); - let name = if actual_pred.is_some() { - format!( - "argument to `{callee}` does not satisfy the expected \ - `where` refinement (caller's predicate does not walk \ - structurally equal to the callee's, and no conjunct \ - of the caller's composite matches)" - ) - } else { - format!( - "argument to `{callee}` does not satisfy the expected \ - `where` refinement — no narrowing branch in scope" - ) - }; - Some(Diagnostic::ResolveError { - name, - span: span.clone(), - correction: Correction::deferred_for_diagnostic_class("InferenceDiagnostic"), - }) - } - } -} - -/// Structural discharge check between an actual and expected -/// predicate declaration. Succeeds when: -/// -/// - The two predicates are the same declaration id; OR -/// - The actual predicate's body walks structurally equal to the -/// expected predicate's body (param-paired); OR -/// - The actual predicate's body is a `Transform(Logical(And), [a, b])` -/// and either `a` or `b` (as a virtual sub-predicate sharing the -/// actual's `Bind.params[0]`) discharges the expected predicate. -/// -/// The composite conjunct case is the load-bearing piece that lets -/// the post-narrowing composite `outer_body && new_body` match a -/// callee whose refinement is just `outer_body`. Pure structural, -/// depth-bounded. -fn predicate_discharges( - dag: &Dag, - actual_pred_decl: DeclarationId, - expected_pred_decl: DeclarationId, - depth: usize, -) -> bool { - if depth >= WALK_DEPTH_LIMIT { - return false; - } - if actual_pred_decl == expected_pred_decl { - return true; - } - let Some((actual_param, actual_body)) = predicate_info(dag, actual_pred_decl) else { - return false; - }; - let Some((expected_param, expected_body)) = predicate_info(dag, expected_pred_decl) else { - return false; - }; - body_discharges( - dag, - actual_body, - expected_body, - actual_param, - expected_param, - ) -} - -/// Flatten-and-subset discharge check. A predicate body is treated -/// as a CONJUNCTION OF LEAVES — the maximal multiset of non-`And` -/// operand ports reachable by recursively unfolding every -/// `Transform(Logical(And), [lhs, rhs])` root. Actual discharges -/// expected iff every expected leaf is walk-equal (param-paired) to -/// some actual leaf. -/// -/// This makes conjunction associativity / grouping irrelevant to -/// discharge: `a && (b && c)`, `(a && b) && c`, and `a && b && c` -/// all flatten to the same leaf set `{a, b, c}` and therefore -/// discharge each other symmetrically. Without the flattening, -/// `body_discharges` could only recurse into one root conjunct of -/// the actual side at a time, so an asymmetric grouping would fail -/// to discharge a syntax-equivalent callee contract (the -/// substrate-level blocker ChatGPT's R5 review called out on -/// `31a3709d`). -/// -/// Still pure structural — no SMT, no absorption laws, no ordering -/// reasoning. The "canonical form" is the leaf multiset; two bodies -/// representing the same conjunction share one leaf multiset up to -/// reordering, and the subset check tolerates the multiset shape. -fn body_discharges( - dag: &Dag, - actual_body: PortId, - expected_body: PortId, - actual_param: PortId, - expected_param: PortId, -) -> bool { - let mut actual_leaves: Vec = Vec::new(); - collect_conjunct_leaves(dag, actual_body, &mut actual_leaves, 0); - let mut expected_leaves: Vec = Vec::new(); - collect_conjunct_leaves(dag, expected_body, &mut expected_leaves, 0); - expected_leaves.into_iter().all(|expected_leaf| { - actual_leaves.iter().any(|&actual_leaf| { - refinement_ports_equal( - dag, - actual_leaf, - expected_leaf, - actual_param, - expected_param, - 0, - ) - }) - }) -} - -/// Recursively unfold `Transform(Logical(And), [lhs, rhs])` roots -/// and collect the non-`And` leaves. Depth-bounded by -/// `WALK_DEPTH_LIMIT`; on overflow the current port is pushed as a -/// leaf so discharge degrades to the pre-flatten shape rather than -/// silently dropping conjuncts. -fn collect_conjunct_leaves(dag: &Dag, body_port: PortId, out: &mut Vec, depth: usize) { - if depth >= WALK_DEPTH_LIMIT { - out.push(body_port); - return; - } - if let Some(node_id) = dag.port(body_port).produced_by { - if let Behavior::Transform(t) = dag.node(node_id) { - if matches!( - &t.target, - TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)) - ) && t.inputs.len() == 2 - { - collect_conjunct_leaves(dag, t.inputs[0], out, depth + 1); - collect_conjunct_leaves(dag, t.inputs[1], out, depth + 1); - return; - } - } - } - out.push(body_port); -} - -fn predicate_info(dag: &Dag, pred_decl: DeclarationId) -> Option<(PortId, PortId)> { - if let TypeConnective::Arrow { - body: ArrowBody::UserDefined(bind_id), - .. - } = &dag.declaration(pred_decl).connective - { - let bind = (*bind_id).bind(dag); - if let Some(param_port) = bind.params.first() { - return Some((*param_port, bind.value)); - } - } - None -} - -fn refinement_ports_equal( - dag: &Dag, - lhs_port: PortId, - rhs_port: PortId, - lhs_param: PortId, - rhs_param: PortId, - depth: usize, -) -> bool { - if depth >= WALK_DEPTH_LIMIT { - return false; - } - let lhs_is_param = lhs_port == lhs_param; - let rhs_is_param = rhs_port == rhs_param; - if lhs_is_param || rhs_is_param { - return lhs_is_param && rhs_is_param; - } - let Some(lhs_nid) = dag.port(lhs_port).produced_by else { - return lhs_port == rhs_port; - }; - let Some(rhs_nid) = dag.port(rhs_port).produced_by else { - return false; - }; - match (dag.node(lhs_nid), dag.node(rhs_nid)) { - (Behavior::Value(lv), Behavior::Value(rv)) => lv.data == rv.data, - (Behavior::Transform(lt), Behavior::Transform(rt)) => { - refinement_targets_equal(dag, <.target, &rt.target) - && lt.inputs.len() == rt.inputs.len() - && lt.inputs.iter().zip(rt.inputs.iter()).all(|(l, r)| { - refinement_ports_equal(dag, *l, *r, lhs_param, rhs_param, depth + 1) - }) - } - _ => false, - } -} - -fn refinement_targets_equal(dag: &Dag, lhs: &TransformTarget, rhs: &TransformTarget) -> bool { - match (lhs, rhs) { - // DB-11 (3a.3) structural callable identity. Call lowering - // materializes a fresh `Instantiation` declaration per - // call-site when the callee has retained template arguments - // (see `retained_template_arguments_for_target` in lower.rs). - // Two syntactically identical calls to a generic predicate - // (e.g., `is_eq(d, 0)`) from two different refinement - // contexts therefore carry different `Callable(DeclarationId)` - // targets even though their template + argument values match. - // Nominal id equality would reject those as distinct; the - // authoritative identity is template + substituted arguments, - // which `declaration_shapes_equivalent` already walks through - // `Instantiation`/`ResolvedIdentifier` edges. - (TransformTarget::Callable(a), TransformTarget::Callable(b)) => { - declaration_shapes_equivalent(dag, *a, *b, 0) - } - (TransformTarget::Operator(a), TransformTarget::Operator(b)) => a == b, - ( - TransformTarget::UnresolvedFieldProject { - field_label: a_label, - }, - TransformTarget::UnresolvedFieldProject { - field_label: b_label, - }, - ) => a_label == b_label, - ( - TransformTarget::ResolvedFieldProject { - field_label: a_label, - }, - TransformTarget::ResolvedFieldProject { - field_label: b_label, - }, - ) => a_label == b_label, - _ => false, - } -} - -struct ResolvedArrow { - inputs: Vec, - output: TypeShape, - body: ArrowBody, -} - -struct ResolvedArrowDecl { - inputs: Vec, - output: DeclarationId, -} - -#[derive(Clone)] -struct PortTypeContext { - decl: DeclarationId, - subst: SubstStack, -} - -struct CallableSignatureContext { - inputs: Vec, - output: PortTypeContext, -} - -enum CallableTargetResolution { - Retry, - Fail(Diagnostic), - Resolved { - template: DeclarationId, - arguments: Vec, - signature: ResolvedArrow, - }, -} - -enum CallableBindingResolution { - Resolved, - Retry, - Conflict, -} - -/// Lazy substitution stack for `Instantiation` walks. When inference -/// descends into an `Instantiation { template, arguments }`, it pushes -/// `arguments` onto this stack; when a downstream `TypeParam` reference -/// is encountered, the stack is consulted top-down to find the bound -/// `DeclarationId`. Pop on Instantiation exit keeps the stack balanced. -/// See M1_DESIGN.md §4 Q4 / §5 for the walk semantics. -#[derive(Clone)] -pub(crate) struct SubstStack { - frames: Vec>, -} - -impl SubstStack { - pub(crate) fn new() -> Self { - Self { frames: Vec::new() } - } - - pub(crate) fn push(&mut self, args: Vec) { - self.frames.push(args); - } - - pub(crate) fn pop(&mut self) { - self.frames.pop(); - } - - pub(crate) fn lookup(&self, param_id: DeclarationId) -> Option { - for frame in self.frames.iter().rev() { - for arg in frame { - if arg.parameter == param_id { - if arg.value == param_id { - return None; - } - return Some(arg.value); - } - } - } - None - } -} - -enum PayloadBindingResolution { - Direct(TypeShape), - SpecializedRecord { - variant_decl_id: DeclarationId, - subst: SubstStack, - }, -} - -fn declaration_is_callable(dag: &Dag, current: DeclarationId, depth: usize) -> bool { - if depth >= WALK_DEPTH_LIMIT { - return false; - } - match &dag.declaration(current).connective { - TypeConnective::Arrow { .. } => true, - TypeConnective::Instantiation { template, .. } => { - declaration_is_callable(dag, *template, depth + 1) - } - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - declaration_is_callable(dag, *next, depth + 1) - } - TypeConnective::Atom(AtomPayload::UnresolvedIdentifier(_)) - | TypeConnective::Atom(AtomPayload::TypeParam(_)) - | TypeConnective::Atom(AtomPayload::Literal(_)) - | TypeConnective::Conj { .. } - | TypeConnective::Disj { .. } - | TypeConnective::Cardinality(_) => false, - } -} - -fn is_retryable_generic_decl(dag: &Dag, current: DeclarationId) -> bool { - let mut visiting = Vec::new(); - is_retryable_generic_decl_walk(dag, current, 0, &mut visiting) -} - -fn is_retryable_generic_decl_walk( - dag: &Dag, - current: DeclarationId, - depth: usize, - visiting: &mut Vec, -) -> bool { - if depth >= WALK_DEPTH_LIMIT { - return false; - } - if visiting.contains(¤t) { - return false; - } - visiting.push(current); - let retryable = match &dag.declaration(current).connective { - TypeConnective::Atom(AtomPayload::TypeParam(_)) => true, - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - is_retryable_generic_decl_walk(dag, *next, depth + 1, visiting) - } - TypeConnective::Instantiation { arguments, .. } => arguments - .iter() - .any(|arg| is_retryable_generic_decl_walk(dag, arg.value, depth + 1, visiting)), - TypeConnective::Cardinality(p) => { - is_retryable_generic_decl_walk(dag, p.element(), depth + 1, visiting) - } - TypeConnective::Conj { children } => children - .iter() - .any(|field| is_retryable_generic_decl_walk(dag, field.ty, depth + 1, visiting)), - TypeConnective::Disj { variants } => variants - .iter() - .any(|field| is_retryable_generic_decl_walk(dag, field.ty, depth + 1, visiting)), - TypeConnective::Atom(AtomPayload::UnresolvedIdentifier(_)) - | TypeConnective::Atom(AtomPayload::Literal(_)) - | TypeConnective::Arrow { .. } => false, - }; - visiting.pop(); - retryable -} - -fn callable_template_arguments( - dag: &Dag, - target: DeclarationId, -) -> (DeclarationId, Vec) { - match &dag.declaration(target).connective { - TypeConnective::Instantiation { - template, - arguments, - } => (*template, arguments.clone()), - _ => (target, Vec::new()), - } -} - -fn template_argument_value( - arguments: &[TemplateArgument], - parameter: DeclarationId, -) -> Option { - match generated_template_argument_value(arguments, ¶meter) { - Lookup::Hit(value) => Some(value), - Lookup::Miss => None, - } -} - -fn resolve_template_argument_value( - arguments: &[TemplateArgument], - current: DeclarationId, - depth: usize, -) -> DeclarationId { - generated_resolve_template_argument_value( - &(WALK_DEPTH_LIMIT.saturating_sub(depth) as i64), - arguments, - current, - ) -} - -fn retained_template_arguments_for_target( - dag: &Dag, - template: DeclarationId, - arguments: &[TemplateArgument], -) -> Vec { - let mut allowed: HashSet = dag - .declaration(template) - .type_params - .iter() - .copied() - .collect(); - if let Some(enclosing_disj) = enclosing_disj_for_variant(dag, template) { - allowed.extend(dag.declaration(enclosing_disj).type_params.iter().copied()); - } - if let Some(raw_arrow) = resolve_arrow_decl_walk(dag, template, &mut SubstStack::new(), 0) { - for input in raw_arrow.inputs { - if declaration_is_callable(dag, input, 0) { - allowed.insert(input); - } - } - } - - let mut retained: Vec = Vec::new(); - for argument in arguments { - if !allowed.contains(&argument.parameter) { - continue; - } - let resolved_value = resolve_template_argument_value(arguments, argument.value, 0); - if let Some(existing) = retained - .iter_mut() - .find(|existing| existing.parameter == argument.parameter) - { - existing.value = resolved_value; - continue; - } - retained.push(TemplateArgument { - parameter: argument.parameter, - value: resolved_value, - }); - } - retained -} - -fn push_template_argument_binding( - arguments: &mut Vec, - parameter: DeclarationId, - value: DeclarationId, -) -> bool { - match generated_push_template_argument_binding(arguments, ¶meter, value) { - TemplateArgumentBinding::Conflict => false, - TemplateArgumentBinding::NoOp => true, - TemplateArgumentBinding::Append => { - arguments.push(TemplateArgument { parameter, value }); - true - } - TemplateArgumentBinding::ReplaceAt { - _0: index, - _1: updated, - } => { - let Some(existing) = arguments.get_mut(index as usize) else { - return false; - }; - existing.value = updated; - true - } - } -} - -fn resolve_arrow_decl_walk( - dag: &Dag, - current: DeclarationId, - subst: &mut SubstStack, - depth: usize, -) -> Option { - if depth >= WALK_DEPTH_LIMIT { - return None; - } - let decl = dag.declaration(current); - match &decl.connective { - TypeConnective::Arrow { inputs, output, .. } => Some(ResolvedArrowDecl { - inputs: inputs.clone(), - output: *output, - }), - TypeConnective::Instantiation { - template, - arguments, - } => { - subst.push(arguments.clone()); - let result = resolve_arrow_decl_walk(dag, *template, subst, depth + 1); - subst.pop(); - result - } - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - resolve_arrow_decl_walk(dag, *next, subst, depth + 1) - } - TypeConnective::Atom(AtomPayload::TypeParam(_)) => { - let bound = subst.lookup(current)?; - resolve_arrow_decl_walk(dag, bound, subst, depth + 1) - } - TypeConnective::Atom(AtomPayload::UnresolvedIdentifier(_)) - | TypeConnective::Atom(AtomPayload::Literal(_)) - | TypeConnective::Conj { .. } - | TypeConnective::Disj { .. } - | TypeConnective::Cardinality(_) => None, - } -} - -fn port_type_context(dag: &Dag, port: PortId) -> Option { - let resolved_decl = match dag.port(port).state() { - PortState::Resolved(ty) => ty.declaration, - PortState::Uninferred | PortState::Unresolved => return None, - }; - let Some(produced_by) = dag.port(port).produced_by else { - return Some(PortTypeContext { - decl: resolved_decl, - subst: SubstStack::new(), - }); - }; - match dag.node(produced_by) { - // Use the port's resolved declaration, not the literal's default - // substrate type (`Int` for all int literals). After range narrowing the - // literal port may already be `UInt8` / etc.; `literal_decl_id`-style - // `Int` here makes `resolve_callable_target` think the argument is still - // the default `Int`, producing spurious implicit-template conflicts against - // a `UInt8` parameter (e.g. `id_u8(7)`). - Behavior::Value(_) => Some(PortTypeContext { - decl: resolved_decl, - subst: SubstStack::new(), - }), - Behavior::Transform(t) => match &t.target { - TransformTarget::Callable(target) => { - let CallableTargetResolution::Resolved { - template, - arguments, - .. - } = resolve_callable_target(dag, *target, &t.inputs, &t.span) - else { - return Some(PortTypeContext { - decl: resolved_decl, - subst: SubstStack::new(), - }); - }; - let mut subst = SubstStack::new(); - subst.push(arguments); - let Some(arrow) = resolve_arrow_decl_walk(dag, template, &mut subst, 0) else { - if let Some(enclosing_disj) = enclosing_disj_for_variant(dag, template) { - return Some(PortTypeContext { - decl: enclosing_disj, - subst, - }); - } - return Some(PortTypeContext { - decl: resolved_decl, - subst: SubstStack::new(), - }); - }; - Some(PortTypeContext { - decl: arrow.output, - subst, - }) - } - TransformTarget::UnresolvedFieldProject { field_label } - | TransformTarget::ResolvedFieldProject { field_label } => { - field_project_port_type_context(dag, t, field_label) - } - TransformTarget::Operator(_) => Some(PortTypeContext { - decl: resolved_decl, - subst: SubstStack::new(), - }), - }, - Behavior::Branch(_) | Behavior::Loop(_) | Behavior::Bind(_) => Some(PortTypeContext { - decl: resolved_decl, - subst: SubstStack::new(), - }), - } -} - -fn field_project_port_type_context( - dag: &Dag, - t: &TransformNode, - field_label: &str, -) -> Option { - if t.inputs.len() != 1 { - return None; - } - let input_ty = match dag.port(t.inputs[0]).state() { - PortState::Resolved(ty) => *ty, - PortState::Uninferred | PortState::Unresolved => return None, - }; - let mut subst = SubstStack::new(); - let conj_id = walk_to_conj_decl_with_subst(dag, input_ty.declaration, &mut subst)?; - let TypeConnective::Conj { children } = &dag.declaration(conj_id).connective else { - return None; - }; - let field_decl = children - .iter() - .find(|field| field.label == field_label) - .map(|field| field.ty)?; - Some(PortTypeContext { - decl: field_decl, - subst, - }) -} - -fn resolve_binding_decl( - dag: &Dag, - current: DeclarationId, - subst: &SubstStack, - depth: usize, -) -> Option { - if depth >= WALK_DEPTH_LIMIT { - return None; - } - match &dag.declaration(current).connective { - TypeConnective::Atom(AtomPayload::TypeParam(_)) => subst - .lookup(current) - .and_then(|bound| resolve_binding_decl(dag, bound, subst, depth + 1)) - .or_else(|| { - walk_to_type_shape(dag, current, subst, depth + 1).map(|ty| ty.declaration) - }), - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - resolve_binding_decl(dag, *next, subst, depth + 1) - } - _ => walk_to_type_shape(dag, current, subst, depth + 1).map(|ty| ty.declaration), - } -} - -fn callable_signature_context( - dag: &Dag, - callable: DeclarationId, -) -> Option { - let decl = dag.declaration(callable); - if let TypeConnective::Arrow { - inputs, - body: ArrowBody::UserDefined(bind_id), - .. - } = &decl.connective - { - let bind = (*bind_id).bind(dag); - if bind.params.len() < inputs.len() { - return None; - } - let start = bind.params.len() - inputs.len(); - let mut input_contexts = Vec::with_capacity(inputs.len()); - for port in &bind.params[start..] { - input_contexts.push(port_type_context(dag, *port)?); - } - return Some(CallableSignatureContext { - inputs: input_contexts, - output: port_type_context(dag, bind.value)?, - }); - } - - let (template, arguments) = callable_template_arguments(dag, callable); - let mut subst = SubstStack::new(); - subst.push(arguments); - let raw_arrow = resolve_arrow_decl_walk(dag, template, &mut subst, 0)?; - Some(CallableSignatureContext { - inputs: raw_arrow - .inputs - .into_iter() - .map(|decl| PortTypeContext { - decl, - subst: subst.clone(), - }) - .collect(), - output: PortTypeContext { - decl: raw_arrow.output, - subst, - }, - }) -} - -fn bind_expected_callable_to_actual( - dag: &Dag, - expected_callable: DeclarationId, - actual_callable: DeclarationId, - arguments: &mut Vec, -) -> CallableBindingResolution { - let mut expected_subst = SubstStack::new(); - expected_subst.push(arguments.clone()); - let Some(expected_arrow) = - resolve_arrow_decl_walk(dag, expected_callable, &mut expected_subst, 0) - else { - return CallableBindingResolution::Conflict; - }; - let Some(actual_signature) = callable_signature_context(dag, actual_callable) else { - return CallableBindingResolution::Retry; - }; - if expected_arrow.inputs.len() != actual_signature.inputs.len() { - return CallableBindingResolution::Conflict; - } - for (expected_input, actual_input) in expected_arrow - .inputs - .into_iter() - .zip(actual_signature.inputs.iter()) - { - if !bind_expected_decl_to_actual_context(dag, expected_input, actual_input, arguments, 0) { - return CallableBindingResolution::Conflict; - } - } - if !bind_expected_decl_to_actual_context( - dag, - expected_arrow.output, - &actual_signature.output, - arguments, - 0, - ) { - return CallableBindingResolution::Conflict; - } - CallableBindingResolution::Resolved -} - -fn bind_expected_decl_to_actual_context( - dag: &Dag, - expected: DeclarationId, - actual: &PortTypeContext, - arguments: &mut Vec, - depth: usize, -) -> bool { - if depth >= WALK_DEPTH_LIMIT { - return false; - } - - match &dag.declaration(expected).connective { - TypeConnective::Atom(AtomPayload::TypeParam(_)) => { - if let Some(bound) = template_argument_value(arguments, expected) { - if bound != expected { - let expected_ctx = PortTypeContext { - decl: bound, - subst: SubstStack::new(), - }; - return bind_expected_decl_to_actual_context( - dag, - expected_ctx.decl, - actual, - arguments, - depth + 1, - ); - } - } - let Some(value) = resolve_binding_decl(dag, actual.decl, &actual.subst, depth + 1) - else { - return false; - }; - push_template_argument_binding(arguments, expected, value) - } - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - bind_expected_decl_to_actual_context(dag, *next, actual, arguments, depth + 1) - } - TypeConnective::Instantiation { - template, - arguments: expected_args, - } => { - let actual_decl = match &dag.declaration(actual.decl).connective { - TypeConnective::Atom(AtomPayload::TypeParam(_)) => { - let Some(bound) = actual.subst.lookup(actual.decl) else { - return false; - }; - return bind_expected_decl_to_actual_context( - dag, - expected, - &PortTypeContext { - decl: bound, - subst: actual.subst.clone(), - }, - arguments, - depth + 1, - ); - } - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - return bind_expected_decl_to_actual_context( - dag, - expected, - &PortTypeContext { - decl: *next, - subst: actual.subst.clone(), - }, - arguments, - depth + 1, - ); - } - _ => actual.decl, - }; - let TypeConnective::Instantiation { - template: actual_template, - arguments: actual_args, - } = &dag.declaration(actual_decl).connective - else { - if actual_decl != *template { - return false; - } - let template_params = dag.declaration(*template).type_params.clone(); - if template_params.len() != expected_args.len() { - return false; - } - for (expected_arg, param_id) in expected_args.iter().zip(template_params) { - let Some(actual_value) = actual.subst.lookup(param_id) else { - return false; - }; - if !bind_expected_decl_to_actual_context( - dag, - expected_arg.value, - &PortTypeContext { - decl: actual_value, - subst: actual.subst.clone(), - }, - arguments, - depth + 1, - ) { - return false; - } - } - return true; - }; - if *actual_template == expected && expected_args.len() == actual_args.len() { - for (expected_arg, actual_arg) in expected_args.iter().zip(actual_args.iter()) { - if !bind_expected_decl_to_actual_context( - dag, - expected_arg.value, - &PortTypeContext { - decl: actual_arg.value, - subst: actual.subst.clone(), - }, - arguments, - depth + 1, - ) { - return false; - } - } - return true; - } - if template != actual_template || expected_args.len() != actual_args.len() { - return false; - } - for (expected_arg, actual_arg) in expected_args.iter().zip(actual_args.iter()) { - if !bind_expected_decl_to_actual_context( - dag, - expected_arg.value, - &PortTypeContext { - decl: actual_arg.value, - subst: actual.subst.clone(), - }, - arguments, - depth + 1, - ) { - return false; - } - } - true - } - TypeConnective::Cardinality(p) => { - let element = p.element(); - let bound = p.bound(); - let actual_decl = match &dag.declaration(actual.decl).connective { - TypeConnective::Atom(AtomPayload::TypeParam(_)) => { - let Some(bound) = actual.subst.lookup(actual.decl) else { - return false; - }; - return bind_expected_decl_to_actual_context( - dag, - expected, - &PortTypeContext { - decl: bound, - subst: actual.subst.clone(), - }, - arguments, - depth + 1, - ); - } - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - return bind_expected_decl_to_actual_context( - dag, - expected, - &PortTypeContext { - decl: *next, - subst: actual.subst.clone(), - }, - arguments, - depth + 1, - ); - } - _ => actual.decl, - }; - let TypeConnective::Cardinality(actual_p) = &dag.declaration(actual_decl).connective - else { - return false; - }; - if bound != actual_p.bound() { - return false; - } - bind_expected_decl_to_actual_context( - dag, - element, - &PortTypeContext { - decl: actual_p.element(), - subst: actual.subst.clone(), - }, - arguments, - depth + 1, - ) - } - _ => { - // Gate #60 Slice Z: `MachineWidth` uses anonymous `LiteralBits::Int` - // phantom declarations. Alias sites vs inference sites can allocate distinct - // declaration ids for the same decimal; `walk_to_type_shape` returns `None` for - // anonymous literals, so fall back to literal equality before shape identity. - let resolved_expected = - resolve_binding_decl(dag, expected, &SubstStack::new(), depth + 1) - .unwrap_or(expected); - let resolved_actual = resolve_binding_decl(dag, actual.decl, &actual.subst, depth + 1) - .unwrap_or(actual.decl); - if let ( - TypeConnective::Atom(AtomPayload::Literal(e_bits)), - TypeConnective::Atom(AtomPayload::Literal(a_bits)), - ) = ( - &dag.declaration(resolved_expected).connective, - &dag.declaration(resolved_actual).connective, - ) { - if e_bits == a_bits { - return true; - } - } - let Some(expected_ty) = - walk_to_type_shape(dag, resolved_expected, &SubstStack::new(), depth + 1) - else { - return false; - }; - let Some(actual_ty) = - walk_to_type_shape(dag, resolved_actual, &actual.subst, depth + 1) - else { - return false; - }; - expected_ty == actual_ty - } - } -} - -fn callable_instantiation_conflict( - dag: &Dag, - target: DeclarationId, - expected: DeclarationId, - actual: &PortTypeContext, - span: &SourceSpan, -) -> Diagnostic { - let expected_name = target_display_name(dag, expected); - let actual_name = resolve_binding_decl(dag, actual.decl, &actual.subst, 0) - .map(|id| target_display_name(dag, id)) - .unwrap_or_else(|| format!("declaration#{}", actual.decl.raw())); - Diagnostic::ResolveError { - name: format!( - "implicit template binding for `{}` conflicts while matching `{expected_name}` against `{actual_name}`", - target_display_name(dag, target) - ), - span: span.clone(), - correction: Correction::deferred_for_diagnostic_class("InferenceDiagnostic"), - } -} - -/// `port_type_context` reports the default `Int` type shape for integer literals, so -/// [`bind_expected_decl_to_actual_context`] can reject a callee that expects a range-backed -/// narrow type (`UInt8`, …). The main transform decision path already allows in-range -/// literal narrowing; mirror that here so [`resolve_callable_target`] can succeed. Out-of-range -/// literals surface as [`Diagnostic::MagnitudeOutOfRange`] to match -/// `decide(Transform)`-style call checks. -fn int_literal_implicit_bind_tolerated_for_expected( - dag: &Dag, - expected: DeclarationId, - input_port: PortId, - span: &SourceSpan, -) -> Result { - let Some(literal) = literal_bigint_at(dag, input_port) else { - return Ok(false); - }; - match int_literal_fits_expected_type(dag, &literal, expected) { - Ok(Some(true)) => Ok(true), - Ok(Some(false)) => match integer_range_for_decl(dag, expected) { - IntegerRangeLookup::Found(range) => Err(magnitude_out_of_range_for_interval( - &literal, - TypeShape::new(expected), - range, - span.clone(), - )), - IntegerRangeLookup::Invalid(diag) => Err(diag), - IntegerRangeLookup::Missing => Ok(false), - }, - Ok(None) => Ok(int_literal_allowed_integral_seed_for_real_decl( - dag, &literal, expected, - )), - Err(diag) => Err(diag), - } -} - -fn resolve_callable_target( - dag: &Dag, - target: DeclarationId, - runtime_inputs: &[PortId], - span: &SourceSpan, -) -> CallableTargetResolution { - let (template, mut arguments) = callable_template_arguments(dag, target); - arguments = retained_template_arguments_for_target(dag, template, &arguments); - let Some(signature) = resolve_direct_target_signature(dag, target, &arguments) else { - let name = target_display_name(dag, target); - return CallableTargetResolution::Fail(Diagnostic::ResolveError { - name, - span: span.clone(), - correction: Correction::deferred_for_diagnostic_class("InferenceDiagnostic"), - }); - }; - let mut raw_subst = SubstStack::new(); - raw_subst.push(arguments.clone()); - let raw_arrow_inputs = - resolve_arrow_decl_walk(dag, template, &mut raw_subst, 0).map(|arrow| arrow.inputs); - - let expected_runtime_arity = raw_arrow_inputs - .as_ref() - .map(|inputs| { - inputs - .iter() - .filter(|input| !declaration_is_callable(dag, **input, 0)) - .count() - }) - .unwrap_or_else(|| signature.inputs.len()); - if expected_runtime_arity != runtime_inputs.len() { - return CallableTargetResolution::Fail(Diagnostic::ArityMismatch { - function: target_display_name(dag, target), - expected: expected_runtime_arity, - actual: runtime_inputs.len(), - span: span.clone(), - correction: Correction::deferred_for_diagnostic_class("InferenceDiagnostic"), - }); - } - - let mut runtime_iter = runtime_inputs.iter(); - if let Some(raw_inputs) = raw_arrow_inputs { - for expected_input in raw_inputs { - if declaration_is_callable(dag, expected_input, 0) { - let Some(actual_callable) = template_argument_value(&arguments, expected_input) - else { - return CallableTargetResolution::Retry; - }; - match bind_expected_callable_to_actual( - dag, - expected_input, - actual_callable, - &mut arguments, - ) { - CallableBindingResolution::Resolved => {} - CallableBindingResolution::Retry => { - return CallableTargetResolution::Retry; - } - CallableBindingResolution::Conflict => { - return CallableTargetResolution::Fail( - Diagnostic::ResolveError { - name: format!( - "callable argument to `{}` does not match the expected function type", - target_display_name(dag, target) - ), - span: span.clone(), - correction: Correction::deferred_for_diagnostic_class("InferenceDiagnostic"), - }, - ); - } - } - continue; - } - let Some(input_port) = runtime_iter.next() else { - break; - }; - match dag.port(*input_port).state() { - PortState::Uninferred => return CallableTargetResolution::Retry, - PortState::Unresolved => { - return CallableTargetResolution::Fail(Diagnostic::ResolveError { - name: format!("(upstream failure in {})", target_display_name(dag, target)), - span: span.clone(), - correction: Correction::deferred_for_diagnostic_class( - "InferenceDiagnostic", - ), - }); - } - PortState::Resolved(_) => {} - } - let Some(actual_ctx) = port_type_context(dag, *input_port) else { - return CallableTargetResolution::Retry; - }; - if !bind_expected_decl_to_actual_context( - dag, - expected_input, - &actual_ctx, - &mut arguments, - 0, - ) { - match int_literal_implicit_bind_tolerated_for_expected( - dag, - expected_input, - *input_port, - span, - ) { - Ok(true) => {} - Ok(false) => { - return CallableTargetResolution::Fail(callable_instantiation_conflict( - dag, - target, - expected_input, - &actual_ctx, - span, - )); - } - Err(diag) => return CallableTargetResolution::Fail(diag), - } - } - } - } else { - for expected_input in &signature.inputs { - if declaration_is_callable(dag, expected_input.declaration, 0) { - let Some(actual_callable) = - template_argument_value(&arguments, expected_input.declaration) - else { - return CallableTargetResolution::Retry; - }; - match bind_expected_callable_to_actual( - dag, - expected_input.declaration, - actual_callable, - &mut arguments, - ) { - CallableBindingResolution::Resolved => {} - CallableBindingResolution::Retry => { - return CallableTargetResolution::Retry; - } - CallableBindingResolution::Conflict => { - return CallableTargetResolution::Fail(Diagnostic::ResolveError { - name: format!( - "callable argument to `{}` does not match the expected function type", - target_display_name(dag, target) - ), - span: span.clone(), - correction: Correction::deferred_for_diagnostic_class("InferenceDiagnostic"), - }); - } - } - continue; - } - let Some(actual_callable) = - template_argument_value(&arguments, expected_input.declaration) - else { - let Some(input_port) = runtime_iter.next() else { - break; - }; - match dag.port(*input_port).state() { - PortState::Uninferred => return CallableTargetResolution::Retry, - PortState::Unresolved => { - return CallableTargetResolution::Fail(Diagnostic::ResolveError { - name: format!( - "(upstream failure in {})", - target_display_name(dag, target) - ), - span: span.clone(), - correction: Correction::deferred_for_diagnostic_class( - "InferenceDiagnostic", - ), - }); - } - PortState::Resolved(_) => {} - } - let Some(actual_ctx) = port_type_context(dag, *input_port) else { - return CallableTargetResolution::Retry; - }; - if !bind_expected_decl_to_actual_context( - dag, - expected_input.declaration, - &actual_ctx, - &mut arguments, - 0, - ) { - match int_literal_implicit_bind_tolerated_for_expected( - dag, - expected_input.declaration, - *input_port, - span, - ) { - Ok(true) => {} - Ok(false) => { - return CallableTargetResolution::Fail( - callable_instantiation_conflict( - dag, - target, - expected_input.declaration, - &actual_ctx, - span, - ), - ); - } - Err(diag) => return CallableTargetResolution::Fail(diag), - } - } - continue; - }; - match bind_expected_callable_to_actual( - dag, - expected_input.declaration, - actual_callable, - &mut arguments, - ) { - CallableBindingResolution::Resolved => {} - CallableBindingResolution::Retry => { - return CallableTargetResolution::Retry; - } - CallableBindingResolution::Conflict => { - return CallableTargetResolution::Fail(Diagnostic::ResolveError { - name: format!( - "callable argument to `{}` does not match the expected function type", - target_display_name(dag, target) - ), - span: span.clone(), - correction: Correction::deferred_for_diagnostic_class( - "InferenceDiagnostic", - ), - }); - } - } - } - } - - let Some(signature) = resolve_direct_target_signature(dag, target, &arguments) else { - let name = target_display_name(dag, target); - return CallableTargetResolution::Fail(Diagnostic::ResolveError { - name, - span: span.clone(), - correction: Correction::deferred_for_diagnostic_class("InferenceDiagnostic"), - }); - }; - CallableTargetResolution::Resolved { - template, - arguments, - signature, - } -} - -fn resolve_direct_target_signature( - dag: &Dag, - target: DeclarationId, - arguments: &[TemplateArgument], -) -> Option { - let (template, _) = callable_template_arguments(dag, target); - let mut subst = SubstStack::new(); - subst.push(arguments.to_vec()); - if let Some(arrow) = resolve_arrow_walk(dag, template, &mut subst, 0) { - return Some(arrow); - } - - let TypeConnective::Conj { children } = &dag.declaration(template).connective else { - return None; - }; - let inputs = children - .iter() - .map(|child| signature_type_shape(dag, child.ty, &subst, 0)) - .collect::>>()?; - Some(ResolvedArrow { - inputs, - output: TypeShape::new( - instantiated_enclosing_disj_for_variant(dag, template, arguments) - .or_else(|| enclosing_disj_for_variant(dag, template)) - .unwrap_or(target), - ), - // Variant constructor synthesis: `Variant(payload)` is direct - // construction, not a function call with an executable body. - // `NoBody` rather than `Pending` so the synthesized signature - // semantically matches the "no body by construction" cases in - // declarations, even though this `ResolvedArrow` is transient - // inference state (never stored in `Dag.declarations`). - body: ArrowBody::NoBody, - }) -} - -fn instantiated_enclosing_disj_for_variant( - dag: &Dag, - variant_decl_id: DeclarationId, - arguments: &[TemplateArgument], -) -> Option { - let enclosing_disj = enclosing_disj_for_variant(dag, variant_decl_id)?; - let params = &dag.declaration(enclosing_disj).type_params; - if params.is_empty() { - return Some(enclosing_disj); - } - let disj_arguments = params - .iter() - .map(|parameter| { - arguments - .iter() - .find(|argument| argument.parameter == *parameter) - .cloned() - }) - .collect::>>()?; - find_equivalent_anonymous_instantiation(dag, enclosing_disj, &disj_arguments, None) -} - -fn resolve_callable_targets(dag: &mut Dag) -> bool { - struct Rewrite { - node_index: usize, - template: DeclarationId, - arguments: Vec, - } - - let mut rewrites: Vec = Vec::new(); - for (node_index, node) in dag.nodes().iter().enumerate() { - let Behavior::Transform(t) = node else { - continue; - }; - let TransformTarget::Callable(target) = t.target else { - continue; - }; - let CallableTargetResolution::Resolved { - template, - arguments, - .. - } = resolve_callable_target(dag, target, &t.inputs, &t.span) - else { - continue; - }; - let (current_template, current_arguments) = callable_template_arguments(dag, target); - if current_template == template - && matches!( - generated_template_arguments_match(¤t_arguments, &arguments), - TemplateArgumentsMatch::Match, - ) - { - continue; - } - if arguments.is_empty() && current_template == template { - continue; - } - rewrites.push(Rewrite { - node_index, - template, - arguments, - }); - } - - let mut changed = false; - for rewrite in rewrites { - let new_target = if rewrite.arguments.is_empty() { - rewrite.template - } else { - let instantiation_id = dag.alloc_declaration_id(); - dag.push_declaration(crate::dag::Declaration { - id: instantiation_id, - name: None, - connective: TypeConnective::Instantiation { - template: rewrite.template, - arguments: rewrite.arguments, - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: synthetic_span(), - }); - instantiation_id - }; - let Behavior::Transform(t) = &mut dag.nodes_mut()[rewrite.node_index] else { - continue; - }; - let TransformTarget::Callable(target) = &mut t.target else { - continue; - }; - if *target != new_target { - *target = new_target; - changed = true; - } - } - changed -} - -fn materialize_callable_signature_instantiations(dag: &mut Dag) -> bool { - let requests: Vec<(DeclarationId, Vec)> = dag - .nodes() - .iter() - .filter_map(|node| { - let Behavior::Transform(t) = node else { - return None; - }; - let TransformTarget::Callable(target) = t.target else { - return None; - }; - let (template, arguments) = callable_template_arguments(dag, target); - (!arguments.is_empty()).then_some((template, arguments)) - }) - .collect(); - - let initial_count = dag.declarations().len(); - for (template, arguments) in requests { - let mut subst = SubstStack::new(); - subst.push(arguments); - let Some(raw_arrow) = resolve_arrow_decl_walk(dag, template, &mut subst, 0) else { - continue; - }; - for input in raw_arrow.inputs { - let _ = concretize_decl_with_subst(dag, input, &subst, 0); - } - let _ = concretize_decl_with_subst(dag, raw_arrow.output, &subst, 0); - } - dag.declarations().len() != initial_count -} - -fn resolve_lambda_parameter_types(dag: &mut Dag) -> bool { - struct Rewrite { - port: PortId, - ty: TypeShape, - } - - let mut rewrites: Vec = Vec::new(); - - for node in dag.nodes() { - let Behavior::Transform(t) = node else { - continue; - }; - let TransformTarget::Callable(target) = t.target else { - continue; - }; - let (template, arguments) = match resolve_callable_target(dag, target, &t.inputs, &t.span) { - CallableTargetResolution::Resolved { - template, - arguments, - .. - } => (template, arguments), - CallableTargetResolution::Retry => { - bind_non_callable_target_arguments(dag, target, &t.inputs) - .unwrap_or_else(|| callable_template_arguments(dag, target)) - } - CallableTargetResolution::Fail(_) => continue, - }; - let mut outer_subst = SubstStack::new(); - outer_subst.push(arguments.clone()); - let Some(raw_arrow) = resolve_arrow_decl_walk(dag, template, &mut SubstStack::new(), 0) - else { - continue; - }; - for expected_input in raw_arrow.inputs { - if !declaration_is_callable(dag, expected_input, 0) { - continue; - } - let Some(actual_callable) = template_argument_value(&arguments, expected_input) else { - continue; - }; - let Some(expected_signature) = - resolve_arrow_walk(dag, expected_input, &mut outer_subst.clone(), 0) - else { - continue; - }; - let TypeConnective::Arrow { body, .. } = &dag.declaration(actual_callable).connective - else { - continue; - }; - let ArrowBody::UserDefined(bind_id) = body else { - continue; - }; - let bind = (*bind_id).bind(dag); - if bind.params.len() < expected_signature.inputs.len() { - continue; - } - let start = bind.params.len() - expected_signature.inputs.len(); - for (port, ty) in bind.params[start..] - .iter() - .copied() - .zip(expected_signature.inputs.iter().copied()) - { - rewrites.push(Rewrite { port, ty }); - } - } - } - - let mut changed = false; - for rewrite in rewrites { - let current = dag.port(rewrite.port).state().clone(); - if matches!(current, PortState::Resolved(existing) if existing == rewrite.ty) { - continue; - } - if matches!(current, PortState::Unresolved) { - continue; - } - dag.set_port_type(rewrite.port, rewrite.ty); - changed = true; - } - changed -} - -fn validate_user_defined_function_signatures(dag: &mut Dag) -> bool { - struct Failure { - port: PortId, - diagnostic: Diagnostic, - } - - let user_defined_arrows: Vec<(DeclarationId, Vec, DeclarationId, BindNodeId)> = - dag.declarations() - .iter() - .filter_map(|decl| match &decl.connective { - TypeConnective::Arrow { - inputs, - output, - body: ArrowBody::UserDefined(bind_id), - } => Some((decl.id, inputs.clone(), *output, *bind_id)), - _ => None, - }) - .collect(); - - let mut failures = Vec::new(); - - 'declarations: for (decl_id, inputs, output, bind_id) in user_defined_arrows { - let bind = bind_id.bind(dag); - if matches!(dag.port(bind.value).state(), PortState::Unresolved) { - continue; - } - if bind.params.len() < inputs.len() { - failures.push(Failure { - port: bind.value, - diagnostic: Diagnostic::ResolveError { - name: format!( - "function `{}` body does not satisfy its declared signature", - dag.declaration(decl_id) - .name - .as_deref() - .unwrap_or("") - ), - span: bind.span.clone(), - correction: witness_correction_for_decl( - dag, - output, - bind.span.clone(), - format!( - "replace the function body with a `{}` value", - declaration_display_name(dag, output) - ), - ) - .unwrap_or_else(|| { - crate::diagnostics::Correction::deferred_for_diagnostic_class( - "InferenceDiagnostic", - ) - }), - }, - }); - continue; - } - - let start = bind.params.len() - inputs.len(); - let mut arguments = Vec::new(); - for (index, (port, expected_decl)) in bind.params[start..] - .iter() - .copied() - .zip(inputs.iter().copied()) - .enumerate() - { - if declaration_is_callable(dag, expected_decl, 0) { - continue; - } - match dag.port(port).state() { - PortState::Uninferred | PortState::Unresolved => continue 'declarations, - PortState::Resolved(_) => {} - } - let Some(actual_ctx) = port_type_context(dag, port) else { - continue 'declarations; - }; - if bind_expected_decl_to_actual_context( - dag, - expected_decl, - &actual_ctx, - &mut arguments, - 0, - ) { - continue; - } - - failures.push(Failure { - port: bind.value, - diagnostic: Diagnostic::ResolveError { - name: format!( - "function `{}` parameter {} does not satisfy its declared signature", - dag.declaration(decl_id) - .name - .as_deref() - .unwrap_or(""), - index + 1 - ), - span: bind.span.clone(), - correction: witness_correction_for_decl( - dag, - expected_decl, - bind.span.clone(), - format!( - "replace the parameter use with a `{}` value", - declaration_display_name(dag, expected_decl) - ), - ) - .unwrap_or_else(|| { - crate::diagnostics::Correction::deferred_for_diagnostic_class( - "InferenceDiagnostic", - ) - }), - }, - }); - continue 'declarations; - } - - match dag.port(bind.value).state() { - PortState::Uninferred | PortState::Unresolved => continue, - PortState::Resolved(_) => {} - } - if declaration_is_callable(dag, output, 0) { - continue; - } - let Some(actual_ctx) = port_type_context(dag, bind.value) else { - continue; - }; - if bind_expected_decl_to_actual_context(dag, output, &actual_ctx, &mut arguments, 0) { - continue; - } - - failures.push(Failure { - port: bind.value, - diagnostic: Diagnostic::ResolveError { - name: format!( - "function `{}` body does not satisfy its declared return type", - dag.declaration(decl_id) - .name - .as_deref() - .unwrap_or("") - ), - span: bind.span.clone(), - correction: witness_correction_for_decl( - dag, - output, - bind.span.clone(), - format!( - "replace the function body with a `{}` value", - declaration_display_name(dag, output) - ), - ) - .unwrap_or_else(|| { - crate::diagnostics::Correction::deferred_for_diagnostic_class( - "InferenceDiagnostic", - ) - }), - }, - }); - } - - let mut changed = false; - for failure in failures { - if matches!(dag.port(failure.port).state(), PortState::Unresolved) { - continue; - } - dag.mark_unresolved(failure.port, failure.diagnostic); - changed = true; - } - changed -} - -fn bind_non_callable_target_arguments( - dag: &Dag, - target: DeclarationId, - runtime_inputs: &[PortId], -) -> Option<(DeclarationId, Vec)> { - let (template, mut arguments) = callable_template_arguments(dag, target); - let signature = resolve_direct_target_signature(dag, target, &arguments)?; - let mut raw_subst = SubstStack::new(); - raw_subst.push(arguments.clone()); - let raw_arrow_inputs = - resolve_arrow_decl_walk(dag, template, &mut raw_subst, 0).map(|arrow| arrow.inputs); - - let expected_runtime_arity = raw_arrow_inputs - .as_ref() - .map(|inputs| { - inputs - .iter() - .filter(|input| !declaration_is_callable(dag, **input, 0)) - .count() - }) - .unwrap_or_else(|| signature.inputs.len()); - if expected_runtime_arity != runtime_inputs.len() { - return None; - } - - let mut runtime_iter = runtime_inputs.iter(); - if let Some(raw_inputs) = raw_arrow_inputs { - for expected_input in raw_inputs { - if declaration_is_callable(dag, expected_input, 0) { - continue; - } - let input_port = *runtime_iter.next()?; - let actual_ctx = port_type_context(dag, input_port)?; - if !bind_expected_decl_to_actual_context( - dag, - expected_input, - &actual_ctx, - &mut arguments, - 0, - ) { - return None; - } - } - } else { - for expected_input in &signature.inputs { - if declaration_is_callable(dag, expected_input.declaration, 0) { - continue; - } - let input_port = *runtime_iter.next()?; - let actual_ctx = port_type_context(dag, input_port)?; - if !bind_expected_decl_to_actual_context( - dag, - expected_input.declaration, - &actual_ctx, - &mut arguments, - 0, - ) { - return None; - } - } - } - - Some((template, arguments)) -} - -fn walk_to_conj_decl_with_subst( - dag: &Dag, - start: DeclarationId, - subst: &mut SubstStack, -) -> Option { - match walk_to_conj_decl_with_subst_or_opacity(dag, start, subst, false) { - ConjWalkResult::Conj(id) => Some(id), - ConjWalkResult::NoConj => None, - ConjWalkResult::NominalOpaque(_) => { - unreachable!("opacity check is disabled for ordinary Conj walks") - } - } -} - -enum ConjWalkResult { - Conj(DeclarationId), - NominalOpaque(DeclarationId), - NoConj, -} - -fn walk_to_conj_decl_with_subst_or_opacity( - dag: &Dag, - start: DeclarationId, - subst: &mut SubstStack, - stop_at_nominal_opacity: bool, -) -> ConjWalkResult { - let mut current = start; - for _ in 0..WALK_DEPTH_LIMIT { - let decl = dag.declaration(current); - if stop_at_nominal_opacity && decl.nominal_opacity.is_some() { - return ConjWalkResult::NominalOpaque(current); - } - match &decl.connective { - TypeConnective::Conj { .. } => return ConjWalkResult::Conj(current), - TypeConnective::Instantiation { - template, - arguments, - } => { - subst.push(arguments.clone()); - current = *template; - } - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - current = *next; - } - TypeConnective::Atom(AtomPayload::TypeParam(_)) => { - let Some(next) = subst.lookup(current) else { - return ConjWalkResult::NoConj; - }; - current = next; - } - _ => return ConjWalkResult::NoConj, - } - } - ConjWalkResult::NoConj -} - -fn walk_to_disj_decl_with_subst( - dag: &Dag, - start: DeclarationId, - subst: &mut SubstStack, -) -> Option { - let mut current = start; - for _ in 0..WALK_DEPTH_LIMIT { - let decl = dag.declaration(current); - match &decl.connective { - TypeConnective::Disj { .. } => return Some(current), - TypeConnective::Cardinality(p) - if p.bound() == crate::dag::CardinalityBound::AtMostOne => - { - return existing_optional_match_disj_decl(dag, current); - } - TypeConnective::Instantiation { - template, - arguments, - } => { - subst.push(arguments.clone()); - current = *template; - } - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - current = *next; - } - TypeConnective::Atom(AtomPayload::TypeParam(_)) => { - current = subst.lookup(current)?; - } - _ => return None, - } - } - None -} - -fn enclosing_disj_for_variant(dag: &Dag, variant_decl_id: DeclarationId) -> Option { - dag.declarations().iter().find_map(|decl| { - let TypeConnective::Disj { variants } = &decl.connective else { - return None; - }; - variants - .iter() - .find(|variant| variant.ty == variant_decl_id) - .map(|_| decl.id) - }) -} - -fn resolve_payload_binding_type( - dag: &Dag, - variant_decl_id: DeclarationId, - subst: &SubstStack, - variant_name: &str, - binding_name: &str, - span: &SourceSpan, -) -> Result { - match &dag.declaration(variant_decl_id).connective { - TypeConnective::Conj { children } if children.is_empty() => { - Err(Diagnostic::ResolveError { - name: format!( - "variant `{variant_name}` does not carry a payload and cannot bind `{binding_name}`" - ), - span: span.clone(), - correction: Correction::deferred_for_diagnostic_class("InferenceDiagnostic"), - }) - } - TypeConnective::Conj { children } - if children.len() == 1 && children[0].label.as_str() == "_0" => - { - let payload_type_decl = children[0].ty; - walk_to_type_shape(dag, payload_type_decl, subst, 0) - .map(PayloadBindingResolution::Direct) - .ok_or_else(|| Diagnostic::ResolveError { - name: format!( - "variant `{variant_name}` payload does not resolve to a port type for binding `{binding_name}`" - ), - span: span.clone(), - correction: Correction::deferred_for_diagnostic_class("InferenceDiagnostic"), - }) - } - TypeConnective::Conj { .. } => Ok(PayloadBindingResolution::SpecializedRecord { - variant_decl_id, - subst: subst.clone(), - }), - _ => { - Err(Diagnostic::ResolveError { - name: format!( - "variant `{variant_name}` does not lower to a payload Conj and cannot bind `{binding_name}`" - ), - span: span.clone(), - correction: Correction::deferred_for_diagnostic_class("InferenceDiagnostic"), - }) - } - } -} - -fn materialize_specialized_payload_record( - dag: &mut Dag, - variant_decl_id: DeclarationId, - subst: &SubstStack, -) -> TypeShape { - let variant_decl = dag.declaration(variant_decl_id).clone(); - let TypeConnective::Conj { children } = variant_decl.connective else { - return TypeShape::new(variant_decl_id); - }; - let specialized_children: Vec = children - .into_iter() - .map(|field| Field { - label: field.label, - ty: concretize_decl_with_subst(dag, field.ty, subst, 0), - }) - .collect(); - if let Some(existing) = find_equivalent_anonymous_conj(dag, &specialized_children) { - return TypeShape::new(existing); - } - let id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id, - name: None, - connective: TypeConnective::Conj { - children: specialized_children, - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: variant_decl.span, - }); - TypeShape::new(id) -} - -pub(crate) fn concretize_decl_with_subst( - dag: &mut Dag, - current: DeclarationId, - subst: &SubstStack, - depth: usize, -) -> DeclarationId { - if depth >= WALK_DEPTH_LIMIT { - return current; - } - let decl = dag.declaration(current).clone(); - // DB-16 (3a.3 closure): refinement-bearing declarations whose base - // requires substitution materialize a fresh substituted-refined - // carrier — structurally identical to what `lower_parameter_refinement` - // would produce if the user had authored the refinement on the - // concrete type directly. Runs before the connective match so the - // refinement edge is preserved across the walk. - if decl.refinement.is_some() && refinement_base_requires_substitution(dag, current, subst) { - return materialize_substituted_refined_decl(dag, current, subst); - } - match decl.connective { - TypeConnective::Atom(AtomPayload::TypeParam(_)) => subst.lookup(current).unwrap_or(current), - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - concretize_decl_with_subst(dag, next, subst, depth + 1) - } - TypeConnective::Instantiation { - template, - arguments, - } => { - let specialized_arguments: Vec = arguments - .into_iter() - .map(|arg| TemplateArgument { - parameter: arg.parameter, - value: concretize_decl_with_subst(dag, arg.value, subst, depth + 1), - }) - .collect(); - if let Some(existing) = find_equivalent_anonymous_instantiation( - dag, - template, - &specialized_arguments, - decl.nominal_opacity.as_ref(), - ) { - return existing; - } - let id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id, - name: None, - connective: TypeConnective::Instantiation { - template, - arguments: specialized_arguments, - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: decl.nominal_opacity.clone(), - span: decl.span, - }); - id - } - TypeConnective::Cardinality(p) => { - let element = p.element(); - let bound = p.bound(); - let specialized_element = concretize_decl_with_subst(dag, element, subst, depth + 1); - if let Some(existing) = - find_equivalent_anonymous_cardinality(dag, specialized_element, &bound) - { - return existing; - } - dag.alloc_cardinality_decl(specialized_element, bound, decl.span.clone()) - } - _ => current, - } -} - -/// DB-16 (3a.3 closure): gate used by both `concretize_decl_with_subst` -/// (construction side) and `signature_type_shape` (consumer side) to -/// decide whether a refinement-bearing declaration needs substitution -/// before its refinement edge can be meaningfully consumed. -/// -/// Returns `true` iff walking the refined carrier's base through -/// `Atom(ResolvedIdentifier(_))` hops lands on either: -/// - a `TypeParam` declaration whose id is bound in `subst`, or -/// - an `Instantiation` whose arguments reference substitution-bound -/// TypeParams (i.e., substitution would materially change the -/// resolved base). -/// -/// For concrete refined carriers (`Int where pred(x)`) the walk -/// short-circuits to `false`; DB-11's identity-terminator fires -/// unchanged. For refined TypeParams with no active binding (earlier -/// iteration retry case) the walk also returns `false`. -fn refinement_base_requires_substitution( - dag: &Dag, - current: DeclarationId, - subst: &SubstStack, -) -> bool { - let decl = dag.declaration(current); - let TypeConnective::Atom( - AtomPayload::ResolvedByStructure(base) | AtomPayload::ResolvedByName(base), - ) = &decl.connective - else { - return false; - }; - refinement_base_walk(dag, *base, subst, 0) -} - -fn refinement_base_walk( - dag: &Dag, - current: DeclarationId, - subst: &SubstStack, - depth: usize, -) -> bool { - if depth >= WALK_DEPTH_LIMIT { - return false; - } - let decl = dag.declaration(current); - match &decl.connective { - TypeConnective::Atom(AtomPayload::TypeParam(_)) => subst.lookup(current).is_some(), - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - refinement_base_walk(dag, *next, subst, depth + 1) - } - TypeConnective::Instantiation { arguments, .. } => arguments - .iter() - .any(|arg| refinement_base_walk(dag, arg.value, subst, depth + 1)), - TypeConnective::Cardinality(p) => refinement_base_walk(dag, p.element(), subst, depth + 1), - _ => false, - } -} - -/// DB-16 (3a.3 closure): the sole construction site for substituted -/// refined carriers. Called from `concretize_decl_with_subst`'s -/// refinement branch during the `materialize_callable_signature_instantiations` -/// phase. Produces a fresh anonymous `Declaration` structurally -/// identical to what `lower_parameter_refinement` would produce if -/// the user had authored the refinement on the concrete substituted -/// base directly. -/// -/// Dedups against existing substituted-refined carriers in the Dag -/// before allocating — at fixpoint iteration N+1, if iteration N -/// already produced a carrier for this (template, subst), the scan -/// finds it and no new allocation happens. -/// -/// Fail-closed per C-8: substrate-integrity violations register -/// diagnostics rather than silently degrading to the template carrier. -fn materialize_substituted_refined_decl( - dag: &mut Dag, - template_refined: DeclarationId, - subst: &SubstStack, -) -> DeclarationId { - // Dedup: if a matching substituted-refined carrier already exists - // (e.g., from an earlier fixpoint iteration), reuse it. - if let Some(existing) = find_equivalent_substituted_refined_decl(dag, template_refined, subst) { - return existing; - } - - let template_decl = dag.declaration(template_refined).clone(); - let Some(template_pred_decl_id) = template_decl.refinement else { - // Caller (concretize_decl_with_subst's refinement branch) checks - // `decl.refinement.is_some()` before entering. Reaching this - // point means the caller contract was violated — surface that - // rather than masking it with a silent fallthrough. - unreachable!( - "materialize_substituted_refined_decl entered on declaration {:?} without refinement edge", - template_refined - ); - }; - let TypeConnective::Atom( - AtomPayload::ResolvedByStructure(template_base) - | AtomPayload::ResolvedByName(template_base), - ) = template_decl.connective - else { - // Caller also checks `refinement_base_requires_substitution`, - // whose first step returns false for any connective other than - // `Atom(ResolvedIdentifier(_))`. Reaching this point means the - // caller contract was violated. - unreachable!( - "materialize_substituted_refined_decl entered on declaration {:?} whose connective is not Atom(ResolvedIdentifier(_))", - template_refined - ); - }; - let template_span = template_decl.span.clone(); - - // Step 1: resolve the substituted base. - let Some(substituted_base) = resolve_decl_with_subst(dag, template_base, subst, 0) else { - dag.attach_diagnostic(Diagnostic::ResolveError { - name: "refined-generic substitution: substituted base did not resolve".to_string(), - span: template_span.clone(), - correction: Correction::deferred_for_diagnostic_class("InferenceDiagnostic"), - }); - return template_refined; - }; - - // Step 2: extract original predicate slots. - let Some((original_param_port, original_body_port)) = - outer_predicate_slots(dag, template_pred_decl_id) - else { - let pred_span = dag.declaration(template_pred_decl_id).span.clone(); - dag.attach_diagnostic(Diagnostic::ResolveError { - name: "refined-generic substitution: malformed predicate shape".to_string(), - span: pred_span, - correction: Correction::deferred_for_diagnostic_class("InferenceDiagnostic"), - }); - return template_refined; - }; - - // Step 3: allocate fresh composite param port typed as substituted base. - let fresh_param_port = dag.alloc_port(None); - dag.set_port_type(fresh_param_port, TypeShape::new(substituted_base)); - - // Step 4: clone the predicate body, routing Transform targets - // through the active substitution stack. - let Some(cloned_body_port) = clone_predicate_body( - dag, - original_body_port, - original_param_port, - fresh_param_port, - subst, - 0, - ) else { - dag.attach_diagnostic(Diagnostic::ResolveError { - name: "refined-generic substitution: out-of-fragment predicate body reached materialization" - .to_string(), - span: template_span.clone(), - correction: Correction::deferred_for_diagnostic_class("InferenceDiagnostic"), - }); - return template_refined; - }; - - // Step 5: wrap cloned body in a fresh Bind. - let bind_id = dag.alloc_node_id(); - dag.push_node(Behavior::Bind(BindNode { - id: bind_id, - name: "".to_string(), - value: cloned_body_port, - params: vec![fresh_param_port], - span: template_span.clone(), - lane2_workflow: None, - emit_participation: None, - })); - - // Step 5 (cont.): build the fresh predicate-Arrow Declaration. - // Inherit the original predicate's output type (Bool) — reading it - // from the original Arrow keeps this module independent of the - // Bool-decl lookup pattern `lower_parameter_refinement` uses. - let TypeConnective::Arrow { - output: bool_decl_id, - .. - } = &dag.declaration(template_pred_decl_id).connective - else { - // `outer_predicate_slots` rejected non-Arrow predicates at - // step 2 above; reaching this point means the predicate - // declaration's connective mutated between step 2 and step 5, - // which is impossible under `&mut Dag` exclusive access. - unreachable!( - "predicate declaration {:?} connective is not Arrow despite outer_predicate_slots succeeding", - template_pred_decl_id - ); - }; - let bool_decl_id = *bool_decl_id; - - let fresh_pred_decl_id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: fresh_pred_decl_id, - name: None, - connective: TypeConnective::Arrow { - inputs: vec![substituted_base], - output: bool_decl_id, - body: ArrowBody::UserDefined( - BindNodeId::from_bind_node(dag, bind_id) - .expect("UserDefined Arrow body bind id must point at a Bind"), - ), - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: template_span.clone(), - }); - - // Step 6: allocate the substituted-refined carrier Declaration. - let fresh_refined_id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: fresh_refined_id, - name: None, - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(substituted_base)), - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(fresh_pred_decl_id), - nominal_opacity: None, - span: template_span, - }); - - fresh_refined_id -} - -/// DB-16 (3a.3 closure): read-only lookup used by both -/// `concretize_decl_with_subst` (pre-allocation dedup) and -/// `signature_type_shape` (consumer-side lookup gate). -/// -/// Given a template refined carrier and an active substitution, scans -/// `dag.declarations()` for an already-materialized substituted-refined -/// carrier whose base matches the substituted base AND whose predicate -/// body walks structurally equal to what cloning the template's body -/// with the given subst WOULD produce. Mirrors -/// `find_equivalent_anonymous_instantiation`'s dedup pattern. -/// -/// Pure read; no allocation. `&Dag`. -fn find_equivalent_substituted_refined_decl( - dag: &Dag, - template_refined: DeclarationId, - subst: &SubstStack, -) -> Option { - let template_decl = dag.declaration(template_refined); - let TypeConnective::Atom( - AtomPayload::ResolvedByStructure(template_base) - | AtomPayload::ResolvedByName(template_base), - ) = &template_decl.connective - else { - return None; - }; - let template_pred_id = template_decl.refinement?; - - let substituted_base = resolve_decl_with_subst(dag, *template_base, subst, 0)?; - if substituted_base == *template_base { - return None; - } - - let (template_param, template_body) = outer_predicate_slots(dag, template_pred_id)?; - - for decl in dag.declarations() { - if decl.name.is_some() { - continue; - } - if decl.id == template_refined { - continue; - } - let TypeConnective::Atom( - AtomPayload::ResolvedByStructure(cand_base) | AtomPayload::ResolvedByName(cand_base), - ) = &decl.connective - else { - continue; - }; - if *cand_base != substituted_base { - continue; - } - let Some(cand_pred_id) = decl.refinement else { - continue; - }; - let Some((cand_param, cand_body)) = outer_predicate_slots(dag, cand_pred_id) else { - continue; - }; - if predicate_bodies_equal_under_subst( - dag, - cand_body, - cand_param, - template_body, - template_param, - subst, - 0, - ) { - return Some(decl.id); - } - } - None -} - -/// DB-16 (3a.3 closure): lockstep structural equality on two predicate -/// bodies, threading the active substitution stack through the -/// template side's Transform target decl-level references. Used by -/// `find_equivalent_substituted_refined_decl` to compare a candidate -/// materialized body against what cloning the template would produce. -/// -/// Pure read; walks Value/Transform nodes, treats the parameter-slot -/// on each side as equivalent. Mirrors `clone_predicate_body`'s shape -/// exactly so the comparison is faithful to what cloning emits. -fn predicate_bodies_equal_under_subst( - dag: &Dag, - cand_port: PortId, - cand_param: PortId, - template_port: PortId, - template_param: PortId, - subst: &SubstStack, - depth: usize, -) -> bool { - if depth >= WALK_DEPTH_LIMIT { - return false; - } - let cand_is_param = cand_port == cand_param; - let template_is_param = template_port == template_param; - if cand_is_param != template_is_param { - return false; - } - if cand_is_param { - return true; - } - - let cand_node_id = dag.port(cand_port).produced_by; - let template_node_id = dag.port(template_port).produced_by; - match (cand_node_id, template_node_id) { - (None, None) => cand_port == template_port, - (Some(cand_id), Some(template_id)) => match (dag.node(cand_id), dag.node(template_id)) { - (Behavior::Value(cand_v), Behavior::Value(template_v)) => { - cand_v.data == template_v.data - } - (Behavior::Transform(cand_t), Behavior::Transform(template_t)) => { - if !transform_targets_equal_under_subst( - dag, - &cand_t.target, - &template_t.target, - subst, - ) { - return false; - } - if cand_t.inputs.len() != template_t.inputs.len() { - return false; - } - cand_t - .inputs - .iter() - .zip(template_t.inputs.iter()) - .all(|(c, t)| { - predicate_bodies_equal_under_subst( - dag, - *c, - cand_param, - *t, - template_param, - subst, - depth + 1, - ) - }) - } - _ => false, - }, - _ => false, - } -} - -fn transform_targets_equal_under_subst( - dag: &Dag, - cand: &TransformTarget, - template: &TransformTarget, - subst: &SubstStack, -) -> bool { - match (cand, template) { - (TransformTarget::Operator(a), TransformTarget::Operator(b)) => a == b, - (TransformTarget::Callable(cand_id), TransformTarget::Callable(template_id)) => { - callable_decls_equal_under_subst(dag, *cand_id, *template_id, subst) - } - ( - TransformTarget::UnresolvedFieldProject { - field_label: cand_label, - }, - TransformTarget::UnresolvedFieldProject { - field_label: template_label, - }, - ) => cand_label == template_label, - ( - TransformTarget::ResolvedFieldProject { - field_label: cand_label, - }, - TransformTarget::ResolvedFieldProject { - field_label: template_label, - }, - ) => cand_label == template_label, - _ => false, - } -} - -/// DB-16 (3a.3 closure): structural equivalence between two declaration -/// references under an active substitution stack. Used by -/// `transform_targets_equal_under_subst` to compare Callable / -/// FieldProject target decl-level references when one side is a -/// template-context Instantiation (possibly carrying extra bindings -/// for outer TypeParams) and the other is a concrete site -/// Instantiation (only bindings for the callee's own TypeParams). -/// -/// Strategy: normalize both sides to their template-own-type-param -/// bindings (filtering out substitution-stack artifacts from the -/// template side), resolve through the subst stack on the template -/// side, then compare. Falls back to -/// `declaration_shapes_equivalent` when either side isn't an -/// Instantiation (direct decl id match). -fn callable_decls_equal_under_subst( - dag: &Dag, - cand_id: DeclarationId, - template_id: DeclarationId, - subst: &SubstStack, -) -> bool { - if cand_id == template_id { - return true; - } - // Fast path: resolve template through subst and compare directly. - let template_resolved = - resolve_decl_with_subst(dag, template_id, subst, 0).unwrap_or(template_id); - if cand_id == template_resolved - || declaration_shapes_equivalent(dag, cand_id, template_resolved, 0) - { - return true; - } - // Fallback: both are Instantiations, compare by template own-type-params. - let (Some(cand_norm), Some(template_norm)) = ( - normalized_instantiation_args(dag, cand_id), - normalized_instantiation_args(dag, template_id), - ) else { - return false; - }; - if cand_norm.template != template_norm.template { - return false; - } - if cand_norm.args.len() != template_norm.args.len() { - return false; - } - cand_norm - .args - .iter() - .zip(template_norm.args.iter()) - .all(|(c_arg, t_arg)| { - c_arg.parameter == t_arg.parameter && { - let t_val = - resolve_decl_with_subst(dag, t_arg.value, subst, 0).unwrap_or(t_arg.value); - c_arg.value == t_val || declaration_shapes_equivalent(dag, c_arg.value, t_val, 0) - } - }) -} - -struct NormalizedInstantiation { - template: DeclarationId, - args: Vec, -} - -/// DB-16 (3a.3 closure): normalize an `Instantiation` declaration by -/// stripping **only** self-bindings (`arg.parameter == arg.value`). -/// -/// Self-bindings are reattachment artifacts produced by -/// `resolve_callable_target`'s unification when a generic call site -/// is encountered under an outer generic scope: the outer TypeParam -/// binds to itself in the callee's argument list because no concrete -/// value has been inferred yet. Those self-bindings are no-op under -/// substitution (`SubstStack::lookup` short-circuits to `None` on -/// them) but inflate argument-length comparisons in strict -/// structural checks. -/// -/// Non-self bindings are NEVER stripped: retained callable-argument -/// identities (per `retained_template_arguments_for_target`) carry -/// semantic meaning that must survive DB-16's equivalence walk. Two -/// Instantiations that differ only by a non-self retained binding -/// are structurally distinct and must compare unequal. -fn normalized_instantiation_args( - dag: &Dag, - decl: DeclarationId, -) -> Option { - match normalize_instantiation_arguments(&dag.declaration(decl).connective) { - NormalizedInstantiationArgs::NotInstantiation => None, - NormalizedInstantiationArgs::Normalized { template, args } => { - Some(NormalizedInstantiation { template, args }) - } - } -} - -fn find_equivalent_anonymous_conj(dag: &Dag, children: &[Field]) -> Option { - dag.declarations().iter().find_map(|decl| { - if decl.name.is_some() { - return None; - } - let TypeConnective::Conj { children: existing } = &decl.connective else { - return None; - }; - (existing.len() == children.len() - && existing - .iter() - .zip(children.iter()) - .all(|(lhs, rhs)| lhs.label == rhs.label && lhs.ty == rhs.ty)) - .then_some(decl.id) - }) -} - -fn find_equivalent_anonymous_instantiation( - dag: &Dag, - template: DeclarationId, - arguments: &[TemplateArgument], - nominal_opacity: Option<&NominalOpacity>, -) -> Option { - dag.declarations().iter().find_map(|decl| { - if decl.name.is_some() { - return None; - } - let TypeConnective::Instantiation { - template: existing_template, - arguments: existing_arguments, - } = &decl.connective - else { - return None; - }; - (template == *existing_template - && decl.nominal_opacity.as_ref() == nominal_opacity - && matches!( - generated_template_arguments_match(existing_arguments, arguments), - TemplateArgumentsMatch::Match, - )) - .then_some(decl.id) - }) -} - -fn find_equivalent_anonymous_cardinality( - dag: &Dag, - element: DeclarationId, - bound: &crate::dag::CardinalityBound, -) -> Option { - dag.declarations().iter().find_map(|decl| { - if decl.name.is_some() { - return None; - } - let TypeConnective::Cardinality(existing) = &decl.connective else { - return None; - }; - (element == existing.element() && existing.bound() == *bound).then_some(decl.id) - }) -} - -enum FieldProjectResolution { - Retry, - Fail(Box), - Resolved { output_ty: TypeShape }, -} - -impl FieldProjectResolution { - fn fail(diagnostic: Diagnostic) -> Self { - Self::Fail(Box::new(diagnostic)) - } -} - -fn resolve_field_project( - dag: &Dag, - t: &TransformNode, - field_label: &str, -) -> FieldProjectResolution { - if t.inputs.len() != 1 { - return FieldProjectResolution::fail(Diagnostic::ArityMismatch { - function: format!(".{field_label}"), - expected: 1, - actual: t.inputs.len(), - span: t.span.clone(), - correction: Correction::deferred_for_diagnostic_class("InferenceDiagnostic"), - }); - } - - let input_ty = match dag.port(t.inputs[0]).state() { - PortState::Uninferred => return FieldProjectResolution::Retry, - PortState::Unresolved => { - return FieldProjectResolution::fail(Diagnostic::ResolveError { - name: format!("(upstream failure in field `{field_label}`)"), - span: t.span.clone(), - correction: Correction::deferred_for_diagnostic_class("InferenceDiagnostic"), - }) - } - PortState::Resolved(ty) => *ty, - }; - - let mut subst = SubstStack::new(); - if let Some(opaque_decl) = first_nominal_opaque_on_conj_walk(dag, input_ty.declaration, &subst) - { - return FieldProjectResolution::fail(Diagnostic::NominalOpacityViolation { - declaration: opaque_decl, - accessor: None, - span: t.span.clone(), - correction: Correction::deferred_for_diagnostic_class("InferenceDiagnostic"), - }); - } - let Some(actual_conj_id) = walk_to_conj_decl_with_subst(dag, input_ty.declaration, &mut subst) - else { - return FieldProjectResolution::fail(Diagnostic::ResolveError { - name: format!( - "field `{field_label}` cannot be projected from `{}` because it does not walk to a Conj type", - target_display_name(dag, input_ty.declaration), - ), - span: t.span.clone(), - correction: Correction::deferred_for_diagnostic_class("InferenceDiagnostic"), - }); - }; - - let children = match &dag.declaration(actual_conj_id).connective { - TypeConnective::Conj { children } => children, - _ => unreachable!("walk_to_conj_decl returned a non-Conj declaration"), - }; - let Some(field_decl_id) = children - .iter() - .find(|field| field.label == field_label) - .map(|field| field.ty) - else { - let field_start = t.span.byte_end.saturating_sub(field_label.len() as u32); - let correction = match children.as_slice() { - [field] => Correction::live( - format!("did you mean field `{}`?", field.label), - SourceSpan::new(t.span.file.clone(), field_start, t.span.byte_end), - field.label.clone(), - ), - fields => { - let candidates = fields - .iter() - .map(|field| field.label.as_str()) - .collect::>() - .join(", "); - Correction::deferred( - format!( - "field `{field_label}` has multiple valid replacements: {candidates}" - ), - "R3 Gap 9 row #106 field-choice correction workflow", - "model structured alternative corrections so each candidate can be surfaced without choosing arbitrarily", - ) - } - }; - return FieldProjectResolution::fail(Diagnostic::ResolveError { - name: format!( - "field `{field_label}` does not exist on `{}`", - target_display_name(dag, input_ty.declaration), - ), - span: t.span.clone(), - correction, - }); - }; - let Some(output_ty) = walk_to_type_shape(dag, field_decl_id, &subst, 0) else { - return FieldProjectResolution::fail(Diagnostic::ResolveError { - name: format!( - "field `{field_label}` on `{}` does not resolve to a port type", - target_display_name(dag, input_ty.declaration), - ), - span: t.span.clone(), - correction: Correction::deferred_for_diagnostic_class("InferenceDiagnostic"), - }); - }; - - FieldProjectResolution::Resolved { output_ty } -} - -fn first_nominal_opaque_on_conj_walk( - dag: &Dag, - start: DeclarationId, - subst: &SubstStack, -) -> Option { - let mut subst = subst.clone(); - match walk_to_conj_decl_with_subst_or_opacity(dag, start, &mut subst, true) { - ConjWalkResult::NominalOpaque(id) => Some(id), - ConjWalkResult::Conj(_) | ConjWalkResult::NoConj => None, - } -} - -fn decide_field_project(dag: &Dag, t: &TransformNode, field_label: &str) -> Decision { - match resolve_field_project(dag, t, field_label) { - FieldProjectResolution::Retry => Decision::Retry, - FieldProjectResolution::Fail(diag) => Decision::fail(t.output, *diag), - FieldProjectResolution::Resolved { output_ty, .. } => Decision::Set(t.output, output_ty), - } -} - -fn resolve_field_project_targets(dag: &mut Dag) -> bool { - let mut rewrites: Vec<(usize, String)> = Vec::new(); - for (node_index, node) in dag.nodes().iter().enumerate() { - let Behavior::Transform(t) = node else { - continue; - }; - let TransformTarget::UnresolvedFieldProject { field_label } = &t.target else { - continue; - }; - let FieldProjectResolution::Resolved { .. } = resolve_field_project(dag, t, field_label) - else { - continue; - }; - rewrites.push((node_index, field_label.clone())); - } - - let mut changed = false; - for (node_index, field_label) in rewrites { - let Behavior::Transform(t) = &mut dag.nodes_mut()[node_index] else { - continue; - }; - let target = &mut t.target; - let TransformTarget::UnresolvedFieldProject { .. } = target else { - continue; - }; - *target = TransformTarget::ResolvedFieldProject { field_label }; - changed = true; - } - changed -} - -const WALK_DEPTH_LIMIT: usize = 32; -/// §8.9 operator dispatch via structural algebra walk. -/// -/// Walks the LHS type's declaration chain (following `Instantiation` -/// and `ResolvedIdentifier` edges) until it reaches an algebra -/// `Conj` declaration, then looks up the operator's field by name -/// (via `OperatorKind::algebra_field_name`). The field's Arrow -/// signature is read from the declaration graph — the compiler -/// consumes `std/algebra.dag` as authority rather than fabricating -/// signatures in Rust. -/// -/// **Receiver substitution rule.** The algebra's first type -/// parameter is the "receiver" — it represents "the inhabitant of -/// this algebra." When the algebra field's Arrow has `(T, T) -> T`, -/// the resolved signature substitutes `T → source_id` (the user's -/// `lhs_type` declaration, e.g., `Int`), not `T → Word64` (the -/// algebra instantiation's template argument). This keeps port -/// types consistent with user-facing primitives. Non-receiver -/// positions (`Bool` in the comparison arrows, `Ordering` in -/// `compare`) stay as-is. -/// -/// **Current coverage.** Works for scalar algebras whose receiver -/// is the first type parameter used directly: `OrderedRing`, -/// `Ring`, `Semiring`, `Field`, `Lattice`, -/// `BooleanAlgebra`. This is sufficient for `Int`, `Float`, and -/// any user type that aliases an `OrderedRing`/`Ring`/`Field` -/// instantiation. -/// -/// **Not yet covered** (tracked in DOWNSTREAM_REQUIREMENTS.md as -/// class-5 gaps): -/// - `Bool`: ~~no structural link~~ now uses `Declaration.inhabits` on -/// the kernel `Bool` sum in `dsl/std/types.dag`, populated when lowering -/// the sum (`crate::lower::wire_kernel_bool_boolean_algebra_inhabits`) so v2 -/// keeps a plain `type Bool = True | False` surface. The walk follows -/// `Declaration.inhabits` when the connective chain hits a `Disj` -/// without an inline algebra. -/// - `String` / collection-level algebras whose receiver is -/// `FreeMonoid` / `Set` / `Map` (the whole -/// instantiation, not just `T`): needs a refinement to the -/// substitution rule. -/// -/// For those cases the resolver falls back to a Rust-side bridge -/// with a `(T, T) -> T` / `(T, T) -> Bool` signature. The fallback -/// is explicit about being a scaffold (see OperatorKind's -/// dissolution receipt). -/// -/// **Dedup invariant:** anonymous `Result<…, DivError>` instantiations -/// must reuse `find_equivalent_anonymous_instantiation` on every pass; -/// a missed structural match would mint fresh `DeclarationId`s each -/// iteration and the fixpoint loop would not terminate. -fn div_total_result_output_shape(dag: &mut Dag, base_lhs: TypeShape) -> Option { - let result_template = canonical_result_decl(dag)?.id; - let div_error = canonical_div_error_decl(dag)?.id; - let (t_ok, t_err, span) = { - let rdecl = dag.declaration(result_template); - ( - rdecl.type_params.first().copied()?, - rdecl.type_params.get(1).copied()?, - rdecl.span.clone(), - ) - }; - let args = vec![ - TemplateArgument { - parameter: t_ok, - value: base_lhs.declaration, - }, - TemplateArgument { - parameter: t_err, - value: div_error, - }, - ]; - if let Some(existing) = - find_equivalent_anonymous_instantiation(dag, result_template, &args, None) - { - return Some(TypeShape::new(existing)); - } - let id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id, - name: None, - connective: TypeConnective::Instantiation { - template: result_template, - arguments: args, - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span, - }); - Some(TypeShape::new(id)) -} - -fn resolve_operator_arrow( - dag: &mut Dag, - op_kind: OperatorKind, - lhs_type: &TypeShape, -) -> Option { - // DB-11 (3a.3) operand normalization. Primitive operators (`+`, - // `>`, `!=`, etc.) are structurally over BASE types — refinements - // are surface-level facts about values, not part of the operator's - // arrow contract. Mirroring a refined lhs like `Int where d != 0` - // onto both operand positions (as the old fallback did) made the - // call-site refinement-discharge pass treat the refinement as a - // real requirement on every operand — so a literal `10` in - // `d > 10` failed discharge because literals carry no refinement. - // Strip refinements once up front; algebra-Conj walks and the - // primitive fallback both operate on the base. - let source_id = strip_refinement_to_base(dag, lhs_type.declaration); - let base_lhs = TypeShape::new(source_id); - // Walk the source type's declaration chain to find the algebra - // Conj. We follow Instantiation/ResolvedIdentifier edges; at - // each step the template argument bindings are intentionally - // discarded — see the receiver substitution rule in the doc - // comment. - let mut current = source_id; - let mut saw_algebra_conj = false; - for _ in 0..WALK_DEPTH_LIMIT { - let decl = dag.declaration(current).clone(); - match &decl.connective { - TypeConnective::Conj { children } => { - saw_algebra_conj = true; - // Found the algebra. Look up the operator's field by - // name. - let field_name = crate::operators::algebra_field_name(op_kind); - if let Some(field) = children.iter().find(|f| f.label == field_name) { - return read_algebra_field(dag, &decl, field.ty, source_id, op_kind, &base_lhs); - } - // Algebra doesn't declare this operator's field — - // fall back to the Rust-side scaffold bridge below. - break; - } - TypeConnective::Instantiation { template, .. } => { - current = *template; - } - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - current = *next; - } - // Terminal connectives: try `Declaration.inhabits` (e.g. Bool - // → BooleanAlgebra) before giving up. - TypeConnective::Atom(AtomPayload::UnresolvedIdentifier(_)) - | TypeConnective::Atom(AtomPayload::TypeParam(_)) - | TypeConnective::Atom(AtomPayload::Literal(_)) - | TypeConnective::Disj { .. } - | TypeConnective::Arrow { .. } - | TypeConnective::Cardinality(_) => { - if let Some(inh) = decl.inhabits { - current = inh; - } else { - break; - } - } - } - } - // Fallback: Rust-side scaffold bridge for primitives whose - // structural walk doesn't terminate at an algebra Conj (Bool, - // Classical; collection-level algebras). Documented class-5 gap. - // - // Logical operators are Bool-monomorphic: both operands and the - // output are always Bool, independent of `lhs_type`. An Int lhs - // on `&&` / `||` must surface a type mismatch, not propagate - // through the operand slots the way Arithmetic / Comparison do. - // - // Fail-closed for LHS that the walk never reached any Conj for: - // every loop exit saw a terminal connective with no `inhabits`, - // an Arrow / Disj / Cardinality with no `inhabits`, or depth - // exhaustion. The pre-fix fallback fabricated `(T,T)->T` / - // `(T,T)->Bool` / `(Bool,Bool)->Bool` / `(T,T)->Result` - // for any such LHS — inventing an arrow contract for a type that - // declares none. Refuse synthesis here so the caller surfaces a - // typed unsupported-operator diagnostic. The Conj-reached-but- - // missing-field path (`saw_algebra_conj == true`) keeps its - // existing scaffold; tightening that further (distinguishing - // algebra carriers from arbitrary product structs) requires a - // structural signal beyond "is a Conj" — see PR #1329 STOP+PING. - if !saw_algebra_conj { - return None; - } - let (inputs, output) = match op_kind { - // Division leaves the class-5 scaffold: total shape matches algebra `div`. - OperatorKind::Arithmetic(ArithmeticOp::Div) => ( - vec![base_lhs, base_lhs], - div_total_result_output_shape(dag, base_lhs)?, - ), - OperatorKind::Arithmetic(_) => (vec![base_lhs, base_lhs], base_lhs), - OperatorKind::Comparison(_) => (vec![base_lhs, base_lhs], dag.bool_shape()?), - OperatorKind::Logical(_) => { - let bool_shape = dag.bool_shape()?; - (vec![bool_shape, bool_shape], bool_shape) - } - }; - Some(ResolvedArrow { - inputs, - output, - body: ArrowBody::Pending, - }) -} - -/// DB-11 (3a.3) refinement-strip helper. Walks the -/// `Atom(ResolvedIdentifier(...))` chain, skipping past any -/// declaration that carries a `refinement` edge, until it reaches a -/// declaration with no refinement. Used by `resolve_operator_arrow` -/// to normalize primitive-operator inputs to their base types — -/// refinements are surface-level facts about values, not part of an -/// operator's arrow contract. -/// -/// Also used by [`crate::emit::operator_carrier_realization`] so emit -/// and infer share one refinement-stripping rule (no drift). -/// -/// Terminates at the first un-refined declaration OR when the chain -/// can no longer be followed (any non-ResolvedIdentifier connective). -/// Depth-bounded by `WALK_DEPTH_LIMIT`. -pub(crate) fn strip_refinement_to_base(dag: &Dag, decl_id: DeclarationId) -> DeclarationId { - let mut current = decl_id; - for _ in 0..WALK_DEPTH_LIMIT { - let decl = dag.declaration(current); - if decl.refinement.is_none() { - return current; - } - match &decl.connective { - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - current = *next; - } - _ => return current, - } - } - current -} - -/// Read an algebra field's Arrow signature and substitute the -/// algebra's receiver type parameter to the source declaration. -/// -/// The algebra field `field_ty` points at an Arrow declaration -/// emitted by `type_to_declaration_id` when lowering the algebra's -/// record type (e.g., `OrderedRing`'s `add: fn(T, T) -> T`). -/// The Arrow's input/output DeclarationIds reference the algebra's -/// receiver type parameter directly. Substitution replaces those -/// references with `source_id`; non-receiver positions walk to -/// their named anchor via the same walk `walk_to_type_shape` does. -fn read_algebra_field( - dag: &mut Dag, - algebra_decl: &crate::dag::Declaration, - field_ty: DeclarationId, - source_id: DeclarationId, - op_kind: OperatorKind, - lhs_type: &TypeShape, -) -> Option { - // The algebra's first type parameter is the receiver. For - // `OrderedRing` this is T's DeclarationId. - let receiver_param = algebra_decl.type_params.first().copied(); - // Unwrap the field's connective to the underlying Arrow. The - // field declaration was emitted by `type_to_declaration_id`'s - // Arrow arm as `TypeConnective::Arrow { inputs, output, body }`. - let field_decl = dag.declaration(field_ty); - let (arrow_inputs, arrow_output, arrow_body) = match &field_decl.connective { - TypeConnective::Arrow { - inputs, - output, - body, - } => (inputs.clone(), *output, body.clone()), - // Algebra field that isn't an Arrow (e.g., the `zero: T` - // constant). Not a callable operator — fall back. - _ => return None, - }; - // Translate each input / output DeclarationId through the - // receiver-substitution rule. - let input_shapes: Vec = arrow_inputs - .iter() - .map(|id| substitute_receiver(dag, *id, receiver_param, source_id).map(TypeShape::new)) - .collect::>()?; - let output_shape = - substitute_receiver(dag, arrow_output, receiver_param, source_id).map(TypeShape::new)?; - // Sanity check: the arity is always 2 for binary operators. - // If algebra.dag ever declares a field under one of our - // operator names with a different arity, the check downstream - // in `decide_transform` catches the mismatch as a - // `Diagnostic::ArityMismatch`, but we also want to preserve - // `lhs_type` in the signature as a debug fallback if the walk - // succeeds but the shape is unexpectedly wrong. - let _ = lhs_type; - let _ = op_kind; - Some(ResolvedArrow { - inputs: input_shapes, - output: output_shape, - body: arrow_body, - }) -} - -/// Substitute a declaration id through the receiver-substitution -/// rule: if the id matches the algebra's receiver type parameter, -/// return the source type; otherwise walk to the nearest named -/// declaration (same model as `walk_to_type_shape` but with the -/// receiver case short-circuited). -fn substitute_receiver( - dag: &mut Dag, - current: DeclarationId, - receiver_param: Option, - source_id: DeclarationId, -) -> Option { - if Some(current) == receiver_param { - return Some(source_id); - } - let decl = dag.declaration(current).clone(); - match &decl.connective { - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - substitute_receiver(dag, *next, receiver_param, source_id) - } - TypeConnective::Instantiation { - template, - arguments, - } => { - let mut new_args: Vec = Vec::with_capacity(arguments.len()); - let mut any_change = false; - for arg in arguments { - let new_val = substitute_receiver(dag, arg.value, receiver_param, source_id)?; - if new_val != arg.value { - any_change = true; - } - new_args.push(TemplateArgument { - parameter: arg.parameter, - value: new_val, - }); - } - if !any_change { - return Some(current); - } - // Same dedup contract as `div_total_result_output_shape`: false negatives - // here allocate unbounded anonymous instantiations across fixpoint iterations. - if let Some(existing) = find_equivalent_anonymous_instantiation( - dag, - *template, - &new_args, - decl.nominal_opacity.as_ref(), - ) { - return Some(existing); - } - let id = dag.alloc_declaration_id(); - let span = decl.span.clone(); - dag.push_declaration(Declaration { - id, - name: None, - connective: TypeConnective::Instantiation { - template: *template, - arguments: new_args, - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: decl.nominal_opacity.clone(), - span, - }); - Some(id) - } - TypeConnective::Atom(AtomPayload::TypeParam(_)) - | TypeConnective::Atom(AtomPayload::UnresolvedIdentifier(_)) => None, - _ => { - if decl.name.is_some() { - Some(current) - } else { - None - } - } - } -} - -fn canonical_result_decl(dag: &Dag) -> Option<&Declaration> { - dag.declarations() - .iter() - .find(|decl| substrate_result_type_decl_suppressed_for_emit(dag, decl)) -} - -fn canonical_div_error_decl(dag: &Dag) -> Option<&Declaration> { - dag.declarations() - .iter() - .find(|decl| substrate_div_error_type_decl_suppressed_for_emit(dag, decl)) -} - -/// Dispatch-time invariant check on an `ExternalRealization` target: -/// the linked declaration must be a `Conj` with a non-`None` -/// `meta_tag` edge. The meta_tag IS the realization marker — no -/// further name/id comparison is required. -/// -/// **Round-10 correction.** Earlier revisions compared `meta_tag` -/// against a cached `Dag::realization_meta_id()` pointing at a -/// `Realization` declaration. Production bootstrap doesn't load a -/// `Realization` declaration (realization facts live in -/// `dsl/extdeps/languages/*` per the thesis, not in the std/ set -/// the M1(2.7) bootstrap consumes), so the cache was always `None` -/// and the check always failed. The shape check is now purely -/// structural: "Conj with a meta_tag" is the realization marker. -/// The structural shape is what `bootstrap::assert_realization_shape` -/// and the `#[cfg(test)]` realization smoke test already validate -/// at construction time. Any drift is caught at both construction -/// and dispatch. -fn is_realization_shape(dag: &Dag, realization_id: DeclarationId) -> bool { - let decl = dag.declaration(realization_id); - if !matches!(decl.connective, TypeConnective::Conj { .. }) { - return false; - } - decl.meta_tag.is_some() -} - -/// Substrate walk: given a DeclarationId, descend through -/// `Instantiation` (pushing subst frames), `Atom(Identifier { resolved -/// })` (following the link), and `Atom(TypeParam)` (looking up the -/// subst stack) until an `Arrow` is reached. At the Arrow, substitute -/// each input and output DeclarationId through the subst stack and -/// bridge to `TypeShape` via `walk_to_type_shape`. -fn resolve_arrow_walk( - dag: &Dag, - current: DeclarationId, - subst: &mut SubstStack, - depth: usize, -) -> Option { - if depth >= WALK_DEPTH_LIMIT { - return None; - } - let decl = dag.declaration(current); - match &decl.connective { - TypeConnective::Arrow { - inputs, - output, - body, - } => { - let mut input_shapes: Vec = Vec::new(); - for id in inputs { - if subst.lookup(*id).is_some() && declaration_is_callable(dag, *id, depth + 1) { - continue; - } - input_shapes.push(signature_type_shape(dag, *id, subst, depth + 1)?); - } - let output_shape = signature_type_shape(dag, *output, subst, depth + 1)?; - Some(ResolvedArrow { - inputs: input_shapes, - output: output_shape, - body: body.clone(), - }) - } - TypeConnective::Instantiation { - template, - arguments, - } => { - subst.push(arguments.clone()); - let result = resolve_arrow_walk(dag, *template, subst, depth + 1); - subst.pop(); - result - } - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - resolve_arrow_walk(dag, *next, subst, depth + 1) - } - // Terminal non-Arrow cases. Each is unreachable in well-formed - // user code; enumerated explicitly (rather than `_ => None`) so - // that any future `TypeConnective` or `AtomPayload` variant - // forces consideration here instead of silently falling through. - TypeConnective::Atom(AtomPayload::UnresolvedIdentifier(_)) => None, - TypeConnective::Atom(AtomPayload::TypeParam(_)) => None, - TypeConnective::Atom(AtomPayload::Literal(_)) => None, - TypeConnective::Conj { .. } => None, - TypeConnective::Disj { .. } => None, - TypeConnective::Cardinality(_) => None, - } -} - -/// Walk a type declaration down to a port-level `TypeShape`. -/// -/// `TypeShape` is a newtype around `DeclarationId` — port types ARE -/// declaration identities. The walk descends through anonymous -/// declarations until it finds a stable type identity: -/// -/// - named top-level declarations keep their own `DeclarationId` -/// - anonymous instantiations keep THEIR instantiation id so -/// `List` and bare `List` do not collapse to the same shape -/// - type params resolve through the substitution stack when bound -/// -/// There is no name-keyed bridge back to a coarse primitive tag — the -/// declaration graph IS the type identity. -fn walk_to_type_shape( - dag: &Dag, - current: DeclarationId, - subst: &SubstStack, - depth: usize, -) -> Option { - if depth >= WALK_DEPTH_LIMIT { - return None; - } - let decl = dag.declaration(current); - // Named top-level declaration: this is the port's type identity. - if decl.name.is_some() { - return Some(TypeShape::new(current)); - } - // Anonymous declaration: follow the chain through the substrate. - match &decl.connective { - TypeConnective::Atom(AtomPayload::TypeParam(_)) => { - if let Some(bound) = subst.lookup(current) { - walk_to_type_shape(dag, bound, subst, depth + 1) - } else { - Some(TypeShape::new(current)) - } - } - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - walk_to_type_shape(dag, *next, subst, depth + 1) - } - TypeConnective::Instantiation { .. } => { - resolve_decl_with_subst(dag, current, subst, depth + 1) - .map(TypeShape::new) - .or_else(|| Some(TypeShape::new(current))) - } - // Terminal non-follow cases. An anonymous `UnresolvedIdentifier` - // means the sweep did not resolve the reference — the phantom - // diagnostic is already attached, and this walk fails so the - // caller can surface it. Anonymous optionals still need port - // identities today because reflected substrate fields such as - // `DagPort.produced_by: NodeId?` are legal field-project outputs. - // The broader anonymous structural cases stay fail-closed until - // port-type extension work admits them deliberately. - // Enumerated explicitly (rather than `_ => None`) so any - // future variant forces consideration here. - TypeConnective::Atom(AtomPayload::UnresolvedIdentifier(_)) => None, - TypeConnective::Atom(AtomPayload::Literal(_)) => None, - TypeConnective::Conj { .. } => None, - TypeConnective::Disj { .. } => None, - TypeConnective::Arrow { .. } => None, - TypeConnective::Cardinality(_) => Some(TypeShape::new(current)), - } -} - -fn signature_type_shape( - dag: &Dag, - current: DeclarationId, - subst: &SubstStack, - depth: usize, -) -> Option { - if depth >= WALK_DEPTH_LIMIT { - return None; - } - let decl = dag.declaration(current); - if decl.name.is_some() { - return Some(TypeShape::new(current)); - } - // DB-16 (3a.3 closure): read-only lookup gate. When the refinement - // base requires substitution, check whether - // `materialize_callable_signature_instantiations` has already - // produced a substituted-refined carrier for this - // (template_refined, subst) combination. If so, return that - // carrier. Construction lives at the phase; this gate reads. - if decl.refinement.is_some() && refinement_base_requires_substitution(dag, current, subst) { - if let Some(materialized) = find_equivalent_substituted_refined_decl(dag, current, subst) { - return Some(TypeShape::new(materialized)); - } - // Lookup miss: the phase didn't materialize for this - // combination (TypeParam unbound at phase time, or call-site - // outside the phase walk). Fall through to the DB-11 - // identity-terminator; downstream `is_retryable_generic_decl` - // classifies as retry. - } - // DB-11 (3a.3): refinement-bearing declarations are identity - // terminators for signature walks. Without this, a refined param - // type `Int where d != 0` (connective: ResolvedIdentifier(Int), - // refinement: Some(pred)) would be walked to its base `Int`, and - // the call-site refinement-discharge check in `decide_transform` - // would never see the predicate edge on the callee side. - if decl.refinement.is_some() { - return Some(TypeShape::new(current)); - } - match &decl.connective { - TypeConnective::Instantiation { .. } => { - resolve_decl_with_subst(dag, current, subst, depth + 1) - .map(TypeShape::new) - .or_else(|| Some(TypeShape::new(current))) - } - TypeConnective::Atom(AtomPayload::TypeParam(_)) => { - if let Some(bound) = subst.lookup(current) { - signature_type_shape(dag, bound, subst, depth + 1) - } else { - Some(TypeShape::new(current)) - } - } - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - signature_type_shape(dag, *next, subst, depth + 1) - } - TypeConnective::Atom(AtomPayload::UnresolvedIdentifier(_)) => None, - TypeConnective::Atom(AtomPayload::Literal(_)) => None, - TypeConnective::Conj { .. } => None, - TypeConnective::Disj { .. } => None, - TypeConnective::Arrow { .. } => None, - // Cardinality-typed signatures (e.g., `fn port(d, id) -> DagPort?`) - // keep the anonymous Cardinality declaration id as the port's type - // identity. Mirrors `walk_to_type_shape`'s Cardinality case — - // optional returns are legal throughout the substrate. - TypeConnective::Cardinality(_) => Some(TypeShape::new(current)), - } -} - -fn resolve_decl_with_subst( - dag: &Dag, - current: DeclarationId, - subst: &SubstStack, - depth: usize, -) -> Option { - if depth >= WALK_DEPTH_LIMIT { - return None; - } - let decl = dag.declaration(current); - match &decl.connective { - TypeConnective::Atom(AtomPayload::TypeParam(_)) => subst - .lookup(current) - .and_then(|bound| resolve_decl_with_subst(dag, bound, subst, depth + 1)) - .or(Some(current)), - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - resolve_decl_with_subst(dag, *next, subst, depth + 1) - } - TypeConnective::Instantiation { - template, - arguments, - } => { - let specialized_arguments: Vec = arguments - .iter() - .map(|arg| { - Some(TemplateArgument { - parameter: arg.parameter, - value: resolve_decl_with_subst(dag, arg.value, subst, depth + 1)?, - }) - }) - .collect::>()?; - if specialized_arguments - .iter() - .zip(arguments.iter()) - .all(|(lhs, rhs)| lhs.parameter == rhs.parameter && lhs.value == rhs.value) - { - return Some(current); - } - find_equivalent_decl_instantiation(dag, *template, &specialized_arguments) - .or(Some(current)) - } - TypeConnective::Cardinality(p) => { - let element = p.element(); - let bound = p.bound(); - let specialized_element = resolve_decl_with_subst(dag, element, subst, depth + 1)?; - if bound == crate::dag::CardinalityBound::AtMostOne { - if let Some(idem) = - crate::dag::cardinality_idempotent_target(dag, specialized_element, bound) - { - return Some(idem); - } - } - if specialized_element == element { - return Some(current); - } - find_equivalent_decl_cardinality(dag, specialized_element, &bound).or(Some(current)) - } - _ => Some(current), - } -} - -fn find_equivalent_decl_instantiation( - dag: &Dag, - template: DeclarationId, - arguments: &[TemplateArgument], -) -> Option { - dag.declarations().iter().find_map(|decl| { - let TypeConnective::Instantiation { - template: existing_template, - arguments: existing_arguments, - } = &decl.connective - else { - return None; - }; - (template == *existing_template - && existing_arguments.len() == arguments.len() - && existing_arguments - .iter() - .zip(arguments.iter()) - .all(|(lhs, rhs)| lhs.parameter == rhs.parameter && lhs.value == rhs.value)) - .then_some(decl.id) - }) -} - -fn find_equivalent_decl_cardinality( - dag: &Dag, - element: DeclarationId, - bound: &crate::dag::CardinalityBound, -) -> Option { - dag.declarations().iter().find_map(|decl| { - let TypeConnective::Cardinality(existing) = &decl.connective else { - return None; - }; - (element == existing.element() && existing.bound() == *bound).then_some(decl.id) - }) -} - -/// Best-effort human-readable name for a Transform.target DeclarationId, -/// used in diagnostics. Walks through resolved Identifier atoms to find -/// something nameable. -fn target_display_name(dag: &Dag, target: DeclarationId) -> String { - let decl = dag.declaration(target); - if let Some(name) = &decl.name { - return name.clone(); - } - match &decl.connective { - TypeConnective::Atom(AtomPayload::UnresolvedIdentifier(name)) => name.clone(), - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - target_display_name(dag, *next) - } - _ => format!("declaration#{}", target.raw()), - } -} - -/// Best-effort human-readable name for a `TransformTarget`. Dispatches -/// on the variant: `Callable` goes through `target_display_name`, -/// `Operator` renders the source symbol directly. -fn transform_target_display_name(dag: &Dag, target: &TransformTarget) -> String { - match target { - TransformTarget::Callable(id) => target_display_name(dag, *id), - TransformTarget::UnresolvedFieldProject { field_label } => format!(".{field_label}"), - TransformTarget::ResolvedFieldProject { field_label } => format!(".{field_label}"), - TransformTarget::Operator(op_kind) => crate::operators::symbol(*op_kind), - } -} - -fn node_span_for_port(dag: &Dag, port: PortId) -> Option { - dag.port(port) - .produced_by - .map(|node_id| dag.node(node_id).span().clone()) -} - -fn synthetic_span() -> SourceSpan { - SourceSpan::new("", 0, 0) -} - -pub(crate) fn type_shapes_equivalent(dag: &Dag, lhs: &TypeShape, rhs: &TypeShape) -> bool { - if lhs == rhs { - return true; - } - declaration_shapes_equivalent(dag, lhs.declaration, rhs.declaration, 0) -} - -fn declaration_shapes_equivalent( - dag: &Dag, - lhs: DeclarationId, - rhs: DeclarationId, - depth: usize, -) -> bool { - if lhs == rhs { - return true; - } - if depth >= WALK_DEPTH_LIMIT { - return false; - } - let lhs_decl = dag.declaration(lhs); - let rhs_decl = dag.declaration(rhs); - match (&lhs_decl.connective, &rhs_decl.connective) { - ( - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)), - _, - ) => declaration_shapes_equivalent(dag, *next, rhs, depth + 1), - ( - _, - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)), - ) => declaration_shapes_equivalent(dag, lhs, *next, depth + 1), - ( - TypeConnective::Instantiation { - template: lhs_template, - arguments: lhs_arguments, - }, - TypeConnective::Instantiation { - template: rhs_template, - arguments: rhs_arguments, - }, - ) => { - declaration_shapes_equivalent(dag, *lhs_template, *rhs_template, depth + 1) - && phantom_arguments_equivalent_for_shape( - dag, - *lhs_template, - lhs_arguments, - *rhs_template, - rhs_arguments, - ) - && lhs_arguments.len() == rhs_arguments.len() - && lhs_arguments - .iter() - .zip(rhs_arguments.iter()) - .all(|(lhs_arg, rhs_arg)| { - declaration_shapes_equivalent(dag, lhs_arg.value, rhs_arg.value, depth + 1) - }) - } - (TypeConnective::Cardinality(lhs_p), TypeConnective::Cardinality(rhs_p)) => { - lhs_p.bound() == rhs_p.bound() - && declaration_shapes_equivalent(dag, lhs_p.element(), rhs_p.element(), depth + 1) - } - ( - TypeConnective::Conj { - children: lhs_children, - }, - TypeConnective::Conj { - children: rhs_children, - }, - ) => { - lhs_children.len() == rhs_children.len() - && lhs_children - .iter() - .zip(rhs_children.iter()) - .all(|(lhs_child, rhs_child)| { - lhs_child.label == rhs_child.label - && declaration_shapes_equivalent( - dag, - lhs_child.ty, - rhs_child.ty, - depth + 1, - ) - }) - } - ( - TypeConnective::Disj { - variants: lhs_variants, - }, - TypeConnective::Disj { - variants: rhs_variants, - }, - ) => { - lhs_variants.len() == rhs_variants.len() - && lhs_variants - .iter() - .zip(rhs_variants.iter()) - .all(|(lhs_variant, rhs_variant)| { - lhs_variant.label == rhs_variant.label - && declaration_shapes_equivalent( - dag, - lhs_variant.ty, - rhs_variant.ty, - depth + 1, - ) - }) - } - _ => false, - } -} - -fn phantom_arguments_equivalent_for_shape( - dag: &Dag, - lhs_template: DeclarationId, - lhs_arguments: &[TemplateArgument], - rhs_template: DeclarationId, - rhs_arguments: &[TemplateArgument], -) -> bool { - phantom_arguments_preserved_from_template( - dag, - lhs_template, - lhs_arguments, - rhs_template, - rhs_arguments, - ) && phantom_arguments_preserved_from_template( - dag, - rhs_template, - rhs_arguments, - lhs_template, - lhs_arguments, - ) -} - -fn phantom_arguments_preserved_from_template( - dag: &Dag, - source_template: DeclarationId, - source_arguments: &[TemplateArgument], - target_template: DeclarationId, - target_arguments: &[TemplateArgument], -) -> bool { - let source_decl = dag.declaration(source_template); - for phantom in &source_decl.phantom_params { - if require_abelian_group_phantom_algebra( - dag, - phantom.algebra, - phantom.parameter, - &synthetic_span(), - ) - .is_err() - { - return false; - } - let Some(target_phantom) = - mapped_phantom_parameter(dag, source_template, phantom, target_template) - else { - return false; - }; - if require_abelian_group_phantom_algebra( - dag, - target_phantom.algebra, - target_phantom.parameter, - &synthetic_span(), - ) - .is_err() - { - return false; - } - if !phantom_algebras_equivalent(dag, phantom.algebra, target_phantom.algebra) { - return false; - } - let Some(source_arg) = source_arguments - .iter() - .find(|arg| arg.parameter == phantom.parameter) - else { - return false; - }; - let Some(target_arg) = target_arguments - .iter() - .find(|arg| arg.parameter == target_phantom.parameter) - else { - return false; - }; - if source_arg.value != target_arg.value { - return false; - } - } - true -} - -#[cfg(test)] -mod bool_logical_operator_arrow_tests { - use super::*; - use crate::dag::PhantomParameter; - use crate::infer_helpers::filter_non_self_template_arguments; - use crate::operators::{ArithmeticOp, ComparisonOp}; - - #[test] - fn nominal_opaque_field_project_fails_closed_before_structural_descent() { - let mut dag = Dag::new(); - let span = SourceSpan::new("", 0, 1); - let int = dag.int_shape().expect("bootstrap Int").declaration; - - let payload = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: payload, - name: Some("OpaquePayload".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "value".to_string(), - ty: int, - }], - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - - let opaque = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: opaque, - name: Some("OpaqueWrapper".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(payload)), - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: Some(NominalOpacity { - permitted_accessors: Vec::new(), - }), - span: span.clone(), - }); - - let input = dag.alloc_port_with_shape(TypeShape::new(opaque)); - let output = dag.push_transform( - TransformTarget::UnresolvedFieldProject { - field_label: "value".to_string(), - }, - vec![input], - span, - ); - - infer(&mut dag); - - assert!(matches!( - dag.diagnostics().get(output), - Some(Diagnostic::NominalOpacityViolation { - declaration, - accessor: None, - .. - }) if *declaration == opaque - )); - assert!( - matches!(dag.port(output).state(), PortState::Unresolved), - "opacity violation must leave the projected output unresolved" - ); - } - - #[test] - fn nominal_opaque_field_project_preserves_instantiation_substitution() { - let mut dag = Dag::new(); - let span = SourceSpan::new("", 0, 1); - let int = dag.int_shape().expect("bootstrap Int").declaration; - - let payload = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: payload, - name: Some("SecretPayloadForSubst".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "value".to_string(), - ty: int, - }], - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - let secret = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: secret, - name: Some("SecretForSubst".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(payload)), - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: Some(NominalOpacity { - permitted_accessors: Vec::new(), - }), - span: span.clone(), - }); - let box_param = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: box_param, - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - let box_alias = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: box_alias, - name: Some("BoxAlias".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(box_param)), - type_params: vec![box_param], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - let boxed_secret = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: boxed_secret, - name: Some("BoxedSecret".to_string()), - connective: TypeConnective::Instantiation { - template: box_alias, - arguments: vec![TemplateArgument { - parameter: box_param, - value: secret, - }], - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - - let input = dag.alloc_port_with_shape(TypeShape::new(boxed_secret)); - let output = dag.push_transform( - TransformTarget::UnresolvedFieldProject { - field_label: "value".to_string(), - }, - vec![input], - span, - ); - - infer(&mut dag); - - assert!(matches!( - dag.diagnostics().get(output), - Some(Diagnostic::NominalOpacityViolation { - declaration, - accessor: None, - .. - }) if *declaration == secret - )); - } - - #[test] - fn field_project_without_nominal_opacity_remains_structural() { - let mut dag = Dag::new(); - let span = SourceSpan::new("", 0, 1); - let int = dag.int_shape().expect("bootstrap Int").declaration; - - let record = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: record, - name: Some("PlainPayload".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "value".to_string(), - ty: int, - }], - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - - let input = dag.alloc_port_with_shape(TypeShape::new(record)); - let output = dag.push_transform( - TransformTarget::UnresolvedFieldProject { - field_label: "value".to_string(), - }, - vec![input], - span, - ); - - infer(&mut dag); - - assert!( - dag.diagnostics().get(output).is_none(), - "plain structural projection should not emit opacity diagnostics" - ); - assert!(matches!( - dag.port(output).state(), - PortState::Resolved(shape) if shape.declaration == int - )); - } - - #[test] - fn bootstrapped_secret_is_marked_nominal_opaque() { - let dag = Dag::new(); - let secret = dag - .declaration_by_name("Secret") - .expect("bootstrap Secret declaration"); - assert!( - secret.nominal_opacity.is_some(), - "Secret must consume the nominal-opacity carrier before Modeling dispatch" - ); - } - - #[test] - fn arithmetic_on_non_algebra_lhs_fails_closed_instead_of_synthesizing_arrow() { - // Director audit (post-merge finding): pre-fix, when the - // structural walk in `resolve_operator_arrow` did not encounter - // any algebra Conj on the LHS (e.g. an Arrow / Disj / Atom with - // no `inhabits` link), the fallback fabricated `(T,T)->T` for - // arithmetic and `(T,T)->Bool` for comparison. That invented - // an operator-rule arrow contract for a type that declares - // none. With the fail-closed check in place, the resolver - // returns None so the call site emits a typed - // unsupported-operator diagnostic. - let mut dag = Dag::new(); - let span = SourceSpan::new("", 0, 1); - let int = dag.int_shape().expect("bootstrap Int").declaration; - - // A non-algebra LHS: an anonymous Arrow declaration. No - // `inhabits`, no Conj on the walk path. - let arrow_decl = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: arrow_decl, - name: None, - connective: TypeConnective::Arrow { - inputs: vec![int], - output: int, - body: ArrowBody::NoBody, - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - let lhs = TypeShape::new(arrow_decl); - - assert!( - resolve_operator_arrow(&mut dag, OperatorKind::Arithmetic(ArithmeticOp::Add), &lhs,) - .is_none(), - "`+` on a non-algebra LHS must fail-closed: the pre-fix \ - fallback fabricated `(Arrow,Arrow)->Arrow` instead of \ - surfacing an unsupported-operator diagnostic" - ); - assert!( - resolve_operator_arrow(&mut dag, OperatorKind::Comparison(ComparisonOp::Lt), &lhs,) - .is_none(), - "`<` on a non-algebra LHS must fail-closed: the pre-fix \ - fallback fabricated `(Arrow,Arrow)->Bool` instead of \ - surfacing an unsupported-operator diagnostic" - ); - assert!( - resolve_operator_arrow(&mut dag, OperatorKind::Arithmetic(ArithmeticOp::Div), &lhs,) - .is_none(), - "`/` on a non-algebra LHS must fail-closed: the pre-fix \ - Div fallback synthesized `(Arrow,Arrow)->Result`" - ); - assert!( - resolve_operator_arrow(&mut dag, OperatorKind::Logical(LogicalOp::And), &lhs,) - .is_none(), - "`&&` on a non-algebra LHS must fail-closed: the pre-fix \ - logical fallback produced `(Bool,Bool)->Bool` regardless \ - of LHS, inventing a carrier the type does not declare" - ); - } - - #[test] - fn bool_logical_and_resolves_via_boolean_algebra_meet_not_pending_fallback() { - let mut dag = Dag::new(); - let bool_shape = dag.bool_shape().expect("bootstrap Bool"); - let sig = - resolve_operator_arrow(&mut dag, OperatorKind::Logical(LogicalOp::And), &bool_shape) - .expect("&& should resolve on Bool"); - assert!( - !matches!(sig.body, ArrowBody::Pending), - "expected Bool && via inhabits → BooleanAlgebra.meet, not Pending scaffold; got {:?}", - sig.body - ); - assert_eq!(sig.inputs.len(), 2); - assert_eq!(sig.inputs[0].declaration, bool_shape.declaration); - assert_eq!(sig.inputs[1].declaration, bool_shape.declaration); - assert_eq!(sig.output.declaration, bool_shape.declaration); - } - - #[test] - fn bool_logical_or_resolves_via_boolean_algebra_join_not_pending_fallback() { - let mut dag = Dag::new(); - let bool_shape = dag.bool_shape().expect("bootstrap Bool"); - let sig = - resolve_operator_arrow(&mut dag, OperatorKind::Logical(LogicalOp::Or), &bool_shape) - .expect("|| should resolve on Bool"); - assert!( - !matches!(sig.body, ArrowBody::Pending), - "expected Bool || via inhabits → BooleanAlgebra.join, not Pending scaffold; got {:?}", - sig.body - ); - assert_eq!(sig.inputs.len(), 2); - assert_eq!(sig.inputs[0].declaration, bool_shape.declaration); - assert_eq!(sig.inputs[1].declaration, bool_shape.declaration); - assert_eq!(sig.output.declaration, bool_shape.declaration); - } - - #[test] - fn arithmetic_operator_checks_abelian_phantom_unit_closure_before_type_mismatch() { - let mut dag = Dag::new(); - let span = SourceSpan::new("", 0, 1); - let int = dag.int_shape().expect("bootstrap Int").declaration; - let abelian_group = dag - .declaration_by_name("AbelianGroup") - .expect("bootstrap AbelianGroup") - .id; - - let currency = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: currency, - name: Some("Currency".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - let usd = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: usd, - name: Some("USD".to_string()), - connective: TypeConnective::Instantiation { - template: currency, - arguments: vec![], - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - let eur = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: eur, - name: Some("EUR".to_string()), - connective: TypeConnective::Instantiation { - template: currency, - arguments: vec![], - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - let currency_abelian_group = dag.alloc_declaration_id(); - let abelian_receiver = dag - .declaration(abelian_group) - .type_params - .first() - .copied() - .expect("AbelianGroup receiver type parameter"); - dag.push_declaration(Declaration { - id: currency_abelian_group, - name: Some("CurrencyAbelianGroup".to_string()), - connective: TypeConnective::Instantiation { - template: abelian_group, - arguments: vec![TemplateArgument { - parameter: abelian_receiver, - value: currency, - }], - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - let int_abelian_group = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: int_abelian_group, - name: Some("IntAbelianGroup".to_string()), - connective: TypeConnective::Instantiation { - template: abelian_group, - arguments: vec![TemplateArgument { - parameter: abelian_receiver, - value: int, - }], - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - let money = dag.alloc_declaration_id(); - let c_param = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: money, - name: Some("Money".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "amount".to_string(), - ty: int, - }], - }, - type_params: vec![c_param], - phantom_params: vec![PhantomParameter { - parameter: c_param, - algebra: currency_abelian_group, - }], - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - dag.push_declaration(Declaration { - id: c_param, - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("C".to_string())), - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - - let money_usd = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: money_usd, - name: Some("MoneyUSD".to_string()), - connective: TypeConnective::Instantiation { - template: money, - arguments: vec![TemplateArgument { - parameter: c_param, - value: usd, - }], - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - let money_eur = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: money_eur, - name: Some("MoneyEUR".to_string()), - connective: TypeConnective::Instantiation { - template: money, - arguments: vec![TemplateArgument { - parameter: c_param, - value: eur, - }], - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - let money_c = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: money_c, - name: Some("MoneyC".to_string()), - connective: TypeConnective::Instantiation { - template: money, - arguments: vec![TemplateArgument { - parameter: c_param, - value: c_param, - }], - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - let alt_c_param = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: alt_c_param, - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("AltC".to_string())), - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - let alt_money = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: alt_money, - name: Some("AltMoney".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "amount".to_string(), - ty: int, - }], - }, - type_params: vec![alt_c_param], - phantom_params: vec![PhantomParameter { - parameter: alt_c_param, - algebra: currency_abelian_group, - }], - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - let alt_money_usd = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: alt_money_usd, - name: Some("AltMoneyUSD".to_string()), - connective: TypeConnective::Instantiation { - template: alt_money, - arguments: vec![TemplateArgument { - parameter: alt_c_param, - value: usd, - }], - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - let alt_money_eur = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: alt_money_eur, - name: Some("AltMoneyEUR".to_string()), - connective: TypeConnective::Instantiation { - template: alt_money, - arguments: vec![TemplateArgument { - parameter: alt_c_param, - value: eur, - }], - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - let other_algebra_money = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: other_algebra_money, - name: Some("OtherAlgebraMoney".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "amount".to_string(), - ty: int, - }], - }, - type_params: vec![alt_c_param], - phantom_params: vec![PhantomParameter { - parameter: alt_c_param, - algebra: int_abelian_group, - }], - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - let other_algebra_money_usd = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: other_algebra_money_usd, - name: Some("OtherAlgebraMoneyUSD".to_string()), - connective: TypeConnective::Instantiation { - template: other_algebra_money, - arguments: vec![TemplateArgument { - parameter: alt_c_param, - value: usd, - }], - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - - let lhs = dag.alloc_port_with_shape(TypeShape::new(money_usd)); - let rhs_same = dag.alloc_port_with_shape(TypeShape::new(money_usd)); - let rhs_other = dag.alloc_port_with_shape(TypeShape::new(money_eur)); - let cross_template_rhs_other = dag.alloc_port_with_shape(TypeShape::new(alt_money_eur)); - let ok_output = dag.push_transform( - TransformTarget::Operator(OperatorKind::Arithmetic(ArithmeticOp::Add)), - vec![lhs, rhs_same], - span.clone(), - ); - let bad_output = dag.push_transform( - TransformTarget::Operator(OperatorKind::Arithmetic(ArithmeticOp::Add)), - vec![lhs, rhs_other], - span.clone(), - ); - let cross_template_bad_output = dag.push_transform( - TransformTarget::Operator(OperatorKind::Arithmetic(ArithmeticOp::Add)), - vec![lhs, cross_template_rhs_other], - span.clone(), - ); - assert!( - type_shapes_equivalent( - &dag, - &TypeShape::new(money_usd), - &TypeShape::new(alt_money_usd) - ), - "structural equivalence should map phantom axes across equivalent templates" - ); - assert!( - !type_shapes_equivalent( - &dag, - &TypeShape::new(money_usd), - &TypeShape::new(other_algebra_money_usd), - ), - "structural equivalence must compare mapped phantom algebra authority" - ); - let money_missing_arg = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: money_missing_arg, - name: Some("MoneyMissingArg".to_string()), - connective: TypeConnective::Instantiation { - template: money, - arguments: Vec::new(), - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - let malformed_lhs = dag.alloc_port_with_shape(TypeShape::new(money_missing_arg)); - let malformed_rhs = dag.alloc_port_with_shape(TypeShape::new(money_missing_arg)); - let malformed_output = dag.push_transform( - TransformTarget::Operator(OperatorKind::Arithmetic(ArithmeticOp::Add)), - vec![malformed_lhs, malformed_rhs], - span.clone(), - ); - let rogue_param = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: rogue_param, - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Rogue".to_string())), - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - let bad_money = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: bad_money, - name: Some("BadMoney".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "amount".to_string(), - ty: int, - }], - }, - type_params: vec![c_param], - phantom_params: vec![PhantomParameter { - parameter: rogue_param, - algebra: currency_abelian_group, - }], - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - let bad_money_usd = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: bad_money_usd, - name: Some("BadMoneyUSD".to_string()), - connective: TypeConnective::Instantiation { - template: bad_money, - arguments: vec![TemplateArgument { - parameter: rogue_param, - value: usd, - }], - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span, - }); - let invalid_lhs = dag.alloc_port_with_shape(TypeShape::new(bad_money_usd)); - let invalid_rhs = dag.alloc_port_with_shape(TypeShape::new(bad_money_usd)); - let invalid_output = dag.push_transform( - TransformTarget::Operator(OperatorKind::Arithmetic(ArithmeticOp::Add)), - vec![invalid_lhs, invalid_rhs], - SourceSpan::new("", 1, 2), - ); - let unsupported_algebra = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: unsupported_algebra, - name: Some("CurrencyMonoid".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("", 2, 3), - }); - let unsupported_money = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: unsupported_money, - name: Some("UnsupportedMoney".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "amount".to_string(), - ty: int, - }], - }, - type_params: vec![c_param], - phantom_params: vec![PhantomParameter { - parameter: c_param, - algebra: unsupported_algebra, - }], - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("", 2, 3), - }); - let unsupported_money_usd = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: unsupported_money_usd, - name: Some("UnsupportedMoneyUSD".to_string()), - connective: TypeConnective::Instantiation { - template: unsupported_money, - arguments: vec![TemplateArgument { - parameter: c_param, - value: usd, - }], - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("", 2, 3), - }); - let unsupported_lhs = dag.alloc_port_with_shape(TypeShape::new(unsupported_money_usd)); - let unsupported_rhs = dag.alloc_port_with_shape(TypeShape::new(unsupported_money_usd)); - let unsupported_output = dag.push_transform( - TransformTarget::Operator(OperatorKind::Arithmetic(ArithmeticOp::Add)), - vec![unsupported_lhs, unsupported_rhs], - SourceSpan::new("", 2, 3), - ); - let fake_abelian_group = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: fake_abelian_group, - name: Some("AbelianGroup".to_string()), - connective: TypeConnective::Conj { children: vec![] }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("", 3, 4), - }); - let fake_algebra_money = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: fake_algebra_money, - name: Some("FakeAlgebraMoney".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "amount".to_string(), - ty: int, - }], - }, - type_params: vec![c_param], - phantom_params: vec![PhantomParameter { - parameter: c_param, - algebra: fake_abelian_group, - }], - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("", 3, 4), - }); - let fake_algebra_money_usd = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: fake_algebra_money_usd, - name: Some("FakeAlgebraMoneyUSD".to_string()), - connective: TypeConnective::Instantiation { - template: fake_algebra_money, - arguments: vec![TemplateArgument { - parameter: c_param, - value: usd, - }], - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("", 3, 4), - }); - let fake_lhs = dag.alloc_port_with_shape(TypeShape::new(fake_algebra_money_usd)); - let fake_rhs = dag.alloc_port_with_shape(TypeShape::new(fake_algebra_money_usd)); - let fake_output = dag.push_transform( - TransformTarget::Operator(OperatorKind::Arithmetic(ArithmeticOp::Add)), - vec![fake_lhs, fake_rhs], - SourceSpan::new("", 3, 4), - ); - let accept_eur = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: accept_eur, - name: Some("accept_eur".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![money_eur], - output: money_eur, - body: ArrowBody::NoBody, - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("", 3, 4), - }); - let callable_lhs = dag.alloc_port_with_shape(TypeShape::new(money_usd)); - let callable_output = dag.push_transform( - TransformTarget::Callable(accept_eur), - vec![callable_lhs], - SourceSpan::new("", 3, 4), - ); - let generic_accept_money = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: generic_accept_money, - name: Some("accept_money".to_string()), - connective: TypeConnective::Arrow { - inputs: vec![money_c], - output: money_c, - body: ArrowBody::NoBody, - }, - type_params: vec![c_param], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("", 4, 5), - }); - let generic_callable_lhs = dag.alloc_port_with_shape(TypeShape::new(money_usd)); - let generic_callable_output = dag.push_transform( - TransformTarget::Callable(generic_accept_money), - vec![generic_callable_lhs], - SourceSpan::new("", 4, 5), - ); - let untracked_param = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: untracked_param, - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("U".to_string())), - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("", 4, 5), - }); - let untracked_money = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: untracked_money, - name: Some("UntrackedMoney".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "amount".to_string(), - ty: int, - }], - }, - type_params: vec![untracked_param], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("", 4, 5), - }); - let untracked_money_usd = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: untracked_money_usd, - name: Some("UntrackedMoneyUSD".to_string()), - connective: TypeConnective::Instantiation { - template: untracked_money, - arguments: vec![TemplateArgument { - parameter: untracked_param, - value: usd, - }], - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: SourceSpan::new("", 4, 5), - }); - let untracked_callable_lhs = dag.alloc_port_with_shape(TypeShape::new(untracked_money_usd)); - let untracked_callable_output = dag.push_transform( - TransformTarget::Callable(accept_eur), - vec![untracked_callable_lhs], - SourceSpan::new("", 4, 5), - ); - assert!( - !type_shapes_equivalent( - &dag, - &TypeShape::new(untracked_money_usd), - &TypeShape::new(money_eur), - ), - "structural equivalence must preserve phantom axes from both templates" - ); - - infer(&mut dag); - - assert_eq!( - dag.port(ok_output).state(), - &PortState::Resolved(TypeShape::new(money_usd)) - ); - let bad_diag = dag - .diagnostics() - .get(bad_output) - .expect("mismatched phantom unit should fail on operator output"); - assert!( - matches!( - bad_diag, - Diagnostic::UnitMismatch { - parameter, - expected, - actual, - .. - } if parameter == "C" - && expected.declaration == usd - && actual.declaration == eur - ), - "unexpected diagnostic: {bad_diag:?}" - ); - let cross_template_bad_diag = dag - .diagnostics() - .get(cross_template_bad_output) - .expect("mapped phantom units should fail across structurally equivalent templates"); - assert!( - matches!( - cross_template_bad_diag, - Diagnostic::UnitMismatch { - parameter, - expected, - actual, - .. - } if parameter == "C" - && expected.declaration == usd - && actual.declaration == eur - ), - "unexpected diagnostic: {cross_template_bad_diag:?}" - ); - let malformed_diag = dag - .diagnostics() - .get(malformed_output) - .expect("missing phantom instantiation argument should fail closed"); - assert!( - matches!( - malformed_diag, - Diagnostic::ResolveError { name, .. } - if name.contains("missing expected argument for phantom parameter C") - ), - "unexpected diagnostic: {malformed_diag:?}" - ); - let invalid_diag = dag - .diagnostics() - .get(invalid_output) - .expect("phantom parameter outside type_params should fail closed"); - assert!( - matches!( - invalid_diag, - Diagnostic::ResolveError { name, .. } - if name.contains("parameter is not in type_params") - ), - "unexpected diagnostic: {invalid_diag:?}" - ); - let unsupported_diag = dag - .diagnostics() - .get(unsupported_output) - .expect("unsupported phantom algebra should fail closed"); - assert!( - matches!( - unsupported_diag, - Diagnostic::ResolveError { name, .. } - if name.contains("unsupported phantom algebra CurrencyMonoid") - ), - "unexpected diagnostic: {unsupported_diag:?}" - ); - let fake_diag = dag - .diagnostics() - .get(fake_output) - .expect("non-canonical declaration named AbelianGroup should fail closed"); - assert!( - matches!( - fake_diag, - Diagnostic::ResolveError { name, .. } - if name.contains("unsupported phantom algebra AbelianGroup") - ), - "unexpected diagnostic: {fake_diag:?}" - ); - let callable_diag = dag - .diagnostics() - .get(callable_output) - .expect("callable boundary should enforce phantom units"); - assert!( - matches!( - callable_diag, - Diagnostic::UnitMismatch { - operator, - parameter, - expected, - actual, - .. - } if operator == "accept_eur" - && parameter == "C" - && expected.declaration == eur - && actual.declaration == usd - ), - "unexpected diagnostic: {callable_diag:?}" - ); - assert!( - matches!( - dag.port(generic_callable_output).state(), - PortState::Resolved(_) - ), - "generic callable should not fail phantom unit checking before C can bind" - ); - assert!( - !matches!( - dag.diagnostics().get(generic_callable_output), - Some(Diagnostic::UnitMismatch { .. }) - ), - "generic callable must not emit UnitMismatch before C can bind" - ); - let untracked_callable_diag = dag - .diagnostics() - .get(untracked_callable_output) - .expect("structural wrapper without phantom axis should not satisfy phantom wrapper"); - assert!( - matches!( - untracked_callable_diag, - Diagnostic::TypeMismatch { .. } | Diagnostic::ResolveError { .. } - ), - "unexpected diagnostic: {untracked_callable_diag:?}" - ); - } - - #[test] - fn template_argument_reconciliation_helpers_match_and_update_consistently() { - let dag = Dag::new(); - let p0 = dag.bool_shape().expect("bootstrap Bool").declaration; - let p1 = dag.int_shape().expect("bootstrap Int").declaration; - let v0 = dag.string_shape().expect("bootstrap String").declaration; - let v1 = dag.bool_shape().expect("bootstrap Bool").declaration; - let mut arguments = vec![ - TemplateArgument { - parameter: p0, - value: p0, - }, - TemplateArgument { - parameter: p1, - value: v1, - }, - ]; - - assert!(push_template_argument_binding(&mut arguments, p0, v0)); - assert!(matches!( - generated_template_arguments_match( - &arguments, - &[ - TemplateArgument { - parameter: p0, - value: v0, - }, - TemplateArgument { - parameter: p1, - value: v1, - }, - ] - ), - TemplateArgumentsMatch::Match, - )); - assert!(!push_template_argument_binding(&mut arguments, p1, v0)); - } - - #[test] - fn template_arguments_match_generated_projection_agrees_across_length_and_value_cases() { - let dag = Dag::new(); - let p0 = dag.bool_shape().expect("bootstrap Bool").declaration; - let p1 = dag.int_shape().expect("bootstrap Int").declaration; - let v0 = dag.string_shape().expect("bootstrap String").declaration; - let v1 = dag.bool_shape().expect("bootstrap Bool").declaration; - let pair = |parameter, value| TemplateArgument { parameter, value }; - let is_match = |lhs: &[TemplateArgument], rhs: &[TemplateArgument]| -> bool { - matches!( - generated_template_arguments_match(lhs, rhs), - TemplateArgumentsMatch::Match, - ) - }; - - let empty: Vec = vec![]; - assert!(is_match(&empty, &empty)); - assert!(!is_match(&empty, &[pair(p0, v0)])); - assert!(!is_match(&[pair(p0, v0)], &empty)); - - let two = vec![pair(p0, v0), pair(p1, v1)]; - assert!(is_match(&two, &two.clone())); - assert!(!is_match(&two, &[pair(p0, v0), pair(p1, v0)])); - assert!(!is_match(&two, &[pair(p0, v0), pair(p0, v1)])); - } - - #[test] - fn filter_non_self_template_arguments_matches_handwritten_filter() { - let dag = Dag::new(); - let p0 = dag.bool_shape().expect("bootstrap Bool").declaration; - let p1 = dag.int_shape().expect("bootstrap Int").declaration; - let args = vec![ - TemplateArgument { - parameter: p0, - value: p0, - }, - TemplateArgument { - parameter: p1, - value: p0, - }, - TemplateArgument { - parameter: p1, - value: p1, - }, - ]; - let expected: Vec = args - .iter() - .filter(|a| a.parameter != a.value) - .cloned() - .collect(); - let actual = filter_non_self_template_arguments(&args); - assert_eq!(actual.len(), expected.len()); - for (a, e) in actual.iter().zip(expected.iter()) { - assert_eq!(a.parameter, e.parameter); - assert_eq!(a.value, e.value); - } - } - - /// SG-4b (callable-instantiation normalization cluster): exercise - /// `find_equivalent_anonymous_instantiation` through the real - /// declaration-table path so the generated template-argument - /// comparison is the one doing the dedup. - #[test] - fn find_equivalent_anonymous_instantiation_dedups_via_generated_comparison() { - let mut dag = Dag::new(); - let template = dag.bool_shape().expect("bootstrap Bool").declaration; - let p0 = dag.int_shape().expect("bootstrap Int").declaration; - let p1 = dag.string_shape().expect("bootstrap String").declaration; - let v0 = dag.int_shape().expect("bootstrap Int").declaration; - let v1 = dag.bool_shape().expect("bootstrap Bool").declaration; - - let args = vec![ - TemplateArgument { - parameter: p0, - value: v0, - }, - TemplateArgument { - parameter: p1, - value: v1, - }, - ]; - - let anon_id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: anon_id, - name: None, - connective: TypeConnective::Instantiation { - template, - arguments: args.clone(), - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: synthetic_span(), - }); - - // Exact arguments match → dedup hit. - assert_eq!( - find_equivalent_anonymous_instantiation(&dag, template, &args, None), - Some(anon_id), - ); - - // One value differs → no hit. - let mut value_diff = args.clone(); - value_diff[1].value = v0; - assert_eq!( - find_equivalent_anonymous_instantiation(&dag, template, &value_diff, None), - None, - ); - - // Length differs → no hit. - assert_eq!( - find_equivalent_anonymous_instantiation(&dag, template, &args[..1], None), - None, - ); - - let opaque = NominalOpacity { - permitted_accessors: Vec::new(), - }; - assert_eq!( - find_equivalent_anonymous_instantiation(&dag, template, &args, Some(&opaque)), - None, - "anonymous instantiation interning must not collapse distinct nominal-opacity carriers" - ); - - let opaque_anon_id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: opaque_anon_id, - name: None, - connective: TypeConnective::Instantiation { - template, - arguments: args.clone(), - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: Some(opaque.clone()), - span: synthetic_span(), - }); - assert_eq!( - find_equivalent_anonymous_instantiation(&dag, template, &args, Some(&opaque)), - Some(opaque_anon_id), - ); - let opaque_with_accessor = NominalOpacity { - permitted_accessors: vec![p0], - }; - assert_eq!( - find_equivalent_anonymous_instantiation( - &dag, - template, - &args, - Some(&opaque_with_accessor), - ), - None, - "permitted-accessor changes are part of the nominal-opacity interning key" - ); - - // Self-binding normalization: a `parameter == value` entry is a - // real structural distinction at this call site — - // `find_equivalent_anonymous_instantiation` does not strip self - // bindings itself; `normalized_instantiation_args` owns that. - // An instantiation with a self-binding added does not dedup - // against one without it, confirming the comparison is strict - // pairwise and the generated helper's length check fires. - let mut with_self = args.clone(); - with_self.push(TemplateArgument { - parameter: p0, - value: p0, - }); - assert_eq!( - find_equivalent_anonymous_instantiation(&dag, template, &with_self, None), - None, - ); - } - - #[test] - fn arithmetic_division_uses_totalized_result_shape() { - let mut dag = Dag::new(); - let int = dag.int_shape().expect("bootstrap Int").declaration; - let lhs = TypeShape::new(int); - let first = - resolve_operator_arrow(&mut dag, OperatorKind::Arithmetic(ArithmeticOp::Div), &lhs) - .expect("division must resolve"); - let after_first = dag.declarations().len(); - let second = - resolve_operator_arrow(&mut dag, OperatorKind::Arithmetic(ArithmeticOp::Div), &lhs) - .expect("division must resolve"); - - assert_eq!(first.output.declaration, second.output.declaration); - assert_eq!( - after_first, - dag.declarations().len(), - "div resolution should dedup anonymous instantiation", - ); - - let result_shape_decl = dag.declaration(first.output.declaration); - let TypeConnective::Instantiation { - template, - arguments, - } = &result_shape_decl.connective - else { - panic!("division output must remain an instantiation"); - }; - let std_result = canonical_result_decl(&dag).expect("std Result").id; - let std_div_error = canonical_div_error_decl(&dag).expect("std DivError").id; - assert_eq!(*template, std_result); - assert_eq!(arguments.len(), 2); - assert_eq!(arguments[0].value, int); - assert_eq!(arguments[1].value, std_div_error); - } - - #[test] - fn arithmetic_division_canonical_result_and_diverror_are_structural_not_path_keyed() { - let mut dag = Dag::new(); - let int = dag.int_shape().expect("bootstrap Int").declaration; - let result = canonical_result_decl(&dag).expect("bootstrap Result").id; - let div_error = canonical_div_error_decl(&dag) - .expect("bootstrap DivError") - .id; - - dag.declaration_mut(result).span.file = "renamed/std/errors.dag".to_string(); - dag.declaration_mut(div_error).span.file = "renamed/std/errors.dag".to_string(); - - let resolved = resolve_operator_arrow( - &mut dag, - OperatorKind::Arithmetic(ArithmeticOp::Div), - &TypeShape::new(int), - ) - .expect("division must resolve through structural error primitives"); - let TypeConnective::Instantiation { - template, - arguments, - } = &dag.declaration(resolved.output.declaration).connective - else { - panic!("division output must remain an instantiation"); - }; - - assert_eq!(*template, result); - assert_eq!(arguments.len(), 2); - assert_eq!(arguments[0].value, int); - assert_eq!(arguments[1].value, div_error); - assert_eq!( - canonical_result_decl(&dag).expect("structural Result").id, - result - ); - assert_eq!( - canonical_div_error_decl(&dag) - .expect("structural DivError") - .id, - div_error - ); - } - - #[test] - fn arithmetic_division_ignores_user_shadowed_result_carriers() { - let mut dag = Dag::new(); - let int = dag.int_shape().expect("bootstrap Int").declaration; - let span = synthetic_span(); - - let shadow_ok = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: shadow_ok, - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Ok".to_string())), - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - let shadow_err = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: shadow_err, - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Err".to_string())), - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - let shadow_result = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: shadow_result, - name: Some("Result".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Ok".to_string(), - ty: shadow_ok, - }, - Field { - label: "Err".to_string(), - ty: shadow_err, - }, - ], - }, - type_params: vec![shadow_ok, shadow_err], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - let shadow_div_error = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: shadow_div_error, - name: Some("DivError".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "DivideByZero".to_string(), - ty: int, - }, - Field { - label: "Overflow".to_string(), - ty: int, - }, - ], - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span, - }); - assert!( - !substrate_div_error_type_decl_suppressed_for_emit( - &dag, - dag.declaration(shadow_div_error) - ), - "payload-bearing DivError twin must not match the canonical unit-variant fingerprint", - ); - - let resolved = resolve_operator_arrow( - &mut dag, - OperatorKind::Arithmetic(ArithmeticOp::Div), - &TypeShape::new(int), - ) - .expect("division must resolve through std carrier"); - let TypeConnective::Instantiation { - template, - arguments, - } = &dag.declaration(resolved.output.declaration).connective - else { - panic!("division output must remain an instantiation"); - }; - - assert_ne!(*template, shadow_result); - assert_ne!(arguments[1].value, shadow_div_error); - assert_eq!( - *template, - canonical_result_decl(&dag).expect("std Result").id - ); - assert_eq!( - arguments[1].value, - canonical_div_error_decl(&dag).expect("std DivError").id - ); - } - - #[test] - fn arithmetic_division_prefers_bootstrap_error_primitives_over_exact_twins() { - let mut dag = Dag::new(); - let int = dag.int_shape().expect("bootstrap Int").declaration; - let std_result = canonical_result_decl(&dag).expect("std Result").id; - let std_div_error = canonical_div_error_decl(&dag).expect("std DivError").id; - let span = synthetic_span(); - - let twin_ok = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: twin_ok, - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("ok".to_string())), - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - let twin_err = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: twin_err, - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("err".to_string())), - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - let twin_ok_payload = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: twin_ok_payload, - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "value".to_string(), - ty: twin_ok, - }], - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - let twin_err_payload = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: twin_err_payload, - name: None, - connective: TypeConnective::Conj { - children: vec![Field { - label: "value".to_string(), - ty: twin_err, - }], - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - let twin_result = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: twin_result, - name: Some("Result".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Ok".to_string(), - ty: twin_ok_payload, - }, - Field { - label: "Err".to_string(), - ty: twin_err_payload, - }, - ], - }, - type_params: vec![twin_ok, twin_err], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - let twin_divide_by_zero = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: twin_divide_by_zero, - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - let twin_overflow = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: twin_overflow, - name: None, - connective: TypeConnective::Conj { children: vec![] }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - let twin_div_error = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: twin_div_error, - name: Some("DivError".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "DivideByZero".to_string(), - ty: twin_divide_by_zero, - }, - Field { - label: "Overflow".to_string(), - ty: twin_overflow, - }, - ], - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span, - }); - - assert!(substrate_result_type_decl_suppressed_for_emit( - &dag, - dag.declaration(twin_result) - )); - assert!(substrate_div_error_type_decl_suppressed_for_emit( - &dag, - dag.declaration(twin_div_error) - )); - assert_eq!(canonical_result_decl(&dag).expect("Result").id, std_result); - assert_eq!( - canonical_div_error_decl(&dag).expect("DivError").id, - std_div_error - ); - - let resolved = resolve_operator_arrow( - &mut dag, - OperatorKind::Arithmetic(ArithmeticOp::Div), - &TypeShape::new(int), - ) - .expect("division must resolve through bootstrap error primitives"); - let TypeConnective::Instantiation { - template, - arguments, - } = &dag.declaration(resolved.output.declaration).connective - else { - panic!("division output must remain an instantiation"); - }; - assert_eq!(*template, std_result); - assert_eq!(arguments[1].value, std_div_error); - assert_ne!(*template, twin_result); - assert_ne!(arguments[1].value, twin_div_error); - } - - #[test] - fn read_algebra_field_fails_closed_on_unresolved_instantiation_argument() { - let mut dag = Dag::new(); - let span = synthetic_span(); - let int = dag.int_shape().expect("bootstrap Int").declaration; - - let receiver_param = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: receiver_param, - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("Self".to_string())), - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - - let unresolved = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: unresolved, - name: None, - connective: TypeConnective::Atom(AtomPayload::UnresolvedIdentifier( - "Missing".to_string(), - )), - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - - let arithmetic_field = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: arithmetic_field, - name: None, - connective: TypeConnective::Arrow { - inputs: vec![receiver_param, unresolved], - output: int, - body: ArrowBody::NoBody, - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - - let algebra = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: algebra, - name: Some("DivProbeAlgebra".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "div".to_string(), - ty: arithmetic_field, - }], - }, - type_params: vec![receiver_param], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - - let before = dag.declarations().len(); - let algebra_decl = dag.declaration(algebra).clone(); - assert!(read_algebra_field( - &mut dag, - &algebra_decl, - arithmetic_field, - int, - OperatorKind::Arithmetic(ArithmeticOp::Div), - &TypeShape::new(int), - ) - .is_none()); - assert_eq!(dag.declarations().len(), before); - } - - #[test] - fn bare_symbol_const_branch_pattern_fails_closed_before_variant_fallback() { - let mut dag = Dag::new(); - let span = SourceSpan::new("symbol-const-pattern-unit.dag", 0, 1); - - let symbol = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: symbol, - name: Some("Symbol".to_string()), - connective: TypeConnective::Atom(AtomPayload::UnresolvedIdentifier( - "Symbol".to_string(), - )), - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - - let symbol_const = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: symbol_const, - name: Some("match_symbol_axis".to_string()), - connective: TypeConnective::Atom(AtomPayload::ResolvedByName(symbol)), - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: Some(symbol), - value_body: Some(crate::dag::ValueBody::Scalar(LiteralBits::String( - "match_symbol_axis".to_string(), - ))), - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - - let left_variant = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: left_variant, - name: None, - connective: TypeConnective::Atom(AtomPayload::ResolvedByName(symbol)), - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - let right_variant = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: right_variant, - name: None, - connective: TypeConnective::Atom(AtomPayload::ResolvedByName(symbol)), - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - let sum = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: sum, - name: Some("TinySum".to_string()), - connective: TypeConnective::Disj { - variants: vec![ - Field { - label: "Left".to_string(), - ty: left_variant, - }, - Field { - label: "Right".to_string(), - ty: right_variant, - }, - ], - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - - let branch_id = dag.alloc_node_id(); - let input = dag.alloc_port(None); - dag.set_port_type(input, TypeShape::new(sum)); - let arm_output = dag.alloc_port(None); - let branch_output = dag.alloc_port(Some(branch_id)); - dag.push_node(Behavior::Branch(crate::dag::BranchNode { - id: branch_id, - input, - paths: vec![crate::dag::Path { - body: branch_id, - output: arm_output, - pattern: crate::dag::BranchPattern::UnresolvedVariant { - name: "match_symbol_axis".to_string(), - span: span.clone(), - }, - binding: None, - }], - output: branch_output, - span: span.clone(), - emit_participation: None, - })); - - assert!(resolve_branch_patterns(&mut dag)); - assert!( - dag.diagnostics().iter().any(|(_, diagnostic)| matches!( - diagnostic, - Diagnostic::ResolveError { name, .. } - if name.contains("bare Symbol constant `match_symbol_axis` cannot be used as a match pattern") - )), - "expected bare Symbol constant branch-pattern diagnostic, got {:?}", - dag.diagnostics() - ); - } -} diff --git a/src/v3/compiler/src/infer_helpers_generated.rs b/src/v3/compiler/src/infer_helpers_generated.rs deleted file mode 100644 index cac371a158e..00000000000 --- a/src/v3/compiler/src/infer_helpers_generated.rs +++ /dev/null @@ -1,198 +0,0 @@ -// AUTO-GENERATED from `src/v3/lenses/infer_helpers.dag` via -// `emit_rust_module`. Regenerate instead of hand-editing. - -#[derive(Clone, Debug)] -pub enum TemplateArgumentBinding { - Conflict, - NoOp, - Append, - ReplaceAt { _0: i64, _1: DeclarationId }, -} -#[derive(Clone, Debug)] -pub enum TemplateArgumentsMatch { - Match, - Mismatch, -} -#[derive(Clone, Debug)] -pub enum TemplateArgumentCursor { - CursorEnd, - CursorHead { - head: TemplateArgument, - tail: Vec, - }, -} -#[derive(Clone, Debug)] -pub enum NormalizedInstantiationArgs { - NotInstantiation, - Normalized { - template: DeclarationId, - args: Vec, - }, -} -pub fn behavior_output_port(p0: &Behavior) -> PortId { - match p0 { - Behavior::Value(v) => (v).result_port(), - Behavior::Transform(t) => (t).result_port(), - Behavior::Branch(b) => (b).result_port(), - Behavior::Loop(l) => (l).result_port(), - Behavior::Bind(bind) => (bind).result_port(), - } -} -pub fn payload_binding_span(p0: &Path, p1: &SourceSpan) -> SourceByteSpan { - match &((p0).pattern) { - BranchPattern::UnresolvedVariant { - name: __u_name, - span: __u_span, - } => SourceByteSpan { - byte_start: (__u_span).byte_start, - byte_end: (__u_span).byte_end, - }, - BranchPattern::ResolvedVariant(_) => SourceByteSpan { - byte_start: (p1).byte_start, - byte_end: (p1).byte_end, - }, - } -} -pub fn template_argument_value( - p0: &[TemplateArgument], - p1: &DeclarationId, -) -> Lookup { - match p0 { - [] => Lookup::Miss, - [__list_head, __list_tail @ ..] => { - if ((__list_head).parameter == (*(p1))) { - Lookup::Hit((__list_head).value) - } else { - template_argument_value(__list_tail, p1) - } - } - } -} -pub fn resolve_template_argument_value( - p0: &i64, - p1: &[TemplateArgument], - p2: DeclarationId, -) -> DeclarationId { - if ((*(p0)) <= 0) { - p2 - } else { - match &(template_argument_value(p1, &p2)) { - Lookup::Miss => p2, - Lookup::Hit(next) => { - if ((*(next)) == p2) { - p2 - } else { - resolve_template_argument_value(&((*(p0)) - 1), p1, (*(next))) - } - } - } - } -} -pub fn push_template_argument_binding( - p0: &[TemplateArgument], - p1: &DeclarationId, - p2: DeclarationId, -) -> TemplateArgumentBinding { - push_template_argument_binding_at(p0, p1, p2, 0) -} -pub fn push_template_argument_binding_at( - p0: &[TemplateArgument], - p1: &DeclarationId, - p2: DeclarationId, - p3: i64, -) -> TemplateArgumentBinding { - match p0 { - [] => TemplateArgumentBinding::Append, - [__list_head, __list_tail @ ..] => { - if ((__list_head).parameter == (*(p1))) { - if ((__list_head).value == (*(p1))) { - TemplateArgumentBinding::ReplaceAt { _0: p3, _1: p2 } - } else { - if ((__list_head).value == p2) { - TemplateArgumentBinding::NoOp - } else { - TemplateArgumentBinding::Conflict - } - } - } else { - push_template_argument_binding_at(__list_tail, p1, p2, (p3 + 1)) - } - } - } -} -pub fn template_arguments_match( - p0: &[TemplateArgument], - p1: &[TemplateArgument], -) -> TemplateArgumentsMatch { - match p0 { - [] => template_arguments_rhs_empty(p1), - [__list_head, __list_tail @ ..] => match &(template_argument_cursor(p1)) { - TemplateArgumentCursor::CursorEnd => TemplateArgumentsMatch::Mismatch, - TemplateArgumentCursor::CursorHead { - head: __cur_head, - tail: __cur_tail, - } => { - if ((__list_head).parameter == (__cur_head).parameter) { - if ((__list_head).value == (__cur_head).value) { - template_arguments_match(__list_tail, __cur_tail) - } else { - TemplateArgumentsMatch::Mismatch - } - } else { - TemplateArgumentsMatch::Mismatch - } - } - }, - } -} -pub fn template_arguments_rhs_empty(p0: &[TemplateArgument]) -> TemplateArgumentsMatch { - match p0 { - [] => TemplateArgumentsMatch::Match, - [__list_head, __list_tail @ ..] => TemplateArgumentsMatch::Mismatch, - } -} -pub fn template_argument_cursor(p0: &[TemplateArgument]) -> TemplateArgumentCursor { - match p0 { - [] => TemplateArgumentCursor::CursorEnd, - [__list_head, __list_tail @ ..] => TemplateArgumentCursor::CursorHead { - head: (__list_head).clone(), - tail: (__list_tail).to_vec(), - }, - } -} -pub fn filter_non_self_template_arguments(p0: &[TemplateArgument]) -> Vec { - match p0 { - [] => Vec::new(), - [__list_head, __list_tail @ ..] => { - if ((__list_head).parameter == (__list_head).value) { - filter_non_self_template_arguments(__list_tail) - } else { - { - let mut __list = filter_non_self_template_arguments(__list_tail); - __list.insert(0, (__list_head).clone()); - __list - } - } - } - } -} -pub fn normalize_instantiation_arguments(p0: &TypeConnective) -> NormalizedInstantiationArgs { - match p0 { - TypeConnective::Atom(_) => NormalizedInstantiationArgs::NotInstantiation, - TypeConnective::Conj { children: _ } => NormalizedInstantiationArgs::NotInstantiation, - TypeConnective::Disj { variants: _ } => NormalizedInstantiationArgs::NotInstantiation, - TypeConnective::Arrow { - inputs: _, - output: _, - body: _, - } => NormalizedInstantiationArgs::NotInstantiation, - TypeConnective::Cardinality(_) => NormalizedInstantiationArgs::NotInstantiation, - TypeConnective::Instantiation { - template: __payload_template, - arguments: __payload_arguments, - } => NormalizedInstantiationArgs::Normalized { - template: (*(__payload_template)), - args: filter_non_self_template_arguments(__payload_arguments), - }, - } -} diff --git a/src/v3/compiler/src/int_literal_ranges.rs b/src/v3/compiler/src/int_literal_ranges.rs deleted file mode 100644 index c6c87054ab4..00000000000 --- a/src/v3/compiler/src/int_literal_ranges.rs +++ /dev/null @@ -1,1222 +0,0 @@ -//! Integer literal magnitude vs declared integer types — **Q1 consumer**. -//! -//! Authoritative modeling: [`docs/design-emission-model.md`](../../../../docs/design-emission-model.md) -//! §Q1 — `BoundDeclaration = StaticBound(Interval) | PlatformDependent`, with asymmetric -//! match (target `Unbounded` universal-accept; target `ExactInterval` exact `lo`/`hi` equality at -//! the fold). This module implements only the **static** side needed for literal narrowing: -//! substrate range facts [`range_min_inclusive` / `range_max_inclusive`](../../../../dsl/extdeps/languages/rust/primitives.dag) -//! on [`rust_grounding_primitives`](crate::dag::Dag::rust_grounding_primitives) supply -//! `StaticBound(Interval)` as [`IntervalInt::ExactInterval`] (decimal endpoints + host -//! `BigInt` comparison; widened from `i128` per R3 Phase A so `u128::MAX` and any future wider -//! primitive is representable structurally). [`IntervalInt::Unbounded`] exists so Q1’s interval -//! algebra is representable when a -//! target declares an unbounded value domain (pilot `IntegerPrimitive` rows are all exact today). -//! [`PlatformDependent`] is out of scope for i64-bounded literal narrowing (deferred targets). -//! -//! ## Downstream consumers (range-facts + narrowing) -//! -//! | Location | Behavior | -//! | --- | --- | -//! | `infer::decide` (`Behavior::Value` integral literal vs annotated fixed-width real) | **Yes** — lossless IEEE narrow via [`int_literal_allowed_integral_seed_for_real_decl`] (R3 gate #67). | -//! | `infer::try_reconcile_int_literal_decision_set` | `let` / `data` pre-seed vs default `Int64` literal; in-range narrow; OOB → `MagnitudeOutOfRange`. | -//! | `infer::decide_transform` (calls) | Parameter-narrow type vs default-`Int` argument literal; narrow or OOB. | -//! | `infer::int_literal_implicit_bind_tolerated_for_expected` | Callable template binding when structural binding fails on int literal. | -//! | `lower` scalar literal lowering | Early reject for OOB literals before inference reunion. | -//! -//! ### R2 downstream audit ([`docs/briefs/r2-modeling-int-lit-magnitude-worker.md`](../../../../docs/briefs/r2-modeling-int-lit-magnitude-worker.md) §Slice 2) -//! -//! Post–[#1227](https://github.com/gunb-ai/gunbc/pull/1227) (**MethodEmitTemplate** Phase 1.5): no shared symbols with `emit_model.dag` method-template row lists -//! or `*_method_template_contracts` — those paths do **not** consult `rust_grounding_primitives` / this module. -//! -//! | Consumer | Range-facts / Q1 magnitude | -//! | --- | --- | -//! | `infer` (`try_reconcile_int_literal_decision_set`, `decide_transform`, `int_literal_implicit_bind_tolerated_for_expected`, transform/`PortUnion` narrow paths) | **Yes** — `integer_range_for_decl` + `magnitude_out_of_range_for_interval`. | -//! | `lower` (`lower_scalar_literal` / scalar literal outcome) | **Yes** — same facts for early OOB. | -//! | `emit::*` (e.g. `rust_target`) | **Indirect** — emits **resolved** shapes after inference; no parallel range-fact walk. | -//! | Method-template / emit-model carriers (**#1227**) | **N/A** — template contracts; unrelated to int-literal narrowing. | - -use std::collections::HashSet; -use std::str::FromStr; - -use num_bigint::BigInt; - -use crate::dag::{ - AtomPayload, Behavior, Dag, DeclarationId, FieldValue, LiteralBits, PortId, TemplateArgument, - TypeConnective, ValueBody, -}; -use crate::diagnostics::{Diagnostic, SourceSpan}; -use crate::types::TypeShape; - -/// Q1 `Interval` instance carried from String-decimal range facts (not `LiteralBits::Int` -/// widening — producer brief). -/// -/// **Host repr:** `min` / `max` are arbitrary-precision `BigInt` so `u128::MAX` (and any future -/// wider-than-i128 primitive) is representable structurally without per-width host-repr variant -/// explosion. Per Director Path A RATIFIED at gunbc#1739 #issuecomment-4392731264 (R3 Substrate -/// Rust-primitive-full-coverage bundled brief). The previous narrow `i128` host-repr deferred the -/// `u128` row in `dsl/extdeps/languages/rust/primitives.dag` because `u128::MAX` exceeds `i128` -/// range; that gap is closed by the `BigInt` host repr here. -#[derive(Debug, Clone, PartialEq, Eq)] -pub(crate) enum IntervalInt { - /// Closed interval — substrate `range_*_inclusive` facts for a fixed-width target primitive. - ExactInterval { - target_name: String, - min_decimal: String, - max_decimal: String, - min: BigInt, - max: BigInt, - }, - /// Value-domain unbounded integer (e.g. arbitrary-precision target). Universal-accept for any - /// tokenized decimal literal magnitude (through `u128::MAX` / signed `|m| ≤ 2^127`). - /// - /// **Dissolution trigger (when this variant is constructed from [`integer_range_for_decl`]):** - /// a `rust_grounding_primitives` `IntegerPrimitive` row (or successor multi-target table) is - /// authored for a target whose Q1 `BoundDeclaration` is `StaticBound(Unbounded)` at magnitude - /// check — e.g. Python `int` per [`docs/design-emission-model.md`](../../../../docs/design-emission-model.md) - /// fold example (T-Ground cross-target / language `primitives.dag` work, not this consumer). - /// Until that producer exists, only [`IntervalInt::ExactInterval`] is returned from the pilot - /// list; [`Unbounded`] remains for `contains_bigint` / Q1 algebra completeness and unit tests. - #[allow(dead_code)] - Unbounded, -} - -/// Decimal endpoints for a **fixed** integer target — the payload of [`MagnitudeOutOfRange`]. -/// -/// **API split:** only [`magnitude_out_of_range`] takes this type. When you have a full -/// [`IntervalInt`] from [`integer_range_for_decl`], call [`magnitude_out_of_range_for_interval`] -/// (it uses [`IntervalInt::exact_interval_facts`] and never passes an unbounded domain into the -/// magnitude diagnostic). -#[derive(Debug, Clone, PartialEq, Eq)] -pub(crate) struct ExactIntIntervalFacts { - pub(crate) target_name: String, - pub(crate) min_decimal: String, - pub(crate) max_decimal: String, -} - -impl IntervalInt { - /// Range check for a surface literal magnitude carried as decimal [`LiteralBits::Int`]. - pub(crate) fn contains_bigint(&self, value: &BigInt) -> bool { - match self { - IntervalInt::Unbounded => true, - IntervalInt::ExactInterval { min, max, .. } => min <= value && value <= max, - } - } - - /// Fixed-width pilot rows: `Some` for [`IntervalInt::ExactInterval`]; `None` for - /// [`IntervalInt::Unbounded`] (no decimal range to quote in `MagnitudeOutOfRange`). - pub(crate) fn exact_interval_facts(&self) -> Option { - match self { - IntervalInt::ExactInterval { - target_name, - min_decimal, - max_decimal, - .. - } => Some(ExactIntIntervalFacts { - target_name: target_name.clone(), - min_decimal: min_decimal.clone(), - max_decimal: max_decimal.clone(), - }), - IntervalInt::Unbounded => None, - } - } -} - -pub(crate) enum IntegerRangeLookup { - Found(IntervalInt), - Missing, - Invalid(Diagnostic), -} - -/// Structural witness for routing integer literals: `IntegerAlgebra` and -/// `TargetCarrier` variant **payload type** ids (the `constructor` field on -/// `FieldValue::Variant`), derived from std `OrderedRing` / `Semiring` -/// **or** `Compose>` with literal-Nat `N` (R3 gate #19 + #60) -/// by resolving to the same pilot `(OrderedRing|Semiring, Word*)` routing key. -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub(crate) struct IntegerRoutingWitness { - pub(crate) algebra_variant_ty: DeclarationId, - pub(crate) carrier_variant_ty: DeclarationId, -} - -/// Integration / structural tests: witness for `decl`'s resolved integer -/// instantiation (`OrderedRing` / `Semiring` + word carrier), if any. -pub(crate) fn integer_routing_witness_for_decl( - dag: &Dag, - decl: DeclarationId, -) -> Option { - integer_routing_witness_walk(dag, decl, 0) -} - -/// `Nat` (`dsl/std/nat.dag`: `Semiring`). Nonnegative literals share the tokenizer's -/// `u128` magnitude carrier; narrowing still rejects negative values structurally. -fn type_is_nat(dag: &Dag, mut decl: DeclarationId) -> bool { - let Some(nat_id) = dag.declaration_by_name("Nat").map(|d| d.id) else { - return false; - }; - let Some(semiring_template) = dag.declaration_by_name("Semiring").map(|d| d.id) else { - return false; - }; - let Some(magnitude_id) = dag.declaration_by_name("Magnitude").map(|d| d.id) else { - return false; - }; - for _ in 0..32 { - if decl == nat_id { - return true; - } - let declaration = dag.declaration(decl); - match &declaration.connective { - TypeConnective::Instantiation { - template, - arguments, - } if *template == semiring_template - && arguments.len() == 1 - && arguments[0].value == magnitude_id => - { - return true; - } - TypeConnective::Instantiation { template, .. } => decl = *template, - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => decl = *next, - _ => return false, - } - } - false -} - -fn nat_decimal_literal_interval() -> IntervalInt { - IntervalInt::ExactInterval { - target_name: "Nat".to_string(), - min_decimal: "0".to_string(), - max_decimal: u128::MAX.to_string(), - min: BigInt::from(0u8), - max: BigInt::from(u128::MAX), - } -} - -pub(crate) fn integer_range_for_decl(dag: &Dag, decl: DeclarationId) -> IntegerRangeLookup { - if type_is_nat(dag, decl) { - return IntegerRangeLookup::Found(nat_decimal_literal_interval()); - } - let Some(witness) = integer_routing_witness_walk(dag, decl, 0) else { - return IntegerRangeLookup::Missing; - }; - let Some(grounding_list) = dag.rust_grounding_primitives() else { - return IntegerRangeLookup::Missing; - }; - let Some(body) = grounding_list.value_body.as_ref() else { - return IntegerRangeLookup::Missing; - }; - let ValueBody::List(elements) = body else { - return IntegerRangeLookup::Missing; - }; - - let integer_primitive_ctor = match rust_primitive_integer_variant_ty(dag) { - Some(id) => id, - None => { - return IntegerRangeLookup::Invalid(malformed_integer_range_fact( - "bootstrap: RustPrimitive.IntegerPrimitive variant type is unavailable".to_string(), - grounding_list.span.clone(), - )); - } - }; - - let mut matches: Vec = Vec::new(); - for element in elements { - let FieldValue::Variant { - constructor, - payload, - } = element - else { - continue; - }; - if *constructor != integer_primitive_ctor { - continue; - } - match grounding_integer_row(witness, payload, grounding_list.span.clone()) { - Ok(Some(m)) => matches.push(m), - Ok(None) => {} - Err(diag) => return IntegerRangeLookup::Invalid(diag), - } - } - - if matches.is_empty() { - return IntegerRangeLookup::Missing; - } - if let Some(row) = matches.iter().find(|row| row.range.is_none()) { - return IntegerRangeLookup::Invalid(malformed_integer_range_fact( - format!( - "malformed rust_grounding_primitives IntegerPrimitive row for routing witness {:?}; integer literal range narrowing is unavailable", - (witness.algebra_variant_ty, witness.carrier_variant_ty) - ), - row.span.clone(), - )); - } - if matches.len() > 1 { - return IntegerRangeLookup::Invalid(malformed_integer_range_fact( - format!( - "duplicate rust_grounding_primitives IntegerPrimitive rows for routing witness {:?}; integer literal range narrowing is ambiguous", - (witness.algebra_variant_ty, witness.carrier_variant_ty) - ), - matches[1].span.clone(), - )); - } - let row = matches.remove(0); - match row.range { - Some(range) => IntegerRangeLookup::Found(range), - None => unreachable!("malformed matching rows are handled before duplicate detection"), - } -} - -struct GroundingIntegerMatch { - range: Option, - span: SourceSpan, -} - -fn integer_routing_witness_walk( - dag: &Dag, - decl: DeclarationId, - depth: usize, -) -> Option { - if depth >= 32 { - return None; - } - let declaration = dag.declaration(decl); - match &declaration.connective { - TypeConnective::Atom(AtomPayload::ResolvedByName(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) => { - integer_routing_witness_walk(dag, *next, depth + 1) - } - TypeConnective::Instantiation { - template, - arguments, - } => { - if arguments.is_empty() { - return integer_routing_witness_walk(dag, *template, depth + 1); - } - if let Some(compose_id) = dag.declaration_by_name("Compose").map(|d| d.id) { - if *template == compose_id && arguments.len() == 2 { - if let Some(w) = compose_integer_routing_witness(dag, arguments.as_slice()) { - return Some(w); - } - } - } - let carrier = arguments.first()?.value; - integer_instantiation_witness(dag, *template, carrier) - } - _ => None, - } -} - -/// Gate #60 Phase 2.1: `MachineWidth`'s phantom argument may be a literal decimal -/// (`MachineWidth<64>`) naming the Nat magnitude; map to the existing `std.bit` width -/// authority (`Byte` / `Word16` / …) for the same integer-routing witness as Word*-spelled rows. -fn machine_width_inner_to_std_width_carrier_decl( - dag: &Dag, - inner_decl: DeclarationId, -) -> Option { - if std_word_carrier_to_target_carrier_variant_ty(dag, inner_decl).is_some() { - return Some(inner_decl); - } - match &dag.declaration(inner_decl).connective { - TypeConnective::Atom(AtomPayload::Literal(LiteralBits::Int(s))) => { - let n: u32 = s.parse().ok()?; - match n { - 8 => Some(dag.declaration_by_name("Byte")?.id), - 16 => Some(dag.declaration_by_name("Word16")?.id), - 32 => Some(dag.declaration_by_name("Word32")?.id), - 64 => Some(dag.declaration_by_name("Word64")?.id), - 128 => Some(dag.declaration_by_name("Word128")?.id), - _ => None, - } - } - _ => None, - } -} - -/// Fixed-width integers after gate #19 + #60: `Compose>` (signed) or -/// `Compose>` (unsigned) with literal-Nat `N` for every fixed width. -/// Maps to the same `(OrderedRing|Semiring, Word*)` pilot routing key as the legacy -/// `OrderedRing` / `Semiring` instantiations. -fn compose_integer_routing_witness( - dag: &Dag, - arguments: &[TemplateArgument], -) -> Option { - let int_id = dag.declaration_by_name("Int").map(|d| d.id)?; - let uint_id = dag.declaration_by_name("UInt").map(|d| d.id)?; - let machine_width = dag.declaration_by_name("MachineWidth").map(|d| d.id)?; - - let mut signed: Option = None; - let mut word_carrier: Option = None; - - for arg in arguments { - let v = arg.value; - if v == int_id { - signed = Some(true); - } else if v == uint_id { - signed = Some(false); - } else if let TypeConnective::Instantiation { - template, - arguments: mw_args, - } = &dag.declaration(v).connective - { - if *template == machine_width && mw_args.len() == 1 { - let inner = mw_args[0].value; - word_carrier = Some(machine_width_inner_to_std_width_carrier_decl(dag, inner)?); - } - } - } - - let signed = signed?; - let carrier_decl = word_carrier?; - let algebra_variant_ty = if signed { - disj_variant_payload_ty(dag, "IntegerAlgebra", "OrderedRingAlgebra")? - } else { - disj_variant_payload_ty(dag, "IntegerAlgebra", "SemiringAlgebra")? - }; - let carrier_variant_ty = std_word_carrier_to_target_carrier_variant_ty(dag, carrier_decl)?; - Some(IntegerRoutingWitness { - algebra_variant_ty, - carrier_variant_ty, - }) -} - -fn integer_instantiation_witness( - dag: &Dag, - template: DeclarationId, - carrier_decl: DeclarationId, -) -> Option { - let ordered_ring = dag.declaration_by_name("OrderedRing")?.id; - let semiring = dag.declaration_by_name("Semiring")?.id; - let algebra_variant_ty = if template == ordered_ring { - disj_variant_payload_ty(dag, "IntegerAlgebra", "OrderedRingAlgebra")? - } else if template == semiring { - disj_variant_payload_ty(dag, "IntegerAlgebra", "SemiringAlgebra")? - } else { - return None; - }; - let carrier_variant_ty = std_word_carrier_to_target_carrier_variant_ty(dag, carrier_decl)?; - Some(IntegerRoutingWitness { - algebra_variant_ty, - carrier_variant_ty, - }) -} - -fn disj_variant_payload_ty( - dag: &Dag, - sum_name: &str, - variant_label: &str, -) -> Option { - let decl = dag.declaration_by_name(sum_name)?; - let TypeConnective::Disj { variants } = &decl.connective else { - return None; - }; - variants - .iter() - .find(|v| v.label == variant_label) - .map(|v| v.ty) -} - -fn std_word_carrier_to_target_carrier_variant_ty( - dag: &Dag, - carrier_decl: DeclarationId, -) -> Option { - let byte = dag.declaration_by_name("Byte")?.id; - let word16 = dag.declaration_by_name("Word16")?.id; - let word32 = dag.declaration_by_name("Word32")?.id; - let word64 = dag.declaration_by_name("Word64")?.id; - let word128 = dag.declaration_by_name("Word128")?.id; - let label = if carrier_decl == byte { - "ByteCarrier" - } else if carrier_decl == word16 { - "Word16Carrier" - } else if carrier_decl == word32 { - "Word32Carrier" - } else if carrier_decl == word64 { - "Word64Carrier" - } else if carrier_decl == word128 { - "Word128Carrier" - } else { - return None; - }; - disj_variant_payload_ty(dag, "TargetCarrier", label) -} - -fn rust_primitive_integer_variant_ty(dag: &Dag) -> Option { - let rust_primitive = dag.declaration_by_name("RustPrimitive")?; - let TypeConnective::Disj { variants } = &rust_primitive.connective else { - return None; - }; - variants - .iter() - .find(|v| v.label == "IntegerPrimitive") - .map(|v| v.ty) -} - -fn grounding_integer_row( - witness: IntegerRoutingWitness, - payload: &[FieldValue], - default_span: SourceSpan, -) -> Result, Diagnostic> { - // IntegerPrimitive field order: target_name, algebra, carrier, range_*, is_copy, overflow - if payload.len() < 5 { - return Ok(None); - } - let FieldValue::Variant { - constructor: algebra_ctor, - .. - } = &payload[1] - else { - return Err(malformed_integer_range_fact( - "rust_grounding_primitives IntegerPrimitive `algebra` must be a variant value" - .to_string(), - default_span.clone(), - )); - }; - let FieldValue::Variant { - constructor: carrier_ctor, - .. - } = &payload[2] - else { - return Err(malformed_integer_range_fact( - "rust_grounding_primitives IntegerPrimitive `carrier` must be a variant value" - .to_string(), - default_span.clone(), - )); - }; - if *algebra_ctor != witness.algebra_variant_ty || *carrier_ctor != witness.carrier_variant_ty { - return Ok(None); - } - - let range = (|| { - let min_decimal = literal_string(payload.get(3)?)?; - let max_decimal = literal_string(payload.get(4)?)?; - let min = min_decimal.parse().ok()?; - let max = max_decimal.parse().ok()?; - if min > max { - return None; - } - Some(IntervalInt::ExactInterval { - target_name: literal_string(payload.first()?)?, - min_decimal, - max_decimal, - min, - max, - }) - })(); - - Ok(Some(GroundingIntegerMatch { - range, - span: default_span, - })) -} - -fn literal_string(value: &FieldValue) -> Option { - match value { - FieldValue::Literal(LiteralBits::String(value)) => Some(value.clone()), - _ => None, - } -} - -pub(crate) fn literal_bigint_at(dag: &Dag, port: PortId) -> Option { - let s = match dag.resolve_producer_opt(&port)? { - Behavior::Value(value) => match &value.data { - LiteralBits::Int(s) => s.as_str(), - _ => return None, - }, - _ => return None, - }; - BigInt::from_str(s).ok() -} - -/// IEEE-754 width targeted by an integral literal that seeds a fixed-width real. -/// -/// 🟡 STAGED — compiler-internal discriminant for gate-#67 interim seeding; dissolve when -/// float lexeme / substrate width facts subsume this path (Practice 4 — internal enum). -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub(crate) enum IntLiteralFloatCoercionTarget { - F32, - F64, -} - -/// Peels empty `Instantiate(T, [])` and `ResolvedBy{Structure,Name}` heads (gate-#60 alias chain). -/// Shared by integral-float seeding and Rust emit `Compose>` inspection. -pub(crate) fn peel_decl_head_for_integral_float_seed( - dag: &Dag, - mut decl: DeclarationId, -) -> DeclarationId { - for _ in 0..32 { - let d = dag.declaration(decl); - match &d.connective { - TypeConnective::Instantiation { - template, - arguments, - } if arguments.is_empty() => { - decl = *template; - } - TypeConnective::Atom(AtomPayload::ResolvedByName(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) => { - decl = *next; - } - _ => return decl, - } - } - decl -} - -/// True when every integer with this magnitude is representable **exactly** as an `f32`. -pub(crate) fn int_literal_lossless_in_f32(literal: &BigInt) -> bool { - // IEEE-754 binary32 has 24 explicit significand bits → all |n| ≤ 2^24 round-trip exactly. - let max = BigInt::from(16777216u32); - let min = -max.clone(); - literal >= &min && literal <= &max -} - -/// True when every integer with this magnitude is representable **exactly** as an `f64`. -pub(crate) fn int_literal_lossless_in_f64(literal: &BigInt) -> bool { - let max = BigInt::from(9007199254740992u64); - let min = -max.clone(); - literal >= &min && literal <= &max -} - -/// R3 gate #60: `MachineWidth` or `MachineWidth` → bit width. -/// (`Byte` is the nominal 8-bit carrier in `dsl/std/bit.dag`; there is no `Word8`.) -pub(crate) fn gate60_machine_width_bits( - dag: &Dag, - machine_width_inst: DeclarationId, -) -> Option { - let wdecl = dag.declaration(machine_width_inst); - let TypeConnective::Instantiation { - template, - arguments: mw_args, - } = &wdecl.connective - else { - return None; - }; - let mw_tpl = dag.declaration_by_name("MachineWidth")?.id; - if *template != mw_tpl || mw_args.len() != 1 { - return None; - } - let slot = mw_args[0].value; - for (carrier_name, bits) in [ - ("Byte", 8_u32), - ("Word16", 16), - ("Word32", 32), - ("Word64", 64), - ("Word128", 128), - ] { - if let Some(w) = dag.declaration_by_name(carrier_name) { - if slot == w.id { - return Some(bits); - } - } - } - let inner = dag.declaration(slot); - if let TypeConnective::Atom(AtomPayload::Literal(LiteralBits::Int(decimal))) = &inner.connective - { - let n: u32 = decimal.parse().ok()?; - return matches!(n, 8 | 16 | 32 | 64 | 128).then_some(n); - } - None -} - -/// Bootstrap `Compose<…, …>` template declaration id (structural gate-#60 / Rust emit walks). -#[inline] -pub(crate) fn compose_carrier_template_declaration_id(dag: &Dag) -> Option { - dag.declaration_by_name("Compose").map(|d| d.id) -} - -fn structural_compose_real_machine_width( - dag: &Dag, - decl: DeclarationId, -) -> Option { - let compose = compose_carrier_template_declaration_id(dag)?; - let real = dag.declaration_by_name("Real")?.id; - - let decl = peel_decl_head_for_integral_float_seed(dag, decl); - let d = dag.declaration(decl); - let TypeConnective::Instantiation { - template, - arguments, - } = &d.connective - else { - return None; - }; - if *template != compose || arguments.len() != 2 { - return None; - } - if !arguments.iter().any(|a| a.value == real) { - return None; - } - let mut out = None; - for arg in arguments { - if arg.value == real { - continue; - } - if let Some(bits) = gate60_machine_width_bits(dag, arg.value) { - match bits { - 32 => out = Some(IntLiteralFloatCoercionTarget::F32), - 64 => out = Some(IntLiteralFloatCoercionTarget::F64), - _ => {} - } - } - } - out -} - -pub(crate) fn int_literal_float_coercion_target( - dag: &Dag, - decl: DeclarationId, -) -> Option { - // Only name the canonical width rows (`Real32`/`Real64`) that own `TypeRealization` targets in - // `rust.dag`. Compatibility aliases (`Float32 = Real32`, …) peel to these via - // [`peel_decl_head_for_integral_float_seed`], so listing `Float*` here would duplicate - // inference authority without adding emit coverage (codex #3115 — P2 single spine). - let peeled = peel_decl_head_for_integral_float_seed(dag, decl); - for (name, fmt) in [ - ("Real64", IntLiteralFloatCoercionTarget::F64), - ("Real32", IntLiteralFloatCoercionTarget::F32), - ] { - if let Some(d) = dag.declaration_by_name(name) { - if peeled == d.id { - return Some(fmt); - } - } - } - structural_compose_real_machine_width(dag, decl) -} - -/// `let r: Real<64> = 0` (etc.): integer literals may seed fixed-width reals when the tokenizer -/// has no float lexeme yet — emit prints a decimal fragment Rust accepts in `f32`/`f64` slots. -pub(crate) fn int_literal_allowed_integral_seed_for_real_decl( - dag: &Dag, - literal: &BigInt, - decl: DeclarationId, -) -> bool { - match int_literal_float_coercion_target(dag, decl) { - Some(IntLiteralFloatCoercionTarget::F64) => int_literal_lossless_in_f64(literal), - Some(IntLiteralFloatCoercionTarget::F32) => int_literal_lossless_in_f32(literal), - None => false, - } -} - -pub(crate) fn int_literal_fits_expected_type( - dag: &Dag, - literal: &BigInt, - expected: DeclarationId, -) -> Result, Diagnostic> { - match integer_range_for_decl(dag, expected) { - IntegerRangeLookup::Found(bound) => Ok(Some(bound.contains_bigint(literal))), - IntegerRangeLookup::Missing => Ok(None), - IntegerRangeLookup::Invalid(diag) => Err(diag), - } -} - -/// Build [`Diagnostic::MagnitudeOutOfRange`] from **exact** decimal range facts only. -/// -/// For a bound that may be [`IntervalInt::Unbounded`], use [`magnitude_out_of_range_for_interval`] -/// instead — this function does not accept [`IntervalInt`]. -pub(crate) fn magnitude_out_of_range( - literal: &BigInt, - expected: TypeShape, - facts: ExactIntIntervalFacts, - span: SourceSpan, -) -> Diagnostic { - Diagnostic::MagnitudeOutOfRange { - literal: literal.to_string(), - target: facts.target_name, - range_min_inclusive: facts.min_decimal, - range_max_inclusive: facts.max_decimal, - expected, - span, - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "IntegerLiteralRangeDiagnostic", - ), - } -} - -/// OOB diagnostic when the only available model is [`IntervalInt`] (e.g. from -/// [`integer_range_for_decl`]). Unbounded domains never produce `MagnitudeOutOfRange` for -/// finite literals; if that combination appears, fail closed without `unreachable!`. -pub(crate) fn magnitude_out_of_range_for_interval( - literal: &BigInt, - expected: TypeShape, - bound: IntervalInt, - span: SourceSpan, -) -> Diagnostic { - match bound.exact_interval_facts() { - Some(facts) => magnitude_out_of_range(literal, expected, facts, span), - None => Diagnostic::ResolveError { - name: "internal: integer literal failed range check but target has no exact interval facts" - .to_string(), - span, - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("IntegerLiteralRangeDiagnostic"), - }, - } -} - -fn malformed_integer_range_fact(message: String, span: SourceSpan) -> Diagnostic { - Diagnostic::MalformedIntegerRangeFact { - message, - span, - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "IntegerLiteralRangeDiagnostic", - ), - } -} - -/// Bootstrap-only gate: walk **every** `IntegerPrimitive` row in -/// `rust_grounding_primitives` and fail closed if any row is structurally -/// ill-formed, range strings do not parse as decimal `BigInt`, `min > max`, -/// or `(algebra, carrier)` witness pairs collide. -/// -/// Call this once when constructing the extdeps-including bootstrapped `Dag` -/// so drift or corruption in the pilot list surfaces at `Dag::new()`, -/// not only when a particular std type is queried. -pub(crate) fn validate_rust_grounding_integer_primitives(dag: &mut Dag) { - // R3 Phase B (Director Path A RATIFIED at gunbc#1739 #issuecomment-4392731264; - // Option (ii) at #issuecomment-4393145631; Phase B-1 at commit `59511503e`): - // pilot carries 10 IntegerPrimitive rows (i8..i64, i128, u8..u64, u128). - // u128 was unblocked by Phase A `IntervalInt::ExactInterval` BigInt host - // repr widening (commit `e7ba022c6`); the prior `T-Int128 Slice B1` / - // "Slice B2" deferral marker is resolved. - const EXPECTED_INTEGER_ROWS: usize = 10; - const INTEGER_PRIMITIVE_FIELD_COUNT: usize = 7; - - enum GroundingListSnapshot { - List(Vec), - MissingBody, - NotList, - } - - // Authority file for span when the declaration is absent (extdeps fixture). - const RUST_INHABITANCE_MIRROR_AUTHORITY: &str = "dsl/extdeps/languages/rust/primitives.dag"; - - let (default_span, grounding_elements) = { - let Some(grounding_list) = dag.rust_grounding_primitives() else { - dag.attach_diagnostic(malformed_integer_range_fact( - "bootstrap: `rust_grounding_primitives` is missing from the extdeps fixture; \ - integer range authority is unavailable (expected extdeps `primitives.dag` load)" - .to_string(), - SourceSpan::new(RUST_INHABITANCE_MIRROR_AUTHORITY, 0, 0), - )); - return; - }; - let sp = grounding_list.span.clone(); - let snap = match grounding_list.value_body.as_ref() { - None => GroundingListSnapshot::MissingBody, - Some(ValueBody::List(els)) => GroundingListSnapshot::List(els.clone()), - Some(_) => GroundingListSnapshot::NotList, - }; - (sp, snap) - }; - - let elements: &[FieldValue] = match &grounding_elements { - GroundingListSnapshot::List(els) => els, - GroundingListSnapshot::MissingBody => { - dag.attach_diagnostic(malformed_integer_range_fact( - "bootstrap: rust_grounding_primitives is missing a value body".to_string(), - default_span, - )); - return; - } - GroundingListSnapshot::NotList => { - dag.attach_diagnostic(malformed_integer_range_fact( - "bootstrap: rust_grounding_primitives must be ValueBody::List".to_string(), - default_span, - )); - return; - } - }; - - let Some(integer_ctor) = rust_primitive_integer_variant_ty(dag) else { - dag.attach_diagnostic(malformed_integer_range_fact( - "bootstrap: RustPrimitive.IntegerPrimitive variant is unavailable".to_string(), - default_span, - )); - return; - }; - - let Some(ord_algebra) = disj_variant_payload_ty(dag, "IntegerAlgebra", "OrderedRingAlgebra") - else { - dag.attach_diagnostic(malformed_integer_range_fact( - "bootstrap: IntegerAlgebra.OrderedRingAlgebra is unavailable for pilot validation" - .to_string(), - default_span, - )); - return; - }; - let Some(sem_algebra) = disj_variant_payload_ty(dag, "IntegerAlgebra", "SemiringAlgebra") - else { - dag.attach_diagnostic(malformed_integer_range_fact( - "bootstrap: IntegerAlgebra.SemiringAlgebra is unavailable for pilot validation" - .to_string(), - default_span, - )); - return; - }; - let mut allowed_carriers: HashSet = HashSet::new(); - for label in [ - "ByteCarrier", - "Word16Carrier", - "Word32Carrier", - "Word64Carrier", - "Word128Carrier", - ] { - if let Some(c) = disj_variant_payload_ty(dag, "TargetCarrier", label) { - allowed_carriers.insert(c); - } - } - if allowed_carriers.is_empty() { - dag.attach_diagnostic(malformed_integer_range_fact( - "bootstrap: no TargetCarrier word variant payload types for pilot validation" - .to_string(), - default_span, - )); - return; - } - - let mut witnesses: HashSet<(DeclarationId, DeclarationId)> = HashSet::new(); - let mut integer_rows: usize = 0; - - for element in elements { - let FieldValue::Variant { - constructor, - payload, - } = element - else { - continue; - }; - if *constructor != integer_ctor { - continue; - } - integer_rows += 1; - - if payload.len() < INTEGER_PRIMITIVE_FIELD_COUNT { - dag.attach_diagnostic(malformed_integer_range_fact( - format!( - "rust_grounding_primitives IntegerPrimitive row has {} fields; expected {}", - payload.len(), - INTEGER_PRIMITIVE_FIELD_COUNT - ), - default_span.clone(), - )); - continue; - } - - let FieldValue::Variant { - constructor: algebra_ctor, - .. - } = &payload[1] - else { - dag.attach_diagnostic(malformed_integer_range_fact( - "rust_grounding_primitives IntegerPrimitive `algebra` must be a variant value" - .to_string(), - default_span.clone(), - )); - continue; - }; - if *algebra_ctor != ord_algebra && *algebra_ctor != sem_algebra { - dag.attach_diagnostic(malformed_integer_range_fact( - "rust_grounding_primitives IntegerPrimitive `algebra` must be OrderedRingAlgebra or SemiringAlgebra (variant payload type id)".to_string(), - default_span.clone(), - )); - continue; - } - - let FieldValue::Variant { - constructor: carrier_ctor, - .. - } = &payload[2] - else { - dag.attach_diagnostic(malformed_integer_range_fact( - "rust_grounding_primitives IntegerPrimitive `carrier` must be a variant value" - .to_string(), - default_span.clone(), - )); - continue; - }; - if !allowed_carriers.contains(carrier_ctor) { - dag.attach_diagnostic(malformed_integer_range_fact( - "rust_grounding_primitives IntegerPrimitive `carrier` must be a word TargetCarrier (Byte/Word16/Word32/Word64/Word128) variant payload type id".to_string(), - default_span.clone(), - )); - continue; - } - - if literal_string(&payload[0]).is_none() { - dag.attach_diagnostic(malformed_integer_range_fact( - "rust_grounding_primitives IntegerPrimitive `target_name` must be a string literal" - .to_string(), - default_span.clone(), - )); - continue; - } - - let (min_s, max_s) = match (literal_string(&payload[3]), literal_string(&payload[4])) { - (Some(a), Some(b)) => (a, b), - _ => { - dag.attach_diagnostic(malformed_integer_range_fact( - "rust_grounding_primitives IntegerPrimitive range bounds must be string literals" - .to_string(), - default_span.clone(), - )); - continue; - } - }; - - if !matches!(payload[5], FieldValue::Literal(LiteralBits::Bool(_))) { - dag.attach_diagnostic(malformed_integer_range_fact( - "rust_grounding_primitives IntegerPrimitive `is_copy` must be a bool literal" - .to_string(), - default_span.clone(), - )); - continue; - } - - if !matches!(&payload[6], FieldValue::Variant { .. }) { - dag.attach_diagnostic(malformed_integer_range_fact( - "rust_grounding_primitives IntegerPrimitive `overflow` must be a variant value" - .to_string(), - default_span.clone(), - )); - continue; - } - - let (min_n, max_n) = match (min_s.parse::(), max_s.parse::()) { - (Ok(mn), Ok(mx)) => (mn, mx), - _ => { - dag.attach_diagnostic(malformed_integer_range_fact( - format!( - "rust_grounding_primitives IntegerPrimitive range [{min_s}, {max_s}] must parse as a decimal integer" - ), - default_span.clone(), - )); - continue; - } - }; - if min_n > max_n { - dag.attach_diagnostic(malformed_integer_range_fact( - format!( - "rust_grounding_primitives IntegerPrimitive range order invalid: min {min_s} > max {max_s}" - ), - default_span.clone(), - )); - continue; - } - - if !witnesses.insert((*algebra_ctor, *carrier_ctor)) { - dag.attach_diagnostic(malformed_integer_range_fact( - format!( - "duplicate rust_grounding_primitives IntegerPrimitive (algebra, carrier) witness: ({algebra_ctor:?}, {carrier_ctor:?})" - ), - default_span.clone(), - )); - } - } - - if integer_rows != EXPECTED_INTEGER_ROWS { - dag.attach_diagnostic(malformed_integer_range_fact( - format!( - "rust_grounding_primitives must list exactly {EXPECTED_INTEGER_ROWS} IntegerPrimitive rows (pilot int scope); found {integer_rows}" - ), - default_span, - )); - } -} - -#[cfg(test)] -mod tests { - use super::*; - use crate::types::TypeShape; - - #[test] - fn float_alias_peels_to_real_before_integral_float_coercion() { - let dag = Dag::new(); - let float64 = dag.declaration_by_name("Float64").expect("Float64").id; - let real64 = dag.declaration_by_name("Real64").expect("Real64").id; - assert_eq!( - peel_decl_head_for_integral_float_seed(&dag, float64), - real64 - ); - assert_eq!( - int_literal_float_coercion_target(&dag, float64), - Some(IntLiteralFloatCoercionTarget::F64) - ); - let float32 = dag.declaration_by_name("Float32").expect("Float32").id; - let real32 = dag.declaration_by_name("Real32").expect("Real32").id; - assert_eq!( - peel_decl_head_for_integral_float_seed(&dag, float32), - real32 - ); - assert_eq!( - int_literal_float_coercion_target(&dag, float32), - Some(IntLiteralFloatCoercionTarget::F32) - ); - } - - #[test] - fn magnitude_out_of_range_accepts_only_exact_int_interval_facts() { - let dag = Dag::new(); - let u8_decl = dag.declaration_by_name("UInt8").expect("UInt8").id; - let d = magnitude_out_of_range( - &BigInt::from(256), - TypeShape::new(u8_decl), - ExactIntIntervalFacts { - target_name: "u8".to_string(), - min_decimal: "0".to_string(), - max_decimal: "255".to_string(), - }, - SourceSpan::new("t.v3", 0, 0), - ); - assert!( - matches!( - d, - Diagnostic::MagnitudeOutOfRange { - ref literal, - ref target, - .. - } if literal == "256" && target == "u8" - ), - "expected MagnitudeOutOfRange, got {d:?}" - ); - } - - #[test] - fn magnitude_out_of_range_unbounded_target_fails_closed_with_resolve_error() { - let dag = Dag::new(); - let int_decl = dag.declaration_by_name("Int").expect("Int in bootstrap").id; - let d = magnitude_out_of_range_for_interval( - &BigInt::from(0), - TypeShape::new(int_decl), - IntervalInt::Unbounded, - SourceSpan::new("t.v3", 0, 0), - ); - assert!( - matches!(d, Diagnostic::ResolveError { .. }), - "expected fail-closed ResolveError, got {d:?}" - ); - } - - #[test] - fn interval_int_unbounded_accepts_sample_literals() { - assert!(IntervalInt::Unbounded.contains_bigint(&BigInt::from(i64::MIN))); - assert!(IntervalInt::Unbounded.contains_bigint(&BigInt::from(i64::MAX))); - } - - #[test] - fn int128_witness_matches_i128_grounding_row_constructors() { - // T-Int128 Slice B1: signed Int128 -> i128 pilot row via Word128Carrier. - let dag = Dag::new(); - assert!( - dag.diagnostics().is_empty(), - "bootstrap diagnostics: {:?}", - dag.diagnostics() - ); - let int128 = dag - .declaration_by_name("Int128") - .expect("Int128 in bootstrap") - .id; - let witness = integer_routing_witness_for_decl(&dag, int128).expect("Int128 witness"); - let grounding_list = dag.rust_grounding_primitives().expect("grounding list"); - let ValueBody::List(elements) = grounding_list.value_body.as_ref().expect("list body") - else { - panic!("expected list"); - }; - let integer_primitive_ctor = rust_primitive_integer_variant_ty(&dag).expect("ctor"); - let mut matched = 0usize; - for element in elements { - let FieldValue::Variant { - constructor, - payload, - } = element - else { - continue; - }; - if *constructor != integer_primitive_ctor { - continue; - } - let FieldValue::Variant { constructor: a, .. } = &payload[1] else { - continue; - }; - let FieldValue::Variant { constructor: c, .. } = &payload[2] else { - continue; - }; - if *a == witness.algebra_variant_ty && *c == witness.carrier_variant_ty { - matched += 1; - } - } - assert_eq!( - matched, 1, - "exactly one grounding IntegerPrimitive row for Int128 witness" - ); - } - - #[test] - fn int128_range_lookup_accepts_all_i64_magnitudes() { - // i128 row's range covers all i64 magnitudes; reconciliation passes - // typical literals through `contains_bigint`. - let dag = Dag::new(); - let int128 = dag - .declaration_by_name("Int128") - .expect("Int128 in bootstrap") - .id; - match integer_range_for_decl(&dag, int128) { - IntegerRangeLookup::Found(bound) => { - assert!(bound.contains_bigint(&BigInt::from(i64::MIN))); - assert!(bound.contains_bigint(&BigInt::from(0))); - assert!(bound.contains_bigint(&BigInt::from(i64::MAX))); - } - IntegerRangeLookup::Missing => panic!("expected Found range for Int128, got Missing"), - IntegerRangeLookup::Invalid(d) => { - panic!("expected Found range for Int128, got Invalid: {d:?}") - } - } - } - - #[test] - fn uint8_witness_matches_u8_grounding_row_constructors() { - let dag = Dag::new(); - assert!( - dag.diagnostics().is_empty(), - "bootstrap diagnostics: {:?}", - dag.diagnostics() - ); - let uint8 = dag - .declaration_by_name("UInt8") - .expect("UInt8 in bootstrap") - .id; - let witness = integer_routing_witness_for_decl(&dag, uint8).expect("UInt8 witness"); - let grounding_list = dag.rust_grounding_primitives().expect("grounding list"); - let ValueBody::List(elements) = grounding_list.value_body.as_ref().expect("list body") - else { - panic!("expected list"); - }; - let integer_primitive_ctor = rust_primitive_integer_variant_ty(&dag).expect("ctor"); - let mut matched = 0usize; - for element in elements { - let FieldValue::Variant { - constructor, - payload, - } = element - else { - continue; - }; - if *constructor != integer_primitive_ctor { - continue; - } - let FieldValue::Variant { constructor: a, .. } = &payload[1] else { - continue; - }; - let FieldValue::Variant { constructor: c, .. } = &payload[2] else { - continue; - }; - if *a == witness.algebra_variant_ty && *c == witness.carrier_variant_ty { - matched += 1; - } - } - assert_eq!( - matched, 1, - "exactly one grounding IntegerPrimitive row for UInt8 witness" - ); - } -} diff --git a/src/v3/compiler/src/integration_rs_wiring_scan.rs b/src/v3/compiler/src/integration_rs_wiring_scan.rs deleted file mode 100644 index 301e3fc9d5d..00000000000 --- a/src/v3/compiler/src/integration_rs_wiring_scan.rs +++ /dev/null @@ -1,362 +0,0 @@ -//! `tests/integration.rs` wiring scanner (Band-C cementing dispatch). -//! -//! SG-0 / INVARIANTS P5: hand-authored Rust under `src/v3/compiler/src/` — keep -//! `EXPECTED_HAND_AUTHORED_NON_TEST` in `tests/integration/sg0_census_test.rs` in lockstep -//! when adding or retiring paths here. -//! -//! **ROADMAP / dissolution:** same **v3 lens capability honesty pass** row as -//! `src/v3/compiler/tests/integration/common/wiring_scanner_test.rs` in `INVARIANTS.md` § SG-0 — -//! Band-C `#[path]` / `mod` wiring is enforced without `syn` until reflected integration facts exist. -//! **Dissolution:** remove this scanner when `tests/integration.rs` cementing module wiring can be -//! validated structurally (no line-oriented scan). Raw/byte string openers in **Code** return -//! `Err` so `CementingDispatchMatchesProjection` surfaces a claim failure instead of aborting the runner. -//! -//! Lives in the compiler crate so `test_runner` can validate -//! `#[path = "integration/cementing/.rs"]` + `mod ;` pairings without -//! duplicating the scanner across test binaries. - -/// `true` when `bytes[i..]` opens a `b"…"`, `br#"…"#`, `r#"…"#`, or `r"…"` literal in -/// Rust source. The wiring scanner does not model these — return an error if they appear -/// in `Code` so Band-C ratchets surface `ClaimResult::Fail` instead of aborting. -fn code_opens_raw_or_byte_string_literal(bytes: &[u8], i: usize) -> bool { - match bytes.get(i) { - Some(b'b') => { - if bytes.get(i + 1) == Some(&b'"') { - return true; - } - if bytes.get(i + 1) == Some(&b'r') { - let mut j = i + 2; - while bytes.get(j) == Some(&b'#') { - j += 1; - } - return bytes.get(j) == Some(&b'"'); - } - false - } - Some(b'r') => { - let mut j = i + 1; - while bytes.get(j) == Some(&b'#') { - j += 1; - } - bytes.get(j) == Some(&b'"') - } - _ => false, - } -} - -/// Byte index after the last byte of a Rust escape sequence starting at `backslash` -/// (`bytes[backslash] == b'\\'`). Matches suffix forms used in character and byte -/// literals (`\n`, `\t`, `\xNN`, `\u{…}`, …). Unicode escapes use **only** the braced -/// `\u{…}` form in modern Rust; there is no separate `\uXXXX` tail to scan. -fn integration_rs_escape_sequence_end(bytes: &[u8], backslash: usize) -> usize { - debug_assert_eq!(bytes.get(backslash), Some(&b'\\')); - let i = backslash + 1; - if i >= bytes.len() { - return bytes.len(); - } - match bytes[i] { - b'x' => (backslash + 4).min(bytes.len()), - b'u' if bytes.get(i + 1) == Some(&b'{') => { - let mut j = i + 2; - while j < bytes.len() && bytes[j] != b'}' { - j += 1; - } - (j + 1).min(bytes.len()) - } - _ => (backslash + 2).min(bytes.len()), - } -} - -#[derive(Clone, Copy, PartialEq, Eq)] -enum IntegrationRsScan { - Code, - LineComment, - BlockComment(u32), - String, - /// Inside `b'…'` after consuming the `b'` prefix. - ByteCharLiteral, - /// Inside `'…'` after consuming the opening `'`. - CharLiteral, -} - -fn integration_rs_reject_raw_string_in_code(bytes: &[u8], i: usize) -> Result<(), String> { - if code_opens_raw_or_byte_string_literal(bytes, i) { - return Err(format!( - "integration_rs wiring scan: raw/byte string literal at byte offset {i} \ - (e.g. r\"…\", r#\"…\"#, b\"…\", br#\"…\"#). Extend IntegrationRsScan before scanning this file." - )); - } - Ok(()) -} - -/// Byte offsets of `needle` in `integration_rs` that occur in **Code** (outside -/// `//`, `/* */`, `"…"` strings, `b'…'` byte literals, and `'…'` character literals). -/// Lifetimes and labels (`'a`, `'static`) are skipped without entering string/literal -/// states. See [`integration_rs_active_line_contains`]. -fn integration_rs_code_substring_positions( - integration_rs: &str, - needle: &str, -) -> Result, String> { - let mut hits = Vec::new(); - if needle.is_empty() { - hits.push(0); - return Ok(hits); - } - let bytes = integration_rs.as_bytes(); - let mut i = 0usize; - let mut state = IntegrationRsScan::Code; - - while i < bytes.len() { - match state { - IntegrationRsScan::Code => { - integration_rs_reject_raw_string_in_code(bytes, i)?; - if bytes[i] == b'/' && i + 1 < bytes.len() { - if bytes[i + 1] == b'/' { - state = IntegrationRsScan::LineComment; - i += 2; - continue; - } - if bytes[i + 1] == b'*' { - state = IntegrationRsScan::BlockComment(1); - i += 2; - continue; - } - } - if bytes.get(i) == Some(&b'b') && bytes.get(i + 1) == Some(&b'\'') { - state = IntegrationRsScan::ByteCharLiteral; - i += 2; - continue; - } - if bytes[i] == b'\'' { - if bytes.get(i + 1) == Some(&b'\\') { - state = IntegrationRsScan::CharLiteral; - i += 1; - continue; - } - if let Some(rest) = integration_rs.get(i + 1..) { - let mut chars = rest.chars(); - if let Some(c) = chars.next() { - let after_char = i + 1 + c.len_utf8(); - if bytes.get(after_char) == Some(&b'\'') { - i = after_char + 1; - continue; - } - } - } - i += 1; - while i < bytes.len() && (bytes[i].is_ascii_alphanumeric() || bytes[i] == b'_') - { - i += 1; - } - continue; - } - if bytes[i] == b'"' { - state = IntegrationRsScan::String; - i += 1; - continue; - } - if integration_rs[i..].starts_with(needle) { - hits.push(i); - } - i += 1; - } - IntegrationRsScan::LineComment => { - if bytes[i] == b'\n' { - state = IntegrationRsScan::Code; - } - i += 1; - } - IntegrationRsScan::BlockComment(depth) => { - if bytes[i] == b'/' && i + 1 < bytes.len() && bytes[i + 1] == b'*' { - state = IntegrationRsScan::BlockComment(depth + 1); - i += 2; - continue; - } - if bytes[i] == b'*' && i + 1 < bytes.len() && bytes[i + 1] == b'/' { - let d = depth - 1; - i += 2; - state = if d == 0 { - IntegrationRsScan::Code - } else { - IntegrationRsScan::BlockComment(d) - }; - continue; - } - i += 1; - } - IntegrationRsScan::String => match bytes[i] { - b'\\' => { - i = (i + 2).min(bytes.len()); - } - b'"' => { - i += 1; - state = IntegrationRsScan::Code; - } - _ => { - i += 1; - } - }, - IntegrationRsScan::ByteCharLiteral => { - if bytes.get(i) == Some(&b'\\') { - i = integration_rs_escape_sequence_end(bytes, i); - } else { - i += 1; - } - if bytes.get(i) == Some(&b'\'') { - i += 1; - } - state = IntegrationRsScan::Code; - } - IntegrationRsScan::CharLiteral => { - if bytes.get(i) == Some(&b'\\') { - i = integration_rs_escape_sequence_end(bytes, i); - } else if let Some(rest) = integration_rs.get(i..) { - let mut ci = rest.chars(); - if let Some(c) = ci.next() { - i += c.len_utf8(); - } else { - state = IntegrationRsScan::Code; - continue; - } - } else { - state = IntegrationRsScan::Code; - continue; - } - if bytes.get(i) == Some(&b'\'') { - i += 1; - } - state = IntegrationRsScan::Code; - } - } - } - Ok(hits) -} - -/// Consume one outer `#[ … ]` attribute (handles quoted `"` regions and nested `[` `]`). -fn skip_rust_attribute(s: &str) -> Option<&str> { - if !s.starts_with("#[") { - return None; - } - let bytes = s.as_bytes(); - let mut i = 1usize; - let mut depth = 0usize; - let mut in_string = false; - let mut escape = false; - while i < bytes.len() { - let b = bytes[i]; - if in_string { - if escape { - escape = false; - i += 1; - continue; - } - if b == b'\\' { - escape = true; - i += 1; - continue; - } - if b == b'"' { - in_string = false; - } - i += 1; - continue; - } - match b { - b'"' => { - in_string = true; - i += 1; - } - b'[' => { - depth += 1; - i += 1; - } - b']' => { - depth = depth.saturating_sub(1); - i += 1; - if depth == 0 { - return Some(&s[i..]); - } - } - _ => { - i += 1; - } - } - } - None -} - -/// After a `#[path = "integration/cementing/.rs"]` attribute in Code, the next -/// Rust item must be `mod ;` (optionally separated by whitespace, newlines, or -/// additional `#[…]` attributes). -fn mod_decl_follows_cementing_path_tail(mut tail: &str, stem: &str) -> bool { - let prefix = format!("mod {stem}"); - loop { - tail = tail.trim_start(); - if tail.is_empty() { - return false; - } - if tail.starts_with("#[") { - let Some(rest) = skip_rust_attribute(tail) else { - return false; - }; - tail = rest; - continue; - } - if !tail.starts_with(&prefix) { - return false; - } - let after_prefix = &tail[prefix.len()..]; - if after_prefix - .chars() - .next() - .is_some_and(|c| c.is_ascii_alphanumeric() || c == '_') - { - // e.g. `mod stem` must not match `mod stem_extra`. - return false; - } - let after = after_prefix.trim_start(); - return after.starts_with(';'); - } -} - -/// `true` when `integration_rs` contains `#[path = "integration/cementing/.rs"]` -/// in **Code** and that attribute is immediately followed (per -/// [`mod_decl_follows_cementing_path_tail`]) by `mod ;`. -/// -/// This is stricter than substring checks for `#[path]` and `mod` separately — it -/// rejects a mismatched `#[path]` on one module paired with a stray `mod ;` -/// elsewhere (`TESTING.md` Band-C dispatch). -pub fn integration_rs_cementing_path_attr_binds_mod_stem( - integration_rs: &str, - stem: &str, -) -> Result { - let path_attr = format!(r#"#[path = "integration/cementing/{stem}.rs"]"#); - for pos in integration_rs_code_substring_positions(integration_rs, &path_attr)? { - let Some(tail) = integration_rs.get(pos + path_attr.len()..) else { - continue; - }; - if mod_decl_follows_cementing_path_tail(tail, stem) { - return Ok(true); - } - } - Ok(false) -} - -/// True when `needle` appears in `integration_rs` **outside** Rust line comments -/// (`//` … including `///` / `//!`), **nested** block comments (`/* … */`), normal -/// `"…"` string literals, `b'…'` byte character literals, and `'…'` character -/// literals (excluding lifetimes / labels such as `'a` or `'static`). -/// -/// Band-C wiring ratchets use this so `#[path = …]` / `mod …;` matches cannot -/// false-green on commented-out or string-embedded copies. Needles are ASCII -/// (`#[path`, `mod foo`); the scan is byte-oriented on UTF-8 boundaries. -/// -/// **Not handled:** raw strings (`r#"…"#`), byte strings (`b"…"`, `br#"…"#`). If those appear in -/// scanned **Code**, this returns `Err` with an explicit message (so `TestPredicate` callers can -/// map to `ClaimResult::Fail`) until `IntegrationRsScan` is widened for those forms. -pub fn integration_rs_active_line_contains( - integration_rs: &str, - needle: &str, -) -> Result { - Ok(!integration_rs_code_substring_positions(integration_rs, needle)?.is_empty()) -} diff --git a/src/v3/compiler/src/lens_cost_target_realization_generated.rs b/src/v3/compiler/src/lens_cost_target_realization_generated.rs deleted file mode 100644 index 75f3e354341..00000000000 --- a/src/v3/compiler/src/lens_cost_target_realization_generated.rs +++ /dev/null @@ -1,27 +0,0 @@ -// AUTO-GENERATED from `src/v3/lenses/cost_target_realization.dag` via -// `emit_rust_module`. Regenerate instead of hand-editing. - -pub fn type_realization_meta(p0: &Dag) -> Option { - (p0).declaration_by_name(&(String::from("TypeRealization"))) - .cloned() -} -pub fn callable_realization_meta(p0: &Dag) -> Option { - (p0).declaration_by_name(&(String::from("CallableRealization"))) - .cloned() -} -pub fn operator_realization_meta(p0: &Dag) -> Option { - (p0).declaration_by_name(&(String::from("OperatorRealization"))) - .cloned() -} -pub fn behavior_realization_meta(p0: &Dag) -> Option { - (p0).declaration_by_name(&(String::from("BehaviorRealization"))) - .cloned() -} -pub fn type_instantiation_realization_meta(p0: &Dag) -> Option { - (p0).declaration_by_name(&(String::from("TypeInstantiationRealization"))) - .cloned() -} -pub fn pattern_realization_meta(p0: &Dag) -> Option { - (p0).declaration_by_name(&(String::from("PatternRealization"))) - .cloned() -} diff --git a/src/v3/compiler/src/lens_declaration_apply.rs b/src/v3/compiler/src/lens_declaration_apply.rs deleted file mode 100644 index 9c0489a9cc7..00000000000 --- a/src/v3/compiler/src/lens_declaration_apply.rs +++ /dev/null @@ -1,2926 +0,0 @@ -//! Bounded lens application (T-LensAPI / D1): interpret `ArrowBody::UserDefined` graphs -//! over substrate-shaped [`FieldValue`] — no whole-claim operator recognizers. -//! -//! **R3 gate #5 (`lens_apply_dot_rs_retired`):** the legacy path -//! `src/v3/compiler/src/lens_apply.rs` is **retired** (path absent from the tree). -//! Bounded lens application and `lens_testgen` live here until PB-Runtime / Row-4 -//! readiness dissolves the host shim, per `docs/r3-program-plan.md` §1.8 and -//! `INVARIANTS` P5(b) deferral language on the tracking PR. - -use std::collections::{HashMap, HashSet}; -use std::str::FromStr; - -use num_bigint::BigInt; - -use crate::dag::{ - literal_bits_int, ArrowBody, AtomPayload, Behavior, BindNode, BranchNode, BranchPattern, Dag, - Declaration, DeclarationId, FieldValue, LiteralBits, OperatorKind, PortId, ProducerLookup, - TransformNode, TransformTarget, TypeConnective, ValueBody, -}; -use crate::evaluator::{ - evaluate_body, EvalFrame, EvalStateStack, EvalStrategy, InputEvaluationOrder, Value, -}; -use crate::infer_helpers::resolve_template_argument_value; - -fn is_fold_instantiation(dag: &Dag, decl: &Declaration) -> bool { - matches!( - &decl.connective, - TypeConnective::Instantiation { template, .. } - if dag.std_list_fold_decl() == Some(*template) - ) -} - -const LENS_APPLY_TYPE_WALK_DEPTH: usize = 32; - -/// Structural eligibility for the monomorphized `std.list.fold` → [`eval_fold_step`] fast path. -/// -/// `eval_fold_step` / `eval_std_fold` are type-erased over accumulator and element shape: they -/// bind acc/elt as opaque [`FieldValue`] to the step `Bind`'s last two params and walk the step -/// body via [`EvalCtx::eval_port`]. The interpretability constraint therefore lives on the step -/// body's transitive [`Behavior`] reachability, not on the resolved type arguments. A step body -/// is eligible iff every reachable producer is one the bounded interpreter can evaluate: -/// [`Behavior::Loop`], non-`UserDefined` [`ArrowBody`], parameterized `Bind` producers, and -/// logical operators are all rejected as fail-closed (matching the interpreter's own -/// [`LensApplyError::UnimplementedLoopBound`] / [`LensApplyError::UnsupportedConstruct`] paths). -/// -/// **Dissolution trigger:** delete this predicate when `eval_loop` and the rejected -/// `Behavior::Bind` / `Logical` paths gain bounded semantics — at that point every fold step -/// body is interpretable and the eligibility gate is vacuous. -fn step_body_eligible_for_bounded_eval(dag: &Dag, step_bind: &BindNode) -> bool { - let mut visited: HashSet = HashSet::new(); - eligibility_walk_port(dag, step_bind.value, &mut visited, 0) -} - -fn eligibility_walk_port( - dag: &Dag, - port: PortId, - visited: &mut HashSet, - depth: usize, -) -> bool { - if depth >= LENS_APPLY_TYPE_WALK_DEPTH { - return false; - } - // Parameter ports (acc/elt of the step `Bind`, formals of any callable we walk into) - // have no producer — they're bound by the interpreter at evaluation time. Treat as - // eligible; only producer-backed nodes contribute interpretability constraints. - // Malformed-substrate states (MissingPort / MissingNode / BindCycle) fail-closed: - // INVARIANTS P3 forbids collapsing them into the legitimate-absence path. - let producer = match dag.resolve_producer_lookup(&port) { - ProducerLookup::NoProducer => return true, - ProducerLookup::Found(b) => b, - ProducerLookup::MissingPort { .. } - | ProducerLookup::MissingNode { .. } - | ProducerLookup::BindCycle { .. } => return false, - }; - match producer { - Behavior::Value(_) => true, - Behavior::Transform(t) => eligibility_walk_transform(dag, t, visited, depth + 1), - Behavior::Branch(b) => eligibility_walk_branch(dag, b, visited, depth + 1), - Behavior::Loop(_) => false, - Behavior::Bind(b) => { - if !b.params.is_empty() { - return false; - } - eligibility_walk_port(dag, b.value, visited, depth + 1) - } - } -} - -fn eligibility_walk_transform( - dag: &Dag, - t: &TransformNode, - visited: &mut HashSet, - depth: usize, -) -> bool { - for input in &t.inputs { - if !eligibility_walk_port(dag, *input, visited, depth + 1) { - return false; - } - } - match &t.target { - TransformTarget::Operator(OperatorKind::Logical(_)) => false, - TransformTarget::Operator(_) - | TransformTarget::UnresolvedFieldProject { .. } - | TransformTarget::ResolvedFieldProject { .. } => true, - TransformTarget::Callable(callee) => { - eligibility_walk_callable(dag, *callee, visited, depth + 1) - } - } -} - -fn eligibility_walk_branch( - dag: &Dag, - b: &BranchNode, - visited: &mut HashSet, - depth: usize, -) -> bool { - if !eligibility_walk_port(dag, b.input, visited, depth + 1) { - return false; - } - for path in &b.paths { - match &path.pattern { - BranchPattern::ResolvedVariant(_) => {} - BranchPattern::UnresolvedVariant { .. } => return false, - } - if !eligibility_walk_port(dag, path.output, visited, depth + 1) { - return false; - } - } - true -} - -fn eligibility_walk_callable( - dag: &Dag, - callee: DeclarationId, - visited: &mut HashSet, - depth: usize, -) -> bool { - if depth >= LENS_APPLY_TYPE_WALK_DEPTH { - return false; - } - if !visited.insert(callee) { - return true; - } - let decl = dag.declaration(callee); - match &decl.connective { - TypeConnective::Instantiation { template, .. } => { - // Nested `std.list.fold` instantiations: the interpreter dispatches the same - // bounded path recursively, so eligibility is conditional on the inner step body. - // For now any nested fold is treated as ineligible — its step body would need to - // be located via `find_fold_step_bind_via_instantiation`, which is the same shape - // recursion this predicate already walks at the outer call site. - if dag.std_list_fold_decl() == Some(*template) { - return false; - } - eligibility_walk_callable(dag, *template, visited, depth + 1) - } - TypeConnective::Arrow { body, .. } => { - let ArrowBody::UserDefined(root) = body else { - return false; - }; - let b = (*root).bind(dag); - eligibility_walk_port(dag, b.value, visited, depth + 1) - } - _ => false, - } -} - -fn declaration_is_callable_type(dag: &Dag, current: DeclarationId, depth: usize) -> bool { - if depth >= LENS_APPLY_TYPE_WALK_DEPTH { - return false; - } - match &dag.declaration(current).connective { - TypeConnective::Arrow { .. } => true, - TypeConnective::Instantiation { template, .. } => { - declaration_is_callable_type(dag, *template, depth + 1) - } - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - declaration_is_callable_type(dag, *next, depth + 1) - } - TypeConnective::Atom(AtomPayload::Literal(_)) - | TypeConnective::Atom(AtomPayload::UnresolvedIdentifier(_)) - | TypeConnective::Atom(AtomPayload::TypeParam(_)) - | TypeConnective::Conj { .. } - | TypeConnective::Disj { .. } - | TypeConnective::Cardinality(_) => false, - } -} - -/// Arrow formals of `std.list.fold` whose types are callable — the step `f` slot. -fn fold_template_callable_formals(dag: &Dag, fold_template: DeclarationId) -> Vec { - let decl = dag.declaration(fold_template); - let TypeConnective::Arrow { inputs, .. } = &decl.connective else { - return Vec::new(); - }; - inputs - .iter() - .copied() - .filter(|&i| declaration_is_callable_type(dag, i, 0)) - .collect() -} - -/// Peel `Instantiation` carriers (same contract as [`LensInterpreter::eval_callable`]) until an -/// `Arrow` with `UserDefined` body; return the root `Bind` when it has ≥2 params (step closure). -fn monomorph_callable_bind_root(dag: &Dag, mut decl_id: DeclarationId) -> Option<&BindNode> { - for _ in 0..LENS_APPLY_TYPE_WALK_DEPTH { - let decl = dag.declaration(decl_id); - match &decl.connective { - TypeConnective::Instantiation { template, .. } => { - if dag.std_list_fold_decl() == Some(*template) { - return None; - } - decl_id = *template; - } - TypeConnective::Arrow { body, .. } => { - let ArrowBody::UserDefined(root) = body else { - return None; - }; - let b = (*root).bind(dag); - return (b.params.len() >= 2).then_some(b); - } - _ => return None, - } - } - None -} - -/// Locate the `|acc, x|` step closure lowered as a two-parameter `Bind` for this `fold` site. -/// -/// Walk `Instantiation.arguments` on the monomorphized fold callee — substrate `DeclarationId` -/// keyed to the template's callable formal — then resolve the step `Arrow` root `Bind`. Matches -/// builder/runtime arity: the step is not a `Transform` input port. No span-overlap recovery — -/// that would not be a declared substrate dependency (Facts Flow Forward). -/// -/// **Dissolution:** attach the step as an explicit `Transform` input / behavior edge and delete -/// this `Instantiation`-walk indirection when lowering guarantees a direct edge. -fn find_fold_step_bind_via_instantiation( - dag: &Dag, - fold_callable_id: DeclarationId, -) -> Option<&BindNode> { - let decl = dag.declaration(fold_callable_id); - let TypeConnective::Instantiation { - template, - arguments, - } = &decl.connective - else { - return None; - }; - if dag.std_list_fold_decl() != Some(*template) { - return None; - } - let formals = fold_template_callable_formals(dag, *template); - let depth_budget = LENS_APPLY_TYPE_WALK_DEPTH as i64; - - for arg in arguments { - let resolved = resolve_template_argument_value(&depth_budget, arguments, arg.value); - let Some(b) = monomorph_callable_bind_root(dag, resolved) else { - continue; - }; - if formals.contains(&arg.parameter) { - return Some(b); - } - } - None -} - -/// WIP gate #2374: R2 evaluator path for lenses whose **runtime inputs are scalar literals only** -/// (`FieldValue::Literal`). Matches PB-runtime-shaped `evaluate` / `evaluate_body` semantics on the -/// lowered lens graph; falls back to [`EvalCtx`] when preconditions fail or evaluation returns a -/// non-literal `Value` this bridge cannot yet map back to [`FieldValue`]. -/// -/// **ProducerLookup discipline:** `ProducerLookup::NoProducer` may fall through to [`EvalCtx`] -/// (`Ok(None)`). Malformed-substrate variants (`MissingPort`, `MissingNode`, `BindCycle`) fail -/// closed as [`LensApplyError`] — they must not collapse into the same silent fallback as legitimate -/// absence (INVARIANTS P2/P3). Evaluator frame/build failures and [`evaluate_body`] errors still -/// return `Ok(None)` so [`EvalCtx`] can recover typed diagnostics (overflow, branch miss, loops). -/// -/// **Not full PB-Runtime retirement:** This helper does **not** complete the Row-4 / -/// interpreter-as-data dissolution by itself; canonical shrink of this module waits on -/// §7.1 receipts. Expand coverage until the bounded-lens host can delete entirely. -/// -/// **Merge:** still gated on §7.1 Row-4 green; this is early signal only. -fn try_apply_lens_via_evaluator_literals_only( - lens_program: &Dag, - root_bind: &BindNode, - inputs: &[FieldValue], -) -> Result, LensApplyError> { - if !inputs.iter().all(|a| matches!(a, FieldValue::Literal(_))) { - return Ok(None); - } - let producer = match lens_program.resolve_producer_lookup(&root_bind.value) { - ProducerLookup::Found(b) => b, - ProducerLookup::NoProducer => return Ok(None), - ProducerLookup::MissingPort { .. } => return Err(LensApplyError::UnresolvedPort), - ProducerLookup::MissingNode { .. } | ProducerLookup::BindCycle { .. } => { - return Err(LensApplyError::MalformedLensRoot); - } - }; - let entry = producer.id(); - let bindings: Vec<(PortId, Value)> = root_bind - .params - .iter() - .zip(inputs.iter()) - .map(|(p, fv)| { - let FieldValue::Literal(bits) = fv else { - unreachable!("filtered to literals above") - }; - (*p, Value::LiteralValue(bits.clone())) - }) - .collect(); - let frame = match EvalFrame::from_bindings(bindings) { - Ok(f) => f, - Err(_) => return Ok(None), - }; - let mut state = EvalStateStack::with_root_frame(frame); - let strategy = EvalStrategy::ApplicativeOrder { - input_order: InputEvaluationOrder::LeftFirst, - }; - let out = match evaluate_body(lens_program, entry, &mut state, strategy) { - Ok(v) => v, - Err(_) => return Ok(None), - }; - match out { - Value::LiteralValue(bits) => Ok(Some(FieldValue::Literal(bits))), - _ => Ok(None), - } -} - -/// Apply a named lens (`Arrow` + `UserDefined` body) from `lens_program` to positional -/// `inputs` (left-to-right with the arrow's formal parameters). -/// -/// When `program_under_test` is `Some`, the R3 fixture lens `auto_loop_parallelism_pending_lens` -/// is evaluated natively against that DAG (iteration-parallelism indicator) so the result is -/// derived from substrate `lane2_workflow` installed during [`crate::compile_to_dag`], not from -/// out-of-band test-runner mutation. -/// -/// **Db18 deviation:** this reads `lane2_workflow` that may have been staged by -/// [`crate::r3_fc_lane2_loop_witness`] from a magic comment — a parallel authority to lowering until -/// the loop workflow is authored from surface syntax. Budget + dissolution: `ROADMAP.md` §"R3 -/// second-batch auto-loop scaffold"; SG-0 pairing class **(b)** on census-touching PRs. -pub fn apply_lens_declaration( - lens_program: &Dag, - program_under_test: Option<&Dag>, - lens_decl_id: DeclarationId, - inputs: &[FieldValue], -) -> Result { - let decl = lens_program.declaration(lens_decl_id); - if let Some(pu) = program_under_test { - if decl.name.as_deref() == Some("auto_loop_parallelism_pending_lens") && inputs.len() == 1 { - let v = pu - .workflow_lane2_subject() - .map(|subject| crate::loop_iteration_parallel_emission_indicator(pu, subject)) - .unwrap_or(0); - return Ok(FieldValue::Literal(LiteralBits::Int(v.to_string()))); - } - } - let TypeConnective::Arrow { - inputs: param_tys, - output: _, - body, - } = &decl.connective - else { - return Err(LensApplyError::NotAnArrow); - }; - let ArrowBody::UserDefined(root) = body else { - return Err(LensApplyError::UnsupportedArrowBody); - }; - if param_tys.len() != inputs.len() { - return Err(LensApplyError::ArityMismatch { - expected: param_tys.len(), - got: inputs.len(), - }); - } - let root_bind = (*root).bind(lens_program); - if root_bind.params.len() != inputs.len() { - return Err(LensApplyError::ArityMismatch { - expected: root_bind.params.len(), - got: inputs.len(), - }); - } - // Reflection (`program_under_test: Some`) supplies rich `FieldValue` shapes the literals-only - // evaluator bridge cannot encode yet — keep `EvalCtx` there until the retirement slice widens. - if program_under_test.is_none() { - if let Some(out) = - try_apply_lens_via_evaluator_literals_only(lens_program, root_bind, inputs)? - { - return Ok(out); - } - } - let mut ctx = EvalCtx::new(lens_program); - for (port, arg) in root_bind.params.iter().zip(inputs.iter()) { - ctx.bind_top(*port, arg.clone()); - } - ctx.eval_port(root_bind.value) -} - -/// Build a substrate-shaped `Dag` record (only `nodes` is populated faithfully) from a -/// compiled program [`Dag`], for lenses like `named_function_count` that read `d.nodes`. -/// -/// Reflection is **complete** per [`docs/design-reflection-completeness.md`](../../docs/design-reflection-completeness.md): -/// every substrate-declared field on each [`Behavior`] variant (and nested carriers such as -/// [`WorkflowEffect`]) projects into [`FieldValue`] with no per-consumer narrowing and no -/// execution semantics (structural `NodeId` / `PortId` references are not followed into -/// callee bodies). -/// -/// `source_file` limits nodes to those authored in that compilation unit (the merged -/// bootstrap graph also lives in the same [`Dag`]). -/// -/// **`id_space` (INVARIANTS P2):** `List` / `Behavior` variant [`DeclarationId`]s in the -/// returned [`FieldValue`] are taken from `id_space` — the same [`Dag`] you pass to -/// [`apply_lens_declaration`] for the lens under test. Shapes still come from `program`'s -/// lowered [`Behavior`] nodes (filtered by `source_file`). Pass `program` for both when the -/// lens and claim program share one compile; pass the canonical lens `Dag` as `id_space` -/// when applying `named_function_count` from the same bytes as `build.rs` splices while -/// reflecting nodes from the claim program. -pub fn reflect_program_dag_nodes_in_file( - program: &Dag, - source_file: &str, - id_space: &Dag, -) -> Result { - let nodes: Vec = program - .nodes() - .iter() - .filter(|b| behavior_source_file(b) == source_file) - .cloned() - .collect(); - let nodes = substrate_reflection::reflect_behavior_list(id_space, &nodes)?; - Ok(FieldValue::Record(vec![("nodes".to_string(), nodes)])) -} - -/// Empty `std.list` spine (`Empty` variant) in the substrate shape expected by `fold`. -pub fn empty_substrate_list_value(dag: &Dag) -> Result { - let (empty_id, _) = v3_list_empty_cons_ids(dag)?; - Ok(FieldValue::Variant { - constructor: empty_id, - payload: vec![], - }) -} - -fn behavior_source_file(behavior: &Behavior) -> &str { - match behavior { - Behavior::Value(v) => v.span.file.as_str(), - Behavior::Transform(t) => t.span.file.as_str(), - Behavior::Branch(b) => b.span.file.as_str(), - Behavior::Loop(l) => l.span.file.as_str(), - Behavior::Bind(b) => b.span.file.as_str(), - } -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum LensApplyError { - NotAnArrow, - UnsupportedArrowBody, - ArityMismatch { - expected: usize, - got: usize, - }, - MalformedLensRoot, - UnsupportedConstruct(&'static str), - TypeMismatch(&'static str), - UnresolvedPort, - UnresolvedBranchPattern, - UnimplementedCallable(String), - UnimplementedLoopBound, - BranchMiss, - BadFieldProject, - BadListShape, - MissingType(&'static str), - MissingValueBody, - /// PR-E: reserved for fold-driver paths that are not yet delegated to - /// [`apply_lens_declaration`] (e.g. `DimensionReport` / lens-instance carriers). - /// Per Q-Reification Option-A (Dag IS the reflected program), the historical - /// `fold_lens_over_reflected_program` reflect-then-apply driver has been retired; - /// callers go through [`apply_lens_declaration`] directly. - UnimplementedLensFold, - /// Substrate → [`FieldValue`] reflection failed (missing sum/variant wiring in id_space). - SubstrateReflect(&'static str), -} - -impl From for LensApplyError { - fn from(e: substrate_reflection::ReflectError) -> Self { - LensApplyError::SubstrateReflect(e.0) - } -} - -/// Lower a declaration [`ValueBody`] into the structural [`FieldValue`] carrier used by the -/// lens interpreter. -/// -/// `fixture_dag` is the graph that will own [`DeclarationId`] edges once structural bodies carry -/// resolvable `Reference` payloads through this helper; today only scalar + shallow structural -/// clone paths are implemented (no `fixture_dag` lookup yet). -pub fn field_value_from_value_body( - #[allow(unused_variables)] fixture_dag: &Dag, - body: &ValueBody, -) -> Result { - match body { - ValueBody::Scalar(bits) => Ok(FieldValue::Literal(bits.clone())), - ValueBody::Structural { fields } => { - let mut out = Vec::with_capacity(fields.len()); - for (label, fv) in fields { - out.push((label.clone(), fv.clone())); - } - Ok(FieldValue::Record(out)) - } - ValueBody::List(values) => Ok(FieldValue::List(values.clone())), - ValueBody::Map(entries) => Ok(FieldValue::Map(entries.clone())), - ValueBody::Unparsed(_) => Err(LensApplyError::UnsupportedConstruct( - "unparsed declaration value body", - )), - } -} - -/// Frame-based evaluation context for D1 lens interpretation. -/// -/// **Complexity / cloning:** port lookups use [`FieldValue::clone`] and list walks -/// clone elements deliberately — bounded R1 gate scope; revisit if lenses iterate -/// over large program DAGs (e.g. T-LaneE). -struct EvalCtx<'a> { - dag: &'a Dag, - frames: Vec>, -} - -impl<'a> EvalCtx<'a> { - fn new(dag: &'a Dag) -> Self { - Self { - dag, - frames: vec![HashMap::new()], - } - } - - fn bind_top(&mut self, port: PortId, value: FieldValue) { - self.frames - .last_mut() - .expect("root frame") - .insert(port.raw(), value); - } - - fn lookup(&self, port: PortId) -> Option { - self.frames - .iter() - .rev() - .find_map(|m| m.get(&port.raw()).cloned()) - } - - fn bind_current(&mut self, port: PortId, value: FieldValue) { - self.frames - .last_mut() - .expect("frame") - .insert(port.raw(), value); - } - - fn push_frame(&mut self) { - self.frames.push(HashMap::new()); - } - - fn pop_frame(&mut self) { - self.frames.pop(); - if self.frames.is_empty() { - panic!("EvalCtx: popped root frame"); - } - } - - fn eval_port(&mut self, port: PortId) -> Result { - if let Some(v) = self.lookup(port) { - return Ok(v); - } - let producer = self - .dag - .resolve_producer_opt(&port) - .ok_or(LensApplyError::UnresolvedPort)?; - let out = match producer { - Behavior::Value(v) => FieldValue::Literal(v.data.clone()), - Behavior::Transform(t) => self.eval_transform(t)?, - Behavior::Branch(b) => self.eval_branch(b, port)?, - Behavior::Loop(l) => self.eval_loop(l)?, - Behavior::Bind(b) => { - // Only top-level lens roots (`apply_lens_declaration`) and fold step - // binds (`eval_fold_step` / `eval_std_fold`) supply parameters; inner - // parameterized `Bind` producers are not interpreted yet. - if b.params.is_empty() { - self.eval_port(b.value)? - } else { - return Err(LensApplyError::UnsupportedConstruct( - "non-root function bind as producer", - )); - } - } - }; - self.bind_current(port, out.clone()); - Ok(out) - } - - fn eval_transform(&mut self, t: &TransformNode) -> Result { - match &t.target { - TransformTarget::Callable(callee) => { - let decl = self.dag.declaration(*callee); - if is_fold_instantiation(self.dag, decl) && t.inputs.len() == 2 { - if let Some(step_bind) = - find_fold_step_bind_via_instantiation(self.dag, *callee) - { - if step_body_eligible_for_bounded_eval(self.dag, step_bind) { - let list = self.eval_port(t.inputs[0])?; - let init = self.eval_port(t.inputs[1])?; - return self.eval_fold_step(list, init, step_bind); - } - } - } - self.eval_callable(*callee, &t.inputs) - } - TransformTarget::Operator(OperatorKind::Arithmetic(op)) => { - if t.inputs.len() != 2 { - return Err(LensApplyError::ArityMismatch { - expected: 2, - got: t.inputs.len(), - }); - } - let a = int_from_value(&self.eval_port(t.inputs[0])?)?; - let b = int_from_value(&self.eval_port(t.inputs[1])?)?; - let n = apply_arithmetic_int(*op, a, b)?; - Ok(FieldValue::Literal(LiteralBits::Int(n.to_string()))) - } - TransformTarget::Operator(OperatorKind::Comparison(op)) => { - if t.inputs.len() != 2 { - return Err(LensApplyError::ArityMismatch { - expected: 2, - got: t.inputs.len(), - }); - } - let lhs = self.eval_port(t.inputs[0])?; - let rhs = self.eval_port(t.inputs[1])?; - let out = match (&lhs, &rhs) { - ( - FieldValue::Literal(LiteralBits::Int(a)), - FieldValue::Literal(LiteralBits::Int(b)), - ) => { - let ai = BigInt::from_str(a).map_err(|_| { - LensApplyError::TypeMismatch("expected decimal Int literal") - })?; - let bi = BigInt::from_str(b).map_err(|_| { - LensApplyError::TypeMismatch("expected decimal Int literal") - })?; - match op { - crate::dag::ComparisonOp::Eq => ai == bi, - crate::dag::ComparisonOp::Ne => ai != bi, - crate::dag::ComparisonOp::Lt => ai < bi, - crate::dag::ComparisonOp::Le => ai <= bi, - crate::dag::ComparisonOp::Gt => ai > bi, - crate::dag::ComparisonOp::Ge => ai >= bi, - } - } - ( - FieldValue::Literal(LiteralBits::String(a)), - FieldValue::Literal(LiteralBits::String(b)), - ) => match op { - crate::dag::ComparisonOp::Eq => a == b, - crate::dag::ComparisonOp::Ne => a != b, - _ => { - return Err(LensApplyError::UnsupportedConstruct( - "string comparison beyond Eq/Ne", - )); - } - }, - _ => { - return Err(LensApplyError::UnsupportedConstruct( - "comparison operands must both be Int literals or both String literals", - )); - } - }; - Ok(FieldValue::Literal(LiteralBits::Bool(out))) - } - TransformTarget::Operator(OperatorKind::Logical(_)) => Err( - LensApplyError::UnsupportedConstruct("logical operator in lens apply"), - ), - TransformTarget::UnresolvedFieldProject { field_label } - | TransformTarget::ResolvedFieldProject { field_label } => { - if t.inputs.len() != 1 { - return Err(LensApplyError::ArityMismatch { - expected: 1, - got: t.inputs.len(), - }); - } - let base = self.eval_port(t.inputs[0])?; - project_field(&base, field_label) - } - } - } - - fn eval_callable( - &mut self, - callee: DeclarationId, - arg_ports: &[PortId], - ) -> Result { - let decl = self.dag.declaration(callee); - if self.dag.std_list_fold_decl() == Some(callee) { - return self.eval_std_fold(arg_ports); - } - if let TypeConnective::Instantiation { template, .. } = &decl.connective { - // Monomorphized user functions (`count_named_bind`, …) lower as `Instantiation` - // carriers; interpretation follows the generic template `Arrow`. - if self.dag.std_list_fold_decl() != Some(*template) { - return self.eval_callable(*template, arg_ports); - } - } - let name = decl.name.clone().unwrap_or_default(); - let TypeConnective::Arrow { - inputs, - output: _, - body, - } = &decl.connective - else { - return Err(LensApplyError::UnimplementedCallable(format!( - "`{name}` (id={}) is not an evaluated callable arrow", - callee.raw() - ))); - }; - let ArrowBody::UserDefined(root) = body else { - return Err(LensApplyError::UnimplementedCallable(format!( - "`{name}` has no UserDefined body" - ))); - }; - if inputs.len() != arg_ports.len() { - return Err(LensApplyError::ArityMismatch { - expected: inputs.len(), - got: arg_ports.len(), - }); - } - let b = (*root).bind(self.dag); - if b.params.len() != arg_ports.len() { - return Err(LensApplyError::ArityMismatch { - expected: b.params.len(), - got: arg_ports.len(), - }); - } - self.push_frame(); - for (param, arg_port) in b.params.iter().zip(arg_ports.iter()) { - let v = self.eval_port(*arg_port)?; - self.bind_current(*param, v); - } - let out = self.eval_port(b.value); - self.pop_frame(); - out - } - - fn eval_fold_step( - &mut self, - list: FieldValue, - init: FieldValue, - step_bind: &BindNode, - ) -> Result { - let n = step_bind.params.len(); - if n < 2 { - return Err(LensApplyError::ArityMismatch { - expected: 2, - got: n, - }); - } - // Monomorphized `fold` lowers the `|acc, x|` lambda with possible leading - // synthesized parameters; the accumulator and element are always the last two - // formal parameter ports. - let acc_param = step_bind.params[n - 2]; - let elt_param = step_bind.params[n - 1]; - let mut acc = init; - for elt in list_elements(self.dag, &list)? { - self.push_frame(); - self.bind_current(acc_param, acc); - self.bind_current(elt_param, elt); - acc = self.eval_port(step_bind.value)?; - self.pop_frame(); - } - Ok(acc) - } - - fn eval_std_fold(&mut self, arg_ports: &[PortId]) -> Result { - if arg_ports.len() != 3 { - return Err(LensApplyError::ArityMismatch { - expected: 3, - got: arg_ports.len(), - }); - } - let list = self.eval_port(arg_ports[0])?; - let init = self.eval_port(arg_ports[1])?; - let step_bind_port = arg_ports[2]; - let step_producer = self - .dag - .resolve_producer_opt(&step_bind_port) - .ok_or(LensApplyError::UnresolvedPort)?; - let Behavior::Bind(step_bind) = step_producer else { - return Err(LensApplyError::UnsupportedConstruct( - "fold step is not a Bind", - )); - }; - let n = step_bind.params.len(); - if n < 2 { - return Err(LensApplyError::ArityMismatch { - expected: 2, - got: n, - }); - } - let acc_param = step_bind.params[n - 2]; - let elt_param = step_bind.params[n - 1]; - let mut acc = init; - for elt in list_elements(self.dag, &list)? { - self.push_frame(); - self.bind_current(acc_param, acc); - self.bind_current(elt_param, elt); - acc = self.eval_port(step_bind.value)?; - self.pop_frame(); - } - Ok(acc) - } - - fn eval_branch( - &mut self, - b: &BranchNode, - out_port: PortId, - ) -> Result { - let disc = self.eval_port(b.input)?; - for path in &b.paths { - let variant_id = match &path.pattern { - BranchPattern::ResolvedVariant(id) => *id, - BranchPattern::UnresolvedVariant { .. } => { - return Err(LensApplyError::UnresolvedBranchPattern); - } - }; - if !variant_matches(self.dag, &disc, variant_id)? { - continue; - } - self.push_frame(); - if let Some(binding) = &path.binding { - let payload = variant_payload_for_binding(self.dag, &disc, variant_id)?; - self.bind_current(binding.payload_port, payload); - } - let v = self.eval_port(path.output)?; - self.pop_frame(); - self.bind_current(out_port, v.clone()); - return Ok(v); - } - Err(LensApplyError::BranchMiss) - } - - /// Loop bodies are intentionally uninterpreted in D1. - /// - /// **Fail-closed receipt:** both `LoopBound::Cardinality` (single-fn recursion) - /// and `LoopBound::Descent` (mutual-recursion clusters) return - /// [`LensApplyError::UnimplementedLoopBound`] until iteration semantics land in - /// this interpreter. - fn eval_loop(&mut self, _l: &crate::dag::LoopNode) -> Result { - Err(LensApplyError::UnimplementedLoopBound) - } -} - -fn int_from_value(v: &FieldValue) -> Result { - match v { - FieldValue::Literal(LiteralBits::Int(s)) => s - .parse::() - .map_err(|_| LensApplyError::TypeMismatch("expected Int literal in i64 range")), - _ => Err(LensApplyError::TypeMismatch("expected Int literal")), - } -} - -/// Checked `Int` arithmetic for the D1 lens interpreter (INVARIANTS P3: no wrapping `+`/`-`/`*`/`/` -/// that could fabricate results or panic in debug under `LensOutputEquals` / gate paths). -fn apply_arithmetic_int( - op: crate::dag::ArithmeticOp, - a: i64, - b: i64, -) -> Result { - const OVERFLOW: LensApplyError = LensApplyError::UnsupportedConstruct("integer overflow"); - match op { - crate::dag::ArithmeticOp::Add => a.checked_add(b).ok_or(OVERFLOW), - crate::dag::ArithmeticOp::Sub => a.checked_sub(b).ok_or(OVERFLOW), - crate::dag::ArithmeticOp::Mul => a.checked_mul(b).ok_or(OVERFLOW), - crate::dag::ArithmeticOp::Div => { - if b == 0 { - return Err(LensApplyError::TypeMismatch("division by zero")); - } - a.checked_div(b).ok_or(OVERFLOW) - } - } -} - -fn project_field(base: &FieldValue, label: &str) -> Result { - let FieldValue::Record(fields) = base else { - return Err(LensApplyError::BadFieldProject); - }; - fields - .iter() - .find(|(l, _)| l == label) - .map(|(_, v)| v.clone()) - .ok_or(LensApplyError::BadFieldProject) -} - -fn variant_matches( - dag: &Dag, - value: &FieldValue, - variant_ty: DeclarationId, -) -> Result { - match value { - FieldValue::Variant { constructor, .. } => Ok(*constructor == variant_ty), - FieldValue::Literal(LiteralBits::Bool(b)) => { - let expected_ty = dag - .bool_runtime_variant_id(*b) - .ok_or(LensApplyError::MissingType("Bool variant"))?; - Ok(expected_ty == variant_ty) - } - _ => Ok(false), - } -} - -fn variant_payload_for_binding( - dag: &Dag, - value: &FieldValue, - variant_ty: DeclarationId, -) -> Result { - if let FieldValue::Literal(LiteralBits::Bool(_)) = value { - if !variant_matches(dag, value, variant_ty)? { - return Err(LensApplyError::BadFieldProject); - } - let conj = dag.declaration(variant_ty); - return match &conj.connective { - TypeConnective::Conj { children } if children.is_empty() => { - Ok(FieldValue::Record(vec![])) - } - TypeConnective::Conj { .. } => Err(LensApplyError::UnsupportedConstruct( - "Bool match arm with payload fields is not supported for Bool literal scrutinee", - )), - _ => Ok(FieldValue::Record(vec![])), - }; - } - let FieldValue::Variant { - constructor, - payload, - } = value - else { - return Err(LensApplyError::BadFieldProject); - }; - if *constructor != variant_ty { - return Err(LensApplyError::BadFieldProject); - } - if payload.len() == 1 { - return Ok(payload[0].clone()); - } - let conj = dag.declaration(variant_ty); - let TypeConnective::Conj { children } = &conj.connective else { - // Unit-like variant (e.g. `True` / `False` / `Empty`). - return Ok(FieldValue::Record(vec![])); - }; - if payload.len() != children.len() { - return Err(LensApplyError::BadFieldProject); - } - let fields: Vec<_> = children - .iter() - .zip(payload.iter()) - .map(|(c, v)| (c.label.clone(), v.clone())) - .collect(); - Ok(FieldValue::Record(fields)) -} - -/// Uncons a substrate `List` spine into owned elements (clones each head). -fn list_elements(dag: &Dag, list: &FieldValue) -> Result, LensApplyError> { - let mut out = Vec::new(); - let mut cur = list; - loop { - let FieldValue::Variant { - constructor, - payload, - } = cur - else { - return Err(LensApplyError::BadListShape); - }; - let label = variant_label(dag, *constructor).ok_or(LensApplyError::BadListShape)?; - match label.as_str() { - "Empty" => break, - "Cons" => { - if payload.len() != 2 { - return Err(LensApplyError::BadListShape); - } - out.push(payload[0].clone()); - cur = &payload[1]; - } - _ => return Err(LensApplyError::BadListShape), - } - } - Ok(out) -} - -// perf: linear scan over all declarations per variant id — fine for R1 gate DAGs; -// revisit if lenses iterate over large programs (prefer declaration-indexed lookup). -fn variant_label(dag: &Dag, variant_id: DeclarationId) -> Option { - dag.declarations() - .iter() - .find_map(|decl| match &decl.connective { - TypeConnective::Disj { variants } => variants - .iter() - .find(|variant| variant.ty == variant_id) - .map(|variant| variant.label.clone()), - _ => None, - }) -} - -// perf: linear scan for `List` disj — same bounded-gate rationale as `variant_label`. -fn v3_list_empty_cons_ids(dag: &Dag) -> Result<(DeclarationId, DeclarationId), LensApplyError> { - let list_decl = dag.declarations().iter().find(|d| { - d.name.as_deref() == Some("List") && matches!(d.connective, TypeConnective::Disj { .. }) - }); - let Some(list_decl) = list_decl else { - return Err(LensApplyError::MissingType("List")); - }; - let TypeConnective::Disj { variants } = &list_decl.connective else { - return Err(LensApplyError::MissingType("List")); - }; - let empty = variants - .iter() - .find(|v| v.label == "Empty") - .ok_or(LensApplyError::MissingType("List.Empty"))? - .ty; - let cons = variants - .iter() - .find(|v| v.label == "Cons") - .ok_or(LensApplyError::MissingType("List.Cons"))? - .ty; - Ok((empty, cons)) -} - -/// Fixed `(a, b, c)` triples for R1 `AlgebraicLaw(Associativity, …)` operational checks. -/// -/// A **single** triple can pass for operations that are not associative (coincidence). The -/// runner requires **every** triple here to satisfy [`int_associativity_holds`] — still not a -/// quantified substrate law proof, but a materially stronger witness than one sample. Magnitudes -/// stay modest so `Int` addition-style lenses do not overflow during witness application. -pub const ASSOCIATIVITY_WITNESS_TRIPLES: &[(i64, i64, i64)] = &[ - (2, 3, 5), - (0, 1, 99), - (-3, 7, 2), - (-1, 0, 1), - (1, 1, 2), - (5, 0, 3), - (10, -4, 7), - (100, 200, 300), -]; - -/// Fixed `(a, b)` pairs for PR-B.3 `AlgebraicLaw(Commutativity, …)` operational checks. -/// -/// These are runner witnesses, not substrate law proofs. The sample table lives next to the -/// associativity table so law-runner scaffolds share one bounded Int witness authority until -/// first-class substrate law witnesses dissolve the runner-side sample checks. -pub const COMMUTATIVITY_WITNESS_PAIRS: &[(i64, i64)] = &[ - (2, 3), - (0, 99), - (-3, 7), - (-1, 0), - (1, 1), - (5, 0), - (10, -4), - (100, 200), -]; - -/// Samples for `AlgebraicLaw(Identity, …)` operational checks: **every** value must appear in at -/// least one [`COMMUTATIVITY_WITNESS_PAIRS`] coordinate so identity witnessing stays materially -/// aligned with the commutativity witness authority (still not a substrate law proof). -pub const IDENTITY_WITNESS_SAMPLES: &[i64] = &[-4, -3, -1, 0, 1, 2, 3, 5, 7, 10, 99, 100, 200]; - -/// Candidate identity elements searched left-to-right; exactly one must satisfy -/// `e ⊕ a = a` and `a ⊕ e = a` for every sample in [`IDENTITY_WITNESS_SAMPLES`]. Multiple matches -/// fail closed (`Ok(false)`) so incidental finite-table coincidences cannot certify an ambiguous op. -/// -/// **High-end redundancy:** keep **at least two** entries **strictly greater** than -/// `max(IDENTITY_WITNESS_SAMPLES)` (currently `200`). With only one such candidate, a binary `Int` -/// lens behaving like `min` can satisfy the finite witness with a unique “top-like” constant even -/// though `Int` has no lattice top (INVARIANTS P1/P3; codex PR #2394). Several candidates also sit -/// below `min(samples)` so `max`-like ops typically hit the same multiplicity fail-closure. -pub const IDENTITY_WITNESS_CANDIDATES: &[i64] = &[ - -300, -200, -100, -99, -10, -7, -5, -4, -3, -2, -1, 0, 1, 2, 3, 5, 7, 10, 99, 100, 200, 250, - 300, 400, -]; - -/// Evaluate `(a ⊕ b) ⊕ c` vs `a ⊕ (b ⊕ c)` for a binary `Int` lens using [`apply_lens_declaration`]. -pub fn int_associativity_holds( - program_dag: &Dag, - lens_decl_id: DeclarationId, - a: i64, - b: i64, - c: i64, -) -> Result { - let int = |n: i64| FieldValue::Literal(literal_bits_int(n)); - let left_ab = apply_lens_declaration(program_dag, None, lens_decl_id, &[int(a), int(b)])?; - let left = apply_lens_declaration(program_dag, None, lens_decl_id, &[left_ab, int(c)])?; - let right_bc = apply_lens_declaration(program_dag, None, lens_decl_id, &[int(b), int(c)])?; - let right = apply_lens_declaration(program_dag, None, lens_decl_id, &[int(a), right_bc])?; - Ok(left == right) -} - -/// True iff [`int_associativity_holds`] succeeds for every triple in `triples`. -pub fn int_associativity_holds_all_triples( - program_dag: &Dag, - lens_decl_id: DeclarationId, - triples: &[(i64, i64, i64)], -) -> Result { - for &(a, b, c) in triples { - if !int_associativity_holds(program_dag, lens_decl_id, a, b, c)? { - return Ok(false); - } - } - Ok(true) -} - -/// True iff exactly one `e` in `candidates` satisfies left/right identity against every `samples` -/// entry via [`apply_lens_declaration`]. -pub fn int_identity_witness_holds( - program_dag: &Dag, - lens_decl_id: DeclarationId, - samples: &[i64], - candidates: &[i64], -) -> Result { - let int = |n: i64| FieldValue::Literal(literal_bits_int(n)); - let mut matching = 0_i32; - for &e in candidates { - let ev = int(e); - let mut ok = true; - for &a in samples { - let left = - apply_lens_declaration(program_dag, None, lens_decl_id, &[ev.clone(), int(a)])?; - let right = - apply_lens_declaration(program_dag, None, lens_decl_id, &[int(a), ev.clone()])?; - if left != int(a) || right != int(a) { - ok = false; - break; - } - } - if ok { - matching += 1; - if matching > 1 { - return Ok(false); - } - } - } - Ok(matching == 1) -} - -const _: () = assert!(IDENTITY_WITNESS_SAMPLES.len() > 1); -const _: () = assert!(IDENTITY_WITNESS_CANDIDATES.len() > 1); - -#[cfg(test)] -mod tests { - use super::*; - use crate::compile_to_dag; - use crate::dag::{Behavior, LoopBound}; - - #[test] - fn named_function_count_on_trivial_program() { - let src = include_str!("../../lenses/named_function_count.dag"); - let lens_dag = - compile_to_dag(src, "src/v3/lenses/named_function_count.dag").expect("lens compiles"); - let prog = compile_to_dag("let x: Int = 1", "lens_apply_prog.v3").expect("prog compiles"); - let lens_id = lens_dag - .declaration_by_name("named_function_count") - .expect("named_function_count") - .id; - let input = reflect_program_dag_nodes_in_file(&prog, "lens_apply_prog.v3", &lens_dag) - .expect("reflect"); - let out = apply_lens_declaration(&lens_dag, None, lens_id, &[input]).expect("apply"); - assert_eq!(out, FieldValue::Literal(literal_bits_int(1))); - } - - #[test] - fn identity_witness_samples_align_with_commutativity_witness_authority() { - for &s in IDENTITY_WITNESS_SAMPLES { - assert!( - COMMUTATIVITY_WITNESS_PAIRS - .iter() - .any(|&(a, b)| a == s || b == s), - "every IDENTITY_WITNESS_SAMPLES entry must appear in COMMUTATIVITY_WITNESS_PAIRS \ - (doc invariant on IDENTITY_WITNESS_SAMPLES); missing sample {s}" - ); - } - } - - #[test] - fn identity_witness_candidate_table_has_redundant_high_and_low_extents() { - let sample_min = *IDENTITY_WITNESS_SAMPLES.iter().min().unwrap(); - let sample_max = *IDENTITY_WITNESS_SAMPLES.iter().max().unwrap(); - let highs: Vec = IDENTITY_WITNESS_CANDIDATES - .iter() - .copied() - .filter(|&c| c > sample_max) - .collect(); - let lows: Vec = IDENTITY_WITNESS_CANDIDATES - .iter() - .copied() - .filter(|&c| c < sample_min) - .collect(); - assert!( - highs.len() >= 2, - "need ≥2 candidates strictly above sample max ({sample_max}) so min-like lenses cannot \ - mint a unique false identity; got {highs:?}" - ); - assert!( - lows.len() >= 2, - "need ≥2 candidates strictly below sample min ({sample_min}) for symmetric fail-closure \ - skew; got {lows:?}" - ); - } - - #[test] - fn int_add_lens_associativity_sample() { - let src = r#"module w -fn lens_composition_op(a: Int, b: Int) -> Int = a + b -"#; - let dag = compile_to_dag(src, "assoc.v3").expect("compiles"); - let id = dag.declaration_by_name("lens_composition_op").unwrap().id; - assert!( - int_associativity_holds_all_triples(&dag, id, ASSOCIATIVITY_WITNESS_TRIPLES) - .expect("assoc witness"), - "Int `+` lens must pass every ASSOCIATIVITY_WITNESS_TRIPLES entry" - ); - } - - #[test] - fn literals_only_evaluator_bridge_agrees_with_eval_ctx_for_int_add() { - let src = r#"module w -fn lens_composition_op(a: Int, b: Int) -> Int = a + b -"#; - let dag = compile_to_dag(src, "eval_bridge_vs_ctx.v3").expect("compiles"); - let lens_decl_id = dag.declaration_by_name("lens_composition_op").unwrap().id; - let decl = dag.declaration(lens_decl_id); - let TypeConnective::Arrow { body, .. } = &decl.connective else { - panic!("expected arrow lens"); - }; - let ArrowBody::UserDefined(root) = body else { - panic!("expected user-defined arrow body"); - }; - let root_bind = (*root).bind(&dag); - let inputs = &[ - FieldValue::Literal(literal_bits_int(11)), - FieldValue::Literal(literal_bits_int(-3)), - ]; - let via_bridge = super::try_apply_lens_via_evaluator_literals_only(&dag, root_bind, inputs) - .expect("evaluator bridge lookup") - .expect("literal Int add must succeed on evaluator bridge"); - let mut ctx = EvalCtx::new(&dag); - for (port, arg) in root_bind.params.iter().zip(inputs.iter()) { - ctx.bind_top(*port, arg.clone()); - } - let via_ctx = ctx.eval_port(root_bind.value).expect("eval ctx"); - assert_eq!(via_bridge, via_ctx); - } - - #[test] - fn literals_only_with_program_under_test_skips_bridge_matches_bare_apply() { - let lens_src = r#"module w -fn lens_composition_op(a: Int, b: Int) -> Int = a + b -"#; - let lens_dag = compile_to_dag(lens_src, "reflect_skip_bridge_lens.v3").expect("compiles"); - let prog_under_test = - compile_to_dag("let x: Int = 1", "reflect_skip_bridge_prog.v3").expect("prog compiles"); - let id = lens_dag - .declaration_by_name("lens_composition_op") - .unwrap() - .id; - let inputs = &[ - FieldValue::Literal(literal_bits_int(5)), - FieldValue::Literal(literal_bits_int(7)), - ]; - let bare = apply_lens_declaration(&lens_dag, None, id, inputs).expect("bare apply"); - let with_put = - apply_lens_declaration(&lens_dag, Some(&prog_under_test), id, inputs).expect("put"); - assert_eq!(bare, with_put); - } - - #[test] - fn int_add_lens_identity_witness_finds_zero_uniquely() { - let src = r#"module w -fn lens_composition_op(a: Int, b: Int) -> Int = a + b -"#; - let dag = compile_to_dag(src, "id_add.v3").expect("compiles"); - let id = dag.declaration_by_name("lens_composition_op").unwrap().id; - assert!( - super::int_identity_witness_holds( - &dag, - id, - IDENTITY_WITNESS_SAMPLES, - IDENTITY_WITNESS_CANDIDATES - ) - .expect("identity witness"), - "Int `+` lens identity must be uniquely 0 on the bounded witness tables" - ); - } - - #[test] - fn int_mul_lens_identity_witness_finds_one_uniquely() { - let src = r#"module w -fn lens_mul_op(a: Int, b: Int) -> Int = a * b -"#; - let dag = compile_to_dag(src, "id_mul.v3").expect("compiles"); - let id = dag.declaration_by_name("lens_mul_op").unwrap().id; - assert!( - super::int_identity_witness_holds( - &dag, - id, - IDENTITY_WITNESS_SAMPLES, - IDENTITY_WITNESS_CANDIDATES - ) - .expect("identity witness"), - "Int `*` lens identity must be uniquely 1 on the bounded witness tables" - ); - } - - #[test] - fn int_min_lens_identity_witness_fails_closed_on_ambiguous_top_candidates() { - let src = r#"module w -fn lens_min_op(a: Int, b: Int) -> Int = if a < b then a else b -"#; - let dag = compile_to_dag(src, "id_min.v3").expect("compiles"); - let id = dag.declaration_by_name("lens_min_op").unwrap().id; - assert!( - !super::int_identity_witness_holds( - &dag, - id, - IDENTITY_WITNESS_SAMPLES, - IDENTITY_WITNESS_CANDIDATES - ) - .expect("identity witness"), - "binary Int min has no identity on bounded samples; bounded witness must fail closed" - ); - } - - #[test] - fn int_add_overflow_returns_lens_apply_error_not_wrapped_value() { - let src = r#"module m -fn f(a: Int, b: Int) -> Int = a + b -"#; - let dag = compile_to_dag(src, "int_ovf.v3").expect("compiles"); - let id = dag.declaration_by_name("f").unwrap().id; - let err = apply_lens_declaration( - &dag, - None, - id, - &[ - FieldValue::Literal(literal_bits_int(i64::MAX)), - FieldValue::Literal(literal_bits_int(1)), - ], - ) - .expect_err("overflow must not yield a wrapped Int"); - assert!( - matches!( - err, - super::LensApplyError::UnsupportedConstruct("integer overflow") - ), - "{err:?}" - ); - } - - #[test] - fn empty_fold_returns_init() { - let src = r#"module m -import std.list { List, fold } - -fn sum(xs: List) -> Int = - fold(xs, 99, |acc, x| acc + x) -"#; - let dag = compile_to_dag(src, "empty_fold.v3").expect("compiles"); - let sum_id = dag.declaration_by_name("sum").expect("sum").id; - let empty = empty_substrate_list_value(&dag).expect("empty list"); - let out = apply_lens_declaration(&dag, None, sum_id, &[empty]).expect("fold empty"); - assert_eq!(out, FieldValue::Literal(literal_bits_int(99))); - } - - #[test] - fn monomorphized_fold_step_bind_recovered_via_instantiation_arguments() { - let src = r#"module m -import std.list { List, fold } - -fn sum(xs: List) -> Int = - fold(xs, 99, |acc, x| acc + x) -"#; - let dag = compile_to_dag(src, "mono_fold_bind_paths.v3").expect("compiles"); - let fold_transform = dag - .nodes() - .iter() - .find_map(|n| { - let Behavior::Transform(t) = n else { - return None; - }; - let TransformTarget::Callable(callee) = &t.target else { - return None; - }; - super::is_fold_instantiation(&dag, dag.declaration(*callee)).then_some(t) - }) - .expect("monomorphized fold transform"); - let TransformTarget::Callable(callee) = &fold_transform.target else { - unreachable!(); - }; - super::find_fold_step_bind_via_instantiation(&dag, *callee).expect("fold step bind"); - } - - #[test] - fn fold_step_lookup_requires_template_formal_edge() { - let src = r#"module m -import std.list { List, fold } - -fn sum(xs: List) -> Int = - fold(xs, 99, |acc, x| acc + x) -"#; - let mut dag = compile_to_dag(src, "mono_fold_bind_no_formal_edge.v3").expect("compiles"); - let fold_callable = dag - .nodes() - .iter() - .find_map(|n| { - let Behavior::Transform(t) = n else { - return None; - }; - let TransformTarget::Callable(callee) = &t.target else { - return None; - }; - super::is_fold_instantiation(&dag, dag.declaration(*callee)).then_some(*callee) - }) - .expect("monomorphized fold transform"); - let TypeConnective::Instantiation { - template, - arguments, - } = &dag.declaration(fold_callable).connective - else { - panic!("fold callable should be an Instantiation"); - }; - let formals = super::fold_template_callable_formals(&dag, *template); - let depth_budget = LENS_APPLY_TYPE_WALK_DEPTH as i64; - let callable_arg_index = arguments - .iter() - .position(|arg| { - let resolved = resolve_template_argument_value(&depth_budget, arguments, arg.value); - super::monomorph_callable_bind_root(&dag, resolved).is_some() - && formals.contains(&arg.parameter) - }) - .expect("callable fold argument"); - let non_formal_parameter = arguments - .iter() - .map(|arg| arg.parameter) - .find(|parameter| !formals.contains(parameter)) - .expect("non-callable fold formal parameter"); - - let TypeConnective::Instantiation { arguments, .. } = - &mut dag.declaration_mut(fold_callable).connective - else { - panic!("fold callable should remain an Instantiation"); - }; - arguments[callable_arg_index].parameter = non_formal_parameter; - - assert!( - super::find_fold_step_bind_via_instantiation(&dag, fold_callable).is_none(), - "unique callable candidates must not be accepted without the template-formal edge" - ); - } - - #[test] - fn comparison_operator_returns_bool_literal_not_sum_variant() { - let src = r#"module m -fn truth() -> Bool = 1 == 1 -"#; - let dag = compile_to_dag(src, "truth.v3").expect("compiles"); - let id = dag.declaration_by_name("truth").unwrap().id; - let out = apply_lens_declaration(&dag, None, id, &[]).expect("apply"); - assert_eq!(out, FieldValue::Literal(LiteralBits::Bool(true))); - } - - #[test] - fn bool_literal_scrutinee_selects_disj_match_arm() { - let src = r#"module m -fn p(b: Bool) -> Int = match b { True => 1, False => 0 } -"#; - let dag = compile_to_dag(src, "bool_lit_match.v3").expect("compiles"); - let id = dag.declaration_by_name("p").unwrap().id; - let out = apply_lens_declaration( - &dag, - None, - id, - &[FieldValue::Literal(LiteralBits::Bool(true))], - ) - .expect("apply"); - assert_eq!(out, FieldValue::Literal(literal_bits_int(1))); - } - - #[test] - fn mutual_recursion_lens_hits_unimplemented_loop_for_descent_cluster() { - let src = r#"module m -fn even(n: Int) -> Bool = if n == 0 then true else odd(n - 1) -fn odd(n: Int) -> Bool = if n == 0 then false else even(n - 1) -fn run_even(n: Int) -> Bool = even(n) -"#; - let dag = compile_to_dag(src, "mutual_lens.v3").expect("compiles"); - assert!( - dag.nodes() - .iter() - .filter_map(Behavior::as_loop) - .any(|l| { matches!(l.bound, LoopBound::Descent { .. }) }), - "expected at least one LoopBound::Descent (mutual cluster)" - ); - let run_even = dag.declaration_by_name("run_even").expect("run_even").id; - let err = apply_lens_declaration( - &dag, - None, - run_even, - &[FieldValue::Literal(literal_bits_int(1))], - ) - .expect_err("loop interpretation is unimplemented"); - assert!( - matches!(err, LensApplyError::UnimplementedLoopBound), - "expected UnimplementedLoopBound, got {err:?}" - ); - } - - #[test] - fn apply_lens_declaration_arity_mismatch() { - let src = r#"module m -fn f(a: Int, b: Int) -> Int = a + b -"#; - let dag = compile_to_dag(src, "arity.v3").expect("compiles"); - let id = dag.declaration_by_name("f").unwrap().id; - let err = - apply_lens_declaration(&dag, None, id, &[FieldValue::Literal(literal_bits_int(1))]) - .expect_err("wrong arity"); - assert!( - matches!( - err, - LensApplyError::ArityMismatch { - expected: 2, - got: 1 - } - ), - "{err:?}" - ); - } - - #[test] - fn eligible_fold_runs_through_bounded_path() { - // Step body is `acc + x` — no Loop, no unsupported construct in transitive call graph. - // The structural eligibility predicate must approve and the bounded fast path must - // produce the sum. - let src = r#"module m -import std.list { List, fold } - -fn sum(xs: List) -> Int = - fold(xs, 0, |acc, x| acc + x) -"#; - let dag = compile_to_dag(src, "eligible_fold.v3").expect("compiles"); - let sum_id = dag.declaration_by_name("sum").expect("sum").id; - let (empty_id, cons_id) = super::v3_list_empty_cons_ids(&dag).expect("list ids"); - let int = |n: i64| FieldValue::Literal(literal_bits_int(n)); - let mut list = FieldValue::Variant { - constructor: empty_id, - payload: vec![], - }; - for n in [3i64, 2, 1] { - list = FieldValue::Variant { - constructor: cons_id, - payload: vec![int(n), list], - }; - } - let out = apply_lens_declaration(&dag, None, sum_id, &[list]).expect("eligible fold runs"); - assert_eq!(out, int(6)); - } - - #[test] - fn ineligible_fold_with_recursive_step_skips_bounded_path() { - // `helper` is self-recursive → lowers to a `LoopNode` in the step body's transitive - // call graph. The structural eligibility predicate must reject; the bounded fast path - // is bypassed; `eval_callable` rejects the monomorphized `Instantiation { template: - // fold }` with `UnimplementedCallable` (fail-closed, vs running and hitting - // `UnimplementedLoopBound` deeper in). - let src = r#"module m -import std.list { List, fold } - -fn helper(n: Int) -> Int = if n == 0 then 0 else helper(n - 1) + 1 -fn sum(xs: List) -> Int = - fold(xs, 0, |acc, x| acc + helper(x)) -"#; - let dag = compile_to_dag(src, "ineligible_fold.v3").expect("compiles"); - let sum_id = dag.declaration_by_name("sum").expect("sum").id; - let (_, cons_id) = super::v3_list_empty_cons_ids(&dag).expect("list ids"); - let empty = empty_substrate_list_value(&dag).expect("empty list"); - let one = FieldValue::Variant { - constructor: cons_id, - payload: vec![FieldValue::Literal(literal_bits_int(1)), empty], - }; - let err = - apply_lens_declaration(&dag, None, sum_id, &[one]).expect_err("ineligible step body"); - assert!( - matches!(err, LensApplyError::UnimplementedCallable(_)), - "{err:?}" - ); - } - - #[test] - fn branch_miss_when_scrutinee_matches_no_arm() { - let src = r#"module m -fn p(b: Bool) -> Int = match b { True => 1, False => 0 } -"#; - let dag = compile_to_dag(src, "branch_miss.v3").expect("compiles"); - let id = dag.declaration_by_name("p").unwrap().id; - let err = - apply_lens_declaration(&dag, None, id, &[FieldValue::Literal(literal_bits_int(42))]) - .expect_err("Int is not True/False"); - assert!(matches!(err, LensApplyError::BranchMiss), "{err:?}"); - } -} - -// Substrate ↔ `FieldValue` structural reflection (design-reflection-completeness). -// SG-0: folded under this file — the census forbids a new sibling `substrate_reflection.rs`. -mod substrate_reflection { - //! Complete structural reflection of computation-substrate [`Behavior`] nodes into - //! lens-input [`FieldValue`] per `docs/design-reflection-completeness.md` (LOCKED). - //! Reflection is static: no execution, no branch-arm selection, no loop iteration. - - use crate::dag::{ - AtomPayload, Behavior, BindEmitParticipation, BindNode, BoolPortRef, BranchArm, - BranchEmitParticipation, BranchNode, BranchPattern, CardinalityBound, ClusterId, Dag, - DeclarationId, FieldMap, FieldValue, HttpMethodScalar, LiteralBits, LoopBound, LoopNode, - NodeId, NonSingletonList, Operation, OperatorKind, Path, PayloadBinding, PortId, - TransformNode, TransformTarget, TypeConnective, UrlPathToken, ValueNode, WorkflowEffect, - }; - use crate::diagnostics::SourceSpan; - - #[derive(Debug, Clone, PartialEq, Eq)] - pub struct ReflectError(pub &'static str); - - pub type ReflectResult = Result; - - fn err(msg: &'static str) -> ReflectResult { - Err(ReflectError(msg)) - } - - fn disj_variant_ty( - dag: &Dag, - sum_name: &str, - variant_label: &str, - ) -> ReflectResult { - let mut decl_id = dag - .declaration_by_name(sum_name) - .ok_or(ReflectError("missing sum type"))? - .id; - const PEEL_MAX: usize = 64; - for _ in 0..PEEL_MAX { - let decl = dag.declaration(decl_id); - match &decl.connective { - TypeConnective::Instantiation { - template, - arguments, - } if arguments.is_empty() => { - decl_id = *template; - } - TypeConnective::Disj { variants } => { - return variants - .iter() - .find(|v| v.label == variant_label) - .map(|v| v.ty) - .ok_or(ReflectError("missing sum variant")); - } - TypeConnective::Atom(AtomPayload::UnresolvedIdentifier(name)) - if name == variant_label => - { - // Single-variant enum: `Instantiation → Atom(Label)` (no `Disj` row). - return Ok(decl_id); - } - _ => return err("sum type is not Disj or unit Atom"), - } - } - err("Instantiation peel depth exceeded") - } - - fn port_fv(p: PortId) -> FieldValue { - FieldValue::Literal(LiteralBits::Int(i64::from(p.raw()).to_string())) - } - - fn node_fv(n: NodeId) -> FieldValue { - FieldValue::Literal(LiteralBits::Int(i64::from(n.raw()).to_string())) - } - - fn cluster_fv(c: ClusterId) -> FieldValue { - FieldValue::Literal(LiteralBits::Int(i64::from(c.raw()).to_string())) - } - - fn reflect_source_span(span: &SourceSpan) -> FieldValue { - // Field names must match `type SourceSpan` in `dsl/std/types.dag` (`file`, `start`, `end`). - // The Rust carrier still uses `byte_start` / `byte_end` on [`SourceSpan`]. - FieldValue::Record(vec![ - ( - "file".to_string(), - FieldValue::Literal(LiteralBits::String(span.file.clone())), - ), - ( - "start".to_string(), - FieldValue::Literal(LiteralBits::Int(i64::from(span.byte_start).to_string())), - ), - ( - "end".to_string(), - FieldValue::Literal(LiteralBits::Int(i64::from(span.byte_end).to_string())), - ), - ]) - } - - fn v3_list_empty_cons_ids(dag: &Dag) -> ReflectResult<(DeclarationId, DeclarationId)> { - let list_decl = dag.declarations().iter().find(|d| { - d.name.as_deref() == Some("List") && matches!(d.connective, TypeConnective::Disj { .. }) - }); - let Some(list_decl) = list_decl else { - return err("List"); - }; - let TypeConnective::Disj { variants } = &list_decl.connective else { - return err("List"); - }; - let empty = variants - .iter() - .find(|v| v.label == "Empty") - .ok_or(ReflectError("List.Empty"))? - .ty; - let cons = variants - .iter() - .find(|v| v.label == "Cons") - .ok_or(ReflectError("List.Cons"))? - .ty; - Ok((empty, cons)) - } - - fn named_record_type_root(dag: &Dag, name: &str) -> ReflectResult { - let mut decl_id = dag - .declaration_by_name(name) - .ok_or(ReflectError("missing substrate record type"))? - .id; - const PEEL_MAX: usize = 64; - for _ in 0..PEEL_MAX { - match &dag.declaration(decl_id).connective { - TypeConnective::Conj { .. } => return Ok(decl_id), - TypeConnective::Instantiation { - template, - arguments, - } if arguments.is_empty() => { - decl_id = *template; - } - _ => return err("substrate record type is not Conj"), - } - } - err("substrate record peel depth exceeded") - } - - fn conj_field_ty( - dag: &Dag, - conj_decl_id: DeclarationId, - label: &str, - ) -> ReflectResult { - let decl = dag.declaration(conj_decl_id); - let TypeConnective::Conj { children } = &decl.connective else { - return err("expected Conj"); - }; - children - .iter() - .find(|c| c.label == label) - .map(|c| c.ty) - .ok_or(ReflectError("missing Conj field")) - } - - /// [`FieldValue::Variant::payload`] is **positional**: one entry per field of the - /// variant payload [`TypeConnective::Conj`], in `children` order — same contract as - /// `variant_payload_for_binding` in this file. - fn sum_variant_payload( - dag: &Dag, - sum_name: &str, - variant_label: &str, - payload: Vec, - ) -> ReflectResult { - let ctor_ty = disj_variant_ty(dag, sum_name, variant_label)?; - match &dag.declaration(ctor_ty).connective { - TypeConnective::Conj { children } => { - if children.len() != payload.len() { - return err("sum variant payload arity mismatch"); - } - } - _ => { - if payload.len() > 1 { - return err("sum variant payload arity mismatch"); - } - } - } - Ok(FieldValue::Variant { - constructor: ctor_ty, - payload, - }) - } - - fn peel_to_optional_cardinality_decl( - dag: &Dag, - mut ty: DeclarationId, - ) -> ReflectResult { - const PEEL_MAX: usize = 64; - for _ in 0..PEEL_MAX { - match &dag.declaration(ty).connective { - TypeConnective::Cardinality(p) if p.bound() == CardinalityBound::AtMostOne => { - return Ok(ty); - } - TypeConnective::Instantiation { template, .. } => ty = *template, - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => ty = *next, - _ => return err("expected optional T? cardinality"), - } - } - err("optional cardinality peel depth exceeded") - } - - fn optional_some_none_constructor_ids( - dag: &Dag, - cardinality_decl_id: DeclarationId, - ) -> ReflectResult<(DeclarationId, DeclarationId)> { - let disj_id = dag - .optional_match_disj(cardinality_decl_id) - .ok_or(ReflectError("missing optional Some/None sum"))?; - let decl = dag.declaration(disj_id); - let TypeConnective::Disj { variants } = &decl.connective else { - return err("optional match row is not Disj"); - }; - let some_ty = variants - .iter() - .find(|v| v.label == "Some") - .ok_or(ReflectError("Some"))? - .ty; - let none_ty = variants - .iter() - .find(|v| v.label == "None") - .ok_or(ReflectError("None"))? - .ty; - Ok((some_ty, none_ty)) - } - - /// Optional `T?` using the same `Some` / `None` sum as inference (`Cardinality` → match disj). - fn reflect_optional_sum( - dag: &Dag, - cardinality_decl_id: DeclarationId, - opt: Option, - mut reflect_some: impl FnMut(&Dag, T) -> ReflectResult, - ) -> ReflectResult { - let (some_ty, none_ty) = optional_some_none_constructor_ids(dag, cardinality_decl_id)?; - Ok(match opt { - None => FieldValue::Variant { - constructor: none_ty, - payload: vec![], - }, - Some(x) => FieldValue::Variant { - constructor: some_ty, - payload: vec![reflect_some(dag, x)?], - }, - }) - } - - fn reflect_port_id_list(dag: &Dag, ports: &[PortId]) -> ReflectResult { - let (empty_id, cons_id) = v3_list_empty_cons_ids(dag)?; - let mut tail = FieldValue::Variant { - constructor: empty_id, - payload: vec![], - }; - for p in ports.iter().rev() { - tail = FieldValue::Variant { - constructor: cons_id, - payload: vec![port_fv(*p), tail], - }; - } - Ok(tail) - } - - fn reflect_unit_variant(dag: &Dag, sum_name: &str, label: &str) -> ReflectResult { - sum_variant_payload(dag, sum_name, label, vec![]) - } - - fn reflect_arithmetic_op(dag: &Dag, op: crate::dag::ArithmeticOp) -> ReflectResult { - let label = match op { - crate::dag::ArithmeticOp::Add => "Add", - crate::dag::ArithmeticOp::Sub => "Sub", - crate::dag::ArithmeticOp::Mul => "Mul", - crate::dag::ArithmeticOp::Div => "Div", - }; - reflect_unit_variant(dag, "ArithmeticOp", label) - } - - fn reflect_comparison_op(dag: &Dag, op: crate::dag::ComparisonOp) -> ReflectResult { - let label = match op { - crate::dag::ComparisonOp::Eq => "Eq", - crate::dag::ComparisonOp::Ne => "Ne", - crate::dag::ComparisonOp::Lt => "Lt", - crate::dag::ComparisonOp::Le => "Le", - crate::dag::ComparisonOp::Gt => "Gt", - crate::dag::ComparisonOp::Ge => "Ge", - }; - reflect_unit_variant(dag, "ComparisonOp", label) - } - - fn reflect_logical_op(dag: &Dag, op: crate::dag::LogicalOp) -> ReflectResult { - let label = match op { - crate::dag::LogicalOp::And => "And", - crate::dag::LogicalOp::Or => "Or", - }; - reflect_unit_variant(dag, "LogicalOp", label) - } - - fn reflect_operator_kind(dag: &Dag, k: &OperatorKind) -> ReflectResult { - match k { - OperatorKind::Arithmetic(op) => { - let id = disj_variant_ty(dag, "OperatorKind", "Arithmetic")?; - Ok(FieldValue::Variant { - constructor: id, - payload: vec![reflect_arithmetic_op(dag, *op)?], - }) - } - OperatorKind::Comparison(op) => { - let id = disj_variant_ty(dag, "OperatorKind", "Comparison")?; - Ok(FieldValue::Variant { - constructor: id, - payload: vec![reflect_comparison_op(dag, *op)?], - }) - } - OperatorKind::Logical(op) => { - let id = disj_variant_ty(dag, "OperatorKind", "Logical")?; - Ok(FieldValue::Variant { - constructor: id, - payload: vec![reflect_logical_op(dag, *op)?], - }) - } - } - } - - fn reflect_http_method_scalar(dag: &Dag, m: HttpMethodScalar) -> ReflectResult { - reflect_unit_variant(dag, "HttpMethod", m.token()) - } - - fn reflect_operation(dag: &Dag, op: &Operation) -> ReflectResult { - let tokens = op - .endpoint - .path - .tokens - .iter() - .map(|token| match token { - UrlPathToken::LiteralToken { text } => sum_variant_payload( - dag, - "UrlPathToken", - "LiteralToken", - vec![FieldValue::Literal(LiteralBits::String(text.clone()))], - ), - UrlPathToken::ParamToken { name } => sum_variant_payload( - dag, - "UrlPathToken", - "ParamToken", - vec![FieldValue::Literal(LiteralBits::String(name.clone()))], - ), - }) - .collect::, _>>()?; - let inputs = FieldMap::from_entries( - op.inputs - .keys() - .map(|name| (name.clone(), FieldValue::Record(vec![]))) - .collect(), - ) - .map_err(|_| ReflectError("duplicate operation input key"))?; - Ok(FieldValue::Record(vec![ - ( - "callable".to_string(), - FieldValue::Record(vec![( - "decl".to_string(), - FieldValue::Reference(op.callable.decl), - )]), - ), - ("inputs".to_string(), FieldValue::Map(inputs)), - ( - "endpoint".to_string(), - FieldValue::Record(vec![ - ( - "method".to_string(), - reflect_http_method_scalar(dag, op.endpoint.method)?, - ), - ( - "path".to_string(), - FieldValue::Record(vec![("tokens".to_string(), FieldValue::List(tokens))]), - ), - ]), - ), - ])) - } - - fn reflect_operation_vec_spine(dag: &Dag, ops: &[Operation]) -> ReflectResult { - let (empty_id, cons_id) = v3_list_empty_cons_ids(dag)?; - let mut tail = FieldValue::Variant { - constructor: empty_id, - payload: vec![], - }; - for op in ops.iter().rev() { - let head = reflect_operation(dag, op)?; - tail = FieldValue::Variant { - constructor: cons_id, - payload: vec![head, tail], - }; - } - Ok(tail) - } - - fn reflect_bool_port_ref(_dag: &Dag, r: BoolPortRef) -> ReflectResult { - Ok(FieldValue::Record(vec![( - "port".to_string(), - port_fv(r.port_id()), - )])) - } - - fn reflect_workflow_effect(dag: &Dag, wf: &WorkflowEffect) -> ReflectResult { - match wf { - WorkflowEffect::LinearEffect { ops } => sum_variant_payload( - dag, - "WorkflowEffect", - "LinearEffect", - vec![reflect_operation_vec_spine(dag, ops)?], - ), - WorkflowEffect::BranchEffect { arms } => sum_variant_payload( - dag, - "WorkflowEffect", - "BranchEffect", - vec![reflect_non_singleton_branch_arms(dag, arms)?], - ), - WorkflowEffect::LoopEffect { body } => sum_variant_payload( - dag, - "WorkflowEffect", - "LoopEffect", - vec![reflect_workflow_effect(dag, body)?], - ), - WorkflowEffect::ParallelEffect { branches } => sum_variant_payload( - dag, - "WorkflowEffect", - "ParallelEffect", - vec![reflect_non_singleton_workflow_branches(dag, branches)?], - ), - } - } - - fn reflect_branch_arm_vec_spine(dag: &Dag, arms: &[BranchArm]) -> ReflectResult { - let (empty_id, cons_id) = v3_list_empty_cons_ids(dag)?; - let mut tail = FieldValue::Variant { - constructor: empty_id, - payload: vec![], - }; - for arm in arms.iter().rev() { - tail = FieldValue::Variant { - constructor: cons_id, - payload: vec![reflect_branch_arm(dag, arm)?, tail], - }; - } - Ok(tail) - } - - fn reflect_non_singleton_branch_arms( - dag: &Dag, - arms: &NonSingletonList, - ) -> ReflectResult { - let rest_spine = reflect_branch_arm_vec_spine(dag, &arms.rest)?; - Ok(FieldValue::Record(vec![ - ("first".to_string(), reflect_branch_arm(dag, &arms.first)?), - ("second".to_string(), reflect_branch_arm(dag, &arms.second)?), - ("rest".to_string(), rest_spine), - ])) - } - - fn reflect_branch_arm(dag: &Dag, arm: &BranchArm) -> ReflectResult { - Ok(FieldValue::Record(vec![ - ( - "condition".to_string(), - reflect_bool_port_ref(dag, arm.bool_port())?, - ), - ( - "body".to_string(), - reflect_workflow_effect(dag, arm.body())?, - ), - ])) - } - - fn reflect_workflow_effect_vec_spine( - dag: &Dag, - items: &[Box], - ) -> ReflectResult { - let (empty_id, cons_id) = v3_list_empty_cons_ids(dag)?; - let mut tail = FieldValue::Variant { - constructor: empty_id, - payload: vec![], - }; - for item in items.iter().rev() { - tail = FieldValue::Variant { - constructor: cons_id, - payload: vec![reflect_workflow_effect(dag, item.as_ref())?, tail], - }; - } - Ok(tail) - } - - fn reflect_non_singleton_workflow_branches( - dag: &Dag, - branches: &NonSingletonList>, - ) -> ReflectResult { - let rest_spine = reflect_workflow_effect_vec_spine(dag, &branches.rest)?; - Ok(FieldValue::Record(vec![ - ( - "first".to_string(), - reflect_workflow_effect(dag, branches.first.as_ref())?, - ), - ( - "second".to_string(), - reflect_workflow_effect(dag, branches.second.as_ref())?, - ), - ("rest".to_string(), rest_spine), - ])) - } - - fn reflect_optional_workflow_effect( - dag: &Dag, - cardinality_decl_id: DeclarationId, - opt: Option<&WorkflowEffect>, - ) -> ReflectResult { - reflect_optional_sum(dag, cardinality_decl_id, opt.cloned(), |d, w| { - reflect_workflow_effect(d, &w) - }) - } - - fn reflect_optional_branch_emit( - dag: &Dag, - cardinality_decl_id: DeclarationId, - opt: Option, - ) -> ReflectResult { - reflect_optional_sum(dag, cardinality_decl_id, opt, |d, p| match p { - BranchEmitParticipation::UserMatch => { - reflect_unit_variant(d, "BranchEmitParticipation", "UserMatch") - } - }) - } - - fn reflect_optional_bind_emit( - dag: &Dag, - cardinality_decl_id: DeclarationId, - opt: Option, - ) -> ReflectResult { - reflect_optional_sum(dag, cardinality_decl_id, opt, |d, p| match p { - BindEmitParticipation::UserCallable => { - reflect_unit_variant(d, "BindEmitParticipation", "UserCallable") - } - }) - } - - fn reflect_transform_target(dag: &Dag, t: &TransformTarget) -> ReflectResult { - match t { - TransformTarget::Callable(callee) => sum_variant_payload( - dag, - "TransformTarget", - "Callable", - vec![FieldValue::Reference(*callee)], - ), - TransformTarget::UnresolvedFieldProject { field_label } => sum_variant_payload( - dag, - "TransformTarget", - "UnresolvedFieldProject", - vec![FieldValue::Literal(LiteralBits::String( - field_label.clone(), - ))], - ), - TransformTarget::ResolvedFieldProject { field_label } => sum_variant_payload( - dag, - "TransformTarget", - "ResolvedFieldProject", - vec![FieldValue::Literal(LiteralBits::String( - field_label.clone(), - ))], - ), - TransformTarget::Operator(op) => sum_variant_payload( - dag, - "TransformTarget", - "Operator", - vec![reflect_operator_kind(dag, op)?], - ), - } - } - - fn reflect_branch_pattern(dag: &Dag, p: &BranchPattern) -> ReflectResult { - match p { - BranchPattern::UnresolvedVariant { name, span } => sum_variant_payload( - dag, - "BranchPattern", - "UnresolvedVariant", - vec![ - FieldValue::Literal(LiteralBits::String(name.clone())), - reflect_source_span(span), - ], - ), - BranchPattern::ResolvedVariant(decl) => sum_variant_payload( - dag, - "BranchPattern", - "ResolvedVariant", - vec![FieldValue::Reference(*decl)], - ), - } - } - - fn reflect_optional_payload_binding( - dag: &Dag, - opt: Option<&PayloadBinding>, - ) -> ReflectResult { - let path = named_record_type_root(dag, "BranchPath")?; - let binding_card = - peel_to_optional_cardinality_decl(dag, conj_field_ty(dag, path, "binding")?)?; - reflect_optional_sum(dag, binding_card, opt.cloned(), |_d, b| { - Ok(FieldValue::Record(vec![ - ( - "binding_name".to_string(), - FieldValue::Literal(LiteralBits::String(b.binding_name.clone())), - ), - ("payload_port".to_string(), port_fv(b.payload_port)), - ])) - }) - } - - fn reflect_branch_path(dag: &Dag, p: &Path) -> ReflectResult { - Ok(FieldValue::Record(vec![ - ("body".to_string(), node_fv(p.body)), - ("result_port".to_string(), port_fv(p.result_port())), - ( - "pattern".to_string(), - reflect_branch_pattern(dag, &p.pattern)?, - ), - ( - "binding".to_string(), - reflect_optional_payload_binding(dag, p.binding.as_ref())?, - ), - ])) - } - - fn reflect_branch_paths(dag: &Dag, paths: &[Path]) -> ReflectResult { - let (empty_id, cons_id) = v3_list_empty_cons_ids(dag)?; - let mut tail = FieldValue::Variant { - constructor: empty_id, - payload: vec![], - }; - for p in paths.iter().rev() { - let head = reflect_branch_path(dag, p)?; - tail = FieldValue::Variant { - constructor: cons_id, - payload: vec![head, tail], - }; - } - Ok(tail) - } - - fn reflect_loop_bound(dag: &Dag, b: &LoopBound) -> ReflectResult { - match b { - LoopBound::Cardinality { count } => { - sum_variant_payload(dag, "LoopBound", "Cardinality", vec![port_fv(*count)]) - } - LoopBound::Descent { cluster, measure } => sum_variant_payload( - dag, - "LoopBound", - "Descent", - vec![cluster_fv(*cluster), port_fv(*measure)], - ), - } - } - - fn behavior_variant_id(dag: &Dag, label: &str) -> ReflectResult { - disj_variant_ty(dag, "Behavior", label) - } - - pub fn reflect_behavior(dag: &Dag, behavior: &Behavior) -> ReflectResult { - match behavior { - Behavior::Value(v) => reflect_value(dag, v), - Behavior::Transform(t) => reflect_transform(dag, t), - Behavior::Branch(b) => reflect_branch(dag, b), - Behavior::Loop(l) => reflect_loop(dag, l), - Behavior::Bind(b) => reflect_bind(dag, b), - } - } - - fn reflect_value(dag: &Dag, v: &ValueNode) -> ReflectResult { - let id = behavior_variant_id(dag, "Value")?; - let vn = named_record_type_root(dag, "ValueNode")?; - let lane2_card = - peel_to_optional_cardinality_decl(dag, conj_field_ty(dag, vn, "lane2_workflow")?)?; - let lane2 = reflect_optional_workflow_effect(dag, lane2_card, v.lane2_workflow())?; - let payload = FieldValue::Record(vec![ - ("id".to_string(), node_fv(v.id)), - ("payload".to_string(), FieldValue::Literal(v.data.clone())), - ("result_port".to_string(), port_fv(v.output)), - ("span".to_string(), reflect_source_span(&v.span)), - ("lane2_workflow".to_string(), lane2), - ]); - Ok(FieldValue::Variant { - constructor: id, - payload: vec![payload], - }) - } - - fn reflect_transform(dag: &Dag, t: &TransformNode) -> ReflectResult { - let id = behavior_variant_id(dag, "Transform")?; - let inputs = reflect_port_id_list(dag, &t.inputs)?; - let payload = FieldValue::Record(vec![ - ("id".to_string(), node_fv(t.id)), - ( - "target".to_string(), - reflect_transform_target(dag, &t.target)?, - ), - ("inputs".to_string(), inputs), - ("result_port".to_string(), port_fv(t.output)), - ("span".to_string(), reflect_source_span(&t.span)), - ]); - Ok(FieldValue::Variant { - constructor: id, - payload: vec![payload], - }) - } - - fn reflect_branch(dag: &Dag, b: &BranchNode) -> ReflectResult { - let id = behavior_variant_id(dag, "Branch")?; - let paths = reflect_branch_paths(dag, &b.paths)?; - let br = named_record_type_root(dag, "BranchNode")?; - let emit_card = - peel_to_optional_cardinality_decl(dag, conj_field_ty(dag, br, "emit_participation")?)?; - let emit = reflect_optional_branch_emit(dag, emit_card, b.emit_participation())?; - let payload = FieldValue::Record(vec![ - ("id".to_string(), node_fv(b.id)), - ("input".to_string(), port_fv(b.input)), - ("paths".to_string(), paths), - ("result_port".to_string(), port_fv(b.output)), - ("span".to_string(), reflect_source_span(&b.span)), - ("emit_participation".to_string(), emit), - ]); - Ok(FieldValue::Variant { - constructor: id, - payload: vec![payload], - }) - } - - fn reflect_loop(dag: &Dag, l: &LoopNode) -> ReflectResult { - let id = behavior_variant_id(dag, "Loop")?; - let bound = reflect_loop_bound(dag, &l.bound)?; - let payload = FieldValue::Record(vec![ - ("id".to_string(), node_fv(l.id)), - ("source".to_string(), port_fv(l.source)), - ("init".to_string(), port_fv(l.init)), - ("body".to_string(), node_fv(l.body)), - ("bound".to_string(), bound), - ("result_port".to_string(), port_fv(l.output)), - ("span".to_string(), reflect_source_span(&l.span)), - ]); - Ok(FieldValue::Variant { - constructor: id, - payload: vec![payload], - }) - } - - fn reflect_bind(dag: &Dag, b: &BindNode) -> ReflectResult { - let id = behavior_variant_id(dag, "Bind")?; - let params = reflect_port_id_list(dag, &b.params)?; - let bn = named_record_type_root(dag, "BindNode")?; - let lane2_card = - peel_to_optional_cardinality_decl(dag, conj_field_ty(dag, bn, "lane2_workflow")?)?; - let emit_card = - peel_to_optional_cardinality_decl(dag, conj_field_ty(dag, bn, "emit_participation")?)?; - let lane2 = reflect_optional_workflow_effect(dag, lane2_card, b.lane2_workflow())?; - let emit = reflect_optional_bind_emit(dag, emit_card, b.emit_participation())?; - let payload = FieldValue::Record(vec![ - ("id".to_string(), node_fv(b.id)), - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String(b.name.clone())), - ), - ("result_port".to_string(), port_fv(b.value)), - ("params".to_string(), params), - ("span".to_string(), reflect_source_span(&b.span)), - ("lane2_workflow".to_string(), lane2), - ("emit_participation".to_string(), emit), - ]); - Ok(FieldValue::Variant { - constructor: id, - payload: vec![payload], - }) - } - - pub fn reflect_behavior_list(dag: &Dag, nodes: &[Behavior]) -> ReflectResult { - let (empty_id, cons_id) = v3_list_empty_cons_ids(dag)?; - let mut tail = FieldValue::Variant { - constructor: empty_id, - payload: vec![], - }; - for behavior in nodes.iter().rev() { - let head = reflect_behavior(dag, behavior)?; - tail = FieldValue::Variant { - constructor: cons_id, - payload: vec![head, tail], - }; - } - Ok(tail) - } - - #[cfg(test)] - mod reflection_tests { - use super::*; - use crate::compile_to_dag; - use crate::dag::{ - Behavior, DeclarationId, FieldValue, LiteralBits, LoopBound, TransformTarget, - TypeConnective, - }; - - fn compile(src: &str, file: &str) -> Dag { - match compile_to_dag(src, file) { - Ok(d) => { - assert!(d.diagnostics().is_empty(), "{file}: {:?}", d.diagnostics()); - d - } - Err(e) => panic!("compile {file}: {e:?}"), - } - } - - fn behavior_inner_record(fv: &FieldValue) -> &[(String, FieldValue)] { - let FieldValue::Variant { payload, .. } = fv else { - panic!("expected Behavior variant, got {fv:?}"); - }; - assert_eq!(payload.len(), 1, "Behavior variant payload"); - let FieldValue::Record(fields) = &payload[0] else { - panic!("expected inner record"); - }; - fields.as_slice() - } - - fn record_get<'a>(rec: &'a [(String, FieldValue)], key: &str) -> &'a FieldValue { - rec.iter() - .find(|(k, _)| k == key) - .map(|(_, v)| v) - .unwrap_or_else(|| panic!("missing field `{key}` in {rec:?}")) - } - - fn list_spine_len(dag: &Dag, list: &FieldValue) -> usize { - let (empty_id, _) = v3_list_empty_cons_ids(dag).expect("List ids"); - let mut n = 0; - let mut cur = list; - loop { - let FieldValue::Variant { - constructor, - payload, - } = cur - else { - panic!("expected List spine"); - }; - if *constructor == empty_id { - break; - } - assert_eq!(payload.len(), 2, "Cons payload"); - n += 1; - cur = &payload[1]; - } - n - } - - fn loop_bound_variant_label(dag: &Dag, variant_constructor_ty: DeclarationId) -> String { - let decl = dag - .declaration_by_name("LoopBound") - .expect("LoopBound declaration"); - let TypeConnective::Disj { variants } = &decl.connective else { - panic!("LoopBound not a Disj"); - }; - variants - .iter() - .find(|v| v.ty == variant_constructor_ty) - .map(|v| v.label.clone()) - .unwrap_or_else(|| { - panic!("constructor {variant_constructor_ty:?} not a LoopBound variant"); - }) - } - - fn optional_carrier_variant_label(dag: &Dag, fv: &FieldValue) -> String { - let FieldValue::Variant { constructor, .. } = fv else { - panic!("expected optional carrier variant, got {fv:?}"); - }; - dag.declarations() - .iter() - .find_map(|decl| match &decl.connective { - TypeConnective::Disj { variants } => variants - .iter() - .find(|v| v.ty == *constructor) - .map(|v| v.label.clone()), - _ => None, - }) - .unwrap_or_else(|| { - panic!("constructor {constructor:?} not a sum variant payload ty") - }) - } - - /// Peel empty `Instantiation` wrappers to the underlying `Conj` (same contract as - /// `substrate_reflection::named_record_type_root`). - fn named_conj_root_id(dag: &Dag, substrate_record_name: &str) -> DeclarationId { - let mut decl_id = dag - .declaration_by_name(substrate_record_name) - .unwrap_or_else(|| panic!("missing declaration `{substrate_record_name}`")) - .id; - const PEEL_MAX: usize = 64; - for _ in 0..PEEL_MAX { - match &dag.declaration(decl_id).connective { - TypeConnective::Conj { .. } => return decl_id, - TypeConnective::Instantiation { - template, - arguments, - } if arguments.is_empty() => { - decl_id = *template; - } - _ => panic!("`{substrate_record_name}` did not peel to a Conj"), - } - } - panic!("peel depth exceeded for `{substrate_record_name}`"); - } - - /// Ratchet: reflected `Record` field **order and labels** match the named substrate `Conj`. - fn assert_record_matches_named_substrate_conj( - dag: &Dag, - rec: &[(String, FieldValue)], - substrate_record_name: &str, - ) { - let conj_id = named_conj_root_id(dag, substrate_record_name); - let TypeConnective::Conj { children } = &dag.declaration(conj_id).connective else { - panic!("`{substrate_record_name}` not a Conj after peel"); - }; - assert_eq!( - rec.len(), - children.len(), - "`{substrate_record_name}`: reflected field count vs declared Conj arity" - ); - for (i, ((ref_label, _), decl_field)) in rec.iter().zip(children.iter()).enumerate() { - assert_eq!( - ref_label, &decl_field.label, - "`{substrate_record_name}`: field {i} label mismatch (reflection vs substrate.dag)" - ); - } - } - - /// Ratchet: `FieldValue::Variant` payload slot count matches the declared variant payload - /// shape (`Conj` children when the constructor is a record; otherwise 0–1 like - /// `sum_variant_payload`). - fn assert_sum_variant_payload_matches_substrate( - dag: &Dag, - sum_decl_name: &str, - fv: &FieldValue, - ) { - let FieldValue::Variant { - constructor, - payload, - } = fv - else { - panic!("expected sum variant, got {fv:?}"); - }; - let ctor_ty = *constructor; - let ctor_decl = dag.declaration(ctor_ty); - let variant_label = { - let sum_decl = dag - .declaration_by_name(sum_decl_name) - .unwrap_or_else(|| panic!("missing sum `{sum_decl_name}`")); - let TypeConnective::Disj { variants } = &sum_decl.connective else { - panic!("`{sum_decl_name}` not a Disj"); - }; - variants - .iter() - .find(|v| v.ty == ctor_ty) - .map(|v| v.label.as_str()) - .unwrap_or_else(|| { - panic!("constructor {ctor_ty:?} is not a variant of `{sum_decl_name}`") - }) - }; - match &ctor_decl.connective { - TypeConnective::Conj { children } => { - assert_eq!( - payload.len(), - children.len(), - "`{sum_decl_name}`::{variant_label}: payload arity vs declared Conj" - ); - } - _ => { - assert!( - payload.len() <= 1, - "`{sum_decl_name}`::{variant_label}: non-Conj constructor allows at most one payload; got {}", - payload.len() - ); - } - } - } - - #[test] - fn reflection_optional_fields_use_some_none_not_list() { - let src = "let x: Int = 7\n"; - let file = "reflect_optional_carrier_value.v3"; - let dag = compile(src, file); - let v = dag - .nodes() - .iter() - .find_map(|b| match b { - Behavior::Value(v) if v.span.file == file => Some(v), - _ => None, - }) - .expect("Value node"); - let fv = reflect_behavior(&dag, &Behavior::Value(v.clone())).expect("reflect"); - let rec = behavior_inner_record(&fv); - let lane2 = record_get(rec, "lane2_workflow"); - assert_eq!(optional_carrier_variant_label(&dag, lane2), "None"); - - let src_bind = "fn g(x: Int) -> Int = x + 1\n"; - let file_bind = "reflect_optional_carrier_bind.v3"; - let dag_b = compile(src_bind, file_bind); - let b = dag_b - .nodes() - .iter() - .find_map(|beh| match beh { - Behavior::Bind(b) if b.span.file == file_bind && !b.params.is_empty() => { - Some(b) - } - _ => None, - }) - .expect("Bind node"); - let fv_b = reflect_behavior(&dag_b, &Behavior::Bind(b.clone())).expect("reflect bind"); - let rec_b = behavior_inner_record(&fv_b); - let emit = record_get(rec_b, "emit_participation"); - assert_eq!(optional_carrier_variant_label(&dag_b, emit), "Some"); - } - - #[test] - fn reflection_value_includes_all_substrate_fields() { - let src = "let x: Int = 7\n"; - let file = "reflect_value.v3"; - let dag = compile(src, file); - let v = dag - .nodes() - .iter() - .find_map(|b| match b { - Behavior::Value(v) if v.span.file == file => Some(v), - _ => None, - }) - .expect("Value node"); - let fv = reflect_behavior(&dag, &Behavior::Value(v.clone())).expect("reflect"); - let rec = behavior_inner_record(&fv); - for key in ["id", "payload", "result_port", "span", "lane2_workflow"] { - let _ = record_get(rec, key); - } - } - - #[test] - fn reflection_transform_includes_target_inputs_and_span() { - let src = "fn f(a: Int, b: Int) -> Int = a + b\n"; - let file = "reflect_transform.v3"; - let dag = compile(src, file); - let t = dag - .nodes() - .iter() - .find_map(|b| match b { - Behavior::Transform(t) if t.span.file == file => Some(t), - _ => None, - }) - .expect("Transform node"); - let fv = reflect_behavior(&dag, &Behavior::Transform(t.clone())).expect("reflect"); - let rec = behavior_inner_record(&fv); - for key in ["id", "target", "inputs", "result_port", "span"] { - let _ = record_get(rec, key); - } - } - - #[test] - fn reflection_bind_includes_params_lane2_emit() { - let src = "fn g(x: Int) -> Int = x + 1\n"; - let file = "reflect_bind.v3"; - let dag = compile(src, file); - let b = dag - .nodes() - .iter() - .find_map(|beh| match beh { - Behavior::Bind(b) if b.span.file == file && !b.params.is_empty() => Some(b), - _ => None, - }) - .expect("Bind node"); - let fv = reflect_behavior(&dag, &Behavior::Bind(b.clone())).expect("reflect"); - let rec = behavior_inner_record(&fv); - for key in [ - "id", - "name", - "result_port", - "params", - "span", - "lane2_workflow", - "emit_participation", - ] { - let _ = record_get(rec, key); - } - } - - #[test] - fn reflection_branch_three_arms_totality() { - let src = "\ - type Color = Red | Green | Blue - fn classify(h: Color) -> Int = match h { Red => 0, Green => 1, Blue => 2 } - "; - let file = "reflect_branch_three.v3"; - let dag = compile(src, file); - let br = dag - .nodes() - .iter() - .find_map(|b| match b { - Behavior::Branch(br) if br.span.file == file => Some(br), - _ => None, - }) - .expect("Branch"); - assert_eq!(br.paths.len(), 3); - let fv = reflect_behavior(&dag, &Behavior::Branch(br.clone())).expect("reflect"); - let rec = behavior_inner_record(&fv); - assert_record_matches_named_substrate_conj(&dag, rec, "BranchNode"); - let paths = record_get(rec, "paths"); - assert_eq!(list_spine_len(&dag, paths), 3); - let FieldValue::Variant { payload, .. } = paths else { - panic!("paths list"); - }; - assert_eq!(payload.len(), 2); - let FieldValue::Record(arm_fields) = &payload[0] else { - panic!("first arm record"); - }; - for key in ["body", "result_port", "pattern", "binding"] { - let _ = record_get(arm_fields, key); - } - } - - #[test] - fn reflection_loop_bound_coproduct_cardinality_vs_descent() { - let src_single = "\ - fn count(n: Int) -> Int = if n == 0 then 0 else 1 + count(n - 1) - let _: Int = count(1) - "; - let file_c = "reflect_loop_card.v3"; - let dag_c = compile(src_single, file_c); - let lp_c = dag_c - .nodes() - .iter() - .find_map(|b| match b { - Behavior::Loop(l) if l.span.file == file_c => Some(l), - _ => None, - }) - .expect("cardinality loop"); - assert!(matches!(lp_c.bound, LoopBound::Cardinality { .. })); - let fv_c = reflect_behavior(&dag_c, &Behavior::Loop(lp_c.clone())).expect("reflect"); - let rec_c = behavior_inner_record(&fv_c); - assert_record_matches_named_substrate_conj(&dag_c, rec_c, "LoopNode"); - let bound_c = record_get(rec_c, "bound"); - let FieldValue::Variant { - constructor: c_ty, .. - } = bound_c - else { - panic!("LoopBound variant"); - }; - assert_eq!(loop_bound_variant_label(&dag_c, *c_ty), "Cardinality"); - - let src_mutual = "\ - fn even(n: Int) -> Bool = if n == 0 then true else odd(n - 1) - fn odd(n: Int) -> Bool = if n == 0 then false else even(n - 1) - "; - let file_d = "reflect_loop_desc.v3"; - let dag_d = compile(src_mutual, file_d); - let lp_d = dag_d - .nodes() - .iter() - .find_map(|b| match b { - Behavior::Loop(l) - if l.span.file == file_d - && matches!(l.bound, LoopBound::Descent { .. }) => - { - Some(l) - } - _ => None, - }) - .expect("descent loop"); - let fv_d = reflect_behavior(&dag_d, &Behavior::Loop(lp_d.clone())).expect("reflect"); - let rec_d = behavior_inner_record(&fv_d); - assert_record_matches_named_substrate_conj(&dag_d, rec_d, "LoopNode"); - let bound_d = record_get(rec_d, "bound"); - let FieldValue::Variant { - constructor: d_ty, .. - } = bound_d - else { - panic!("LoopBound variant"); - }; - assert_eq!(loop_bound_variant_label(&dag_d, *d_ty), "Descent"); - } - - #[test] - fn reflection_value_inner_record_matches_value_node_conj_decl() { - let src = "let x: Int = 7\n"; - let file = "reflect_schema_value.v3"; - let dag = compile(src, file); - let v = dag - .nodes() - .iter() - .find_map(|b| match b { - Behavior::Value(v) if v.span.file == file => Some(v), - _ => None, - }) - .expect("Value node"); - let fv = reflect_behavior(&dag, &Behavior::Value(v.clone())).expect("reflect"); - let rec = behavior_inner_record(&fv); - assert_record_matches_named_substrate_conj(&dag, rec, "ValueNode"); - } - - #[test] - fn reflection_source_span_record_matches_types_dag_conj_decl() { - let src = "let x: Int = 7\n"; - let file = "reflect_schema_source_span.v3"; - let dag = compile(src, file); - let v = dag - .nodes() - .iter() - .find_map(|b| match b { - Behavior::Value(v) if v.span.file == file => Some(v), - _ => None, - }) - .expect("Value node"); - let fv = reflect_behavior(&dag, &Behavior::Value(v.clone())).expect("reflect"); - let rec = behavior_inner_record(&fv); - let span_rec = match record_get(rec, "span") { - FieldValue::Record(fields) => fields.as_slice(), - other => panic!("expected span record, got {other:?}"), - }; - assert_record_matches_named_substrate_conj(&dag, span_rec, "SourceSpan"); - assert_eq!( - record_get(span_rec, "start"), - &FieldValue::Literal(LiteralBits::Int(i64::from(v.span.byte_start).to_string())) - ); - assert_eq!( - record_get(span_rec, "end"), - &FieldValue::Literal(LiteralBits::Int(i64::from(v.span.byte_end).to_string())) - ); - } - - #[test] - fn reflection_transform_inner_record_matches_transform_node_conj_decl() { - let src = "fn f(a: Int, b: Int) -> Int = a + b\n"; - let file = "reflect_schema_transform.v3"; - let dag = compile(src, file); - let t = dag - .nodes() - .iter() - .find_map(|b| match b { - Behavior::Transform(t) if t.span.file == file => Some(t), - _ => None, - }) - .expect("Transform node"); - let fv = reflect_behavior(&dag, &Behavior::Transform(t.clone())).expect("reflect"); - let rec = behavior_inner_record(&fv); - assert_record_matches_named_substrate_conj(&dag, rec, "TransformNode"); - } - - #[test] - fn reflection_bind_inner_record_matches_bind_node_conj_decl() { - let src = "fn g(x: Int) -> Int = x + 1\n"; - let file = "reflect_schema_bind.v3"; - let dag = compile(src, file); - let b = dag - .nodes() - .iter() - .find_map(|beh| match beh { - Behavior::Bind(b) if b.span.file == file && !b.params.is_empty() => Some(b), - _ => None, - }) - .expect("Bind node"); - let fv = reflect_behavior(&dag, &Behavior::Bind(b.clone())).expect("reflect"); - let rec = behavior_inner_record(&fv); - assert_record_matches_named_substrate_conj(&dag, rec, "BindNode"); - } - - #[test] - fn reflection_transform_target_callable_variant_matches_substrate_payload_shape() { - let src = "fn id(x: Int) -> Int = x\nlet _: Int = id(1)\n"; - let file = "reflect_schema_callable.v3"; - let dag = compile(src, file); - let t = dag - .nodes() - .iter() - .find_map(|b| match b { - Behavior::Transform(t) if t.span.file == file => match &t.target { - TransformTarget::Callable(_) => Some(t), - _ => None, - }, - _ => None, - }) - .expect("Callable transform"); - let fv = reflect_behavior(&dag, &Behavior::Transform(t.clone())).expect("reflect"); - let rec = behavior_inner_record(&fv); - let target = record_get(rec, "target"); - assert_sum_variant_payload_matches_substrate(&dag, "TransformTarget", target); - } - - #[test] - fn reflection_transform_target_field_project_variant_matches_substrate_payload_shape() { - let src = "\ -type Point { x: Int y: Int } -fn get_x(point: Point) -> Int = point.x -"; - let file = "reflect_schema_field_proj.v3"; - let dag = compile(src, file); - let t = dag - .nodes() - .iter() - .find_map(|b| match b { - Behavior::Transform(t) if t.span.file == file => match &t.target { - TransformTarget::UnresolvedFieldProject { .. } - | TransformTarget::ResolvedFieldProject { .. } => Some(t), - _ => None, - }, - _ => None, - }) - .expect("FieldProject transform"); - let fv = reflect_behavior(&dag, &Behavior::Transform(t.clone())).expect("reflect"); - let rec = behavior_inner_record(&fv); - let target = record_get(rec, "target"); - assert_sum_variant_payload_matches_substrate(&dag, "TransformTarget", target); - } - } -} - -// R3 gate #6 (`lens_testgen_dot_rs_retired`): the standalone `lens_testgen.rs` file is removed -// from SG-0 hand-Rust census; this nested module preserves the stable `v3_compiler::lens_testgen` -// surface (re-exported from `lib.rs`) until PB-Runtime owns testgen end-to-end. -pub mod lens_testgen { - include!("lens_testgen_body.txt"); -} - -pub use substrate_reflection::reflect_behavior_list; diff --git a/src/v3/compiler/src/lens_effect_enumeration_generated.rs b/src/v3/compiler/src/lens_effect_enumeration_generated.rs deleted file mode 100644 index ea5581b83ec..00000000000 --- a/src/v3/compiler/src/lens_effect_enumeration_generated.rs +++ /dev/null @@ -1,331 +0,0 @@ -// AUTO-GENERATED from `src/v3/lenses/effect_enumeration.dag` via -// `emit_rust_module`. Regenerate instead of hand-editing. - -#[derive(Clone, Debug)] -pub enum EffectEnumerationAuthoritySite { - SubstrateDagBehaviorNode, - ServicesOperationCarrier, -} -#[derive(Clone, Debug)] -pub enum StructuralEffectShape { - NoEffect, - ReadShaped, - WriteShaped, - UnknownEffect { reason: String }, -} -#[derive(Clone, Debug)] -pub struct EffectFact { - pub port: PortId, - pub shape: StructuralEffectShape, -} -#[derive(Clone, Debug)] -pub struct CoverageGap { - pub node: NodeId, - pub reason: String, -} -#[derive(Clone, Debug)] -pub struct RedundantReadError { - pub first_read: PortId, - pub redundant_read: PortId, - pub reason: String, -} -#[derive(Clone, Debug)] -pub enum TransactionalPattern { - NoTransaction, - BeginModifyCommit { root: NodeId }, -} -#[derive(Clone, Debug)] -pub struct EffectEnumerationReport { - pub facts: Vec, - pub coverage_gaps: Vec, - pub redundant_reads: Vec, - pub transaction: TransactionalPattern, -} -pub fn enumerate_effects(p0: &Dag) -> EffectEnumerationReport { - EffectEnumerationReport { - facts: compute_effect_facts(p0), - coverage_gaps: compute_coverage_gaps(p0), - redundant_reads: Vec::new(), - transaction: transaction_pattern(p0), - } -} -pub fn operation_structural_effect_shape(p0: &Operation) -> StructuralEffectShape { - match &(classify_operation_effect(p0)) { - EffectClassificationResult::EffectClassified { shape: shape } => { - effect_shape_to_structural(shape) - } - EffectClassificationResult::EffectClassificationFailed { failure: _ } => { - StructuralEffectShape::UnknownEffect { - reason: String::from("operation effect classification failed"), - } - } - } -} -pub fn effect_shape_to_structural(p0: &EffectShape) -> StructuralEffectShape { - match p0 { - EffectShape::IsIdempotent(idempotent) => idempotent_shape_to_structural(idempotent), - EffectShape::IsBreaking(breaking) => breaking_shape_to_structural(breaking), - } -} -pub fn idempotent_shape_to_structural(p0: &IdempotentShape) -> StructuralEffectShape { - match p0 { - IdempotentShape::ReadEffect => StructuralEffectShape::ReadShaped, - IdempotentShape::UpsertEffect { key_source: _ } => StructuralEffectShape::WriteShaped, - IdempotentShape::DeleteEffect { key_source: _ } => StructuralEffectShape::WriteShaped, - } -} -pub fn breaking_shape_to_structural(p0: &BreakingShape) -> StructuralEffectShape { - match p0 { - BreakingShape::CreateEffect { cause: _ } => StructuralEffectShape::WriteShaped, - BreakingShape::AppendEffect => StructuralEffectShape::WriteShaped, - } -} -pub fn compute_effect_facts(p0: &Dag) -> Vec { - ((p0).nodes()) - .iter() - .fold(Vec::new(), |__fold_acc, __fold_item| { - let mut __list = (__fold_acc).clone(); - __list.insert(0, effect_fact_for(p0, &__fold_acc, __fold_item)); - __list - }) -} -pub fn effect_fact_for(p0: &Dag, p1: &[EffectFact], p2: &Behavior) -> EffectFact { - match p2 { - Behavior::Value(v) => EffectFact { - port: (v).result_port(), - shape: StructuralEffectShape::NoEffect, - }, - Behavior::Transform(t) => EffectFact { - port: (t).result_port(), - shape: transform_effect(p0, t), - }, - Behavior::Branch(b) => EffectFact { - port: (b).result_port(), - shape: branch_effect(p1, &((b).paths)), - }, - Behavior::Loop(l) => EffectFact { - port: (l).result_port(), - shape: loop_effect(p0, p1, &((l).body)), - }, - Behavior::Bind(bind) => EffectFact { - port: (bind).result_port(), - shape: bind_effect(p0, p1, bind), - }, - } -} -pub fn bind_effect(p0: &Dag, p1: &[EffectFact], p2: &BindNode) -> StructuralEffectShape { - match &((p0).resolve_producer_opt(&((p2).result_port())).cloned()) { - None => StructuralEffectShape::UnknownEffect { - reason: String::from("bind result producer missing from substrate"), - }, - Some(producer) => { - if (behavior_node_id(producer) == (p2).id) { - StructuralEffectShape::UnknownEffect { - reason: String::from("bind result producer self-shadows bind output"), - } - } else { - effect_at(p1, &(behavior_result_port(producer))) - } - } - } -} -pub fn transform_effect(p0: &Dag, p1: &TransformNode) -> StructuralEffectShape { - match &((p1).target) { - TransformTarget::Callable(id) => callable_signature_effect(p0, id), - TransformTarget::UnresolvedFieldProject { field_label: _ } => { - StructuralEffectShape::NoEffect - } - TransformTarget::ResolvedFieldProject { field_label: _ } => StructuralEffectShape::NoEffect, - TransformTarget::Operator(_) => StructuralEffectShape::NoEffect, - } -} -pub fn callable_signature_effect(p0: &Dag, p1: &DeclarationId) -> StructuralEffectShape { - match &((p0).declaration_opt(p1).cloned()) { - None => StructuralEffectShape::UnknownEffect { - reason: String::from("callable declaration missing from substrate"), - }, - Some(decl) => match &((decl).connective) { - TypeConnective::Arrow { - inputs: __a_inputs, - output: __a_output, - body: __a_body, - } => callable_arrow_effect(__a_inputs, __a_output, __a_body), - TypeConnective::Atom(_) => StructuralEffectShape::UnknownEffect { - reason: String::from("transform target is not an arrow declaration"), - }, - TypeConnective::Conj { children: _ } => StructuralEffectShape::UnknownEffect { - reason: String::from("transform target is not an arrow declaration"), - }, - TypeConnective::Disj { variants: _ } => StructuralEffectShape::UnknownEffect { - reason: String::from("transform target is not an arrow declaration"), - }, - TypeConnective::Cardinality(_) => StructuralEffectShape::UnknownEffect { - reason: String::from("transform target is not an arrow declaration"), - }, - TypeConnective::Instantiation { - template: _, - arguments: _, - } => StructuralEffectShape::UnknownEffect { - reason: String::from("transform target is not an arrow declaration"), - }, - }, - } -} -pub fn callable_arrow_effect( - p0: &[DeclarationId], - p1: &DeclarationId, - p2: &ArrowBody, -) -> StructuralEffectShape { - match p0 { - [] => body_default_effect(p2), - [__list_head, __list_tail @ ..] => { - if ((*(__list_head)) == (*(p1))) { - StructuralEffectShape::WriteShaped - } else { - callable_arrow_effect(__list_tail, p1, p2) - } - } - } -} -pub fn body_default_effect(p0: &ArrowBody) -> StructuralEffectShape { - match p0 { - ArrowBody::ExternalRealization(_) => StructuralEffectShape::ReadShaped, - ArrowBody::UserDefined(_) => StructuralEffectShape::ReadShaped, - ArrowBody::NoBody => StructuralEffectShape::UnknownEffect { - reason: String::from("callable has no body and no external realization"), - }, - ArrowBody::Pending => StructuralEffectShape::UnknownEffect { - reason: String::from("callable body pending; signature coverage incomplete"), - }, - ArrowBody::Unparsed(_) => StructuralEffectShape::UnknownEffect { - reason: String::from("callable body unparsed; signature coverage incomplete"), - }, - } -} -pub fn branch_effect(p0: &[EffectFact], p1: &[Path]) -> StructuralEffectShape { - (p1).iter().fold( - StructuralEffectShape::NoEffect, - |__fold_acc, __fold_item| { - combine_effects( - (__fold_acc).clone(), - effect_at(p0, &((__fold_item).result_port())), - ) - }, - ) -} -pub fn loop_effect(p0: &Dag, p1: &[EffectFact], p2: &NodeId) -> StructuralEffectShape { - match &((p0).node_opt(p2).cloned()) { - None => StructuralEffectShape::UnknownEffect { - reason: String::from("loop body node missing from substrate"), - }, - Some(behavior) => effect_at(p1, &(behavior_result_port(behavior))), - } -} -pub fn behavior_result_port(p0: &Behavior) -> PortId { - match p0 { - Behavior::Value(v) => (v).result_port(), - Behavior::Transform(t) => (t).result_port(), - Behavior::Branch(br) => (br).result_port(), - Behavior::Loop(lp) => (lp).result_port(), - Behavior::Bind(bind) => (bind).result_port(), - } -} -pub fn combine_effects( - p0: StructuralEffectShape, - p1: StructuralEffectShape, -) -> StructuralEffectShape { - match &p0 { - StructuralEffectShape::UnknownEffect { reason: _ } => p0, - StructuralEffectShape::WriteShaped => StructuralEffectShape::WriteShaped, - StructuralEffectShape::ReadShaped => match &p1 { - StructuralEffectShape::UnknownEffect { reason: _ } => p1, - StructuralEffectShape::WriteShaped => StructuralEffectShape::WriteShaped, - StructuralEffectShape::ReadShaped => StructuralEffectShape::ReadShaped, - StructuralEffectShape::NoEffect => StructuralEffectShape::ReadShaped, - }, - StructuralEffectShape::NoEffect => p1, - } -} -pub fn effect_at(p0: &[EffectFact], p1: &PortId) -> StructuralEffectShape { - match p0 { - [] => StructuralEffectShape::UnknownEffect { - reason: String::from("effect fact missing for port"), - }, - [__list_head, __list_tail @ ..] => { - if ((__list_head).port == (*(p1))) { - ((__list_head).shape).clone() - } else { - effect_at(__list_tail, p1) - } - } - } -} -pub fn compute_coverage_gaps(p0: &Dag) -> Vec { - compute_coverage_gaps_from_facts((p0).nodes(), p0, &(compute_effect_facts(p0))) -} -pub fn compute_coverage_gaps_from_facts( - p0: &[Behavior], - p1: &Dag, - p2: &[EffectFact], -) -> Vec { - match p0 { - [] => Vec::new(), - [__list_head, __list_tail @ ..] => prepend_gap( - &(coverage_gap_for(p1, p2, __list_head)), - compute_coverage_gaps_from_facts(__list_tail, p1, p2), - ), - } -} -pub fn prepend_gap(p0: &[CoverageGap], p1: Vec) -> Vec { - match p0 { - [] => p1, - [__list_head, __list_tail @ ..] => { - let mut __list = prepend_gap(__list_tail, (p1).clone()); - __list.insert(0, (__list_head).clone()); - __list - } - } -} -pub fn coverage_gap_for(p0: &Dag, p1: &[EffectFact], p2: &Behavior) -> Vec { - match p2 { - Behavior::Transform(t) => coverage_gap_for_effect((t).id, &(transform_effect(p0, t))), - Behavior::Branch(br) => { - coverage_gap_for_effect((br).id, &(branch_effect(p1, &((br).paths)))) - } - Behavior::Loop(l) => coverage_gap_for_effect((l).id, &(loop_effect(p0, p1, &((l).body)))), - Behavior::Bind(bind) => { - coverage_gap_for_effect((bind).id, &(effect_at(p1, &((bind).result_port())))) - } - Behavior::Value(_) => Vec::new(), - } -} -pub fn coverage_gap_for_effect(p0: NodeId, p1: &StructuralEffectShape) -> Vec { - match p1 { - StructuralEffectShape::UnknownEffect { reason: u } => { - let mut __list = Vec::new(); - __list.insert( - 0, - CoverageGap { - node: p0, - reason: (u).clone(), - }, - ); - __list - } - StructuralEffectShape::NoEffect => Vec::new(), - StructuralEffectShape::ReadShaped => Vec::new(), - StructuralEffectShape::WriteShaped => Vec::new(), - } -} -pub fn transaction_pattern(p0: &Dag) -> TransactionalPattern { - TransactionalPattern::NoTransaction -} -pub fn behavior_node_id(p0: &Behavior) -> NodeId { - match p0 { - Behavior::Value(v) => (v).id, - Behavior::Transform(t) => (t).id, - Behavior::Branch(b) => (b).id, - Behavior::Loop(l) => (l).id, - Behavior::Bind(bind) => (bind).id, - } -} diff --git a/src/v3/compiler/src/lens_idempotency_generated.rs b/src/v3/compiler/src/lens_idempotency_generated.rs deleted file mode 100644 index 38a95f16ea8..00000000000 --- a/src/v3/compiler/src/lens_idempotency_generated.rs +++ /dev/null @@ -1,6 +0,0 @@ -// AUTO-GENERATED from `src/v3/lenses/idempotency.dag` via -// `emit_rust_module`. Regenerate instead of hand-editing. - -pub fn analyze_workflow(p0: &Dag, p1: &NodeId) -> WorkflowIdempotencyReport { - match &((p0).lane2_workflow_effect_at(p1).cloned()) { None => report_unsupported_workflow_variant(&(String::from("Lane2WorkflowRoot")), &(String::from("lane2_stage2b_idempotency_lens")), &(String::from("no WorkflowEffect at this substrate root - populate `lane2_workflow` on `Value`/`Bind` via lowering or `try_register_lane2_workflow_effect`"))), Some(wf) => lane2_workflow_idempotency_report(p0, wf), } -} diff --git a/src/v3/compiler/src/lens_parallelism_generated.rs b/src/v3/compiler/src/lens_parallelism_generated.rs deleted file mode 100644 index 0067cba589f..00000000000 --- a/src/v3/compiler/src/lens_parallelism_generated.rs +++ /dev/null @@ -1,257 +0,0 @@ -// AUTO-GENERATED from `src/v3/lenses/parallelism.dag` via -// `emit_rust_module`. Regenerate instead of hand-editing. - -const DOWNSTREAM: &str = "lane2_stage2e_parallelism_lens"; - -fn parallel_unsupported( - kind: ParallelismUnsupportedKind, - reason: impl Into, -) -> WorkflowParallelismReport { - WorkflowParallelismReport::ParallelismUnsupported(ParallelismUnsupportedDetail { - kind, - downstream_stage: DOWNSTREAM.to_string(), - reason: reason.into(), - }) -} - -fn pairwise_non_commute( - left: Operation, - right: Operation, - reason: impl Into, -) -> ParallelismUnsupportedDetail { - ParallelismUnsupportedDetail { - kind: ParallelismUnsupportedKind::PairwiseNonCommute { left, right }, - downstream_stage: DOWNSTREAM.to_string(), - reason: reason.into(), - } -} - -fn key_sources_equal(a: &KeySource, b: &KeySource) -> bool { - match (a, b) { - (KeySource::PathParam { param: pa }, KeySource::PathParam { param: pb }) => pa == pb, - (KeySource::InputField { field: fa }, KeySource::InputField { field: fb }) => fa == fb, - _ => false, - } -} - -fn idempotent_shapes_commute(a: &IdempotentShape, b: &IdempotentShape) -> bool { - match (a, b) { - (IdempotentShape::ReadEffect, IdempotentShape::ReadEffect) => true, - ( - IdempotentShape::DeleteEffect { key_source: ka }, - IdempotentShape::DeleteEffect { key_source: kb }, - ) => key_sources_equal(ka, kb), - _ => false, - } -} - -fn operations_commute( - dag: &Dag, - a: &Operation, - b: &Operation, -) -> Result { - Ok(match (classify_operation_effect(dag, a)?, classify_operation_effect(dag, b)?) { - (EffectShape::IsIdempotent(ia), EffectShape::IsIdempotent(ib)) => { - idempotent_shapes_commute(&ia, &ib) - } - _ => false, - }) -} - -fn extract_linear_branches( - branches: &NonSingletonList>, -) -> Option>> { - let mut out = Vec::new(); - for br in branches.iter() { - match br.as_ref() { - WorkflowEffect::LinearEffect { ops } => out.push(ops.to_vec()), - _ => return None, - } - } - Some(out) -} - -fn flatten_branch_ops(branch_ops: &[Vec]) -> Vec { - branch_ops - .iter() - .flat_map(|ops| ops.iter().cloned()) - .collect() -} - -fn pairwise_cross_branch_commutes( - dag: &Dag, - branch_ops: &[Vec], -) -> Result<(), ParallelismUnsupportedDetail> { - for i in 0..branch_ops.len() { - for j in (i + 1)..branch_ops.len() { - for oa in &branch_ops[i] { - for ob in &branch_ops[j] { - match operations_commute(dag, oa, ob) { - Ok(true) => {} - Ok(false) => { - return Err(pairwise_non_commute( - oa.clone(), - ob.clone(), - "parallel branch operations do not commute under parallel scheduling", - )); - } - Err( - EffectClassificationFailure::StdMethodAnchorResolutionFailed - | EffectClassificationFailure::UnknownOperationCallable, - ) => { - return Err(ParallelismUnsupportedDetail { - kind: ParallelismUnsupportedKind::EffectClassificationUnavailable, - downstream_stage: DOWNSTREAM.to_string(), - reason: "std.effects method anchors are missing or ambiguous; operation effect classification cannot safely prove parallelism" - .to_string(), - }); - } - } - } - } - } - } - Ok(()) -} - -pub fn analyze_parallelism(p0: &Dag, p1: NodeId) -> WorkflowParallelismReport { - let Some(workflow) = p0.lane2_workflow_effect_at(&p1) else { - return parallel_unsupported( - ParallelismUnsupportedKind::NoWorkflowProjection, - "no WorkflowEffect projection on this substrate node - analysis reads only `Value`/`Bind` fields set by lowering or `try_register_lane2_workflow_effect`", - ); - }; - let WorkflowEffect::ParallelEffect { branches } = workflow else { - return parallel_unsupported( - ParallelismUnsupportedKind::NotParallelEffectRoot, - "parallelism lens analyzes `ParallelEffect` roots only", - ); - }; - let Some(branch_ops) = extract_linear_branches(branches) else { - return parallel_unsupported( - ParallelismUnsupportedKind::NonLinearParallelBranch, - "Stage 2e v1 requires every parallel branch to be `LinearEffect`", - ); - }; - match compose_operation_effects(p0, flatten_branch_ops(&branch_ops).as_slice()) { - Ok(CompositionVerdict::BrokenBy { first_breaker }) => { - return WorkflowParallelismReport::ParallelCompositionVerdict( - CompositionVerdict::BrokenBy { first_breaker }, - ); - } - Ok(CompositionVerdict::IdempotentComposition) => {} - Err(_) => { - return parallel_unsupported( - ParallelismUnsupportedKind::EffectClassificationUnavailable, - "std.effects method anchors are missing or ambiguous; operation effect classification cannot safely prove parallelism", - ); - } - } - match pairwise_cross_branch_commutes(p0, &branch_ops) { - Ok(()) => WorkflowParallelismReport::ParallelCompositionVerdict( - CompositionVerdict::IdempotentComposition, - ), - Err(detail) => WorkflowParallelismReport::ParallelismUnsupported(detail), - } -} - -pub(super) fn loop_iteration_parallel_emission_indicator(p0: &Dag, p1: NodeId) -> i64 { - let Some(workflow) = p0.lane2_workflow_effect_at(&p1) else { - return 0; - }; - let WorkflowEffect::LoopEffect { body } = workflow else { - return 0; - }; - let WorkflowEffect::LinearEffect { ops } = body.as_ref() else { - return 0; - }; - if ops.is_empty() { - return 0; - } - for op in ops { - match classify_operation_effect(p0, op) { - Ok(EffectShape::IsIdempotent(IdempotentShape::ReadEffect)) => {} - Ok(_) - | Err( - EffectClassificationFailure::StdMethodAnchorResolutionFailed - | EffectClassificationFailure::UnknownOperationCallable, - ) => return 0, - } - } - 1 -} - -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub(crate) enum ParallelismMode { - OptInIndependent, - Sequential, -} - -fn behavior_parallelism_root(behavior: &Behavior) -> NodeId { - match behavior { - Behavior::Value(v) => v.id, - Behavior::Transform(t) => t.id, - Behavior::Branch(b) => b.id, - Behavior::Loop(l) => l.id, - Behavior::Bind(bind) => bind.id, - } -} - -pub(super) fn parallelism_iteration_observed_mode(p0: &Dag, p1: NodeId) -> ParallelismMode { - if loop_iteration_parallel_emission_indicator(p0, p1) == 1 { - ParallelismMode::OptInIndependent - } else { - ParallelismMode::Sequential - } -} - -pub(super) fn parallelism_lens_read(p0: &Dag, p1: &Behavior) -> Witness { - Witness::Inhabits(parallelism_iteration_observed_mode(p0, behavior_parallelism_root(p1))) -} - -pub(super) fn parallelism_lens_iterate( - body: ParallelismMode, - _bound: &LoopBound, -) -> ParallelismMode { - body -} - -pub(super) fn parallelism_lens_validate( - _p0: &Dag, - _p1: &ParallelismMode, -) -> OptionalDiagnostic { - OptionalDiagnostic::NoDiagnostic -} - -pub(super) fn parallelism_enforcement_project(m: ParallelismMode) -> ParallelismMode { - m -} - -pub(super) fn parallelism_enforcement_violates( - observed: &ParallelismMode, - declared: &ParallelismMode, -) -> bool { - match declared { - ParallelismMode::OptInIndependent => match observed { - ParallelismMode::Sequential => true, - ParallelismMode::OptInIndependent => false, - }, - ParallelismMode::Sequential => match observed { - ParallelismMode::OptInIndependent => false, - ParallelismMode::Sequential => false, - }, - } -} - -pub(super) fn parallelism_lens_combine( - a: &ParallelismMode, - b: &ParallelismMode, -) -> ParallelismMode { - match a { - ParallelismMode::Sequential => ParallelismMode::Sequential, - ParallelismMode::OptInIndependent => match b { - ParallelismMode::Sequential => ParallelismMode::Sequential, - ParallelismMode::OptInIndependent => ParallelismMode::OptInIndependent, - }, - } -} diff --git a/src/v3/compiler/src/lens_provenance_generated.rs b/src/v3/compiler/src/lens_provenance_generated.rs deleted file mode 100644 index 06a5fc68ac5..00000000000 --- a/src/v3/compiler/src/lens_provenance_generated.rs +++ /dev/null @@ -1,34 +0,0 @@ -// AUTO-GENERATED from `src/v3/lenses/provenance.dag` via -// `emit_rust_module`. Regenerate instead of hand-editing. - -#[derive(Clone, Debug)] -pub enum Origin { - NoProducer, - MissingPort, - MissingBehavior, - Source { _0: NodeId }, - Computed { _0: NodeId }, - Selected { _0: NodeId }, - Accumulated { _0: NodeId }, -} -pub fn origin_of(p0: &Dag, p1: &PortId) -> Origin { - match &((p0).port_opt(p1).cloned()) { - None => Origin::MissingPort, - Some(p) => match &((p).produced_by) { - None => Origin::NoProducer, - Some(producer_id) => match &((p0).node_opt(producer_id).cloned()) { - None => Origin::MissingBehavior, - Some(behavior) => origin_for_behavior(behavior), - }, - }, - } -} -pub fn origin_for_behavior(p0: &Behavior) -> Origin { - match p0 { - Behavior::Value(v) => Origin::Source { _0: (v).id }, - Behavior::Transform(t) => Origin::Computed { _0: (t).id }, - Behavior::Branch(b) => Origin::Selected { _0: (b).id }, - Behavior::Loop(l) => Origin::Accumulated { _0: (l).id }, - Behavior::Bind(bind) => Origin::Source { _0: (bind).id }, - } -} diff --git a/src/v3/compiler/src/lens_structural_resolution_generated.rs b/src/v3/compiler/src/lens_structural_resolution_generated.rs deleted file mode 100644 index a84359f7df4..00000000000 --- a/src/v3/compiler/src/lens_structural_resolution_generated.rs +++ /dev/null @@ -1,135 +0,0 @@ -// AUTO-GENERATED from `src/v3/lenses/structural_resolution.dag` via -// `emit_rust_module`. Regenerate instead of hand-editing. - -#[derive(Clone, Debug)] -pub struct UnresolvedArrowBody { - pub declaration: DeclarationId, - pub name: String, - pub span: SourceSpan, -} -#[derive(Clone, Debug)] -pub struct NameKeyedReference { - pub declaration: DeclarationId, - pub resolved_to: DeclarationId, - pub span: SourceSpan, -} -pub fn check(p0: &Dag) -> Vec { - ((p0).declarations()) - .iter() - .fold(Vec::new(), |__fold_acc, __fold_item| { - prepend_all(&(check_declaration(__fold_item)), (__fold_acc).clone()) - }) -} -pub fn check_declaration(p0: &Declaration) -> Vec { - match &((p0).connective) { - TypeConnective::Atom(_) => Vec::new(), - TypeConnective::Conj { children: _ } => Vec::new(), - TypeConnective::Disj { variants: _ } => Vec::new(), - TypeConnective::Arrow { - inputs: __a_inputs, - output: __a_output, - body: __a_body, - } => check_arrow_body(p0, __a_body), - TypeConnective::Cardinality(_) => Vec::new(), - TypeConnective::Instantiation { - template: _, - arguments: _, - } => Vec::new(), - } -} -pub fn check_arrow_body(p0: &Declaration, p1: &ArrowBody) -> Vec { - match p1 { - ArrowBody::UserDefined(_) => Vec::new(), - ArrowBody::ExternalRealization(_) => Vec::new(), - ArrowBody::Pending => singleton_violation(p0), - ArrowBody::NoBody => Vec::new(), - ArrowBody::Unparsed(_) => Vec::new(), - } -} -pub fn declaration_name(p0: &Declaration) -> String { - match &((p0).name) { - Some(name_str) => (name_str).clone(), - None => String::from(""), - } -} -pub fn singleton_violation(p0: &Declaration) -> Vec { - { - let mut __list = Vec::new(); - __list.insert( - 0, - UnresolvedArrowBody { - declaration: (p0).id, - name: declaration_name(p0), - span: ((p0).span).clone(), - }, - ); - __list - } -} -pub fn prepend_all( - p0: &[UnresolvedArrowBody], - p1: Vec, -) -> Vec { - (p0).iter().fold((p1).clone(), |__fold_acc, __fold_item| { - let mut __list = (__fold_acc).clone(); - __list.insert(0, (__fold_item).clone()); - __list - }) -} -pub fn name_keyed_references(p0: &Dag) -> Vec { - ((p0).declarations()) - .iter() - .fold(Vec::new(), |__fold_acc, __fold_item| { - prepend_name_keyed( - &(check_name_keyed_declaration(__fold_item)), - (__fold_acc).clone(), - ) - }) -} -pub fn check_name_keyed_declaration(p0: &Declaration) -> Vec { - match &((p0).connective) { - TypeConnective::Atom(payload) => check_name_keyed_payload(p0, payload), - TypeConnective::Conj { children: _ } => Vec::new(), - TypeConnective::Disj { variants: _ } => Vec::new(), - TypeConnective::Arrow { - inputs: _, - output: _, - body: _, - } => Vec::new(), - TypeConnective::Cardinality(_) => Vec::new(), - TypeConnective::Instantiation { - template: _, - arguments: _, - } => Vec::new(), - } -} -pub fn check_name_keyed_payload(p0: &Declaration, p1: &AtomPayload) -> Vec { - match p1 { - AtomPayload::Literal(_) => Vec::new(), - AtomPayload::UnresolvedIdentifier(_) => Vec::new(), - AtomPayload::ResolvedByStructure(_) => Vec::new(), - AtomPayload::ResolvedByName(id) => { - let mut __list = Vec::new(); - __list.insert( - 0, - NameKeyedReference { - declaration: (p0).id, - resolved_to: (*(id)), - span: ((p0).span).clone(), - }, - ); - __list - } - AtomPayload::TypeParam(_) => Vec::new(), - } -} -pub fn prepend_name_keyed( - p0: &[NameKeyedReference], - p1: Vec, -) -> Vec { - (p0).iter().fold((p1).clone(), |__fold_acc, __fold_item| { - let mut __list = (__fold_acc).clone(); - __list.insert(0, (__fold_item).clone()); - __list - }) -} diff --git a/src/v3/compiler/src/lens_t_las_carrier.rs b/src/v3/compiler/src/lens_t_las_carrier.rs deleted file mode 100644 index 39c8f105bbe..00000000000 --- a/src/v3/compiler/src/lens_t_las_carrier.rs +++ /dev/null @@ -1,53 +0,0 @@ -//! Structural carriers for Rust emission of T-LAS lens surfaces that reference -//! `v3.std.lens::Lens`, `std.algebra::Monoid`, and `v3.std.lens_application` -//! (`gate #92`). Shapes mirror the `.dag` authorities; they are not used by the -//! compiler runtime outside `emit_rust_module` snapshots linking against -//! `v3_compiler`. - -use std::rc::Rc; - -use crate::dag::{Behavior, Dag, LoopBound}; -use crate::diagnostics::Diagnostic; -use crate::dimension::Witness; - -/// Mirrors `OptionalDiagnostic` in `v3.std.dimensions` for emitted lens code. -#[derive(Clone, Debug)] -pub enum OptionalDiagnostic { - NoDiagnostic, - SomeDiagnostic { value: Box }, -} - -pub type LensReadFn = dyn Fn(&Dag, &Behavior) -> Witness; -pub type LensValidateFn = dyn Fn(&Dag, T) -> OptionalDiagnostic; - -/// Mirrors `Monoid` in `dsl/std/algebra.dag`. -#[derive(Clone)] -pub struct Monoid { - pub op: Rc T>, - pub identity: T, -} - -/// Mirrors `Lens` in `v3.std.lens`. -#[derive(Clone)] -pub struct Lens { - pub name: String, - pub read: Rc>, - pub sequential: Monoid, - pub branch: Rc T>, - pub iterate: Rc T>, - pub validate: Rc>, -} - -/// Mirrors `LensEnforcement` in `v3.std.lens_application`. -#[derive(Clone)] -pub struct LensEnforcement { - pub project: Rc Projected>, - pub violates: Rc bool>, -} - -/// Mirrors `EnforceableLens` in `v3.std.lens_application`. -#[derive(Clone)] -pub struct EnforceableLens { - pub lens: Lens, - pub enforcement: LensEnforcement, -} diff --git a/src/v3/compiler/src/lens_testgen_body.txt b/src/v3/compiler/src/lens_testgen_body.txt deleted file mode 100644 index 02c111eb7bd..00000000000 --- a/src/v3/compiler/src/lens_testgen_body.txt +++ /dev/null @@ -1,812 +0,0 @@ -// R3 gate #6 (`lens_testgen_dot_rs_retired`): former `lens_testgen.rs` body, included from `lens_declaration_apply.rs`. -// Dissolution trigger: PB-Runtime `.dag` testgen authority owns this logic end-to-end; delete this -// fragment and the `pub mod lens_testgen` wrapper, then drop the path from -// `EXPECTED_HAND_AUTHORED_FRAGMENTS` in `sg0_census_test.rs`. - -use crate::dag::{ - AtomPayload, Dag, Declaration, DeclarationId, Field, FieldValue, LiteralBits, TypeConnective, -}; -use crate::lens_cost::{cost_of, CostLookup}; -use crate::{compile_to_dag, CompileError}; -use std::collections::HashMap; - -const MAX_RENDER_DEPTH: usize = 3; - -#[derive(Debug, Clone)] -pub struct GeneratedClaim<'a> { - dag: &'a Dag, - declaration_name: String, - fields: Vec<(String, FieldValue)>, -} - -impl<'a> GeneratedClaim<'a> { - fn new(dag: &'a Dag, declaration_name: String, fields: Vec<(String, FieldValue)>) -> Self { - Self { - dag, - declaration_name, - fields, - } - } - - pub fn declaration_name(&self) -> &str { - &self.declaration_name - } - - pub fn fields(&self) -> &[(String, FieldValue)] { - &self.fields - } - - pub fn dag(&self) -> &Dag { - self.dag - } - - pub fn render_declaration_source(&self) -> String { - let rendered_fields = self - .fields - .iter() - .map(|(label, value)| format!(" {label}: {}", self.render_field_value(value))) - .collect::>() - .join(",\n"); - format!( - "data {}: TestClaim = {{\n{}\n}}\n", - self.declaration_name, rendered_fields - ) - } - - fn render_field_value(&self, value: &FieldValue) -> String { - match value { - FieldValue::Literal(LiteralBits::Int(decimal)) => decimal.clone(), - FieldValue::Literal(LiteralBits::Bool(b)) => b.to_string(), - FieldValue::Literal(LiteralBits::String(s) | LiteralBits::Symbol(s)) => { - quote_string(s) - } - FieldValue::Reference(decl_id) => self - .dag - .declaration(*decl_id) - .name - .clone() - .unwrap_or_else(|| panic!("reference declaration {:?} should be named", decl_id)), - FieldValue::Record(fields) => format!( - "{{ {} }}", - fields - .iter() - .map(|(label, value)| format!("{label}: {}", self.render_field_value(value))) - .collect::>() - .join(", ") - ), - FieldValue::List(values) => format!( - "[{}]", - values - .iter() - .map(|value| self.render_field_value(value)) - .collect::>() - .join(", ") - ), - FieldValue::Map(entries) => format!( - "{{ {} }}", - entries - .entries() - .iter() - .map(|(key, value)| format!( - "{}: {}", - quote_string(key), - self.render_field_value(value) - )) - .collect::>() - .join(", ") - ), - FieldValue::Variant { - constructor, - payload, - } => { - let label = self.variant_label(*constructor); - if payload.is_empty() { - label - } else { - format!( - "{}({})", - label, - payload - .iter() - .map(|value| self.render_field_value(value)) - .collect::>() - .join(", ") - ) - } - } - } - } - - fn variant_label(&self, variant_id: DeclarationId) -> String { - self.dag - .declarations() - .iter() - .find_map(|decl| match &decl.connective { - TypeConnective::Disj { variants } => variants - .iter() - .find(|variant| variant.ty == variant_id) - .map(|variant| variant.label.clone()), - _ => None, - }) - .unwrap_or_else(|| panic!("variant declaration {:?} not found", variant_id)) - } -} - -pub struct TestgenLens<'a> { - dag: &'a Dag, -} - -impl<'a> TestgenLens<'a> { - pub fn new(dag: &'a Dag) -> Self { - Self { dag } - } - - pub fn query(&self) -> Vec> { - let mut claims = Vec::new(); - let mut next_claim_id = 0usize; - for decl_id in self.named_std_type_ids() { - let decl = self.dag.declaration(decl_id); - let subst = self.default_subst(decl); - let Some(type_expr) = self.render_type_expr(decl_id, &subst) else { - continue; - }; - match &decl.connective { - TypeConnective::Conj { children } => { - let compile_value = self.render_value_expr(decl_id, &subst, 0); - if let Some(value_expr) = &compile_value { - let compile_source = format!("let witness: {type_expr} = {value_expr}\n"); - let compile_file_name = format!("{}_compiles.v3", sanitize(&type_expr)); - self.push_claim( - &mut claims, - &mut next_claim_id, - format!("{type_expr} compiles"), - compile_source.clone(), - compile_file_name.clone(), - self.sum_variant("TestPredicate", "Compiles", Vec::new()), - ); - self.push_claim( - &mut claims, - &mut next_claim_id, - format!("{type_expr} witness resolves"), - compile_source.clone(), - format!("{}_port_state.v3", sanitize(&type_expr)), - self.port_state_predicate("witness", "Resolved"), - ); - if let Some(cost) = - self.bind_cost_of(&compile_source, &compile_file_name, "witness") - { - self.push_claim( - &mut claims, - &mut next_claim_id, - format!("{type_expr} witness has bounded cost"), - compile_source, - format!("{}_cost.v3", sanitize(&type_expr)), - self.cost_bounded_predicate("witness", "Eq", cost), - ); - } - } - let missing_field = self.missing_field_name(children); - let missing_field_source = - format!("fn probe(value: {type_expr}) -> Int = value.{missing_field}\n"); - self.push_claim( - &mut claims, - &mut next_claim_id, - format!("{type_expr} rejects missing field"), - missing_field_source.clone(), - format!("{}_missing_field.v3", sanitize(&type_expr)), - self.diagnostic_predicate( - "ResolveError", - &format!("field `{missing_field}` does not exist"), - ), - ); - self.push_claim( - &mut claims, - &mut next_claim_id, - format!("{type_expr} missing-field port stays unresolved"), - missing_field_source, - format!("{}_missing_field_port_state.v3", sanitize(&type_expr)), - self.port_state_predicate("probe", "Unresolved"), - ); - if compile_value.is_some() - && decl.span.file == "src/v3/std/verification.dag" - && self.supports_type_mismatch_claim(children) - { - let mismatch_source = format!( - "let witness: {type_expr} = {}\n", - self.render_mismatch_record(children, &subst) - ); - self.push_claim( - &mut claims, - &mut next_claim_id, - format!("{type_expr} rejects field type mismatch"), - mismatch_source.clone(), - format!("{}_type_mismatch.v3", sanitize(&type_expr)), - self.diagnostic_kind_predicate("TypeMismatch"), - ); - self.push_claim( - &mut claims, - &mut next_claim_id, - format!("{type_expr} mismatched witness stays unresolved"), - mismatch_source, - format!("{}_type_mismatch_port_state.v3", sanitize(&type_expr)), - self.port_state_predicate("witness", "Unresolved"), - ); - } - } - TypeConnective::Disj { variants } => { - for variant in variants { - if let Some(value_expr) = - self.render_variant_witness(decl_id, variant, &subst, 0) - { - let compile_source = - format!("let witness: {type_expr} = {value_expr}\n"); - let base_name = - format!("{}_{}", sanitize(&type_expr), sanitize(&variant.label)); - self.push_claim( - &mut claims, - &mut next_claim_id, - format!("{type_expr} variant {} compiles", variant.label), - compile_source.clone(), - format!("{base_name}_compiles.v3"), - self.sum_variant("TestPredicate", "Compiles", Vec::new()), - ); - self.push_claim( - &mut claims, - &mut next_claim_id, - format!("{type_expr} variant {} resolves", variant.label), - compile_source.clone(), - format!("{base_name}_port_state.v3"), - self.port_state_predicate("witness", "Resolved"), - ); - if let Some(cost) = self.bind_cost_of( - &compile_source, - &format!("{base_name}_compiles.v3"), - "witness", - ) { - self.push_claim( - &mut claims, - &mut next_claim_id, - format!( - "{type_expr} variant {} has bounded cost", - variant.label - ), - compile_source, - format!("{base_name}_cost.v3"), - self.cost_bounded_predicate("witness", "Eq", cost), - ); - } - } - } - if variants.len() > 1 { - let non_exhaustive_source = format!( - "fn probe(value: {type_expr}) -> Int = match value {{ {} => 0 }}\n", - self.match_pattern(&variants[0]) - ); - self.push_claim( - &mut claims, - &mut next_claim_id, - format!("{type_expr} requires exhaustive match"), - non_exhaustive_source.clone(), - format!("{}_non_exhaustive.v3", sanitize(&type_expr)), - self.diagnostic_predicate("ResolveError", "non-exhaustive"), - ); - self.push_claim( - &mut claims, - &mut next_claim_id, - format!("{type_expr} non-exhaustive match stays unresolved"), - non_exhaustive_source, - format!("{}_non_exhaustive_port_state.v3", sanitize(&type_expr)), - self.port_state_predicate("probe", "Unresolved"), - ); - } - } - _ => {} - } - } - claims - } - - fn push_claim( - &self, - claims: &mut Vec>, - next_claim_id: &mut usize, - claim_name: String, - program_source: String, - file_name: String, - predicate: FieldValue, - ) { - let declaration_name = format!("generated_test_claim_{:03}", *next_claim_id); - *next_claim_id += 1; - claims.push(GeneratedClaim::new( - self.dag, - declaration_name, - vec![ - ( - "name".to_string(), - FieldValue::Literal(LiteralBits::String(claim_name)), - ), - ( - "source".to_string(), - FieldValue::Literal(LiteralBits::String(program_source)), - ), - ( - "file_name".to_string(), - FieldValue::Literal(LiteralBits::String(file_name)), - ), - ("predicate".to_string(), predicate), - ("requires".to_string(), FieldValue::List(Vec::new())), - ], - )); - } - - fn sum_variant( - &self, - sum_name: &str, - variant_label: &str, - payload: Vec, - ) -> FieldValue { - let sum_decl = self - .dag - .declaration_by_name(sum_name) - .unwrap_or_else(|| panic!("bootstrap should load `{sum_name}`")); - self.sum_variant_decl(sum_decl.id, variant_label, payload) - } - - fn sum_variant_decl( - &self, - sum_decl_id: DeclarationId, - variant_label: &str, - payload: Vec, - ) -> FieldValue { - let sum_decl = self.dag.declaration(sum_decl_id); - let TypeConnective::Disj { variants } = &sum_decl.connective else { - panic!( - "declaration {:?} should lower to a Disj, got {:?}", - sum_decl_id, sum_decl.connective - ); - }; - let constructor = variants - .iter() - .find(|variant| variant.label == variant_label) - .map(|variant| variant.ty) - .unwrap_or_else(|| { - panic!( - "variant `{variant_label}` not found under declaration {:?}", - sum_decl_id - ) - }); - FieldValue::Variant { - constructor, - payload, - } - } - - fn diagnostic_kind_predicate(&self, kind: &str) -> FieldValue { - self.sum_variant( - "TestPredicate", - "FailsWithDiagnostic", - vec![self.diagnostic_reference(kind, None)], - ) - } - - fn diagnostic_predicate(&self, kind: &str, detail_contains: &str) -> FieldValue { - self.sum_variant( - "TestPredicate", - "FailsWithDiagnostic", - vec![self.diagnostic_reference(kind, Some(detail_contains))], - ) - } - - fn diagnostic_reference(&self, kind: &str, detail_contains: Option<&str>) -> FieldValue { - FieldValue::Record(vec![ - ( - "kind".to_string(), - self.sum_variant("DiagnosticKind", kind, Vec::new()), - ), - ( - "detail_contains".to_string(), - self.diagnostic_detail_expectation(detail_contains), - ), - ]) - } - - fn diagnostic_detail_expectation(&self, value: Option<&str>) -> FieldValue { - match value { - Some(text) => self.sum_variant( - "DiagnosticDetailExpectation", - "Contains", - vec![FieldValue::Literal(LiteralBits::String(text.to_string()))], - ), - None => self.sum_variant("DiagnosticDetailExpectation", "AnyDetail", Vec::new()), - } - } - - fn port_state_predicate(&self, bind_name: &str, state_label: &str) -> FieldValue { - self.sum_variant( - "TestPredicate", - "PortHasState", - vec![ - FieldValue::Literal(LiteralBits::String(bind_name.to_string())), - self.sum_variant("PortStateExpectation", state_label, Vec::new()), - ], - ) - } - - fn cost_bounded_predicate( - &self, - bind_name: &str, - comparator: &str, - bound: usize, - ) -> FieldValue { - self.sum_variant( - "TestPredicate", - "CostBounded", - vec![ - FieldValue::Literal(LiteralBits::String(bind_name.to_string())), - self.sum_variant("ComparisonOp", comparator, Vec::new()), - FieldValue::Literal(LiteralBits::Int((bound as i64).to_string())), - ], - ) - } - - /// Return the complexity-lens cost for `bind_name` in a freshly - /// compiled fixture. `None` means the bind is not in the fixture - /// (legitimate skip — some testgen paths construct probes that - /// don't include a named bind). The two other failure modes - /// panic, because they indicate a structural invariant violation - /// the test harness must surface, not a silent "skip this claim": - /// - /// - `CostLookup::Miss` — the lens computed no cost for - /// a bind that testgen explicitly constructed. A well-formed - /// fixture always has a cost for the named bind; `Miss` - /// here means the fixture is malformed or the lens regressed. - /// - /// - `i64 → usize` conversion failure — the lens emitted a - /// negative cost. The complexity algebra is non-negative by - /// construction, so a negative is a compiler invariant - /// violation, not a caller concern. - /// - /// Keeping the two failure modes distinct prevents silently - /// dropping generated cost claims (Half A review blocker). - fn bind_cost_of(&self, source: &str, file_name: &str, bind_name: &str) -> Option { - let dag = compile_any(source, file_name); - let bind = dag.nodes().iter().find_map(|node| match node { - crate::dag::Behavior::Bind(bind) if bind.name == bind_name => Some(bind), - _ => None, - })?; - let cost = match cost_of(&dag, &bind.value) { - CostLookup::Hit(cost) => cost, - CostLookup::Miss => { - panic!( - "testgen: cost lens returned Miss for bind `{bind_name}` \ - in fixture `{file_name}` — the named bind was found in the \ - Dag but has no cost entry. Indicates a malformed fixture or \ - a regression in the complexity lens." - ); - } - }; - Some(usize::try_from(cost).unwrap_or_else(|_| { - panic!( - "testgen: complexity lens emitted negative cost `{cost}` for bind \ - `{bind_name}` in fixture `{file_name}` — the cost algebra is \ - non-negative by construction; a negative value is a compiler \ - invariant violation." - ) - })) - } - - fn named_std_type_ids(&self) -> Vec { - let mut chosen: HashMap = HashMap::new(); - for decl in self.dag.declarations() { - let Some(name) = &decl.name else { - continue; - }; - // DB-18 R2: `BoolPortRef` / `BranchArm` carry `PortId` witnesses that - // cannot be lowered from surface literals — testgen's synthetic - // `render_value_expr` cannot produce a valid compile witness. - if matches!(name.as_str(), "BoolPortRef" | "BranchArm") { - continue; - } - // `DimensionReport` has two `List<…>` fields whose synthetic - // `empty()` witnesses share one implicit template binding during - // infer (surface calls cannot spell `empty()` — no generic - // call syntax in expression position). Skip until testgen can emit - // non-conflicting list witnesses. - if name == "DimensionReport" { - continue; - } - // Cardinality list primitives (`NonEmptyList`, `NonSingletonList`) live in - // `substrate_minimal.dag` ahead of `list.dag`'s `empty()` helper in bootstrap - // order — the testgen witness uses `empty()` for `List<…>` tails in a - // position where resolution regressed; skip until the witness renderer - // names `empty<…>()` explicitly. - if matches!(name.as_str(), "NonEmptyList" | "NonSingletonList") { - continue; - } - if decl.value_body.is_some() - || !is_bootstrapped_std_file(&decl.span.file) - || decl.span.file == "src/v3/std/substrate.dag" - { - continue; - } - match chosen.get(name).copied() { - None => { - chosen.insert(name.clone(), decl.id); - } - Some(existing) => { - let new_rank = std_preference_rank(&decl.span.file); - let old_rank = std_preference_rank(&self.dag.declaration(existing).span.file); - if new_rank > old_rank { - chosen.insert(name.clone(), decl.id); - } - } - } - } - let mut ids: Vec<_> = chosen.into_values().collect(); - ids.sort_by_key(|id| self.dag.declaration(*id).name.clone()); - ids - } - - fn default_subst(&self, decl: &Declaration) -> HashMap { - let int_id = self - .dag - .declaration_by_name("Int") - .expect("bootstrap should load Int") - .id; - decl.type_params - .iter() - .map(|param| (*param, int_id)) - .collect() - } - - fn render_type_expr( - &self, - decl_id: DeclarationId, - subst: &HashMap, - ) -> Option { - let decl = self.dag.declaration(decl_id); - if let Some(name) = &decl.name { - if !matches!( - decl.connective, - TypeConnective::Atom(AtomPayload::TypeParam(_)) - ) { - if decl.type_params.is_empty() { - return Some(name.clone()); - } - let args: Option> = decl - .type_params - .iter() - .map(|param| self.render_type_expr(*subst.get(param)?, subst)) - .collect(); - return Some(format!("{name}<{}>", args?.join(", "))); - } - } - match &decl.connective { - TypeConnective::Atom(AtomPayload::TypeParam(_)) => { - self.render_type_expr(*subst.get(&decl_id)?, subst) - } - TypeConnective::Instantiation { - template, - arguments, - } => { - let template_decl = self.dag.declaration(*template); - let template_name = template_decl.name.as_ref()?; - let args: Option> = arguments - .iter() - .map(|arg| self.render_type_expr(arg.value, subst)) - .collect(); - Some(format!("{template_name}<{}>", args?.join(", "))) - } - _ => None, - } - } - - fn render_value_expr( - &self, - decl_id: DeclarationId, - subst: &HashMap, - depth: usize, - ) -> Option { - if depth > MAX_RENDER_DEPTH { - return None; - } - let decl = self.dag.declaration(decl_id); - if self - .render_type_expr(decl_id, subst) - .is_some_and(|ty| ty.starts_with("List<")) - && depth > 0 - { - return Some("empty()".to_string()); - } - match decl.name.as_deref() { - Some("Int") => Some("1".to_string()), - Some("Bool") => Some("true".to_string()), - Some("String") => Some("\"x\"".to_string()), - Some(_) if !is_bootstrapped_std_file(&decl.span.file) => None, - _ => match &decl.connective { - TypeConnective::Atom(AtomPayload::TypeParam(_)) => { - self.render_value_expr(*subst.get(&decl_id)?, subst, depth + 1) - } - TypeConnective::Instantiation { - template, - arguments, - } => { - let mut specialized = subst.clone(); - for arg in arguments { - specialized.insert(arg.parameter, arg.value); - } - self.render_value_expr(*template, &specialized, depth + 1) - } - TypeConnective::Conj { children } => { - let fields: Option> = children - .iter() - .map(|field| { - Some(format!( - "{}: {}", - field.label, - self.render_value_expr(field.ty, subst, depth + 1)? - )) - }) - .collect(); - Some(format!("{{ {} }}", fields?.join(", "))) - } - TypeConnective::Disj { variants } => variants - .iter() - .find_map(|variant| self.render_variant_expr(variant, subst, depth + 1)), - _ => None, - }, - } - } - - fn render_variant_expr( - &self, - variant: &Field, - subst: &HashMap, - depth: usize, - ) -> Option { - let TypeConnective::Conj { children } = &self.dag.declaration(variant.ty).connective else { - return None; - }; - if children.is_empty() { - return Some(variant.label.clone()); - } - let payloads: Option> = children - .iter() - .map(|field| self.render_value_expr(field.ty, subst, depth + 1)) - .collect(); - Some(format!("{}({})", variant.label, payloads?.join(", "))) - } - - fn render_variant_witness( - &self, - sum_decl_id: DeclarationId, - variant: &Field, - subst: &HashMap, - depth: usize, - ) -> Option { - if self.dag.declaration(sum_decl_id).name.as_deref() == Some("List") { - return match variant.label.as_str() { - "Empty" => Some("[]".to_string()), - "Cons" => { - let TypeConnective::Conj { children } = - &self.dag.declaration(variant.ty).connective - else { - return None; - }; - let head = self.render_value_expr(children.first()?.ty, subst, depth + 1)?; - Some(format!("[{head}]")) - } - _ => None, - }; - } - self.render_variant_expr(variant, subst, depth) - } - - fn render_mismatch_record( - &self, - children: &[Field], - subst: &HashMap, - ) -> String { - let mismatch_index = 0usize; - format!( - "{{ {} }}", - children - .iter() - .enumerate() - .map(|(idx, field)| { - let value = if idx == mismatch_index { - self.render_wrong_value_expr(field.ty, subst) - } else { - self.render_value_expr(field.ty, subst, 1) - .expect("type mismatch claims should reuse a valid witness for non-targeted fields") - }; - format!("{}: {}", field.label, value) - }) - .collect::>() - .join(", ") - ) - } - - fn render_wrong_value_expr( - &self, - decl_id: DeclarationId, - subst: &HashMap, - ) -> String { - match self.render_type_expr(decl_id, subst).as_deref() { - Some("Int") => "\"oops\"".to_string(), - _ => "1".to_string(), - } - } - - fn missing_field_name(&self, children: &[Field]) -> String { - let mut candidate = "missing_field".to_string(); - while children.iter().any(|field| field.label == candidate) { - candidate.push('_'); - } - candidate - } - - fn match_pattern(&self, variant: &Field) -> String { - match &self.dag.declaration(variant.ty).connective { - TypeConnective::Conj { children } if children.is_empty() => variant.label.clone(), - TypeConnective::Conj { .. } => format!("{}(payload)", variant.label), - _ => variant.label.clone(), - } - } - - fn supports_type_mismatch_claim(&self, children: &[Field]) -> bool { - !children.is_empty() - && children.iter().all(|field| { - !matches!( - self.effective_connective(field.ty), - Some(TypeConnective::Arrow { .. }) - ) - }) - } - - fn effective_connective(&self, decl_id: DeclarationId) -> Option<&TypeConnective> { - let decl = self.dag.declaration(decl_id); - match &decl.connective { - TypeConnective::Atom(AtomPayload::TypeParam(_)) => None, - TypeConnective::Instantiation { .. } if decl.name.is_some() => Some(&decl.connective), - TypeConnective::Instantiation { template, .. } => { - Some(&self.dag.declaration(*template).connective) - } - other => Some(other), - } - } -} - -fn is_bootstrapped_std_file(file: &str) -> bool { - file.starts_with("src/v3/std/") -} - -fn std_preference_rank(file: &str) -> usize { - if file.starts_with("src/v3/std/") { - 2 - } else { - 0 - } -} - -fn sanitize(s: &str) -> String { - s.chars() - .map(|ch| if ch.is_ascii_alphanumeric() { ch } else { '_' }) - .collect() -} - -fn quote_string(s: &str) -> String { - let escaped = s - .replace('\\', "\\\\") - .replace('"', "\\\"") - .replace('\n', "\\n"); - format!("\"{escaped}\"") -} - -fn compile_any(source: &str, file: &str) -> Dag { - match compile_to_dag(source, file) { - Ok(dag) => dag, - Err(CompileError::Semantic(dag)) => dag, - Err(other) => panic!("unexpected structural error while compiling `{file}`: {other:?}"), - } -} diff --git a/src/v3/compiler/src/lens_unused_parameters_generated.rs b/src/v3/compiler/src/lens_unused_parameters_generated.rs deleted file mode 100644 index a4f0a71a01d..00000000000 --- a/src/v3/compiler/src/lens_unused_parameters_generated.rs +++ /dev/null @@ -1,191 +0,0 @@ -// AUTO-GENERATED from `src/v3/lenses/unused_parameters.dag` via -// `emit_rust_module`. Regenerate instead of hand-editing. - -#[derive(Clone, Debug)] -pub struct UnusedParameter { - pub function: NodeId, - pub parameter: PortId, - pub parameter_index: i64, -} -pub fn check(p0: &Dag) -> Vec { - ((p0).nodes()) - .iter() - .fold(Vec::new(), |__fold_acc, __fold_item| { - let mut __left = (__fold_acc).clone(); - __left.extend(check_behavior(p0, __fold_item)); - __left - }) -} -pub fn check_behavior(p0: &Dag, p1: &Behavior) -> Vec { - match p1 { - Behavior::Value(_) => Vec::new(), - Behavior::Transform(_) => Vec::new(), - Behavior::Branch(_) => Vec::new(), - Behavior::Loop(_) => Vec::new(), - Behavior::Bind(bind) => { - if ((bind).params).is_empty() { - Vec::new() - } else { - check_bind(p0, bind) - } - } - } -} -pub fn check_bind(p0: &Dag, p1: &BindNode) -> Vec { - collect_unused_params( - &((p1).params), - p1, - &(referenced_ports(p0, (p1).result_port())), - 0, - ) -} -pub fn collect_unused_params( - p0: &[PortId], - p1: &BindNode, - p2: &[PortId], - p3: i64, -) -> Vec { - match p0 { - [] => Vec::new(), - [__list_head, __list_tail @ ..] => { - if (p2).contains(__list_head) { - collect_unused_params(__list_tail, p1, p2, (p3 + 1)) - } else { - { - let mut __list = collect_unused_params(__list_tail, p1, p2, (p3 + 1)); - __list.insert( - 0, - UnusedParameter { - function: (p1).id, - parameter: (*(__list_head)), - parameter_index: p3, - }, - ); - __list - } - } - } - } -} -pub fn referenced_ports(p0: &Dag, p1: PortId) -> Vec { - walk_steps(&(((p0).ports()).len() as i64), p0, &[p1], Vec::new()) -} -pub fn walk_steps(p0: &i64, p1: &Dag, p2: &[PortId], p3: Vec) -> Vec { - if ((*(p0)) == 0) { - p3 - } else { - if (p2).is_empty() { - p3 - } else { - walk_steps( - &((*(p0)) - 1), - p1, - &(expand_frontier_list(p2, p1, &p3)), - expand_referenced_list(p2, (p3).clone()), - ) - } - } -} -pub fn expand_frontier_list(p0: &[PortId], p1: &Dag, p2: &[PortId]) -> Vec { - match p0 { - [] => Vec::new(), - [__list_head, __list_tail @ ..] => { - if (p2).contains(__list_head) { - expand_frontier_list(__list_tail, p1, p2) - } else { - { - let mut __left = inputs_for_port(p1, __list_head); - __left.extend(expand_frontier_list(__list_tail, p1, p2)); - __left - } - } - } - } -} -pub fn expand_referenced_list(p0: &[PortId], p1: Vec) -> Vec { - (p0).iter().fold((p1).clone(), |__fold_acc, __fold_item| { - if (__fold_acc).contains(__fold_item) { - __fold_acc - } else { - { - let mut __list = (__fold_acc).clone(); - __list.insert(0, (*(__fold_item))); - __list - } - } - }) -} -pub fn inputs_for_port(p0: &Dag, p1: &PortId) -> Vec { - match &((p0).port_opt(p1).cloned()) { - None => Vec::new(), - Some(p) => match &((p).produced_by) { - None => Vec::new(), - Some(node_id) => inputs_for_node(p0, node_id), - }, - } -} -pub fn inputs_for_node(p0: &Dag, p1: &NodeId) -> Vec { - match &((p0).node_opt(p1).cloned()) { - None => Vec::new(), - Some(behavior) => inputs_for_behavior(p0, behavior), - } -} -pub fn inputs_for_behavior(p0: &Dag, p1: &Behavior) -> Vec { - match p1 { - Behavior::Value(_) => Vec::new(), - Behavior::Transform(t) => ((t).inputs).to_vec(), - Behavior::Branch(branch) => { - let mut __list = branch_path_outputs(&((branch).paths)); - __list.insert(0, (branch).input); - __list - } - Behavior::Loop(loop_node) => loop_inputs(p0, loop_node), - Behavior::Bind(bind) => vec![(bind).result_port()], - } -} -pub fn loop_inputs(p0: &Dag, p1: &LoopNode) -> Vec { - { - let mut __left = { - let mut __list = { - let mut __list = loop_bound_inputs(&((p1).bound)); - __list.insert(0, (p1).init); - __list - }; - __list.insert(0, (p1).source); - __list - }; - __left.extend(match &((p0).node_opt(&((p1).body)).cloned()) { - None => Vec::new(), - Some(body_node) => vec![behavior_port(body_node)], - }); - __left - } -} -pub fn loop_bound_inputs(p0: &LoopBound) -> Vec { - match p0 { - LoopBound::Cardinality { count: payload } => vec![(*(payload))], - LoopBound::Descent { - cluster: __payload_cluster, - measure: __payload_measure, - } => vec![(*(__payload_measure))], - } -} -pub fn branch_path_outputs(p0: &[Path]) -> Vec { - match p0 { - [] => Vec::new(), - [__list_head, __list_tail @ ..] => { - let mut __list = branch_path_outputs(__list_tail); - __list.insert(0, (__list_head).result_port()); - __list - } - } -} -pub fn behavior_port(p0: &Behavior) -> PortId { - match p0 { - Behavior::Value(v) => (v).result_port(), - Behavior::Transform(t) => (t).result_port(), - Behavior::Branch(b) => (b).result_port(), - Behavior::Loop(l) => (l).result_port(), - Behavior::Bind(bind) => (bind).result_port(), - } -} diff --git a/src/v3/compiler/src/lib.rs b/src/v3/compiler/src/lib.rs deleted file mode 100644 index 4f6da1d4f29..00000000000 --- a/src/v3/compiler/src/lib.rs +++ /dev/null @@ -1,6365 +0,0 @@ -// v3 compiler — M0 substrate skeleton. -// -// Pipeline (target end state for M0): -// source text -> tokenize -> parse -> lower to L1 behaviors -> infer -> Dag -// -// Fail-closed compile boundary (invariant C-8): -// compile_to_dag returns Ok(Dag) ONLY when the diagnostic table -// is empty. Any semantic errors (type mismatches, unresolved -// names, arity errors, etc.) surface as Err(CompileError::Semantic(dag)) -// — the dag is still handed back so the caller can inspect the -// diagnostics, but the Result variant is Err. -// -// Structural errors (tokenize/parse) surface as their own variants -// because they occur before a Dag exists. G5: no TypeError variant -// on CompileError — type errors live on the Dag, not in the Err -// payload. - -pub mod cementing_dispatch; -pub mod complexity_lattice; -pub mod dag; -pub mod diagnostics; -mod enforced_lens_application; -// T-30 **P5(b)** interim Practice-8 mirror — **private** `mod` (not crate public API; INVARIANTS -// P2 / Practice 6). `dead_code` is suppressed **only** inside `v4_hollow_alias_gate.rs` until a -// production consumer exists — dissolution when the generated `.dag` gate is authority -// (`INVARIANTS.md` §P5(b)). -mod v4_hollow_alias_gate; -pub use enforced_lens_application::check_enforced_lens_applications; -pub use enforced_lens_application::parallelism_iteration_opt_in_enforcement_violates; -// Gate #58 integration receipts (`tests/integration/t_gate_58_apply_lens_self_application_test.rs`) -// need the helpers below as **`pub`**: the consolidated integration test binary is a separate -// crate that links this library and cannot call `pub(crate)` items on `v3_compiler`. -// `#[doc(hidden)]` keeps them off the supported public API; they remain unsupported for -// out-of-tree callers (see `enforced_lens_application` module docs on each symbol). -#[doc(hidden)] -pub use enforced_lens_application::gate_58_test_parse_timing_budget_violation_max_ns_pair; -#[doc(hidden)] -pub use enforced_lens_application::gate_58_test_raise_modeled_ci_timing_measurement_duration_ns; -pub mod integration_rs_wiring_scan; -pub mod lens_t_las_carrier; -pub mod pb_method_template_projection; -pub mod r3_gate_87_cementing_regen_runner_suites; -mod regen_bootstrap_emit; -pub mod regen_lens_driver; -pub mod regen_tokenize; - -/// SG-0 producer-owned generated-file manifest. -/// -/// `GENERATED_FILES` is the workspace-relative path list of every -/// `.rs` file under `src/v3/compiler` that is produced by a codegen -/// authority. The list is emitted by `build.rs` at build time; the -/// literal is reviewed there. Two consumers today: the `regen_*` -/// binaries (they assert their output path is in the list before -/// writing) and the SG-0 census test (it uses the list as the sole -/// generated/hand-authored partition — no content-marker scanning). -pub mod generated_files { - include!(concat!(env!("OUT_DIR"), "/v3_generated_files.rs")); -} - -pub mod emit; -pub mod emit_rust; -pub mod emit_rust_bin_shim; -pub mod omni_shape_b_openapi; -pub mod process_exit; -pub mod realization_cost { - //! Rust-side realization-cost table for T-CostLens-Composition's epsilon path. - //! - //! The `.dag` cost lens remains target-agnostic and produces `SymbolicCost`. - //! This module consumes target LanguageSpec realization rows and extracts the - //! per-primitive concrete costs that later composition slices combine with the - //! abstract symbolic shape. - - use std::collections::HashMap; - - use crate::dag::{ - literal_decimal_i64, sequential, Dag, DeclarationId, FieldValue, LiteralBits, SymbolicCost, - ValueBody, - }; - - /// 🟢 GREEN (terminal): closed mirror of the six `*Realization` - /// meta-types in `src/v3/std/emit_model.dag`; each variant selects a - /// distinct row shape with different key fields. - #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] - pub enum RealizationCostCategory { - Type, - Callable, - Operator, - Behavior, - TypeInstantiation, - Pattern, - } - - /// 🟢 GREEN (terminal): lookup key shape is determined by the realization - /// row category. Five categories key by `target`; operator rows key by - /// `(target, op)`, so collapsing to one record would make absent fields - /// meaningful for non-operator rows. - #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] - pub enum RealizationCostKey { - Type(DeclarationId), - Callable(DeclarationId), - Operator { - target: DeclarationId, - op: DeclarationId, - }, - Behavior(DeclarationId), - TypeInstantiation(DeclarationId), - Pattern(DeclarationId), - } - - impl RealizationCostKey { - pub fn category(self) -> RealizationCostCategory { - match self { - Self::Type(_) => RealizationCostCategory::Type, - Self::Callable(_) => RealizationCostCategory::Callable, - Self::Operator { .. } => RealizationCostCategory::Operator, - Self::Behavior(_) => RealizationCostCategory::Behavior, - Self::TypeInstantiation(_) => RealizationCostCategory::TypeInstantiation, - Self::Pattern(_) => RealizationCostCategory::Pattern, - } - } - } - - #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] - pub struct RealizationCostAmount { - value: i64, - } - - impl RealizationCostAmount { - fn new(value: i64) -> Result { - if value >= 0 { - Ok(Self { value }) - } else { - Err(value) - } - } - - pub fn value(self) -> i64 { - self.value - } - } - - #[derive(Debug, Clone, PartialEq, Eq)] - pub struct RealizationCostEntry { - pub declaration: DeclarationId, - pub language: DeclarationId, - pub key: RealizationCostKey, - pub cost: RealizationCostAmount, - } - - impl RealizationCostEntry { - pub fn category(&self) -> RealizationCostCategory { - self.key.category() - } - } - - #[derive(Debug, Clone, PartialEq, Eq)] - pub struct RealizationCostTable { - language: DeclarationId, - entries: HashMap, - } - - /// 🟢 GREEN (terminal): fail-closed error taxonomy for this walker. - /// The variants distinguish missing meta-type substrate, malformed row - /// payload, negative cost facts, and duplicate realization keys; these are - /// different repair surfaces. - #[derive(Debug, Clone, PartialEq, Eq)] - pub enum RealizationCostError { - MissingMeta(&'static str), - NotLanguageSpec { - declaration: DeclarationId, - }, - MalformedRealization { - declaration: DeclarationId, - detail: String, - }, - NegativeRealizationCost { - declaration: DeclarationId, - cost: i64, - }, - DuplicateRealization { - declaration: DeclarationId, - key: RealizationCostKey, - }, - } - - impl RealizationCostTable { - pub fn for_language( - dag: &Dag, - language: DeclarationId, - ) -> Result { - let metas = RealizationMetas::read(dag)?; - let language_spec_meta = dag - .declaration_by_name("LanguageSpec") - .map(|decl| decl.id) - .ok_or(RealizationCostError::MissingMeta("LanguageSpec"))?; - if dag.declaration(language).meta_tag != Some(language_spec_meta) { - return Err(RealizationCostError::NotLanguageSpec { - declaration: language, - }); - } - let mut entries = HashMap::new(); - - for decl in dag.declarations() { - let Some(meta_tag) = decl.meta_tag else { - continue; - }; - let Some(category) = metas.category_for(meta_tag) else { - continue; - }; - let Some(ValueBody::Structural { fields }) = &decl.value_body else { - return Err(RealizationCostError::MalformedRealization { - declaration: decl.id, - detail: "realization data item has no Structural value_body".to_string(), - }); - }; - let row_language = require_decl_ref(fields, "language", decl.id)?; - if row_language != language { - continue; - } - let target = require_decl_ref(fields, "target", decl.id)?; - let key = match category { - RealizationCostCategory::Type => RealizationCostKey::Type(target), - RealizationCostCategory::Callable => RealizationCostKey::Callable(target), - RealizationCostCategory::Operator => RealizationCostKey::Operator { - target, - op: require_decl_ref(fields, "op", decl.id)?, - }, - RealizationCostCategory::Behavior => RealizationCostKey::Behavior(target), - RealizationCostCategory::TypeInstantiation => { - RealizationCostKey::TypeInstantiation(target) - } - RealizationCostCategory::Pattern => RealizationCostKey::Pattern(target), - }; - let entry = RealizationCostEntry { - declaration: decl.id, - language, - key, - cost: require_nonnegative_int(fields, "cost", decl.id)?, - }; - if entries.insert(key, entry).is_some() { - return Err(RealizationCostError::DuplicateRealization { - declaration: decl.id, - key, - }); - } - } - - Ok(Self { language, entries }) - } - - pub fn language(&self) -> DeclarationId { - self.language - } - - pub fn len(&self) -> usize { - self.entries.len() - } - - pub fn is_empty(&self) -> bool { - self.entries.is_empty() - } - - pub fn get(&self, key: &RealizationCostKey) -> Option<&RealizationCostEntry> { - self.entries.get(key) - } - - pub fn cost(&self, key: &RealizationCostKey) -> Option { - self.get(key).map(|entry| entry.cost) - } - } - - /// Compose the target-agnostic symbolic cost with target realization - /// costs read from a `LanguageSpec` row table. - pub fn compose_symbolic_cost_with_realization_costs( - algebra_cost: SymbolicCost, - costs: impl IntoIterator, - ) -> SymbolicCost { - costs.into_iter().fold(algebra_cost, |acc, cost| { - sequential(acc, SymbolicCost::ConstantCost { _0: cost.value() }) - }) - } - - struct RealizationMetas { - type_meta: DeclarationId, - callable_meta: DeclarationId, - operator_meta: DeclarationId, - behavior_meta: DeclarationId, - type_instantiation_meta: DeclarationId, - pattern_meta: DeclarationId, - } - - impl RealizationMetas { - fn read(dag: &Dag) -> Result { - Ok(Self { - type_meta: dag - .type_realization_meta() - .ok_or(RealizationCostError::MissingMeta("TypeRealization"))?, - callable_meta: dag - .callable_realization_meta() - .ok_or(RealizationCostError::MissingMeta("CallableRealization"))?, - operator_meta: dag - .operator_realization_meta() - .ok_or(RealizationCostError::MissingMeta("OperatorRealization"))?, - behavior_meta: dag - .behavior_realization_meta() - .ok_or(RealizationCostError::MissingMeta("BehaviorRealization"))?, - type_instantiation_meta: dag.type_instantiation_realization_meta().ok_or( - RealizationCostError::MissingMeta("TypeInstantiationRealization"), - )?, - pattern_meta: dag - .pattern_realization_meta() - .ok_or(RealizationCostError::MissingMeta("PatternRealization"))?, - }) - } - - fn category_for(&self, meta_tag: DeclarationId) -> Option { - if meta_tag == self.type_meta { - Some(RealizationCostCategory::Type) - } else if meta_tag == self.callable_meta { - Some(RealizationCostCategory::Callable) - } else if meta_tag == self.operator_meta { - Some(RealizationCostCategory::Operator) - } else if meta_tag == self.behavior_meta { - Some(RealizationCostCategory::Behavior) - } else if meta_tag == self.type_instantiation_meta { - Some(RealizationCostCategory::TypeInstantiation) - } else if meta_tag == self.pattern_meta { - Some(RealizationCostCategory::Pattern) - } else { - None - } - } - } - - fn require_field<'a>( - fields: &'a [(String, FieldValue)], - label: &str, - declaration: DeclarationId, - ) -> Result<&'a FieldValue, RealizationCostError> { - fields - .iter() - .find_map(|(field_label, value)| (field_label == label).then_some(value)) - .ok_or(RealizationCostError::MalformedRealization { - declaration, - detail: format!("realization data item is missing required field `{label}`"), - }) - } - - fn require_decl_ref( - fields: &[(String, FieldValue)], - label: &str, - declaration: DeclarationId, - ) -> Result { - match require_field(fields, label, declaration)? { - FieldValue::Reference(id) => Ok(*id), - _ => Err(RealizationCostError::MalformedRealization { - declaration, - detail: format!("realization data item field `{label}` should be a DeclarationRef"), - }), - } - } - - fn require_nonnegative_int( - fields: &[(String, FieldValue)], - label: &str, - declaration: DeclarationId, - ) -> Result { - match require_field(fields, label, declaration)? { - FieldValue::Literal(LiteralBits::Int(s)) => { - let Some(parsed) = literal_decimal_i64(s.as_str()) else { - return Err(RealizationCostError::MalformedRealization { - declaration, - detail: format!( - "realization data item field `{label}` must be a signed decimal i64; got `{s}`" - ), - }); - }; - RealizationCostAmount::new(parsed).map_err(|cost| { - RealizationCostError::NegativeRealizationCost { declaration, cost } - }) - } - _ => Err(RealizationCostError::MalformedRealization { - declaration, - detail: format!("realization data item field `{label}` should be an Int literal"), - }), - } - } - - #[cfg(test)] - mod tests { - use super::*; - - use crate::generated_full_bootstrap_dag; - - #[test] - fn realization_cost_table_rejects_negative_cost_rows() { - let mut dag = bootstrap_dag(); - let rust_language = named_id(&dag, "rust_language"); - let rust_int = named_id(&dag, "rust_int"); - set_int_field(&mut dag, rust_int, "cost", -1); - - let err = RealizationCostTable::for_language(&dag, rust_language) - .expect_err("negative realization cost should fail closed"); - - assert_eq!( - err, - RealizationCostError::NegativeRealizationCost { - declaration: rust_int, - cost: -1, - } - ); - } - - #[test] - fn realization_cost_table_rejects_non_language_spec_context() { - let dag = bootstrap_dag(); - let not_language = named_id(&dag, "Int"); - - let err = RealizationCostTable::for_language(&dag, not_language) - .expect_err("non-LanguageSpec context should fail closed"); - - assert_eq!( - err, - RealizationCostError::NotLanguageSpec { - declaration: not_language, - } - ); - } - - fn named_id(dag: &Dag, name: &str) -> DeclarationId { - dag.declaration_by_name(name) - .unwrap_or_else(|| panic!("missing declaration `{name}`")) - .id - } - - fn bootstrap_dag() -> Dag { - std::thread::Builder::new() - .name("realization-cost-bootstrap".to_string()) - .stack_size(64 * 1024 * 1024) - .spawn(generated_full_bootstrap_dag) - .expect("spawn bootstrap builder") - .join() - .expect("bootstrap builder should not panic") - } - - fn set_int_field(dag: &mut Dag, decl: DeclarationId, field_name: &str, value: i64) { - let Some(ValueBody::Structural { fields }) = &mut dag.declaration_mut(decl).value_body - else { - panic!("declaration {:?} should have structural value_body", decl); - }; - let field = fields - .iter_mut() - .find_map(|(label, field_value)| (label == field_name).then_some(field_value)) - .unwrap_or_else(|| panic!("missing field `{field_name}`")); - *field = FieldValue::Literal(LiteralBits::Int(value.to_string())); - } - } -} -pub mod self_host_receipt_p0; -pub mod evaluator { - //! E2 evaluator frame helpers. - //! - //! This module is the narrow Rust realization of the existing - //! `EvalFrame { bindings: Map }` and - //! `EvalStateStack { frames: List }` substrate carriers. The - //! value payload is generic on purpose: E2 owns binding-scope behavior, - //! not a new observable `Value` carrier. Later body-evaluator slices plug - //! in the runtime value representation without changing the frame rules - //! here. - //! - //! Dissolution target: when the `.dag` evaluator body implementation owns - //! frame mutation directly, this host helper should shrink to generated or - //! substrate-backed calls instead of becoming a parallel evaluator runtime. - - use std::collections::HashMap; - use std::str::FromStr; - - use num_bigint::BigInt; - - use crate::dag::{ - ArithmeticOp, ArrowBody, Behavior, BranchNode, BranchPattern, ClusterId, ComparisonOp, Dag, - DeclarationId, LiteralBits, LogicalOp, LoopBound, NodeId, OperatorKind, Path, PortId, - TransformNode, TransformTarget, TypeConnective, - }; - - /// Rust mirror of the substrate runtime `Value` carrier in - /// `src/v3/std/runtime.dag`. - /// - /// **Dissolution receipt: TERMINAL.** This is not a second value authority: - /// it has the same five inhabitants as the `.dag` carrier and exists so the - /// Rust eager evaluator can return typed runtime data until generated - /// substrate-backed calls replace this host helper. - #[derive(Debug, Clone, PartialEq, Eq)] - pub enum Value { - LiteralValue(LiteralBits), - RecordValue(Vec), - VariantValue { - tag: DeclarationId, - payload: Box, - }, - NodeRef(NodeId), - CardinalityValue(LoopBound), - } - - #[derive(Debug, Clone, PartialEq, Eq)] - pub struct NamedField { - pub label: String, - pub value: Value, - } - - /// Rust evaluator consumer mirror of `std.termination::StrictEvidence`. - /// - /// The `.dag` carrier is the authority; this mirror exists only because - /// the eager Rust evaluator cannot yet call generated std block bodies. - #[derive(Debug, Clone, Copy, PartialEq, Eq)] - pub enum StrictEvidence { - Strict, - } - - /// Rust evaluator consumer mirror of `std.termination::NonStrictEvidence`. - #[derive(Debug, Clone, Copy, PartialEq, Eq)] - pub enum NonStrictEvidence { - NonIncreasing, - DescentUnknown, - } - - /// Rust evaluator consumer mirror of `std.termination::DescentResidual`. - #[derive(Debug, Clone, Copy, PartialEq, Eq)] - pub enum DescentResidual { - EvidenceUnknown(NonStrictEvidence), - EvidenceIncomplete, - } - - /// Rust evaluator consumer mirror of - /// `std.termination::DescentExecutionProof`. - #[derive(Debug, Clone, PartialEq, Eq)] - pub struct DescentExecutionProof { - pub cluster: ClusterId, - pub port: PortId, - pub per_path: HashMap, - } - - fn descent_execution_proof( - _dag: &Dag, - _cluster: ClusterId, - _port: PortId, - ) -> Result { - Err(DescentResidual::EvidenceIncomplete) - } - - /// Rust mirror of the PR-A.3 / TC2 eager strategy carrier. - /// - /// **Dissolution receipt: TERMINAL at PR-A.3 / TC2 input-order scope.** The - /// public evaluator boundary carries strategy now so downstream slices - /// cannot erase it. TC2 adds a second executable input order under the same - /// applicative/eager skeleton; additional strategy families must land with - /// substrate carriers and executable evaluator rules. - #[derive(Debug, Clone, PartialEq, Eq)] - pub enum EvalStrategy { - ApplicativeOrder { input_order: InputEvaluationOrder }, - } - - /// 🟢 TERMINAL: Rust mirror of `std.runtime::InputEvaluationOrder`. Both - /// variants have executable eager evaluator behavior and key TC2 - /// strategy-paired report producers through `EvalStrategy`. - #[derive(Debug, Clone, PartialEq, Eq)] - pub enum InputEvaluationOrder { - LeftFirst, - RightFirst, - } - - /// Stable [`EvalError::BadTransformOperands::reason`] when a `Transform` callable target is - /// not an Arrow-shaped declaration at evaluation time (single string authority for pins/tests). - pub const BAD_TRANSFORM_CALLABLE_TARGET_NOT_ARROW_REASON: &str = - "Callable target declaration is not an Arrow type"; - - /// **Dissolution receipt: TERMINAL.** Typed fail-closed outcomes for - /// the body evaluator: missing-substrate cases (`MissingNode`, - /// `UnboundPort`), E3 transform - /// operand / arity diagnostics (`TransformArityMismatch`, - /// `UnsupportedTransformTarget`, `BadTransformOperands`), Branch - /// resolution / shape / payload-frame errors (E4), and frame - /// discipline propagation (`FrameError`). E5 adds loop-bound - /// diagnostics from the readiness audit: descent residual, - /// non-integer cardinality, and negative cardinality. Adding any - /// further variant is a STOP+PING per the E0 brief — either route the - /// underlying gap through P1 or extend PR-B.1's fail-closed catalog - /// first. - #[derive(Debug, Clone, PartialEq, Eq)] - pub enum EvalError { - MissingNode { - node: NodeId, - }, - UnboundPort { - port: PortId, - }, - TransformArityMismatch { - expected: usize, - got: usize, - }, - UnsupportedTransformTarget { - kind: &'static str, - }, - BadTransformOperands { - reason: &'static str, - }, - /// E4 fail-closed: a `BranchPath.pattern` is still - /// `UnresolvedVariant` at evaluation time. Resolution must lower - /// `UnresolvedVariant` to `ResolvedVariant(DeclarationId)` before - /// the body evaluator runs. Reaching this variant is a resolution - /// gap, not a runtime case. - BranchUnresolvedVariant { - node: NodeId, - name: String, - }, - /// E4 fail-closed: scrutinee `Value` is not `VariantValue`, so no - /// `BranchPattern::ResolvedVariant(tag)` can match. Substrate + - /// inference guarantee totality on well-typed programs; reaching - /// this is an invariant violation, not a runtime case. - BranchScrutineeShape { - node: NodeId, - }, - /// E4 fail-closed: scrutinee is a `VariantValue { tag, .. }` but - /// no `BranchPath` carries `pattern: ResolvedVariant(decl)` with - /// `decl == tag`. Same invariant-violation framing. - BranchNoMatchingArm { - node: NodeId, - tag: DeclarationId, - }, - /// E5 fail-closed: `LoopBound::Descent` execution requires - /// termination evidence and is explicitly deferred by the E5 - /// readiness audit. The `measure` port is carried so diagnostics - /// identify the runtime value that would need descent evidence. - LoopBoundDescentResidual { - node: NodeId, - cluster: crate::dag::ClusterId, - measure: PortId, - }, - /// E5 fail-closed: cardinality loops accept only a non-negative - /// runtime `Int` literal as the bounded iteration witness. - LoopCardinalityNonInteger { - node: NodeId, - count: PortId, - }, - /// E5 fail-closed: negative counts are not cardinality witnesses. - LoopCardinalityNegative { - node: NodeId, - count: PortId, - value: i64, - }, - /// E5 fail-closed: count is non-negative but cannot fit in the - /// host iteration counter without truncation. - LoopCardinalityTooLarge { - node: NodeId, - count: PortId, - value: i64, - }, - /// E4 / E2 propagation: an `EvalFrameError` produced during - /// frame discipline (push/pop balance, duplicate bind, unbound - /// port). Carries the underlying `EvalFrameError` for - /// diagnostic locality. - FrameError(EvalFrameError), - } - - impl From for EvalError { - fn from(err: EvalFrameError) -> Self { - EvalError::FrameError(err) - } - } - - pub fn eval_value(value: &crate::dag::ValueNode) -> Value { - Value::LiteralValue(value.data.clone()) - } - - fn reify_bool_literal_for_branch_scrutinee(dag: &Dag, value: Value) -> Value { - match value { - Value::LiteralValue(LiteralBits::Bool(b)) => dag - .bool_runtime_variant_id(b) - .map(|tag| Value::VariantValue { - tag, - payload: Box::new(Value::RecordValue(Vec::new())), - }) - .unwrap_or(Value::LiteralValue(LiteralBits::Bool(b))), - other => other, - } - } - - pub fn eval_port( - dag: &Dag, - port: PortId, - state: &mut EvalStateStack, - strategy: &EvalStrategy, - ) -> Result { - let Some(port_ref) = dag.port_opt(&port) else { - return Err(EvalError::UnboundPort { port }); - }; - if let Some(producer) = port_ref.produced_by { - return eval_node(dag, producer, state, strategy); - } - state - .lookup(port) - .cloned() - .map_err(|_| EvalError::UnboundPort { port }) - } - - pub fn eval_node( - dag: &Dag, - node: NodeId, - state: &mut EvalStateStack, - strategy: &EvalStrategy, - ) -> Result { - match dag.node_opt(&node).ok_or(EvalError::MissingNode { node })? { - Behavior::Value(value) => Ok(eval_value(value)), - Behavior::Transform(t) => eval_transform_node(dag, t, state, strategy), - Behavior::Branch(branch) => eval_branch(dag, branch.clone(), state, strategy), - Behavior::Loop(loop_node) => eval_loop(dag, loop_node.clone(), state, strategy), - Behavior::Bind(bind) => eval_bind(dag, bind.clone(), state, strategy), - } - } - - /// PR-E E4: evaluate a `Branch` node per PR-B.1 §B.1.3 — eager - /// scrutinee evaluation, exact `ResolvedVariant` tag match, - /// payload binding in a fresh frame, body evaluation through - /// `eval_node`. Frame push/pop is balanced on both success and - /// diagnostic paths so the stack invariant survives errors. - pub fn eval_branch( - dag: &Dag, - branch: BranchNode, - state: &mut EvalStateStack, - strategy: &EvalStrategy, - ) -> Result { - let scrutinee = reify_bool_literal_for_branch_scrutinee( - dag, - eval_port(dag, branch.input, state, strategy)?, - ); - let (tag, payload) = match scrutinee { - Value::VariantValue { tag, payload } => (tag, payload), - _ => return Err(EvalError::BranchScrutineeShape { node: branch.id }), - }; - let path = select_branch_path(dag, &branch, tag)?; - state.push_frame(EvalFrame::empty()); - let body_result = - eval_branch_body_in_pushed_frame(dag, branch.id, &path, *payload, state, strategy); - let pop_result = state.pop_frame(); - // The body result is authoritative; only surface a frame - // error if the body otherwise succeeded. - match (body_result, pop_result) { - (Ok(value), Ok(_)) => Ok(value), - (Err(err), _) => Err(err), - (Ok(_), Err(frame_err)) => Err(EvalError::from(frame_err)), - } - } - - fn select_branch_path( - dag: &Dag, - branch: &BranchNode, - tag: DeclarationId, - ) -> Result { - // Pass 1 (Fail-Closed / C-8): reject substrate-invalid branches before arm - // selection — a matching early arm cannot mask an unresolvable later arm. - // - // PB-1 embedded bootstrap often leaves surface variant labels as - // `UnresolvedVariant` before inference materializes `ResolvedVariant` rows. - // Validation + matching consult **existing `Disj` facts** on `dag` (plus Bool / - // list-shaped fast paths), not a parallel sum-name registry. - for path in &branch.paths { - if let BranchPattern::UnresolvedVariant { name, .. } = &path.pattern { - validate_unresolved_branch_pattern_for_eval(dag, branch.id, name, tag)?; - } - } - for path in &branch.paths { - if branch_pattern_matches_scrutinee_tag(dag, &path.pattern, tag)? { - return Ok(path.clone()); - } - } - Err(EvalError::BranchNoMatchingArm { - node: branch.id, - tag, - }) - } - - fn validate_unresolved_branch_pattern_for_eval( - dag: &Dag, - branch_id: NodeId, - name: &str, - scrutinee_tag: DeclarationId, - ) -> Result<(), EvalError> { - let missing = || EvalError::BranchUnresolvedVariant { - node: branch_id, - name: name.to_string(), - }; - // Fail-closed: labels must be declared on the **owning sum** of `scrutinee_tag`, - // not merely on some unrelated `Disj` elsewhere on `dag`. Otherwise a wrong-sum - // `UnresolvedVariant` arm validates globally while an earlier arm matches — - // masking substrate-invalid arms (C-8). - if !scrutinee_sum_declares_variant_label(dag, scrutinee_tag, name) { - return Err(missing()); - } - Ok(()) - } - - fn variant_arm_targets_scrutinee_constructor( - dag: &Dag, - arm_ty: DeclarationId, - scrutinee_tag: DeclarationId, - ) -> bool { - if arm_ty == scrutinee_tag { - return true; - } - let scrutinee_template = match &dag.declaration(scrutinee_tag).connective { - TypeConnective::Instantiation { template, .. } => Some(*template), - _ => None, - }; - scrutinee_template == Some(arm_ty) - } - - fn scrutinee_sum_declares_variant_label( - dag: &Dag, - scrutinee_tag: DeclarationId, - label: &str, - ) -> bool { - for decl in dag.declarations() { - let TypeConnective::Disj { variants } = &decl.connective else { - continue; - }; - let owns_scrutinee = variants - .iter() - .any(|v| variant_arm_targets_scrutinee_constructor(dag, v.ty, scrutinee_tag)); - if !owns_scrutinee { - continue; - } - if variants.iter().any(|v| v.label == label) { - return true; - } - } - false - } - - fn branch_pattern_matches_scrutinee_tag( - dag: &Dag, - pattern: &BranchPattern, - scrutinee_tag: DeclarationId, - ) -> Result { - let list_scrutinee_shape = Value::VariantValue { - tag: scrutinee_tag, - payload: Box::new(Value::RecordValue(Vec::new())), - }; - match pattern { - BranchPattern::ResolvedVariant(decl) => Ok(*decl == scrutinee_tag), - BranchPattern::UnresolvedVariant { name, .. } => match name.as_str() { - "True" => Ok(dag.bool_runtime_variant_id(true) == Some(scrutinee_tag)), - "False" => Ok(dag.bool_runtime_variant_id(false) == Some(scrutinee_tag)), - "Empty" => { - Ok(eval_std_list_is_empty_variant(dag, &list_scrutinee_shape) == Some(true)) - } - "Cons" => { - Ok(eval_std_list_is_empty_variant(dag, &list_scrutinee_shape) == Some(false)) - } - other => Ok(unresolved_variant_label_matches_scrutinee_tag( - dag, - other, - scrutinee_tag, - )), - }, - } - } - - /// PB-1 embed: relate an `UnresolvedVariant` label to the scrutinee constructor id using only - /// [`TypeConnective::Disj`] rows already allocated on [`Dag`]—the same substrate carrier - /// inference will eventually freeze as [`BranchPattern::ResolvedVariant`]. - fn unresolved_variant_label_matches_scrutinee_tag( - dag: &Dag, - pattern_label: &str, - scrutinee_tag: DeclarationId, - ) -> bool { - let constructor_template = match &dag.declaration(scrutinee_tag).connective { - TypeConnective::Instantiation { template, .. } => Some(*template), - _ => None, - }; - for decl in dag.declarations() { - let TypeConnective::Disj { variants } = &decl.connective else { - continue; - }; - for variant in variants { - if variant.label != pattern_label { - continue; - } - if variant.ty == scrutinee_tag { - return true; - } - if constructor_template == Some(variant.ty) { - return true; - } - } - } - false - } - - fn eval_branch_body_in_pushed_frame( - dag: &Dag, - branch_id: NodeId, - path: &Path, - payload: Value, - state: &mut EvalStateStack, - strategy: &EvalStrategy, - ) -> Result { - if let Some(binding) = &path.binding { - state.bind_top(binding.payload_port, payload)?; - } - // `lower.rs` uses `path.body == branch.id` as the - // **producerless-arm sentinel**: the arm's result port has no - // producer node (returns an existing or payload-bound port - // directly), so the lowerer points body back at the Branch - // node itself. Skip body evaluation in that case — recursing - // through `eval_node` would re-enter `eval_branch` on the - // same node and either loop forever or drop the authoritative - // `path.output` fact. The arm's value is read directly from - // `path.output` via `eval_port`. - if path.body != branch_id { - // Otherwise: evaluate the body for its frame-binding side - // effects (E6 Bind, future E3 Transform). Body diagnostic - // propagates through `?`. The body's local return value - // is intentionally discarded — the arm's authoritative - // value is at `path.output`, per - // `BranchPath.output: PortId` in the substrate; an arm - // whose `output` is an existing or payload-bound port - // would drop that fact if the evaluator returned the - // body's local result instead. - let _ = eval_node(dag, path.body, state, strategy)?; - } - eval_port(dag, path.output, state, strategy) - } - - /// PR-E E5: bounded eager loop execution. `LoopBound::Cardinality` - /// evaluates by count. `LoopBound::Descent` is wired through the - /// `descent_execution_proof` proof hook, but the live default hook remains - /// fail-closed with `EvidenceIncomplete` until the substrate producer - /// emits per-path strict evidence. Tests inject that proof hook to exercise - /// the consumer success and residual paths. - pub fn eval_loop( - dag: &Dag, - loop_node: crate::dag::LoopNode, - state: &mut EvalStateStack, - strategy: &EvalStrategy, - ) -> Result { - eval_loop_with_descent_execution_proof( - dag, - loop_node, - state, - strategy, - descent_execution_proof, - ) - } - - fn eval_loop_with_descent_execution_proof( - dag: &Dag, - loop_node: crate::dag::LoopNode, - state: &mut EvalStateStack, - strategy: &EvalStrategy, - proof_fn: impl Fn(&Dag, ClusterId, PortId) -> Result, - ) -> Result { - let mut acc = eval_port(dag, loop_node.init, state, strategy)?; - let count = match &loop_node.bound { - LoopBound::Cardinality { count } => { - decode_loop_cardinality_count(dag, loop_node.id, *count, state, strategy)? - } - LoopBound::Descent { cluster, measure } => { - let proof = proof_fn(dag, *cluster, *measure).map_err(|_| { - EvalError::LoopBoundDescentResidual { - node: loop_node.id, - cluster: *cluster, - measure: *measure, - } - })?; - discharge_descent_obligation(dag, loop_node.id, *cluster, *measure, proof)?; - // Current E2 consumer scope discharges the termination - // obligation and executes one descent step. Body-to-convergence - // semantics belong to the follow-on descent producer/runtime. - 1 - } - }; - for _ in 0..count { - state.push_frame(EvalFrame::empty()); - let body_result = eval_loop_iteration_body(dag, &loop_node, acc, state, strategy); - let pop_result = state.pop_frame(); - match (body_result, pop_result) { - (Ok(next), Ok(_)) => acc = next, - (Err(err), _) => return Err(err), - (Ok(_), Err(frame_err)) => return Err(EvalError::from(frame_err)), - } - } - Ok(acc) - } - - fn discharge_descent_obligation( - dag: &Dag, - node: NodeId, - cluster: ClusterId, - measure: PortId, - proof: DescentExecutionProof, - ) -> Result<(), EvalError> { - if proof.cluster == cluster - && proof.port == measure - && dag.cluster(cluster).intra_cluster_calls.iter().all(|call| { - proof - .per_path - .contains_key(&descent_proof_path_key(call.transform)) - }) - { - Ok(()) - } else { - Err(EvalError::LoopBoundDescentResidual { - node, - cluster, - measure, - }) - } - } - - fn descent_proof_path_key(transform: crate::dag::TransformRef) -> String { - transform.node_id().raw().to_string() - } - - fn eval_loop_iteration_body( - dag: &Dag, - loop_node: &crate::dag::LoopNode, - acc: Value, - state: &mut EvalStateStack, - strategy: &EvalStrategy, - ) -> Result { - state.bind_top(loop_node.source, acc)?; - eval_node(dag, loop_node.body, state, strategy) - } - - fn decode_loop_cardinality_count( - dag: &Dag, - node: NodeId, - count: PortId, - state: &mut EvalStateStack, - strategy: &EvalStrategy, - ) -> Result { - match eval_port(dag, count, state, strategy)? { - Value::LiteralValue(LiteralBits::Int(s)) => { - let n: i128 = s - .parse() - .map_err(|_| EvalError::LoopCardinalityNonInteger { node, count })?; - if n < 0 { - return Err(EvalError::LoopCardinalityNegative { - node, - count, - value: (n.clamp(i64::MIN as i128, i64::MAX as i128) as i64), - }); - } - usize::try_from(n).map_err(|_| EvalError::LoopCardinalityTooLarge { - node, - count, - value: (n.clamp(i64::MIN as i128, i64::MAX as i128) as i64), - }) - } - _ => Err(EvalError::LoopCardinalityNonInteger { node, count }), - } - } - - /// PR-E Bind/callable-entry prerequisite: evaluate the body port in a - /// fresh callable frame populated from the caller-visible parameter - /// bindings. Argument evaluation / callable dispatch stays outside this - /// slice; callers must have already registered `BindNode.params` in an - /// outer frame. - pub fn eval_bind( - dag: &Dag, - bind: crate::dag::BindNode, - state: &mut EvalStateStack, - strategy: &EvalStrategy, - ) -> Result { - if bind.params.is_empty() { - return eval_port(dag, bind.value, state, strategy); - } - let bindings = bind - .params - .iter() - .map(|param| { - state - .lookup(*param) - .cloned() - .map(|value| (*param, value)) - .map_err(EvalError::from) - }) - .collect::, _>>()?; - state.push_frame(EvalFrame::empty()); - let body_result = eval_bind_body_in_pushed_frame(dag, &bind, bindings, state, strategy); - let pop_result = state.pop_frame(); - match (body_result, pop_result) { - (Ok(value), Ok(_)) => Ok(value), - (Err(err), _) => Err(err), - (Ok(_), Err(frame_err)) => Err(EvalError::from(frame_err)), - } - } - - fn eval_bind_body_in_pushed_frame( - dag: &Dag, - bind: &crate::dag::BindNode, - bindings: Vec<(PortId, Value)>, - state: &mut EvalStateStack, - strategy: &EvalStrategy, - ) -> Result { - for (param, value) in bindings { - state.bind_top(param, value)?; - } - eval_port(dag, bind.value, state, strategy) - } - - fn eval_transform_node( - dag: &Dag, - t: &TransformNode, - state: &mut EvalStateStack, - strategy: &EvalStrategy, - ) -> Result { - // Bool `&&` / `||` must short-circuit: eager operand evaluation would run RHS - // transforms (e.g. polymorphic `contains`) even when the LHS already fixes the - // result — PB-1 demo stubs rely on surface precedence (`A || B && C` ≡ `A || (B && C)`). - if let TransformTarget::Operator(OperatorKind::Logical(op)) = &t.target { - if t.inputs.len() != 2 { - return Err(EvalError::TransformArityMismatch { - expected: 2, - got: t.inputs.len(), - }); - } - let lhs_val = eval_port(dag, t.inputs[0], state, strategy)?; - let a = expect_bool_literal(&lhs_val)?; - return match op { - LogicalOp::And => { - if !a { - Ok(Value::LiteralValue(LiteralBits::Bool(false))) - } else { - let rhs_val = eval_port(dag, t.inputs[1], state, strategy)?; - let b = expect_bool_literal(&rhs_val)?; - Ok(Value::LiteralValue(LiteralBits::Bool(b))) - } - } - LogicalOp::Or => { - if a { - Ok(Value::LiteralValue(LiteralBits::Bool(true))) - } else { - let rhs_val = eval_port(dag, t.inputs[1], state, strategy)?; - let b = expect_bool_literal(&rhs_val)?; - Ok(Value::LiteralValue(LiteralBits::Bool(b))) - } - } - }; - } - - let operands = eval_transform_operands(dag, &t.inputs, state, strategy)?; - match &t.target { - TransformTarget::Operator(OperatorKind::Arithmetic(op)) => { - if operands.len() != 2 { - return Err(EvalError::TransformArityMismatch { - expected: 2, - got: operands.len(), - }); - } - let a = expect_int_literal(&operands[0])?; - let b = expect_int_literal(&operands[1])?; - // `Div` is totalized as `Result` on the transform port in inference. - // The host `Value` carrier has no std `Result` projection yet — fail closed here - // instead of routing `/` through the same `i64` success path as `+`/`-`/`*`. - if matches!(op, ArithmeticOp::Div) { - return Err(EvalError::UnsupportedTransformTarget { - kind: "ArithmeticDiv", - }); - } - let n = apply_arithmetic_int_ring_only(*op, a, b)?; - Ok(Value::LiteralValue(LiteralBits::Int(n.to_string()))) - } - TransformTarget::Operator(OperatorKind::Comparison(op)) => { - if operands.len() != 2 { - return Err(EvalError::TransformArityMismatch { - expected: 2, - got: operands.len(), - }); - } - let out = match (&operands[0], &operands[1]) { - ( - Value::LiteralValue(LiteralBits::Int(a)), - Value::LiteralValue(LiteralBits::Int(b)), - ) => { - let ai = - BigInt::from_str(a).map_err(|_| EvalError::BadTransformOperands { - reason: "expected Int literal", - })?; - let bi = - BigInt::from_str(b).map_err(|_| EvalError::BadTransformOperands { - reason: "expected Int literal", - })?; - match op { - ComparisonOp::Eq => ai == bi, - ComparisonOp::Ne => ai != bi, - ComparisonOp::Lt => ai < bi, - ComparisonOp::Le => ai <= bi, - ComparisonOp::Gt => ai > bi, - ComparisonOp::Ge => ai >= bi, - } - } - ( - Value::LiteralValue(LiteralBits::Bool(a)), - Value::LiteralValue(LiteralBits::Bool(b)), - ) => match op { - ComparisonOp::Eq => a == b, - ComparisonOp::Ne => a != b, - ComparisonOp::Lt => a < b, - ComparisonOp::Le => a <= b, - ComparisonOp::Gt => a > b, - ComparisonOp::Ge => a >= b, - }, - ( - Value::LiteralValue(LiteralBits::String(a)), - Value::LiteralValue(LiteralBits::String(b)), - ) - | ( - Value::LiteralValue(LiteralBits::Symbol(a)), - Value::LiteralValue(LiteralBits::Symbol(b)), - ) - | ( - Value::LiteralValue(LiteralBits::String(a)), - Value::LiteralValue(LiteralBits::Symbol(b)), - ) - | ( - Value::LiteralValue(LiteralBits::Symbol(a)), - Value::LiteralValue(LiteralBits::String(b)), - ) => match op { - ComparisonOp::Eq => a == b, - ComparisonOp::Ne => a != b, - _ => { - return Err(EvalError::BadTransformOperands { - reason: "string/symbol comparison beyond Eq/Ne", - }); - } - }, - _ => { - return Err(EvalError::BadTransformOperands { - reason: - "comparison operands must be Int literals, Bool literals, or String literals (Eq/Ne only for String)", - }); - } - }; - Ok(Value::LiteralValue(LiteralBits::Bool(out))) - } - TransformTarget::Operator(OperatorKind::Logical(_)) => { - // `Logical` is handled above (short-circuit). Reaching here is dispatch drift, - // not a proof obligation — fail closed without `unreachable!` (CODING.md). - Err(EvalError::UnsupportedTransformTarget { - kind: "LogicalTransformRouting", - }) - } - TransformTarget::UnresolvedFieldProject { field_label } - | TransformTarget::ResolvedFieldProject { field_label } => { - if operands.len() != 1 { - return Err(EvalError::TransformArityMismatch { - expected: 1, - got: operands.len(), - }); - } - let carrier = &operands[0]; - let Value::RecordValue(fields) = carrier else { - return Err(EvalError::BadTransformOperands { - reason: "FieldProject carrier must be a RecordValue", - }); - }; - let Some(field) = fields.iter().find(|f| &f.label == field_label) else { - return Err(EvalError::BadTransformOperands { - reason: "FieldProject label not present on RecordValue carrier", - }); - }; - Ok(field.value.clone()) - } - TransformTarget::Callable(callee_decl) => { - let callee_decl = *callee_decl; - if let Some(value) = try_dispatch_std_list_is_empty(dag, callee_decl, &operands) { - return Ok(value); - } - if let Some(result) = crate::emit_host_eval::try_dispatch_run_host_process( - dag, - callee_decl, - &operands, - state, - strategy, - ) { - return result; - } - if let Some(result) = - crate::emit_host_eval::try_dispatch_runtime_value_signed_i32_le_as_int( - dag, - callee_decl, - &operands, - state, - strategy, - ) - { - return result; - } - if let Some(result) = crate::emit_host_eval::try_dispatch_emit_host_rust( - dag, - callee_decl, - &operands, - state, - strategy, - ) { - return result; - } - if let Some(result) = crate::emit_host_eval::try_dispatch_emit_host_go( - dag, - callee_decl, - &operands, - state, - strategy, - ) { - return result; - } - if let Some(result) = crate::emit_host_eval::try_dispatch_emit_host( - dag, - callee_decl, - &operands, - state, - strategy, - ) { - return result; - } - let connective = &dag.declaration(callee_decl).connective; - if let TypeConnective::Arrow { body, .. } = connective { - let ArrowBody::UserDefined(bind_id) = body else { - return Err(EvalError::UnsupportedTransformTarget { - kind: "Callable (non-UserDefined body)", - }); - }; - let bind_node_id = bind_id.node_id(); - let Behavior::Bind(bind) = dag.node(bind_node_id) else { - return Err(EvalError::MissingNode { node: bind_node_id }); - }; - let bind = bind.clone(); - if operands.len() != bind.params.len() { - return Err(EvalError::TransformArityMismatch { - expected: bind.params.len(), - got: operands.len(), - }); - } - let bindings: Vec<(PortId, Value)> = - bind.params.iter().copied().zip(operands).collect(); - state.push_frame(EvalFrame::empty()); - let body_result = - eval_callable_body_in_pushed_frame(dag, &bind, bindings, state, strategy); - let pop_result = state.pop_frame(); - return match (body_result, pop_result) { - (Ok(value), Ok(_)) => Ok(value), - (Err(err), _) => Err(err), - (Ok(_), Err(frame_err)) => Err(EvalError::from(frame_err)), - }; - } - - // E6-G0d: non-Arrow `Callable` targets lowered as record/variant constructors. - let variant_tag_template = match &dag.declaration(callee_decl).connective { - TypeConnective::Instantiation { template, .. } => *template, - _ => callee_decl, - }; - if crate::lower::declaration_is_disj_variant_arm(dag, variant_tag_template) { - let Some(fields) = - crate::lower::eval_constructor_variant_payload_fields(dag, callee_decl) - else { - return Err(EvalError::BadTransformOperands { - reason: "variant constructor payload fields could not be resolved", - }); - }; - if operands.len() != fields.len() { - return Err(EvalError::TransformArityMismatch { - expected: fields.len(), - got: operands.len(), - }); - } - // Match `infer::resolve_payload_binding_type`: a single Conj field labeled - // `_0` uses `PayloadBindingResolution::Direct` — the match arm's payload port - // is typed as the inner `T`, not a record shape. Runtime `VariantValue.payload` - // must carry `T` directly so `eval_branch` binding agrees with inference. - let payload: Value = if fields.len() == 1 && fields[0].0 == "_0" { - operands - .into_iter() - .next() - .expect("length checked against fields.len()") - } else { - Value::RecordValue( - fields - .into_iter() - .zip(operands) - .map(|((label, _), value)| NamedField { label, value }) - .collect(), - ) - }; - return Ok(Value::VariantValue { - tag: variant_tag_template, - payload: Box::new(payload), - }); - } - - if let Some(labels) = - crate::lower::constructor_record_field_labels(dag, callee_decl) - { - if operands.len() != labels.len() { - return Err(EvalError::TransformArityMismatch { - expected: labels.len(), - got: operands.len(), - }); - } - let record_fields: Vec = labels - .into_iter() - .zip(operands) - .map(|(label, value)| NamedField { label, value }) - .collect(); - return Ok(Value::RecordValue(record_fields)); - } - - Err(EvalError::BadTransformOperands { - reason: BAD_TRANSFORM_CALLABLE_TARGET_NOT_ARROW_REASON, - }) - } - } - } - - fn eval_transform_operands( - dag: &Dag, - inputs: &[PortId], - state: &mut EvalStateStack, - strategy: &EvalStrategy, - ) -> Result, EvalError> { - let mut evaluated = Vec::with_capacity(inputs.len()); - match strategy { - EvalStrategy::ApplicativeOrder { - input_order: InputEvaluationOrder::LeftFirst, - } => { - for (index, port) in inputs.iter().enumerate() { - evaluated.push((index, eval_port(dag, *port, state, strategy)?)); - } - } - EvalStrategy::ApplicativeOrder { - input_order: InputEvaluationOrder::RightFirst, - } => { - for (index, port) in inputs.iter().enumerate().rev() { - evaluated.push((index, eval_port(dag, *port, state, strategy)?)); - } - evaluated.sort_by_key(|(index, _)| *index); - } - } - Ok(evaluated.into_iter().map(|(_, value)| value).collect()) - } - - fn eval_callable_body_in_pushed_frame( - dag: &Dag, - bind: &crate::dag::BindNode, - bindings: Vec<(PortId, Value)>, - state: &mut EvalStateStack, - strategy: &EvalStrategy, - ) -> Result { - for (param, value) in bindings { - state.bind_top(param, value)?; - } - eval_port(dag, bind.value, state, strategy) - } - - fn expect_int_literal(value: &Value) -> Result { - match value { - Value::LiteralValue(LiteralBits::Int(s)) => { - s.parse::() - .map_err(|_| EvalError::BadTransformOperands { - reason: "expected Int literal in i64 range", - }) - } - _ => Err(EvalError::BadTransformOperands { - reason: "expected Int literal", - }), - } - } - - fn expect_bool_literal(value: &Value) -> Result { - match value { - Value::LiteralValue(LiteralBits::Bool(b)) => Ok(*b), - _ => Err(EvalError::BadTransformOperands { - reason: "expected Bool literal", - }), - } - } - - /// PB-1 scaffold: `std.list.is_empty` lowers as `Callable(non-UserDefined)` for generic - /// instances; recognize list-shaped `VariantValue` scrutinees without executing the missing - /// body. Dissolution: UserDefined lowering for list helpers on the PB-1 bootstrap path. - fn try_dispatch_std_list_is_empty( - dag: &Dag, - callee_decl: DeclarationId, - operands: &[Value], - ) -> Option { - if operands.len() != 1 { - return None; - } - let callee = dag.declaration(callee_decl); - if callee.name.as_deref() != Some("is_empty") { - return None; - } - if !callee.span.file.ends_with("list.dag") { - return None; - } - let TypeConnective::Arrow { output, body, .. } = &callee.connective else { - return None; - }; - if matches!(body, ArrowBody::UserDefined(_)) { - return None; - } - if !type_peels_to_bool(dag, *output) { - return None; - } - let bit = eval_std_list_is_empty_variant(dag, &operands[0])?; - Some(Value::LiteralValue(LiteralBits::Bool(bit))) - } - - fn type_peels_to_bool(dag: &Dag, mut ty: DeclarationId) -> bool { - let Some(bool_shape) = dag.bool_shape() else { - return false; - }; - let bool_decl = bool_shape.declaration; - for _ in 0..64 { - if ty == bool_decl { - return true; - } - let decl = dag.declaration(ty); - match &decl.connective { - TypeConnective::Instantiation { - template, - arguments, - } if arguments.is_empty() => { - ty = *template; - } - _ => return false, - } - } - false - } - - fn eval_std_list_is_empty_variant(dag: &Dag, list_value: &Value) -> Option { - let Value::VariantValue { tag, .. } = list_value else { - return None; - }; - let list_decl = dag.declaration_by_name("List")?; - let TypeConnective::Disj { variants } = &list_decl.connective else { - return None; - }; - let empty_arm_ty = variants.iter().find(|v| v.label == "Empty")?.ty; - let cons_arm_ty = variants.iter().find(|v| v.label == "Cons")?.ty; - let tag_decl = dag.declaration(*tag); - if let TypeConnective::Instantiation { template, .. } = &tag_decl.connective { - if *template == empty_arm_ty { - return Some(true); - } - if *template == cons_arm_ty { - return Some(false); - } - return None; - } - match tag_decl.name.as_deref()? { - "Empty" => Some(true), - "Cons" => Some(false), - _ => None, - } - } - - /// Checked `Int` ring ops only (`Add` / `Sub` / `Mul`). `Div` is rejected - /// at the [`eval_transform_node`] call site so this helper never collapses - /// division through the same `i64` carrier as ring success values. - fn apply_arithmetic_int_ring_only(op: ArithmeticOp, a: i64, b: i64) -> Result { - const OVERFLOW: EvalError = EvalError::BadTransformOperands { - reason: "integer overflow", - }; - match op { - ArithmeticOp::Add => a.checked_add(b).ok_or(OVERFLOW), - ArithmeticOp::Sub => a.checked_sub(b).ok_or(OVERFLOW), - ArithmeticOp::Mul => a.checked_mul(b).ok_or(OVERFLOW), - ArithmeticOp::Div => Err(EvalError::UnsupportedTransformTarget { - kind: "ArithmeticDiv", - }), - } - } - - /// Evaluate a substrate `fn` declaration by `DeclarationId` (Arrow + UserDefined body). - pub fn eval_callable_declaration( - dag: &Dag, - callee_decl: DeclarationId, - operands: Vec, - state: &mut EvalStateStack, - strategy: &EvalStrategy, - ) -> Result { - let connective = &dag.declaration(callee_decl).connective; - let TypeConnective::Arrow { body, .. } = connective else { - return Err(EvalError::UnsupportedTransformTarget { - kind: "Callable (non-Arrow body)", - }); - }; - let ArrowBody::UserDefined(bind_id) = body else { - return Err(EvalError::UnsupportedTransformTarget { - kind: "Callable (non-UserDefined body)", - }); - }; - let bind_node_id = bind_id.node_id(); - let Behavior::Bind(bind) = dag.node(bind_node_id) else { - return Err(EvalError::MissingNode { node: bind_node_id }); - }; - let bind = bind.clone(); - if operands.len() != bind.params.len() { - return Err(EvalError::TransformArityMismatch { - expected: bind.params.len(), - got: operands.len(), - }); - } - let bindings: Vec<(PortId, Value)> = bind.params.iter().copied().zip(operands).collect(); - state.push_frame(EvalFrame::empty()); - let body_result = eval_callable_body_in_pushed_frame(dag, &bind, bindings, state, strategy); - let pop_result = state.pop_frame(); - match (body_result, pop_result) { - (Ok(value), Ok(_)) => Ok(value), - (Err(err), _) => Err(err), - (Ok(_), Err(frame_err)) => Err(EvalError::from(frame_err)), - } - } - - pub fn evaluate_body( - dag: &Dag, - entry: NodeId, - state: &mut EvalStateStack, - strategy: EvalStrategy, - ) -> Result { - eval_node(dag, entry, state, &strategy) - } - - /// **Dissolution receipt: TERMINAL.** The three variants are distinct - /// fail-closed outcomes for the E2 frame boundary. - #[derive(Debug, Clone, PartialEq, Eq)] - pub enum EvalFrameError { - EmptyStateStack, - DuplicateBinding { port: PortId }, - UnboundPort { port: PortId }, - } - - /// One evaluator binding scope. - /// - /// `HashMap` is the Rust realization of the substrate - /// `Map` finite partial-function discipline. Do not replace - /// this with a duplicate-admitting `List` shape. - #[derive(Debug, Clone, PartialEq, Eq)] - pub struct EvalFrame { - bindings: HashMap, - } - - impl EvalFrame { - pub fn empty() -> Self { - Self { - bindings: HashMap::new(), - } - } - - pub fn from_bindings( - bindings: impl IntoIterator, - ) -> Result { - let mut frame = Self::empty(); - for (port, value) in bindings { - frame.bind(port, value)?; - } - Ok(frame) - } - - pub fn bind(&mut self, port: PortId, value: V) -> Result<(), EvalFrameError> { - if self.bindings.contains_key(&port) { - return Err(EvalFrameError::DuplicateBinding { port }); - } - self.bindings.insert(port, value); - Ok(()) - } - - pub fn lookup_local(&self, port: PortId) -> Option<&V> { - self.bindings.get(&port) - } - } - - /// Evaluator frame stack. The final element is the innermost / top frame. - #[derive(Debug, Clone, PartialEq, Eq)] - pub struct EvalStateStack { - frames: Vec>, - } - - impl EvalStateStack { - pub fn with_root_frame(frame: EvalFrame) -> Self { - Self { - frames: vec![frame], - } - } - - pub fn from_outer_to_inner(frames: Vec>) -> Self { - Self { frames } - } - - pub fn push_frame(&mut self, frame: EvalFrame) { - self.frames.push(frame); - } - - pub fn pop_frame(&mut self) -> Result, EvalFrameError> { - self.frames.pop().ok_or(EvalFrameError::EmptyStateStack) - } - - pub fn lookup(&self, port: PortId) -> Result<&V, EvalFrameError> { - self.frames - .iter() - .rev() - .find_map(|frame| frame.lookup_local(port)) - .ok_or(EvalFrameError::UnboundPort { port }) - } - - pub fn bind_top(&mut self, port: PortId, value: V) -> Result<(), EvalFrameError> { - self.frames - .last_mut() - .ok_or(EvalFrameError::EmptyStateStack)? - .bind(port, value) - } - - pub fn frames_outer_to_inner(&self) -> &[EvalFrame] { - &self.frames - } - } - - #[cfg(test)] - mod tests { - use std::collections::HashMap; - - use super::NamedField; - use super::{ - descent_proof_path_key, eval_loop_with_descent_execution_proof, eval_node, eval_port, - eval_value, evaluate_body, DescentExecutionProof, DescentResidual, EvalError, - EvalFrame, EvalFrameError, EvalStateStack, EvalStrategy, InputEvaluationOrder, - NonStrictEvidence, StrictEvidence, Value, - BAD_TRANSFORM_CALLABLE_TARGET_NOT_ARROW_REASON, - }; - use crate::compile_to_dag; - use crate::dag::{ - literal_bits_int, ArithmeticOp, ArrowBody, Behavior, BranchPattern, Cluster, - ComparisonOp, Dag, DeclarationId, IntraClusterCall, LiteralBits, LogicalOp, LoopBound, - MemberDescent, NodeId, NonEmptyList, NonSingletonList, OperatorKind, Path, - PayloadBinding, PortId, TransformTarget, TypeConnective, - }; - use crate::diagnostics::SourceSpan; - - fn span() -> SourceSpan { - SourceSpan::new("evaluator_frame.unit", 0, 1) - } - - fn ports(count: usize) -> Vec { - let mut dag = Dag::new(); - (0..count) - .map(|i| dag.push_value(literal_bits_int(i as i64), span())) - .collect() - } - - fn node_for_port(dag: &Dag, port: PortId) -> NodeId { - dag.resolve_producer_opt(&port).expect("producer").id() - } - - fn descent_loop_fixture(body_value: i64) -> (Dag, crate::dag::LoopNode) { - let mut dag = Dag::new(); - let source = dag.alloc_port(None); - let init = dag.push_value(literal_bits_int(0), span()); - let body_output = dag.push_value(literal_bits_int(body_value), span()); - let body = node_for_port(&dag, body_output); - let bind = dag.push_bind("descent_member", init, vec![source, init], span()); - let param0 = dag.param_of(bind, 0).expect("param 0"); - let param1 = dag.param_of(bind, 1).expect("param 1"); - let transform_output = dag.push_transform( - TransformTarget::Operator(OperatorKind::Arithmetic(ArithmeticOp::Sub)), - vec![source, init], - span(), - ); - let transform = dag - .as_transform_ref(node_for_port(&dag, transform_output)) - .expect("transform ref"); - let cluster = dag.push_cluster(Cluster { - members: NonSingletonList::from_vec(vec![ - MemberDescent { param: param0 }, - MemberDescent { param: param1 }, - ]) - .expect("non-singleton"), - intra_cluster_calls: NonEmptyList::from_vec(vec![IntraClusterCall { transform }]) - .expect("non-empty"), - }); - let output = dag.push_loop( - source, - init, - body, - LoopBound::Descent { - cluster, - measure: source, - }, - span(), - ); - let entry = node_for_port(&dag, output); - let loop_node = dag.node(entry).as_loop().expect("loop node").clone(); - (dag, loop_node) - } - - fn empty_state() -> EvalStateStack { - EvalStateStack::with_root_frame(EvalFrame::empty()) - } - - fn eager_strategy() -> EvalStrategy { - EvalStrategy::ApplicativeOrder { - input_order: InputEvaluationOrder::LeftFirst, - } - } - - fn eager_right_first_strategy() -> EvalStrategy { - EvalStrategy::ApplicativeOrder { - input_order: InputEvaluationOrder::RightFirst, - } - } - - fn bind_node_id_for_fn(dag: &Dag, fn_name: &str) -> NodeId { - let decl = dag - .declaration_by_name(fn_name) - .unwrap_or_else(|| panic!("missing fn `{fn_name}`")); - let TypeConnective::Arrow { body, .. } = &decl.connective else { - panic!("`{fn_name}` must be Arrow"); - }; - let ArrowBody::UserDefined(bind_id) = body else { - panic!("`{fn_name}` must be UserDefined"); - }; - bind_id.node_id() - } - - fn first_resolved_variant_tag_in_bind_body(dag: &Dag, fn_name: &str) -> DeclarationId { - let entry = bind_node_id_for_fn(dag, fn_name); - let Behavior::Bind(bind) = dag.node(entry) else { - panic!("expected Bind"); - }; - let mut stack = vec![bind.value]; - while let Some(port) = stack.pop() { - let Some(producer) = dag.port(port).produced_by else { - continue; - }; - match dag.node(producer) { - Behavior::Branch(branch) => { - for path in &branch.paths { - if let BranchPattern::ResolvedVariant(decl) = &path.pattern { - return *decl; - } - } - } - Behavior::Bind(inner) => stack.push(inner.value), - _ => {} - } - } - panic!("no ResolvedVariant pattern in `{fn_name}` body"); - } - - fn template_decl_id_for_callable_constructor_in_fn( - dag: &Dag, - fn_name: &str, - ) -> DeclarationId { - let entry = bind_node_id_for_fn(dag, fn_name); - let Behavior::Bind(bind) = dag.node(entry) else { - panic!("expected Bind"); - }; - let mut stack = vec![bind.value]; - while let Some(port) = stack.pop() { - let Some(producer) = dag.port(port).produced_by else { - continue; - }; - match dag.node(producer) { - Behavior::Transform(t) => { - if let TransformTarget::Callable(callee) = t.target { - return match &dag.declaration(callee).connective { - TypeConnective::Instantiation { template, .. } => *template, - _ => callee, - }; - } - } - Behavior::Bind(inner) => stack.push(inner.value), - _ => {} - } - } - panic!("no TransformTarget::Callable in `{fn_name}` body"); - } - - #[test] - fn e6_g0d_variant_constructor_executes_to_variant_value() { - let src = "type MaybeInt = Some { value: Int } | None\n\ - fn pack(x: Int) -> MaybeInt = Some { value: x }\n"; - let dag = compile_to_dag(src, "e6_g0d_variant.v3").expect("compile"); - let expected_tag = template_decl_id_for_callable_constructor_in_fn(&dag, "pack"); - let entry = bind_node_id_for_fn(&dag, "pack"); - let Behavior::Bind(bind) = dag.node(entry) else { - panic!("bind"); - }; - let x_port = bind.params[0]; - let frame = - EvalFrame::from_bindings([(x_port, Value::LiteralValue(literal_bits_int(42)))]) - .expect("frame"); - let mut state = EvalStateStack::with_root_frame(frame); - let value = evaluate_body(&dag, entry, &mut state, eager_strategy()).expect("eval"); - let Value::VariantValue { tag, payload } = value else { - panic!("expected VariantValue, got {value:?}"); - }; - assert_eq!(tag, expected_tag); - let Value::RecordValue(fields) = *payload else { - panic!("expected record payload"); - }; - assert_eq!(fields.len(), 1); - assert_eq!(fields[0].label, "value"); - assert_eq!(fields[0].value, Value::LiteralValue(literal_bits_int(42))); - } - - #[test] - fn e6_g0d_record_constructor_preserves_declaration_field_order() { - let src = "type R { a: Int, b: Int }\n\ - fn mk() -> R = { b: 7, a: 5 }\n"; - let dag = compile_to_dag(src, "e6_g0d_record.v3").expect("compile"); - let entry = bind_node_id_for_fn(&dag, "mk"); - let mut state = empty_state(); - let value = evaluate_body(&dag, entry, &mut state, eager_strategy()).expect("eval"); - let Value::RecordValue(fields) = value else { - panic!("expected RecordValue, got {value:?}"); - }; - assert_eq!( - fields, - vec![ - NamedField { - label: "a".to_string(), - value: Value::LiteralValue(literal_bits_int(5)), - }, - NamedField { - label: "b".to_string(), - value: Value::LiteralValue(literal_bits_int(7)), - }, - ] - ); - } - - #[test] - fn e6_g0d_generic_variant_constructor_tag_matches_resolved_variant_pattern() { - let src = "type Maybe = Some(T) | None\n\ - fn pack_int(x: Int) -> Maybe = Some(x)\n\ - fn probe(x: Int) -> Int = match pack_int(x) { Some(p) => p, None => 0 }\n"; - let dag = compile_to_dag(src, "e6_g0d_gen_variant.v3").expect("compile"); - let expected_tag = first_resolved_variant_tag_in_bind_body(&dag, "probe"); - let entry = bind_node_id_for_fn(&dag, "pack_int"); - let Behavior::Bind(bind) = dag.node(entry) else { - panic!("bind"); - }; - let x_port = bind.params[0]; - let frame = - EvalFrame::from_bindings([(x_port, Value::LiteralValue(literal_bits_int(99)))]) - .expect("frame"); - let mut state = EvalStateStack::with_root_frame(frame); - let value = evaluate_body(&dag, entry, &mut state, eager_strategy()).expect("eval"); - let Value::VariantValue { tag, payload } = value else { - panic!("expected VariantValue"); - }; - assert_eq!( - tag, expected_tag, - "tag must be template variant id (matches BranchPattern::ResolvedVariant), not an anonymous Instantiation id" - ); - assert_eq!( - *payload, - Value::LiteralValue(literal_bits_int(99)), - "positional `Some(T)` payload must be Direct-shaped (infer `PayloadBindingResolution::Direct`), not RecordValue(_0)" - ); - } - - #[test] - fn e6_g0d_positional_variant_payload_round_trips_through_direct_binding_arm() { - let src = "type Boxed = Box(T) | Empty\n\ - fn mk(x: Int) -> Boxed = Box(x)\n\ - fn bump(x: Int) -> Int = match mk(x) { Box(p) => p + 1, Empty => 0 }\n"; - let dag = compile_to_dag(src, "e6_g0d_positional_direct.v3").expect("compile"); - let entry = bind_node_id_for_fn(&dag, "bump"); - let Behavior::Bind(bind) = dag.node(entry) else { - panic!("bind"); - }; - let x_port = bind.params[0]; - let frame = - EvalFrame::from_bindings([(x_port, Value::LiteralValue(literal_bits_int(5)))]) - .expect("frame"); - let mut state = EvalStateStack::with_root_frame(frame); - let value = evaluate_body(&dag, entry, &mut state, eager_strategy()).expect("eval"); - assert_eq!(value, Value::LiteralValue(literal_bits_int(6))); - } - - #[test] - fn e6_g0d_generic_record_constructor_preserves_template_field_order() { - let src = "type PairAB { first: A, second: B }\n\ - fn mk() -> PairAB = { second: true, first: 3 }\n"; - let dag = compile_to_dag(src, "e6_g0d_gen_record.v3").expect("compile"); - let entry = bind_node_id_for_fn(&dag, "mk"); - let mut state = empty_state(); - let value = evaluate_body(&dag, entry, &mut state, eager_strategy()).expect("eval"); - let Value::RecordValue(fields) = value else { - panic!("expected RecordValue"); - }; - assert_eq!( - fields, - vec![ - NamedField { - label: "first".to_string(), - value: Value::LiteralValue(literal_bits_int(3)), - }, - NamedField { - label: "second".to_string(), - value: Value::LiteralValue(LiteralBits::Bool(true)), - }, - ] - ); - } - - #[test] - fn e6_g0d_nullary_variant_constructor_empty_record_payload() { - let src = "type U = Z | S { n: Int }\n\ - fn zed() -> U = Z\n"; - let dag = compile_to_dag(src, "e6_g0d_nullary.v3").expect("compile"); - let expected_tag = template_decl_id_for_callable_constructor_in_fn(&dag, "zed"); - let entry = bind_node_id_for_fn(&dag, "zed"); - let mut state = empty_state(); - let value = evaluate_body(&dag, entry, &mut state, eager_strategy()).expect("eval"); - let Value::VariantValue { tag, payload } = value else { - panic!("expected VariantValue"); - }; - assert_eq!(tag, expected_tag); - let Value::RecordValue(fields) = *payload else { - panic!("expected record payload"); - }; - assert!(fields.is_empty()); - } - - #[test] - fn e6_g0d_variant_constructor_round_trips_through_branch_match() { - let src = "type MaybeInt = Some { value: Int } | None\n\ - fn pack(x: Int) -> MaybeInt = Some { value: x }\n\ - fn unpack(x: Int) -> Int = match pack(x) { Some { value: v } => v, None => 0 }\n"; - let dag = compile_to_dag(src, "e6_g0d_roundtrip.v3").expect("compile"); - let entry = bind_node_id_for_fn(&dag, "unpack"); - let Behavior::Bind(bind) = dag.node(entry) else { - panic!("bind"); - }; - let x_port = bind.params[0]; - let frame = - EvalFrame::from_bindings([(x_port, Value::LiteralValue(literal_bits_int(11)))]) - .expect("frame"); - let mut state = EvalStateStack::with_root_frame(frame); - let value = evaluate_body(&dag, entry, &mut state, eager_strategy()).expect("eval"); - assert_eq!(value, Value::LiteralValue(literal_bits_int(11))); - } - - #[test] - fn eval_value_constructs_literal_runtime_value() { - let mut dag = Dag::new(); - let output = dag.push_value(LiteralBits::String("ready".to_string()), span()); - let value_node = dag - .resolve_producer_opt(&output) - .and_then(Behavior::as_value) - .expect("value producer"); - - let value = eval_value(value_node); - - assert_eq!( - value, - Value::LiteralValue(LiteralBits::String("ready".to_string())) - ); - } - - #[test] - fn eval_node_dispatches_value_behavior_to_literal_runtime_value() { - let mut dag = Dag::new(); - let output = dag.push_value(LiteralBits::String("ready".to_string()), span()); - let entry = node_for_port(&dag, output); - let mut state = empty_state(); - let strategy = eager_strategy(); - - let value = eval_node(&dag, entry, &mut state, &strategy).expect("value evaluates"); - - assert_eq!( - value, - Value::LiteralValue(LiteralBits::String("ready".to_string())) - ); - } - - #[test] - fn eval_port_prefers_dag_producer_over_frame_binding() { - let mut dag = Dag::new(); - let port = dag.push_value(literal_bits_int(1), span()); - let frame = EvalFrame::from_bindings([( - port, - Value::LiteralValue(LiteralBits::String("shadow".to_string())), - )]) - .expect("frame"); - let mut state = EvalStateStack::with_root_frame(frame); - let strategy = eager_strategy(); - - let value = eval_port(&dag, port, &mut state, &strategy).expect("producer wins"); - - assert_eq!(value, Value::LiteralValue(literal_bits_int(1))); - } - - #[test] - fn eval_port_uses_innermost_frame_binding_for_producerless_port() { - let mut dag = Dag::std_fixture_bootstrap_snapshot(); - let port = dag.alloc_port_with_shape(dag.bool_shape().expect("Bool shape")); - let outer = EvalFrame::from_bindings([( - port, - Value::LiteralValue(LiteralBits::String("outer".to_string())), - )]) - .expect("outer frame"); - let inner = EvalFrame::from_bindings([( - port, - Value::LiteralValue(LiteralBits::String("inner".to_string())), - )]) - .expect("inner frame"); - let mut state = EvalStateStack::from_outer_to_inner(vec![outer, inner]); - let strategy = eager_strategy(); - - let value = eval_port(&dag, port, &mut state, &strategy).expect("bound port"); - - assert_eq!( - value, - Value::LiteralValue(LiteralBits::String("inner".to_string())) - ); - } - - #[test] - fn eval_port_falls_back_to_producer_value() { - let mut dag = Dag::new(); - let port = dag.push_value(LiteralBits::Bool(true), span()); - let mut state = empty_state(); - let strategy = eager_strategy(); - - let value = eval_port(&dag, port, &mut state, &strategy).expect("producer value"); - - assert_eq!(value, Value::LiteralValue(LiteralBits::Bool(true))); - } - - #[test] - fn eval_port_reports_unbound_port_when_no_frame_or_producer_resolves() { - let mut source = Dag::new(); - let stale_port = source.push_value(literal_bits_int(1), span()); - let empty = Dag::new(); - let mut state = empty_state(); - let strategy = eager_strategy(); - - let err = - eval_port(&empty, stale_port, &mut state, &strategy).expect_err("unbound port"); - - assert_eq!(err, EvalError::UnboundPort { port: stale_port }); - } - - #[test] - fn eval_port_rejects_frame_binding_for_port_absent_from_dag() { - let mut source = Dag::new(); - let stale_port = source.push_value(literal_bits_int(1), span()); - let empty = Dag::new(); - let frame = EvalFrame::from_bindings([( - stale_port, - Value::LiteralValue(LiteralBits::String("stale".to_string())), - )]) - .expect("frame"); - let mut state = EvalStateStack::with_root_frame(frame); - let strategy = eager_strategy(); - - let err = - eval_port(&empty, stale_port, &mut state, &strategy).expect_err("unbound port"); - - assert_eq!(err, EvalError::UnboundPort { port: stale_port }); - } - - #[test] - fn evaluate_body_delegates_to_eval_node_shell() { - let mut dag = Dag::new(); - let output = dag.push_value(literal_bits_int(8), span()); - let entry = node_for_port(&dag, output); - let mut state = empty_state(); - - let value = - evaluate_body(&dag, entry, &mut state, eager_strategy()).expect("value evaluates"); - - assert_eq!(value, Value::LiteralValue(literal_bits_int(8))); - } - - #[test] - fn missing_entry_node_fails_closed() { - let mut source = Dag::new(); - let output = source.push_value(literal_bits_int(1), span()); - let stale_entry = node_for_port(&source, output); - let empty = Dag::new(); - let mut state = empty_state(); - - let err = evaluate_body(&empty, stale_entry, &mut state, eager_strategy()) - .expect_err("missing node"); - - assert_eq!(err, EvalError::MissingNode { node: stale_entry }); - } - - #[test] - fn transform_arithmetic_add_evaluates() { - let mut dag = Dag::new(); - let lhs = dag.push_value(literal_bits_int(1), span()); - let rhs = dag.push_value(literal_bits_int(2), span()); - let output = dag.push_transform( - TransformTarget::Operator(OperatorKind::Arithmetic(ArithmeticOp::Add)), - vec![lhs, rhs], - span(), - ); - let entry = node_for_port(&dag, output); - let mut state = empty_state(); - let strategy = eager_strategy(); - - let value = eval_node(&dag, entry, &mut state, &strategy).expect("transform evaluates"); - - assert_eq!(value, Value::LiteralValue(literal_bits_int(3))); - } - - #[test] - fn transform_arithmetic_sub_evaluates() { - let mut dag = Dag::new(); - let lhs = dag.push_value(literal_bits_int(10), span()); - let rhs = dag.push_value(literal_bits_int(3), span()); - let output = dag.push_transform( - TransformTarget::Operator(OperatorKind::Arithmetic(ArithmeticOp::Sub)), - vec![lhs, rhs], - span(), - ); - let entry = node_for_port(&dag, output); - let mut state = empty_state(); - - let value = eval_node(&dag, entry, &mut state, &eager_strategy()).expect("sub"); - - assert_eq!(value, Value::LiteralValue(literal_bits_int(7))); - } - - #[test] - fn transform_right_first_evaluates_inputs_without_reordering_operands() { - let mut dag = Dag::new(); - let lhs = dag.push_value(literal_bits_int(10), span()); - let rhs = dag.push_value(literal_bits_int(3), span()); - let output = dag.push_transform( - TransformTarget::Operator(OperatorKind::Arithmetic(ArithmeticOp::Sub)), - vec![lhs, rhs], - span(), - ); - let entry = node_for_port(&dag, output); - let mut state = empty_state(); - let strategy = eager_right_first_strategy(); - - let value = eval_node(&dag, entry, &mut state, &strategy).expect("right-first sub"); - - assert_eq!(value, Value::LiteralValue(literal_bits_int(7))); - } - - #[test] - fn transform_right_first_reports_rightmost_input_error_first() { - let mut dag = Dag::new(); - let lhs = dag.alloc_port(None); - let rhs = dag.alloc_port(None); - let output = dag.push_transform( - TransformTarget::Operator(OperatorKind::Arithmetic(ArithmeticOp::Add)), - vec![lhs, rhs], - span(), - ); - let entry = node_for_port(&dag, output); - - let mut left_first_state = empty_state(); - let left_first_err = eval_node(&dag, entry, &mut left_first_state, &eager_strategy()) - .expect_err("left-first should read lhs first"); - assert_eq!(left_first_err, EvalError::UnboundPort { port: lhs }); - - let mut right_first_state = empty_state(); - let right_first_err = eval_node( - &dag, - entry, - &mut right_first_state, - &eager_right_first_strategy(), - ) - .expect_err("right-first should read rhs first"); - assert_eq!(right_first_err, EvalError::UnboundPort { port: rhs }); - } - - #[test] - fn transform_arithmetic_checked_overflow_fails_closed() { - let mut dag = Dag::new(); - let lhs = dag.push_value(literal_bits_int(i64::MAX), span()); - let rhs = dag.push_value(literal_bits_int(1), span()); - let output = dag.push_transform( - TransformTarget::Operator(OperatorKind::Arithmetic(ArithmeticOp::Add)), - vec![lhs, rhs], - span(), - ); - let entry = node_for_port(&dag, output); - let mut state = empty_state(); - - let err = eval_node(&dag, entry, &mut state, &eager_strategy()).expect_err("overflow"); - - assert_eq!( - err, - EvalError::BadTransformOperands { - reason: "integer overflow", - } - ); - } - - // PR-E E4: branch helpers — bridge a tag declaration name into the - // bootstrap fixture so `Value::VariantValue { tag, .. }` carries an - // honest `DeclarationId`, not a hand-rolled stub. The branch - // evaluator only does `decl == tag` equality, so any two distinct - // real declarations (`Bool` / `Int`) are sufficient as tag stand-ins - // without introducing variant-discovery infrastructure that doesn't - // belong in this slice. - fn declaration_id_by_name(dag: &Dag, name: &str) -> DeclarationId { - dag.declaration_by_name(name) - .unwrap_or_else(|| panic!("declaration `{name}` missing from fixture")) - .id - } - - fn variant(tag: DeclarationId, payload: Value) -> Value { - Value::VariantValue { - tag, - payload: Box::new(payload), - } - } - - // E4 §B.1.3: caller-supplied `VariantValue` scrutinee at the - // branch input port matches the path whose `ResolvedVariant.tag` - // equals the runtime tag; the body's value is returned. - #[test] - fn eval_branch_selects_resolved_variant_by_tag() { - let mut dag = Dag::std_fixture_bootstrap_snapshot(); - let some_tag = declaration_id_by_name(&dag, "Bool"); - let other_tag = declaration_id_by_name(&dag, "Int"); - let scrutinee = dag.alloc_port_with_shape(dag.bool_shape().expect("Bool shape")); - // Bodies are `Behavior::Value` nodes (E1-supported); Bind / - // Transform bodies wait on E3 / E6. - let some_arm_output = dag.push_value(literal_bits_int(7), span()); - let some_arm_body = node_for_port(&dag, some_arm_output); - let other_arm_output = dag.push_value(literal_bits_int(13), span()); - let other_arm_body = node_for_port(&dag, other_arm_output); - let output = dag.push_branch( - scrutinee, - vec![ - Path { - body: some_arm_body, - output: some_arm_output, - pattern: BranchPattern::ResolvedVariant(some_tag), - binding: None, - }, - Path { - body: other_arm_body, - output: other_arm_output, - pattern: BranchPattern::ResolvedVariant(other_tag), - binding: None, - }, - ], - span(), - ); - let entry = node_for_port(&dag, output); - let frame = EvalFrame::from_bindings([( - scrutinee, - variant(some_tag, Value::LiteralValue(LiteralBits::Bool(true))), - )]) - .expect("frame"); - let mut state = EvalStateStack::with_root_frame(frame); - let strategy = eager_strategy(); - - let value = eval_node(&dag, entry, &mut state, &strategy).expect("branch evaluates"); - - assert_eq!(value, Value::LiteralValue(literal_bits_int(7))); - } - - // E4 Bool alignment: Bool literal scrutinees are reified through - // `Dag::bool_runtime_variant_id`, so branch dispatch compares the same - // `True` / `False` declaration ids that inference resolved on patterns. - #[test] - fn eval_branch_reifies_bool_literal_scrutinee_to_disj_variant_id() { - let mut dag = Dag::std_fixture_bootstrap_snapshot(); - let true_tag = dag - .bool_runtime_variant_id(true) - .expect("Bool.True variant id"); - let false_tag = dag - .bool_runtime_variant_id(false) - .expect("Bool.False variant id"); - let scrutinee = dag.alloc_port_with_shape(dag.bool_shape().expect("Bool shape")); - let true_output = dag.push_value(literal_bits_int(1), span()); - let true_body = node_for_port(&dag, true_output); - let false_output = dag.push_value(literal_bits_int(0), span()); - let false_body = node_for_port(&dag, false_output); - let output = dag.push_branch( - scrutinee, - vec![ - Path { - body: true_body, - output: true_output, - pattern: BranchPattern::ResolvedVariant(true_tag), - binding: None, - }, - Path { - body: false_body, - output: false_output, - pattern: BranchPattern::ResolvedVariant(false_tag), - binding: None, - }, - ], - span(), - ); - let entry = node_for_port(&dag, output); - let frame = EvalFrame::from_bindings([( - scrutinee, - Value::LiteralValue(LiteralBits::Bool(true)), - )]) - .expect("frame"); - let mut state = EvalStateStack::with_root_frame(frame); - let strategy = eager_strategy(); - - let value = eval_node(&dag, entry, &mut state, &strategy).expect("branch evaluates"); - - assert_eq!(value, Value::LiteralValue(literal_bits_int(1))); - assert_eq!(state.frames_outer_to_inner().len(), 1); - } - - #[test] - fn eval_branch_reifies_true_bool_literal_scrutinee_to_true_arm() { - let mut dag = Dag::std_fixture_bootstrap_snapshot(); - let true_tag = dag - .bool_runtime_variant_id(true) - .expect("Bool.True variant id"); - let false_tag = dag - .bool_runtime_variant_id(false) - .expect("Bool.False variant id"); - let scrutinee = dag.alloc_port_with_shape(dag.bool_shape().expect("Bool shape")); - let true_output = dag.push_value(literal_bits_int(11), span()); - let true_body = node_for_port(&dag, true_output); - let false_output = dag.push_value(literal_bits_int(22), span()); - let false_body = node_for_port(&dag, false_output); - let output = dag.push_branch( - scrutinee, - vec![ - Path { - body: true_body, - output: true_output, - pattern: BranchPattern::ResolvedVariant(true_tag), - binding: None, - }, - Path { - body: false_body, - output: false_output, - pattern: BranchPattern::ResolvedVariant(false_tag), - binding: None, - }, - ], - span(), - ); - let entry = node_for_port(&dag, output); - let frame = EvalFrame::from_bindings([( - scrutinee, - Value::LiteralValue(LiteralBits::Bool(true)), - )]) - .expect("frame"); - let mut state = EvalStateStack::with_root_frame(frame); - let strategy = eager_strategy(); - - let value = eval_node(&dag, entry, &mut state, &strategy).expect("branch evaluates"); - - assert_eq!(value, Value::LiteralValue(literal_bits_int(11))); - assert_eq!(state.frames_outer_to_inner().len(), 1); - } - - #[test] - fn eval_branch_reifies_false_bool_literal_scrutinee_to_false_arm() { - let mut dag = Dag::std_fixture_bootstrap_snapshot(); - let true_tag = dag - .bool_runtime_variant_id(true) - .expect("Bool.True variant id"); - let false_tag = dag - .bool_runtime_variant_id(false) - .expect("Bool.False variant id"); - let scrutinee = dag.alloc_port_with_shape(dag.bool_shape().expect("Bool shape")); - let true_output = dag.push_value(literal_bits_int(1), span()); - let true_body = node_for_port(&dag, true_output); - let false_output = dag.push_value(literal_bits_int(0), span()); - let false_body = node_for_port(&dag, false_output); - let output = dag.push_branch( - scrutinee, - vec![ - Path { - body: true_body, - output: true_output, - pattern: BranchPattern::ResolvedVariant(true_tag), - binding: None, - }, - Path { - body: false_body, - output: false_output, - pattern: BranchPattern::ResolvedVariant(false_tag), - binding: None, - }, - ], - span(), - ); - let entry = node_for_port(&dag, output); - let frame = EvalFrame::from_bindings([( - scrutinee, - Value::LiteralValue(LiteralBits::Bool(false)), - )]) - .expect("frame"); - let mut state = EvalStateStack::with_root_frame(frame); - let strategy = eager_strategy(); - - let value = eval_node(&dag, entry, &mut state, &strategy).expect("branch evaluates"); - - assert_eq!(value, Value::LiteralValue(literal_bits_int(0))); - assert_eq!(state.frames_outer_to_inner().len(), 1); - } - - #[test] - fn eval_branch_fails_closed_when_bool_reification_authority_is_missing() { - let mut dag = Dag::std_fixture_bootstrap_snapshot(); - let true_tag = dag - .bool_runtime_variant_id(true) - .expect("Bool.True variant id"); - let bool_decl = dag - .declaration_by_name("Bool") - .expect("Bool declaration") - .id; - dag.declaration_mut(bool_decl).name = Some("TruthValue".to_string()); - - let scrutinee = dag.alloc_port_with_shape(dag.bool_shape().expect("Bool shape")); - let arm_output = dag.push_value(literal_bits_int(1), span()); - let arm_body = node_for_port(&dag, arm_output); - let output = dag.push_branch( - scrutinee, - vec![Path { - body: arm_body, - output: arm_output, - pattern: BranchPattern::ResolvedVariant(true_tag), - binding: None, - }], - span(), - ); - let entry = node_for_port(&dag, output); - let frame = EvalFrame::from_bindings([( - scrutinee, - Value::LiteralValue(LiteralBits::Bool(true)), - )]) - .expect("frame"); - let mut state = EvalStateStack::with_root_frame(frame); - let strategy = eager_strategy(); - - let err = eval_node(&dag, entry, &mut state, &strategy) - .expect_err("missing Bool reification authority rejected"); - - assert_eq!(err, EvalError::BranchScrutineeShape { node: entry }); - assert_eq!(state.frames_outer_to_inner().len(), 1); - } - - // E4 §B.1.3: payload binding registers on the freshly-pushed - // frame and does not leak past `pop_frame`. Bodies that *read* - // the bound payload (Bind / Transform forms) wait on E3 / E6; - // this test verifies the frame-discipline scaffolding the body - // would observe by checking pre/post stack state through a - // shadow-port outer binding that the inner frame's lookup chain - // walks past. - #[test] - fn eval_branch_binds_payload_in_fresh_frame_for_body() { - let mut dag = Dag::std_fixture_bootstrap_snapshot(); - let some_tag = declaration_id_by_name(&dag, "Bool"); - let scrutinee = dag.alloc_port_with_shape(dag.bool_shape().expect("Bool shape")); - let payload_port = dag.alloc_port_with_shape(dag.bool_shape().expect("Bool shape")); - // Body returns a literal — verifies the path body is - // dispatched through `eval_node` after the frame push and - // payload bind. Bodies that consume the payload via - // `eval_port` wait on E3 / E6 supporting Bind / Transform. - let arm_output = dag.push_value(literal_bits_int(0), span()); - let arm_body = node_for_port(&dag, arm_output); - let output = dag.push_branch( - scrutinee, - vec![Path { - body: arm_body, - output: arm_output, - pattern: BranchPattern::ResolvedVariant(some_tag), - binding: Some(PayloadBinding { - binding_name: "p".to_string(), - payload_port, - }), - }], - span(), - ); - let entry = node_for_port(&dag, output); - let frame = EvalFrame::from_bindings([( - scrutinee, - variant( - some_tag, - Value::LiteralValue(LiteralBits::String("hello".to_string())), - ), - )]) - .expect("frame"); - let mut state = EvalStateStack::with_root_frame(frame); - let strategy = eager_strategy(); - - let value = eval_node(&dag, entry, &mut state, &strategy).expect("branch evaluates"); - - // Body is a literal; the test's primary assertion is the - // post-evaluation frame discipline below. (Body return value - // is the literal, confirming `eval_node` dispatched into the - // path body.) - assert_eq!(value, Value::LiteralValue(literal_bits_int(0))); - // After branch evaluation, the pushed frame is popped; only - // the original root frame remains, which never bound the - // payload port. Per Facts-Flow-Forward, the payload binding - // was scoped to the body frame and does not leak into the - // caller's stack. - assert_eq!(state.frames_outer_to_inner().len(), 1); - assert!(state.frames_outer_to_inner()[0] - .lookup_local(payload_port) - .is_none()); - } - - // E4 §B.1.3 fail-closed: `UnresolvedVariant` reaching evaluation - // is a resolution gap, not a runtime case — diagnose the path's - // declared name so a downstream consumer can repoint. - #[test] - fn eval_branch_fails_closed_on_unresolved_variant() { - let mut dag = Dag::std_fixture_bootstrap_snapshot(); - let some_tag = declaration_id_by_name(&dag, "Bool"); - let scrutinee = dag.alloc_port_with_shape(dag.bool_shape().expect("Bool shape")); - let arm_output = dag.push_value(literal_bits_int(1), span()); - let arm_body = node_for_port(&dag, arm_output); - let output = dag.push_branch( - scrutinee, - vec![Path { - body: arm_body, - output: arm_output, - pattern: BranchPattern::UnresolvedVariant { - name: "Drift".to_string(), - span: span(), - }, - binding: None, - }], - span(), - ); - let entry = node_for_port(&dag, output); - let frame = EvalFrame::from_bindings([( - scrutinee, - variant(some_tag, Value::LiteralValue(LiteralBits::Bool(true))), - )]) - .expect("frame"); - let mut state = EvalStateStack::with_root_frame(frame); - let strategy = eager_strategy(); - - let err = eval_node(&dag, entry, &mut state, &strategy) - .expect_err("unresolved variant rejected"); - - assert_eq!( - err, - EvalError::BranchUnresolvedVariant { - node: entry, - name: "Drift".to_string(), - } - ); - // Stack invariant: balanced even on the diagnostic path. - assert_eq!(state.frames_outer_to_inner().len(), 1); - } - - // E4 §B.1.3 fail-closed: scrutinee must be `VariantValue` for - // `ResolvedVariant` matching to be well-defined. - #[test] - fn eval_branch_fails_closed_on_non_variant_scrutinee() { - let mut dag = Dag::std_fixture_bootstrap_snapshot(); - let some_tag = declaration_id_by_name(&dag, "Bool"); - let scrutinee = dag.alloc_port_with_shape(dag.bool_shape().expect("Bool shape")); - let arm_output = dag.push_value(literal_bits_int(1), span()); - let arm_body = node_for_port(&dag, arm_output); - let output = dag.push_branch( - scrutinee, - vec![Path { - body: arm_body, - output: arm_output, - pattern: BranchPattern::ResolvedVariant(some_tag), - binding: None, - }], - span(), - ); - let entry = node_for_port(&dag, output); - let frame = - EvalFrame::from_bindings([(scrutinee, Value::LiteralValue(literal_bits_int(42)))]) - .expect("frame"); - let mut state = EvalStateStack::with_root_frame(frame); - let strategy = eager_strategy(); - - let err = eval_node(&dag, entry, &mut state, &strategy) - .expect_err("non-variant scrutinee rejected"); - - assert_eq!(err, EvalError::BranchScrutineeShape { node: entry }); - assert_eq!(state.frames_outer_to_inner().len(), 1); - } - - // E4 §B.1.3 fail-closed: scrutinee tag with no matching path is - // an inference / substrate invariant violation at runtime. - #[test] - fn eval_branch_fails_closed_on_no_matching_arm() { - let mut dag = Dag::std_fixture_bootstrap_snapshot(); - let path_tag = declaration_id_by_name(&dag, "Bool"); - let scrutinee_tag = declaration_id_by_name(&dag, "Int"); - let scrutinee = dag.alloc_port_with_shape(dag.bool_shape().expect("Bool shape")); - let arm_output = dag.push_value(literal_bits_int(1), span()); - let arm_body = node_for_port(&dag, arm_output); - let output = dag.push_branch( - scrutinee, - // Only the `path_tag` (`Bool`) arm; scrutinee carries - // `scrutinee_tag` (`Int`) so no path matches and the - // evaluator must fail closed on no-matching-arm. - vec![Path { - body: arm_body, - output: arm_output, - pattern: BranchPattern::ResolvedVariant(path_tag), - binding: None, - }], - span(), - ); - let entry = node_for_port(&dag, output); - let frame = EvalFrame::from_bindings([( - scrutinee, - variant(scrutinee_tag, Value::LiteralValue(LiteralBits::Bool(false))), - )]) - .expect("frame"); - let mut state = EvalStateStack::with_root_frame(frame); - let strategy = eager_strategy(); - - let err = eval_node(&dag, entry, &mut state, &strategy) - .expect_err("no matching arm rejected"); - - assert_eq!( - err, - EvalError::BranchNoMatchingArm { - node: entry, - tag: scrutinee_tag, - } - ); - assert_eq!(state.frames_outer_to_inner().len(), 1); - } - - // E4 sanity: reachable through the public `evaluate_body` entry. - #[test] - fn evaluate_body_dispatches_branch_through_eval_node() { - let mut dag = Dag::std_fixture_bootstrap_snapshot(); - let some_tag = declaration_id_by_name(&dag, "Bool"); - let scrutinee = dag.alloc_port_with_shape(dag.bool_shape().expect("Bool shape")); - let arm_output = dag.push_value(literal_bits_int(99), span()); - let arm_body = node_for_port(&dag, arm_output); - let output = dag.push_branch( - scrutinee, - vec![Path { - body: arm_body, - output: arm_output, - pattern: BranchPattern::ResolvedVariant(some_tag), - binding: None, - }], - span(), - ); - let entry = node_for_port(&dag, output); - let frame = EvalFrame::from_bindings([( - scrutinee, - variant(some_tag, Value::LiteralValue(LiteralBits::Bool(true))), - )]) - .expect("frame"); - let mut state = EvalStateStack::with_root_frame(frame); - let strategy = eager_strategy(); - - let value = evaluate_body(&dag, entry, &mut state, strategy).expect("branch evaluates"); - - assert_eq!(value, Value::LiteralValue(literal_bits_int(99))); - } - - // E4 / Facts-Flow-Forward: the arm value is the value at - // `BranchPath.output`, not the body's local return. When - // `path.output` is a payload-bound port (the arm "returns its - // payload"), the evaluator must read that port via `eval_port` - // after running the body for its side effects, not return the - // body node's own value. Constructed so the body is a Value - // node returning a *different* literal than the payload — if - // the evaluator returned the body's value the test would see - // the wrong literal. - #[test] - fn eval_branch_returns_value_at_path_output_not_body_value() { - let mut dag = Dag::std_fixture_bootstrap_snapshot(); - let some_tag = declaration_id_by_name(&dag, "Bool"); - let scrutinee = dag.alloc_port_with_shape(dag.bool_shape().expect("Bool shape")); - let payload_port = dag.alloc_port_with_shape(dag.bool_shape().expect("Bool shape")); - // Body returns a sentinel literal; if the evaluator wrongly - // returned this directly, the test would fail. - let body_output = dag.push_value(literal_bits_int(0xdead), span()); - let arm_body = node_for_port(&dag, body_output); - let payload_value = Value::LiteralValue(literal_bits_int(7)); - let output = dag.push_branch( - scrutinee, - vec![Path { - body: arm_body, - // Authoritative arm value comes from `payload_port`, - // not from `body_output`. - output: payload_port, - pattern: BranchPattern::ResolvedVariant(some_tag), - binding: Some(PayloadBinding { - binding_name: "p".to_string(), - payload_port, - }), - }], - span(), - ); - let entry = node_for_port(&dag, output); - let frame = - EvalFrame::from_bindings([(scrutinee, variant(some_tag, payload_value.clone()))]) - .expect("frame"); - let mut state = EvalStateStack::with_root_frame(frame); - let strategy = eager_strategy(); - - let value = eval_node(&dag, entry, &mut state, &strategy).expect("branch evaluates"); - - assert_eq!(value, payload_value); - assert_eq!(state.frames_outer_to_inner().len(), 1); - } - - // E4 / Facts-Flow-Forward: producerless-arm sentinel. - // `lower.rs:6133-6134, 6265` lowers arms whose result port has - // no producer node by setting `path.body == branch.id` — - // there's no body to execute; the value is at `path.output` - // already (e.g. payload-bound or an existing port from outside - // the branch). `eval_branch` must detect this sentinel and - // skip body evaluation, otherwise it would re-enter - // `eval_branch` on the same node and either loop or drop the - // authoritative `path.output` fact. Constructed via - // crate-private `alloc_node_id` / `push_node` so `path.body` - // can equal the branch's own id (the public `push_branch` - // builder asserts body existence before allocating its id, so - // it cannot construct this sentinel directly). - #[test] - fn eval_branch_handles_producerless_arm_sentinel() { - use crate::dag::BranchNode; - let mut dag = Dag::std_fixture_bootstrap_snapshot(); - let some_tag = declaration_id_by_name(&dag, "Bool"); - let scrutinee = dag.alloc_port_with_shape(dag.bool_shape().expect("Bool shape")); - let payload_port = dag.alloc_port_with_shape(dag.bool_shape().expect("Bool shape")); - // Manual branch construction so `path.body == branch_id`, - // mirroring the `producer_of(...).unwrap_or(branch_id)` - // sentinel from `lower.rs`. - let branch_id = dag.alloc_node_id(); - let branch_output = dag.alloc_port(Some(branch_id)); - dag.push_node(Behavior::Branch(BranchNode { - id: branch_id, - input: scrutinee, - paths: vec![Path { - body: branch_id, // sentinel: no producer for the arm result - output: payload_port, - pattern: BranchPattern::ResolvedVariant(some_tag), - binding: Some(PayloadBinding { - binding_name: "p".to_string(), - payload_port, - }), - }], - output: branch_output, - span: span(), - emit_participation: None, - })); - let payload_value = Value::LiteralValue(literal_bits_int(42)); - let frame = - EvalFrame::from_bindings([(scrutinee, variant(some_tag, payload_value.clone()))]) - .expect("frame"); - let mut state = EvalStateStack::with_root_frame(frame); - let strategy = eager_strategy(); - - // If eval_branch recursed into eval_node(branch_id), it would - // re-enter the same Branch infinitely; the test passing at - // all confirms the sentinel detection. - let value = - eval_node(&dag, branch_id, &mut state, &strategy).expect("branch evaluates"); - - assert_eq!(value, payload_value); - assert_eq!(state.frames_outer_to_inner().len(), 1); - } - - // E4 §B.1.3 fail-closed: every `BranchPath.pattern` must be - // `ResolvedVariant` before evaluation proceeds. A matching - // early arm cannot mask a later `UnresolvedVariant` — - // unresolved-substrate state is a Fail-Closed (C-8) violation - // regardless of which arm would have been selected. - #[test] - fn eval_branch_fails_closed_on_late_unresolved_arm_even_if_earlier_arm_matches() { - let mut dag = Dag::std_fixture_bootstrap_snapshot(); - let matching_tag = declaration_id_by_name(&dag, "Bool"); - let scrutinee = dag.alloc_port_with_shape(dag.bool_shape().expect("Bool shape")); - let early_output = dag.push_value(literal_bits_int(7), span()); - let early_body = node_for_port(&dag, early_output); - let late_output = dag.push_value(literal_bits_int(13), span()); - let late_body = node_for_port(&dag, late_output); - let output = dag.push_branch( - scrutinee, - vec![ - // Early arm matches the scrutinee tag — without the - // pre-pass this would be returned and the late - // unresolved arm would slip through. - Path { - body: early_body, - output: early_output, - pattern: BranchPattern::ResolvedVariant(matching_tag), - binding: None, - }, - Path { - body: late_body, - output: late_output, - pattern: BranchPattern::UnresolvedVariant { - name: "LateDrift".to_string(), - span: span(), - }, - binding: None, - }, - ], - span(), - ); - let entry = node_for_port(&dag, output); - let frame = EvalFrame::from_bindings([( - scrutinee, - variant(matching_tag, Value::LiteralValue(LiteralBits::Bool(true))), - )]) - .expect("frame"); - let mut state = EvalStateStack::with_root_frame(frame); - let strategy = eager_strategy(); - - let err = eval_node(&dag, entry, &mut state, &strategy) - .expect_err("late unresolved arm rejected"); - - assert_eq!( - err, - EvalError::BranchUnresolvedVariant { - node: entry, - name: "LateDrift".to_string(), - } - ); - assert_eq!(state.frames_outer_to_inner().len(), 1); - } - - // Wrong-sum `UnresolvedVariant` labels exist on *some* `Disj` in the fixture DAG but not on - // the scrutinee's owning sum. Without scrutinee-scoped validation, `any_disj` acceptance - // lets them pass the pre-pass while an earlier arm matches — masking the substrate gap. - #[test] - fn eval_branch_fails_closed_on_wrong_sum_unresolved_arm_masked_by_earlier_match() { - let mut dag = Dag::std_fixture_bootstrap_snapshot(); - let matching_tag = declaration_id_by_name(&dag, "Bool"); - let scrutinee = dag.alloc_port_with_shape(dag.bool_shape().expect("Bool shape")); - let early_output = dag.push_value(LiteralBits::Int("7".to_string()), span()); - let early_body = node_for_port(&dag, early_output); - let late_output = dag.push_value(LiteralBits::Int("13".to_string()), span()); - let late_body = node_for_port(&dag, late_output); - let output = dag.push_branch( - scrutinee, - vec![ - Path { - body: early_body, - output: early_output, - pattern: BranchPattern::ResolvedVariant(matching_tag), - binding: None, - }, - Path { - body: late_body, - output: late_output, - pattern: BranchPattern::UnresolvedVariant { - name: "Empty".to_string(), - span: span(), - }, - binding: None, - }, - ], - span(), - ); - let entry = node_for_port(&dag, output); - let frame = EvalFrame::from_bindings([( - scrutinee, - variant(matching_tag, Value::LiteralValue(LiteralBits::Bool(true))), - )]) - .expect("frame"); - let mut state = EvalStateStack::with_root_frame(frame); - let strategy = eager_strategy(); - - let err = eval_node(&dag, entry, &mut state, &strategy) - .expect_err("wrong-sum unresolved arm rejected"); - - assert_eq!( - err, - EvalError::BranchUnresolvedVariant { - node: entry, - name: "Empty".to_string(), - } - ); - assert_eq!(state.frames_outer_to_inner().len(), 1); - } - - #[test] - fn eval_loop_zero_iterations_returns_init_without_body_eval() { - let mut dag = Dag::new(); - let source = dag.alloc_port(None); - let init = dag.push_value(literal_bits_int(9), span()); - let zero = dag.push_value(literal_bits_int(0), span()); - let one = dag.push_value(literal_bits_int(1), span()); - let bad_body_output = dag.push_transform( - TransformTarget::Operator(OperatorKind::Arithmetic(ArithmeticOp::Div)), - vec![source, one], - span(), - ); - let bad_body = node_for_port(&dag, bad_body_output); - let output = dag.push_loop( - source, - init, - bad_body, - LoopBound::Cardinality { count: zero }, - span(), - ); - let entry = node_for_port(&dag, output); - let mut state = empty_state(); - let strategy = eager_strategy(); - - let value = eval_node(&dag, entry, &mut state, &strategy).expect("zero loop"); - - assert_eq!( - value, - Value::LiteralValue(literal_bits_int(9)), - "zero iterations must not evaluate the unsupported body" - ); - assert_eq!(state.frames_outer_to_inner().len(), 1); - } - - #[test] - fn eval_loop_cardinality_threads_accumulator_through_body() { - let mut dag = Dag::new(); - let source = dag.alloc_port(None); - let init = dag.push_value(literal_bits_int(0), span()); - let count = dag.push_value(literal_bits_int(3), span()); - let one = dag.push_value(literal_bits_int(1), span()); - let body_output = dag.push_transform( - TransformTarget::Operator(OperatorKind::Arithmetic(ArithmeticOp::Add)), - vec![source, one], - span(), - ); - let body = node_for_port(&dag, body_output); - let output = - dag.push_loop(source, init, body, LoopBound::Cardinality { count }, span()); - let entry = node_for_port(&dag, output); - let mut state = empty_state(); - - let value = - eval_node(&dag, entry, &mut state, &eager_strategy()).expect("loop evaluates"); - - assert_eq!(value, Value::LiteralValue(literal_bits_int(3))); - assert_eq!(state.frames_outer_to_inner().len(), 1); - assert_eq!( - state.lookup(source), - Err(EvalFrameError::UnboundPort { port: source }), - "iteration accumulator binding must not leak" - ); - } - - #[test] - fn eval_loop_cardinality_missing_count_fails_closed() { - let mut dag = Dag::new(); - let source = dag.alloc_port(None); - let init = dag.push_value(literal_bits_int(0), span()); - let missing_count = dag.alloc_port(None); - let body_output = dag.push_value(literal_bits_int(1), span()); - let body = node_for_port(&dag, body_output); - let output = dag.push_loop( - source, - init, - body, - LoopBound::Cardinality { - count: missing_count, - }, - span(), - ); - let entry = node_for_port(&dag, output); - let mut state = empty_state(); - - let err = - eval_node(&dag, entry, &mut state, &eager_strategy()).expect_err("missing count"); - - assert_eq!( - err, - EvalError::UnboundPort { - port: missing_count - } - ); - assert_eq!(state.frames_outer_to_inner().len(), 1); - } - - #[test] - fn eval_loop_cardinality_non_integer_count_fails_closed() { - let mut dag = Dag::new(); - let source = dag.alloc_port(None); - let init = dag.push_value(literal_bits_int(0), span()); - let count = dag.push_value(LiteralBits::String("three".to_string()), span()); - let body_output = dag.push_value(literal_bits_int(1), span()); - let body = node_for_port(&dag, body_output); - let output = - dag.push_loop(source, init, body, LoopBound::Cardinality { count }, span()); - let entry = node_for_port(&dag, output); - let mut state = empty_state(); - - let err = eval_node(&dag, entry, &mut state, &eager_strategy()) - .expect_err("non-integer count"); - - assert_eq!( - err, - EvalError::LoopCardinalityNonInteger { node: entry, count } - ); - assert_eq!(state.frames_outer_to_inner().len(), 1); - } - - #[test] - fn eval_loop_cardinality_negative_count_fails_closed() { - let mut dag = Dag::new(); - let source = dag.alloc_port(None); - let init = dag.push_value(literal_bits_int(0), span()); - let count = dag.push_value(literal_bits_int(-1), span()); - let body_output = dag.push_value(literal_bits_int(1), span()); - let body = node_for_port(&dag, body_output); - let output = - dag.push_loop(source, init, body, LoopBound::Cardinality { count }, span()); - let entry = node_for_port(&dag, output); - let mut state = empty_state(); - - let err = - eval_node(&dag, entry, &mut state, &eager_strategy()).expect_err("negative count"); - - assert_eq!( - err, - EvalError::LoopCardinalityNegative { - node: entry, - count, - value: -1, - } - ); - assert_eq!(state.frames_outer_to_inner().len(), 1); - } - - #[cfg(target_pointer_width = "32")] - #[test] - fn eval_loop_cardinality_count_too_large_for_usize_fails_closed() { - let mut dag = Dag::new(); - let source = dag.alloc_port(None); - let init = dag.push_value(literal_bits_int(0), span()); - let too_large = i64::from(u32::MAX) + 1; - let count = dag.push_value(literal_bits_int(too_large), span()); - let body_output = dag.push_value(literal_bits_int(1), span()); - let body = node_for_port(&dag, body_output); - let output = - dag.push_loop(source, init, body, LoopBound::Cardinality { count }, span()); - let entry = node_for_port(&dag, output); - let mut state = empty_state(); - - let err = - eval_node(&dag, entry, &mut state, &eager_strategy()).expect_err("count too large"); - - assert_eq!( - err, - EvalError::LoopCardinalityTooLarge { - node: entry, - count, - value: too_large, - } - ); - assert_eq!(state.frames_outer_to_inner().len(), 1); - } - - #[test] - fn eval_loop_descent_bound_with_strict_per_path_proof_succeeds() { - let (dag, loop_node) = descent_loop_fixture(7); - let mut state = empty_state(); - let strategy = eager_strategy(); - let LoopBound::Descent { cluster, measure } = loop_node.bound else { - panic!("descent bound"); - }; - - let value = eval_loop_with_descent_execution_proof( - &dag, - loop_node, - &mut state, - &strategy, - |_, proof_cluster, proof_measure| { - assert_eq!(proof_cluster, cluster); - assert_eq!(proof_measure, measure); - Ok(DescentExecutionProof { - cluster: proof_cluster, - port: proof_measure, - per_path: HashMap::from([( - descent_proof_path_key( - dag.cluster(cluster).intra_cluster_calls.first.transform, - ), - StrictEvidence::Strict, - )]), - }) - }, - ) - .expect("strict descent proof discharges loop bound"); - - assert_eq!(value, Value::LiteralValue(literal_bits_int(7))); - assert_eq!(state.frames_outer_to_inner().len(), 1); - assert_eq!( - state.lookup(measure), - Err(EvalFrameError::UnboundPort { port: measure }), - "descent iteration binding must not leak" - ); - } - - #[test] - fn eval_loop_descent_bound_incomplete_per_path_coverage_fails_closed() { - let (dag, loop_node) = descent_loop_fixture(1); - let mut state = empty_state(); - let strategy = eager_strategy(); - let node = loop_node.id; - let LoopBound::Descent { cluster, measure } = loop_node.bound else { - panic!("descent bound"); - }; - - let err = eval_loop_with_descent_execution_proof( - &dag, - loop_node, - &mut state, - &strategy, - |_, proof_cluster, proof_measure| { - Ok(DescentExecutionProof { - cluster: proof_cluster, - port: proof_measure, - per_path: HashMap::new(), - }) - }, - ) - .expect_err("missing intra-cluster call coverage fails closed"); - - assert_eq!( - err, - EvalError::LoopBoundDescentResidual { - node, - cluster, - measure, - } - ); - assert_eq!(state.frames_outer_to_inner().len(), 1); - } - - #[test] - fn eval_loop_descent_bound_evidence_incomplete_fails_closed() { - let (dag, loop_node) = descent_loop_fixture(1); - let mut state = empty_state(); - let strategy = eager_strategy(); - let node = loop_node.id; - let LoopBound::Descent { cluster, measure } = loop_node.bound else { - panic!("descent bound"); - }; - - let err = eval_loop_with_descent_execution_proof( - &dag, - loop_node, - &mut state, - &strategy, - |_, _, _| Err(DescentResidual::EvidenceIncomplete), - ) - .expect_err("incomplete descent proof fails closed"); - - assert_eq!( - err, - EvalError::LoopBoundDescentResidual { - node, - cluster, - measure, - } - ); - assert_eq!(state.frames_outer_to_inner().len(), 1); - } - - #[test] - fn eval_loop_descent_bound_evidence_unknown_non_increasing_fails_closed() { - let (dag, loop_node) = descent_loop_fixture(1); - let mut state = empty_state(); - let strategy = eager_strategy(); - let node = loop_node.id; - let LoopBound::Descent { cluster, measure } = loop_node.bound else { - panic!("descent bound"); - }; - - let err = eval_loop_with_descent_execution_proof( - &dag, - loop_node, - &mut state, - &strategy, - |_, _, _| { - Err(DescentResidual::EvidenceUnknown( - NonStrictEvidence::NonIncreasing, - )) - }, - ) - .expect_err("non-increasing descent proof fails closed"); - - assert_eq!( - err, - EvalError::LoopBoundDescentResidual { - node, - cluster, - measure, - } - ); - assert_eq!(state.frames_outer_to_inner().len(), 1); - } - - #[test] - fn eval_loop_descent_bound_evidence_unknown_descent_unknown_fails_closed() { - let (dag, loop_node) = descent_loop_fixture(1); - let mut state = empty_state(); - let strategy = eager_strategy(); - let node = loop_node.id; - let LoopBound::Descent { cluster, measure } = loop_node.bound else { - panic!("descent bound"); - }; - - let err = eval_loop_with_descent_execution_proof( - &dag, - loop_node, - &mut state, - &strategy, - |_, _, _| { - Err(DescentResidual::EvidenceUnknown( - NonStrictEvidence::DescentUnknown, - )) - }, - ) - .expect_err("unknown descent proof fails closed"); - - assert_eq!( - err, - EvalError::LoopBoundDescentResidual { - node, - cluster, - measure, - } - ); - assert_eq!(state.frames_outer_to_inner().len(), 1); - } - - #[test] - fn eval_loop_restores_stack_after_body_diagnostic() { - let mut dag = Dag::new(); - let source = dag.alloc_port(None); - let init = dag.push_value(literal_bits_int(0), span()); - let count = dag.push_value(literal_bits_int(1), span()); - let one = dag.push_value(literal_bits_int(1), span()); - let bad_body_output = dag.push_transform( - TransformTarget::Operator(OperatorKind::Arithmetic(ArithmeticOp::Div)), - vec![source, one], - span(), - ); - let bad_body = node_for_port(&dag, bad_body_output); - let output = dag.push_loop( - source, - init, - bad_body, - LoopBound::Cardinality { count }, - span(), - ); - let entry = node_for_port(&dag, output); - let mut state = empty_state(); - - let err = - eval_node(&dag, entry, &mut state, &eager_strategy()).expect_err("body diagnostic"); - - assert_eq!( - err, - EvalError::UnsupportedTransformTarget { - kind: "ArithmeticDiv", - } - ); - assert_eq!(state.frames_outer_to_inner().len(), 1); - assert_eq!( - state.lookup(source), - Err(EvalFrameError::UnboundPort { port: source }), - "failed iteration frame must be popped" - ); - } - - // E3 Transform — preserved from main during merge. - - #[test] - fn transform_arithmetic_div_unsupported_until_result_carrier_eval_lands() { - let mut dag = Dag::new(); - let lhs = dag.push_value(literal_bits_int(8), span()); - let rhs = dag.push_value(literal_bits_int(2), span()); - let output = dag.push_transform( - TransformTarget::Operator(OperatorKind::Arithmetic(ArithmeticOp::Div)), - vec![lhs, rhs], - span(), - ); - let entry = node_for_port(&dag, output); - let mut state = empty_state(); - - let err = eval_node(&dag, entry, &mut state, &eager_strategy()).expect_err("div"); - - assert_eq!( - err, - EvalError::UnsupportedTransformTarget { - kind: "ArithmeticDiv", - } - ); - } - - #[test] - fn transform_comparison_int_evaluates() { - let mut dag = Dag::new(); - let lhs = dag.push_value(literal_bits_int(2), span()); - let rhs = dag.push_value(literal_bits_int(3), span()); - let output = dag.push_transform( - TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Lt)), - vec![lhs, rhs], - span(), - ); - let entry = node_for_port(&dag, output); - let mut state = empty_state(); - - let value = eval_node(&dag, entry, &mut state, &eager_strategy()).expect("cmp"); - - assert_eq!(value, Value::LiteralValue(LiteralBits::Bool(true))); - } - - #[test] - fn transform_comparison_bool_matches_rust_total_order() { - let mut dag = Dag::new(); - let lhs = dag.push_value(LiteralBits::Bool(false), span()); - let rhs = dag.push_value(LiteralBits::Bool(true), span()); - let output = dag.push_transform( - TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Lt)), - vec![lhs, rhs], - span(), - ); - let entry = node_for_port(&dag, output); - let mut state = empty_state(); - - let value = eval_node(&dag, entry, &mut state, &eager_strategy()).expect("bool lt"); - - assert_eq!(value, Value::LiteralValue(LiteralBits::Bool(true))); - } - - #[test] - fn transform_logical_operator_evaluates_bool_literals() { - let mut dag = Dag::new(); - let lhs = dag.push_value(LiteralBits::Bool(true), span()); - let rhs = dag.push_value(LiteralBits::Bool(false), span()); - let output = dag.push_transform( - TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - vec![lhs, rhs], - span(), - ); - let entry = node_for_port(&dag, output); - let mut state = empty_state(); - - let value = eval_node(&dag, entry, &mut state, &eager_strategy()).expect("logical"); - - assert_eq!(value, Value::LiteralValue(LiteralBits::Bool(false))); - } - - #[test] - fn transform_field_project_non_record_carrier_fails_closed() { - // E6-G0c: FieldProject now executes; non-record carrier must - // fail closed with a typed BadTransformOperands rather than - // returning an unrelated value. - let mut dag = Dag::new(); - let v = dag.push_value(literal_bits_int(1), span()); - let output = dag.push_transform( - TransformTarget::UnresolvedFieldProject { - field_label: "x".to_string(), - }, - vec![v], - span(), - ); - let entry = node_for_port(&dag, output); - let mut state = empty_state(); - - let err = eval_node(&dag, entry, &mut state, &eager_strategy()).expect_err("project"); - - assert_eq!( - err, - EvalError::BadTransformOperands { - reason: "FieldProject carrier must be a RecordValue", - } - ); - } - - #[test] - fn transform_callable_non_arrow_decl_fails_closed() { - // E6-G0c: Callable now executes for Arrow-bodied user - // functions; a non-Arrow declaration (e.g., Bool's Disj - // connective) must fail closed with a typed - // BadTransformOperands rather than the prior blanket - // UnsupportedTransformTarget. - let mut dag = Dag::new(); - let target_decl = dag.declaration_by_name("Bool").expect("Bool").id; - let output = dag.push_transform(TransformTarget::Callable(target_decl), vec![], span()); - let entry = node_for_port(&dag, output); - let mut state = empty_state(); - - let err = eval_node(&dag, entry, &mut state, &eager_strategy()).expect_err("callable"); - - assert_eq!( - err, - EvalError::BadTransformOperands { - reason: BAD_TRANSFORM_CALLABLE_TARGET_NOT_ARROW_REASON, - } - ); - } - - #[test] - fn eval_bind_value_binding_returns_body_port_value() { - let mut dag = Dag::new(); - let value = dag.push_value(LiteralBits::Bool(false), span()); - let entry = dag.push_bind("flag", value, Vec::new(), span()); - let mut state = empty_state(); - let strategy = eager_strategy(); - - let out = eval_node(&dag, entry, &mut state, &strategy).expect("bind evaluates"); - - assert_eq!(out, Value::LiteralValue(LiteralBits::Bool(false))); - assert!(matches!(dag.node(entry), Behavior::Bind(_))); - assert_eq!(state.frames_outer_to_inner().len(), 1); - } - - #[test] - fn eval_bind_copies_callable_param_into_fresh_frame_for_body() { - let mut dag = Dag::new(); - let param = dag.alloc_port(None); - let one = dag.push_value(literal_bits_int(1), span()); - let body = dag.push_transform( - TransformTarget::Operator(OperatorKind::Arithmetic(ArithmeticOp::Add)), - vec![param, one], - span(), - ); - let entry = dag.push_bind("increment", body, vec![param], span()); - let caller = - EvalFrame::from_bindings([(param, Value::LiteralValue(literal_bits_int(41)))]) - .expect("caller frame"); - let mut state = EvalStateStack::with_root_frame(caller); - - let out = eval_node(&dag, entry, &mut state, &eager_strategy()) - .expect("callable bind evaluates"); - - assert_eq!(out, Value::LiteralValue(literal_bits_int(42))); - assert_eq!(state.frames_outer_to_inner().len(), 1); - assert_eq!( - state.lookup(param), - Ok(&Value::LiteralValue(literal_bits_int(41))), - "caller binding remains in the outer frame" - ); - } - - #[test] - fn eval_bind_body_result_can_be_parameter_port() { - let mut dag = Dag::new(); - let param = dag.alloc_port(None); - let entry = dag.push_bind("identity", param, vec![param], span()); - let caller = EvalFrame::from_bindings([( - param, - Value::LiteralValue(LiteralBits::String("arg".to_string())), - )]) - .expect("caller frame"); - let mut state = EvalStateStack::with_root_frame(caller); - - let out = eval_node(&dag, entry, &mut state, &eager_strategy()).expect("identity bind"); - - assert_eq!( - out, - Value::LiteralValue(LiteralBits::String("arg".to_string())) - ); - assert_eq!(state.frames_outer_to_inner().len(), 1); - } - - #[test] - fn eval_bind_duplicate_param_fails_closed_and_restores_stack() { - let mut dag = Dag::new(); - let param = dag.alloc_port(None); - let entry = dag.push_bind("dup", param, vec![param, param], span()); - let caller = - EvalFrame::from_bindings([(param, Value::LiteralValue(literal_bits_int(1)))]) - .expect("caller frame"); - let mut state = EvalStateStack::with_root_frame(caller); - - let err = - eval_node(&dag, entry, &mut state, &eager_strategy()).expect_err("duplicate param"); - - assert_eq!( - err, - EvalError::FrameError(EvalFrameError::DuplicateBinding { port: param }) - ); - assert_eq!(state.frames_outer_to_inner().len(), 1); - } - - // ---- E6-G0c: Callable / FieldProject execution ---- - - fn alloc_arrow_decl_with_bind( - dag: &mut Dag, - bind_node: NodeId, - arity: usize, - ) -> DeclarationId { - // Wrap an existing Bind body in an Arrow declaration so the - // evaluator's Callable arm can find it via - // `dag.declaration(decl).connective`. `arity` matches the - // bind's parameter count; `inputs` holds `arity` Int decls - // so the builder's `callable_runtime_arity` agrees with the - // operand count at the call site. - let int_decl = dag.int_shape().expect("Int decl in bootstrap").declaration; - let bind_id = - crate::dag::BindNodeId::from_bind_node(dag, bind_node).expect("bind node id"); - let id = dag.alloc_declaration_id(); - dag.push_declaration(crate::dag::Declaration { - id, - name: Some("user_callable".to_string()), - connective: crate::dag::TypeConnective::Arrow { - inputs: vec![int_decl; arity], - output: int_decl, - body: crate::dag::ArrowBody::UserDefined(bind_id), - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span(), - }); - id - } - - #[test] - fn transform_field_project_returns_named_field_value() { - // Lift the RecordValue carrier directly into the caller frame - // — the FieldProject arm reads from the projected carrier's - // Value shape, not from a Record-lowering port path. - let mut dag = Dag::new(); - let carrier_port = dag.alloc_port(None); - let carrier_value = Value::RecordValue(vec![ - crate::evaluator::NamedField { - label: "x".to_string(), - value: Value::LiteralValue(literal_bits_int(7)), - }, - crate::evaluator::NamedField { - label: "y".to_string(), - value: Value::LiteralValue(literal_bits_int(11)), - }, - ]); - let frame = - EvalFrame::from_bindings([(carrier_port, carrier_value)]).expect("caller frame"); - let mut state = EvalStateStack::with_root_frame(frame); - let output = dag.push_transform( - TransformTarget::UnresolvedFieldProject { - field_label: "y".to_string(), - }, - vec![carrier_port], - span(), - ); - let entry = node_for_port(&dag, output); - - let value = eval_node(&dag, entry, &mut state, &eager_strategy()).expect("y projects"); - - assert_eq!(value, Value::LiteralValue(literal_bits_int(11))); - } - - #[test] - fn transform_field_project_missing_label_fails_closed() { - let mut dag = Dag::new(); - let carrier_port = dag.alloc_port(None); - let carrier_value = Value::RecordValue(vec![crate::evaluator::NamedField { - label: "only".to_string(), - value: Value::LiteralValue(literal_bits_int(1)), - }]); - let frame = - EvalFrame::from_bindings([(carrier_port, carrier_value)]).expect("caller frame"); - let mut state = EvalStateStack::with_root_frame(frame); - let output = dag.push_transform( - TransformTarget::UnresolvedFieldProject { - field_label: "missing".to_string(), - }, - vec![carrier_port], - span(), - ); - let entry = node_for_port(&dag, output); - - let err = - eval_node(&dag, entry, &mut state, &eager_strategy()).expect_err("missing label"); - - assert_eq!( - err, - EvalError::BadTransformOperands { - reason: "FieldProject label not present on RecordValue carrier", - } - ); - } - - // (FieldProject / Callable arity mismatches are unrepresentable - // at construction: `Dag::push_transform`'s builder asserts arity - // matches `field_child`/`callable_runtime_arity`. The runtime - // arity guards in the evaluator are defense-in-depth for future - // builders that bypass that assertion; they are not exercisable - // through the standard construction path. No runtime-only arity - // tests here.) - - #[test] - fn transform_callable_executes_user_function_body() { - // E6-G0c positive: build `fn user_callable(n) = n + n` as an - // Arrow declaration with UserDefined body. Invoke through - // TransformTarget::Callable with operand 21; expect 42. - let mut dag = Dag::new(); - let param = dag.alloc_port(None); - let two_n = dag.push_transform( - TransformTarget::Operator(OperatorKind::Arithmetic(ArithmeticOp::Add)), - vec![param, param], - span(), - ); - let bind_node = dag.push_bind("user_callable", two_n, vec![param], span()); - let callee_decl = alloc_arrow_decl_with_bind(&mut dag, bind_node, /* arity */ 1); - let twenty_one = dag.push_value(literal_bits_int(21), span()); - let call_output = dag.push_transform( - TransformTarget::Callable(callee_decl), - vec![twenty_one], - span(), - ); - let entry = node_for_port(&dag, call_output); - let mut state = empty_state(); - - let value = - eval_node(&dag, entry, &mut state, &eager_strategy()).expect("user callable"); - - assert_eq!(value, Value::LiteralValue(literal_bits_int(42))); - assert_eq!(state.frames_outer_to_inner().len(), 1, "frame popped"); - } - - #[test] - fn transform_callable_evaluates_inputs_left_to_right() { - // Build `fn sub(a, b) = a - b` and invoke `sub(10, 3)` → - // expect 7. The argument-evaluation order is left-to-right; - // Sub is non-commutative, so a swap would surface a swap to - // -7. Pinning the orientation is enough for a left-first - // ordering check at this layer. - let mut dag = Dag::new(); - let a = dag.alloc_port(None); - let b = dag.alloc_port(None); - let body = dag.push_transform( - TransformTarget::Operator(OperatorKind::Arithmetic(ArithmeticOp::Sub)), - vec![a, b], - span(), - ); - let bind_node = dag.push_bind("sub", body, vec![a, b], span()); - let callee_decl = alloc_arrow_decl_with_bind(&mut dag, bind_node, /* arity */ 2); - let ten = dag.push_value(literal_bits_int(10), span()); - let three = dag.push_value(literal_bits_int(3), span()); - let call_output = dag.push_transform( - TransformTarget::Callable(callee_decl), - vec![ten, three], - span(), - ); - let entry = node_for_port(&dag, call_output); - let mut state = empty_state(); - - let value = eval_node(&dag, entry, &mut state, &eager_strategy()).expect("sub"); - - assert_eq!(value, Value::LiteralValue(literal_bits_int(7))); - } - - #[test] - fn eval_bind_unbound_param_fails_closed_without_pushing_frame() { - let mut dag = Dag::new(); - let param = dag.alloc_port(None); - let entry = dag.push_bind("missing", param, vec![param], span()); - let mut state = empty_state(); - - let err = - eval_node(&dag, entry, &mut state, &eager_strategy()).expect_err("unbound param"); - - assert_eq!( - err, - EvalError::FrameError(EvalFrameError::UnboundPort { port: param }) - ); - assert_eq!(state.frames_outer_to_inner().len(), 1); - } - - #[test] - fn eval_bind_restores_stack_after_body_diagnostic() { - let mut dag = Dag::new(); - let param = dag.alloc_port(None); - let one = dag.push_value(literal_bits_int(1), span()); - let bad_body = dag.push_transform( - TransformTarget::Operator(OperatorKind::Arithmetic(ArithmeticOp::Div)), - vec![param, one], - span(), - ); - let entry = dag.push_bind("bad", bad_body, vec![param], span()); - let caller = - EvalFrame::from_bindings([(param, Value::LiteralValue(literal_bits_int(8)))]) - .expect("caller frame"); - let mut state = EvalStateStack::with_root_frame(caller); - - let err = - eval_node(&dag, entry, &mut state, &eager_strategy()).expect_err("body diagnostic"); - - assert_eq!( - err, - EvalError::UnsupportedTransformTarget { - kind: "ArithmeticDiv", - } - ); - assert_eq!(state.frames_outer_to_inner().len(), 1); - assert_eq!( - state.lookup(param), - Ok(&Value::LiteralValue(literal_bits_int(8))) - ); - } - - #[test] - fn lookup_walks_innermost_frame_first() { - let ids = ports(2); - let outer = EvalFrame::from_bindings([(ids[0], "outer"), (ids[1], "outer-only")]) - .expect("outer frame"); - let inner = EvalFrame::from_bindings([(ids[0], "inner")]).expect("inner frame"); - let stack = EvalStateStack::from_outer_to_inner(vec![outer, inner]); - - assert_eq!(stack.lookup(ids[0]), Ok(&"inner")); - assert_eq!(stack.lookup(ids[1]), Ok(&"outer-only")); - } - - #[test] - fn bind_top_writes_only_the_innermost_frame() { - let ids = ports(1); - let outer = EvalFrame::from_bindings([(ids[0], "outer")]).expect("outer frame"); - let inner = EvalFrame::empty(); - let mut stack = EvalStateStack::from_outer_to_inner(vec![outer, inner]); - - stack.bind_top(ids[0], "inner").expect("bind top"); - - assert_eq!(stack.lookup(ids[0]), Ok(&"inner")); - assert_eq!( - stack.frames_outer_to_inner()[0].lookup_local(ids[0]), - Some(&"outer") - ); - assert_eq!( - stack.frames_outer_to_inner()[1].lookup_local(ids[0]), - Some(&"inner") - ); - } - - #[test] - fn bind_top_rejects_duplicate_binding_in_current_frame() { - let ids = ports(1); - let mut stack = - EvalStateStack::with_root_frame(EvalFrame::from_bindings([(ids[0], 1)]).unwrap()); - - let err = stack.bind_top(ids[0], 2).expect_err("duplicate rejected"); - - assert_eq!(err, EvalFrameError::DuplicateBinding { port: ids[0] }); - assert_eq!(stack.lookup(ids[0]), Ok(&1)); - } - - #[test] - fn lookup_reports_unbound_port_after_full_stack_walk() { - let ids = ports(2); - let stack = - EvalStateStack::with_root_frame(EvalFrame::from_bindings([(ids[0], 1)]).unwrap()); - - let err = stack.lookup(ids[1]).expect_err("unbound rejected"); - - assert_eq!(err, EvalFrameError::UnboundPort { port: ids[1] }); - } - - #[test] - fn bind_top_reports_empty_state_stack() { - let ids = ports(1); - let mut stack: EvalStateStack = EvalStateStack::from_outer_to_inner(Vec::new()); - - let err = stack.bind_top(ids[0], 1).expect_err("empty stack rejected"); - - assert_eq!(err, EvalFrameError::EmptyStateStack); - } - } -} -mod int_literal_ranges; -/// T-LensAPI D1: bounded lens interpreter over substrate-shaped [`FieldValue`] -/// (see module docs in `lens_declaration_apply.rs`). -pub mod lens_declaration_apply; -pub use lens_declaration_apply::lens_testgen; - -/// Effect-enumeration lens. Authority lives in -/// `src/v3/lenses/effect_enumeration.dag`; the Rust projection is -/// auto-emitted into `src/v3/compiler/src/lens_effect_enumeration_generated.rs` -/// and wrapped here so callers use `v3_compiler::lens_effect_enumeration`. -/// Editing the lens means editing the `.dag` and regenerating the checked-in -/// projection in the same change. -pub mod lens_effect_enumeration { - #[allow( - dead_code, - unused_imports, - unused_parens, - unused_variables, - clippy::clone_on_copy, - clippy::collapsible_else_if, - non_shorthand_field_patterns - )] - mod generated { - use crate::dag::*; - use crate::diagnostics::*; - - enum EffectClassificationResult { - EffectClassified { - shape: EffectShape, - }, - EffectClassificationFailed { - failure: EffectClassificationFailure, - }, - } - - fn classify_operation_effect(op: &Operation) -> EffectClassificationResult { - match crate::dag::classify_operation_effect(&Dag::new(), op) { - Ok(shape) => EffectClassificationResult::EffectClassified { shape }, - Err(failure) => EffectClassificationResult::EffectClassificationFailed { failure }, - } - } - - fn operation_effect_shape(op: &Operation) -> EffectShape { - crate::dag::operation_effect_shape(&Dag::new(), op) - .expect("std.effects operation anchors unavailable for generated adapter") - } - - include!("lens_effect_enumeration_generated.rs"); - } - - pub use generated::{ - enumerate_effects, CoverageGap, EffectEnumerationReport, EffectFact, RedundantReadError, - StructuralEffectShape, TransactionalPattern, - }; - - pub fn operation_structural_effect_shape(op: &crate::dag::Operation) -> StructuralEffectShape { - match crate::dag::operation_effect_shape(&crate::dag::Dag::new(), op) { - Some(shape) => generated::effect_shape_to_structural(&shape), - None => StructuralEffectShape::UnknownEffect { - reason: "std.effects operation anchors unavailable".to_string(), - }, - } - } -} - -/// Unused-parameters lens. Authority lives in `src/v3/lenses/unused_parameters.dag`; -/// the Rust projection is emitted into `lens_unused_parameters_generated.rs` and -/// wrapped here inline (same host pattern as `lens_cost` / `lens_provenance`). -pub mod lens_unused_parameters { - use crate::dag::{NodeId, PortId}; - use crate::Dag; - - mod generated { - #![allow( - dead_code, - unused_imports, - unused_parens, - unused_variables, - clippy::clone_on_copy, - clippy::collapsible_else_if - )] - - use crate::dag::*; - use crate::diagnostics::*; - - include!("lens_unused_parameters_generated.rs"); - } - - #[derive(Debug, Clone, Default)] - pub struct UnusedParametersConfig {} - - #[derive(Debug, Clone)] - pub struct UnusedParameter { - pub function: NodeId, - pub parameter: PortId, - pub parameter_index: usize, - } - - pub struct UnusedParametersLens<'a> { - dag: &'a Dag, - } - - impl<'a> UnusedParametersLens<'a> { - pub fn new(dag: &'a Dag) -> Self { - Self { dag } - } - - pub fn query(&self, _config: &UnusedParametersConfig) -> Vec { - generated::check(self.dag) - .into_iter() - .map(|violation| UnusedParameter { - function: violation.function, - parameter: violation.parameter, - parameter_index: usize::try_from(violation.parameter_index) - .expect("compiled lens should emit non-negative parameter indexes"), - }) - .collect() - } - } - - #[cfg(test)] - mod tests { - use super::{UnusedParametersConfig, UnusedParametersLens}; - use crate::dag::{ - literal_bits_int, BranchPattern, Dag, LoopBound, Path, PortId, TransformTarget, - }; - use crate::diagnostics::SourceSpan; - use crate::operators::{ArithmeticOp, ComparisonOp, OperatorKind}; - - const DIRECT_DAG_FILE: &str = "lens_unused_parameters.unit"; - - fn span() -> SourceSpan { - SourceSpan::new(DIRECT_DAG_FILE, 0, 0) - } - - fn unused_parameter_indexes(dag: &Dag) -> Vec { - let lens = UnusedParametersLens::new(dag); - let mut indexes: Vec<_> = lens - .query(&UnusedParametersConfig::default()) - .into_iter() - .map(|violation| violation.parameter_index) - .collect(); - indexes.sort_unstable(); - indexes - } - - fn int_value(dag: &mut Dag, value: i64) -> PortId { - dag.push_value(literal_bits_int(value), span()) - } - - fn add(dag: &mut Dag, lhs: PortId, rhs: PortId) -> PortId { - dag.push_transform( - TransformTarget::Operator(OperatorKind::Arithmetic(ArithmeticOp::Add)), - vec![lhs, rhs], - span(), - ) - } - - fn gt(dag: &mut Dag, lhs: PortId, rhs: PortId) -> PortId { - dag.push_transform( - TransformTarget::Operator(OperatorKind::Comparison(ComparisonOp::Gt)), - vec![lhs, rhs], - span(), - ) - } - - fn int_params(dag: &mut Dag, count: usize) -> Vec { - let int_shape = dag.int_shape().expect("bootstrap Dag has Int"); - (0..count) - .map(|_| dag.alloc_port_with_shape(int_shape)) - .collect() - } - - fn producer_or_bind(dag: &mut Dag, name: &str, output: PortId) -> crate::dag::NodeId { - dag.port(output) - .produced_by - .unwrap_or_else(|| dag.push_bind(name, output, Vec::new(), span())) - } - - fn bind_arm(dag: &mut Dag, name: &str, output: PortId) -> Path { - Path { - body: producer_or_bind(dag, name, output), - output, - pattern: BranchPattern::UnresolvedVariant { - name: name.to_string(), - span: span(), - }, - binding: None, - } - } - - fn function_dag(name: &str, param_count: usize, build_body: F) -> Dag - where - F: FnOnce(&mut Dag, &[PortId]) -> PortId, - { - let mut dag = Dag::new(); - let params = int_params(&mut dag, param_count); - let value = build_body(&mut dag, ¶ms); - dag.push_bind(name, value, params, span()); - dag - } - - #[test] - fn unused_params_empty_for_function_using_every_parameter() { - let dag = function_dag("add", 2, |dag, params| add(dag, params[0], params[1])); - - assert_eq!(unused_parameter_indexes(&dag), Vec::::new()); - } - - #[test] - fn unused_params_reports_single_unused_parameter() { - let dag = function_dag("first", 2, |_dag, params| params[0]); - - assert_eq!(unused_parameter_indexes(&dag), vec![1]); - } - - #[test] - fn unused_params_reports_all_parameters_for_constant_body() { - let dag = function_dag("always_one", 3, |dag, _params| int_value(dag, 1)); - - assert_eq!(unused_parameter_indexes(&dag), vec![0, 1, 2]); - } - - #[test] - fn unused_params_skips_value_bindings() { - let mut dag = Dag::new(); - let lhs = int_value(&mut dag, 1); - let rhs = int_value(&mut dag, 2); - let value = add(&mut dag, lhs, rhs); - dag.push_bind("x", value, Vec::new(), span()); - - assert_eq!(unused_parameter_indexes(&dag), Vec::::new()); - } - - #[test] - fn unused_params_handles_branch_in_body() { - let dag = function_dag("pick", 2, |dag, params| { - let zero = int_value(dag, 0); - let cond = gt(dag, params[0], zero); - let then_path = bind_arm(dag, "then_arm", params[0]); - let else_path = bind_arm(dag, "else_arm", params[1]); - dag.push_branch(cond, vec![then_path, else_path], span()) - }); - - assert_eq!(unused_parameter_indexes(&dag), Vec::::new()); - } - - #[test] - fn unused_params_bootstrap_baseline_is_empty() { - let dag = Dag::new(); - assert_eq!(unused_parameter_indexes(&dag), Vec::::new()); - } - - #[test] - fn unused_params_reports_unused_in_branch_body() { - let dag = function_dag("always_a", 2, |dag, params| { - let zero = int_value(dag, 0); - let cond = gt(dag, params[0], zero); - let then_path = bind_arm(dag, "then_arm", params[0]); - let else_path = bind_arm(dag, "else_arm", params[0]); - dag.push_branch(cond, vec![then_path, else_path], span()) - }); - - assert_eq!(unused_parameter_indexes(&dag), vec![1]); - } - - #[test] - fn unused_params_descends_into_loop_body_for_recursive_calls() { - let dag = function_dag("count_down", 2, |dag, params| { - let body_output = add(dag, params[0], params[1]); - let count = int_value(dag, 1); - let body = producer_or_bind(dag, "loop_body", body_output); - dag.push_loop( - params[0], - params[1], - body, - LoopBound::Cardinality { count }, - span(), - ) - }); - - assert_eq!(unused_parameter_indexes(&dag), Vec::::new()); - } - - #[test] - fn unused_params_loop_body_descent_finds_param_only_used_in_recursion() { - let dag = function_dag("count_down", 2, |dag, params| { - let body_output = add(dag, params[0], params[1]); - let init = int_value(dag, 0); - let count = int_value(dag, 1); - let body = producer_or_bind(dag, "loop_body", body_output); - dag.push_loop( - params[0], - init, - body, - LoopBound::Cardinality { count }, - span(), - ) - }); - - assert_eq!(unused_parameter_indexes(&dag), Vec::::new()); - } - } -} - -pub mod boundary_emit_gates; -mod bounded_host_command; -pub mod emit_host_bridge; -pub mod emit_host_eval; -/// DB-8 / m1_3 / R1C-E: shared `PROGRAM_FIXTURES` + reflected harness table. -pub mod emit_rust_roundtrip_fixtures; -pub mod post_emit_verifier; -pub mod r1c_e_gates; -pub mod test_runner; -pub mod wall_clock_ratchet_manifest; -pub mod serialize { - use crate::dag::{Behavior, Dag}; - use crate::diagnostics::Diagnostic; - - include!("serialize_generated.rs"); -} -pub mod types { - use crate::dag::DeclarationId; - - include!("types_generated.rs"); -} -pub mod parse_surface { - use crate::diagnostics::SourceSpan; - use crate::operators::OperatorKind; - - include!("parse_surface_generated.rs"); -} - -pub use regen_bootstrap_emit::{render_bootstrap_generated_rs, render_bootstrap_std_generated_rs}; - -/// Operator symbols and `algebra_field_name` projections. -/// -/// **Single authority:** `src/v3/compiler/operators.dag` → `operators_generated.rs` -/// (see the generated file header; do not add a parallel hand-written -/// `operators.rs` — reviewers sometimes misread the crate layout that way). -pub mod operators { - pub use crate::dag::{ArithmeticOp, ComparisonOp, LogicalOp, OperatorKind}; - - mod generated { - #![allow( - dead_code, - unused_imports, - unused_parens, - unused_variables, - clippy::clone_on_copy, - clippy::collapsible_else_if - )] - - use crate::dag::{ArithmeticOp, ComparisonOp, LogicalOp, OperatorKind}; - - include!("operators_generated.rs"); - } - - pub use generated::{algebra_field_name, from_symbol, symbol}; -} - -/// SG-2c grammar-tables prototype (SG-2c-1 binary ops, SG-2c-2 item-keyword -/// dispatch, SG-2c-3 type-RHS boundary keywords, SG-2c-4 brackets, SG-2c-5 soft -/// keyword idents, SG-2c-6/7 `parse_primary` prefix + atom cluster). -/// Authority: `src/v3/compiler/parse_tables.dag`. -/// The generated Rust projection is emitted by `regen_parse_tables` and consumed -/// from `parse_parser_body.txt` so the parser no longer open-codes token → operator -/// matches or keyword membership tables for top-level type lookahead. Full parser authority (SG-2c -/// proper) is blocked on recursive list-body emission over `List`; see -/// `parse_tables.dag` header for the dissolution trigger. -pub mod parse_tables { - #![allow( - dead_code, - unused_imports, - unused_parens, - clippy::clone_on_copy, - clippy::collapsible_else_if - )] - - include!("parse_tables_generated.rs"); -} - -/// Complexity lens. The authority lives in `src/v3/lenses/complexity.dag`; -/// the generated surface now returns `Lookup` via -/// `complexity_of`. `cost_of` below is a compatibility adapter for older -/// structural-depth test-runner paths; new consumers should read -/// `complexity_of`. -pub mod lens_cost { - #[allow( - dead_code, - unused_imports, - unused_parens, - unused_variables, - clippy::clone_on_copy, - clippy::collapsible_else_if, - clippy::double_parens, - clippy::eq_op, - clippy::large_enum_variant - )] - mod generated { - // Regen can emit a redundant paren around some `Hit(...)` payload - // subexpressions (`Hit((1 + n))` vs `Hit(1 + n)`) — relax until emission - // drops one stable layer of grouping. - use crate::complexity_lattice::complexity_enforcement_budget_dominates as asymptotic_dominates; - use crate::dag::*; - use crate::diagnostics::*; - use crate::lens_t_las_carrier::{ - EnforceableLens, Lens, LensEnforcement, Monoid, OptionalDiagnostic, - }; - use crate::ViolatesSubject; - use crate::Witness; - - include!("complexity_lens_generated.rs"); - } - - pub use generated::{ - complexity_enforcement_project, complexity_enforcement_violates, complexity_of, - complexity_summary_work_class_consistent, Certainty, ComplexityEntry, ComplexitySummary, - DominanceOutcome, - }; - pub type ComplexityLookup = crate::dag::Lookup; - - #[cfg(test)] - mod complexity_summary_work_class_consistent_tests { - use super::{complexity_summary_work_class_consistent, Certainty, ComplexitySummary}; - use crate::dag::{AsymptoticClass, PortId, SizeVariable, SymbolicCost}; - - #[test] - fn rejects_under_reported_asymptotic_class_class_log_vs_classified_linear_work() { - let summary = ComplexitySummary { - work: SymbolicCost::LinearCost { - _0: SizeVariable { - source_port: PortId::test_raw(1), - display_name: None, - }, - }, - span: SymbolicCost::ConstantCost { _0: 0 }, - asymptotic_class: AsymptoticClass::ClassLog, - work_certainty: Certainty::Proven, - span_certainty: Certainty::Proven, - }; - assert!( - !complexity_summary_work_class_consistent(&summary), - "stored ClassLog must not cover classified ClassLinear work" - ); - } - - #[test] - fn accepts_stored_class_covering_classified_work_class_linear_covers_log_work() { - let summary = ComplexitySummary { - work: SymbolicCost::LogCost { - _0: SizeVariable { - source_port: PortId::test_raw(2), - display_name: None, - }, - }, - span: SymbolicCost::ConstantCost { _0: 0 }, - asymptotic_class: AsymptoticClass::ClassLinear, - work_certainty: Certainty::Proven, - span_certainty: Certainty::Proven, - }; - assert!(complexity_summary_work_class_consistent(&summary)); - } - } - - /// Back-compat projection for pre-`ComplexitySummary` callers that still - /// assert the old structural depth integer. This is not the behavioral - /// completion surface. - pub type CostLookup = crate::dag::Lookup; - - pub fn cost_of(dag: &crate::dag::Dag, port: &crate::dag::PortId) -> CostLookup { - legacy_lookup_cost(&legacy_compute_costs(dag), port) - } - - fn legacy_compute_costs(dag: &crate::dag::Dag) -> Vec<(crate::dag::PortId, CostLookup)> { - dag.nodes() - .iter() - .fold(legacy_seed_bind_params(dag.nodes()), |mut acc, behavior| { - acc.insert(0, legacy_entry_for(dag, &acc, behavior)); - acc - }) - } - - fn legacy_seed_bind_params( - nodes: &[crate::dag::Behavior], - ) -> Vec<(crate::dag::PortId, CostLookup)> { - let mut out = Vec::new(); - for behavior in nodes { - if let crate::dag::Behavior::Bind(bind) = behavior { - for param in &bind.params { - out.insert(0, (*param, CostLookup::Hit(0))); - } - } - } - out - } - - fn legacy_entry_for( - _dag: &crate::dag::Dag, - acc: &[(crate::dag::PortId, CostLookup)], - behavior: &crate::dag::Behavior, - ) -> (crate::dag::PortId, CostLookup) { - use crate::dag::Behavior; - match behavior { - Behavior::Value(v) => (v.result_port(), CostLookup::Hit(0)), - Behavior::Transform(t) => ( - t.result_port(), - legacy_add_one(&legacy_sum_costs(acc, &t.inputs)), - ), - Behavior::Branch(b) => ( - b.result_port(), - legacy_add_one(&legacy_add_cost( - &legacy_lookup_cost(acc, &b.input), - &legacy_max_path_cost(acc, &b.paths), - )), - ), - Behavior::Loop(l) => ( - l.result_port(), - legacy_add_one(&legacy_add_cost( - &legacy_lookup_cost(acc, &l.source), - &legacy_lookup_cost(acc, &l.init), - )), - ), - Behavior::Bind(bind) => ( - bind.result_port(), - legacy_lookup_cost(acc, &bind.result_port()), - ), - } - } - - fn legacy_sum_costs( - acc: &[(crate::dag::PortId, CostLookup)], - ports: &[crate::dag::PortId], - ) -> CostLookup { - ports.iter().fold(CostLookup::Hit(0), |sum, port_id| { - legacy_add_cost(&sum, &legacy_lookup_cost(acc, port_id)) - }) - } - - fn legacy_max_path_cost( - acc: &[(crate::dag::PortId, CostLookup)], - paths: &[crate::dag::Path], - ) -> CostLookup { - paths.iter().fold(CostLookup::Hit(0), |best, path| { - legacy_max_cost(&best, &legacy_lookup_cost(acc, &path.result_port())) - }) - } - - fn legacy_lookup_cost( - acc: &[(crate::dag::PortId, CostLookup)], - port_id: &crate::dag::PortId, - ) -> CostLookup { - acc.iter() - .find(|(port, _)| port == port_id) - .map(|(_, cost)| cost.clone()) - .unwrap_or(CostLookup::Miss) - } - - fn legacy_add_one(c: &CostLookup) -> CostLookup { - match c { - CostLookup::Miss => CostLookup::Miss, - CostLookup::Hit(n) => CostLookup::Hit(n + 1), - } - } - - fn legacy_add_cost(a: &CostLookup, b: &CostLookup) -> CostLookup { - match a { - CostLookup::Miss => CostLookup::Miss, - CostLookup::Hit(x) => match b { - CostLookup::Miss => CostLookup::Miss, - CostLookup::Hit(y) => CostLookup::Hit(x + y), - }, - } - } - - fn legacy_max_cost(a: &CostLookup, b: &CostLookup) -> CostLookup { - match a { - CostLookup::Miss => CostLookup::Miss, - CostLookup::Hit(x) => match b { - CostLookup::Miss => CostLookup::Miss, - CostLookup::Hit(y) => CostLookup::Hit((*x).max(*y)), - }, - } - } - - #[cfg(test)] - mod tests { - use super::{cost_of, CostLookup}; - use crate::dag::{ - literal_bits_int, ArithmeticOp, BranchPattern, Dag, LiteralBits, LoopBound, - OperatorKind, Path, PortId, TransformTarget, - }; - use crate::diagnostics::SourceSpan; - - fn span() -> SourceSpan { - SourceSpan::new("", 0, 0) - } - - fn expect_found(lookup: CostLookup) -> i64 { - match lookup { - CostLookup::Hit(c) => c, - CostLookup::Miss => panic!("expected Hit, got Miss"), - } - } - - fn assert_cost(dag: &Dag, port: PortId, expected: i64) { - assert_eq!(expect_found(cost_of(dag, &port)), expected); - } - - fn int_value(dag: &mut Dag, value: i64) -> PortId { - dag.push_value(literal_bits_int(value), span()) - } - - fn add(dag: &mut Dag, lhs: PortId, rhs: PortId) -> PortId { - dag.push_transform( - TransformTarget::Operator(OperatorKind::Arithmetic(ArithmeticOp::Add)), - vec![lhs, rhs], - span(), - ) - } - - fn bind_arm(dag: &mut Dag, name: &str, output: PortId) -> Path { - Path { - body: dag.push_bind(name, output, Vec::new(), span()), - output, - pattern: BranchPattern::UnresolvedVariant { - name: name.to_string(), - span: span(), - }, - binding: None, - } - } - - #[test] - fn value_port_has_zero_cost() { - let mut dag = Dag::new(); - let port = dag.push_value(literal_bits_int(7), span()); - assert_cost(&dag, port, 0); - } - - #[test] - fn transform_adds_one_to_sum_of_input_costs() { - let mut dag = Dag::new(); - let a = dag.push_value(literal_bits_int(1), span()); - let b = dag.push_value(literal_bits_int(2), span()); - let sum = dag.push_transform( - TransformTarget::Operator(OperatorKind::Arithmetic(ArithmeticOp::Add)), - vec![a, b], - span(), - ); - assert_cost(&dag, sum, 1); - } - - #[test] - fn chained_transforms_accumulate_through_input_edges() { - // (1 + 2) + 3: outer transform = 1 + (inner=1) + (literal=0) = 2. - let mut dag = Dag::new(); - let a = dag.push_value(literal_bits_int(1), span()); - let b = dag.push_value(literal_bits_int(2), span()); - let c = dag.push_value(literal_bits_int(3), span()); - let inner = dag.push_transform( - TransformTarget::Operator(OperatorKind::Arithmetic(ArithmeticOp::Add)), - vec![a, b], - span(), - ); - let outer = dag.push_transform( - TransformTarget::Operator(OperatorKind::Arithmetic(ArithmeticOp::Add)), - vec![inner, c], - span(), - ); - assert_cost(&dag, outer, 2); - } - - #[test] - fn branch_cost_is_one_plus_input_plus_max_of_path_outputs() { - // cond=Bool(true) [0], arm=Int(1) [0] → branch = 1 + 0 + 0 = 1. - let mut dag = Dag::new(); - let cond = dag.push_value(LiteralBits::Bool(true), span()); - let arm_output = int_value(&mut dag, 1); - let arm_body = dag.push_bind("arm", arm_output, Vec::new(), span()); - let branch = dag.push_branch( - cond, - vec![Path { - body: arm_body, - output: arm_output, - pattern: BranchPattern::UnresolvedVariant { - name: "Only".to_string(), - span: span(), - }, - binding: None, - }], - span(), - ); - assert_cost(&dag, branch, 1); - } - - #[test] - fn branch_cost_uses_max_not_sum_across_paths() { - let mut dag = Dag::new(); - let cond = dag.push_value(LiteralBits::Bool(true), span()); - let cheap = int_value(&mut dag, 20); - let forty = int_value(&mut dag, 40); - let fifty = int_value(&mut dag, 50); - let pricey = add(&mut dag, forty, fifty); - let sixty = int_value(&mut dag, 60); - let pricier = add(&mut dag, pricey, sixty); - let paths = vec![ - bind_arm(&mut dag, "cheap_arm", cheap), - bind_arm(&mut dag, "pricier_arm", pricier), - ]; - let branch = dag.push_branch(cond, paths, span()); - - // branch = 1 + cond(0) + max(cheap=0, pricier=((40+50)+60)=2) - assert_cost(&dag, branch, 3); - } - - #[test] - fn loop_cost_is_one_plus_source_plus_init() { - let mut dag = Dag::new(); - let source = dag.push_value(literal_bits_int(4), span()); - let init = dag.push_value(literal_bits_int(0), span()); - let body_output = dag.push_value(literal_bits_int(0), span()); - let body = dag.push_bind("loop_body", body_output, Vec::new(), span()); - let loop_port = dag.push_loop( - source, - init, - body, - LoopBound::Cardinality { count: source }, - span(), - ); - assert_cost(&dag, loop_port, 1); - } - - #[test] - fn bind_cost_tracks_body_value_cost() { - // let x = 1 + 2: bind.value is the Add transform (cost 1). - let mut dag = Dag::new(); - let a = dag.push_value(literal_bits_int(1), span()); - let b = dag.push_value(literal_bits_int(2), span()); - let body = dag.push_transform( - TransformTarget::Operator(OperatorKind::Arithmetic(ArithmeticOp::Add)), - vec![a, b], - span(), - ); - let _ = dag.push_bind("x", body, Vec::new(), span()); - assert_cost(&dag, body, 1); - } - - #[test] - fn bind_params_seed_as_zero_cost_and_body_costs_accumulate() { - // fn double(x) = x + x: body transform reads x twice. Each param - // port is seeded to cost 0, so body cost = 1 + 0 + 0 = 1. - let mut dag = Dag::new(); - let int_shape = dag.int_shape().expect("bootstrap Int"); - let x = dag.alloc_port_with_shape(int_shape); - let body = dag.push_transform( - TransformTarget::Operator(OperatorKind::Arithmetic(ArithmeticOp::Add)), - vec![x, x], - span(), - ); - let _ = dag.push_bind("double", body, vec![x], span()); - - // Parameter ports look up against the seeded entries. - assert_cost(&dag, x, 0); - assert_cost(&dag, body, 1); - } - } -} - -/// Symbolic-cost lens (Lane 2 Stage 2d / DB-7). Authority lives in -/// `src/v3/lenses/cost.dag`; the Rust projection is auto-emitted -/// into `src/v3/compiler/src/cost_symbolic_lens_generated.rs` and -/// re-exported so callers use `v3_compiler::lens_cost_symbolic::*`. -/// -/// **Dual gate #104 witness entrypoints — different contracts:** -/// - **[`symbolic_cost_of`]** is **port-keyed**: runs typed [`crate::dag::Dag::resolve_producer_lookup`] -/// and may return **malformed-substrate** [`Witness::Violates`](crate::dimension::Witness::Violates) -/// with [`ViolatesSubject`](crate::dimension::ViolatesSubject) (**`ProducerLookupMissingPort`** / -/// **`ProducerLookupMissingNode`**, or **`AtBehavior`** for **`BindCycle`**), or **`NoProducer`** with -/// table **`Hit` → `Inhabits`** / **`Miss` → `UnknownCost`**. -/// - **`Lens.read`** is implemented by the generated **`cost_lens_read`** (same fold + table as this -/// module): caller supplies subject **`Behavior`** `b`; it runs **`lookup_cost(compute_symbolic_costs(..), -/// behavior_result_port(b))`**, and on table **`Miss`** uses [`Witness::Violates`](crate::dimension::Witness::Violates) with -/// **`subject: ViolatesSubject::AtBehavior(b)`** — it does **not** re-run **`resolve_producer_lookup`**, -/// so it never emits the producer-walk malformed reasons (facts attach to the behavior the caller is -/// pinning). -/// -/// The `SymbolicCost` + `SizeVariable` carriers live in -/// `src/v3/compiler/src/dag.rs` rather than the generated module -/// because they're declared in `src/v3/std/algebra.dag`, which -/// `emit_rust_module`'s `is_bootstrap_file` filter excludes from -/// type emission. The hand-maintained Rust mirror adjacent to -/// `Behavior` / `LoopBound` follows the same substrate-ownership -/// pattern the other bootstrap-resident types use. -pub mod lens_cost_symbolic { - #[allow( - dead_code, - unused_imports, - unused_parens, - unused_variables, - clippy::clone_on_copy, - clippy::collapsible_else_if, - clippy::deref_addrof, - clippy::eq_op - )] - mod generated { - use crate::dag::*; - use crate::diagnostics::*; - use crate::lens_t_las_carrier::{ - EnforceableLens, Lens, LensEnforcement, Monoid, OptionalDiagnostic, - }; - use crate::ViolatesSubject; - use crate::Witness; - - include!("cost_symbolic_lens_generated.rs"); - } - - pub use generated::{ - transform_cost_for_target, CostBasisDeclaration, CostBasisKind, SymbolicCostEntry, - }; - - /// Same fold order as regen’d [`generated::compute_symbolic_costs`], plus - /// [`crate::dag::collapse_unary_bind_tail_iterate_linear_product_if_duplicate_induction`] on - /// each `Hit` row **before it enters the fold accumulator** (P5 receipt: `ROADMAP.md` - /// Post-merge debt (2026-05-08), **R3 gate #78**). - /// - /// The generated lens reads operand costs via [`generated::lookup_cost`] against entries built - /// earlier in the fold; applying collapse only after the full vector would leave those lookups - /// observing uncollapsed `ProductCost` shells (facts-forward / single-authority for composed - /// rows). - /// - /// **Single public folded table.** [`compute_symbolic_costs`] is the normalization authority - /// (P2): [`generated::compute_symbolic_costs`] plus the collapse pass above. - pub fn compute_symbolic_costs(dag: &crate::dag::Dag) -> Vec { - use crate::dag::Lookup; - - dag.nodes() - .iter() - .fold(generated::seed_bind_params(dag.nodes()), |fold_acc, fold_item| { - let mut row = generated::entry_for(dag, &fold_acc, fold_item); - let port = row.port; - row.cost = match row.cost { - Lookup::Miss => Lookup::Miss, - Lookup::Hit(c) => Lookup::Hit( - crate::dag::collapse_unary_bind_tail_iterate_linear_product_if_duplicate_induction( - dag, port, c, - ), - ), - }; - let mut list = fold_acc.clone(); - list.insert(0, row); - list - }) - } - - /// Port-only [`Witness`](crate::dimension::Witness) over [`SymbolicCost`] (R3 §1.8 gate #104). - /// - /// Uses [`crate::dag::Dag::resolve_producer_lookup`] (typed walk) — **not** - /// [`crate::dag::Dag::resolve_producer_opt`], which merges legitimate `NoProducer` with malformed - /// substrate (`MissingPort` / `MissingNode` / `BindCycle`) into `None` (INVARIANTS P3 forbids that - /// collapse here). - /// - /// - [`ProducerLookup::Found`]: merges table lookup via [`generated::witness_from_symbolic_cost_lookup`] - /// (lawful `Violates` on table **`Miss`** uses [`ViolatesSubject::AtBehavior`] with the resolved producer). - /// - [`ProducerLookup::NoProducer`]: **INVARIANTS P2** — still consult the **same** `folded` - /// [`generated::lookup_cost`] as `Found`. Table **`Hit`** (e.g. bind-parameter seeds from - /// [`generated::seed_bind_params`]) flows forward as **`Inhabits`**. Only plain parameters / - /// externals with **no** folded row (**`Miss`**) use **`Inhabits(UnknownCost("…"))`** — not - /// substrate corruption and not a fake `Violates`. - /// - Malformed substrate: **`Violates { reason, subject }`** ([`ViolatesSubject`]) — - /// **no fabricated unrelated [`Behavior`].** **`BindCycle`** uses **`AtBehavior(dag.node(detected_at))`** - /// (detected Bind). **`MissingPort`** / **`MissingNode`** carry only the offending [`PortId`] / - /// [`NodeId`] residue from the walker. When projecting to IDE diagnostics from this **port-keyed** - /// query, compose spans with **`Some(port)`** via [`crate::violates_subject_diagnostic_span`] so producer-walk residues can anchor like [`ViolatesSubject::AtBehavior`] when the keyed port declares a lawful producer. - /// - /// Uses normalized [`compute_symbolic_costs`] for [`generated::lookup_cost`]. - /// - /// [`ProducerLookup::Found`]: crate::dag::ProducerLookup::Found - /// [`ProducerLookup::NoProducer`]: crate::dag::ProducerLookup::NoProducer - /// [`ProducerLookup::MissingPort`]: crate::dag::ProducerLookup::MissingPort - /// [`ProducerLookup::MissingNode`]: crate::dag::ProducerLookup::MissingNode - /// [`ProducerLookup::BindCycle`]: crate::dag::ProducerLookup::BindCycle - /// [`ViolatesSubject::AtBehavior`]: crate::dimension::ViolatesSubject::AtBehavior - /// [`ViolatesSubject`]: crate::dimension::ViolatesSubject - /// [`NodeId`]: crate::dag::NodeId - /// [`SymbolicCost`]: crate::dag::SymbolicCost - pub fn symbolic_cost_of( - dag: &crate::dag::Dag, - port: &crate::dag::PortId, - ) -> crate::dimension::Witness { - use crate::dag::ProducerLookup; - use crate::dimension::ViolatesSubject; - - let folded = generated::lookup_cost(&compute_symbolic_costs(dag), port); - match dag.resolve_producer_lookup(port) { - ProducerLookup::Found(subject) => { - generated::witness_from_symbolic_cost_lookup(&folded, subject.clone()) - } - ProducerLookup::NoProducer => match folded { - SymbolicCostLookup::Hit(cost) => crate::dimension::Witness::Inhabits(cost), - SymbolicCostLookup::Miss => { - crate::dimension::Witness::Inhabits(crate::dag::SymbolicCost::UnknownCost { - _0: String::from( - "symbolic_cost_of: no producer for port (parameter or external binding)", - ), - }) - } - }, - ProducerLookup::MissingPort { port: missing } => crate::dimension::Witness::Violates { - reason: format!( - "symbolic_cost_of: malformed substrate — MissingPort {:?}", - missing - ), - subject: ViolatesSubject::ProducerLookupMissingPort { port: missing }, - }, - ProducerLookup::MissingNode { producer } => crate::dimension::Witness::Violates { - reason: format!( - "symbolic_cost_of: malformed substrate — MissingNode {:?}", - producer - ), - subject: ViolatesSubject::ProducerLookupMissingNode { producer }, - }, - ProducerLookup::BindCycle { detected_at } => crate::dimension::Witness::Violates { - reason: format!( - "symbolic_cost_of: malformed substrate — BindCycle at {:?}", - detected_at - ), - subject: ViolatesSubject::AtBehavior(dag.node(detected_at).clone()), - }, - } - } - - /// Table-only [`Lookup`] for one port—the same folded [`compute_symbolic_costs`] facts - /// [`symbolic_cost_of`] inspects—but **without** producer resolution / - /// [`Witness`](crate::dimension::Witness) packaging (algebra-level consumers; dimensional spine). - #[inline] - pub fn symbolic_cost_lookup( - dag: &crate::dag::Dag, - port: &crate::dag::PortId, - ) -> SymbolicCostLookup { - generated::lookup_cost(&compute_symbolic_costs(dag), port) - } - - /// Scan a single port against a table from [`compute_symbolic_costs`]. - /// - /// Callers that need many ports should compute once and use this instead of - /// [`symbolic_cost_lookup`], which rebuilds the full table on every lookup. - #[inline] - pub fn lookup_symbolic_cost( - table: &[SymbolicCostEntry], - port: &crate::dag::PortId, - ) -> SymbolicCostLookup { - generated::lookup_cost(table, port) - } - - /// Alias for [`Lookup`] at [`SymbolicCost`] (`Hit` / `Miss`) over [`compute_symbolic_costs`] rows. - /// - /// [`SymbolicCost`]: crate::dag::SymbolicCost - /// [`Lookup`]: crate::dag::Lookup - pub type SymbolicCostLookup = crate::dag::Lookup; -} - -pub mod memory_peak_cost; - -/// `cost_target_realization.dag` `.dag`-tier consumer of the -/// `declaration_by_name` substrate accessor (T-CostLens-Composition -/// Slice 1a.1; gunb-ai/gunbc#2141 ε scope per gunbc#2181 ratification). -/// Six per-category meta-type `Declaration?` resolvers covering all -/// `*Realization` carriers declared in `src/v3/std/emit_model.dag` -/// (TypeRealization / CallableRealization / OperatorRealization / -/// BehaviorRealization / TypeInstantiationRealization / PatternRealization). -pub mod lens_cost_target_realization { - #[allow( - dead_code, - unused_imports, - unused_parens, - unused_variables, - clippy::clone_on_copy, - clippy::collapsible_else_if - )] - mod generated { - use crate::dag::*; - - include!("lens_cost_target_realization_generated.rs"); - } - - pub use generated::{ - behavior_realization_meta, callable_realization_meta, operator_realization_meta, - pattern_realization_meta, type_instantiation_realization_meta, type_realization_meta, - }; -} - -/// Provenance lens. The authority lives in -/// `src/v3/lenses/provenance.dag`; the Rust projection is auto-emitted -/// into `src/v3/compiler/src/lens_provenance_generated.rs` and wrapped -/// here as a module so callers use `v3_compiler::lens_provenance`. -/// Editing the lens means editing the `.dag` — there is no hand-written -/// implementation on this crate side. -/// -/// Only `Origin` and `origin_of` are re-exported. The generated module -/// also declares internal helper carriers (`PortLookup`, -/// `BehaviorLookup`) and their `find_*` / `behavior_id` walkers, which -/// exist solely because the substrate still exposes `Dag.ports` / -/// `Dag.nodes` as linear lists. Those helpers are bounded scaffolding -/// that dissolves when the substrate grows total keyed `port(id)` / -/// `node(id)` accessors — keeping them crate-private now prevents the -/// tracked-scaffold from leaking into `v3_compiler::lens_provenance`'s -/// public surface and attracting downstream consumers. -pub mod lens_provenance { - #[allow( - dead_code, - unused_imports, - unused_parens, - unused_variables, - clippy::clone_on_copy, - clippy::collapsible_else_if - )] - mod generated { - use crate::dag::*; - use crate::diagnostics::*; - - include!("lens_provenance_generated.rs"); - } - - pub use generated::{origin_of, Origin}; - - #[cfg(test)] - mod tests { - use super::{origin_of, Origin}; - use crate::dag::{ - literal_bits_int, ArithmeticOp, BranchPattern, Dag, LiteralBits, LoopBound, - OperatorKind, Path, TransformTarget, - }; - use crate::diagnostics::SourceSpan; - - fn span() -> SourceSpan { - SourceSpan::new("", 0, 0) - } - - fn label(origin: &Origin) -> &'static str { - match origin { - Origin::NoProducer => "NoProducer", - Origin::MissingPort => "MissingPort", - Origin::MissingBehavior => "MissingBehavior", - Origin::Source { .. } => "Source", - Origin::Computed { .. } => "Computed", - Origin::Selected { .. } => "Selected", - Origin::Accumulated { .. } => "Accumulated", - } - } - - #[test] - fn unproduced_parameter_port_reports_no_producer() { - let mut dag = Dag::new(); - let int_shape = dag.int_shape().expect("bootstrap Int"); - let param = dag.alloc_port_with_shape(int_shape); - assert_eq!(label(&origin_of(&dag, ¶m)), "NoProducer"); - } - - #[test] - fn value_port_reports_source_origin() { - let mut dag = Dag::new(); - let port = dag.push_value(literal_bits_int(1), span()); - assert_eq!(label(&origin_of(&dag, &port)), "Source"); - } - - #[test] - fn transform_port_reports_computed_origin() { - let mut dag = Dag::new(); - let a = dag.push_value(literal_bits_int(1), span()); - let b = dag.push_value(literal_bits_int(2), span()); - let sum = dag.push_transform( - TransformTarget::Operator(OperatorKind::Arithmetic(ArithmeticOp::Add)), - vec![a, b], - span(), - ); - assert_eq!(label(&origin_of(&dag, &sum)), "Computed"); - } - - #[test] - fn branch_port_reports_selected_origin() { - let mut dag = Dag::new(); - let cond = dag.push_value(LiteralBits::Bool(true), span()); - let arm_output = dag.push_value(literal_bits_int(1), span()); - let arm_body = dag.push_bind("arm", arm_output, Vec::new(), span()); - let branch = dag.push_branch( - cond, - vec![Path { - body: arm_body, - output: arm_output, - pattern: BranchPattern::UnresolvedVariant { - name: "Only".to_string(), - span: span(), - }, - binding: None, - }], - span(), - ); - assert_eq!(label(&origin_of(&dag, &branch)), "Selected"); - } - - #[test] - fn loop_port_reports_accumulated_origin() { - let mut dag = Dag::new(); - let source = dag.push_value(literal_bits_int(4), span()); - let init = dag.push_value(literal_bits_int(0), span()); - let body_output = dag.push_value(literal_bits_int(0), span()); - let body = dag.push_bind("loop_body", body_output, Vec::new(), span()); - let loop_port = dag.push_loop( - source, - init, - body, - LoopBound::Cardinality { count: source }, - span(), - ); - assert_eq!(label(&origin_of(&dag, &loop_port)), "Accumulated"); - } - - #[test] - fn bind_value_origin_is_its_producer_not_the_bind_itself() { - // `let x = 1 + 2` — bind.value is the transform output, so - // origin_of(bind.value) walks through to the Transform producer - // and reports Computed. A Bind's own output is only reached - // when something references the Bind node directly. - let mut dag = Dag::new(); - let a = dag.push_value(literal_bits_int(1), span()); - let b = dag.push_value(literal_bits_int(2), span()); - let body = dag.push_transform( - TransformTarget::Operator(OperatorKind::Arithmetic(ArithmeticOp::Add)), - vec![a, b], - span(), - ); - let _ = dag.push_bind("x", body, Vec::new(), span()); - assert_eq!(label(&origin_of(&dag, &body)), "Computed"); - } - } -} - -/// Structural-resolution lens. The authority lives in -/// `src/v3/lenses/structural_resolution.dag`; the Rust projection is -/// auto-emitted into `src/v3/compiler/src/lens_structural_resolution_generated.rs` -/// and wrapped here as a module so callers use -/// `v3_compiler::lens_structural_resolution`. Editing the lens means -/// editing the `.dag` — there is no hand-written implementation on -/// this crate side. -/// -/// Detects leaked `ArrowBody::Pending` in the final Dag. -/// Defense-in-depth regression pin for the R13 fix (see the `.dag` -/// source for the full detection rule and disposal trigger). -pub mod lens_structural_resolution { - #[allow( - dead_code, - unused_imports, - unused_parens, - unused_variables, - clippy::clone_on_copy, - clippy::collapsible_else_if - )] - mod generated { - use crate::dag::*; - use crate::diagnostics::*; - - include!("lens_structural_resolution_generated.rs"); - } - - pub use generated::{check, name_keyed_references, NameKeyedReference, UnresolvedArrowBody}; - - #[cfg(test)] - mod tests { - use super::{check, name_keyed_references, NameKeyedReference, UnresolvedArrowBody}; - use crate::dag::{ArrowBody, AtomPayload, Declaration, DeclarationId, TypeConnective}; - use crate::diagnostics::SourceSpan; - use crate::{compile_to_dag, Dag}; - - fn span() -> SourceSpan { - SourceSpan::new("", 0, 0) - } - - fn inject_named_pending_arrow( - dag: &mut Dag, - name: &str, - output_type: DeclarationId, - ) -> DeclarationId { - let id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id, - name: Some(name.to_string()), - connective: TypeConnective::Arrow { - inputs: Vec::new(), - output: output_type, - body: ArrowBody::Pending, - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span(), - }); - id - } - - fn inject_anonymous_pending_arrow( - dag: &mut Dag, - output_type: DeclarationId, - ) -> DeclarationId { - let id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id, - name: None, - connective: TypeConnective::Arrow { - inputs: Vec::new(), - output: output_type, - body: ArrowBody::Pending, - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span(), - }); - id - } - - fn inject_name_keyed_reference(dag: &mut Dag, target: DeclarationId) -> DeclarationId { - let id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id, - name: None, - connective: TypeConnective::Atom(AtomPayload::ResolvedByName(target)), - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span(), - }); - id - } - - fn violations(dag: &Dag) -> Vec { - check(dag) - } - - fn name_keyed(dag: &Dag) -> Vec { - name_keyed_references(dag) - } - - #[test] - fn lens_flags_named_arrow_pending_injected_into_dag() { - let mut dag = Dag::new(); - let int_output = dag.int_shape().expect("bootstrap Dag has Int").declaration; - let decl_id = inject_named_pending_arrow(&mut dag, "leaked_fn", int_output); - - let found = violations(&dag); - assert_eq!( - found.len(), - 1, - "expected exactly one violation, got {}: {:?}", - found.len(), - found - ); - assert_eq!(found[0].declaration, decl_id); - assert_eq!(found[0].name, "leaked_fn"); - } - - #[test] - fn lens_silent_on_empty_bootstrap_dag() { - let dag = Dag::new(); - let found = violations(&dag); - assert!( - found.is_empty(), - "bootstrap Dag must produce zero violations (algebra arrows are anonymous), got {}: {:?}", - found.len(), - found - ); - } - - #[test] - fn lens_flags_anonymous_arrow_pending_injected_into_dag() { - let mut dag = Dag::new(); - let int_output = dag.int_shape().expect("bootstrap Dag has Int").declaration; - let decl_id = inject_anonymous_pending_arrow(&mut dag, int_output); - - let found = violations(&dag); - assert_eq!( - found.len(), - 1, - "expected exactly one anonymous violation, got {}: {:?}", - found.len(), - found - ); - assert_eq!(found[0].declaration, decl_id); - assert_eq!(found[0].name, ""); - } - - #[test] - fn lens_survives_co_existing_injected_and_compiled_declarations() { - let mut dag = - compile_to_dag("fn good(x: Int) -> Int = x + 1", "user.v3").expect("compiles"); - let int_output = dag.int_shape().expect("Int shape").declaration; - let leak_id = inject_named_pending_arrow(&mut dag, "leaked", int_output); - let found = violations(&dag); - assert_eq!( - found.len(), - 1, - "expected exactly one violation amid real declarations, got {}: {:?}", - found.len(), - found - ); - assert_eq!(found[0].declaration, leak_id); - assert_eq!(found[0].name, "leaked"); - } - - #[test] - fn lens_flags_injected_name_keyed_reference() { - let mut dag = Dag::new(); - let int_id = dag.int_shape().expect("bootstrap Dag has Int").declaration; - let site_id = inject_name_keyed_reference(&mut dag, int_id); - - let found = name_keyed(&dag); - let injected = found - .iter() - .find(|entry| entry.declaration == site_id) - .unwrap_or_else(|| { - panic!( - "expected injected site in name-keyed references, got {}: {:?}", - found.len(), - found - ) - }); - assert_eq!(injected.resolved_to, int_id); - } - } -} - -mod bootstrap; - -pub use bootstrap::BOOTSTRAP_FIXTURE_PATH_KEYS; - -#[cfg(feature = "bootstrap-regen-fresh")] -mod bootstrap_regen_fresh; - -/// Fresh tokenize/parse/lower bootstrap used **only** by `regen_bootstrap` -/// (`--features bootstrap-regen-fresh`). Default `v3-compiler` builds omit this -/// module; production callers load snapshots via `Dag::new()`. -#[cfg(feature = "bootstrap-regen-fresh")] -pub use bootstrap_regen_fresh::{ - compile_full_bootstrap_dag_from_std_seed, - compile_full_bootstrap_without_parse_surface_dag_from_std_seed, compile_std_bootstrap_dag, -}; - -mod cost_basis_declaration; -mod dimension; -mod infer; - -/// SG-4 prep: first .dag-authority slice of `infer.rs`. Authority -/// lives in `src/v3/lenses/infer_helpers.dag`; the Rust projection is -/// auto-emitted into `src/v3/compiler/src/infer_helpers_generated.rs` -/// and consumed by `infer.rs` via -/// `crate::infer_helpers::behavior_output_port`. Editing the helper -/// means editing the `.dag` — there is no hand-written implementation -/// on this crate side. SG-6 owns folding the standalone regen driver -/// and relocating extracted helper modules out of `lenses/` once the -/// consolidated regen target lands. -pub(crate) mod infer_helpers { - #[allow( - dead_code, - unused_imports, - unused_parens, - unused_variables, - clippy::clone_on_copy, - clippy::collapsible_else_if - )] - mod generated { - use crate::dag::*; - use crate::diagnostics::{SourceByteSpan, SourceSpan}; - - include!("infer_helpers_generated.rs"); - } - - pub(crate) use generated::{ - behavior_output_port, normalize_instantiation_arguments, payload_binding_span, - push_template_argument_binding, resolve_template_argument_value, template_argument_value, - template_arguments_match as generated_template_arguments_match, - NormalizedInstantiationArgs, TemplateArgumentBinding, TemplateArgumentsMatch, - }; - - #[cfg(test)] - pub(crate) use generated::filter_non_self_template_arguments; -} - -/// SG-3g-d: `.dag`-authority `expr_span` / `item_span` for surface nodes plus -/// `pattern_binding_names` (see `lenses/lower_helpers.dag`). -/// Consumed from `lower.rs`; `parse_generated.rs` keeps its own `&SourceSpan` helper for -/// parser-local span fusion without cloning. -pub(crate) mod lower_helpers { - use crate::diagnostics::SourceSpan; - - #[allow( - dead_code, - unused_imports, - unused_parens, - unused_variables, - clippy::clone_on_copy, - clippy::collapsible_else_if - )] - mod generated { - use crate::diagnostics::SourceByteSpan; - use crate::parse_surface; - use crate::parse_surface::{SurfaceExpr, SurfaceItem, SurfacePattern}; - - include!("lower_helpers_generated.rs"); - } - - #[allow(unused_imports)] // `item_span` is only referenced from this module's unit tests. - pub(crate) use generated::{expr_span, item_span, pattern_binding_names}; - - /// Full [`SourceSpan`] for a top-level [`SurfaceItem`]: `file` plus byte range, - /// read from the parse surface (`span` on each item shape, or - /// [`crate::parse::expr_span`] for `Let` bodies). - /// - /// Contrast with `expr_span` / `item_span` from `lower_helpers.dag`, which - /// return `SourceByteSpan` only (R3 gate #31 — no `SourceSpan.file` on that - /// lens-generated surface). Callers that need a real diagnostic / declaration - /// span with compilation-unit identity use this helper instead of inventing a - /// span from bytes alone. - pub(crate) fn surface_item_span(item: &crate::parse_surface::SurfaceItem) -> &SourceSpan { - use crate::parse_surface::SurfaceItem; - match item { - SurfaceItem::Let { expr, .. } => crate::parse::expr_span(expr), - SurfaceItem::Fn { span, .. } => span, - SurfaceItem::FnExternalBody { span, .. } => span, - SurfaceItem::Data { span, .. } => span, - SurfaceItem::Module { span, .. } => span, - SurfaceItem::Import { span, .. } => span, - SurfaceItem::TypeAtom { span, .. } => span, - SurfaceItem::TypeRecord { span, .. } => span, - SurfaceItem::TypeSum { span, .. } => span, - SurfaceItem::TypeAlias { span, .. } => span, - } - } - - #[cfg(test)] - mod tests { - use super::{expr_span, item_span, pattern_binding_names}; - use crate::diagnostics::{SourceByteSpan, SourceSpan}; - use crate::parse_surface::{SurfaceExpr, SurfaceItem, SurfacePattern, SurfacePatternField}; - - #[test] - fn expr_span_matches_variant_span_field() { - let span = SourceSpan::new("t.v3", 10, 20); - let e = SurfaceExpr::Literal { - value: crate::parse_surface::SurfaceLiteral::Int("1".into()), - span: span.clone(), - }; - assert_eq!(expr_span(&e), SourceByteSpan::new(10, 20)); - } - - #[test] - fn item_span_matches_item_shape() { - let item_span_value = SourceSpan::new("t.v3", 30, 40); - let expr_span_value = SourceSpan::new("t.v3", 50, 60); - - assert_eq!( - item_span(&SurfaceItem::Let { - name: "x".into(), - type_ann: None, - expr: SurfaceExpr::Literal { - value: crate::parse_surface::SurfaceLiteral::Int("1".into()), - span: expr_span_value.clone(), - }, - }), - SourceByteSpan::new(50, 60) - ); - assert_eq!( - item_span(&SurfaceItem::Fn { - name: "f".into(), - type_params: vec![], - params: vec![], - return_type: crate::parse_surface::SurfaceType::Named { - name: "Int".into(), - span: item_span_value.clone(), - }, - body: SurfaceExpr::Literal { - value: crate::parse_surface::SurfaceLiteral::Int("1".into()), - span: expr_span_value, - }, - span: item_span_value.clone(), - }), - SourceByteSpan::new(30, 40) - ); - } - - #[test] - fn pattern_binding_names_match_pattern_shape() { - let span = SourceSpan::new("t.v3", 10, 20); - assert_eq!( - pattern_binding_names(&SurfacePattern::BareVariant { - name: "None".into(), - span: span.clone(), - }), - Vec::::new() - ); - assert_eq!( - pattern_binding_names(&SurfacePattern::VariantWith { - name: "Some".into(), - binding: "value".into(), - span: span.clone(), - }), - vec!["value".to_string()] - ); - assert_eq!( - pattern_binding_names(&SurfacePattern::VariantFields { - name: "Pair".into(), - fields: vec![ - SurfacePatternField { - name: "left".into(), - binding: "x".into(), - span: span.clone(), - }, - SurfacePatternField { - name: "right".into(), - binding: "y".into(), - span: span.clone(), - }, - ], - span, - }), - vec!["x".to_string(), "y".to_string()] - ); - } - } -} - -/// Back-compat module path for the Stage 2b idempotency lens. -/// -/// The dedicated `lens_idempotency.rs` wrapper retired once the native-Dag -/// bridge collapsed to a single re-export. Keep the module name as an API alias -/// until callers move to the crate-root `analyze_workflow` export. -pub mod lens_idempotency { - #[allow( - dead_code, - unused_imports, - unused_parens, - unused_variables, - clippy::clone_on_copy, - clippy::collapsible_else_if - )] - mod generated { - use crate::dag::*; - use crate::diagnostics::*; - use crate::lens_t_las_carrier::OptionalDiagnostic; - use crate::Witness; - - include!("lens_idempotency_generated.rs"); - } - - /// Stable `(Dag, NodeId)` surface for callers; the emitted regen module uses `&NodeId`. - pub fn analyze_workflow( - dag: &crate::dag::Dag, - workflow_root: crate::dag::NodeId, - ) -> crate::dag::WorkflowIdempotencyReport { - generated::analyze_workflow(dag, &workflow_root) - } -} - -/// Lane 2 Stage 2e parallelism lens. Authority lives in -/// `src/v3/lenses/parallelism.dag`; the Rust projection is auto-emitted into -/// `src/v3/compiler/src/lens_parallelism_generated.rs` and wrapped here so the -/// crate-root compatibility exports use the `.dag` port directly. -pub mod lens_parallelism { - #[allow( - dead_code, - unused_imports, - unused_parens, - unused_variables, - clippy::clone_on_copy, - clippy::collapsible_else_if - )] - mod generated { - use crate::dag::*; - use crate::diagnostics::*; - use crate::lens_t_las_carrier::OptionalDiagnostic; - use crate::Witness; - - include!("lens_parallelism_generated.rs"); - } - - pub use generated::analyze_parallelism; - - pub fn loop_iteration_parallel_emission_indicator( - dag: &crate::dag::Dag, - workflow_root: crate::dag::NodeId, - ) -> i64 { - generated::loop_iteration_parallel_emission_indicator(dag, workflow_root) - } - - pub(crate) fn parallelism_iteration_observed_mode( - dag: &crate::dag::Dag, - workflow_root: crate::dag::NodeId, - ) -> ParallelismMode { - generated::parallelism_iteration_observed_mode(dag, workflow_root) - } - - pub(crate) use generated::ParallelismMode; -} - -// Surface pipeline for this crate (not workspace-root `src/tokenize.rs` / `src/parse.rs`): -// `tokenize.dag` → `regen_tokenize` → `tokenize_generated.rs`, -// `parse_parser_body.txt` → `regen_parse` → `parse_generated.rs` (`parse` module), -// then hand-authored `lower.rs` consumes `parse::SurfaceItem` (including `inhabits`). -mod lower; -#[path = "parse_generated.rs"] -mod parse; -mod pipeline_authority; -mod regen_parse_emit; -mod regen_parse_tables_emit; -#[allow( - dead_code, - unused_imports, - unused_parens, - unused_variables, - clippy::clone_on_copy, - clippy::collapsible_else_if -)] -#[path = "tokenize_generated.rs"] -mod tokenize; - -/// Integration-parity hooks: `byte_matches` / `ScannerCharClass` for substrate-vs-codegen -/// receipts (ROADMAP `char_in_class` interpreter parity row). **Unsupported** for external -/// crates except the in-repo integration harness (`#[doc(hidden)]` per `enforced_lens_application` -/// precedent above). -#[doc(hidden)] -pub use tokenize::{byte_matches, ScannerCharClass}; - -pub use regen_parse_emit::{render_parse_generated_rs, RenderParseGeneratedError}; -pub use regen_parse_tables_emit::{ - render_parse_tables_generated_rs, RenderParseTablesGeneratedError, -}; -pub(crate) mod variant_payload { - #[allow( - dead_code, - unused_imports, - unused_parens, - unused_variables, - clippy::clone_on_copy, - clippy::collapsible_else_if, - clippy::cmp_owned, - clippy::large_enum_variant - )] - mod generated { - use crate::dag::*; - - include!("variant_payload_generated.rs"); - } - - pub(crate) use generated::{ - variant_payload_shape, VariantPayloadShape, VariantPayloadShapeLookup, - }; - - #[cfg(test)] - mod tests { - use super::{variant_payload_shape, VariantPayloadShape, VariantPayloadShapeLookup}; - use crate::dag::{AtomPayload, Dag, Declaration, DeclarationId, Field, TypeConnective}; - use crate::diagnostics::SourceSpan; - - fn span() -> SourceSpan { - SourceSpan::new("", 0, 0) - } - - fn push_payload_decl( - dag: &mut Dag, - name: &str, - fields: Vec<(&str, DeclarationId)>, - ) -> DeclarationId { - let id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id, - name: Some(name.to_string()), - connective: TypeConnective::Conj { - children: fields - .into_iter() - .map(|(label, ty)| Field { - label: label.to_string(), - ty, - }) - .collect(), - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span(), - }); - id - } - - fn shape_for(dag: &Dag, decl: DeclarationId) -> VariantPayloadShape { - match variant_payload_shape(dag, &decl) { - VariantPayloadShapeLookup::Found { _0: shape } => shape, - other => panic!("expected Found(..) payload shape, got {other:?}"), - } - } - - fn dag_with_int_decl() -> (Dag, DeclarationId) { - let dag = Dag::new(); - let int_decl = dag.int_shape().expect("bootstrap Int shape").declaration; - (dag, int_decl) - } - - fn push_atom_decl(dag: &mut Dag) -> DeclarationId { - let atom = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: atom, - name: Some("AtomPayload".to_string()), - connective: TypeConnective::Atom(AtomPayload::TypeParam("AtomPayload".to_string())), - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span(), - }); - atom - } - - #[test] - fn variant_payload_shape_cements_empty_product_payload() { - let (mut dag, _) = dag_with_int_decl(); - let empty = push_payload_decl(&mut dag, "EmptyPayload", Vec::new()); - assert!( - matches!(shape_for(&dag, empty), VariantPayloadShape::Empty), - "zero-field Conj payloads are empty variants" - ); - } - - #[test] - fn variant_payload_shape_cements_positional_single_payload() { - let (mut dag, int_decl) = dag_with_int_decl(); - let positional = push_payload_decl(&mut dag, "TuplePayload", vec![("_0", int_decl)]); - assert!( - matches!( - shape_for(&dag, positional), - VariantPayloadShape::PositionalSingle - ), - "single `_0` field is the positional-single payload convention" - ); - } - - #[test] - fn variant_payload_shape_cements_single_named_field_payload() { - let (mut dag, int_decl) = dag_with_int_decl(); - let named_one = - push_payload_decl(&mut dag, "NamedOnePayload", vec![("value", int_decl)]); - match shape_for(&dag, named_one) { - VariantPayloadShape::NamedFields { _0: fields } => { - assert_eq!(fields, vec!["value".to_string()]); - } - other => panic!("single non-`_0` field must stay named, got {other:?}"), - } - } - - #[test] - fn variant_payload_shape_cements_multi_named_field_payload() { - let (mut dag, int_decl) = dag_with_int_decl(); - let named_many = push_payload_decl( - &mut dag, - "NamedManyPayload", - vec![("left", int_decl), ("right", int_decl)], - ); - match shape_for(&dag, named_many) { - VariantPayloadShape::NamedFields { _0: fields } => { - assert_eq!(fields, vec!["left".to_string(), "right".to_string()]); - } - other => panic!("multi-field payload must stay named, got {other:?}"), - } - } - - #[test] - fn variant_payload_shape_fails_closed_on_missing_declaration() { - let (dag, _) = dag_with_int_decl(); - let missing = DeclarationId::test_raw(u32::MAX); - assert!( - matches!( - variant_payload_shape(&dag, &missing), - VariantPayloadShapeLookup::DeclarationMissing - ), - "missing declaration ids are substrate-integrity failures, not not-a-product" - ); - } - - #[test] - fn variant_payload_shape_reports_non_product_declaration() { - let (mut dag, _) = dag_with_int_decl(); - let atom = push_atom_decl(&mut dag); - assert!( - matches!( - variant_payload_shape(&dag, &atom), - VariantPayloadShapeLookup::NotPayloadProduct - ), - "non-Conj declarations are ordinary non-payload products" - ); - } - } -} -mod r3_fc_lane2_loop_witness; - -pub use cost_basis_declaration::{ - try_build_per_write_log_cost_basis_declaration, CostBasisDeclarationBuildError, -}; -pub use dag::{lane2_workflow_idempotency_report, report_unsupported_workflow_variant}; -pub use dag::{Dag, NodeId}; -pub use diagnostics::{Diagnostic, SourceSpan, LAYER1_DIAGNOSTIC_KIND_LABELS}; -pub use emit::{EmitDispatchError, EmitMode, EmitTarget, EmittedSource}; -pub use emit_rust::EmitError; -/// Lane 2 Stage 2b — supported public surface: [`analyze_workflow`] is the -/// primary entry; [`report_unsupported_workflow_variant`] and -/// [`lane2_workflow_idempotency_report`] are additionally exported so -/// `emit_rust_module(idempotency.dag)` output can link in rustc round-trip -/// tests. Composition helpers such as `compose_operation_effects` / -/// `operation_to_breaker` are **not** re-exported: naming and algebra authority -/// live in `src/v3/std/effects.dag`, and the Rust bridge must not become a -/// parallel public implementation surface beyond these std.effects mirrors. -pub use lens_idempotency::analyze_workflow; -/// Lane 2 Stage 2e — parallel composition safety (`ParallelEffect`); see DB-20. -pub use lens_parallelism::{analyze_parallelism, loop_iteration_parallel_emission_indicator}; - -/// Lane 2 Stage 2f — DB-3 dimension abstraction (`std/dimensions.dag` types; -/// `analyze_symbolic_cost_dimension` is the first migrated lens path). -pub use dimension::{ - analyze_complexity, analyze_symbolic_cost_dimension, behavior_spine_in_node_order, - violates_subject_diagnostic_span, DimensionReport, ViolatesSubject, Witness, -}; - -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum StageSnapshotKind { - Surface, - Text, - Dag, -} - -#[derive(Debug, Clone)] -pub struct StageSnapshot { - pub stage: String, - pub kind: StageSnapshotKind, - pub bytes: Vec, - pub dag: Option, -} - -#[derive(Debug)] -pub enum StageSnapshotError { - Compile(Box), - Emit(Box), - Pipeline(String), -} - -#[derive(Debug)] -pub struct FixedPointMismatch { - pub stage: String, - pub detail: String, -} - -/// Test-only hook: tokenize a source string. Used by the -/// `real_stdlib_parse_smoke` integration test to verify the parser -/// accepts production `dsl/std/*.dag` files before bootstrap migration. -#[doc(hidden)] -pub fn tokenize_for_test(source: &str, file: &str) -> Result, Diagnostic> { - tokenize::tokenize(source, file) -} - -#[doc(hidden)] -pub fn token_is_kw_fn_for_test(token: &tokenize::Token) -> bool { - matches!(token.kind, tokenize::TokenKind::KwFn) -} - -#[doc(hidden)] -pub fn token_is_ident_for_test(token: &tokenize::Token, spelling: &str) -> bool { - matches!(&token.kind, tokenize::TokenKind::Ident(s) if s == spelling) -} - -/// Test-only hook: parse a token stream into a surface module. -#[doc(hidden)] -pub fn parse_for_test( - tokens: &[tokenize::Token], - file: &str, -) -> Result { - parse::parse(tokens, file) -} - -/// Test-only hook: top-level `let` binding names in source order. -#[doc(hidden)] -pub fn surface_top_level_let_names_for_test(module: &parse::SurfaceModule) -> Vec { - module - .items - .iter() - .filter_map(|item| match item { - parse::SurfaceItem::Let { name, .. } => Some(name.clone()), - _ => None, - }) - .collect() -} - -/// Test hook: pipeline stage identifiers in `compile { ... }` order in -/// `pipeline.dag` — the same ordering as `materialize_pipeline_realizations`. -#[doc(hidden)] -pub fn pipeline_compile_order_stage_names() -> Result, String> { - pipeline_authority::pipeline_compile_order_names(&dag::Dag::new()) -} - -/// Top-level compile failure. Distinguishes three structural -/// categories of failure by phase of the pipeline where they occurred. -/// -/// **Dissolution receipt: TERMINAL.** Three variants, each with a -/// structurally distinct payload: -/// - `Tokenize(Diagnostic)`: tokenization produced a single diagnostic; -/// no Dag exists yet, so no Dag payload. -/// - `Parse(Diagnostic)`: parsing produced a single diagnostic; no Dag -/// exists yet. -/// - `Semantic(Dag)`: lowering/inference produced one or more -/// diagnostics; the Dag exists and carries them in its diagnostic -/// table, so it's handed back as the payload for caller inspection. -/// -/// The three variants correspond to three structurally different -/// failure states (no-Dag-yet with a diagnostic vs Dag-with- -/// diagnostic-table). Pattern 2 (variant-is-data) fails because the -/// payloads are different types. Pattern 3 (algebraic-form) doesn't -/// apply — these are failure phases, not algebraic operations. -/// -/// Guardrail G5: there is no `TypeError` variant. Type errors are -/// data on the Dag via the diagnostic table, not fields on the -/// error type. `Semantic(Dag)` is a handoff, not a classification of -/// what went wrong — the caller reads `dag.diagnostics()` for -/// specifics. This is what "fail-closed at the boundary" means in -/// practice: a successful compile returns `Ok(Dag)` with an empty -/// diagnostic table; a failed compile returns `Err(Semantic(Dag))` -/// with a non-empty one. There is no third outcome. -#[allow(clippy::large_enum_variant)] -#[derive(Debug)] -pub enum CompileError { - Tokenize(diagnostics::Diagnostic), - Parse(diagnostics::Diagnostic), - /// Semantic errors. The Dag is included so callers can inspect - /// `dag.diagnostics()` to see what went wrong. `Err(Semantic(_))` - /// means: the compile reached infer, some (>=1) diagnostics were - /// produced, and the result is not usable. - Semantic(Dag), -} - -// `result_large_err`: clippy flags `Result` -// because `CompileError::Semantic(Dag)` carries a `Dag` payload -// (~264 bytes after the M1(3) PR-B-unwind R1 added the realization -// meta cache). Boxing the Dag would touch every pattern-match -// against `CompileError::Semantic` in the test suite, and the -// payload is on the cold failure path where the indirection would -// matter less than the API churn. Targeted `allow` on the function -// signature only — the rest of the crate keeps the lint enforced. -fn is_lenses_complexity_authority_module(module: &parse::SurfaceModule) -> bool { - use crate::parse::SurfaceItem; - module.items.iter().any(|item| { - matches!( - item, - SurfaceItem::Module { path, .. } - if path.len() >= 2 && path[0] == "lenses" && path[1] == "complexity" - ) - }) -} - -fn needs_complexity_lens_authority_prepended(module: &parse::SurfaceModule) -> bool { - use crate::parse::SurfaceItem; - if is_lenses_complexity_authority_module(module) { - return false; - } - module.items.iter().any(|item| { - matches!( - item, - SurfaceItem::Import { path, .. } - if path.len() >= 2 && path[0] == "lenses" && path[1] == "complexity" - ) - }) -} - -fn is_lenses_parallelism_authority_module(module: &parse::SurfaceModule) -> bool { - use crate::parse::SurfaceItem; - module.items.iter().any(|item| { - matches!( - item, - SurfaceItem::Module { path, .. } - if path.len() >= 2 && path[0] == "lenses" && path[1] == "parallelism" - ) - }) -} - -fn needs_parallelism_lens_authority_prepended(module: &parse::SurfaceModule) -> bool { - use crate::parse::SurfaceItem; - if is_lenses_parallelism_authority_module(module) { - return false; - } - module.items.iter().any(|item| { - matches!( - item, - SurfaceItem::Import { path, .. } - if path.len() >= 2 && path[0] == "lenses" && path[1] == "parallelism" - ) - }) -} - -#[allow(clippy::result_large_err)] -pub fn compile_to_dag(source: &str, file: &str) -> Result { - let tokens = tokenize::tokenize(source, file).map_err(CompileError::Tokenize)?; - let surface = parse::parse(&tokens, file).map_err(CompileError::Parse)?; - let mut dag = lower::lower_compile_module( - &surface, - needs_complexity_lens_authority_prepended(&surface), - needs_parallelism_lens_authority_prepended(&surface), - ); - infer::infer(&mut dag); - r3_fc_lane2_loop_witness::apply_authored_lane2_loop_witness(&mut dag, source, file); - if dag.diagnostics().is_empty() { - Ok(dag) - } else { - Err(CompileError::Semantic(dag)) - } -} - -/// Lower `sources` in order into one bootstrap [`Dag`], then infer. -/// -/// Hermetic integration harness when the primary module imports `v4.std.*` peers -/// that M1(2.7) single-file [`compile_to_dag`] cannot load (e.g. `v4.std.patch` for -/// `ConfigPatchRecord` / `config_patch_layer`). Earlier entries are dependency modules; -/// the last entry is the primary module under test. -#[allow(clippy::result_large_err)] -pub fn compile_to_dag_modules_in_order(sources: &[(&str, &str)]) -> Result { - let (primary_source, primary_file) = sources - .last() - .expect("compile_to_dag_modules_in_order requires at least one module"); - let mut dag = Dag::new(); - let user_start = dag.declarations().len(); - for (source, file) in sources { - let tokens = tokenize::tokenize(source, file).map_err(CompileError::Tokenize)?; - let surface = parse::parse(&tokens, file).map_err(CompileError::Parse)?; - lower::lower_into(&mut dag, &surface); - } - lower::finalize_strict_user_lower_range(&mut dag, user_start); - infer::infer(&mut dag); - r3_fc_lane2_loop_witness::apply_authored_lane2_loop_witness( - &mut dag, - primary_source, - primary_file, - ); - if dag.diagnostics().is_empty() { - Ok(dag) - } else { - Err(CompileError::Semantic(dag)) - } -} - -/// Structural witness for integer literal range narrowing: the -/// `IntegerAlgebra` and `TargetCarrier` variant payload [`dag::DeclarationId`]s -/// used to match rows in `rust_grounding_primitives`, derived from std -/// `OrderedRing` / `Semiring` by declaration identity (no template-name -/// string routing). -pub fn integer_literal_routing_witness( - dag: &Dag, - declaration: dag::DeclarationId, -) -> Option<(dag::DeclarationId, dag::DeclarationId)> { - int_literal_ranges::integer_routing_witness_for_decl(dag, declaration) - .map(|w| (w.algebra_variant_ty, w.carrier_variant_ty)) -} - -/// Lower `src/v3/std/parse_surface.dag` for codegen (`regen_parse`, SG-2 staging tests). -/// -/// Unlike [`compile_to_dag`], this starts from a bootstrap Dag that omits the embedded -/// `parse_surface.dag` staged fixture so the fresh parse is first-of-name and can be -/// lowered without duplicate-declaration diagnostics. -#[allow(clippy::result_large_err)] -fn compile_onto_parse_surface_free_bootstrap( - source: &str, - file: &str, -) -> Result { - let tokens = tokenize::tokenize(source, file).map_err(CompileError::Tokenize)?; - let surface = parse::parse(&tokens, file).map_err(CompileError::Parse)?; - let mut dag = Dag::new_without_parse_surface_staged_fixture_bootstrap(); - let user_start = dag.declarations().len(); - lower::lower_into(&mut dag, &surface); - lower::finalize_strict_user_lower_range(&mut dag, user_start); - infer::infer(&mut dag); - r3_fc_lane2_loop_witness::apply_authored_lane2_loop_witness(&mut dag, source, file); - if dag.diagnostics().is_empty() { - Ok(dag) - } else { - Err(CompileError::Semantic(dag)) - } -} - -#[allow(clippy::result_large_err)] -pub fn compile_parse_surface_std_authority_dag( - source: &str, - file: &str, -) -> Result { - compile_onto_parse_surface_free_bootstrap(source, file) -} - -/// PB-1-a generated snapshot helper: load the committed std-fixture -/// bootstrap snapshot without re-running tokenize/parse/lower. -pub fn generated_std_bootstrap_dag() -> Dag { - Dag::std_fixture_bootstrap_snapshot() -} - -pub fn generated_full_bootstrap_dag() -> Dag { - Dag::new() -} - -pub fn generated_full_bootstrap_without_parse_surface_dag() -> Dag { - Dag::new_without_parse_surface_staged_fixture_bootstrap() -} - -pub fn default_fixed_point_source() -> &'static str { - "let x: Int = 1 + 2\nlet y: Int = x + 3\n" -} - -pub fn compile_stage_snapshots( - source: &str, - file: &str, -) -> Result, StageSnapshotError> { - let pipeline_dag = Dag::new(); - if !pipeline_dag.diagnostics().is_empty() { - return Err(StageSnapshotError::Compile(Box::new( - CompileError::Semantic(pipeline_dag), - ))); - } - let pipeline = pipeline_authority::ordered_pipeline_stages(&pipeline_dag) - .map_err(StageSnapshotError::Pipeline)?; - - let tokens = tokenize::tokenize(source, file) - .map_err(CompileError::Tokenize) - .map_err(|error| StageSnapshotError::Compile(Box::new(error)))?; - let surface = parse::parse(&tokens, file) - .map_err(CompileError::Parse) - .map_err(|error| StageSnapshotError::Compile(Box::new(error)))?; - let parse_bytes = format!("{surface:#?}").into_bytes(); - - let mut lower_dag = lower::lower(&surface); - let lower_snapshot = lower_dag.clone(); - let lower_bytes = serialize::serialize_dag(&lower_snapshot); - - infer::infer(&mut lower_dag); - if !lower_dag.diagnostics().is_empty() { - return Err(StageSnapshotError::Compile(Box::new( - CompileError::Semantic(lower_dag.clone()), - ))); - } - - let infer_snapshot = lower_dag.clone(); - let infer_bytes = serialize::serialize_dag(&infer_snapshot); - let emitted = emit::emit(&lower_dag, EmitTarget::Rust) - .map(|source| source.text) - .map_err(|error| match error { - emit::EmitDispatchError::Core(error) => StageSnapshotError::Emit(Box::new(error)), - emit::EmitDispatchError::Python(_) => { - unreachable!("EmitTarget::Rust cannot yield a Python emission error") - } - })?; - - let mut snapshots = Vec::with_capacity(pipeline.len()); - for stage in pipeline { - let (kind, bytes, dag) = match stage.stage_name.as_str() { - "parse" => (StageSnapshotKind::Surface, parse_bytes.clone(), None), - "lower" => ( - StageSnapshotKind::Dag, - lower_bytes.clone(), - Some(lower_snapshot.clone()), - ), - "infer" => ( - StageSnapshotKind::Dag, - infer_bytes.clone(), - Some(infer_snapshot.clone()), - ), - "compute_ownership" => ( - StageSnapshotKind::Dag, - infer_bytes.clone(), - Some(infer_snapshot.clone()), - ), - "lens_complexity" => ( - StageSnapshotKind::Dag, - infer_bytes.clone(), - Some(infer_snapshot.clone()), - ), - "emit" => (StageSnapshotKind::Text, emitted.clone().into_bytes(), None), - other => { - return Err(StageSnapshotError::Pipeline(format!( - "pipeline stage `{other}` has no Rust snapshot implementation" - ))); - } - }; - - if !snapshot_kind_matches(stage.snapshot_kind, kind) { - return Err(StageSnapshotError::Pipeline(format!( - "pipeline stage `{}` declares snapshot kind {:?} but Rust produced {:?}", - stage.stage_name, stage.snapshot_kind, kind - ))); - } - - snapshots.push(StageSnapshot { - stage: stage.stage_name, - kind, - bytes, - dag, - }); - } - - Ok(snapshots) -} - -pub fn compare_stage_snapshots( - lhs: &[StageSnapshot], - rhs: &[StageSnapshot], -) -> Result<(), FixedPointMismatch> { - if lhs.len() != rhs.len() { - return Err(FixedPointMismatch { - stage: "pipeline".to_string(), - detail: format!( - "stage count mismatch: pass1 has {}, pass2 has {}", - lhs.len(), - rhs.len() - ), - }); - } - - for (left, right) in lhs.iter().zip(rhs.iter()) { - if left.stage != right.stage { - return Err(FixedPointMismatch { - stage: "pipeline".to_string(), - detail: format!( - "stage order mismatch: pass1 has `{}`, pass2 has `{}`", - left.stage, right.stage - ), - }); - } - if left.kind != right.kind { - return Err(FixedPointMismatch { - stage: left.stage.clone(), - detail: format!( - "snapshot kind mismatch at stage `{}`: pass1={:?}, pass2={:?}", - left.stage, left.kind, right.kind - ), - }); - } - if left.bytes == right.bytes { - continue; - } - - let detail = match (&left.dag, &right.dag) { - (Some(lhs_dag), Some(rhs_dag)) => serialize::first_difference(lhs_dag, rhs_dag) - .map(|diff| diff.detail) - .unwrap_or_else(|| first_differing_line(&left.bytes, &right.bytes)), - _ => first_differing_line(&left.bytes, &right.bytes), - }; - return Err(FixedPointMismatch { - stage: left.stage.clone(), - detail, - }); - } - - Ok(()) -} - -fn snapshot_kind_matches( - declared: pipeline_authority::PipelineSnapshotKind, - actual: StageSnapshotKind, -) -> bool { - matches!( - (declared, actual), - ( - pipeline_authority::PipelineSnapshotKind::Surface, - StageSnapshotKind::Surface - ) | ( - pipeline_authority::PipelineSnapshotKind::Dag, - StageSnapshotKind::Dag - ) | ( - pipeline_authority::PipelineSnapshotKind::Text, - StageSnapshotKind::Text - ) - ) -} - -fn first_differing_line(lhs: &[u8], rhs: &[u8]) -> String { - let lhs = String::from_utf8_lossy(lhs); - let rhs = String::from_utf8_lossy(rhs); - for (idx, (left, right)) in lhs.lines().zip(rhs.lines()).enumerate() { - if left != right { - return format!( - "first differing line {}: pass1=`{}`, pass2=`{}`", - idx + 1, - left, - right - ); - } - } - format!( - "snapshot byte-length mismatch: pass1={} bytes, pass2={} bytes", - lhs.len(), - rhs.len() - ) -} -#[cfg(test)] -mod tokenize_ascii_parity_tests { - use super::tokenize::{byte_matches, ScannerCharClass}; - - #[test] - fn ascii_byte_class_predicates_match_std_unicode_ascii_boundary() { - for byte in 0u8..=127 { - assert_eq!( - byte_matches(byte, ScannerCharClass::Whitespace), - byte.is_ascii_whitespace(), - "tokenizer whitespace predicate diverged at byte {byte:#04x}" - ); - - assert_eq!( - byte_matches(byte, ScannerCharClass::Digit), - byte.is_ascii_digit(), - "tokenizer digit predicate diverged at byte {byte:#04x}" - ); - - assert_eq!( - byte_matches(byte, ScannerCharClass::IdentStart), - (byte.is_ascii_alphabetic() || byte == b'_'), - "tokenizer ident-start predicate diverged at byte {byte:#04x}" - ); - - assert_eq!( - byte_matches(byte, ScannerCharClass::IdentContinue), - (byte.is_ascii_alphanumeric() || byte == b'_'), - "tokenizer ident-continue predicate diverged at byte {byte:#04x}" - ); - } - } -} - -/// Signed decimal literals (`-` immediately followed by ASCII digits) for -/// Coercion-Fold interval lowers (`src/v3/spec/rust.dag` Slice B rows). -#[cfg(test)] -mod signed_decimal_int_literal_tests { - use super::tokenize::{tokenize, TokenKind}; - - #[test] - fn minus_digits_lexes_as_single_int_lit_i32_min() { - let tokens = - tokenize("-2147483648", "signed_decimal_int_literal_tests.v3").expect("tokenize"); - assert!( - matches!(tokens.first().map(|t| &t.kind), Some(TokenKind::IntLit(n)) if n == "-2147483648"), - "expected `-2147483648` as one token; got {:?}", - tokens.first().map(|t| &t.kind) - ); - assert!( - matches!(tokens.get(1).map(|t| &t.kind), Some(TokenKind::Eof)), - "expected EOF after literal; got {:?}", - tokens.get(1).map(|t| &t.kind) - ); - } - - #[test] - fn minus_digits_lexes_as_single_int_lit_i64_min() { - let tokens = - tokenize("-9223372036854775808", "signed_decimal_i64_min.v3").expect("tokenize"); - assert!( - matches!(tokens.first().map(|t| &t.kind), Some(TokenKind::IntLit(n)) if n == "-9223372036854775808"), - "expected i64::MIN as one token; got {:?}", - tokens.first().map(|t| &t.kind) - ); - assert!( - matches!(tokens.get(1).map(|t| &t.kind), Some(TokenKind::Eof)), - "expected EOF after literal; got {:?}", - tokens.get(1).map(|t| &t.kind) - ); - } - - #[test] - fn infix_minus_without_whitespace_stays_binary_minus() { - let tokens = tokenize("1-1", "infix_minus.v3").expect("tokenize"); - assert!(tokens.len() >= 4, "expected literal, minus, literal, EOF"); - assert!(matches!(&tokens[0].kind, TokenKind::IntLit(s) if s == "1")); - assert!(matches!(&tokens[1].kind, TokenKind::Minus)); - assert!(matches!(&tokens[2].kind, TokenKind::IntLit(s) if s == "1")); - assert!(matches!(&tokens[3].kind, TokenKind::Eof)); - } - - #[test] - fn ident_minus_digit_without_whitespace_stays_binary_minus() { - let tokens = tokenize("x-1", "ident_minus.v3").expect("tokenize"); - assert!(tokens.len() >= 4, "expected ident, minus, literal, EOF"); - assert!(matches!( - &tokens[0].kind, - TokenKind::Ident(x) if x == "x" - )); - assert!(matches!(&tokens[1].kind, TokenKind::Minus)); - assert!(matches!(&tokens[2].kind, TokenKind::IntLit(s) if s == "1")); - assert!(matches!(&tokens[3].kind, TokenKind::Eof)); - } - - #[test] - fn unary_minus_after_eq_still_merges_digits() { - let tokens = tokenize("=-42", "eq_unary.v3").expect("tokenize"); - assert!(tokens.len() >= 3, "expected Eq, signed literal, EOF"); - assert!(matches!(&tokens[0].kind, TokenKind::Eq)); - assert!(matches!(&tokens[1].kind, TokenKind::IntLit(s) if s == "-42")); - assert!(matches!(&tokens[2].kind, TokenKind::Eof)); - } -} - -/// PB-Runtime / flat-namespace: L1 behavior marker `ValueBehavior` frees bare -/// `Value` for runtime union carriers (`type Value = …` in user or evaluator DAG). -#[cfg(test)] -mod value_behavior_marker_tests { - use crate::dag::Dag; - use crate::{infer, lower, parse, tokenize}; - - #[test] - fn runtime_value_decl_coexists_with_value_behavior_marker() { - let mut dag = Dag::new(); - let marker_id = dag.value_marker().expect("ValueBehavior marker cached"); - let marker_decl = dag - .declaration_by_name("ValueBehavior") - .expect("ValueBehavior declaration present"); - assert_eq!(marker_id, marker_decl.id); - if let Some(runtime_value) = dag.declaration_by_name("Value") { - assert_ne!( - runtime_value.id, marker_id, - "bootstrap bare `Value` must not alias ValueBehavior marker" - ); - assert_eq!( - runtime_value.span.file, "src/v3/std/runtime.dag", - "bootstrap bare `Value`, when present, must be the runtime carrier" - ); - } - - let source = "module test.pb_runtime_value_name_smoke\n\ntype UserValue {}\n"; - let file = "pb_runtime_value_name_smoke.v3"; - let tokens = tokenize::tokenize(source, file).expect("tokenize"); - let surface = parse::parse(&tokens, file).expect("parse"); - let user_start = dag.declarations().len(); - lower::lower_into(&mut dag, &surface); - lower::finalize_strict_user_lower_range(&mut dag, user_start); - infer::infer(&mut dag); - assert!( - dag.diagnostics().is_empty(), - "user non-conflicting type should compile onto bootstrap; diagnostics: {:?}", - dag.diagnostics() - ); - assert_eq!( - dag.value_marker(), - Some(marker_id), - "marker cache must still resolve ValueBehavior after user declarations land" - ); - } -} diff --git a/src/v3/compiler/src/lower.rs b/src/v3/compiler/src/lower.rs deleted file mode 100644 index 2c0c7737bd7..00000000000 --- a/src/v3/compiler/src/lower.rs +++ /dev/null @@ -1,13220 +0,0 @@ -// Surface → Dag lowering. -// -// Two-pass. Pass 1 walks all top-level items and allocates placeholder -// Declarations for each named type/fn, populating a symbol table -// (name → DeclarationId). Pass 2 fills in each declaration's connective -// and lowers function/let bodies to L1 behaviors, using the symbol table -// to resolve identifier references. See M1_DESIGN.md §8.1. -// -// Computation-side lowering follows M0 semantics unchanged: -// -// SurfaceLiteral::{Int,Bool,String,Symbol} → Value(LiteralBits::*) -// Var (local) → scope lookup -// Var (unresolved) → placeholder port + ResolveError -// Call → Transform { target: TransformTarget::Callable(DeclarationId), inputs } -// Operator → Transform { target: TransformTarget::Operator(OperatorKind), inputs } -// If → Branch with 2 Paths -// Fn item → Bind with non-empty params + optional Loop wrapper -// Let item → Bind with empty params -// -// `TransformTarget::Callable` points at a DeclarationId for user -// function calls and resolved named declarations. `TransformTarget::Operator` -// carries a structural `OperatorKind` directly — no anonymous stub -// declaration, no name-based inhabitance walk at infer time. - -use std::collections::{HashMap, HashSet}; -use std::str::FromStr; - -use num_bigint::BigInt; - -use crate::dag::{ - type_connective_cardinality, ArrowBody, AtomPayload, Behavior, BindEmitParticipation, BindNode, - BindNodeId, BranchEmitParticipation, BranchNode, BranchPattern, CardinalityBound, Cluster, Dag, - Declaration, DeclarationId, Field, FieldMap, IntraClusterCall, LiteralBits, LoopBound, - LoopNode, MemberDescent, NodeId, NominalOpacity, NonEmptyList, NonSingletonList, Path, - PayloadBinding, PhantomParameter, PortId, TemplateArgument, TransformNode, TransformTarget, - TypeConnective, ValueNode, MAX_PEANO_MATERIALIZATION, -}; -use crate::diagnostics::{ - declaration_display_name, witness_correction_for_decl, BootstrapAuthorityKey, Correction, - Diagnostic, SourceSpan, -}; -use crate::infer::{concretize_decl_with_subst, SubstStack}; -use crate::int_literal_ranges::{ - int_literal_fits_expected_type, integer_range_for_decl, magnitude_out_of_range_for_interval, - IntegerRangeLookup, -}; -use crate::lower_helpers::{pattern_binding_names, surface_item_span}; -use crate::operators::{ArithmeticOp, ComparisonOp, LogicalOp, OperatorKind}; -use crate::parse::expr_span as surface_expr_span; -use crate::parse::{ - SurfaceExpr, SurfaceField, SurfaceItem, SurfaceLiteral, SurfaceModule, SurfaceParam, - SurfacePattern, SurfacePatternField, SurfaceRecordField, SurfaceType, SurfaceVariant, - TypeAngleArg, VariantPayload, -}; -use crate::types::TypeShape; - -type CallableScope = HashMap; -const DIMENSION_STD_AUTHORITY_FILE: &str = "src/v3/std/dimensions.dag"; - -/// Behavioral lens authorities (`complexity_enforceable`, `parallelism_enforceable`, …). Kept -/// **out** of the embedded `Dag::new` snapshot so rust emit tests are not forced to realize -/// every lens carrier edge; [`lower_compile_module`] / [`crate::compile_to_dag`] prepend these DAGs before -/// user lowering when surfaced imports imply them (`lenses.complexity`, `lenses.parallelism`). -const COMPLEXITY_LENS_AUTHORITY_DAG: &str = include_str!("../../lenses/complexity.dag"); -const COMPLEXITY_LENS_AUTHORITY_FILE: &str = "src/v3/lenses/complexity.dag"; - -const PARALLELISM_LENS_AUTHORITY_DAG: &str = include_str!("../../lenses/parallelism.dag"); -const PARALLELISM_LENS_AUTHORITY_FILE: &str = "src/v3/lenses/parallelism.dag"; - -fn append_complexity_lens_authority(dag: &mut Dag) { - let tokens = crate::tokenize::tokenize( - COMPLEXITY_LENS_AUTHORITY_DAG, - COMPLEXITY_LENS_AUTHORITY_FILE, - ) - .unwrap_or_else(|diag| { - panic!( - "complexity lens authority must tokenize ({COMPLEXITY_LENS_AUTHORITY_FILE}): {diag:?}" - ) - }); - let module = - crate::parse::parse(&tokens, COMPLEXITY_LENS_AUTHORITY_FILE).unwrap_or_else(|diag| { - panic!( - "complexity lens authority must parse ({COMPLEXITY_LENS_AUTHORITY_FILE}): {diag:?}" - ) - }); - lower_into(dag, &module); -} - -fn append_parallelism_lens_authority(dag: &mut Dag) { - let tokens = crate::tokenize::tokenize( - PARALLELISM_LENS_AUTHORITY_DAG, - PARALLELISM_LENS_AUTHORITY_FILE, - ) - .unwrap_or_else(|diag| { - panic!( - "parallelism lens authority must tokenize ({PARALLELISM_LENS_AUTHORITY_FILE}): {diag:?}" - ) - }); - let module = - crate::parse::parse(&tokens, PARALLELISM_LENS_AUTHORITY_FILE).unwrap_or_else(|diag| { - panic!( - "parallelism lens authority must parse ({PARALLELISM_LENS_AUTHORITY_FILE}): {diag:?}" - ) - }); - lower_into(dag, &module); -} - -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -struct RecursiveEdge { - caller: DeclarationId, - callee: DeclarationId, -} - -#[derive(Debug, Clone)] -struct MutualClusterShape { - members: Vec, - member_names: Vec, - per_member_positions: HashMap, - recursive_edges: HashSet, -} - -impl MutualClusterShape { - fn has_recursive_edge(&self, caller: DeclarationId, callee: DeclarationId) -> bool { - self.recursive_edges - .contains(&RecursiveEdge { caller, callee }) - } -} - -#[derive(Debug, Clone)] -struct InvalidMutualCluster { - members: Vec, -} - -#[derive(Debug, Clone, Default)] -struct MutualRecursionPlans { - clusters: Vec, - by_member: HashMap, - invalid_by_member: HashMap, -} - -impl MutualRecursionPlans { - fn cluster_for_member(&self, member: DeclarationId) -> Option<&MutualClusterShape> { - self.by_member - .get(&member) - .and_then(|idx| self.clusters.get(*idx)) - } -} - -#[derive(Debug, Clone)] -struct PendingMutualLoop { - bind_id: Option, - source: PortId, - body_port: PortId, - loop_output: PortId, - body_root: Option, - span: SourceSpan, -} - -#[derive(Debug, Default)] -struct MutualClusterBuildState { - pending_loops: HashMap, - intra_cluster_transform_ids: Vec, -} - -#[derive(Debug, Default)] -struct MutualRecursionState { - clusters: Vec, -} - -impl MutualRecursionState { - fn new(plans: &MutualRecursionPlans) -> Self { - Self { - clusters: (0..plans.clusters.len()) - .map(|_| MutualClusterBuildState::default()) - .collect(), - } - } -} - -fn declaration_name_preference_rank(file: &str) -> usize { - if file.starts_with("src/v3/") { - 2 - } else if file.starts_with("dsl/") { - 0 - } else { - 1 - } -} - -#[derive(Default)] -struct ScopeState { - values: HashMap, - callables: CallableScope, -} - -struct LambdaLoweringContext<'a> { - dag: &'a mut Dag, - scope: &'a HashMap, - callable_scope: &'a CallableScope, - symbols: &'a HashMap, -} - -pub fn lower(module: &SurfaceModule) -> Dag { - lower_compile_module(module, false, false) -} - -/// Prepends lens authority subgraphs requested by surfaced imports (`lenses.complexity`, -/// `lenses.parallelism`) ahead of lowering `module` — mirrors gate #92 (complexity). Kept **out** -/// of [`Dag::new`] / [`lower`] defaults so callers that omit those imports avoid loading unrelated -/// lens carriers. -pub(crate) fn lower_compile_module( - module: &SurfaceModule, - prepend_complexity_lens_authority: bool, - prepend_parallelism_lens_authority: bool, -) -> Dag { - let mut dag = Dag::new(); - if prepend_complexity_lens_authority { - append_complexity_lens_authority(&mut dag); - } - if prepend_parallelism_lens_authority { - append_parallelism_lens_authority(&mut dag); - } - let user_start = if prepend_complexity_lens_authority || prepend_parallelism_lens_authority { - dag.seal_prepended_authority_fixture_range(); - dag.post_bootstrap_declaration_append_begin() as usize - } else { - dag.declarations().len() - }; - lower_into(&mut dag, module); - finalize_strict_user_lower_range(&mut dag, user_start); - dag -} - -/// Strict identifier resolution + unparsed-scaffold rejection for declarations -/// allocated at or after `strict_from` (the user module range after bootstrap). -pub(crate) fn finalize_strict_user_lower_range(dag: &mut Dag, strict_from: usize) { - // User-module sweep: every Identifier stub allocated during - // `lower_into` (id >= strict_from) must resolve, or it becomes a - // fail-closed ResolveError. Stubs in the bootstrap range are - // resolved opportunistically but tolerated — the canonical std/ - // files (`dsl/std/algebra.dag`, etc.) have dangling references to - // types that live in std/ modules outside the M1(2.6) load set - // (e.g., `Tuple`), and those aren't user errors. - resolve_pending_identifiers_strict(dag, strict_from); - // User-mode scaffold rejection: `FnExternalBody` / - // `ArrowBody::Unparsed` and `Data` / `ValueBody::Unparsed` - // are load-bearing scaffolds for the std/bootstrap files - // whose bodies the M1(2.8) parser cannot yet lower - // (match / record literals / lambdas / etc.), and for staged `.dag` - // brace `fn` bodies that intentionally stay on the `FnExternalBody` - // parse path (see `Parser::fn_brace_body_parse_as_expression`). - // User-range declarations that rely on the scaffold are - // fail-closed: ordinary user code has no business shipping - // an opaque body the compiler cannot validate. Without this - // sweep, `fn foo(x: Int) -> Int { junk }` would compile - // cleanly and callers would get Resolved types from an - // unvalidated body. - reject_user_unparsed_scaffolds(dag, strict_from); -} - -/// Lower a surface module into an existing Dag as a single-shot call. -/// Used by user-code compilation (`lower()` above) where there's only -/// one module in the pass. Bootstrap calls -/// `collect_symbols_phase` + `lower_bodies_phase` separately so it can -/// run phase 1 over ALL std/ files before phase 2 on any of them, -/// which is required for cross-file forward references (e.g., -/// `bit.dag`'s `Word64 { bytes: List }` references `List` from -/// `types.dag`, which loads later). -pub(crate) fn lower_into(dag: &mut Dag, module: &SurfaceModule) { - let (symbols, is_first) = collect_symbols_phase(dag, &module.items); - lower_bodies_phase(dag, module, &symbols, &is_first); -} - -/// Phase 1 of two-phase lowering. Allocates placeholder declarations -/// and TypeParam children for every top-level named item in `items`, -/// updates the declaration table in place, and returns the symbols -/// map plus the duplicate-detection vector. Safe to call multiple -/// times for different modules — later calls seed their symbols from -/// earlier calls' declarations, so cross-module forward references -/// resolve via `resolve_pending_identifiers` at the end of phase 2. -pub(crate) fn collect_symbols_phase( - dag: &mut Dag, - items: &[SurfaceItem], -) -> (HashMap, Vec) { - collect_symbols(dag, items) -} - -/// Phase 2 of two-phase lowering. Given the already-allocated -/// placeholder declarations + type_params from phase 1, fills in each -/// item's connective and emits any behavior sub-DAGs. Intentionally -/// does NOT run `resolve_pending_identifiers` — bootstrap batches the -/// sweep across all files, and the user-code `lower()` entry point -/// runs the strict sweep itself. -pub(crate) fn lower_bodies_phase( - dag: &mut Dag, - module: &SurfaceModule, - symbols: &HashMap, - is_first: &[bool], -) { - seed_function_signatures_phase(dag, &module.items, symbols, is_first); - let mut scope = ScopeState::default(); - let empty_mutual_recursion = MutualRecursionPlans::default(); - let mut empty_mutual_state = MutualRecursionState::default(); - // DB-10 (3a.2) ordering: dependency-ordered pre-passes so - // references to top-level declarations resolve independent of - // source order. - // - // Pass 1: types (TypeRecord / TypeSum / TypeAlias / TypeAtom) - // — pure type connectives; don't reference values. - // Pass 2: data (SurfaceItem::Data) — depend on types for - // inhabitance checking; populate `value_body` so later - // fn-body `SurfaceExpr::Var` lookups find it. - // Pass 3: everything else in source order (fns, let, modules). - // Types and data are skipped here because they were - // lowered in the pre-passes. - // - // Without pass 2, a fn body referencing a later-declared `data` - // item (e.g. `fn f() -> Int = answer` followed by - // `data answer: Int = 42`) would resolve `answer` to a - // declaration whose `value_body` is still `None` and fall - // through to the unresolved diagnostic — order-dependent name - // resolution. - let pending_refined_function_refs = - pending_refined_function_refs(&module.items, symbols, is_first); - for (idx, item) in module.items.iter().enumerate() { - if !is_first[idx] { - continue; - } - if matches!( - item, - SurfaceItem::TypeRecord { .. } - | SurfaceItem::TypeSum { .. } - | SurfaceItem::TypeAlias { .. } - | SurfaceItem::TypeAtom { .. } - ) { - validate_dimension_phantom_surface_item(dag, item); - scope = lower_item( - item, - dag, - scope, - symbols, - &empty_mutual_recursion, - &mut empty_mutual_state, - ); - } - } - for (idx, item) in module.items.iter().enumerate() { - if !is_first[idx] { - continue; - } - if let SurfaceItem::Data { - name, - ty, - body: Some(SurfaceExpr::Lambda { .. }), - .. - } = item - { - initialize_data_declaration_type(name, ty, dag, symbols); - } - } - for (idx, item) in module.items.iter().enumerate() { - if !is_first[idx] { - continue; - } - if let SurfaceItem::Data { - name, - ty, - body, - body_span, - .. - } = item - { - if matches!(body, Some(SurfaceExpr::Lambda { .. })) { - continue; - } - let mut data_ctx = DataLoweringContext { - dag, - symbols, - pending_refined_function_refs: &pending_refined_function_refs, - invalid_data_lambda_cluster: None, - }; - lower_data_item(name, ty, body.as_ref(), body_span, &mut data_ctx); - } - } - let mutual_recursion = compute_mutually_recursive(&module.items, dag, symbols, is_first); - for (idx, item) in module.items.iter().enumerate() { - if !is_first[idx] { - continue; - } - if let SurfaceItem::Data { - name, - ty, - body: Some(body @ SurfaceExpr::Lambda { .. }), - body_span, - .. - } = item - { - let mut data_ctx = DataLoweringContext { - dag, - symbols, - pending_refined_function_refs: &pending_refined_function_refs, - invalid_data_lambda_cluster: mutual_recursion.invalid_by_member.get(&symbols[name]), - }; - lower_data_item(name, ty, Some(body), body_span, &mut data_ctx); - } - } - // DB-11 (3a.3) phase-ordered refinement lowering. Runs AFTER the - // data pre-pass so predicates referencing top-level `data` - // constants resolve against lowered declarations, not placeholders. - // Sole caller of `lower_parameter_refinement` for parameter - // `where` clauses (single construction authority). - lower_parameter_refinements_phase(dag, module, symbols, is_first); - lower_type_alias_refinements_phase(dag, module, symbols, is_first); - validate_scalar_data_refinements_phase(dag, module, symbols, is_first); - let mut mutual_state = MutualRecursionState::new(&mutual_recursion); - for (idx, item) in module.items.iter().enumerate() { - if !is_first[idx] { - // Duplicate declaration — skipped at lower time so the - // first-of-name's filled connective is not overwritten. - // `collect_symbols` already emitted a fail-closed - // diagnostic for the duplicate. - continue; - } - // Types + Data lowered in the pre-passes above; skip here - // so their lowering doesn't run twice. - if matches!( - item, - SurfaceItem::Data { .. } - | SurfaceItem::TypeRecord { .. } - | SurfaceItem::TypeSum { .. } - | SurfaceItem::TypeAlias { .. } - | SurfaceItem::TypeAtom { .. } - ) { - continue; - } - scope = lower_item( - item, - dag, - scope, - symbols, - &mutual_recursion, - &mut mutual_state, - ); - } - finalize_mutual_clusters(dag, &mutual_recursion, &mutual_state); -} - -fn finalize_mutual_clusters( - dag: &mut Dag, - mutual_recursion: &MutualRecursionPlans, - mutual_state: &MutualRecursionState, -) { - for (cluster_index, cluster_plan) in mutual_recursion.clusters.iter().enumerate() { - let Some(build_state) = mutual_state.clusters.get(cluster_index) else { - continue; - }; - if build_state.pending_loops.len() != cluster_plan.members.len() { - fail_mutual_cluster_build( - dag, - build_state, - cluster_plan, - "not every cluster member produced a pending loop witness", - ); - continue; - } - - let members: Vec = cluster_plan - .members - .iter() - .filter_map(|member_decl| { - let pending_loop = build_state.pending_loops.get(member_decl)?; - let bind_id = pending_loop.bind_id?; - let slot = *cluster_plan.per_member_positions.get(member_decl)?; - dag.param_of(bind_id, slot) - .map(|param| MemberDescent { param }) - }) - .collect(); - let intra_cluster_calls: Vec = build_state - .intra_cluster_transform_ids - .iter() - .copied() - .filter_map(|transform_id| { - dag.as_transform_ref(transform_id) - .map(|transform| IntraClusterCall { transform }) - }) - .collect(); - - let Some(member_list) = NonSingletonList::from_vec(members) else { - fail_mutual_cluster_build( - dag, - build_state, - cluster_plan, - "member descent witnesses could not be materialized", - ); - continue; - }; - let Some(call_list) = NonEmptyList::from_vec(intra_cluster_calls) else { - fail_mutual_cluster_build( - dag, - build_state, - cluster_plan, - "lowered bodies did not produce any intra-cluster calls", - ); - continue; - }; - - let cluster_id = dag.push_cluster(Cluster { - members: member_list, - intra_cluster_calls: call_list, - }); - for member_decl in &cluster_plan.members { - let Some(pending_loop) = build_state.pending_loops.get(member_decl) else { - continue; - }; - let loop_id = dag.alloc_node_id(); - dag.set_port_producer(pending_loop.loop_output, Some(loop_id)); - dag.push_node(Behavior::Loop(LoopNode { - id: loop_id, - source: pending_loop.source, - init: pending_loop.source, - body: pending_loop.body_root.unwrap_or(loop_id), - bound: LoopBound::Descent { - cluster: cluster_id, - measure: pending_loop.source, - }, - output: pending_loop.loop_output, - span: pending_loop.span.clone(), - })); - if let Some(bind_id) = pending_loop.bind_id { - dag.patch_bind_value(bind_id, pending_loop.loop_output); - } - } - } -} - -fn fail_mutual_cluster_build( - dag: &mut Dag, - build_state: &MutualClusterBuildState, - cluster_plan: &MutualClusterShape, - detail: &str, -) { - let members = cluster_plan.member_names.join(", "); - let reason = format!("cannot finalize mutual recursion cluster [{members}]: {detail}"); - for pending_loop in build_state.pending_loops.values() { - dag.mark_unresolved( - pending_loop.body_port, - Diagnostic::ResolveError { - name: reason.clone(), - span: pending_loop.span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - }, - ); - dag.mark_unresolved( - pending_loop.loop_output, - Diagnostic::ResolveError { - name: reason.clone(), - span: pending_loop.span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - }, - ); - } -} - -fn seed_function_signatures_phase( - dag: &mut Dag, - items: &[SurfaceItem], - symbols: &HashMap, - is_first: &[bool], -) { - for (idx, item) in items.iter().enumerate() { - if !is_first[idx] { - continue; - } - match item { - SurfaceItem::Fn { - name, - params, - return_type, - .. - } => { - seed_function_signature(name, params, return_type, ArrowBody::Pending, dag, symbols) - } - SurfaceItem::FnExternalBody { - name, - params, - return_type, - body_span, - .. - } => seed_function_signature( - name, - params, - return_type, - ArrowBody::Unparsed(body_span.clone()), - dag, - symbols, - ), - _ => {} - } - } -} - -fn pending_refined_function_refs( - items: &[SurfaceItem], - symbols: &HashMap, - is_first: &[bool], -) -> HashSet { - items - .iter() - .enumerate() - .filter(|(idx, _)| is_first[*idx]) - .filter_map(|(_, item)| match item { - SurfaceItem::Fn { name, params, .. } - | SurfaceItem::FnExternalBody { name, params, .. } - if params.iter().any(|param| param.refinement.is_some()) => - { - symbols.get(name).copied() - } - _ => None, - }) - .collect() -} - -fn rejected_data_lambda_connective( - name: &str, - connective: TypeConnective, - diagnostic: Diagnostic, - span: &SourceSpan, - dag: &mut Dag, -) -> TypeConnective { - let TypeConnective::Arrow { inputs, output, .. } = connective else { - return connective; - }; - let bind_params: Vec = inputs - .iter() - .map(|input| { - let port = dag.alloc_port(None); - if let Ok(shape) = declaration_to_port_shape(*input, dag, span) { - dag.set_port_type(port, shape); - } - port - }) - .collect(); - let err_port = dag.alloc_port(None); - dag.mark_unresolved(err_port, diagnostic); - let bind_id = dag.alloc_node_id(); - dag.push_node(Behavior::Bind(BindNode { - id: bind_id, - name: name.to_string(), - value: err_port, - params: bind_params, - span: span.clone(), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - let Some(body_id) = BindNodeId::from_bind_node(dag, bind_id) else { - return TypeConnective::Arrow { - inputs, - output, - body: ArrowBody::NoBody, - }; - }; - TypeConnective::Arrow { - inputs, - output, - body: ArrowBody::UserDefined(body_id), - } -} - -/// DB-11 (3a.3): allocate the predicate `Declaration` for a `where` -/// refinement (parameter or type-alias RHS). `bind_name` is the sole -/// `SurfaceExpr::Var` binding installed in the predicate scope: -/// -/// - **Function parameters:** `bind_name` is the parameter identifier (e.g. -/// `d` in `d: Int where d != 0`). -/// - **Type-alias RHS:** `bind_name` is the **alias's declared name**, not a -/// fresh synthetic parameter. Surface rule: the refined value is referred to -/// by the same identifier as the alias itself, e.g. -/// `type PositiveInt = Int where PositiveInt > 0` — `PositiveInt` in the -/// predicate names the subject of type `Int` (the alias's RHS base). This is -/// deliberate user-facing semantics, not an implementation accident; see -/// `test_db11_type_alias_where_survives_parse_and_lower` in -/// `m2_feature_parity_test.rs`. -/// -/// In every call, `bind_name` is the surface spelling the author uses for the -/// **value being refined**; it is not a second name for the type. The single -/// `Var` in scope is bound to a port of shape `base_decl_id` (the base type -/// for that value). -/// -/// When `registry_synthesized_body` is true, the predicate `Bind` is tagged -/// `` so downstream literal discharge can -/// distinguish registry ladder bodies from user-written refinements (same -/// fragment shapes must not imply discharge equivalence). -fn build_refinement_predicate_declaration( - base_decl_id: DeclarationId, - predicate: &SurfaceExpr, - bind_name: &str, - symbols: &HashMap, - dag: &mut Dag, - subject_span: SourceSpan, - registry_synthesized_body: bool, -) -> DeclarationId { - let pred_span = surface_expr_span(predicate).clone(); - let pred_param_port = dag.alloc_port(None); - match declaration_to_port_shape(base_decl_id, dag, &subject_span) { - Ok(shape) => dag.set_port_type(pred_param_port, shape), - Err(diag) => dag.mark_unresolved(pred_param_port, diag), - } - - let mut pred_scope: HashMap = HashMap::new(); - pred_scope.insert(bind_name.to_string(), pred_param_port); - let pred_callable_scope: CallableScope = CallableScope::new(); - let bool_decl_id = symbols - .get("Bool") - .copied() - .unwrap_or_else(|| alloc_identifier_stub(dag, "Bool", &pred_span)); - let pred_value_port = lower_expr( - predicate, - dag, - &pred_scope, - &pred_callable_scope, - symbols, - Some(bool_decl_id), - ); - - let bind_id = dag.alloc_node_id(); - let bind_tag = if registry_synthesized_body { - format!("") - } else { - format!("") - }; - dag.push_node(Behavior::Bind(BindNode { - id: bind_id, - name: bind_tag, - value: pred_value_port, - params: vec![pred_param_port], - span: pred_span.clone(), - lane2_workflow: None, - emit_participation: None, - })); - - let pred_decl_id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: pred_decl_id, - name: None, - connective: TypeConnective::Arrow { - inputs: vec![base_decl_id], - output: bool_decl_id, - body: ArrowBody::UserDefined( - BindNodeId::from_bind_node(dag, bind_id) - .expect("UserDefined Arrow body bind id must point at a Bind"), - ), - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: pred_span, - }); - pred_decl_id -} - -/// Argument-shape contract for a registered predicate. Matched against the -/// parsed `SurfaceExpr` at the predicate's call position. See [`KNOWN_PREDICATES`] -/// for the full registry doc + the substrate-fact-introduction receipt. -// 🟢 TERMINAL — implementation-layer coproduct over the parsed `SurfaceExpr` -// shapes that registered `where`-predicates may legitimately carry. Each -// variant is anchored in a parser-fact (`Bare` ↔ `SurfaceExpr::Var`; -// `SingleStringLiteral` ↔ `SurfaceExpr::Call { args: [Literal::String(_)] }`; -// `NumericRecord` ↔ `Call { args: [Record { fields: [Int-literal-fields] }] }`) -// — not a scaffold to dissolve. Variant set grows when a new predicate enters -// `KNOWN_PREDICATES` with a different parsed-arg shape. -#[derive(Debug, Clone, Copy)] -enum PredicateArgShape { - /// Bare predicate — no argument list, must parse as `SurfaceExpr::Var`. - /// E.g. `non_empty`, `gt_zero`. - Bare, - /// Single string-literal argument — `SurfaceExpr::Call { args: [Literal::String(_)] }`. - /// E.g. `brand("…")`. - SingleStringLiteral, - /// Record-shape with named numeric-literal fields. At least one of the - /// listed fields must be present; all present fields must be integer - /// literals. E.g. `range(min: N)` / `range(min: N, max: M)`. - NumericRecord { - accepted_fields: &'static [&'static str], - require_at_least_one: bool, - }, -} - -struct PredicateSpec { - name: &'static str, - allowed_carriers: &'static [&'static str], - arg_shape: PredicateArgShape, -} - -/// **Predicate registry** (S9 Slice 2.5 — Path 3 RATIFIED at gunbc#828 -/// `issuecomment-4390333451`; Path (a) extension RATIFIED at gunbc#828 -/// `issuecomment-4390760353`). Authoritative set of predicate identifiers -/// recognized by `where`-sugar refinements. Each entry pairs the predicate -/// name with its **allowed carrier types** (the set of base-type names a -/// `where (…)` clause may legitimately refine) and its -/// **`arg_shape`** contract (the parsed `SurfaceExpr` shape the predicate's -/// call position must match). -/// -/// **Validation outcomes** (see [`PredicateValidation`] / [`validate_where_clause`]): -/// - Registered name + allowed carrier + matching arg shape → placeholder -/// refinement via [`alloc_registered_refinement_placeholder`] (refinement -/// is *named* at the declaration level — P3 facts-flow-forward — without -/// requiring a lowered `Bool` predicate body). -/// - Registered name but disallowed carrier OR malformed arg shape → -/// [`PredicateValidation::RegisteredButMalformed`]; the call site emits -/// `Diagnostic::ResolveError` directly via `report_declaration_error` -/// (fail-closed per Codex/openai-pro REQUEST_CHANGES at PR #1846). -/// - Unregistered name → fall through to live resolution in -/// [`build_refinement_predicate_declaration`] (which emits its own -/// `Diagnostic::ResolveError` if the name does not resolve as a callable). -/// -/// Replaces the prior PB-1 file-path special case -/// (`span.file == "dsl/std/types.dag"`) — the asymmetry that motivated this -/// slice. Per `feedback_no_textual_enforcement_bridges`: gating structural -/// behavior on a textual file identifier was the anti-pattern; gating on -/// whether the predicate name is registered AND carrier-compatible AND -/// arg-shape-matched is the substrate-faithful authority. -/// -/// **DFS-of-concept-DAG receipt** (proud-lynx-311 pre-flight grep at -/// `gunbc#1746 issuecomment-4390253616` + brief `docs/briefs/r3-substrate-s9-slice-2-5-predicate-registry-worker.md` -/// authority audit): no parallel predicate-registry exists under another -/// name; this constant IS the substrate-fact-introduction. -const KNOWN_PREDICATES: &[PredicateSpec] = &[ - // Pre-existing types.dag predicates absorbed via the prior PB-1 shim. - // `allowed_carriers` derived from the surface usage at `dsl/std/types.dag` - // pre-PR; the registry now enforces structurally what the file-path shim - // tolerated by location. - // - // **Pattern / format / content REMOVED from the registry** per Director - // Option A revised RATIFIED at gunbc#828 `issuecomment-4392245968`: - // these predicates needed regex-primitive substrate that doesn't exist - // (`Q-Regex-Primitive`); rather than ride a placeholder-with-named-trigger - // bridge through this slice, they are structurally absent until - // `Q-Regex-Primitive` lands. User-code `where pattern(...)` (or - // format/content) now falls through to live resolution and surfaces a - // `Diagnostic::ResolveError` naming the unblock dependency. The 12 - // types.dag declarations that previously used these predicates have - // dropped their where-clauses with inline-comment receipts pointing at - // the Q-Regex restoration path. - PredicateSpec { - name: "range", - allowed_carriers: &["Int", "Nat"], - arg_shape: PredicateArgShape::NumericRecord { - accepted_fields: &["min", "max"], - require_at_least_one: true, - }, - }, - PredicateSpec { - name: "non_empty", - allowed_carriers: &["String", "Secret", "List"], - arg_shape: PredicateArgShape::Bare, - }, - PredicateSpec { - // `brand` is the most-frequently-applied predicate in `types.dag`; - // it tags any nominal carrier with a brand identity. Allowed carriers - // span every type that carries a brand in the existing surface. - name: "brand", - allowed_carriers: &[ - "NonEmptyStr", - "String", - "FilePath", - "Unit", - "Int", - "Nat", - "Secret", - ], - arg_shape: PredicateArgShape::SingleStringLiteral, - }, - // S9 Slice 2.5 new primitive (Director Option 2 ratification at - // gunbc#828 issuecomment-4390199218). `gt_zero` IS the reason for "Nat - // without zero" / "Nat above structural bound"; intrinsic to Nat and - // generalizes over Int. - PredicateSpec { - name: "gt_zero", - allowed_carriers: &["Nat", "Int"], - arg_shape: PredicateArgShape::Bare, - }, - // Unicode scalar value over `Int`: U+0000..U+D7FF ∪ U+E000..U+10FFFF - // (excludes surrogate pair code units U+D800..U+DFFF). Single-interval - // `range(max: 0x10FFFF)` is intentionally **not** used — it admits - // surrogates and contradicts `String = FreeMonoid` modeling. - PredicateSpec { - name: "unicode_scalar", - allowed_carriers: &["Int"], - arg_shape: PredicateArgShape::Bare, - }, -]; - -fn predicate_spec(name: &str) -> Option<&'static PredicateSpec> { - KNOWN_PREDICATES.iter().find(|spec| spec.name == name) -} - -/// Walk an alias chain (`Atom::ResolvedByStructure` / `Atom::ResolvedByName` / -/// `Instantiation`) collecting every *named* declaration encountered. -/// Returns the names of every level in the chain — both the immediate alias -/// and any transitive aliases — so a predicate like `brand` over -/// `NonEmptyStr` matches because `NonEmptyStr` itself is allowed (alias chain -/// doesn't need to bottom out at `String`). -fn carrier_chain_names(dag: &Dag, decl_id: DeclarationId) -> Vec { - let mut out = Vec::new(); - let mut current = decl_id; - for _ in 0..32 { - let decl = dag.declaration(current); - if let Some(name) = decl.name.as_deref() { - out.push(name.to_string()); - } - match &decl.connective { - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => current = *next, - TypeConnective::Instantiation { template, .. } => current = *template, - _ => break, - } - } - out -} - -/// Follow only `Atom(ResolvedByName)` edges — bounded forward walk (INVARIANTS -/// §P3/P4). Same discipline as [`carrier_chain_names`] (which also caps hops); -/// this helper is for template resolution where only import stubs use `ResolvedByName`. -/// -/// Returns `None` when more than `max_depth` consecutive `ResolvedByName` edges -/// remain (cycle or excessive depth). -fn follow_resolved_by_name_bounded( - dag: &Dag, - mut id: DeclarationId, - max_depth: usize, -) -> Option { - for _ in 0..max_depth { - match &dag.declaration(id).connective { - TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => id = *next, - _ => return Some(id), - } - } - match &dag.declaration(id).connective { - TypeConnective::Atom(AtomPayload::ResolvedByName(_)) => None, - _ => Some(id), - } -} - -/// Outcome of validating a single registered-predicate clause against -/// [`KNOWN_PREDICATES`]. Path (a) RATIFIED at gunbc#828 -/// `issuecomment-4390760353`: registered predicates must validate carrier -/// **and** argument shape; mismatches fail-closed via `Diagnostic::ResolveError` -/// rather than silently take a placeholder. -// -// 🟢 TERMINAL — implementation-layer coproduct over the three outcomes -// `validate_where_clause` produces: registered+valid (placeholder/synthesis -// path), registered+malformed (fail-closed diagnostic), unregistered -// (fall-through to live resolution). Not a scaffold; the three outcomes are -// the structural surface of registry dispatch. -enum PredicateValidation { - /// Predicate name is registered, carrier is allowed, and argument shape - /// matches the spec. Eligible for placeholder allocation. - Registered, - /// Predicate name is registered but the call is malformed (wrong carrier - /// or arg shape). Caller emits `Diagnostic::ResolveError` directly via - /// `report_declaration_error` and skips refinement allocation - /// (fail-closed; no placeholder, no live-resolution fallback). - RegisteredButMalformed { reason: String, span: SourceSpan }, - /// Predicate name is not in the registry. Falls through to live - /// resolution unchanged (existing `build_refinement_predicate_declaration` - /// path emits `Diagnostic::ResolveError` if the name does not resolve). - NotRegistered, -} - -/// Validate a single predicate-position `SurfaceExpr` against the registry. -fn validate_predicate_clause(expr: &SurfaceExpr, carrier_chain: &[String]) -> PredicateValidation { - let (predicate_name, predicate_span) = match expr { - SurfaceExpr::Call { target, span, .. } => (target.as_str(), span.clone()), - SurfaceExpr::Var { name, span } => (name.as_str(), span.clone()), - _ => return PredicateValidation::NotRegistered, - }; - let Some(spec) = predicate_spec(predicate_name) else { - return PredicateValidation::NotRegistered; - }; - let carrier_ok = spec - .allowed_carriers - .iter() - .any(|allowed| carrier_chain.iter().any(|name| name == allowed)); - if !carrier_ok { - return PredicateValidation::RegisteredButMalformed { - reason: format!( - "predicate `{predicate_name}` requires a carrier in {{{}}}; \ - base-type chain has none of those (chain: {})", - spec.allowed_carriers.join(", "), - if carrier_chain.is_empty() { - "".to_string() - } else { - carrier_chain.join(" → ") - } - ), - span: predicate_span, - }; - } - if let Some(reason) = arg_shape_mismatch(spec, expr) { - return PredicateValidation::RegisteredButMalformed { - reason, - span: predicate_span, - }; - } - PredicateValidation::Registered -} - -/// Check whether the call shape at `expr` matches `spec.arg_shape`. Returns -/// `Some(reason)` if malformed. -fn arg_shape_mismatch(spec: &PredicateSpec, expr: &SurfaceExpr) -> Option { - let predicate_name = spec.name; - match (&spec.arg_shape, expr) { - // Bare predicates accept ONLY the bare-ident `SurfaceExpr::Var` shape. - // `gt_zero()` (zero-arg Call) is a different surface — explicit empty - // call list — and is rejected per Codex BLOCKING at PR #1846 - // (S9 Slice 2.5 Path (a) cement: bare-predicate shape contract is - // strictly the bare-ident form, not zero-arg-call-compatible). - (PredicateArgShape::Bare, SurfaceExpr::Var { .. }) => None, - (PredicateArgShape::Bare, _) => Some(format!( - "predicate `{predicate_name}` is bare; use the bare-ident form \ - `{predicate_name}` (no parentheses, no arguments)" - )), - (PredicateArgShape::SingleStringLiteral, SurfaceExpr::Call { args, .. }) - if matches!( - args.as_slice(), - [SurfaceExpr::Literal { - value: SurfaceLiteral::String(_), - .. - }] - ) => - { - None - } - (PredicateArgShape::SingleStringLiteral, _) => Some(format!( - "predicate `{predicate_name}` requires a single string-literal argument" - )), - ( - PredicateArgShape::NumericRecord { - accepted_fields, - require_at_least_one, - }, - SurfaceExpr::Call { args, .. }, - ) => { - // Per `parse_type_alias_where_tail` doc-comment: `range(min: 1, max: 5)` - // desugars to a single `Record` argument. - let Some(SurfaceExpr::Record { fields, .. }) = args.first() else { - return Some(format!( - "predicate `{predicate_name}` requires record-shaped \ - arguments (e.g. `{predicate_name}(min: N)`)" - )); - }; - if args.len() != 1 { - return Some(format!( - "predicate `{predicate_name}` accepts a single record argument; got {}", - args.len() - )); - } - if *require_at_least_one && fields.is_empty() { - return Some(format!( - "predicate `{predicate_name}` requires at least one of \ - the fields {{{}}}", - accepted_fields.join(", ") - )); - } - let mut seen: Vec<&str> = Vec::with_capacity(fields.len()); - for field in fields { - if !accepted_fields.contains(&field.name.as_str()) { - return Some(format!( - "predicate `{predicate_name}` does not accept field `{}` \ - (accepts: {})", - field.name, - accepted_fields.join(", ") - )); - } - if seen.contains(&field.name.as_str()) { - return Some(format!( - "predicate `{predicate_name}` does not accept duplicate \ - field `{}`", - field.name - )); - } - seen.push(field.name.as_str()); - if !matches!( - &field.value, - SurfaceExpr::Literal { - value: SurfaceLiteral::Int(_), - .. - } - ) { - return Some(format!( - "predicate `{predicate_name}` field `{}` requires an \ - integer-literal value", - field.name - )); - } - } - None - } - (PredicateArgShape::NumericRecord { .. }, _) => Some(format!( - "predicate `{predicate_name}` requires record-shaped arguments" - )), - } -} - -/// Synthesize a `Bool`-returning `SurfaceExpr` body equivalent to the -/// registered predicate's semantic content, suitable for handing to -/// [`build_refinement_predicate_declaration`]. Returns `None` if the -/// predicate's body cannot yet be synthesized from existing substrate -/// primitives (e.g. `pattern` requires regex-matching primitives that have -/// not landed; surfacing as STOP-AND-ESCALATE per S9 Slice 2.5 brief). -/// -/// `bind_name` is the alias being declared (the predicate's subject). -/// `predicate` is the parsed `where`-clause predicate (e.g. the `gt_zero` -/// `SurfaceExpr::Var` or the `range(min: 1)` `SurfaceExpr::Call`). -/// -/// Currently implemented: -/// - **`gt_zero`**: subject `> 0`. Equivalent for both `Nat` and `Int` -/// carriers (Nat's structural lower bound is 0; gt_zero is "above -/// structural bound"). -/// - **`unicode_scalar`**: `(0 <= subject <= 0xD7FF) || (0xE000 <= subject <= 0x10FFFF)`. -/// - **`brand`**: lowers to reflexive `subject == subject` ∧ reflexive string equality on -/// the tag literal (`label == label`). That fragment is **always true** when evaluated -/// statically, including at [`scalar_literal_must_reject_for_refinement`] — it carries the -/// registry predicate as a **real lowered body** (Path (a) vs placeholder) for structural -/// discharge / inference, but it contributes **no extra literal-side narrowing** on Int/Nat -/// carriers by itself. Nominal disjointness between branded aliases is enforced where types -/// are compared by declaration identity (call-site discharge, coercions), not by rejecting -/// raw numeric literals. When `brand` is **conjoined** with substantive predicates (`range`, -/// `unicode_scalar`, …), those conjuncts still constrain literals at the discharge boundary. -/// **Dissolution / tech debt:** if we ever need brand-tag evidence at the literal boundary, -/// introduce a non-vacuous lowered fact (or substrate provenance) rather than pretending -/// reflexive Eq does that work — aligns with INVARIANTS facts-flow-forward: the Bool fragment -/// here must not be interpreted as carrying nominal disjointness evidence it does not encode. -/// - **`range`**: subject `>= min` / `<= max` / both, depending on which -/// record fields are present. Numeric primitives in scope; arg-shape -/// validation already guaranteed Int-literal field values when reaching -/// this point. -/// -/// Pending substrate — STOP-AND-ESCALATE candidates per S9 Slice 2.5 brief -/// (returns `None` — falls through to placeholder for now): -/// - `non_empty`: synthesizing a real Bool body triggers a *discharge cascade* -/// — `scalar_literal_must_reject_for_refinement` fails closed when it cannot -/// evaluate the lowered predicate against the literal; there is no static -/// evaluator for `subject != ""` yet on string literals (e.g. data fields -/// typed `NonEmptyStr`). Result: bootstrap regen would emit spurious -/// "scalar literal does not satisfy `where` refinement" diagnostics for -/// data declarations whose fields are typed as non-empty carriers (e.g. -/// `LensRegistryEntry.name: NonEmptyStr`). Surfacing as STOP per brief — -/// the lowerer-side discharge mechanism is the substrate-fact-introduction -/// needed before `non_empty` synthesizes. -/// - `pattern` / `format` / `content`: regex-primitive substrate-fact-introduction -/// (Q-Regex-Primitive) has not landed. -fn brand_predicate_label(predicate: &SurfaceExpr) -> Option { - match predicate { - SurfaceExpr::Call { args, .. } | SurfaceExpr::PathCall { args, .. } => { - let first = args.first()?; - match first { - SurfaceExpr::Literal { - value: SurfaceLiteral::String(s), - .. - } => Some(s.clone()), - _ => None, - } - } - _ => None, - } -} - -fn synthesize_predicate_body( - spec: &PredicateSpec, - predicate: &SurfaceExpr, - bind_name: &str, - _carrier_chain: &[String], -) -> Option { - let span = surface_expr_span(predicate).clone(); - let subject_var = || SurfaceExpr::Var { - name: bind_name.to_string(), - span: span.clone(), - }; - let int_literal = |value: i64| SurfaceExpr::Literal { - value: SurfaceLiteral::Int(value.to_string()), - span: span.clone(), - }; - match spec.name { - "gt_zero" => Some(SurfaceExpr::Operator { - op: OperatorKind::Comparison(ComparisonOp::Gt), - args: vec![subject_var(), int_literal(0)], - span, - }), - "unicode_scalar" => { - const MAX_BMP_NON_SURROGATE: i64 = 0xD7FF; - const MIN_POST_SURROGATE: i64 = 0xE000; - const MAX_UNICODE_SCALAR: i64 = 0x10_FFFF; - let low_ok = SurfaceExpr::Operator { - op: OperatorKind::Logical(LogicalOp::And), - args: vec![ - SurfaceExpr::Operator { - op: OperatorKind::Comparison(ComparisonOp::Ge), - args: vec![subject_var(), int_literal(0)], - span: span.clone(), - }, - SurfaceExpr::Operator { - op: OperatorKind::Comparison(ComparisonOp::Le), - args: vec![subject_var(), int_literal(MAX_BMP_NON_SURROGATE)], - span: span.clone(), - }, - ], - span: span.clone(), - }; - let high_ok = SurfaceExpr::Operator { - op: OperatorKind::Logical(LogicalOp::And), - args: vec![ - SurfaceExpr::Operator { - op: OperatorKind::Comparison(ComparisonOp::Ge), - args: vec![subject_var(), int_literal(MIN_POST_SURROGATE)], - span: span.clone(), - }, - SurfaceExpr::Operator { - op: OperatorKind::Comparison(ComparisonOp::Le), - args: vec![subject_var(), int_literal(MAX_UNICODE_SCALAR)], - span: span.clone(), - }, - ], - span: span.clone(), - }; - Some(SurfaceExpr::Operator { - op: OperatorKind::Logical(LogicalOp::Or), - args: vec![low_ok, high_ok], - span, - }) - } - "brand" => { - // Intentionally tautological Bool fragment: produces a real lowered Arrow body for - // registry Path (a) while keeping nominal disjointness out of this Expr-shaped proof. - // See module doc on `brand` in [`synthesize_predicate_body`]. - let label = brand_predicate_label(predicate)?; - let brand_lit = SurfaceExpr::Literal { - value: SurfaceLiteral::String(label), - span: span.clone(), - }; - let tag_check = SurfaceExpr::Operator { - op: OperatorKind::Comparison(ComparisonOp::Eq), - args: vec![brand_lit.clone(), brand_lit], - span: span.clone(), - }; - Some(SurfaceExpr::Operator { - op: OperatorKind::Logical(LogicalOp::And), - args: vec![ - SurfaceExpr::Operator { - op: OperatorKind::Comparison(ComparisonOp::Eq), - args: vec![subject_var(), subject_var()], - span: span.clone(), - }, - tag_check, - ], - span, - }) - } - // range body synthesis enabled. Note: synthesizing `subject >= min` - // / `subject <= max` for the existing `dsl/std/types.dag` - // Int-where-range declarations (RetryCount, HttpStatus, Port, - // EpochMs, Duration, Milliseconds, Seconds) creates additional - // `Value(LiteralBits::Int(N))` nodes in the DAG (one per record - // field). Tests that locate a value node by literal-bits alone - // (e.g. `int_literal_cardinality_test::let_annotated_uint8_*`) - // must filter by `span.file` to disambiguate the user's literal - // from the synthesized predicate-body literals. - "range" => { - // arg-shape validation has already confirmed: - // - exactly 1 SurfaceExpr::Record arg - // - each field name is in {"min", "max"} (no duplicates) - // - each field value is SurfaceLiteral::Int(_) - // …so the extraction below is total over the validated shape. - let SurfaceExpr::Call { args, .. } = predicate else { - return None; - }; - let SurfaceExpr::Record { fields, .. } = args.first()? else { - return None; - }; - let int_literal_decimal = |decimal: String| SurfaceExpr::Literal { - value: SurfaceLiteral::Int(decimal), - span: span.clone(), - }; - let mut min_value: Option = None; - let mut max_value: Option = None; - for field in fields { - let SurfaceExpr::Literal { - value: SurfaceLiteral::Int(n), - .. - } = &field.value - else { - return None; - }; - // Reject ill-formed decimals; accept any magnitude that parses as `BigInt` so - // `range` synthesis cannot silently fall back to placeholders merely because the - // bound exceeds host `i64` (R3 full-magnitude Int literal carrier). - if BigInt::from_str(n.as_str()).is_err() { - return None; - } - match field.name.as_str() { - "min" => min_value = Some(n.clone()), - "max" => max_value = Some(n.clone()), - _ => return None, - } - } - let mut clauses: Vec = Vec::with_capacity(2); - if let Some(m) = min_value { - clauses.push(SurfaceExpr::Operator { - op: OperatorKind::Comparison(ComparisonOp::Ge), - args: vec![subject_var(), int_literal_decimal(m)], - span: span.clone(), - }); - } - if let Some(m) = max_value { - clauses.push(SurfaceExpr::Operator { - op: OperatorKind::Comparison(ComparisonOp::Le), - args: vec![subject_var(), int_literal_decimal(m)], - span: span.clone(), - }); - } - match clauses.len() { - 0 => None, - 1 => clauses.pop(), - _ => { - let mut iter = clauses.into_iter(); - let mut acc = iter.next()?; - for next in iter { - let combined_span = span.clone(); - acc = SurfaceExpr::Operator { - op: OperatorKind::Logical(LogicalOp::And), - args: vec![acc, next], - span: combined_span, - }; - } - Some(acc) - } - } - } - _ => None, - } -} - -/// Result of attempting per-leaf body synthesis on a (possibly And-combined) -/// `where`-sugar clause. The mixed case is the openai-pro REQUEST_CHANGES -/// finding (gunbc PR #1846): if a clause combines a synthesizable predicate -/// (e.g. `gt_zero`) with an unsynthesizable one (e.g. `range` pre-Gap-3), -/// returning a placeholder for the whole clause silently weakens the -/// enforceable `gt_zero` fact. Returning a mixed-result variant lets the -/// caller fail-closed instead. -// -// 🟢 TERMINAL — implementation-layer coproduct over the three per-clause -// body-synthesis outcomes (all leaves synthesized / all leaves placeholder / -// mixed → fail-closed). Not a scaffold; preserves per-leaf facts -// representation needed to satisfy openai-pro REQUEST_CHANGES at PR #1846. -enum BodySynthOutcome { - /// Every leaf synthesized; combined body lowers via the live predicate - /// declaration path. - AllSynthesized(SurfaceExpr), - /// No leaf synthesized; whole clause routes through the placeholder - /// allocator (status quo for unsynthesized registered predicates). - AllPlaceholder, - /// Mixed: at least one leaf synthesized, at least one didn't. Caller - /// emits `Diagnostic::ResolveError` with the listed predicate names so - /// the synthesized fact isn't silently weakened by being merged into - /// the placeholder. Pairs with the test - /// `test_mixed_synthesizable_and_placeholder_predicates_fails_closed`. - Mixed { - synthesized_names: Vec, - unsynthesized_names: Vec, - }, -} - -/// Walk a (possibly And-combined) `where`-sugar refinement expression and -/// classify per-leaf synthesizability. Single registered predicate delegates -/// to [`synthesize_predicate_body`]. `Operator { And, [a, b, …] }` walks each -/// leaf and aggregates outcomes; if any leaf classifies different from the -/// rest, returns `Mixed` so the caller fails closed. -fn registered_predicate_synthesized_body( - expr: &SurfaceExpr, - bind_name: &str, - carrier_chain: &[String], -) -> BodySynthOutcome { - match expr { - SurfaceExpr::Operator { - op: OperatorKind::Logical(LogicalOp::And), - args, - span, - } => { - let mut synthesized: Vec = Vec::with_capacity(args.len()); - let mut synthesized_names: Vec = Vec::new(); - let mut unsynthesized_names: Vec = Vec::new(); - for arg in args { - match registered_predicate_synthesized_body(arg, bind_name, carrier_chain) { - BodySynthOutcome::AllSynthesized(body) => { - synthesized.push(body); - // Collect every leaf name reachable through the arg - // (handles nested `And` subtrees per openai-pro - // REQUEST_CHANGES at PR #1846 `4a42cb1f` — - // `leaf_predicate_name` alone returns None for an - // `Operator(And)` arg and would silently drop the - // nested per-leaf names). - synthesized_names.extend(collect_leaf_predicate_names(arg)); - } - BodySynthOutcome::AllPlaceholder => { - unsynthesized_names.extend(collect_leaf_predicate_names(arg)); - } - BodySynthOutcome::Mixed { - synthesized_names: s, - unsynthesized_names: u, - } => { - synthesized_names.extend(s); - unsynthesized_names.extend(u); - } - } - } - match (synthesized_names.is_empty(), unsynthesized_names.is_empty()) { - (false, true) => BodySynthOutcome::AllSynthesized(SurfaceExpr::Operator { - op: OperatorKind::Logical(LogicalOp::And), - args: synthesized, - span: span.clone(), - }), - (true, false) => BodySynthOutcome::AllPlaceholder, - (true, true) => BodySynthOutcome::AllPlaceholder, - (false, false) => BodySynthOutcome::Mixed { - synthesized_names, - unsynthesized_names, - }, - } - } - SurfaceExpr::Call { target, .. } => match predicate_spec(target) { - Some(spec) => match synthesize_predicate_body(spec, expr, bind_name, carrier_chain) { - Some(body) => BodySynthOutcome::AllSynthesized(body), - None => BodySynthOutcome::AllPlaceholder, - }, - None => BodySynthOutcome::AllPlaceholder, - }, - SurfaceExpr::Var { name, .. } => match predicate_spec(name) { - Some(spec) => match synthesize_predicate_body(spec, expr, bind_name, carrier_chain) { - Some(body) => BodySynthOutcome::AllSynthesized(body), - None => BodySynthOutcome::AllPlaceholder, - }, - None => BodySynthOutcome::AllPlaceholder, - }, - _ => BodySynthOutcome::AllPlaceholder, - } -} - -/// Extract the predicate identifier at the head of a `where`-clause leaf. -/// Returns `None` for non-leaf expressions (e.g. `Operator(And)` itself, or -/// shapes that aren't predicate calls). Used to attribute names in the -/// `Mixed` synthesis-outcome diagnostic. For nested `And` subtrees, use -/// [`collect_leaf_predicate_names`] which recurses through the conjunction -/// structure. -fn leaf_predicate_name(expr: &SurfaceExpr) -> Option { - match expr { - SurfaceExpr::Call { target, .. } => Some(target.clone()), - SurfaceExpr::Var { name, .. } => Some(name.clone()), - _ => None, - } -} - -/// Collect every leaf predicate name reachable from `expr` by recursing -/// through `Operator { And, … }` conjunctions. Addresses openai-pro -/// REQUEST_CHANGES at PR #1846 (`4a42cb1f`): nested-`And` subtrees were -/// returning `None` from [`leaf_predicate_name`] (because the subtree itself -/// is an `Operator`, not a leaf), causing per-leaf synthesized/placeholder -/// names to be dropped during outer aggregation. The fix is to walk the -/// conjunction structure and collect names at every leaf. -fn collect_leaf_predicate_names(expr: &SurfaceExpr) -> Vec { - match expr { - SurfaceExpr::Operator { - op: OperatorKind::Logical(LogicalOp::And), - args, - .. - } => { - let mut out = Vec::new(); - for arg in args { - out.extend(collect_leaf_predicate_names(arg)); - } - out - } - _ => leaf_predicate_name(expr).into_iter().collect(), - } -} - -/// Recursively walk a `where`-sugar refinement expression. Predicates combine -/// via `Operator { op: Logical(And), … }` (per `parse_type_alias_where_tail` -/// / `fold_type_alias_where_parts`); the leaves are `SurfaceExpr::Call` -/// (e.g. `range(min: 1)`, `brand("X")`) or `SurfaceExpr::Var` (bare -/// predicates like `non_empty`). Per Path (a) RATIFIED at gunbc#828 -/// `issuecomment-4390760353`, returns the worst-case validation across all -/// leaves: any single malformed registered predicate fails the whole clause -/// closed; any single non-registered leaf falls through to live resolution. -fn validate_where_clause(expr: &SurfaceExpr, carrier_chain: &[String]) -> PredicateValidation { - if let SurfaceExpr::Operator { - op: OperatorKind::Logical(LogicalOp::And), - args, - .. - } = expr - { - let mut all_registered = true; - for arg in args { - match validate_where_clause(arg, carrier_chain) { - PredicateValidation::Registered => {} - PredicateValidation::RegisteredButMalformed { reason, span } => { - return PredicateValidation::RegisteredButMalformed { reason, span }; - } - PredicateValidation::NotRegistered => all_registered = false, - } - } - return if all_registered { - PredicateValidation::Registered - } else { - PredicateValidation::NotRegistered - }; - } - validate_predicate_clause(expr, carrier_chain) -} - -/// P3 / “facts flow forward” for registered-predicate refinements: allocate -/// a **non-Arrow** declaration id used only as `Declaration::refinement` for -/// these aliases. Refinement discharge in infer requires a `Arrow` + -/// `UserDefined` `Bind` predicate; this placeholder uses a `Conj` so it is -/// never mistaken for a lowered `Bool` predicate, except for identity on the -/// same `DeclarationId` (the alias matches itself at call sites). Successor -/// to `alloc_deferred_types_dag_refinement_placeholder` (PB-1 file-path -/// special-case retired in S9 Slice 2.5 Path 3). -fn alloc_registered_refinement_placeholder( - dag: &mut Dag, - alias_name: &str, - span: SourceSpan, -) -> DeclarationId { - let id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id, - name: Some(format!("")), - connective: TypeConnective::Conj { children: vec![] }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - id -} - -/// DB-11 (3a.3): lower a parameter's `where` refinement into a -/// predicate `Declaration` and a refined type `Declaration`. -/// -/// - `base_decl_id`: the parameter's declared type declaration -/// (e.g. `Int` for `d: Int where d != 0`). -/// - `predicate`: the parsed surface expression after `where`. Lowered -/// in an isolated scope containing only the parameter (bound to a -/// fresh port typed as `base_decl_id`). -/// - Returns a refined type Declaration whose connective is -/// `Atom(ResolvedIdentifier(base_decl_id))` (structurally -/// equivalent to the base type) with `refinement: Some(pred_decl)` -/// pointing at the predicate declaration. -/// -/// The predicate is itself a Declaration with an `Arrow` connective -/// taking the base type and returning `Bool`, with body -/// `UserDefined(bind_id)` pointing at a Bind that owns the predicate -/// sub-DAG. The Bind's `params[0]` is the predicate parameter port — -/// structural equality on predicates treats this slot as "the refined -/// parameter" and pairs it across both sides. -fn lower_parameter_refinement( - base_decl_id: DeclarationId, - predicate: &SurfaceExpr, - param_name: &str, - symbols: &HashMap, - dag: &mut Dag, - param_span: SourceSpan, -) -> DeclarationId { - let pred_decl_id = build_refinement_predicate_declaration( - base_decl_id, - predicate, - param_name, - symbols, - dag, - param_span.clone(), - false, - ); - let refined_id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: refined_id, - name: None, - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(base_decl_id)), - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(pred_decl_id), - nominal_opacity: None, - span: param_span, - }); - refined_id -} - -fn seed_function_signature( - name: &str, - params: &[SurfaceParam], - return_type: &SurfaceType, - body: ArrowBody, - dag: &mut Dag, - symbols: &HashMap, -) { - let fn_decl_id = symbols[name]; - let local = local_scope_from_parent(dag, fn_decl_id); - // DB-11 (3a.3) phase-ordering fix: seed the Arrow with BASE - // declaration ids only. Parameter `where` clauses are lowered by - // `lower_parameter_refinements_phase`, which runs AFTER the data - // pre-pass populates top-level `data` declarations' connectives - // and `value_body`s. Lowering a predicate here would evaluate any - // references to top-level data constants against placeholder - // declarations — the references would mark `Unresolved` even - // though the constants are valid. - let param_decl_inputs: Vec = params - .iter() - .map(|p| type_to_declaration_id(&p.ty, symbols, &local, dag)) - .collect(); - let return_decl_id = type_to_declaration_id(return_type, symbols, &local, dag); - dag.declaration_mut(fn_decl_id).connective = TypeConnective::Arrow { - inputs: param_decl_inputs, - output: return_decl_id, - body, - }; -} - -/// DB-11 (3a.3): lower parameter `where` clauses for every Fn / -/// FnExternalBody item and update the fn's Arrow inputs with the -/// refined declaration ids. Runs between the data pre-pass and the -/// main fn-body pass so references inside predicates to top-level -/// `data` constants see fully-lowered declarations (not placeholders) -/// and resolve cleanly. -/// -/// Sole caller of `lower_parameter_refinement` for parameter `where` -/// clauses — preserves single construction authority even though -/// the work is split off from seeding. The alternative (lowering -/// refinements at seed time) ordered-broke predicates that referenced -/// top-level data; the alternative (lowering at fn-body time) split -/// the authority across `Fn` (body path) and `FnExternalBody` (which -/// has no body to hook into). One dedicated phase handles both. -fn lower_parameter_refinements_phase( - dag: &mut Dag, - module: &SurfaceModule, - symbols: &HashMap, - is_first: &[bool], -) { - for (idx, item) in module.items.iter().enumerate() { - if !is_first[idx] { - continue; - } - let (name, params) = match item { - SurfaceItem::Fn { name, params, .. } => (name, params), - SurfaceItem::FnExternalBody { name, params, .. } => (name, params), - _ => continue, - }; - let fn_decl_id = symbols[name]; - // Read the seeded Arrow's inputs and output (set by - // `seed_function_signature` to the base declarations). - let (existing_inputs, output, body) = match &dag.declaration(fn_decl_id).connective { - TypeConnective::Arrow { - inputs, - output, - body, - } => (inputs.clone(), *output, body.clone()), - _ => continue, - }; - let mut refined_inputs = Vec::with_capacity(params.len()); - for (param, &base_decl) in params.iter().zip(existing_inputs.iter()) { - let input_decl = match ¶m.refinement { - Some(predicate) => { - match refinement_predicate_out_of_fragment(predicate) { - Some((shape_label, span)) => { - // DB-11 (3a.3) fail-closed boundary. The - // discharge walker (`predicate_discharges` + - // `refinement_ports_equal`) and the - // composite-narrowing clone - // (`clone_predicate_body`) both model only - // `Value` and `Transform` predicate bodies. - // Admitting a `where` predicate that lowers - // through `Branch` / `Loop` / `Bind` would - // produce a substrate state the consumers - // silently disagree about — discharge would - // reject matching shapes as "not equal," and - // narrowing would discard the composite. - // Reject at the lowering boundary so the - // user gets an honest "unsupported shape" - // diagnostic instead of a misleading - // downstream mismatch. - report_declaration_error( - dag, - Diagnostic::ResolveError { - name: format!( - "`where` predicate shape not supported in \ - DB-11 3a.3: `{shape_label}` lowers through \ - a Branch/Loop/Bind node, but the discharge \ - walker and composite-narrowing path only \ - support Value and Transform expression \ - bodies. Use a direct comparison or a call \ - to a Bool-returning helper instead." - ), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("LoweringDiagnostic"), - span, - }, - ); - base_decl - } - None => lower_parameter_refinement( - base_decl, - predicate, - ¶m.name, - symbols, - dag, - param.ty.span().clone(), - ), - } - } - None => base_decl, - }; - refined_inputs.push(input_decl); - } - dag.declaration_mut(fn_decl_id).connective = TypeConnective::Arrow { - inputs: refined_inputs, - output, - body, - }; - } -} - -/// DB-11: lower `type Name = T where …` after the data pre-pass so -/// predicates can reference top-level `data` (same phase ordering as -/// [`lower_parameter_refinements_phase`]). -/// -/// Predicate lowering uses [`build_refinement_predicate_declaration`] with -/// `bind_name = Name`: the `where` expression resolves `Var`s spelling the alias -/// identifier to the refined base type `T`. Authors write the subject as the -/// alias name; there is no separate hidden parameter symbol. -/// -/// **Predicate registry (S9 Slice 2.5 — Option A revised RATIFIED at -/// gunbc#828 `issuecomment-4392245968`, post Path 3 / Path (a) cascade).** -/// Each `where` clause is dispatched per [`validate_where_clause`]: -/// - **Registered + valid carrier + valid arg shape**: if -/// [`registered_predicate_synthesized_body`] returns `Some`, the predicate -/// lowers to a real `Bool` body via -/// [`build_refinement_predicate_declaration`] (`gt_zero`, `unicode_scalar`, -/// `range`, `brand`). -/// Otherwise it gets a `Conj`-shaped placeholder via -/// [`alloc_registered_refinement_placeholder`] (P3 facts-flow-forward — -/// alias still carries a named refinement; body synthesis is the named -/// follow-on rung; currently `non_empty` remains placeholder-only). -/// - **Registered but malformed** (carrier-incompatible, arg-shape mismatch, -/// duplicate field, bare-with-empty-call): fail-closed via -/// `Diagnostic::ResolveError`, no refinement allocated. -/// - **Unregistered** (e.g. `pattern`, `format`, `content` — STRUCTURALLY -/// ABSENT from [`KNOWN_PREDICATES`] until Q-Regex-Primitive lands as a -/// separate substrate-fact-introduction): falls through to live resolution -/// in [`build_refinement_predicate_declaration`], which surfaces a -/// `Diagnostic::ResolveError` since the predicate name does not resolve as -/// a callable. The 11 `dsl/std/types.dag` declarations that previously -/// used these predicates have dropped their where-clauses with inline -/// restoration receipts pointing at the Q-Regex-Primitive landing. -/// -/// Replaces the prior PB-1 file-path special case -/// (`span.file == "dsl/std/types.dag"`). Per -/// `feedback_no_textual_enforcement_bridges`: gating structural behavior on -/// a textual file identifier was the anti-pattern; the registry IS the -/// substrate-faithful authority for predicate-name resolution. -/// -/// **Dissolution (retire the placeholder branch when):** the bootstrap -/// supplies a body synthesis for each remaining registered predicate -/// (Gap 1 discharge mechanism for `non_empty` / `brand`; Gap 3 -/// integer-routing fix for `range`); at that point every registered -/// predicate routes through the live [`build_refinement_predicate_declaration`] -/// path and the placeholder allocation can be deleted. -fn lower_type_alias_refinements_phase( - dag: &mut Dag, - module: &SurfaceModule, - symbols: &HashMap, - is_first: &[bool], -) { - for (idx, item) in module.items.iter().enumerate() { - if !is_first[idx] { - continue; - } - let SurfaceItem::TypeAlias { - name, - target, - refinement, - span, - .. - } = item - else { - continue; - }; - let Some(predicate) = refinement.as_ref() else { - continue; - }; - let decl_id = *symbols - .get(name) - .expect("type alias name missing from symbol table (first pass must register it)"); - if let Some((shape_label, frag_span)) = refinement_predicate_out_of_fragment(predicate) { - report_declaration_error( - dag, - Diagnostic::ResolveError { - name: format!( - "`where` predicate shape not supported in \ - DB-11 3a.3: `{shape_label}` lowers through \ - a Branch/Loop/Bind node, but the discharge \ - walker and composite-narrowing path only \ - support Value and Transform expression \ - bodies. Use a direct comparison or a call \ - to a Bool-returning helper instead." - ), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - span: frag_span, - }, - ); - continue; - } - let local = local_scope_from_parent(dag, decl_id); - let base_decl_id = type_to_declaration_id(target, symbols, &local, dag); - dag.declaration_mut(decl_id).connective = - TypeConnective::Atom(AtomPayload::ResolvedByStructure(base_decl_id)); - - // S9 Slice 2.5 (Path (a) RATIFIED at gunbc#828 issuecomment-4390760353) - // — replaces prior PB-1 file-path special case - // (`span.file == "dsl/std/types.dag"`) with a predicate-name registry - // plus carrier + arg-shape contract. See `KNOWN_PREDICATES`, - // `carrier_chain_names`, and `validate_where_clause`. A registered - // predicate applied to an allowed carrier with valid arg shape gets a - // placeholder refinement (P3 facts-flow-forward — alias still carries - // a named refinement; predicate-body lowering is the named follow-on - // ladder rung). A registered predicate with malformed carrier or - // arg-shape produces `Diagnostic::ResolveError` directly — fail-closed - // per Codex/openai-pro REQUEST_CHANGES at PR #1846 (`92758dd0` / - // `788d6acb` / `e2698434`). An unregistered predicate falls through - // to live resolution unchanged. - let carrier_chain = carrier_chain_names(dag, base_decl_id); - match validate_where_clause(predicate, &carrier_chain) { - PredicateValidation::Registered => { - // Path (a) Rung 3 (S9 Slice 2.5): for predicates whose body - // can be synthesized from existing substrate primitives, - // lower a real `Bool`-returning predicate body via - // `build_refinement_predicate_declaration` rather than - // allocating a `Conj`-shaped placeholder. Synthesizable today: - // `gt_zero`, `unicode_scalar`, `range`, `brand` (see `synthesize_predicate_body`). - match registered_predicate_synthesized_body(predicate, name, &carrier_chain) { - BodySynthOutcome::AllSynthesized(synthesized) => { - let pred_decl_id = build_refinement_predicate_declaration( - base_decl_id, - &synthesized, - name, - symbols, - dag, - span.clone(), - true, - ); - dag.declaration_mut(decl_id).refinement = Some(pred_decl_id); - } - BodySynthOutcome::AllPlaceholder => { - let ph = alloc_registered_refinement_placeholder(dag, name, span.clone()); - dag.declaration_mut(decl_id).refinement = Some(ph); - } - BodySynthOutcome::Mixed { - synthesized_names, - unsynthesized_names, - } => { - // openai-pro REQUEST_CHANGES at PR #1846 (`79c4da09`): - // mixed clauses (synthesizable + unsynthesizable - // registered predicates combined via And) cannot route - // to a single placeholder without silently weakening - // the synthesized facts. Fail-closed via - // `Diagnostic::ResolveError` until per-leaf refinement - // representation lands. - report_declaration_error( - dag, - Diagnostic::ResolveError { - name: format!( - "registered `where` clause mixes \ - body-synthesized predicates ({}) with \ - placeholder-only predicates ({}); the \ - synthesized facts cannot collapse into a \ - single placeholder without losing \ - enforcement. Author the predicates as \ - separate type aliases until per-leaf \ - refinement representation lands.", - synthesized_names.join(", "), - unsynthesized_names.join(", ") - ), - span: span.clone(), - correction: - crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - }, - ); - } - } - continue; - } - PredicateValidation::RegisteredButMalformed { - reason, - span: pred_span, - } => { - report_declaration_error( - dag, - Diagnostic::ResolveError { - name: reason, - span: pred_span, - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - }, - ); - continue; - } - PredicateValidation::NotRegistered => {} - } - let pred_decl_id = build_refinement_predicate_declaration( - base_decl_id, - predicate, - name, - symbols, - dag, - span.clone(), - false, - ); - dag.declaration_mut(decl_id).refinement = Some(pred_decl_id); - } -} - -/// DB-11 / T-Substrate scalar-literal refinement boundary. -/// -/// Top-level `data` bodies lower before alias refinements are attached -/// so refinement predicates can reference data constants. That means -/// `lower_scalar_literal_for_type` can only check base scalar -/// cardinality in the data pre-pass. After alias refinements land, this -/// validation pass rejects any already-scalar-lowered data declaration -/// whose declared type now carries a lowered predicate refinement that -/// cannot be **statically discharged** for that literal (including literals -/// nested inside structural data bodies). Synthesizable registry predicates -/// (`gt_zero`, `unicode_scalar`, `range`, `brand`, nested `And`/`Or`) are -/// evaluated via the same lowered `Transform` fragment as narrowing discharge; -/// unsupported shapes fail closed. Deferred placeholders are skipped because they intentionally -/// carry no lowered predicate to discharge until their PB-1 dissolution -/// trigger lands. -fn validate_scalar_data_refinements_phase( - dag: &mut Dag, - module: &SurfaceModule, - symbols: &HashMap, - is_first: &[bool], -) { - for (idx, item) in module.items.iter().enumerate() { - if !is_first[idx] { - continue; - } - let SurfaceItem::Data { - name, body_span, .. - } = item - else { - continue; - }; - let Some(&decl_id) = symbols.get(name) else { - continue; - }; - let decl = dag.declaration(decl_id); - let Some(expected) = decl.meta_tag else { - continue; - }; - let Some(value_body) = decl.value_body.as_ref() else { - continue; - }; - if !value_body_contains_undischarged_scalar_literal(dag, expected, value_body) { - continue; - } - dag.declaration_mut(decl_id).value_body = None; - report_declaration_error( - dag, - Diagnostic::ResolveError { - name: format!( - "data `{name}` scalar literal does not satisfy the expected \ - `where` refinement — no narrowing branch in scope" - ), - span: body_span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - }, - ); - } -} - -fn value_body_contains_undischarged_scalar_literal( - dag: &Dag, - expected_type: DeclarationId, - value_body: &crate::dag::ValueBody, -) -> bool { - match value_body { - crate::dag::ValueBody::Scalar(bits) => { - scalar_literal_must_reject_for_refinement(dag, bits, expected_type) - } - crate::dag::ValueBody::Structural { fields } => { - structural_fields_contain_undischarged_scalar_literal(dag, expected_type, fields) - } - crate::dag::ValueBody::List(values) => { - list_element_type(dag, expected_type).is_some_and(|element_type| { - values.iter().any(|element| { - field_value_contains_undischarged_scalar_literal(dag, element_type, element) - }) - }) - } - crate::dag::ValueBody::Map(entries) => { - map_value_type(dag, expected_type).is_some_and(|value_type| { - entries.entries().iter().any(|(_, value)| { - field_value_contains_undischarged_scalar_literal(dag, value_type, value) - }) - }) - } - crate::dag::ValueBody::Unparsed(_) => false, - } -} - -fn structural_fields_contain_undischarged_scalar_literal( - dag: &Dag, - expected_type: DeclarationId, - fields: &[(String, crate::dag::FieldValue)], -) -> bool { - let Some(conj_id) = walk_to_conj_decl(dag, expected_type) else { - return false; - }; - let TypeConnective::Conj { children } = &dag.declaration(conj_id).connective else { - return false; - }; - fields.iter().any(|(label, value)| { - let Some(field) = children.iter().find(|field| field.label == *label) else { - return false; - }; - field_value_contains_undischarged_scalar_literal(dag, field.ty, value) - }) -} - -fn field_value_contains_undischarged_scalar_literal( - dag: &Dag, - expected_type: DeclarationId, - value: &crate::dag::FieldValue, -) -> bool { - match value { - crate::dag::FieldValue::Literal(bits) => { - scalar_literal_must_reject_for_refinement(dag, bits, expected_type) - } - crate::dag::FieldValue::Reference(_) => false, - crate::dag::FieldValue::Record(fields) => { - structural_fields_contain_undischarged_scalar_literal(dag, expected_type, fields) - } - crate::dag::FieldValue::List(values) => { - list_element_type(dag, expected_type).is_some_and(|element_type| { - values.iter().any(|element| { - field_value_contains_undischarged_scalar_literal(dag, element_type, element) - }) - }) - } - crate::dag::FieldValue::Map(entries) => { - map_value_type(dag, expected_type).is_some_and(|value_type| { - entries.entries().iter().any(|(_, value)| { - field_value_contains_undischarged_scalar_literal(dag, value_type, value) - }) - }) - } - crate::dag::FieldValue::Variant { - constructor, - payload, - } => variant_payload_fields_for_lowering(dag, *constructor, Some(expected_type)) - .is_some_and(|fields| { - payload - .iter() - .zip(fields.iter()) - .any(|(value, (_, field_type))| { - field_value_contains_undischarged_scalar_literal(dag, *field_type, value) - }) - }), - } -} - -fn is_deferred_refinement_placeholder(dag: &Dag, refinement: DeclarationId) -> bool { - dag.declaration(refinement) - .name - .as_deref() - .is_some_and(|name| name.starts_with("`. User-written alias/`where` -/// predicates keep ``. Static literal discharge runs **only** on -/// the former so shapes like `PositiveInt > 0` cannot be accidentally proven -/// merely because they lower to the same `Transform` operators as synthesized -/// registry bodies (`int_literal_cardinality_test` discharge traps). -/// -/// **Representation note:** this is intentionally encoded as a `Bind.name` prefix today — a -/// small parallel-authority string convention (rename either prefix without updating both -/// [`build_refinement_predicate_declaration`] and this predicate silently breaks discharge). -/// **Dissolution trigger:** move eligibility to an explicit substrate field (e.g. -/// `RefinementProvenance` on the predicate `Declaration` or a typed enum) once bootstrap / -/// snapshot churn can absorb another Declaration slot — keeps the rule compiler-enforced. -fn refinement_predicate_allows_registry_literal_static_discharge( - dag: &Dag, - pred_decl: DeclarationId, -) -> bool { - let TypeConnective::Arrow { - body: ArrowBody::UserDefined(bind_node_id), - .. - } = &dag.declaration(pred_decl).connective - else { - return false; - }; - let Some(bind) = bind_node_id.bind_opt(dag) else { - return false; - }; - bind.name.starts_with("` tag from [`build_refinement_predicate_declaration`] -/// (`registry_synthesized_body: true`). User-written predicates always fail this -/// gate and keep the historic “no narrowing / no discharge evidence” boundary. -/// -/// Deferred placeholders intentionally return `false` — no proof obligation. -/// -/// Unsupported shapes / evaluator overflow → `true` (fail closed). -fn scalar_literal_must_reject_for_refinement( - dag: &Dag, - literal: &LiteralBits, - expected_type: DeclarationId, -) -> bool { - let mut current = expected_type; - for _ in 0..32 { - let decl = dag.declaration(current); - if let Some(refinement) = decl.refinement { - if is_deferred_refinement_placeholder(dag, refinement) { - return false; - } - if !refinement_predicate_allows_registry_literal_static_discharge(dag, refinement) { - return true; - } - return !literal_statically_satisfies_refinement_predicate(dag, literal, refinement); - } - match &decl.connective { - TypeConnective::Instantiation { template, .. } => current = *template, - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => current = *next, - _ => return false, - } - } - false -} - -/// Infer-facing counterpart to [`scalar_literal_must_reject_for_refinement`]: -/// structural equivalence can unify a callee refined alias carrier with canonical -/// `Int` **before** the argument port nominally [`Decision::Set`]s — scalar -/// literals that pass the same gate-20 static discharge as lowering narrow the port. -pub(crate) fn int_literal_bigint_statically_discharges_refinement_chain( - dag: &Dag, - literal: &BigInt, - expected_type: DeclarationId, -) -> bool { - let bits = LiteralBits::Int(literal.to_string()); - !scalar_literal_must_reject_for_refinement(dag, &bits, expected_type) -} - -fn literal_statically_satisfies_refinement_predicate( - dag: &Dag, - literal: &LiteralBits, - pred_decl: DeclarationId, -) -> bool { - let LiteralBits::Int(s) = literal else { - return false; - }; - let Ok(value) = BigInt::from_str(s.as_str()) else { - return false; - }; - let Some((param_port, body_port)) = outer_predicate_slots(dag, pred_decl) else { - return false; - }; - eval_int_refinement_expr_port(dag, body_port, param_port, &value, 0).unwrap_or(false) -} - -fn eval_int_refinement_expr_port( - dag: &Dag, - port: PortId, - param_port: PortId, - value: &BigInt, - depth: usize, -) -> Option { - if depth >= 64 { - return None; - } - let nid = dag.port(port).produced_by?; - let Behavior::Transform(t) = dag.node(nid) else { - return None; - }; - match &t.target { - TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)) => { - let l = eval_int_refinement_expr_port(dag, t.inputs[0], param_port, value, depth + 1)?; - let r = eval_int_refinement_expr_port(dag, t.inputs[1], param_port, value, depth + 1)?; - Some(l && r) - } - TransformTarget::Operator(OperatorKind::Logical(LogicalOp::Or)) => { - let l = eval_int_refinement_expr_port(dag, t.inputs[0], param_port, value, depth + 1)?; - let r = eval_int_refinement_expr_port(dag, t.inputs[1], param_port, value, depth + 1)?; - Some(l || r) - } - TransformTarget::Operator(OperatorKind::Comparison(op)) => { - eval_int_comparison_port(dag, *op, t.inputs[0], t.inputs[1], param_port, value) - } - _ => None, - } -} - -fn eval_int_comparison_port( - dag: &Dag, - op: ComparisonOp, - lhs: PortId, - rhs: PortId, - param_port: PortId, - value: &BigInt, -) -> Option { - match op { - ComparisonOp::Eq => eval_eq_comparison_ports(dag, lhs, rhs, param_port, value), - ComparisonOp::Ge | ComparisonOp::Le | ComparisonOp::Gt => { - let lhs_v = int_operand_for_static_refinement(dag, lhs, param_port, value)?; - let rhs_v = int_operand_for_static_refinement(dag, rhs, param_port, value)?; - let ok = match op { - ComparisonOp::Ge => lhs_v >= rhs_v, - ComparisonOp::Le => lhs_v <= rhs_v, - ComparisonOp::Gt => lhs_v > rhs_v, - _ => return None, - }; - Some(ok) - } - ComparisonOp::Ne | ComparisonOp::Lt => None, - } -} - -fn int_operand_for_static_refinement( - dag: &Dag, - port: PortId, - param_port: PortId, - value: &BigInt, -) -> Option { - if port == param_port { - return Some(value.clone()); - } - let nid = dag.port(port).produced_by?; - let Behavior::Value(v) = dag.node(nid) else { - return None; - }; - match &v.data { - LiteralBits::Int(s) => BigInt::from_str(s.as_str()).ok(), - _ => None, - } -} - -fn string_literal_value_port(dag: &Dag, port: PortId) -> Option<&str> { - let nid = dag.port(port).produced_by?; - let Behavior::Value(v) = dag.node(nid) else { - return None; - }; - match &v.data { - LiteralBits::String(s) => Some(s.as_str()), - _ => None, - } -} - -fn eval_eq_comparison_ports( - dag: &Dag, - lhs: PortId, - rhs: PortId, - param_port: PortId, - value: &BigInt, -) -> Option { - if lhs == param_port && rhs == param_port { - return Some(true); - } - let ls = string_literal_value_port(dag, lhs); - let rs = string_literal_value_port(dag, rhs); - if ls.is_some() || rs.is_some() { - return Some(ls.is_some() && rs == ls); - } - let lv = int_operand_for_static_refinement(dag, lhs, param_port, value); - let rv = int_operand_for_static_refinement(dag, rhs, param_port, value); - match (lv, rv) { - (Some(a), Some(b)) => Some(a == b), - _ => None, - } -} - -/// DB-11 (3a.3) fragment gate. Walks a `where`-predicate -/// `SurfaceExpr` and returns `Some((shape_label, span))` for the -/// first sub-expression whose lowering would produce a `Branch`, -/// `Loop`, or `Bind` behavior — i.e., an out-of-fragment shape that -/// the discharge walker and composite-narrowing clone path cannot -/// compare or reproduce. -/// -/// Supported shapes return `None`: -/// - `Literal`, `Var`, `Path` — leaf Value / field-project -/// Transforms. -/// - `Call` / `Operator` — Transform nodes; arguments are recursed -/// into. -/// -/// Out-of-fragment shapes: -/// - `If` / `Match` — lower to `Branch`. -/// - `Lambda` — lowers to `Bind`. -/// - `Record` / `List` — lower to fail-closed diagnostics at user -/// scope today; still rejected here so the user sees the refinement -/// boundary clearly rather than the generic lowering failure. -fn refinement_predicate_out_of_fragment(expr: &SurfaceExpr) -> Option<(&'static str, SourceSpan)> { - match expr { - SurfaceExpr::Literal { .. } | SurfaceExpr::Var { .. } | SurfaceExpr::Path { .. } => None, - SurfaceExpr::Call { args, .. } - | SurfaceExpr::Operator { args, .. } - | SurfaceExpr::PathCall { args, .. } => { - args.iter().find_map(refinement_predicate_out_of_fragment) - } - SurfaceExpr::Lambda { span, .. } => Some(("lambda", span.clone())), - SurfaceExpr::If { span, .. } => Some(("if", span.clone())), - SurfaceExpr::Match { span, .. } => Some(("match", span.clone())), - SurfaceExpr::VariantRecord { span, .. } => { - Some(("named constructor literal", span.clone())) - } - SurfaceExpr::Record { fields, .. } => fields - .iter() - .find_map(|field| refinement_predicate_out_of_fragment(&field.value)), - SurfaceExpr::List { elements, .. } => elements - .iter() - .find_map(refinement_predicate_out_of_fragment), - SurfaceExpr::Map { span, .. } => Some(("map literal", span.clone())), - } -} - -/// DB-11 (3a.3) arm-local refinement narrowing. Given an `if` / match -/// guard expression `cond` and the outer scope, if `cond` is a -/// recognizable predicate on a scope-bound name (e.g. `d != 0` where -/// `d` is in scope), returns a new scope where that name is rebound to -/// a freshly-allocated port whose type carries a refinement matching -/// the predicate. The predicate is lowered identically to a parameter -/// refinement, so call-site structural discharge in -/// `infer::decide_transform` treats the two predicates as equal. -/// -/// Returns `None` when the cond doesn't match a narrowing shape, when -/// no scope-bound Var appears in the cond's operand list, or when the -/// outer port's type cannot be recovered. The caller keeps using the -/// unmodified outer scope in that case. -/// -/// Scope of recognition (3a.3 M-sized subset): two-argument -/// `SurfaceExpr::Operator` / `SurfaceExpr::Call` forms where exactly -/// one operand is a `Var` bound in the outer scope. More complex -/// predicate shapes (conjunctions, nested calls on the narrowed -/// parameter, negation-of-predicate on else-arm) fall through with -/// `None` — users either add an explicit guard or live without -/// narrowing. Expanding this recognition is 3a.3-follow-up work. -fn narrow_scope_for_predicate( - cond: &SurfaceExpr, - scope: &HashMap, - symbols: &HashMap, - dag: &mut Dag, -) -> Option> { - let narrow_name = narrowable_var_name(cond, scope)?; - let &outer_port = scope.get(&narrow_name)?; - let outer_shape = match dag.port(outer_port).state() { - crate::dag::PortState::Resolved(ty) => *ty, - _ => return None, - }; - // DB-11 (3a.3) composite-canonical narrowing. Walk past any - // existing refinement to the TRUE BASE; the new refined - // declaration aliases that base directly, not the outer refined - // declaration. No alias chain survives. If the outer port already - // carried a refinement, its predicate body is cloned into the new - // composite Bind with the refined-parameter slot re-pointed at the - // composite's fresh param, then `&&`-joined with the freshly - // lowered cond — the result is one composite predicate Declaration, - // structurally identical to what a user-written - // `where outer_pred && new_cond` would produce. - let (true_base_decl, outer_pred_decl) = walk_to_refinement_base(dag, outer_shape.declaration); - let refined_decl = build_narrowed_refinement( - dag, - symbols, - true_base_decl, - outer_pred_decl, - cond, - &narrow_name, - )?; - let narrow_port = dag.alloc_port(None); - match declaration_to_port_shape(refined_decl, dag, surface_expr_span(cond)) { - Ok(shape) => dag.set_port_type(narrow_port, shape), - Err(_) => return None, - } - let mut narrowed = scope.clone(); - narrowed.insert(narrow_name, narrow_port); - Some(narrowed) -} - -/// Walk the `Atom(ResolvedIdentifier(...))` chain from a parameter's -/// declaration, skipping past any refinement-carrier declarations to -/// reach the true base declaration. Returns `(base_decl, deepest_refinement)` -/// where `deepest_refinement` is the top-level refinement that was on -/// the input declaration (if any) — the outer predicate that the -/// caller wants to compose with a new narrowing predicate. -/// -/// For a freshly seeded `Int where d != 0` parameter, returns -/// `(Int_decl, Some(d_ne_0_pred_decl))`. For an unrefined `Int` -/// parameter, returns `(Int_decl, None)`. The loop is depth-bounded -/// so pathological cyclic aliases can't hang lowering. -fn walk_to_refinement_base( - dag: &Dag, - decl_id: DeclarationId, -) -> (DeclarationId, Option) { - const DEPTH_LIMIT: usize = 32; - let top_refinement = dag.declaration(decl_id).refinement; - let mut current = decl_id; - for _ in 0..DEPTH_LIMIT { - let decl = dag.declaration(current); - if decl.refinement.is_none() { - return (current, top_refinement); - } - match &decl.connective { - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - current = *next; - } - _ => return (current, top_refinement), - } - } - (current, top_refinement) -} - -/// Build a refined parameter declaration for a narrowed scope. The -/// returned declaration aliases `true_base_decl` directly (no alias -/// chain) and carries a single composite predicate: -/// -/// - If `outer_pred_decl` is `None`, the predicate is the freshly -/// lowered `new_cond` — identical shape to what a bare -/// `where new_cond` parameter clause would produce. -/// - If `outer_pred_decl` is `Some`, the predicate body is -/// `outer_body && new_body`, where `outer_body` is cloned from -/// the outer predicate's `Bind` with its param slot re-pointed at -/// the fresh composite param. Structurally identical to -/// `where outer_pred_source && new_cond_source` if the user had -/// written it that way. -fn build_narrowed_refinement( - dag: &mut Dag, - symbols: &HashMap, - true_base_decl: DeclarationId, - outer_pred_decl: Option, - new_cond: &SurfaceExpr, - narrow_name: &str, -) -> Option { - let Some(outer_pred_decl) = outer_pred_decl else { - // No existing refinement — the fresh predicate IS the - // refinement. Same shape as a seeded `where` clause. - return Some(lower_parameter_refinement( - true_base_decl, - new_cond, - narrow_name, - symbols, - dag, - surface_expr_span(new_cond).clone(), - )); - }; - - let pred_span = surface_expr_span(new_cond).clone(); - // Allocate a fresh composite parameter port typed as the true - // base — the composite predicate's sole parameter slot. - let composite_param_port = dag.alloc_port(None); - match declaration_to_port_shape(true_base_decl, dag, &pred_span) { - Ok(shape) => dag.set_port_type(composite_param_port, shape), - Err(diag) => dag.mark_unresolved(composite_param_port, diag), - } - - // Clone the outer predicate's body into the composite's scope, - // substituting outer's Bind.params[0] → composite_param_port. - // Narrowing operates within a single function's scope; no - // TypeParam substitution applies, so pass an empty SubstStack - // (DB-16: the Transform-target walk becomes a structural no-op). - let (outer_param_port, outer_value_port) = outer_predicate_slots(dag, outer_pred_decl)?; - let outer_cloned_value = clone_predicate_body( - dag, - outer_value_port, - outer_param_port, - composite_param_port, - &SubstStack::new(), - 0, - )?; - - // Lower the new cond in a scope where narrow_name resolves to - // composite_param_port. - let mut pred_scope: HashMap = HashMap::new(); - pred_scope.insert(narrow_name.to_string(), composite_param_port); - let pred_callable_scope: CallableScope = CallableScope::new(); - let bool_decl_id = symbols - .get("Bool") - .copied() - .unwrap_or_else(|| alloc_identifier_stub(dag, "Bool", &pred_span)); - let new_value_port = lower_expr( - new_cond, - dag, - &pred_scope, - &pred_callable_scope, - symbols, - Some(bool_decl_id), - ); - - // `outer_cloned && new` — single Transform(Logical(And)). The - // output port inherits Bool shape via `resolve_operator_arrow` - // during inference. - let and_node_id = dag.alloc_node_id(); - let and_output = dag.alloc_port(Some(and_node_id)); - dag.push_node(Behavior::Transform(TransformNode { - id: and_node_id, - target: TransformTarget::Operator(OperatorKind::Logical(LogicalOp::And)), - inputs: vec![outer_cloned_value, new_value_port], - output: and_output, - span: pred_span.clone(), - })); - - // Wrap in the composite Bind; single params slot, composite body. - let bind_id = dag.alloc_node_id(); - dag.push_node(Behavior::Bind(BindNode { - id: bind_id, - name: format!(""), - value: and_output, - params: vec![composite_param_port], - span: pred_span.clone(), - lane2_workflow: None, - emit_participation: None, - })); - - // Predicate declaration with Arrow body, same shape as - // `lower_parameter_refinement` produces — so discharge logic - // does not need a special case. - let pred_decl_id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: pred_decl_id, - name: None, - connective: TypeConnective::Arrow { - inputs: vec![true_base_decl], - output: bool_decl_id, - body: ArrowBody::UserDefined( - BindNodeId::from_bind_node(dag, bind_id) - .expect("UserDefined Arrow body bind id must point at a Bind"), - ), - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: pred_span.clone(), - }); - - // Refined type declaration aliasing the TRUE BASE (not the - // outer refined decl) — no alias chain. - let refined_id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: refined_id, - name: None, - connective: TypeConnective::Atom(AtomPayload::ResolvedByStructure(true_base_decl)), - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: Some(pred_decl_id), - nominal_opacity: None, - span: pred_span, - }); - Some(refined_id) -} - -/// Read a predicate declaration's Bind slots: the sole parameter -/// port (`Bind.params[0]`) and the body value port (`Bind.value`). -/// Returns `None` if the predicate declaration isn't the expected -/// `Arrow { body: UserDefined(bind) }` shape with a single param -/// slot — in which case composite narrowing falls back to treating -/// the outer refinement as absent (safe degradation). -pub(crate) fn outer_predicate_slots( - dag: &Dag, - pred_decl: DeclarationId, -) -> Option<(PortId, PortId)> { - let TypeConnective::Arrow { - body: ArrowBody::UserDefined(bind_id), - .. - } = &dag.declaration(pred_decl).connective - else { - return None; - }; - let bind = (*bind_id).bind(dag); - let param = *bind.params.first()?; - Some((param, bind.value)) -} - -/// Clone a predicate body sub-DAG, rewriting every reference to -/// `substitute_from` into `substitute_to`, and routing each -/// `Transform` target's declaration-level references through -/// `concretize_decl_with_subst` so generic-helper calls and -/// generic-record projections land on concretized declarations. -/// Fresh node ids + port ids are allocated for each cloned node so -/// the result is structurally independent from the source — two -/// composite Binds in the same DAG do not share intermediate ports. -/// -/// Walks only `Value` and `Transform` nodes, matching the predicate -/// fragment that `predicates_structurally_equal` already accepts. -/// `Branch` / `Loop` / `Bind` in a predicate body are out of scope -/// for DB-11's admitted fragment — clone returns `None` and callers -/// treat that as "cannot produce a well-formed composite." -/// -/// DB-16 (3a.3 closure): the `subst` parameter carries the active -/// substitution stack so Transform targets with `Callable(id)` referencing -/// template TypeParams get re-rooted to their concrete instantiations. -/// `ResolvedFieldProject` keeps only its label; the substituted parent input -/// type remains the authority for the projected child. DB-11 callers -/// (`build_narrowed_refinement`) pass an empty `SubstStack`, which makes the -/// Transform-target walk a structural no-op (no substitution lookup ever -/// fires). -pub(crate) fn clone_predicate_body( - dag: &mut Dag, - source_port: PortId, - substitute_from: PortId, - substitute_to: PortId, - subst: &SubstStack, - depth: usize, -) -> Option { - const DEPTH_LIMIT: usize = 64; - if depth >= DEPTH_LIMIT { - return None; - } - if source_port == substitute_from { - return Some(substitute_to); - } - let Some(node_id) = dag.port(source_port).produced_by else { - // No producer — external port (e.g. another function's - // param). Reuse directly; no rewrite needed. - return Some(source_port); - }; - let cloned = match dag.node(node_id).clone() { - Behavior::Value(v) => { - let new_node_id = dag.alloc_node_id(); - let new_output = dag.alloc_port(Some(new_node_id)); - dag.push_node(Behavior::Value(ValueNode { - id: new_node_id, - data: v.data, - output: new_output, - span: v.span, - lane2_workflow: v.lane2_workflow.clone(), - })); - new_output - } - Behavior::Transform(t) => { - let mut new_inputs = Vec::with_capacity(t.inputs.len()); - for input_port in &t.inputs { - new_inputs.push(clone_predicate_body( - dag, - *input_port, - substitute_from, - substitute_to, - subst, - depth + 1, - )?); - } - let new_target = substitute_transform_target(dag, t.target, subst); - let new_node_id = dag.alloc_node_id(); - let new_output = dag.alloc_port(Some(new_node_id)); - dag.push_node(Behavior::Transform(TransformNode { - id: new_node_id, - target: new_target, - inputs: new_inputs, - output: new_output, - span: t.span, - })); - new_output - } - Behavior::Branch(_) | Behavior::Loop(_) | Behavior::Bind(_) => { - // Out-of-fragment predicate shapes — tracked as DB-11 - // 3a.3 ROADMAP debt (admitted surface > supported - // fragment). Fail-closed at narrowing time rather than - // producing a malformed composite. - return None; - } - }; - Some(cloned) -} - -/// DB-16 (3a.3 closure): re-root a `TransformTarget`'s declaration- -/// level references through the active substitution stack so cloned -/// predicate bodies that reference generic helpers or generic-record -/// projections land on concretized declarations. -/// -/// - `Operator(_)`: no substitution. Operator kinds are intrinsic; -/// `resolve_operator_arrow` handles TypeParam operands through its -/// own substitution pipeline at inference time. -/// - `ResolvedFieldProject { field_label }`: no substitution. The parent -/// input type remains the authority; inference resolves the label through -/// the concrete parent after substitution. -/// - `Callable(id)`: route `id` through `concretize_decl_with_subst`. -/// When `id` is an `Instantiation` whose arguments reference -/// substitution-bound TypeParams, the result is a fresh -/// Instantiation with concretized arguments, deduped via -/// `find_equivalent_anonymous_instantiation`. -/// -/// With an empty `SubstStack`, every call to -/// `concretize_decl_with_subst` short-circuits to the input id (no -/// TypeParam lookup ever hits) — DB-11 callers see no behavior change. -fn substitute_transform_target( - dag: &mut Dag, - target: TransformTarget, - subst: &SubstStack, -) -> TransformTarget { - match target { - TransformTarget::Operator(_) => target, - TransformTarget::UnresolvedFieldProject { .. } => target, - TransformTarget::ResolvedFieldProject { .. } => target, - TransformTarget::Callable(id) => { - TransformTarget::Callable(concretize_decl_with_subst(dag, id, subst, 0)) - } - } -} - -/// Return the name of the single scope-bound `Var` referenced in a -/// predicate-shaped cond expression, or `None` if the cond doesn't -/// match the narrowing-eligible shape. -/// -/// A cond is narrowing-eligible iff: -/// - it is a two-argument `Operator` or `Call` expression, AND -/// - it references **exactly one** scope-bound name (the candidate -/// refined parameter). Top-level symbols and literals are fine. -/// -/// The single-scope-bound-var requirement is load-bearing: a predicate -/// that references two scope-locals (e.g. `x != y`) would need a -/// multi-arity refinement, which DB-11's structural-equality proof -/// theory does not model. Inside a match-arm body where a pattern -/// binding (e.g. `Cons(payload)`) is in scope, predicates like -/// `behavior_id(payload.head) == node_id` have two scope-bound vars -/// (`payload` and `node_id`) and skip narrowing — otherwise the -/// predicate-lowering side effects would attempt to resolve the -/// non-candidate vars in an isolated scope and fail, polluting the -/// main DAG with unresolvable sub-expressions. -fn narrowable_var_name(cond: &SurfaceExpr, scope: &HashMap) -> Option { - match cond { - SurfaceExpr::Operator { args, .. } if args.len() == 2 => {} - SurfaceExpr::Call { args, .. } if args.len() == 2 => {} - _ => return None, - } - let mut seen: std::collections::HashSet = std::collections::HashSet::new(); - collect_scope_bound_free_vars(cond, scope, &mut seen); - if seen.len() == 1 { - seen.into_iter().next() - } else { - None - } -} - -/// Walk a surface expression and collect the names of all free -/// variables that resolve to entries in `scope`. Lambda parameter -/// shadowing and match-arm binding shadowing are respected. Top-level -/// declarations (not in `scope`) are filtered out by construction -/// since `scope` holds only local-variable bindings, not symbols. -fn collect_scope_bound_free_vars( - expr: &SurfaceExpr, - scope: &HashMap, - out: &mut std::collections::HashSet, -) { - match expr { - SurfaceExpr::Var { name, .. } => { - if scope.contains_key(name) { - out.insert(name.clone()); - } - } - SurfaceExpr::Literal { .. } => {} - SurfaceExpr::Path { segments, .. } => { - // The head of a dotted path is a local-variable reference - // when it resolves to scope (field access). A top-level - // typed path (e.g. `OrderedRing.add`) wouldn't be in - // `scope` so it's filtered out. - if let Some(head) = segments.first() { - if scope.contains_key(head) { - out.insert(head.clone()); - } - } - } - SurfaceExpr::Call { args, .. } | SurfaceExpr::Operator { args, .. } => { - for arg in args { - collect_scope_bound_free_vars(arg, scope, out); - } - } - SurfaceExpr::VariantRecord { fields, .. } => { - for field in fields { - collect_scope_bound_free_vars(&field.value, scope, out); - } - } - SurfaceExpr::Lambda { params, body, .. } => { - let mut shadowed = scope.clone(); - for p in params { - shadowed.remove(p); - } - // Use a placeholder port so `contains_key` would return - // true only for non-shadowed names; we don't use it. - collect_scope_bound_free_vars(body, &shadowed, out); - } - SurfaceExpr::If { - cond, - then_branch, - else_branch, - .. - } => { - collect_scope_bound_free_vars(cond, scope, out); - collect_scope_bound_free_vars(then_branch, scope, out); - collect_scope_bound_free_vars(else_branch, scope, out); - } - SurfaceExpr::Match { - scrutinee, arms, .. - } => { - collect_scope_bound_free_vars(scrutinee, scope, out); - for arm in arms { - let mut arm_scope = scope.clone(); - for binding in pattern_binding_names(&arm.pattern) { - arm_scope.remove(&binding); - } - collect_scope_bound_free_vars(&arm.body, &arm_scope, out); - } - } - SurfaceExpr::Record { fields, .. } => { - for field in fields { - collect_scope_bound_free_vars(&field.value, scope, out); - } - } - SurfaceExpr::List { elements, .. } => { - for el in elements { - collect_scope_bound_free_vars(el, scope, out); - } - } - SurfaceExpr::Map { entries, .. } => { - // Map keys are string literals (no scope-bound names). - // Values can reference scope-bound names like any other - // expression position. - for entry in entries { - collect_scope_bound_free_vars(&entry.value, scope, out); - } - } - SurfaceExpr::PathCall { segments, args, .. } => { - // Like Path: head segment is a local-variable reference - // when it resolves to scope. Plus recurse into args like - // Call. - if let Some(head) = segments.first() { - if scope.contains_key(head) { - out.insert(head.clone()); - } - } - for arg in args { - collect_scope_bound_free_vars(arg, scope, out); - } - } - } -} - -/// Pass 1: allocate a placeholder Declaration for every named top-level -/// item and record `name → DeclarationId` in the symbol table. Let / -/// Module / Import items produce no declaration. -/// -/// Returns `(symbols, is_first)`. `symbols` maps each name to the -/// declaration currently selected by the temporary duplicate-authority -/// preference scaffold shared with `Dag::declaration_by_name`. -/// `is_first[idx]` is false only for items that lose selection to an -/// already-present declaration of the same name. A later higher-rank -/// `src/v3/` declaration can replace a seeded lower-rank duplicate and -/// remain `true`. `lower_into` skips only the losing duplicates so the -/// selected declaration's filled connective is not overwritten later. -/// -/// Duplicate declarations emit a fail-closed `ResolveError` via a -/// phantom port, so the compile surfaces through -/// `Err(CompileError::Semantic)`. The duplicate's own declaration slot -/// is still allocated (for structural consistency in the declaration -/// table), but it stays as a placeholder and is unreachable by name. -fn collect_symbols( - dag: &mut Dag, - items: &[SurfaceItem], -) -> (HashMap, Vec) { - // Seed from already-present declarations with the same temporary - // duplicate-authority preference scaffold as - // `Dag::declaration_by_name`: `src/v3/` declarations outrank - // legacy `dsl/` duplicates. Equal-rank ties remain deterministic - // by insertion order but are not the intended steady-state rule. - // - // **🟡 Scaffold — v3 migration preference mirror.** This mirrors the - // rank policy defined at `Dag::declaration_name_preference_rank`. Kept - // as a scaffold (not deleted) because the duplicates it resolves carry - // v3-only substrate content that cannot yet be hosted under `dsl/std/`. - // Dissolution trigger: when duplicate authorities converge to a single - // canonical home, delete this seeding branch together with the rank - // function in `dag.rs` and remove the preference rule entirely. At that - // point name lookup must resolve against the single surviving authority - // or fail closed on multiple matches. Convergence checklist - // (ROADMAP.md "Post-merge debt"): `module std.effects`, - // `module std.verification`, embedded `http_path` mirror inside - // `src/v3/std/effects.dag`, `module std.computation`, - // `module std.induction`, `module std.termination` (each `dsl/std/*` - // ↔ `src/v3/std/*` duplicate pair — same rank scaffold as effects). - let mut symbols: HashMap = HashMap::new(); - for d in dag.declarations() { - if let Some(name) = &d.name { - match symbols.get(name).copied() { - None => { - symbols.insert(name.clone(), d.id); - } - Some(existing_id) => { - let existing = dag.declaration(existing_id); - let new_rank = declaration_name_preference_rank(&d.span.file); - let existing_rank = declaration_name_preference_rank(&existing.span.file); - if new_rank > existing_rank { - symbols.insert(name.clone(), d.id); - } - } - } - } - } - - seed_symbolic_cost_variant_constructors_for_symbols(dag, &mut symbols); - - let mut is_first = vec![true; items.len()]; - for (idx, item) in items.iter().enumerate() { - // Extract the surface-level name and type parameter list. - // Items that don't allocate declarations: - // - Let bindings (they produce a BindNode at lower time, not - // a Declaration). - // - Module / Import items (parsed facts preserved but have no - // lowered declaration at M1(2.7)). - // Every other surface form allocates one top-level declaration - // with the declared name, including `FnExternalBody` and `Data` - // scaffold forms — their facts flow forward. - let (name, surface_type_params): (String, &[String]) = match item { - SurfaceItem::Let { .. } => continue, - SurfaceItem::Module { .. } => continue, - SurfaceItem::Import { .. } => continue, - SurfaceItem::Fn { - name, type_params, .. - } => (name.clone(), type_params.as_slice()), - SurfaceItem::FnExternalBody { - name, type_params, .. - } => (name.clone(), type_params.as_slice()), - SurfaceItem::Data { name, .. } => (name.clone(), &[]), - SurfaceItem::TypeAtom { - name, type_params, .. - } - | SurfaceItem::TypeRecord { - name, type_params, .. - } - | SurfaceItem::TypeSum { - name, type_params, .. - } - | SurfaceItem::TypeAlias { - name, type_params, .. - } => (name.clone(), type_params.as_slice()), - }; - let span = surface_item_span(item).clone(); - let id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id, - name: Some(name.clone()), - connective: placeholder_connective(&name), - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - - // Allocate TypeParam declarations for this item's generic - // parameters and link them via `Declaration.type_params`. - // Doing this in collect_symbols (pass 1) instead of - // lower_type_* (pass 2) means that by the time ANY other - // module's body references `List`, List's - // `type_params` slot is already populated — so - // `build_template_arguments` can always look up the real - // template parameter id at construction time. No half-valid - // state, no post-sweep fixup pass. - if !surface_type_params.is_empty() { - let mut param_ids = Vec::with_capacity(surface_type_params.len()); - for param in surface_type_params { - let param_id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: param_id, - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam(param.clone())), - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - param_ids.push(param_id); - } - dag.declaration_mut(id).type_params = param_ids; - } - - if let Some(&existing_id) = symbols.get(&name) { - let existing = dag.declaration(existing_id); - let new_rank = declaration_name_preference_rank(&span.file); - let existing_rank = declaration_name_preference_rank(&existing.span.file); - if new_rank > existing_rank { - symbols.insert(name, id); - } else { - is_first[idx] = false; - let existing_span = existing.span.clone(); - report_declaration_error( - dag, - Diagnostic::ResolveError { - name: format!( - "duplicate declaration `{name}` (first declared in `{}` at bytes {}..{})", - existing_span.file, - existing_span.byte_start, - existing_span.byte_end, - ), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("LoweringDiagnostic"), - span, - }, - ); - } - } else { - symbols.insert(name, id); - } - } - (symbols, is_first) -} - -/// Seeds [`SymbolicCost`] coproduct variant **carrier** ids under their surface labels (`ConstantCost`, -/// `LinearCost`, …). Those carriers are anonymous declarations in the substrate (`name: None`), so -/// they never appear in the first-pass name seed — yet call sites spell variant constructors by -/// name. Without this hook, [`try_lower_symbolic_cost_constant_cost_data`] cannot match the -/// `symbols` map (Practice 5 / duplicate authority at data-body edges). -/// -/// `HashMap::entry` via `or_insert` preserves an explicit same-spelling binding when one already -/// exists (user decl or higher-ranked bootstrap duplicate). -fn seed_symbolic_cost_variant_constructors_for_symbols( - dag: &Dag, - symbols: &mut HashMap, -) { - let Some(sym_decl) = dag.declaration_by_name("SymbolicCost") else { - return; - }; - let decl = dag.declaration(sym_decl.id); - let TypeConnective::Disj { variants } = &decl.connective else { - return; - }; - for v in variants { - symbols.entry(v.label.clone()).or_insert(v.ty); - } -} - -fn placeholder_connective(name: &str) -> TypeConnective { - TypeConnective::Atom(AtomPayload::UnresolvedIdentifier(name.to_string())) -} - -fn lower_item( - item: &SurfaceItem, - dag: &mut Dag, - scope: ScopeState, - symbols: &HashMap, - mutual_recursion: &MutualRecursionPlans, - mutual_state: &mut MutualRecursionState, -) -> ScopeState { - let mut scope = scope; - match item { - SurfaceItem::Let { - name, - type_ann, - expr, - } => { - let mut lambda_callable: Option = None; - let value_port = if let SurfaceExpr::Lambda { params, body, span } = expr { - let Some(ty) = type_ann else { - let port = dag.alloc_port(None); - dag.mark_unresolved( - port, - Diagnostic::ResolveError { - name: "lambda expressions currently require an expected function type (for example a `let` annotation or a function-typed parameter position)".to_string(), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("LoweringDiagnostic"), - }, - ); - scope.values.insert(name.clone(), port); - return scope; - }; - let decl_id = type_to_declaration_id(ty, symbols, &HashMap::new(), dag); - let mut lambda_ctx = LambdaLoweringContext { - dag, - scope: &scope.values, - callable_scope: &scope.callables, - symbols, - }; - match lower_lambda_expr(params, body, span, decl_id, &mut lambda_ctx) { - Ok(lambda_decl_id) => { - lambda_callable = Some(lambda_decl_id); - let port = lambda_ctx.dag.alloc_port(None); - match declaration_to_port_shape(decl_id, lambda_ctx.dag, ty.span()) { - Ok(expected) => lambda_ctx.dag.set_port_type(port, expected), - Err(diag) => lambda_ctx.dag.mark_unresolved(port, diag), - } - port - } - Err(diag) => { - let port = lambda_ctx.dag.alloc_port(None); - lambda_ctx.dag.mark_unresolved(port, diag); - port - } - } - } else { - let expected_decl = type_ann - .as_ref() - .map(|ty| type_to_declaration_id(ty, symbols, &HashMap::new(), dag)); - lower_expr( - expr, - dag, - &scope.values, - &scope.callables, - symbols, - expected_decl, - ) - }; - if let Some(ty) = type_ann { - // Compute the annotated type's declaration id ONCE. - // Port TypeShape wraps the same id — no second - // allocation, no lower↔infer identity split. - let local: HashMap = HashMap::new(); - let decl_id = type_to_declaration_id(ty, symbols, &local, dag); - match declaration_to_port_shape(decl_id, dag, ty.span()) { - Ok(declared) => dag.set_port_type(value_port, declared), - Err(diag) => dag.mark_unresolved(value_port, diag), - } - } - let bind_id = dag.alloc_node_id(); - let bind_span = match type_ann { - Some(ty) => ty.span().clone(), - None => surface_expr_span(expr).clone(), - }; - dag.push_node(Behavior::Bind(BindNode { - id: bind_id, - name: name.clone(), - value: value_port, - params: Vec::new(), - span: bind_span, - lane2_workflow: None, - emit_participation: None, - })); - scope.values.insert(name.clone(), value_port); - if let Some(lambda_decl_id) = lambda_callable { - scope.callables.insert(name.clone(), lambda_decl_id); - } - scope - } - SurfaceItem::Fn { - name, - params, - return_type, - body, - span: _, - .. - } => { - scope.values = lower_fn_item_expr_body( - name, - params, - return_type, - body, - dag, - scope.values, - symbols, - mutual_recursion, - mutual_state, - ); - scope - } - SurfaceItem::FnExternalBody { .. } => { - // DB-11 (3a.3): signature was fully built by - // `seed_function_signatures_phase` with - // `ArrowBody::Unparsed(body_span)`. Nothing remains to do - // at body-lowering time — the declaration is already in - // its final form. - scope - } - SurfaceItem::Data { - name, - ty, - body, - body_span, - span: _, - } => { - let pending_refined_function_refs = HashSet::new(); - let mut data_ctx = DataLoweringContext { - dag, - symbols, - pending_refined_function_refs: &pending_refined_function_refs, - invalid_data_lambda_cluster: None, - }; - lower_data_item(name, ty, body.as_ref(), body_span, &mut data_ctx); - scope - } - SurfaceItem::Module { .. } | SurfaceItem::Import { .. } => { - // No-op at M1(2.7). The parsed facts are preserved in the - // SurfaceItem for M2 module scoping to consume; lowering - // doesn't currently need them because name resolution - // spans the flat declaration table. - scope - } - SurfaceItem::TypeAtom { name, .. } => { - let decl_id = symbols[name]; - // Empty product — equivalent to a unit type. - dag.declaration_mut(decl_id).connective = TypeConnective::Conj { - children: Vec::new(), - }; - scope - } - SurfaceItem::TypeRecord { - name, - type_params, - fields, - .. - } => { - lower_type_record(dag, symbols, name, type_params, fields); - scope - } - // E-6: `SurfaceItem::TypeSum.inhabits` is not parse-only — `lower_type_sum` - // writes `Declaration.inhabits`, then `infer::resolve_operator_arrow` and - // emitters' `walk_to_algebra_conj` follow it (Lane 1e-2b / BooleanAlgebra). - SurfaceItem::TypeSum { - name, - type_params, - variants, - inhabits, - .. - } => { - lower_type_sum(dag, symbols, name, type_params, variants, inhabits.as_ref()); - scope - } - SurfaceItem::TypeAlias { - name, - type_params, - nominal_opaque, - target, - .. - } => { - lower_type_alias(dag, symbols, name, type_params, *nominal_opaque, target); - scope - } - } -} - -fn validate_dimension_phantom_surface_item(dag: &mut Dag, item: &SurfaceItem) { - match item { - SurfaceItem::TypeRecord { name, span, .. } => { - if name == "Dimension" && span.file == DIMENSION_STD_AUTHORITY_FILE { - // The record case is validated after field lowering so the - // bridge can check the resolved `value: Carrier` payload. - } - } - SurfaceItem::TypeAtom { name, span, .. } - | SurfaceItem::TypeSum { name, span, .. } - | SurfaceItem::TypeAlias { name, span, .. } - if name == "Dimension" && span.file == DIMENSION_STD_AUTHORITY_FILE => - { - report_dimension_phantom_error( - dag, - span.clone(), - "std `Dimension` must be a record declaration, not another type form", - ); - } - _ => {} - } -} - -/// Read a parent declaration's pre-populated `type_params` slot and -/// build a `name → DeclarationId` local scope map for field-type and -/// variant-payload lookups. The actual TypeParam declarations were -/// allocated up front in `collect_symbols` so every declaration -/// reaches `lower_type_*` with its `type_params` slot already filled. -/// This is the shape that lets `build_template_arguments` look up real -/// parameter ids at construction time — no half-valid state, no -/// post-sweep fixup pass. -fn local_scope_from_parent(dag: &Dag, parent_id: DeclarationId) -> HashMap { - let parent = dag.declaration(parent_id); - let mut scope: HashMap = parent - .type_params - .iter() - .filter_map(|pid| { - if let TypeConnective::Atom(AtomPayload::TypeParam(name)) = - &dag.declaration(*pid).connective - { - Some((name.clone(), *pid)) - } else { - None - } - }) - .collect(); - // Recursive declarations must be able to refer to themselves - // while their connective is still being lowered. Without this, - // `tail: List` inside `type List = ...` allocates an - // UnresolvedIdentifier stub that later resolves back to the - // declaration and trips the "resolves to itself" fail-closed - // guard intended for bad aliases, not real recursive sums. - if let Some(name) = &parent.name { - scope.insert(name.clone(), parent_id); - } - scope -} - -fn lower_type_record( - dag: &mut Dag, - symbols: &HashMap, - name: &str, - _type_params: &[String], - fields: &[SurfaceField], -) { - let decl_id = symbols[name]; - let local = local_scope_from_parent(dag, decl_id); - let mut children: Vec = Vec::with_capacity(fields.len()); - for field in fields { - let ty_id = type_to_declaration_id(&field.ty, symbols, &local, dag); - children.push(Field { - label: field.name.clone(), - ty: ty_id, - }); - } - dag.declaration_mut(decl_id).connective = TypeConnective::Conj { children }; - attach_dimension_phantom_parameter(dag, decl_id, name); -} - -fn attach_dimension_phantom_parameter(dag: &mut Dag, decl_id: DeclarationId, name: &str) { - if name != "Dimension" { - return; - } - let span = dag.declaration(decl_id).span.clone(); - if span.file != DIMENSION_STD_AUTHORITY_FILE { - return; - } - if !dag.declaration(decl_id).phantom_params.is_empty() { - return; - } - - let type_params = dag.declaration(decl_id).type_params.clone(); - if type_params.len() != 2 - || !type_param_is_named(dag, type_params[0], "Unit") - || !type_param_is_named(dag, type_params[1], "Carrier") - { - report_dimension_phantom_error( - dag, - span, - "std `Dimension` must declare exactly `Dimension`", - ); - return; - } - let unit_param = type_params[0]; - let carrier_param = type_params[1]; - if !dimension_record_payload_is_carrier(dag, decl_id, carrier_param) { - report_dimension_phantom_error( - dag, - span, - "std `Dimension` must contain exactly `value: Carrier`", - ); - return; - } - let Some(abelian_group) = dag.abelian_group_decl() else { - report_dimension_phantom_error( - dag, - span, - "std `Dimension` requires `AbelianGroup` to attach its unit phantom algebra", - ); - return; - }; - let Some(abelian_receiver) = dag.declaration(abelian_group).type_params.first().copied() else { - report_dimension_phantom_error( - dag, - span, - "`AbelianGroup` must expose its receiver type parameter for `Dimension` phantom algebra", - ); - return; - }; - let unit_abelian_group = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: unit_abelian_group, - name: Some("DimensionUnitAbelianGroup".to_string()), - connective: TypeConnective::Instantiation { - template: abelian_group, - arguments: vec![TemplateArgument { - parameter: abelian_receiver, - value: unit_param, - }], - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span, - }); - dag.declaration_mut(decl_id) - .phantom_params - .push(PhantomParameter { - parameter: unit_param, - algebra: unit_abelian_group, - }); -} - -fn type_param_is_named(dag: &Dag, decl_id: DeclarationId, expected: &str) -> bool { - matches!( - &dag.declaration(decl_id).connective, - TypeConnective::Atom(AtomPayload::TypeParam(name)) if name == expected - ) -} - -fn dimension_record_payload_is_carrier( - dag: &Dag, - decl_id: DeclarationId, - carrier_param: DeclarationId, -) -> bool { - matches!( - &dag.declaration(decl_id).connective, - TypeConnective::Conj { children } - if children.len() == 1 - && children[0].label == "value" - && children[0].ty == carrier_param - ) -} - -fn report_dimension_phantom_error(dag: &mut Dag, span: SourceSpan, detail: &str) { - report_declaration_error( - dag, - Diagnostic::ResolveError { - name: format!("invalid std `Dimension` phantom bridge: {detail}"), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - span, - }, - ); -} - -/// Lane 1e-2b Path A — wire kernel `Bool` to `BooleanAlgebra`. -/// -/// `dsl/std/types.dag` stays on plain `type Bool = True | False` for the v2 -/// fixture parse path; this helper mirrors what an explicit `inhabits` field -/// on [`SurfaceItem::TypeSum`] would lower to (see [`lower_type_sum`]'s -/// `inhabits:` arm). Invoked only for the authoritative kernel sum in -/// [`BootstrapAuthorityKey::for_kernel_bool`]. -pub(crate) fn wire_kernel_bool_boolean_algebra_inhabits(dag: &mut Dag, bool_id: DeclarationId) { - let bool_authority = BootstrapAuthorityKey::for_kernel_bool(); - let bool_decl = dag.declaration(bool_id); - let span_for_inst = bool_decl.span.clone(); - if bool_decl.inhabits.is_some() { - return; - } - let (ba_template, param_id) = { - let Some(ba) = dag.declaration_by_name("BooleanAlgebra") else { - dag.attach_bootstrap_diagnostic( - bool_authority, - Diagnostic::ResolveError { - name: "bootstrap: Lane 1e-2b Path A — `BooleanAlgebra` not present in the \ - bootstrap Dag; cannot wire kernel `Bool` `inhabits`" - .to_string(), - span: span_for_inst.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "BootstrapDiagnostic", - ), - }, - ); - return; - }; - let Some(¶m_id) = ba.type_params.first() else { - dag.attach_bootstrap_diagnostic( - bool_authority, - Diagnostic::ResolveError { - name: - "bootstrap: Lane 1e-2b Path A — `BooleanAlgebra` has no type parameters; \ - cannot instantiate `BooleanAlgebra` for kernel `Bool` `inhabits`" - .to_string(), - span: span_for_inst.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "BootstrapDiagnostic", - ), - }, - ); - return; - }; - (ba.id, param_id) - }; - let inst_id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: inst_id, - name: None, - connective: TypeConnective::Instantiation { - template: ba_template, - arguments: vec![TemplateArgument { - parameter: param_id, - value: bool_id, - }], - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span_for_inst, - }); - dag.declaration_mut(bool_id).inhabits = Some(inst_id); -} - -fn lower_type_sum( - dag: &mut Dag, - symbols: &HashMap, - name: &str, - _type_params: &[String], - variants: &[SurfaceVariant], - inhabits: Option<&SurfaceType>, -) { - let decl_id = symbols[name]; - let local = local_scope_from_parent(dag, decl_id); - let mut variant_fields: Vec = Vec::with_capacity(variants.len()); - for variant in variants { - // Build payload children FIRST, then allocate the variant declaration. - // Allocating the variant id before its payload children would wedge - // the dense-sequential invariant on `Dag.declarations` because the - // child declarations push into slots between the variant's reserved - // id and its eventual push. - let connective = match &variant.payload { - // Unit variants surface as `Positional(vec![])` — the - // empty-positional case handles them with zero Field - // children, which is structurally indistinguishable - // from a Unit variant and avoids a dedicated enum arm. - VariantPayload::Positional(payload_types) => { - let children: Vec = payload_types - .iter() - .enumerate() - .map(|(idx, ty)| Field { - label: format!("_{idx}"), - ty: type_to_declaration_id(ty, symbols, &local, dag), - }) - .collect(); - TypeConnective::Conj { children } - } - VariantPayload::Record(fields) => { - let children: Vec = fields - .iter() - .map(|f| Field { - label: f.name.clone(), - ty: type_to_declaration_id(&f.ty, symbols, &local, dag), - }) - .collect(); - TypeConnective::Conj { children } - } - }; - // Sum variant declarations are anonymous. The variant name - // lives structurally in the parent `Disj.variants` Field label, - // not in the child declaration's name slot. Keeps variant names - // (`True`, `False`, `Less`, `Equal`, `Greater`) out of - // `Dag::declaration_by_name`'s flat scan. - let variant_id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: variant_id, - name: None, - connective, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - - value_body: None, - refinement: None, - nominal_opacity: None, - span: variant.span.clone(), - }); - variant_fields.push(Field { - label: variant.name.clone(), - ty: variant_id, - }); - } - dag.declaration_mut(decl_id).connective = TypeConnective::Disj { - variants: variant_fields, - }; - if let Some(inh_ty) = inhabits { - let inh_id = type_to_declaration_id(inh_ty, symbols, &local, dag); - dag.declaration_mut(decl_id).inhabits = Some(inh_id); - } else if name == "Bool" - && variants.len() == 2 - && variants.iter().any(|v| v.name == "True") - && variants.iter().any(|v| v.name == "False") - && dag.declaration(decl_id).span.file == BootstrapAuthorityKey::for_kernel_bool().path() - { - // v2 `dsl/std/types.dag` parse path has no `inhabits` token sequence for kernel - // `Bool`; wire at lower time instead of a post-parse patch sweep. - wire_kernel_bool_boolean_algebra_inhabits(dag, decl_id); - } -} - -fn lower_type_alias( - dag: &mut Dag, - symbols: &HashMap, - name: &str, - _type_params: &[String], - nominal_opaque: bool, - target: &SurfaceType, -) { - let decl_id = symbols[name]; - let local = local_scope_from_parent(dag, decl_id); - let connective = type_to_connective(target, symbols, &local, dag); - dag.declaration_mut(decl_id).connective = connective; - if nominal_opaque { - dag.declaration_mut(decl_id).nominal_opacity = Some(NominalOpacity { - permitted_accessors: Vec::new(), - }); - } -} - -// --- R3 gate #60 Phase 2.1 — `Int` / `UInt` / `Real` / `Nat` surface sugar -------- -// Q-MachineConstraint sub-decision 3 (gunbc#828 #issuecomment-4385530115): elaborates to -// `Compose>` with literal-Nat `N` in the phantom slot (not Word*). - -fn gate60_literal_machine_width_bits(decimal: &str) -> Option { - let n: u32 = decimal.parse().ok()?; - matches!(n, 8 | 16 | 32 | 64 | 128).then_some(n) -} - -fn alloc_literal_width_nat_decl(dag: &mut Dag, decimal: &str, span: SourceSpan) -> DeclarationId { - let id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id, - name: None, - connective: TypeConnective::Atom(AtomPayload::Literal(LiteralBits::Int( - decimal.to_string(), - ))), - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span, - }); - id -} - -fn alloc_machine_width_literal_nat( - dag: &mut Dag, - machine_width_tpl: DeclarationId, - decimal: &str, - span: SourceSpan, -) -> Option { - let lit = alloc_literal_width_nat_decl(dag, decimal, span.clone()); - let param0 = template_param_id(dag, machine_width_tpl, 0)?; - let id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id, - name: None, - connective: TypeConnective::Instantiation { - template: machine_width_tpl, - arguments: vec![TemplateArgument { - parameter: param0, - value: lit, - }], - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span, - }); - Some(id) -} - -fn compose_algebra_machine_width_connective( - dag: &Dag, - compose_tpl: DeclarationId, - algebra_id: DeclarationId, - machine_width_inst: DeclarationId, -) -> Option { - let p0 = template_param_id(dag, compose_tpl, 0)?; - let p1 = template_param_id(dag, compose_tpl, 1)?; - Some(TypeConnective::Instantiation { - template: compose_tpl, - arguments: vec![ - TemplateArgument { - parameter: p0, - value: algebra_id, - }, - TemplateArgument { - parameter: p1, - value: machine_width_inst, - }, - ], - }) -} - -/// When `surface_name` is `Int` / `UInt` / `Real` / `Nat` and there is exactly one -/// [`TypeAngleArg::WidthNatLiteral`] argument with a gate-60 bit width, lower to -/// `Compose>` per Q-MC sub-decision 3. `Nat` uses `UInt` -/// in slot-1 (same unsigned width-refinement axis as `UInt`; `UInt = Nat` in std). -fn materialize_algebra_machine_width_width_nat( - dag: &mut Dag, - symbols: &HashMap, - local: &HashMap, - surface_name: &str, - args: &[TypeAngleArg], - _span: &SourceSpan, -) -> Option { - if args.len() != 1 { - return None; - } - let TypeAngleArg::WidthNatLiteral { - decimal, - span: lit_span, - } = &args[0] - else { - return None; - }; - let algebra_surface = match surface_name { - "Int" => "Int", - "UInt" => "UInt", - "Real" => "Real", - "Nat" => "UInt", - _ => return None, - }; - gate60_literal_machine_width_bits(decimal)?; - let compose_tpl = dag.declaration_by_name("Compose")?.id; - let mw_tpl = dag.declaration_by_name("MachineWidth")?.id; - let algebra_id = local - .get(algebra_surface) - .or_else(|| symbols.get(algebra_surface)) - .copied()?; - let mw_inst = alloc_machine_width_literal_nat(dag, mw_tpl, decimal, lit_span.clone())?; - compose_algebra_machine_width_connective(dag, compose_tpl, algebra_id, mw_inst) -} - -/// Record-field map for `ConfigPatchRecord`: each `name: T` in `Config` becomes -/// `name: FieldPatch` in the patch record (T-4.16 `config-patch-record-projection`). -fn materialize_config_patch_record_from_config_decl( - dag: &mut Dag, - config_ty: DeclarationId, - span: &SourceSpan, -) -> Option { - let mut subst = LowerSubstStack::default(); - let conj_id = walk_to_conj_decl_with_subst_lower(dag, config_ty, &mut subst)?; - let children = match &dag.declaration(conj_id).connective { - TypeConnective::Conj { children } => children.clone(), - _ => return None, - }; - let field_patch_tpl = v4_std_patch_named_declaration(dag, "FieldPatch")?; - let field_patch_param = template_param_id(dag, field_patch_tpl, 0)?; - let patch_children: Vec = children - .into_iter() - .map(|field| { - let field_ty = concretize_decl_with_lower_subst(dag, field.ty, &subst, 0); - let patch_field_ty = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: patch_field_ty, - name: None, - connective: TypeConnective::Instantiation { - template: field_patch_tpl, - arguments: vec![TemplateArgument { - parameter: field_patch_param, - value: field_ty, - }], - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - Field { - label: field.label.clone(), - ty: patch_field_ty, - } - }) - .collect(); - Some(TypeConnective::Conj { - children: patch_children, - }) -} - -fn materialize_config_patch_record_connective( - dag: &mut Dag, - symbols: &HashMap, - local: &HashMap, - args: &[TypeAngleArg], - span: &SourceSpan, -) -> Option { - if args.len() != 1 { - return None; - } - let config_ty = type_angle_arg_to_declaration_id(&args[0], symbols, local, dag); - materialize_config_patch_record_from_config_decl(dag, config_ty, span) -} - -fn config_patch_record_decl_for_config( - dag: &mut Dag, - config_decl: DeclarationId, - span: &SourceSpan, -) -> Option { - let connective = materialize_config_patch_record_from_config_decl(dag, config_decl, span)?; - let id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id, - name: None, - connective, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - Some(id) -} - -const V4_STD_PATCH_DAG_SUFFIX: &str = "v4/std/patch.dag"; - -fn declaration_authority_is_v4_std_patch(dag: &Dag, decl_id: DeclarationId) -> bool { - dag.declaration(decl_id) - .span - .file - .replace('\\', "/") - .ends_with(V4_STD_PATCH_DAG_SUFFIX) -} - -/// Unique top-level declaration authored in `src/v4/std/patch.dag` (fail-closed on homographs). -fn v4_std_patch_named_declaration(dag: &Dag, name: &str) -> Option { - let mut matches = dag - .declarations() - .iter() - .filter(|decl| { - decl.name.as_deref() == Some(name) - && declaration_authority_is_v4_std_patch(dag, decl.id) - }) - .map(|decl| decl.id) - .collect::>(); - matches.sort_by_key(|id| id.raw()); - match matches.as_slice() { - [only] => Some(*only), - _ => None, - } -} - -/// Surface `Parameterized` names must resolve to the canonical `v4.std.patch` template id. -fn surface_parameterized_name_resolves_to_template( - dag: &Dag, - symbols: &HashMap, - local: &HashMap, - surface_name: &str, - expected_template_name: &str, -) -> bool { - let Some(canonical) = v4_std_patch_named_declaration(dag, expected_template_name) else { - return false; - }; - let Some(&resolved) = local - .get(surface_name) - .or_else(|| symbols.get(surface_name)) - else { - return false; - }; - resolved == canonical -} - -fn callable_is_v4_std_patch_config_patch_layer(dag: &Dag, decl_id: DeclarationId) -> bool { - v4_std_patch_named_declaration(dag, "config_patch_layer") == Some(decl_id) -} - -fn config_patch_layer_args_diagnostic(span: &SourceSpan) -> Diagnostic { - Diagnostic::ResolveError { - name: "config_patch_layer requires exactly two named arguments (base: , patch: )" - .to_string(), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - } -} - -fn config_patch_layer_body_fallback_diagnostic(span: &SourceSpan) -> Diagnostic { - Diagnostic::ResolveError { - name: "config_patch_layer must be expanded at the call site by the v3 lowerer; \ - executing the surface stub body is forbidden" - .to_string(), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - } -} - -fn config_patch_record_materialization_failed_diagnostic(span: &SourceSpan) -> Diagnostic { - Diagnostic::ResolveError { - name: "ConfigPatchRecord requires Config to lower to a record (Conj)".to_string(), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - } -} - -/// Parse `config_patch_layer(base: …, patch: …)` call-site named operands. -fn extract_config_patch_layer_operands( - args: &[SurfaceExpr], -) -> Option<(&SurfaceExpr, &SurfaceExpr)> { - let [SurfaceExpr::Record { fields, .. }] = args else { - return None; - }; - let mut base = None; - let mut patch = None; - for field in fields { - match field.name.as_str() { - "base" if base.is_none() => base = Some(&field.value), - "patch" if patch.is_none() => patch = Some(&field.value), - _ => return None, - } - } - Some((base?, patch?)) -} - -/// Project one record field from a Var or Path carrier (the call-site base/patch expressions). -fn surface_field_access_expr( - carrier: &SurfaceExpr, - field_label: &str, - span: &SourceSpan, -) -> Option { - let field_span = SourceSpan::new(span.file.as_str(), span.byte_start, span.byte_end); - match carrier { - SurfaceExpr::Var { - name, - span: carrier_span, - } => Some(SurfaceExpr::Path { - segments: vec![name.clone(), field_label.to_string()], - segment_spans: vec![carrier_span.clone(), field_span], - span: span.clone(), - }), - SurfaceExpr::Path { - segments, - segment_spans, - span: path_span, - } => { - let mut segs = segments.clone(); - let mut spans = segment_spans.clone(); - segs.push(field_label.to_string()); - spans.push(field_span); - Some(SurfaceExpr::Path { - segments: segs, - segment_spans: spans, - span: path_span.clone(), - }) - } - _ => None, - } -} - -/// Symbols for expanding `config_patch_layer` at a call site: caller scope plus -/// `apply_field_patch` from `v4.std.patch` (resolved via `Dag::declaration_by_name`, not -/// caller imports). -fn config_patch_layer_expansion_symbols( - dag: &Dag, - symbols: &HashMap, -) -> Option> { - let apply_field_patch = v4_std_patch_named_declaration(dag, "apply_field_patch")?; - let mut expansion_symbols = symbols.clone(); - expansion_symbols.insert("apply_field_patch".to_string(), apply_field_patch); - Some(expansion_symbols) -} - -fn config_patch_layer_missing_apply_field_patch_diagnostic(span: &SourceSpan) -> Diagnostic { - Diagnostic::ResolveError { - name: "config_patch_layer expansion requires `apply_field_patch` from v4.std.patch in the compilation DAG" - .to_string(), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - } -} - -fn surface_apply_field_patch_from_operands( - base_operand: &SurfaceExpr, - patch_operand: &SurfaceExpr, - field_label: &str, - span: &SourceSpan, -) -> Option { - let base_field = surface_field_access_expr(base_operand, field_label, span)?; - let patch_field = surface_field_access_expr(patch_operand, field_label, span)?; - Some(SurfaceExpr::Call { - target: "apply_field_patch".to_string(), - args: vec![SurfaceExpr::Record { - fields: vec![ - SurfaceRecordField { - name: "base".to_string(), - value: base_field, - span: span.clone(), - }, - SurfaceRecordField { - name: "patch".to_string(), - value: patch_field, - span: span.clone(), - }, - ], - span: span.clone(), - }], - span: span.clone(), - }) -} - -/// Expand `config_patch_layer(base: …, patch: …)` into per-field `apply_field_patch` -/// and a config record rebuild (same semantics as hand-written `*_layer` mirrors). -#[allow(clippy::too_many_arguments)] -fn try_lower_config_patch_layer_invocation( - base_target_decl: DeclarationId, - args: &[SurfaceExpr], - span: &SourceSpan, - dag: &mut Dag, - scope: &HashMap, - callable_scope: &CallableScope, - symbols: &HashMap, - expected_decl: Option, -) -> Option { - if !callable_is_v4_std_patch_config_patch_layer(dag, base_target_decl) { - return None; - } - let config_decl = match expected_decl { - Some(decl) => decl, - None => { - return Some(unresolved_port( - dag, - config_patch_layer_args_diagnostic(span), - )); - } - }; - let (base_operand, patch_operand) = match extract_config_patch_layer_operands(args) { - Some(operands) => operands, - None => { - return Some(unresolved_port( - dag, - config_patch_layer_args_diagnostic(span), - )); - } - }; - let conj_id = match walk_to_conj_decl(dag, config_decl) { - Some(id) => id, - None => { - return Some(unresolved_port( - dag, - Diagnostic::ResolveError { - name: "config_patch_layer return type must be a record (Conj)".to_string(), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - }, - )); - } - }; - let children = match &dag.declaration(conj_id).connective { - TypeConnective::Conj { children } => children.clone(), - _ => { - return Some(unresolved_port( - dag, - Diagnostic::ResolveError { - name: "config_patch_layer return type must be a record (Conj)".to_string(), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - }, - )); - } - }; - if !matches!( - base_operand, - SurfaceExpr::Var { .. } | SurfaceExpr::Path { .. } - ) || !matches!( - patch_operand, - SurfaceExpr::Var { .. } | SurfaceExpr::Path { .. } - ) { - return Some(unresolved_port( - dag, - Diagnostic::ResolveError { - name: "config_patch_layer operands must be variables or paths".to_string(), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - }, - )); - } - let patch_record_decl = match config_patch_record_decl_for_config(dag, config_decl, span) { - Some(decl) => decl, - None => { - return Some(unresolved_port( - dag, - config_patch_record_materialization_failed_diagnostic(span), - )); - } - }; - let base_port = lower_expr( - base_operand, - dag, - scope, - callable_scope, - symbols, - Some(config_decl), - ); - if matches!( - dag.port(base_port).state(), - crate::dag::PortState::Unresolved - ) { - return Some(base_port); - } - let patch_port = lower_expr( - patch_operand, - dag, - scope, - callable_scope, - symbols, - Some(patch_record_decl), - ); - if matches!( - dag.port(patch_port).state(), - crate::dag::PortState::Unresolved - ) { - return Some(patch_port); - } - let mut record_fields: Vec = Vec::with_capacity(children.len()); - for field in children { - let value = match surface_apply_field_patch_from_operands( - base_operand, - patch_operand, - &field.label, - span, - ) { - Some(expr) => expr, - None => { - return Some(unresolved_port( - dag, - Diagnostic::ResolveError { - name: format!( - "config_patch_layer operands must be variables or paths so field `{}` can be projected", - field.label - ), - span: span.clone(), - correction: - crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - }, - )); - } - }; - record_fields.push(SurfaceRecordField { - name: field.label.clone(), - value, - span: span.clone(), - }); - } - let expansion_symbols = match config_patch_layer_expansion_symbols(dag, symbols) { - Some(symbols) => symbols, - None => { - return Some(unresolved_port( - dag, - config_patch_layer_missing_apply_field_patch_diagnostic(span), - )); - } - }; - Some(lower_record_literal_expr( - &record_fields, - span, - dag, - scope, - callable_scope, - &expansion_symbols, - Some(config_decl), - )) -} - -/// Lower a `SurfaceType` to a fresh DeclarationId. Used for field types, -/// Arrow parameters, and template arguments. Allocates anonymous (unnamed) -/// declarations for composite shapes; looks up named references against -/// `local` (type params in scope) first, then `symbols` (top-level names). -/// Unknown names get an Identifier Atom stub with `resolved: None` — pass -/// 2 and inference are responsible for filling it in or reporting. -fn type_to_declaration_id( - ty: &SurfaceType, - symbols: &HashMap, - local: &HashMap, - dag: &mut Dag, -) -> DeclarationId { - match ty { - SurfaceType::Named { name, .. } => { - if let Some(id) = local.get(name) { - return *id; - } - if let Some(id) = symbols.get(name) { - return *id; - } - alloc_identifier_stub(dag, name, ty.span()) - } - SurfaceType::Parameterized { name, args, span } => { - if let Some(connective) = - materialize_algebra_machine_width_width_nat(dag, symbols, local, name, args, span) - { - let id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id, - name: None, - connective, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - return id; - } - if surface_parameterized_name_resolves_to_template( - dag, - symbols, - local, - name, - "ConfigPatchRecord", - ) { - if let Some(connective) = - materialize_config_patch_record_connective(dag, symbols, local, args, span) - { - let id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id, - name: None, - connective, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - return id; - } - report_declaration_error( - dag, - config_patch_record_materialization_failed_diagnostic(span), - ); - return alloc_identifier_stub(dag, "ConfigPatchRecord", span); - } - let template_id = local - .get(name) - .or_else(|| symbols.get(name)) - .copied() - .unwrap_or_else(|| alloc_identifier_stub(dag, name, span)); - let arguments = - build_template_arguments(dag, symbols, local, template_id, name, args, span); - let id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id, - name: None, - connective: TypeConnective::Instantiation { - template: template_id, - arguments, - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - id - } - SurfaceType::Optional { inner, span } => { - let element = type_to_declaration_id(inner, symbols, local, dag); - dag.alloc_cardinality_decl(element, CardinalityBound::AtMostOne, span.clone()) - } - SurfaceType::Arrow { - inputs, - output, - span, - } => { - let input_ids: Vec = inputs - .iter() - .map(|i| type_to_declaration_id(i, symbols, local, dag)) - .collect(); - let output_id = type_to_declaration_id(output, symbols, local, dag); - let id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id, - name: None, - connective: TypeConnective::Arrow { - inputs: input_ids, - output: output_id, - // Anonymous nested Arrow inside a larger type expression - // (e.g. `cb: fn(Int) -> Int` as a parameter type, or - // `handler: fn(Int) -> Int` as an algebra/record field). - // Function-as-data: no executable body, by construction. - // `NoBody` makes that fact structural so any future named - // refactor of these declarations does not silently - // become an `Arrow(Pending)` lens target. - body: ArrowBody::NoBody, - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - id - } - } -} - -/// Lower a `SurfaceType` directly to a connective (not a new declaration). -/// Used for `TypeAlias` targets where we want the alias declaration itself -/// to carry the aliased shape, not a one-level-indirect wrapper. -fn type_to_connective( - ty: &SurfaceType, - symbols: &HashMap, - local: &HashMap, - dag: &mut Dag, -) -> TypeConnective { - match ty { - SurfaceType::Named { name, .. } => { - let template = local - .get(name) - .or_else(|| symbols.get(name)) - .copied() - .unwrap_or_else(|| alloc_identifier_stub(dag, name, ty.span())); - TypeConnective::Instantiation { - template, - arguments: Vec::new(), - } - } - SurfaceType::Parameterized { name, args, span } => { - if let Some(conn) = - materialize_algebra_machine_width_width_nat(dag, symbols, local, name, args, span) - { - return conn; - } - if surface_parameterized_name_resolves_to_template( - dag, - symbols, - local, - name, - "ConfigPatchRecord", - ) { - if let Some(conn) = - materialize_config_patch_record_connective(dag, symbols, local, args, span) - { - return conn; - } - report_declaration_error( - dag, - config_patch_record_materialization_failed_diagnostic(span), - ); - return TypeConnective::Atom(AtomPayload::UnresolvedIdentifier( - "ConfigPatchRecord".to_string(), - )); - } - let template = local - .get(name) - .or_else(|| symbols.get(name)) - .copied() - .unwrap_or_else(|| alloc_identifier_stub(dag, name, span)); - let arguments = - build_template_arguments(dag, symbols, local, template, name, args, span); - TypeConnective::Instantiation { - template, - arguments, - } - } - SurfaceType::Optional { inner, .. } => { - let element = type_to_declaration_id(inner, symbols, local, dag); - type_connective_cardinality(dag, element, CardinalityBound::AtMostOne) - } - SurfaceType::Arrow { inputs, output, .. } => TypeConnective::Arrow { - inputs: inputs - .iter() - .map(|i| type_to_declaration_id(i, symbols, local, dag)) - .collect(), - output: type_to_declaration_id(output, symbols, local, dag), - // `type_to_connective` is invoked from two callers: - // `lower_type_alias` (`type Callback = fn(Int) -> Int`) and - // `lower_data_item` (`data x: fn(Int) -> Int = ...`). In - // both contexts an Arrow shape here is a TYPE-LEVEL function - // type with no executable body, so `NoBody` is correct in - // both. `Pending` would false-positive on - // `lens_structural_resolution` for the named-declaration - // outputs of either caller. - body: ArrowBody::NoBody, - }, - } -} - -/// Lower a single angle-bracket type argument (full `SurfaceType` or gate-60 width literal). -fn type_angle_arg_to_declaration_id( - arg: &TypeAngleArg, - symbols: &HashMap, - local: &HashMap, - dag: &mut Dag, -) -> DeclarationId { - match arg { - TypeAngleArg::TypeExpr { ty } => type_to_declaration_id(ty, symbols, local, dag), - TypeAngleArg::WidthNatLiteral { decimal, span } => { - alloc_literal_width_nat_decl(dag, decimal, span.clone()) - } - } -} - -/// Build the `TemplateArgument` list for an `Instantiation`. -/// -/// Two-phase bootstrap means every real declaration's `type_params` -/// slot is populated by the time lowering runs, so real templates -/// always produce well-formed `TemplateArgument`s whose `parameter` -/// edge points at a genuine TypeParam atom — honoring the field's -/// contract in `dag::TemplateArgument`. -/// -/// **Stub templates** — anonymous `UnresolvedIdentifier` stubs -/// created when a name can't be resolved at lower time — produce an -/// **empty argument list**. The stub itself already has a diagnostic -/// waiting for it (bootstrap mode tolerates bootstrap-range dangling -/// refs like `Tuple` in `algebra.dag`; user-code mode fails closed -/// via the strict sweep), so there is no additional consumer that -/// needs a per-argument `TemplateArgument` when the template is -/// unresolved. The old "self-reference tolerated scaffold" path is -/// deleted per QW4 — `TemplateArgument.parameter` is no longer -/// representable as a non-TypeParam reference at construction -/// time. -fn build_template_arguments( - dag: &mut Dag, - symbols: &HashMap, - local: &HashMap, - template: DeclarationId, - template_name: &str, - args: &[TypeAngleArg], - span: &SourceSpan, -) -> Vec { - let template_decl = dag.declaration(template); - let template_is_stub = template_decl.name.is_none() - && matches!( - &template_decl.connective, - TypeConnective::Atom(AtomPayload::UnresolvedIdentifier(_)) - ); - if template_is_stub { - // Consume the argument surface types for their side effects - // (nested stub allocation, diagnostic attachment), but do not - // construct any TemplateArgument values — the template's - // pending error is the authoritative failure for this - // instantiation, and a TemplateArgument whose parameter - // wasn't a TypeParam would violate the field contract. - for arg in args { - let _ = type_angle_arg_to_declaration_id(arg, symbols, local, dag); - } - return Vec::new(); - } - let Some(template_for_params) = - resolve_template_for_type_parameters(dag, template, template_name, span) - else { - for arg in args { - let _ = type_angle_arg_to_declaration_id(arg, symbols, local, dag); - } - return Vec::new(); - }; - let template_param_count = dag.declaration(template_for_params).type_params.len(); - if template_param_count != args.len() { - report_declaration_error( - dag, - Diagnostic::ArityMismatch { - function: format!("type `{template_name}`"), - expected: template_param_count, - actual: args.len(), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - }, - ); - // Arity mismatch is an authoritative failure. Consume the - // argument surface types for their side effects and return - // nothing — building partial TemplateArguments would require - // inventing parameter references that don't exist, which - // would violate the field contract. - for arg in args { - let _ = type_angle_arg_to_declaration_id(arg, symbols, local, dag); - } - return Vec::new(); - } - args.iter() - .enumerate() - .map(|(idx, arg)| { - let value = type_angle_arg_to_declaration_id(arg, symbols, local, dag); - let parameter = template_param_id(dag, template_for_params, idx).expect( - "template_param_count equality was checked immediately above — \ - param lookup at idx < count must succeed", - ); - TemplateArgument { parameter, value } - }) - .collect() -} - -/// Allocate a stub Identifier-atom declaration. Callers reach this path when -/// name resolution fails against the local type-parameter scope and the -/// current top-level symbol table snapshot. The stub deliberately carries -/// `resolved: None` and stays in the declaration graph so that a later -/// `resolve_pending_identifiers` sweep can either fill it in (forward -/// references across bootstrap fixtures) or emit a fail-closed diagnostic. -fn alloc_identifier_stub(dag: &mut Dag, name: &str, span: &SourceSpan) -> DeclarationId { - let id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id, - name: None, - connective: TypeConnective::Atom(AtomPayload::UnresolvedIdentifier(name.to_string())), - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - id -} - -/// Emit a declaration-level diagnostic via `Dag::attach_diagnostic`. -/// Thin wrapper kept for naming symmetry with the per-item fail-closed -/// call sites in lowering; bootstrap and tests use -/// `Dag::attach_diagnostic` directly. -fn report_declaration_error(dag: &mut Dag, diag: Diagnostic) { - dag.attach_diagnostic(diag); -} - -/// Final-pass resolution over anonymous Identifier-atom declarations in -/// **bootstrap** mode. Resolves every stub whose name is in the -/// declaration table; **tolerates** stubs whose name is dangling. -/// Tolerance is bootstrap-specific: the canonical `dsl/std/*.dag` -/// files carry forward references to types that live in std/ modules -/// outside the M1(2.6) load set (e.g., `Tuple` referenced from -/// `algebra.dag` with no defining `.dag` file among the seven loaded), -/// and those are not bootstrap errors. User-facing code uses the -/// strict variant below. -#[cfg_attr(not(feature = "bootstrap-regen-fresh"), allow(dead_code))] -pub(crate) fn resolve_pending_identifiers(dag: &mut Dag) { - run_identifier_sweep(dag, /*strict_from=*/ usize::MAX); -} - -/// Final-pass resolution in **strict** mode: every Identifier stub at -/// a declaration id `>= strict_from` that cannot resolve emits a -/// fail-closed `ResolveError`. Used by `lower` for user modules, where -/// `strict_from` is the declaration count before user lowering began. -/// Stubs in the bootstrap range (id < strict_from) are still resolved -/// opportunistically but tolerated. -pub(crate) fn resolve_pending_identifiers_strict(dag: &mut Dag, strict_from: usize) { - run_identifier_sweep(dag, strict_from); -} - -/// User-mode scaffold rejection. `FnExternalBody` lowers to -/// `ArrowBody::Unparsed(SourceSpan)`; `Data` lowers to a declaration -/// with `value_body = Some(ValueBody::Unparsed(SourceSpan))`. Both -/// are load-bearing scaffolds for std/bootstrap files whose bodies -/// the M1(2.8) parser cannot yet lower. For ordinary user code they -/// are a fail-closed concern: an opaque body that the compiler has -/// not validated shipping through `compile_to_dag` violates the -/// fail-closed static-grounding invariant. -/// -/// This sweep walks declarations at id `>= strict_from` (i.e. the -/// user-lowered range) and attaches a fail-closed diagnostic for -/// each `Unparsed` scaffold found. Bootstrap-range declarations -/// (id < strict_from) are tolerated — those scaffolds exist by -/// design until the parser grows to cover the remaining std/ -/// grammar (match / record literals / lambdas / pipes / data body -/// literals — see `DOWNSTREAM_REQUIREMENTS.md` class-5 gap list). -/// -/// Diagnostics are attached via `report_declaration_error` -/// (`Dag::attach_diagnostic`), which routes through the phantom-port -/// channel so they surface via `compile_to_dag`'s standard -/// `CompileError::Semantic` path. -fn reject_user_unparsed_scaffolds(dag: &mut Dag, strict_from: usize) { - // Snapshot the offending (id, span) pairs first so we can emit - // diagnostics without holding a long immutable borrow of the - // declaration slice. - let mut unparsed_fn_scaffolds: Vec<(DeclarationId, String, SourceSpan)> = Vec::new(); - let mut unparsed_data_scaffolds: Vec<(DeclarationId, String, SourceSpan)> = Vec::new(); - for decl in dag.declarations() { - if (decl.id.raw() as usize) < strict_from { - continue; - } - let name = decl - .name - .clone() - .unwrap_or_else(|| format!("declaration#{}", decl.id.raw())); - if let TypeConnective::Arrow { - body: ArrowBody::Unparsed(span), - .. - } = &decl.connective - { - unparsed_fn_scaffolds.push((decl.id, name.clone(), span.clone())); - } - if let Some(crate::dag::ValueBody::Unparsed(span)) = &decl.value_body { - unparsed_data_scaffolds.push((decl.id, name, span.clone())); - } - } - for (_, name, span) in unparsed_fn_scaffolds { - report_declaration_error( - dag, - Diagnostic::ResolveError { - name: format!( - "function `{name}` has an opaque block body — M1(2.8) user code cannot yet use match / record literals / lambdas inside block-bodied fn definitions (see DOWNSTREAM_REQUIREMENTS.md class-5 gaps)" - ), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("LoweringDiagnostic"), - span, - }, - ); - } - for (_, name, span) in unparsed_data_scaffolds { - report_declaration_error( - dag, - Diagnostic::ResolveError { - name: format!( - "data `{name}` has an opaque body — M1(2.8) user code cannot ship a data body the compiler could not structurally validate (see DOWNSTREAM_REQUIREMENTS.md class-5 gap #3)" - ), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("LoweringDiagnostic"), - span, - }, - ); - } -} - -fn run_identifier_sweep(dag: &mut Dag, strict_from: usize) { - let snapshot: Vec<(DeclarationId, String, SourceSpan)> = dag - .declarations() - .iter() - .filter_map(|d| match &d.connective { - TypeConnective::Atom(AtomPayload::UnresolvedIdentifier(name)) => { - Some((d.id, name.clone(), d.span.clone())) - } - _ => None, - }) - .collect(); - - for (decl_id, name, span) in snapshot { - // Operator identifiers (`+`, `-`, ...) no longer flow through - // this sweep — they are committed to - // `TransformTarget::Operator(OperatorKind)` at parse time and - // never allocate a stub declaration. Any `UnresolvedIdentifier` - // atom that reaches this point is a real name-reference stub - // waiting for lower-time or sweep-time resolution. - if let Some(target) = dag.declaration_by_name(&name).map(|d| d.id) { - if target == decl_id { - report_declaration_error( - dag, - Diagnostic::ResolveError { - name: format!("type `{name}` resolves to itself"), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - span, - }, - ); - continue; - } - // Structural phase transition: rewrite the connective from - // `UnresolvedIdentifier(name)` to `ResolvedByName(target)`. - // The phase is now visible in the variant, not hidden in - // an Option field. - dag.declaration_mut(decl_id).connective = - TypeConnective::Atom(AtomPayload::ResolvedByName(target)); - } else if (decl_id.raw() as usize) >= strict_from { - // Strict mode for user-lowering stubs: any - // `UnresolvedIdentifier` that survives the sweep is a - // fail-closed ResolveError. After this loop every - // user-range Identifier atom is either a - // ResolvedIdentifier or has attached a diagnostic. - report_declaration_error( - dag, - Diagnostic::ResolveError { - name: format!("unresolved type identifier `{name}`"), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - span, - }, - ); - } - // else: bootstrap-range dangling ref, tolerated. The canonical - // std/ files may forward-reference types that live in std/ - // modules outside the M1(2.6) load set; those are not errors. - } -} - -/// Return the `idx`-th type parameter declaration of a template. Reads the -/// canonical `Declaration.type_params` slot rather than filtering -/// `Conj.children` — type params are first-class on `Declaration` per -/// M1(2.5)'s refactor. Returns None when the template has fewer params than -/// `idx` requires; callers must fail-closed (not substitute a fallback). -fn template_param_id(dag: &Dag, template: DeclarationId, idx: usize) -> Option { - dag.declaration(template).type_params.get(idx).copied() -} - -/// Upper bound on `ResolvedByName` hops while resolving an imported type to the -/// declaration that carries `type_params` for generic application (INVARIANTS -/// §P3/P4 — bounded lowering). Longer chains (including cyclic forwarding) -/// fail closed with [`Diagnostic::ResolveError`]. -const MAX_TEMPLATE_IMPORT_ALIAS_DEPTH: usize = 64; - -/// `import std.other { Foo }` introduces a forwarding declaration whose -/// connective is `Atom(ResolvedByName(target))` with an empty `type_params` -/// slot. Generic instantiation must read params from the **target** template -/// (e.g. `ApproximateField` in `src/v3/std/approximate_field.dag`), not the -/// import stub — otherwise `Foo` lowers as arity-0 and drops arguments. -/// -/// Returns `None` after attaching `ResolveError` when the chain exceeds -/// [`MAX_TEMPLATE_IMPORT_ALIAS_DEPTH`] (cycle or pathological depth). -fn resolve_template_for_type_parameters( - dag: &mut Dag, - template: DeclarationId, - template_name: &str, - span: &SourceSpan, -) -> Option { - match follow_resolved_by_name_bounded(dag, template, MAX_TEMPLATE_IMPORT_ALIAS_DEPTH) { - Some(id) => Some(id), - None => { - report_declaration_error( - dag, - Diagnostic::ResolveError { - name: format!( - "type `{template_name}`: import-alias chain exceeds bound ({MAX_TEMPLATE_IMPORT_ALIAS_DEPTH} `ResolvedByName` hops)" - ), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("LoweringDiagnostic"), - }, - ); - None - } - } -} - -// DB-11 (3a.3) single-construction-authority cleanup: -// `lower_fn_item_unparsed` used to run a full parameter-decl walk -// and an Arrow overwrite here — duplicating the work that -// `seed_function_signatures_phase` already did for every -// `SurfaceItem::FnExternalBody`. When a parameter carried a `where` -// refinement, the duplication pushed a second predicate Bind and a -// second refined Declaration into the DAG and then overwrote the -// Arrow's `inputs` to point at the duplicates, leaving the seeded -// predicate Bind and refined Declaration orphaned. Seeding already -// produces the final Arrow shape (`ArrowBody::Unparsed(body_span)`), -// so the function was redundant and is now deleted; the caller in -// the `SurfaceItem::FnExternalBody` arm has been simplified to a -// no-op since the signature flows directly from seeding. - -/// Lower a `SurfaceItem::Data` — a typed constant whose body is not -/// yet parseable as a `SurfaceExpr`. The declaration carries two -/// facts: -/// -/// - `connective` = the resolved type annotation (via -/// `type_to_connective`). The declaration's type is accessible -/// through the same path as type aliases. -/// - `value_body = Some(ValueBody::Unparsed(body_span))`. This -/// makes the declaration structurally distinguishable from a -/// type alias (which has `value_body = None`) so consumers can -/// tell "data value with this type" from "type alias of this -/// type" by reading the substrate directly. -/// -/// **QW2 + structural scaffold honesty** (M1(2.7) review round 9): -/// before this fix, lowering dropped the body entirely and set -/// the connective to the type. The declaration was structurally -/// identical to a type alias — the substrate admitted a state -/// where "data vs type" had no distinction. Now the fact survives -/// as an Unparsed scaffold with an explicit dissolution trigger -/// (M2+ record/map/list literal parser extension), and the -/// declaration carries both the declared type and the body span -/// for future parser passes to consume. -struct DataLoweringContext<'a> { - dag: &'a mut Dag, - symbols: &'a HashMap, - pending_refined_function_refs: &'a HashSet, - invalid_data_lambda_cluster: Option<&'a InvalidMutualCluster>, -} - -fn lower_data_item( - name: &str, - ty: &SurfaceType, - body: Option<&SurfaceExpr>, - body_span: &SourceSpan, - ctx: &mut DataLoweringContext<'_>, -) { - let decl_id = ctx.symbols[name]; - let ty_decl_id = initialize_data_declaration_type(name, ty, ctx.dag, ctx.symbols); - // Attempt structural inhabitance checking if the body parsed - // as a record literal. Falls back to Unparsed on any failure - // (walk doesn't terminate at a Conj, missing field, extra - // field, value isn't a literal, type mismatch). Fail-closed - // paths attach a diagnostic via `report_declaration_error` so - // user-facing code sees the error. - // DB-10 (3a.2): `data x: T = v` bodies lower by shape: - // - Lambda → executable Arrow on the data declaration. - // - Record literal → ValueBody::Structural (existing path). - // - List literal → ValueBody::List (top-level aggregate path). - // - Scalar literal → ValueBody::Scalar (new path, DB-10). - // - Map literal → ValueBody::Map (top-level string-keyed map path). - // - Anything else → ValueBody::Unparsed fallback. - let mut suppress_unparsed_scaffold = false; - let value_body = match body { - Some(SurfaceExpr::Lambda { params, body, span }) => { - if let Some(invalid_cluster) = ctx.invalid_data_lambda_cluster { - let diagnostic = Diagnostic::ResolveError { - name: format!( - "function-valued data `{name}` participates in an unbounded callable cycle {{{}}}; recursive data lambdas are rejected until they participate in the bounded recursion gate", - invalid_cluster.members.join(", ") - ), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("LoweringDiagnostic"), - }; - let rejected = rejected_data_lambda_connective( - name, - ctx.dag.declaration(decl_id).connective.clone(), - diagnostic.clone(), - span, - ctx.dag, - ); - ctx.dag.declaration_mut(decl_id).connective = rejected; - report_declaration_error(ctx.dag, diagnostic); - None - } else { - let empty_scope = HashMap::new(); - let empty_callable_scope = CallableScope::new(); - let mut lambda_ctx = LambdaLoweringContext { - dag: ctx.dag, - scope: &empty_scope, - callable_scope: &empty_callable_scope, - symbols: ctx.symbols, - }; - match lower_lambda_expr_to_arrow(params, body, span, ty_decl_id, &mut lambda_ctx) { - Ok(connective) => { - lambda_ctx.dag.declaration_mut(decl_id).connective = connective; - suppress_unparsed_scaffold = true; - None - } - Err(diag) => { - let rejected = rejected_data_lambda_connective( - name, - lambda_ctx.dag.declaration(decl_id).connective.clone(), - diag.clone(), - span, - lambda_ctx.dag, - ); - lambda_ctx.dag.declaration_mut(decl_id).connective = rejected; - report_declaration_error(lambda_ctx.dag, diag); - None - } - } - } - } - Some(SurfaceExpr::Record { fields, .. }) => lower_record_to_structural( - name, - fields, - ty_decl_id, - body_span, - ctx.symbols, - ctx.dag, - ctx.pending_refined_function_refs, - ), - Some(list_expr @ SurfaceExpr::List { .. }) => lower_list_to_structural( - name, - list_expr, - ty_decl_id, - ctx.symbols, - ctx.dag, - ctx.pending_refined_function_refs, - ), - Some(lit_expr @ SurfaceExpr::Literal { .. }) => { - match lower_scalar_literal_for_type(lit_expr, ty_decl_id, ctx.dag) { - LowerScalarLiteralOutcome::Literal(bits) => { - Some(crate::dag::ValueBody::Scalar(bits)) - } - LowerScalarLiteralOutcome::NotApplicable => None, - LowerScalarLiteralOutcome::Reject(diag) => { - suppress_unparsed_scaffold = true; - report_declaration_error(ctx.dag, diag); - None - } - } - } - Some(map_expr @ SurfaceExpr::Map { .. }) => lower_map_to_structural( - name, - map_expr, - ty_decl_id, - ctx.symbols, - ctx.dag, - ctx.pending_refined_function_refs, - ), - Some(variant_expr @ SurfaceExpr::VariantRecord { .. }) => { - try_lower_symbolic_cost_bind_param_expected_structural_data( - name, - variant_expr, - ty_decl_id, - ctx.symbols, - ctx.dag, - ctx.pending_refined_function_refs, - ) - .or_else(|| { - try_lower_symbolic_cost_structural_data( - name, - variant_expr, - ty_decl_id, - ctx.symbols, - ctx.dag, - ctx.pending_refined_function_refs, - ) - }) - } - Some(SurfaceExpr::Call { target, args, .. }) => { - match ( - dsl_std_render_repeat_string_decl_id(ctx.dag), - ctx.symbols.get(target), - ) { - (Some(canonical), Some(&callee)) if callee == canonical => { - try_lower_repeat_string_string_data(args.as_slice(), ty_decl_id, ctx.dag) - } - _ => try_lower_symbolic_cost_bind_param_expected_structural_data( - name, - body.expect("call arm has body"), - ty_decl_id, - ctx.symbols, - ctx.dag, - ctx.pending_refined_function_refs, - ) - .or_else(|| { - try_lower_symbolic_cost_structural_data( - name, - body.expect("call arm has body"), - ty_decl_id, - ctx.symbols, - ctx.dag, - ctx.pending_refined_function_refs, - ) - }) - .or_else(|| { - try_lower_symbolic_cost_constant_cost_data( - target, - args.as_slice(), - ty_decl_id, - ctx.dag, - ctx.symbols.get(target).copied(), - ) - }), - } - } - _ => None, - }; - ctx.dag.declaration_mut(decl_id).value_body = match value_body { - Some(body) => Some(body), - None if suppress_unparsed_scaffold => None, - None => Some(crate::dag::ValueBody::Unparsed(body_span.clone())), - }; -} - -fn initialize_data_declaration_type( - name: &str, - ty: &SurfaceType, - dag: &mut Dag, - symbols: &HashMap, -) -> DeclarationId { - let decl_id = symbols[name]; - if let Some(ty_decl_id) = dag.declaration(decl_id).meta_tag { - return ty_decl_id; - } - let local: HashMap = HashMap::new(); - // Compute the declaration id of the type annotation (e.g. - // Realization's DeclarationId for `data rust_int: Realization`) - // — the walk starts here. - let ty_decl_id = type_to_declaration_id(ty, symbols, &local, dag); - let connective = type_to_connective(ty, symbols, &local, dag); - // meta_tag edge from the data item to its type annotation. This - // is what makes a data declaration structurally distinct from a - // type alias (R9/R10 + PR-B): the type is readable from the - // same field shape as Realization instances in rust.dag, and - // downstream consumers (emit_rust) can filter by meta_tag to - // find all declarations of a given meta-type. - dag.declaration_mut(decl_id).meta_tag = Some(ty_decl_id); - dag.declaration_mut(decl_id).connective = connective; - ty_decl_id -} - -/// Substrate fact for the R1C-B `repeat_string` data-body fold: only the declaration -/// introduced from `dsl/std/render.dag` or `render_repeat_string_bootstrap.dag` (the latter -/// emitted by `src/v3/compiler/build.rs` from the marked excerpt in `render.dag`) is eligible — -/// not any other `repeat_string` name binding (user/local shadowing). -fn dsl_std_render_repeat_string_decl_id(dag: &Dag) -> Option { - // Closed enum of substrate files that introduce the authoritative `repeat_string` - // decl (`dsl/std/render.dag` when present in the bundle, else the bootstrap slice). - const REPEAT_STRING_AUTHORITY_SUFFIXES: &[&str] = &[ - "dsl/std/render.dag", - "dsl/std/render_repeat_string_bootstrap.dag", - ]; - dag.declarations() - .iter() - .find(|d| { - d.name.as_deref() == Some("repeat_string") - && REPEAT_STRING_AUTHORITY_SUFFIXES - .iter() - .any(|suffix| d.span.file.ends_with(suffix)) - }) - .map(|d| d.id) -} - -/// R1C-B / T-P0: fold `data …: String = repeat_string(s: , n: )` to a -/// `ValueBody::Scalar` at lower time so `TestRunner` `OutputEquals` witnesses modeled -/// `repeat_string` without the v2-oracle bridge. -fn try_lower_repeat_string_string_data( - args: &[SurfaceExpr], - ty_decl_id: DeclarationId, - dag: &Dag, -) -> Option { - if !is_string_type_decl(dag, ty_decl_id) { - return None; - } - let [arg0] = args else { - return None; - }; - let SurfaceExpr::Record { fields, .. } = arg0 else { - return None; - }; - let mut s_value: Option = None; - let mut n_value: Option = None; - for field in fields { - match field.name.as_str() { - "s" => match &field.value { - SurfaceExpr::Literal { - value: SurfaceLiteral::String(s), - .. - } => s_value = Some(s.clone()), - _ => return None, - }, - "n" => match &field.value { - SurfaceExpr::Literal { - value: SurfaceLiteral::Int(n), - .. - } => n_value = Some(i64::from_str(n.as_str()).ok()?), - _ => return None, - }, - _ => return None, - } - } - let s = s_value?; - let n = n_value?; - let folded = fold_repeat_string_semantics(&s, n)?; - Some(crate::dag::ValueBody::Scalar(LiteralBits::String(folded))) -} - -fn is_string_type_decl(dag: &Dag, ty_decl_id: DeclarationId) -> bool { - if let Some(shape) = dag.string_shape() { - return shape.declaration == ty_decl_id; - } - matches!(dag.declaration(ty_decl_id).name.as_deref(), Some("String")) -} - -/// Upper bound on repeat count for compile-time `repeat_string` folding on `data` bodies. -const REPEAT_STRING_FOLD_MAX_COUNT: i64 = 1_048_576; - -/// Upper bound on produced UTF-8 bytes for the same fold (defense in depth with [`REPEAT_STRING_FOLD_MAX_COUNT`]). -const REPEAT_STRING_FOLD_MAX_OUTPUT_BYTES: usize = 64 * 1024 * 1024; - -/// Semantics aligned with `dsl/std/render.dag` `repeat_string` / `repeat_string_loop` (same text -/// is mechanically sliced into `render_repeat_string_bootstrap.dag` — see `build.rs`): -/// `remaining <= 0` returns the accumulator immediately (`""` for `repeat_string`), so **both** -/// `n == 0` and **`n < 0`** fold to an empty string — matches the bounded-loop story in -/// `dsl/std/render.dag` (not a separate partial semantics for negative `n`). -/// -/// Fail-closed on excessive `n` or output size so lowering does not materialize unbounded strings -/// for hostile literals (see R1C-B T-P0 gate — bounded compile-time fold). -fn fold_repeat_string_semantics(s: &str, n: i64) -> Option { - if n <= 0 { - return Some(String::new()); - } - if n > REPEAT_STRING_FOLD_MAX_COUNT { - return None; - } - let total = (s.len() as i128).checked_mul(n as i128)?; - if total > REPEAT_STRING_FOLD_MAX_OUTPUT_BYTES as i128 { - return None; - } - Some(s.repeat(n as usize)) -} - -fn type_decl_is_symbolic_cost(dag: &Dag, mut ty_decl_id: DeclarationId) -> bool { - for _ in 0..32 { - let decl = dag.declaration(ty_decl_id); - if decl.name.as_deref() == Some("SymbolicCost") { - return true; - } - match &decl.connective { - TypeConnective::Instantiation { - template, - arguments, - } if arguments.is_empty() => { - ty_decl_id = *template; - } - TypeConnective::Atom( - AtomPayload::ResolvedByStructure(next) | AtomPayload::ResolvedByName(next), - ) => { - ty_decl_id = *next; - } - _ => return false, - } - } - false -} - -fn symbolic_cost_variant_constructor_id(dag: &Dag, variant_label: &str) -> Option { - let symbolic_cost = dag.declaration_by_name("SymbolicCost")?; - let TypeConnective::Disj { variants } = &symbolic_cost.connective else { - return None; - }; - variants - .iter() - .find(|v| v.label == variant_label) - .map(|v| v.ty) -} - -/// `data …: SymbolicCost = ConstantCost()` — progress on **R3 gate #40** -/// (`symbolic_cost_expr_equals_executable`) / the ROADMAP.md debt row where §SymbolicCostExprEquals was -/// still `NotYetImplemented`: a narrow **class-5 gap #3** lowering slice until general `SymbolicCost` -/// data literals lower structurally (same gap named in `lower_data_item` / DOWNSTREAM_REQUIREMENTS). -/// -/// **Terminology:** do not read this staged compiler hook as INVARIANTS **P5(b)**’s per-PR “checkable -/// receipt” (deleted scaffold path, SG-0 census before/after in `sg0_census_test.rs`, or explicit -/// deferral citing a `ROADMAP.md` row). Those receipts belong in the **PR description**, not in this -/// doc comment. -/// -/// **Canonical constructor id (modeling Practice 5 / single authority at the boundary):** like -/// [`dsl_std_render_repeat_string_decl_id`] -/// for `repeat_string`, only the **bootstrap** `SymbolicCost::ConstantCost` variant constructor is -/// eligible — compare the resolved callee [`DeclarationId`] to [`symbolic_cost_variant_constructor_id`], -/// not only the surface spelling `ConstantCost` (local shadowing must not reinterpret as std arm). -fn try_lower_symbolic_cost_constant_cost_data( - target: &str, - args: &[SurfaceExpr], - ty_decl_id: DeclarationId, - dag: &Dag, - resolved_call_target: Option, -) -> Option { - if target != "ConstantCost" || args.len() != 1 { - return None; - } - let canonical_constant_cost = symbolic_cost_variant_constructor_id(dag, "ConstantCost")?; - let resolved = resolved_call_target?; - if resolved != canonical_constant_cost { - return None; - } - if !type_decl_is_symbolic_cost(dag, ty_decl_id) { - return None; - } - let SurfaceExpr::Literal { - value: SurfaceLiteral::Int(s), - .. - } = &args[0] - else { - return None; - }; - let constructor = canonical_constant_cost; - Some(crate::dag::ValueBody::Structural { - fields: vec![( - "_".to_string(), - crate::dag::FieldValue::Variant { - constructor, - payload: vec![crate::dag::FieldValue::Literal(LiteralBits::Int(s.clone()))], - }, - )], - }) -} - -fn try_lower_symbolic_cost_structural_data( - name: &str, - expr: &SurfaceExpr, - ty_decl_id: DeclarationId, - symbols: &HashMap, - dag: &mut Dag, - pending_refined_function_refs: &HashSet, -) -> Option { - if !type_decl_is_symbolic_cost(dag, ty_decl_id) { - return None; - } - if !symbolic_cost_expr_uses_canonical_constructors(name, expr, symbols, dag) { - return None; - } - let span = surface_expr_span(expr); - let fv = lower_structural_field_value( - name, - "_", - expr, - ty_decl_id, - &LowerSubstStack::default(), - symbols, - dag, - None, - span, - pending_refined_function_refs, - )?; - Some(crate::dag::ValueBody::Structural { - fields: vec![("_".to_string(), fv)], - }) -} - -fn try_lower_symbolic_cost_bind_param_expected_structural_data( - name: &str, - expr: &SurfaceExpr, - ty_decl_id: DeclarationId, - symbols: &HashMap, - dag: &mut Dag, - pending_refined_function_refs: &HashSet, -) -> Option { - let expected_id = dag.declaration_by_name("SymbolicCostBindParamExpected")?.id; - if ty_decl_id != expected_id { - return None; - } - let span = surface_expr_span(expr); - let fv = lower_structural_field_value( - name, - "_", - expr, - ty_decl_id, - &LowerSubstStack::default(), - symbols, - dag, - None, - span, - pending_refined_function_refs, - )?; - Some(crate::dag::ValueBody::Structural { - fields: vec![("_".to_string(), fv)], - }) -} - -fn symbolic_cost_expr_uses_canonical_constructors( - data_name: &str, - expr: &SurfaceExpr, - symbols: &HashMap, - dag: &mut Dag, -) -> bool { - match expr { - SurfaceExpr::Call { target, args, span } => { - if !symbolic_cost_constructor_spelling_is_canonical( - data_name, target, span, symbols, dag, - ) { - return false; - } - args.iter().all(|arg| { - symbolic_cost_expr_uses_canonical_constructors(data_name, arg, symbols, dag) - }) - } - SurfaceExpr::VariantRecord { - target, - fields, - span, - } => { - symbolic_cost_constructor_spelling_is_canonical(data_name, target, span, symbols, dag) - && fields.iter().all(|field| { - symbolic_cost_expr_uses_canonical_constructors( - data_name, - &field.value, - symbols, - dag, - ) - }) - } - SurfaceExpr::Operator { args, .. } | SurfaceExpr::PathCall { args, .. } => { - args.iter().all(|arg| { - symbolic_cost_expr_uses_canonical_constructors(data_name, arg, symbols, dag) - }) - } - SurfaceExpr::Lambda { body, .. } => { - symbolic_cost_expr_uses_canonical_constructors(data_name, body, symbols, dag) - } - SurfaceExpr::If { - cond, - then_branch, - else_branch, - .. - } => { - symbolic_cost_expr_uses_canonical_constructors(data_name, cond, symbols, dag) - && symbolic_cost_expr_uses_canonical_constructors( - data_name, - then_branch, - symbols, - dag, - ) - && symbolic_cost_expr_uses_canonical_constructors( - data_name, - else_branch, - symbols, - dag, - ) - } - SurfaceExpr::Match { - scrutinee, arms, .. - } => { - symbolic_cost_expr_uses_canonical_constructors(data_name, scrutinee, symbols, dag) - && arms.iter().all(|arm| { - symbolic_cost_expr_uses_canonical_constructors( - data_name, &arm.body, symbols, dag, - ) - }) - } - SurfaceExpr::Record { fields, .. } => fields.iter().all(|field| { - symbolic_cost_expr_uses_canonical_constructors(data_name, &field.value, symbols, dag) - }), - SurfaceExpr::List { elements, .. } => elements.iter().all(|element| { - symbolic_cost_expr_uses_canonical_constructors(data_name, element, symbols, dag) - }), - SurfaceExpr::Map { entries, .. } => entries.iter().all(|entry| { - symbolic_cost_expr_uses_canonical_constructors(data_name, &entry.value, symbols, dag) - }), - SurfaceExpr::Literal { .. } | SurfaceExpr::Var { .. } | SurfaceExpr::Path { .. } => true, - } -} - -fn symbolic_cost_constructor_spelling_is_canonical( - data_name: &str, - target: &str, - span: &SourceSpan, - symbols: &HashMap, - dag: &mut Dag, -) -> bool { - let Some(canonical) = symbolic_cost_variant_constructor_id(dag, target) else { - return true; - }; - if symbols.get(target).copied() == Some(canonical) { - return true; - } - report_declaration_error( - dag, - Diagnostic::ResolveError { - name: format!( - "data `{data_name}` SymbolicCost constructor `{target}` is shadowed or unresolved; \ - expected the canonical std.algebra `{target}` constructor" - ), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - }, - ); - false -} - -fn lower_list_to_structural( - name: &str, - expr: &SurfaceExpr, - ty_decl_id: DeclarationId, - symbols: &HashMap, - dag: &mut Dag, - pending_refined_function_refs: &HashSet, -) -> Option { - let Some(element_type) = list_element_type(dag, ty_decl_id) else { - report_declaration_error( - dag, - Diagnostic::ResolveError { - name: format!( - "data `{name}` has a list body but its declared type is not a List<_>" - ), - span: surface_expr_span(expr).clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - }, - ); - return None; - }; - let SurfaceExpr::List { elements, .. } = expr else { - unreachable!("lower_list_to_structural only accepts SurfaceExpr::List"); - }; - let mut lowered = Vec::with_capacity(elements.len()); - for element in elements { - lowered.push(lower_structural_field_value( - name, - "", - element, - element_type, - &LowerSubstStack::default(), - symbols, - dag, - None, - surface_expr_span(element), - pending_refined_function_refs, - )?); - } - Some(crate::dag::ValueBody::List(lowered)) -} - -fn lower_map_to_structural( - name: &str, - expr: &SurfaceExpr, - ty_decl_id: DeclarationId, - symbols: &HashMap, - dag: &mut Dag, - pending_refined_function_refs: &HashSet, -) -> Option { - let Some(value_type) = map_value_type(dag, ty_decl_id) else { - let expected_shape = if map_key_type_is_not_string(dag, ty_decl_id) { - "Map; non-String map keys are not supported by ValueBody::Map" - } else { - "Map" - }; - report_declaration_error( - dag, - Diagnostic::ResolveError { - name: format!( - "data `{name}` has a map body but its declared type is not a {expected_shape}" - ), - span: surface_expr_span(expr).clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - }, - ); - return None; - }; - let SurfaceExpr::Map { entries, .. } = expr else { - unreachable!("lower_map_to_structural only accepts SurfaceExpr::Map"); - }; - let lowered = lower_string_map_entries( - name, - entries, - value_type, - &LowerSubstStack::default(), - symbols, - dag, - pending_refined_function_refs, - )?; - Some(crate::dag::ValueBody::Map(lowered)) -} - -fn lower_string_map_entries( - data_name: &str, - entries: &[crate::parse_surface::SurfaceMapEntry], - value_type: DeclarationId, - subst: &LowerSubstStack, - symbols: &HashMap, - dag: &mut Dag, - pending_refined_function_refs: &HashSet, -) -> Option { - let mut seen = HashSet::new(); - let mut lowered = Vec::with_capacity(entries.len()); - for entry in entries { - if !seen.insert(entry.key.clone()) { - report_declaration_error( - dag, - Diagnostic::ResolveError { - name: format!("data `{data_name}` map body repeats key `{}`", entry.key), - span: entry.key_span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - }, - ); - return None; - } - lowered.push(( - entry.key.clone(), - lower_structural_field_value( - data_name, - &entry.key, - &entry.value, - resolve_decl_with_subst_lower(dag, value_type, subst, 0).unwrap_or(value_type), - subst, - symbols, - dag, - None, - surface_expr_span(&entry.value), - pending_refined_function_refs, - )?, - )); - } - match FieldMap::from_entries(lowered) { - Ok(map) => Some(map), - Err(duplicate) => { - report_declaration_error( - dag, - Diagnostic::ResolveError { - name: format!( - "data `{data_name}` map body repeats key `{}`", - duplicate.key - ), - span: SourceSpan::new("", 0, 0), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - }, - ); - None - } - } -} - -/// Walk a declaration through `Instantiation` / `ResolvedIdentifier` -/// edges until it reaches a declaration whose connective is -/// `Conj`. Returns the `DeclarationId` of that Conj declaration — or -/// `None` if no Conj is reachable within the walk depth limit, or -/// the chain terminates at some other connective. -/// -/// Used by `lower_data_item` for data body inhabitance checking. -/// Mirrors the `walk_to_disj_decl` helper in `infer.rs`: the two -/// walks look for complementary terminal shapes (Conj for data -/// item inhabitance vs Disj for Branch scrutinees), but follow the -/// same alias/instantiation chains otherwise. -fn walk_to_conj_decl(dag: &Dag, start: DeclarationId) -> Option { - let mut current = start; - for _ in 0..32 { - let decl = dag.declaration(current); - match &decl.connective { - TypeConnective::Conj { .. } => return Some(current), - TypeConnective::Instantiation { template, .. } => { - current = *template; - } - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - current = *next; - } - _ => return None, - } - } - None -} - -fn walk_to_disj_decl(dag: &Dag, start: DeclarationId) -> Option { - let mut current = start; - for _ in 0..32 { - let decl = dag.declaration(current); - match &decl.connective { - TypeConnective::Disj { .. } => return Some(current), - TypeConnective::Instantiation { template, .. } => { - current = *template; - } - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - current = *next; - } - _ => return None, - } - } - None -} - -fn walk_to_disj_decl_with_subst_lower( - dag: &Dag, - start: DeclarationId, - subst: &mut LowerSubstStack, -) -> Option { - let mut current = start; - for _ in 0..32 { - match &dag.declaration(current).connective { - TypeConnective::Disj { .. } => return Some(current), - TypeConnective::Instantiation { - template, - arguments, - } => { - subst.push(arguments.clone()); - current = *template; - } - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => current = *next, - TypeConnective::Atom(AtomPayload::TypeParam(_)) => current = subst.lookup(current)?, - _ => return None, - } - } - None -} - -#[derive(Clone, Default)] -struct LowerSubstStack { - frames: Vec>, -} - -impl LowerSubstStack { - fn push(&mut self, frame: Vec) { - self.frames.push(frame); - } - - fn lookup(&self, parameter: DeclarationId) -> Option { - self.frames - .iter() - .rev() - .find_map(|frame| frame.iter().find(|arg| arg.parameter == parameter)) - .map(|arg| arg.value) - } -} - -fn find_equivalent_decl_instantiation_lower( - dag: &Dag, - template: DeclarationId, - arguments: &[TemplateArgument], -) -> Option { - dag.declarations().iter().find_map(|decl| { - let TypeConnective::Instantiation { - template: existing_template, - arguments: existing_arguments, - } = &decl.connective - else { - return None; - }; - (template == *existing_template - && existing_arguments.len() == arguments.len() - && existing_arguments - .iter() - .zip(arguments.iter()) - .all(|(lhs, rhs)| lhs.parameter == rhs.parameter && lhs.value == rhs.value)) - .then_some(decl.id) - }) -} - -fn resolve_decl_with_subst_lower( - dag: &Dag, - current: DeclarationId, - subst: &LowerSubstStack, - depth: usize, -) -> Option { - if depth >= 32 { - return None; - } - match &dag.declaration(current).connective { - TypeConnective::Atom(AtomPayload::TypeParam(_)) => subst - .lookup(current) - .and_then(|bound| resolve_decl_with_subst_lower(dag, bound, subst, depth + 1)) - .or(Some(current)), - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - resolve_decl_with_subst_lower(dag, *next, subst, depth + 1) - } - TypeConnective::Instantiation { - template, - arguments, - } => { - let specialized_arguments: Vec = arguments - .iter() - .map(|arg| { - Some(TemplateArgument { - parameter: arg.parameter, - value: resolve_decl_with_subst_lower(dag, arg.value, subst, depth + 1)?, - }) - }) - .collect::>()?; - if specialized_arguments - .iter() - .zip(arguments.iter()) - .all(|(lhs, rhs)| lhs.parameter == rhs.parameter && lhs.value == rhs.value) - { - return Some(current); - } - find_equivalent_decl_instantiation_lower(dag, *template, &specialized_arguments) - .or(Some(current)) - } - TypeConnective::Cardinality(_) - | TypeConnective::Arrow { .. } - | TypeConnective::Conj { .. } - | TypeConnective::Disj { .. } - | TypeConnective::Atom(AtomPayload::UnresolvedIdentifier(_)) - | TypeConnective::Atom(AtomPayload::Literal(_)) => Some(current), - } -} - -fn concretize_decl_with_lower_subst( - dag: &mut Dag, - current: DeclarationId, - subst: &LowerSubstStack, - depth: usize, -) -> DeclarationId { - if depth >= 32 { - return current; - } - let decl = dag.declaration(current).clone(); - match decl.connective { - TypeConnective::Atom(AtomPayload::TypeParam(_)) => match subst.lookup(current) { - Some(bound) => concretize_decl_with_lower_subst(dag, bound, subst, depth + 1), - None => current, - }, - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - concretize_decl_with_lower_subst(dag, next, subst, depth + 1) - } - TypeConnective::Instantiation { - template, - arguments, - } => { - let specialized_arguments: Vec = arguments - .into_iter() - .map(|arg| TemplateArgument { - parameter: arg.parameter, - value: concretize_decl_with_lower_subst(dag, arg.value, subst, depth + 1), - }) - .collect(); - if let Some(existing) = - find_equivalent_decl_instantiation_lower(dag, template, &specialized_arguments) - { - return existing; - } - let id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id, - name: None, - connective: TypeConnective::Instantiation { - template, - arguments: specialized_arguments, - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: decl.nominal_opacity, - span: decl.span, - }); - id - } - TypeConnective::Cardinality(payload) => { - let element = - concretize_decl_with_lower_subst(dag, payload.element(), subst, depth + 1); - dag.alloc_cardinality_decl(element, payload.bound(), decl.span) - } - TypeConnective::Arrow { inputs, output, .. } => { - let original_inputs = inputs.clone(); - let specialized_inputs: Vec = inputs - .into_iter() - .map(|input| concretize_decl_with_lower_subst(dag, input, subst, depth + 1)) - .collect(); - let specialized_output = - concretize_decl_with_lower_subst(dag, output, subst, depth + 1); - if specialized_inputs == original_inputs && specialized_output == output { - return current; - } - let id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id, - name: None, - connective: TypeConnective::Arrow { - inputs: specialized_inputs, - output: specialized_output, - body: ArrowBody::NoBody, - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: decl.span, - }); - id - } - TypeConnective::Conj { .. } - | TypeConnective::Disj { .. } - | TypeConnective::Atom(AtomPayload::UnresolvedIdentifier(_)) - | TypeConnective::Atom(AtomPayload::Literal(_)) => current, - } -} - -fn walk_to_conj_decl_with_subst_lower( - dag: &Dag, - start: DeclarationId, - subst: &mut LowerSubstStack, -) -> Option { - let mut current = start; - for _ in 0..32 { - match &dag.declaration(current).connective { - TypeConnective::Conj { .. } => return Some(current), - TypeConnective::Instantiation { - template, - arguments, - } => { - subst.push(arguments.clone()); - current = *template; - } - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => current = *next, - TypeConnective::Atom(AtomPayload::TypeParam(_)) => current = subst.lookup(current)?, - _ => return None, - } - } - None -} - -fn walk_to_type_shape_lower( - dag: &Dag, - current: DeclarationId, - subst: &LowerSubstStack, - depth: usize, -) -> Option { - if depth >= 32 { - return None; - } - let decl = dag.declaration(current); - if decl.name.is_some() { - return Some(TypeShape::new(current)); - } - match &decl.connective { - TypeConnective::Atom(AtomPayload::TypeParam(_)) => { - if let Some(bound) = subst.lookup(current) { - walk_to_type_shape_lower(dag, bound, subst, depth + 1) - } else { - Some(TypeShape::new(current)) - } - } - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - walk_to_type_shape_lower(dag, *next, subst, depth + 1) - } - TypeConnective::Instantiation { .. } => { - resolve_decl_with_subst_lower(dag, current, subst, depth + 1) - .map(TypeShape::new) - .or_else(|| Some(TypeShape::new(current))) - } - TypeConnective::Atom(AtomPayload::UnresolvedIdentifier(_)) - | TypeConnective::Atom(AtomPayload::Literal(_)) - | TypeConnective::Conj { .. } - | TypeConnective::Disj { .. } - | TypeConnective::Arrow { .. } - | TypeConnective::Cardinality(_) => None, - } -} - -fn resolve_static_field_project( - dag: &Dag, - input_port: PortId, - field_label: &str, -) -> Option<(DeclarationId, TypeShape)> { - let input_ty = match dag.port(input_port).state() { - crate::dag::PortState::Resolved(ty) => *ty, - crate::dag::PortState::Uninferred | crate::dag::PortState::Unresolved => return None, - }; - let mut subst = LowerSubstStack::default(); - let conj_id = walk_to_conj_decl_with_subst_lower(dag, input_ty.declaration, &mut subst)?; - let children = match &dag.declaration(conj_id).connective { - TypeConnective::Conj { children } => children, - _ => return None, - }; - let field_decl = children - .iter() - .find(|field| field.label == field_label) - .map(|field| field.ty)?; - let output_ty = walk_to_type_shape_lower(dag, field_decl, &subst, 0)?; - Some((field_decl, output_ty)) -} - -/// Attempt to lower a parsed record literal body into a -/// `ValueBody::Structural { fields }` by matching each record field -/// against the declared type's Conj children. Returns `None` (and -/// attaches one or more diagnostics) if any check fails; the caller -/// falls back to `ValueBody::Unparsed`. -/// -/// Validation rules: -/// 1. The type annotation's declaration must walk to a `Conj` -/// declaration via `walk_to_conj_decl`. Failure → diagnostic -/// "data item's type has no record shape" → return None. -/// 2. The record literal's field labels must exactly match the -/// Conj's children — no extras, no missing. -/// 3. Each field's value must be a `SurfaceExpr::Literal` -/// (scalar literal). Nested records, variable references, and -/// computed expressions are class-5 gap #3 follow-ups. -/// 4. Each literal's type must match the corresponding Conj -/// field's declared type (validated via the primitive cache). -fn lower_record_to_structural( - data_name: &str, - record_fields: &[crate::parse::SurfaceRecordField], - ty_decl_id: DeclarationId, - body_span: &SourceSpan, - symbols: &HashMap, - dag: &mut Dag, - pending_refined_function_refs: &HashSet, -) -> Option { - let mut subst = LowerSubstStack::default(); - let Some(conj_id) = walk_to_conj_decl_with_subst_lower(dag, ty_decl_id, &mut subst) else { - report_declaration_error( - dag, - Diagnostic::ResolveError { - name: format!( - "data `{data_name}`'s type annotation does not resolve to a record type (Conj); cannot apply inhabitance checking to the body" - ), - span: body_span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("LoweringDiagnostic"), - }, - ); - return None; - }; - // Snapshot the Conj's children to avoid borrowing conflicts - // while we walk the record literal. - let type_fields: Vec<(String, DeclarationId)> = match &dag.declaration(conj_id).connective { - TypeConnective::Conj { children } => children - .iter() - .map(|f| { - ( - f.label.clone(), - resolve_decl_with_subst_lower(dag, f.ty, &subst, 0).unwrap_or(f.ty), - ) - }) - .collect(), - _ => unreachable!("walk_to_conj_decl returned a non-Conj declaration"), - }; - if let Some(record_field) = duplicate_record_field(record_fields) { - report_declaration_error( - dag, - Diagnostic::ResolveError { - name: format!( - "data `{data_name}` record body repeats field `{}`", - record_field.name - ), - span: record_field.span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - }, - ); - return None; - } - // Check no extra fields in the data body. - for record_field in record_fields { - if !type_fields - .iter() - .any(|(label, _)| *label == record_field.name) - { - report_declaration_error( - dag, - Diagnostic::ResolveError { - name: format!( - "data `{data_name}` has field `{}` but the type has no such field", - record_field.name - ), - span: record_field.span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - }, - ); - return None; - } - } - // Check no missing fields. - for (type_label, _) in &type_fields { - if !record_fields.iter().any(|f| f.name == *type_label) { - report_declaration_error( - dag, - Diagnostic::ResolveError { - name: format!("data `{data_name}` is missing required field `{type_label}`"), - span: body_span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - }, - ); - return None; - } - } - // Determine which realization category (if any) this data - // item belongs to. Used below to narrow the acceptable shape - // of `target` / `op` field values per category. The category - // is identified by name lookup (Phase 2 doesn't have the - // realization meta cache populated yet — that runs at - // bootstrap end). Same lookup as for primitives above. - let category = realization_category_for_meta(dag, ty_decl_id); - - let mut structural_fields: Vec<(String, crate::dag::FieldValue)> = - Vec::with_capacity(type_fields.len()); - for (type_label, type_field_id) in &type_fields { - let record_field = record_fields - .iter() - .find(|f| f.name == *type_label) - .expect("checked above"); - let field_value = lower_structural_field_value( - data_name, - type_label, - &record_field.value, - *type_field_id, - &subst, - symbols, - dag, - category, - &record_field.span, - pending_refined_function_refs, - )?; - structural_fields.push((type_label.clone(), field_value)); - } - if category == Some(RealizationCategoryTag::Operator) - && !validate_operator_realization_free_monoid_op_pairing( - dag, - data_name, - &structural_fields, - body_span, - ) - { - return None; - } - Some(crate::dag::ValueBody::Structural { - fields: structural_fields, - }) -} - -/// `OperatorRealization.target: FreeMonoid` is only meaningful for the monoid -/// witness equality path, which selects `OrderedRing.eq` after the walk. -/// Enforce that pairing here (once both fields are lowered) so illegal -/// `(FreeMonoid, op)` shapes fail closed at the realization boundary rather -/// than relying on spec authors (INVARIANTS P2/P3). -fn validate_operator_realization_free_monoid_op_pairing( - dag: &mut Dag, - data_name: &str, - structural_fields: &[(String, crate::dag::FieldValue)], - body_span: &SourceSpan, -) -> bool { - let Some(free_monoid) = dag.declaration_by_name("FreeMonoid").map(|d| d.id) else { - return true; - }; - let Some(crate::dag::FieldValue::Reference(target_id)) = structural_fields - .iter() - .find(|(label, _)| label == "target") - .map(|(_, v)| v) - else { - return true; - }; - if *target_id != free_monoid { - return true; - } - let Some(crate::dag::FieldValue::Reference(op_id)) = structural_fields - .iter() - .find(|(label, _)| label == "op") - .map(|(_, v)| v) - else { - report_declaration_error( - dag, - Diagnostic::ResolveError { - name: format!( - "data `{data_name}` (`OperatorRealization`): `target: FreeMonoid` requires `op` as a resolved algebra field reference" - ), - span: body_span.clone(), - correction: Correction::deferred_for_diagnostic_class("LoweringDiagnostic"), - }, - ); - return false; - }; - let Some(expected_eq) = canonical_ordered_ring_operator_field_arrow( - dag, - OperatorKind::Comparison(ComparisonOp::Eq), - ) else { - report_declaration_error( - dag, - Diagnostic::ResolveError { - name: format!( - "data `{data_name}` (`OperatorRealization`): `target: FreeMonoid` requires canonical `OrderedRing.eq`, but the `OrderedRing` algebra metadata is unavailable" - ), - span: body_span.clone(), - correction: Correction::deferred_for_diagnostic_class("LoweringDiagnostic"), - }, - ); - return false; - }; - if *op_id != expected_eq { - report_declaration_error( - dag, - Diagnostic::ResolveError { - name: format!( - "data `{data_name}` (`OperatorRealization`): `target: FreeMonoid` is only legal with `op: OrderedRing.eq` (fail-closed narrowing); resolved `op` does not match canonical `OrderedRing.eq`" - ), - span: body_span.clone(), - correction: Correction::deferred_for_diagnostic_class("LoweringDiagnostic"), - }, - ); - return false; - } - true -} - -fn canonical_ordered_ring_operator_field_arrow( - dag: &Dag, - op: OperatorKind, -) -> Option { - let ordered_ring_id = dag.ordered_ring_decl()?; - let ordered_ring = dag.declaration(ordered_ring_id); - let TypeConnective::Conj { children } = &ordered_ring.connective else { - return None; - }; - let label = crate::operators::algebra_field_name(op); - children - .iter() - .find(|field| field.label == label) - .map(|field| field.ty) -} - -fn duplicate_record_field( - fields: &[crate::parse::SurfaceRecordField], -) -> Option<&crate::parse::SurfaceRecordField> { - let mut seen = HashSet::new(); - fields.iter().find(|field| !seen.insert(field.name.clone())) -} - -/// `PositiveIntervalWidth.UnitCount` carries a Peano-spine authoring shorthand; -/// reject negative `units` literals so width magnitude stays nonnegative at rest. -fn enforce_non_negative_unit_count_payload( - dag: &Dag, - variant_payload_ty: DeclarationId, - payload: &[crate::dag::FieldValue], - span: &SourceSpan, -) -> Result<(), Diagnostic> { - let Some(piw_decl) = dag.declaration_by_name("PositiveIntervalWidth") else { - return Ok(()); - }; - let TypeConnective::Disj { variants } = &piw_decl.connective else { - return Ok(()); - }; - let Some(unit_variant) = variants.iter().find(|v| v.label == "UnitCount") else { - return Ok(()); - }; - if unit_variant.ty != variant_payload_ty { - return Ok(()); - } - let Some(first) = payload.first() else { - return Err(Diagnostic::ResolveError { - name: "PositiveIntervalWidth.UnitCount payload is empty".to_string(), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - }); - }; - match first { - crate::dag::FieldValue::Literal(LiteralBits::Int(s)) => { - let Ok(n) = i128::from_str(s.as_str()) else { - return Err(Diagnostic::ResolveError { - name: "PositiveIntervalWidth.UnitCount requires a literal Int `units` field" - .to_string(), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - }); - }; - if n >= 0 { - Ok(()) - } else { - Err(Diagnostic::ResolveError { - name: crate::diagnostics::positive_interval_width_unit_count_requires_nonnegative_units_literal_message( - s.as_str(), - ), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("LoweringDiagnostic"), - }) - } - } - _ => Err(Diagnostic::ResolveError { - name: "PositiveIntervalWidth.UnitCount requires a literal Int `units` field" - .to_string(), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - }), - } -} - -#[allow(clippy::too_many_arguments)] -fn lower_structural_field_value( - data_name: &str, - field_label: &str, - expr: &SurfaceExpr, - expected_type: DeclarationId, - subst: &LowerSubstStack, - symbols: &HashMap, - dag: &mut Dag, - category: Option, - span: &SourceSpan, - pending_refined_function_refs: &HashSet, -) -> Option { - if let Some(marker_id) = dag.declaration_by_name("DeclarationRef").map(|d| d.id) { - if walks_to(dag, expected_type, marker_id) { - let Some(decl_id) = resolve_field_value_as_declaration_ref(expr, symbols, dag) else { - report_declaration_error( - dag, - Diagnostic::ResolveError { - name: format!( - "data `{data_name}` field `{field_label}` must be a DeclarationRef edge; use an identifier or dotted path, not a record literal" - ), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("LoweringDiagnostic"), - }, - ); - return None; - }; - if let Some(cat) = category { - if let Err(reason) = - validate_realization_field_target(dag, cat, field_label, decl_id) - { - report_declaration_error( - dag, - Diagnostic::ResolveError { - name: format!( - "data `{data_name}` field `{field_label}` does not satisfy the {cat:?} realization constraint: {reason}" - ), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("LoweringDiagnostic"), - }, - ); - return None; - } - } - return Some(crate::dag::FieldValue::Reference(decl_id)); - } - } - - // `v3.std.substrate_minimal::DeclarationId` — nominal carrier for "any - // declaration at the DAG level" (e.g. `SectionRef.DeclarationScope.declaration`). - // Unlike `DeclarationRef` (spec refinement), this is the substrate row type; - // references may point at functions (`Arrow`), types, or `data` carriers. - if let Some(marker_id) = dag.declaration_by_name("DeclarationId").map(|d| d.id) { - if declaration_ref_types_equivalent_with_subst(dag, marker_id, expected_type, subst, 0) { - let decl_id = resolve_field_value_as_declaration_ref(expr, symbols, dag)?; - if let Some(cat) = category { - if let Err(reason) = - validate_realization_field_target(dag, cat, field_label, decl_id) - { - report_declaration_error( - dag, - Diagnostic::ResolveError { - name: format!( - "data `{data_name}` field `{field_label}` does not satisfy the {cat:?} realization constraint: {reason}" - ), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("LoweringDiagnostic"), - }, - ); - return None; - } - } - return Some(crate::dag::FieldValue::Reference(decl_id)); - } - } - - if let Some(decl_id) = resolve_field_value_as_declaration_ref(expr, symbols, dag) { - if pending_refined_function_refs.contains(&decl_id) { - report_declaration_error( - dag, - Diagnostic::ResolveError { - name: format!( - "data `{data_name}` field `{field_label}` references a function with a `where`-refined parameter before refinement discharge is available for data field references" - ), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("LoweringDiagnostic"), - }, - ); - return None; - } - let referenced = dag.declaration(decl_id); - if is_value_level_arrow_declaration(referenced) - && declaration_ref_types_equivalent_with_subst(dag, decl_id, expected_type, subst, 0) - { - return Some(crate::dag::FieldValue::Reference(decl_id)); - } - if is_value_level_arrow_declaration(referenced) { - let expected = concretize_decl_with_lower_subst(dag, expected_type, subst, 0); - report_declaration_error( - dag, - Diagnostic::TypeMismatch { - expected: TypeShape::new(expected), - actual: TypeShape::new(decl_id), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - }, - ); - return None; - } - if referenced.meta_tag.is_some_and(|actual| { - declaration_ref_types_equivalent_with_subst(dag, actual, expected_type, subst, 0) - }) { - return Some(crate::dag::FieldValue::Reference(decl_id)); - } - if let Some(actual) = referenced.meta_tag { - let expected = concretize_decl_with_lower_subst(dag, expected_type, subst, 0); - report_declaration_error( - dag, - Diagnostic::TypeMismatch { - expected: TypeShape::new(expected), - actual: TypeShape::new(actual), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - }, - ); - return None; - } - } - - match lower_scalar_literal_for_type(expr, expected_type, dag) { - LowerScalarLiteralOutcome::Literal(literal_bits) => { - return Some(crate::dag::FieldValue::Literal(literal_bits)); - } - LowerScalarLiteralOutcome::NotApplicable => {} - LowerScalarLiteralOutcome::Reject(diag) => { - report_declaration_error(dag, diag); - return None; - } - } - - if let Some(element_type) = list_element_type_with_subst(dag, expected_type, subst, 0) { - let SurfaceExpr::List { elements, .. } = expr else { - report_declaration_error( - dag, - Diagnostic::ResolveError { - name: format!( - "data `{data_name}` field `{field_label}` must be a list literal matching the declared List<_> type" - ), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("LoweringDiagnostic"), - }, - ); - return None; - }; - let mut lowered = Vec::with_capacity(elements.len()); - for element in elements { - lowered.push(lower_structural_field_value( - data_name, - field_label, - element, - element_type, - subst, - symbols, - dag, - None, - surface_expr_span(element), - pending_refined_function_refs, - )?); - } - return Some(crate::dag::FieldValue::List(lowered)); - } - - if let Some(value_type) = map_value_type_with_subst(dag, expected_type, subst, 0) { - let SurfaceExpr::Map { entries, .. } = expr else { - report_declaration_error( - dag, - Diagnostic::ResolveError { - name: format!( - "data `{data_name}` field `{field_label}` must be a map literal matching the declared Map type" - ), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("LoweringDiagnostic"), - }, - ); - return None; - }; - let lowered = lower_string_map_entries( - data_name, - entries, - value_type, - subst, - symbols, - dag, - pending_refined_function_refs, - )?; - return Some(crate::dag::FieldValue::Map(lowered)); - } - - if map_key_type_is_not_string_with_subst(dag, expected_type, subst, 0) { - report_declaration_error( - dag, - Diagnostic::ResolveError { - name: format!( - "data `{data_name}` field `{field_label}` has a map value but the declared map key type is not String" - ), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("LoweringDiagnostic"), - }, - ); - return None; - } - - let mut nested_subst = subst.clone(); - if let Some(conj_id) = walk_to_conj_decl_with_subst_lower(dag, expected_type, &mut nested_subst) - { - let SurfaceExpr::Record { fields, .. } = expr else { - report_declaration_error( - dag, - Diagnostic::ResolveError { - name: format!( - "data `{data_name}` field `{field_label}` must be a record literal matching the declared record type" - ), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("LoweringDiagnostic"), - }, - ); - return None; - }; - if let Some(field) = duplicate_record_field(fields) { - report_declaration_error( - dag, - Diagnostic::ResolveError { - name: format!( - "data `{data_name}` field `{field_label}` repeats nested field `{}`", - field.name - ), - span: field.span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - }, - ); - return None; - } - let expected_fields: Vec<(String, DeclarationId)> = - match &dag.declaration(conj_id).connective { - TypeConnective::Conj { children } => children - .iter() - .map(|child| (child.label.clone(), child.ty)) - .map(|(label, ty)| { - ( - label, - resolve_decl_with_subst_lower(dag, ty, &nested_subst, 0).unwrap_or(ty), - ) - }) - .collect(), - _ => unreachable!("walk_to_conj_decl returned non-Conj"), - }; - for field in fields { - if !expected_fields - .iter() - .any(|(label, _)| *label == field.name) - { - report_declaration_error( - dag, - Diagnostic::ResolveError { - name: format!( - "data `{data_name}` field `{field_label}` has nested field `{}` but the declared type has no such field", - field.name - ), - span: field.span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("LoweringDiagnostic"), - }, - ); - return None; - } - } - for (label, _) in &expected_fields { - if !fields.iter().any(|field| field.name == *label) - && !expected_fields - .iter() - .find(|(candidate, _)| candidate == label) - .is_some_and(|(_, ty)| { - is_at_most_one_type_with_subst(dag, *ty, &nested_subst, 0) - }) - { - report_declaration_error( - dag, - Diagnostic::ResolveError { - name: format!( - "data `{data_name}` field `{field_label}` is missing nested field `{label}`" - ), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("LoweringDiagnostic"), - }, - ); - return None; - } - } - let mut lowered = Vec::with_capacity(expected_fields.len()); - for (label, ty) in expected_fields { - let Some(nested) = fields.iter().find(|field| field.name == label) else { - continue; - }; - lowered.push(( - label.clone(), - lower_structural_field_value( - data_name, - &label, - &nested.value, - ty, - &nested_subst, - symbols, - dag, - None, - &nested.span, - pending_refined_function_refs, - )?, - )); - } - return Some(crate::dag::FieldValue::Record(lowered)); - } - - let mut disj_subst = subst.clone(); - let optional_card = - optional_at_most_one_cardinality_decl_with_subst(dag, expected_type, subst, 0); - let optional_disj = - optional_card.and_then(|card| crate::infer::ensure_optional_match_disj(dag, card)); - let disj_id = optional_disj - .or_else(|| walk_to_disj_decl_with_subst_lower(dag, expected_type, &mut disj_subst)); - if let Some(disj_id) = disj_id { - let variants: Vec<(String, DeclarationId)> = match &dag.declaration(disj_id).connective { - TypeConnective::Disj { variants } => variants - .iter() - .map(|field| (field.label.clone(), field.ty)) - .collect(), - _ => unreachable!("walk_to_disj_decl returned non-Disj"), - }; - - if optional_disj.is_some() && surface_expr_is_authored_optional_none(expr) { - let Some((_, none_variant_payload_decl)) = - variants.iter().find(|(label, _)| label == "None") - else { - report_declaration_error( - dag, - Diagnostic::ResolveError { - name: format!( - "data `{data_name}` field `{field_label}`: optional match disj missing `None` arm" - ), - span: span.clone(), - correction: Correction::deferred_for_diagnostic_class("ResolveError"), - }, - ); - return None; - }; - return Some(crate::dag::FieldValue::Variant { - constructor: *none_variant_payload_decl, - payload: vec![], - }); - } - - if optional_disj.is_some() - && !surface_expr_is_authored_optional_none(expr) - && !optional_some_none_surface_form(expr) - { - if let Some(inner_ty) = optional_element_type_with_subst(dag, expected_type, subst, 0) { - match lower_structural_field_value( - data_name, - field_label, - expr, - inner_ty, - subst, - symbols, - dag, - None, - span, - pending_refined_function_refs, - ) { - Some(inner_fv) => { - let Some((_, some_payload_conj)) = - variants.iter().find(|(label, _)| label == "Some") - else { - report_declaration_error( - dag, - Diagnostic::ResolveError { - name: format!( - "data `{data_name}` field `{field_label}`: optional match disj missing `Some` arm" - ), - span: span.clone(), - correction: Correction::deferred_for_diagnostic_class("ResolveError"), - }, - ); - return None; - }; - return Some(crate::dag::FieldValue::Variant { - constructor: *some_payload_conj, - payload: vec![inner_fv], - }); - } - None => return None, - } - } - } - - let (variant_name, variant_decl_id, positional_args, named_fields, variant_span) = - match expr { - SurfaceExpr::Call { target, args, span } => { - let Some((_, variant_decl_id)) = - variants.iter().find(|(label, _)| label == target) - else { - report_declaration_error( - dag, - Diagnostic::ResolveError { - name: format!( - "data `{data_name}` field `{field_label}` uses constructor `{target}` which is not a variant of the declared sum type" - ), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("LoweringDiagnostic"), - }, - ); - return None; - }; - ( - target.as_str(), - *variant_decl_id, - Some(args.as_slice()), - None, - span, - ) - } - SurfaceExpr::VariantRecord { - target, - fields, - span, - } => { - let Some((_, variant_decl_id)) = - variants.iter().find(|(label, _)| label == target) - else { - report_declaration_error( - dag, - Diagnostic::ResolveError { - name: format!( - "data `{data_name}` field `{field_label}` uses constructor `{target}` which is not a variant of the declared sum type" - ), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("LoweringDiagnostic"), - }, - ); - return None; - }; - ( - target.as_str(), - *variant_decl_id, - None, - Some(fields.as_slice()), - span, - ) - } - SurfaceExpr::Record { fields, span } => { - let authored: HashSet<&str> = fields.iter().map(|f| f.name.as_str()).collect(); - let mut matched: Option<(&str, DeclarationId)> = None; - for (label, variant_decl_id) in &variants { - let Some(payload_fields) = variant_payload_fields_for_lowering_with_subst( - dag, - *variant_decl_id, - &disj_subst, - ) else { - continue; - }; - let payload: HashSet<&str> = - payload_fields.iter().map(|(l, _)| l.as_str()).collect(); - if authored == payload { - if let Some((prev_label, _)) = matched { - report_declaration_error( - dag, - Diagnostic::ResolveError { - name: format!( - "data `{data_name}` field `{field_label}` record literal is ambiguous: same field set matches sum variants `{prev_label}` and `{label}`" - ), - span: span.clone(), - correction: Correction::deferred_for_diagnostic_class("ResolveError"), - }, - ); - return None; - } - matched = Some((label.as_str(), *variant_decl_id)); - } - } - let Some((label, variant_decl_id)) = matched else { - report_declaration_error( - dag, - Diagnostic::ResolveError { - name: format!( - "data `{data_name}` field `{field_label}` record literal field set does not match any variant of the declared sum type" - ), - span: span.clone(), - correction: Correction::deferred_for_diagnostic_class("ResolveError"), - }, - ); - return None; - }; - (label, variant_decl_id, None, Some(fields.as_slice()), span) - } - SurfaceExpr::Var { name, span } => { - let Some((_, variant_decl_id)) = - variants.iter().find(|(label, _)| label == name) - else { - report_declaration_error( - dag, - Diagnostic::ResolveError { - name: format!( - "data `{data_name}` field `{field_label}` uses constructor `{name}` which is not a variant of the declared sum type" - ), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("LoweringDiagnostic"), - }, - ); - return None; - }; - (name.as_str(), *variant_decl_id, Some(&[][..]), None, span) - } - _ => { - report_declaration_error( - dag, - Diagnostic::ResolveError { - name: format!( - "data `{data_name}` field `{field_label}` must be a constructor expression matching the declared sum type" - ), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("LoweringDiagnostic"), - }, - ); - return None; - } - }; - let payload_fields = match variant_payload_fields_for_lowering_with_subst( - dag, - variant_decl_id, - &disj_subst, - ) { - Some(fields) => fields, - other => { - report_declaration_error( - dag, - Diagnostic::ResolveError { - name: format!( - "data `{data_name}` field `{field_label}` constructor `{variant_name}` does not lower to a record payload shape: got {other:?}" - ), - span: variant_span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("LoweringDiagnostic"), - }, - ); - return None; - } - }; - let mut payload = Vec::with_capacity(payload_fields.len()); - if let Some(args) = positional_args { - if payload_fields.len() != args.len() { - report_declaration_error( - dag, - Diagnostic::ArityMismatch { - function: variant_name.to_string(), - expected: payload_fields.len(), - actual: args.len(), - span: variant_span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - }, - ); - return None; - } - for (arg, (_, payload_field_ty)) in args.iter().zip(payload_fields.iter()) { - payload.push(lower_structural_field_value( - data_name, - field_label, - arg, - *payload_field_ty, - subst, - symbols, - dag, - None, - surface_expr_span(arg), - pending_refined_function_refs, - )?); - } - } else if let Some(fields) = named_fields { - if let Some(field) = duplicate_record_field(fields) { - report_declaration_error( - dag, - Diagnostic::ResolveError { - name: format!( - "data `{data_name}` field `{field_label}` constructor `{variant_name}` repeats payload field `{}`", - field.name - ), - span: field.span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("LoweringDiagnostic"), - }, - ); - return None; - } - for field in fields { - if !payload_fields.iter().any(|(label, _)| { - surface_record_field_matches_variant_payload_label(&field.name, label) - }) { - report_declaration_error( - dag, - Diagnostic::ResolveError { - name: format!( - "data `{data_name}` field `{field_label}` constructor `{variant_name}` has payload field `{}` but the variant has no such field", - field.name - ), - span: field.span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("LoweringDiagnostic"), - }, - ); - return None; - } - } - for (payload_field_label, payload_field_ty) in &payload_fields { - let Some(field) = - surface_record_field_for_variant_payload(fields, payload_field_label) - else { - report_declaration_error( - dag, - Diagnostic::ResolveError { - name: format!( - "data `{data_name}` field `{field_label}` constructor `{variant_name}` is missing payload field `{payload_field_label}`" - ), - span: variant_span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("LoweringDiagnostic"), - }, - ); - return None; - }; - payload.push(lower_structural_field_value( - data_name, - field_label, - &field.value, - *payload_field_ty, - subst, - symbols, - dag, - None, - &field.span, - pending_refined_function_refs, - )?); - } - } - if let Err(diag) = - enforce_non_negative_unit_count_payload(dag, variant_decl_id, &payload, variant_span) - { - report_declaration_error(dag, diag); - return None; - } - return Some(crate::dag::FieldValue::Variant { - constructor: variant_decl_id, - payload, - }); - } - - report_declaration_error( - dag, - Diagnostic::ResolveError { - name: format!( - "data `{data_name}` field `{field_label}` does not match the declared structural type" - ), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("LoweringDiagnostic"), - }, - ); - None -} - -fn is_value_level_arrow_declaration(decl: &crate::dag::Declaration) -> bool { - matches!( - &decl.connective, - TypeConnective::Arrow { - body: ArrowBody::Pending - | ArrowBody::UserDefined(_) - | ArrowBody::ExternalRealization(_) - | ArrowBody::Unparsed(_), - .. - } - ) -} - -/// 🟢 TERMINAL — file-local lowering outcome coproduct. -/// -/// 4-pattern check: Pattern 1 (fact placement) reaches the terminal -/// control-flow split here: successful scalar lowering, non-literal -/// fallthrough, and typed rejection each flow to a different caller -/// branch. Patterns 2-4 do not apply because the variants are not a -/// shared labeled payload, algebraic operation, or dimensional product. -enum LowerScalarLiteralOutcome { - Literal(LiteralBits), - NotApplicable, - Reject(Diagnostic), -} - -fn lower_scalar_literal_for_type( - expr: &SurfaceExpr, - expected_type: DeclarationId, - dag: &Dag, -) -> LowerScalarLiteralOutcome { - let SurfaceExpr::Literal { value, .. } = expr else { - return LowerScalarLiteralOutcome::NotApplicable; - }; - let literal_bits = match value { - SurfaceLiteral::Int(v) => LiteralBits::Int(v.clone()), - SurfaceLiteral::Bool(v) => LiteralBits::Bool(*v), - SurfaceLiteral::String(v) => LiteralBits::String(v.clone()), - SurfaceLiteral::Symbol(v) => LiteralBits::Symbol(v.clone()), - }; - let int_decl_id = dag.declaration_by_name("Int").map(|d| d.id); - let bool_decl_id = dag.declaration_by_name("Bool").map(|d| d.id); - let string_decl_id = dag.declaration_by_name("String").map(|d| d.id); - let symbol_decl_id = dag.declaration_by_name("Symbol").map(|d| d.id); - let type_ok = match &literal_bits { - LiteralBits::Int(s) => { - let Ok(int_value) = BigInt::from_str(s.as_str()) else { - return LowerScalarLiteralOutcome::Reject(Diagnostic::ResolveError { - name: "internal: malformed decimal integer literal".to_string(), - span: surface_expr_span(expr).clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - }); - }; - int_decl_id - .map(|id| walks_to(dag, expected_type, id)) - .unwrap_or(false) - || optional_element_type(dag, expected_type) - .is_some_and(|element| walks_to(dag, element, int_decl_id.unwrap_or(element))) - || matches!( - int_literal_fits_expected_type(dag, &int_value, expected_type), - Ok(Some(true)) - ) - } - LiteralBits::Bool(_) => { - bool_decl_id - .map(|id| walks_to(dag, expected_type, id)) - .unwrap_or(false) - || optional_element_type(dag, expected_type) - .is_some_and(|element| walks_to(dag, element, bool_decl_id.unwrap_or(element))) - } - LiteralBits::String(_) => { - string_decl_id - .map(|id| walks_to(dag, expected_type, id)) - .unwrap_or(false) - || optional_element_type(dag, expected_type).is_some_and(|element| { - walks_to(dag, element, string_decl_id.unwrap_or(element)) - }) - } - LiteralBits::Symbol(_) => { - symbol_decl_id - .map(|id| walks_to(dag, expected_type, id)) - .unwrap_or(false) - || optional_element_type(dag, expected_type).is_some_and(|element| { - walks_to(dag, element, symbol_decl_id.unwrap_or(element)) - }) - } - }; - if type_ok { - let span = surface_expr_span(expr).clone(); - if scalar_literal_must_reject_for_refinement(dag, &literal_bits, expected_type) { - return LowerScalarLiteralOutcome::Reject(Diagnostic::ResolveError { - name: "scalar literal does not satisfy the expected `where` refinement — no narrowing branch in scope".to_string(), - span, - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("LoweringDiagnostic"), - }); - } - return LowerScalarLiteralOutcome::Literal(literal_bits); - } - if let LiteralBits::Int(s) = &literal_bits { - let Ok(int_value) = BigInt::from_str(s.as_str()) else { - return LowerScalarLiteralOutcome::Reject(Diagnostic::ResolveError { - name: "internal: malformed decimal integer literal".to_string(), - span: surface_expr_span(expr).clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - }); - }; - match integer_range_for_decl(dag, expected_type) { - IntegerRangeLookup::Found(range) => { - return LowerScalarLiteralOutcome::Reject(magnitude_out_of_range_for_interval( - &int_value, - TypeShape::new(expected_type), - range, - surface_expr_span(expr).clone(), - )); - } - IntegerRangeLookup::Invalid(diag) => return LowerScalarLiteralOutcome::Reject(diag), - IntegerRangeLookup::Missing => {} - } - } - LowerScalarLiteralOutcome::Reject(Diagnostic::ResolveError { - name: "scalar literal does not match declared type".to_string(), - span: surface_expr_span(expr).clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - }) -} - -fn list_element_type(dag: &Dag, expected_type: DeclarationId) -> Option { - let list_id = dag.declaration_by_name("List")?.id; - match &dag.declaration(expected_type).connective { - TypeConnective::Instantiation { - template, - arguments, - } if *template == list_id && arguments.len() == 1 => Some(arguments[0].value), - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => list_element_type(dag, *next), - _ => None, - } -} - -fn optional_element_type(dag: &Dag, expected_type: DeclarationId) -> Option { - match &dag.declaration(expected_type).connective { - TypeConnective::Cardinality(payload) if payload.bound() == CardinalityBound::AtMostOne => { - Some(payload.element()) - } - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - optional_element_type(dag, *next) - } - TypeConnective::Instantiation { - template, - arguments, - } if arguments.is_empty() => optional_element_type(dag, *template), - _ => None, - } -} - -/// If `expected_type` is (after alias / type-param peel) `Cardinality(_, AtMostOne)`, -/// returns that cardinality declaration id. Used so structural `data` lowering can -/// mint the `Some`/`None` optional-match disj before `infer::infer` runs. -fn optional_at_most_one_cardinality_decl_with_subst( - dag: &Dag, - expected_type: DeclarationId, - subst: &LowerSubstStack, - depth: usize, -) -> Option { - if depth >= 32 { - return None; - } - match &dag.declaration(expected_type).connective { - TypeConnective::Atom(AtomPayload::TypeParam(_)) => { - optional_at_most_one_cardinality_decl_with_subst( - dag, - subst.lookup(expected_type)?, - subst, - depth + 1, - ) - } - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - optional_at_most_one_cardinality_decl_with_subst(dag, *next, subst, depth + 1) - } - TypeConnective::Cardinality(p) if p.bound() == CardinalityBound::AtMostOne => { - Some(expected_type) - } - TypeConnective::Instantiation { - template, - arguments, - } if arguments.is_empty() => { - optional_at_most_one_cardinality_decl_with_subst(dag, *template, subst, depth + 1) - } - _ => None, - } -} - -fn optional_element_type_with_subst( - dag: &Dag, - expected_type: DeclarationId, - subst: &LowerSubstStack, - depth: usize, -) -> Option { - if depth >= 32 { - return None; - } - match &dag.declaration(expected_type).connective { - TypeConnective::Atom(AtomPayload::TypeParam(_)) => { - optional_element_type_with_subst(dag, subst.lookup(expected_type)?, subst, depth + 1) - } - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - optional_element_type_with_subst(dag, *next, subst, depth + 1) - } - _ => optional_element_type(dag, expected_type).map(|element| { - resolve_decl_with_subst_lower(dag, element, subst, 0).unwrap_or(element) - }), - } -} - -fn surface_expr_is_authored_optional_none(expr: &SurfaceExpr) -> bool { - match expr { - SurfaceExpr::Path { segments, .. } => segments.len() == 1 && segments[0] == "none", - SurfaceExpr::Var { name, .. } => name == "none", - _ => false, - } -} - -// Recognize already-authored optional disj syntax (`Some` / `None`) so lowering does not -// double-wrap. Spelling matches the language's optional constructors (see `docs/v3-spec.md` -// Scenario 6), not an arbitrary callable: a hypothetical user-defined `Some`/`None` at an -// `Optional` site would skip implicit `Some` wrapping here by design. -fn optional_some_none_surface_form(expr: &SurfaceExpr) -> bool { - match expr { - SurfaceExpr::VariantRecord { target, .. } => target == "Some" || target == "None", - SurfaceExpr::Call { target, .. } => target == "Some" || target == "None", - _ => false, - } -} - -// Optional/sum payload surface vs lowered field names: `docs/v3-spec.md` Scenario 6 shows -// `Some { value: v }` style patterns; lowering may use synthetic `_0` for the inner payload field. -// Single pairing authority for this lowering seam (P2: avoid scattering `"value"`/`"_0"` literals). -const SURFACE_SUM_PAYLOAD_FIELD: &str = "value"; -const LOWERED_SUM_PAYLOAD_FIELD: &str = "_0"; - -fn surface_record_field_for_variant_payload<'a>( - fields: &'a [crate::parse::SurfaceRecordField], - payload_label: &str, -) -> Option<&'a crate::parse::SurfaceRecordField> { - fields.iter().find(|f| f.name == payload_label).or_else(|| { - (payload_label == LOWERED_SUM_PAYLOAD_FIELD) - .then(|| fields.iter().find(|f| f.name == SURFACE_SUM_PAYLOAD_FIELD)) - .flatten() - }) -} - -fn surface_record_field_matches_variant_payload_label( - authored_field: &str, - payload_label: &str, -) -> bool { - if authored_field == payload_label { - return true; - } - authored_field == SURFACE_SUM_PAYLOAD_FIELD && payload_label == LOWERED_SUM_PAYLOAD_FIELD -} - -fn list_element_type_with_subst( - dag: &Dag, - expected_type: DeclarationId, - subst: &LowerSubstStack, - depth: usize, -) -> Option { - if depth >= 32 { - return None; - } - match &dag.declaration(expected_type).connective { - TypeConnective::Atom(AtomPayload::TypeParam(_)) => { - list_element_type_with_subst(dag, subst.lookup(expected_type)?, subst, depth + 1) - } - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - list_element_type_with_subst(dag, *next, subst, depth + 1) - } - _ => list_element_type(dag, expected_type).map(|element| { - resolve_decl_with_subst_lower(dag, element, subst, 0).unwrap_or(element) - }), - } -} - -fn map_value_type(dag: &Dag, expected_type: DeclarationId) -> Option { - let map_id = dag.declaration_by_name("Map")?.id; - let string_id = dag.declaration_by_name("String")?.id; - match &dag.declaration(expected_type).connective { - TypeConnective::Instantiation { - template, - arguments, - } if *template == map_id - && arguments.len() == 2 - && walks_to(dag, arguments[0].value, string_id) => - { - Some(arguments[1].value) - } - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => map_value_type(dag, *next), - _ => None, - } -} - -fn map_value_type_with_subst( - dag: &Dag, - expected_type: DeclarationId, - subst: &LowerSubstStack, - depth: usize, -) -> Option { - if depth >= 32 { - return None; - } - match &dag.declaration(expected_type).connective { - TypeConnective::Atom(AtomPayload::TypeParam(_)) => { - map_value_type_with_subst(dag, subst.lookup(expected_type)?, subst, depth + 1) - } - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - map_value_type_with_subst(dag, *next, subst, depth + 1) - } - TypeConnective::Instantiation { - template, - arguments, - } if dag - .declaration_by_name("Map") - .is_some_and(|decl| decl.id == *template) - && arguments.len() == 2 => - { - let string_id = dag.declaration_by_name("String")?.id; - let key = resolve_decl_with_subst_lower(dag, arguments[0].value, subst, 0) - .unwrap_or(arguments[0].value); - walks_to(dag, key, string_id).then(|| { - resolve_decl_with_subst_lower(dag, arguments[1].value, subst, 0) - .unwrap_or(arguments[1].value) - }) - } - _ => None, - } -} - -fn map_key_type_is_not_string(dag: &Dag, expected_type: DeclarationId) -> bool { - let Some(map_id) = dag.declaration_by_name("Map").map(|decl| decl.id) else { - return false; - }; - let Some(string_id) = dag.declaration_by_name("String").map(|decl| decl.id) else { - return false; - }; - match &dag.declaration(expected_type).connective { - TypeConnective::Instantiation { - template, - arguments, - } if *template == map_id && arguments.len() == 2 => { - !walks_to(dag, arguments[0].value, string_id) - } - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - map_key_type_is_not_string(dag, *next) - } - _ => false, - } -} - -fn map_key_type_is_not_string_with_subst( - dag: &Dag, - expected_type: DeclarationId, - subst: &LowerSubstStack, - depth: usize, -) -> bool { - if depth >= 32 { - return false; - } - match &dag.declaration(expected_type).connective { - TypeConnective::Atom(AtomPayload::TypeParam(_)) => { - subst.lookup(expected_type).is_some_and(|bound| { - map_key_type_is_not_string_with_subst(dag, bound, subst, depth + 1) - }) - } - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - map_key_type_is_not_string_with_subst(dag, *next, subst, depth + 1) - } - TypeConnective::Instantiation { - template, - arguments, - } if dag - .declaration_by_name("Map") - .is_some_and(|decl| decl.id == *template) - && arguments.len() == 2 => - { - let Some(string_id) = dag.declaration_by_name("String").map(|decl| decl.id) else { - return false; - }; - let key = resolve_decl_with_subst_lower(dag, arguments[0].value, subst, 0) - .unwrap_or(arguments[0].value); - !walks_to(dag, key, string_id) - } - _ => false, - } -} - -fn is_at_most_one_type_with_subst( - dag: &Dag, - expected_type: DeclarationId, - subst: &LowerSubstStack, - depth: usize, -) -> bool { - if depth >= 32 { - return false; - } - match &dag.declaration(expected_type).connective { - TypeConnective::Cardinality(payload) => payload.bound() == CardinalityBound::AtMostOne, - TypeConnective::Atom(AtomPayload::TypeParam(_)) => subst - .lookup(expected_type) - .is_some_and(|bound| is_at_most_one_type_with_subst(dag, bound, subst, depth + 1)), - TypeConnective::Atom( - AtomPayload::ResolvedByStructure(next) | AtomPayload::ResolvedByName(next), - ) => is_at_most_one_type_with_subst(dag, *next, subst, depth + 1), - TypeConnective::Instantiation { - template, - arguments, - } if arguments.is_empty() => { - is_at_most_one_type_with_subst(dag, *template, subst, depth + 1) - } - _ => false, - } -} - -/// Resolve a record-literal field value as a typed declaration -/// reference. Accepts: -/// -/// - `SurfaceExpr::Var { name }` — top-level identifier looked up -/// in the symbols map. -/// - `SurfaceExpr::Path { segments }` — dotted-path. The first -/// segment is a top-level identifier; subsequent segments walk -/// the parent's `Conj` children by field label or `Disj` -/// variants by variant label, returning the child/variant's -/// `ty` (the field's type declaration / the variant's payload -/// declaration). -/// -/// Walking Disj variants is the path that lets pattern-role -/// realization specs reference a specific sum variant (e.g. -/// `List.Empty`) without the emitter needing a label-matching -/// heuristic — the authority for "which variant plays the empty -/// role" lives in the spec data item, not in emitter code. -/// -/// Returns `None` if the expression is not a recognized reference -/// shape or any segment fails to resolve. -fn resolve_field_value_as_declaration_ref( - expr: &SurfaceExpr, - symbols: &HashMap, - dag: &Dag, -) -> Option { - let segments: Vec<&str> = match expr { - SurfaceExpr::Var { name, .. } => vec![name.as_str()], - SurfaceExpr::Path { segments, .. } => segments.iter().map(|s| s.as_str()).collect(), - _ => return None, - }; - let (first, rest) = segments.split_first()?; - let mut current = symbols.get(*first).copied()?; - for segment in rest { - if let Some(conj_id) = walk_to_conj_decl(dag, current) { - let TypeConnective::Conj { children } = &dag.declaration(conj_id).connective else { - return None; - }; - let next = children.iter().find(|f| f.label == *segment)?; - current = next.ty; - continue; - } - if let Some(disj_id) = walk_to_disj_decl(dag, current) { - let TypeConnective::Disj { variants } = &dag.declaration(disj_id).connective else { - return None; - }; - let next = variants.iter().find(|v| v.label == *segment)?; - current = next.ty; - continue; - } - return None; - } - Some(current) -} - -fn declaration_ref_types_equivalent( - dag: &Dag, - lhs: DeclarationId, - rhs: DeclarationId, - depth: usize, -) -> bool { - if lhs == rhs { - return true; - } - if depth >= 32 { - return false; - } - let lhs_decl = dag.declaration(lhs); - let rhs_decl = dag.declaration(rhs); - match (&lhs_decl.connective, &rhs_decl.connective) { - ( - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)), - _, - ) => declaration_ref_types_equivalent(dag, *next, rhs, depth + 1), - ( - _, - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)), - ) => declaration_ref_types_equivalent(dag, lhs, *next, depth + 1), - ( - TypeConnective::Instantiation { - template, - arguments, - }, - _, - ) if arguments.is_empty() => { - declaration_ref_types_equivalent(dag, *template, rhs, depth + 1) - } - ( - _, - TypeConnective::Instantiation { - template, - arguments, - }, - ) if arguments.is_empty() => { - declaration_ref_types_equivalent(dag, lhs, *template, depth + 1) - } - ( - TypeConnective::Arrow { - inputs: lhs_inputs, - output: lhs_output, - .. - }, - TypeConnective::Arrow { - inputs: rhs_inputs, - output: rhs_output, - .. - }, - ) => { - lhs_inputs.len() == rhs_inputs.len() - && lhs_inputs - .iter() - .zip(rhs_inputs.iter()) - .all(|(lhs, rhs)| declaration_ref_types_equivalent(dag, *lhs, *rhs, depth + 1)) - && declaration_ref_types_equivalent(dag, *lhs_output, *rhs_output, depth + 1) - } - ( - TypeConnective::Instantiation { - template: lhs_template, - arguments: lhs_arguments, - }, - TypeConnective::Instantiation { - template: rhs_template, - arguments: rhs_arguments, - }, - ) => { - declaration_ref_types_equivalent(dag, *lhs_template, *rhs_template, depth + 1) - && lhs_arguments.len() == rhs_arguments.len() - && lhs_arguments - .iter() - .zip(rhs_arguments.iter()) - .all(|(lhs_arg, rhs_arg)| { - lhs_arg.parameter == rhs_arg.parameter - && declaration_ref_types_equivalent( - dag, - lhs_arg.value, - rhs_arg.value, - depth + 1, - ) - }) - } - _ => false, - } -} - -fn declaration_ref_types_equivalent_with_subst( - dag: &Dag, - lhs: DeclarationId, - rhs: DeclarationId, - rhs_subst: &LowerSubstStack, - depth: usize, -) -> bool { - if lhs == rhs { - return true; - } - if depth >= 32 { - return false; - } - let lhs_decl = dag.declaration(lhs); - let rhs_decl = dag.declaration(rhs); - match (&lhs_decl.connective, &rhs_decl.connective) { - ( - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)), - _, - ) => declaration_ref_types_equivalent_with_subst(dag, *next, rhs, rhs_subst, depth + 1), - ( - _, - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)), - ) => declaration_ref_types_equivalent_with_subst(dag, lhs, *next, rhs_subst, depth + 1), - (_, TypeConnective::Atom(AtomPayload::TypeParam(_))) => { - rhs_subst.lookup(rhs).is_some_and(|bound| { - declaration_ref_types_equivalent_with_subst(dag, lhs, bound, rhs_subst, depth + 1) - }) - } - ( - TypeConnective::Instantiation { - template, - arguments, - }, - _, - ) if arguments.is_empty() => { - declaration_ref_types_equivalent_with_subst(dag, *template, rhs, rhs_subst, depth + 1) - } - ( - _, - TypeConnective::Instantiation { - template, - arguments, - }, - ) if arguments.is_empty() => { - declaration_ref_types_equivalent_with_subst(dag, lhs, *template, rhs_subst, depth + 1) - } - ( - TypeConnective::Arrow { - inputs: lhs_inputs, - output: lhs_output, - .. - }, - TypeConnective::Arrow { - inputs: rhs_inputs, - output: rhs_output, - .. - }, - ) => { - lhs_inputs.len() == rhs_inputs.len() - && lhs_inputs.iter().zip(rhs_inputs.iter()).all(|(lhs, rhs)| { - declaration_ref_types_equivalent_with_subst( - dag, - *lhs, - *rhs, - rhs_subst, - depth + 1, - ) - }) - && declaration_ref_types_equivalent_with_subst( - dag, - *lhs_output, - *rhs_output, - rhs_subst, - depth + 1, - ) - } - ( - TypeConnective::Instantiation { - template: lhs_template, - arguments: lhs_arguments, - }, - TypeConnective::Instantiation { - template: rhs_template, - arguments: rhs_arguments, - }, - ) => { - declaration_ref_types_equivalent_with_subst( - dag, - *lhs_template, - *rhs_template, - rhs_subst, - depth + 1, - ) && lhs_arguments.len() == rhs_arguments.len() - && lhs_arguments - .iter() - .zip(rhs_arguments.iter()) - .all(|(lhs_arg, rhs_arg)| { - lhs_arg.parameter == rhs_arg.parameter - && declaration_ref_types_equivalent_with_subst( - dag, - lhs_arg.value, - rhs_arg.value, - rhs_subst, - depth + 1, - ) - }) - } - _ => declaration_ref_types_equivalent(dag, lhs, rhs, depth), - } -} - -/// Realization category tag for the lower-time narrowing check. -/// Mirrors `emit_rust::RealizationCategory` but lives in lower's -/// own namespace because the lowerer can't depend on emit_rust. -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -enum RealizationCategoryTag { - Type, - Operator, - Behavior, - Callable, - TypeInstantiation, - Pattern, -} - -/// Identify which realization category (if any) a data item's -/// meta-type belongs to. Returns `None` for non-realization data -/// items (which skip the narrowing check entirely). -/// -/// Looks up the meta-type by name. The realization meta cache on -/// `Dag` isn't populated until `populate_primitive_cache` runs at -/// bootstrap end, but `collect_symbols_phase` has registered every -/// top-level declaration by the time `lower_record_to_structural` -/// runs in Phase 2, so `declaration_by_name` works here. Same -/// pattern as the primitive lookups above. -fn realization_category_for_meta( - dag: &Dag, - meta_decl_id: DeclarationId, -) -> Option { - let type_meta = dag.declaration_by_name("TypeRealization").map(|d| d.id); - let op_meta = dag.declaration_by_name("OperatorRealization").map(|d| d.id); - let behavior_meta = dag.declaration_by_name("BehaviorRealization").map(|d| d.id); - let callable_meta = dag.declaration_by_name("CallableRealization").map(|d| d.id); - let type_instantiation_meta = dag - .declaration_by_name("TypeInstantiationRealization") - .map(|d| d.id); - let pattern_meta = dag.declaration_by_name("PatternRealization").map(|d| d.id); - if Some(meta_decl_id) == type_meta { - Some(RealizationCategoryTag::Type) - } else if Some(meta_decl_id) == op_meta { - Some(RealizationCategoryTag::Operator) - } else if Some(meta_decl_id) == behavior_meta { - Some(RealizationCategoryTag::Behavior) - } else if Some(meta_decl_id) == callable_meta { - Some(RealizationCategoryTag::Callable) - } else if Some(meta_decl_id) == type_instantiation_meta { - Some(RealizationCategoryTag::TypeInstantiation) - } else if Some(meta_decl_id) == pattern_meta { - Some(RealizationCategoryTag::Pattern) - } else { - None - } -} - -/// Validate that the resolved target of a realization-category -/// field satisfies the per-(category, field_label) structural -/// constraint. Returns `Ok(())` on success or `Err(reason)` with -/// a human-readable explanation of the violation. -/// -/// **The constraints encode the "DeclarationRef sentinel is too -/// permissive" narrowing.** PR #445's R1 review on the unwind -/// flagged that `BehaviorRealization { target: Int }` would -/// type-check at the substrate level because the field type is -/// `DeclarationRef` (the universal sentinel). The fully structural -/// fix (typed marker hierarchy via `inhabits` syntax or `where` -/// clauses) requires parser/lower extensions that are out of -/// scope for the PR-B-unwind round; this function is the -/// fail-closed lower-time alternative. Bad wirings now surface -/// as fail-closed diagnostics at lower time, not as silent skips -/// or downstream "missing realization" errors at emit time. -/// -/// Constraints, by category × field label: -/// -/// - `TypeRealization.target` — must be a primitive type -/// declaration (Int / Bool / String). Anything else is a -/// spec error. -/// - `OperatorRealization.target` — must be either a primitive -/// type or an atomic identity handle (the operand type for a -/// realized operator, e.g. Int for `1 + 2` or PortId for -/// reflected handle equality, or the `FreeMonoid` template for -/// `OrderedRing.eq` after the monoid witness walk on `String` / -/// `List` element comparisons). When `target` is `FreeMonoid`, -/// `lower_record_to_structural` additionally requires `op` to resolve -/// to the canonical `OrderedRing.eq` arrow (fail-closed pairing gate). -/// - `OperatorRealization.op` — must walk to an Arrow -/// declaration that is a child of an algebra Conj (e.g. -/// OrderedRing.add). The constraint is "the resolved -/// declaration's connective is Arrow," which is the structural -/// shape every algebra field has. -/// - `BehaviorRealization.target` — must be one of the v3_l1 -/// substrate behavior markers (Bind / Branch / Loop / -/// Transform / ValueBehavior / Main). -/// - `CallableRealization.target` — must walk to an Arrow -/// declaration (a callable target). -/// - `TypeInstantiationRealization.target` — must be a named -/// generic declaration with at least one type parameter. -/// - `PatternRealization.target` — must walk to a Disj -/// declaration (a matchable sum carrier). -fn validate_realization_field_target( - dag: &Dag, - category: RealizationCategoryTag, - field_label: &str, - target: DeclarationId, -) -> Result<(), String> { - let int_id = dag.declaration_by_name("Int").map(|d| d.id); - let bool_id = dag.declaration_by_name("Bool").map(|d| d.id); - let string_id = dag.declaration_by_name("String").map(|d| d.id); - let node_id = dag.declaration_by_name("NodeId").map(|d| d.id); - let port_id = dag.declaration_by_name("PortId").map(|d| d.id); - let declaration_id = dag.declaration_by_name("DeclarationId").map(|d| d.id); - let free_monoid = dag.declaration_by_name("FreeMonoid").map(|d| d.id); - - let is_primitive = - |id: DeclarationId| Some(id) == int_id || Some(id) == bool_id || Some(id) == string_id; - let is_atomic_handle = |id: DeclarationId| { - Some(id) == node_id || Some(id) == port_id || Some(id) == declaration_id - }; - let is_behavior_marker = |id: DeclarationId| { - let markers = [ - dag.declaration_by_name("ValueBehavior"), - dag.declaration_by_name("Transform"), - dag.declaration_by_name("Branch"), - dag.declaration_by_name("Loop"), - dag.declaration_by_name("Bind"), - dag.declaration_by_name("Main"), - ]; - markers.iter().any(|m| m.map(|d| d.id) == Some(id)) - }; - let is_algebra_field = - |id: DeclarationId| matches!(dag.declaration(id).connective, TypeConnective::Arrow { .. }); - let walks_to_arrow = |start: DeclarationId| { - let mut current = start; - for _ in 0..32 { - match &dag.declaration(current).connective { - TypeConnective::Arrow { .. } => return true, - TypeConnective::Instantiation { template, .. } => current = *template, - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => current = *next, - _ => return false, - } - } - false - }; - let walks_to_disj = |start: DeclarationId| { - let mut current = start; - for _ in 0..32 { - match &dag.declaration(current).connective { - TypeConnective::Disj { .. } => return true, - TypeConnective::Instantiation { template, .. } => current = *template, - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => current = *next, - _ => return false, - } - } - false - }; - - match (category, field_label) { - (RealizationCategoryTag::Type, "target") => { - if is_behavior_marker(target) { - Err(format!( - "TypeRealization.target must reference a realizable structural type, not a behavior marker; got declaration {target:?}" - )) - } else { - Ok(()) - } - } - (RealizationCategoryTag::Operator, "target") => { - if is_primitive(target) || is_atomic_handle(target) || Some(target) == free_monoid { - Ok(()) - } else { - Err(format!( - "OperatorRealization.target must reference a primitive operand type, atomic handle (Int/Bool/String/NodeId/PortId/DeclarationId), or the `FreeMonoid` template; got declaration {target:?}" - )) - } - } - (RealizationCategoryTag::Operator, "op") => { - if is_algebra_field(target) { - Ok(()) - } else { - Err(format!( - "OperatorRealization.op must reference an algebra field declaration whose connective is Arrow (e.g. OrderedRing.add); got declaration {target:?}" - )) - } - } - (RealizationCategoryTag::Behavior, "target") => { - if is_behavior_marker(target) { - Ok(()) - } else { - Err(format!( - "BehaviorRealization.target must reference one of the v3_l1 behavior markers (Bind/Branch/Loop/Transform/ValueBehavior/Main); got declaration {target:?}" - )) - } - } - (RealizationCategoryTag::Callable, "target") => { - if walks_to_arrow(target) { - Ok(()) - } else { - Err(format!( - "CallableRealization.target must reference a callable declaration whose connective walks to Arrow; got declaration {target:?}" - )) - } - } - (RealizationCategoryTag::TypeInstantiation, "target") => { - if !dag.declaration(target).type_params.is_empty() { - Ok(()) - } else { - Err(format!( - "TypeInstantiationRealization.target must reference a generic declaration with at least one type parameter; got declaration {target:?}" - )) - } - } - (RealizationCategoryTag::Pattern, "target") => { - if walks_to_disj(target) { - Ok(()) - } else { - Err(format!( - "PatternRealization.target must reference a matchable sum declaration whose connective walks to Disj; got declaration {target:?}" - )) - } - } - // Fields without a category-specific narrowing constraint - // (e.g. carrier and cost are scalar literals, not - // Declaration references). The category check is a - // partial constraint applied only to the fields where it - // makes sense; other fields skip it. - _ => Ok(()), - } -} - -/// Walk a declaration chain looking for a specific target -/// declaration id. Returns true if `current` eventually resolves -/// to `target` via Instantiation/ResolvedIdentifier edges or if -/// `current == target` directly. Used by -/// `lower_record_to_structural` to check "is this field's type -/// annotation ultimately Int/Bool/String?" -fn walks_to(dag: &Dag, start: DeclarationId, target: DeclarationId) -> bool { - let mut current = start; - for _ in 0..32 { - if current == target { - return true; - } - let decl = dag.declaration(current); - match &decl.connective { - TypeConnective::Instantiation { template, .. } => { - current = *template; - } - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - current = *next; - } - _ => return false, - } - } - false -} - -#[allow(clippy::too_many_arguments)] -fn lower_fn_item_expr_body( - name: &str, - params: &[SurfaceParam], - return_type: &SurfaceType, - body: &SurfaceExpr, - dag: &mut Dag, - outer_scope: HashMap, - symbols: &HashMap, - mutual_recursion: &MutualRecursionPlans, - mutual_state: &mut MutualRecursionState, -) -> HashMap { - let fn_decl_id = symbols[name]; - - // 1. Read the seeded Arrow — single-construction-authority for - // parameter declarations (DB-11 3a.3). `seed_function_signatures_phase` - // already ran `type_to_declaration_id` for each parameter and, - // when a `where` refinement is present, built the predicate - // Declaration + refined Declaration via `lower_parameter_refinement`. - // Re-lowering them here would push a parallel Bind + refined - // Declaration into the DAG for every `where` clause and then - // overwrite the fn's Arrow inputs to point at the duplicates - // — the seeded ones would stay in the DAG, orphaned. Read - // the seeded inputs directly instead. - let (param_decl_inputs, return_decl_id) = match dag.declaration(fn_decl_id).connective.clone() { - TypeConnective::Arrow { inputs, output, .. } => (inputs, output), - observed => { - let fn_decl = dag.declaration(fn_decl_id); - let fn_decl_name = fn_decl.name.as_deref().unwrap_or(name).to_string(); - let span = fn_decl.span.clone(); - report_declaration_error( - dag, - Diagnostic::ResolveError { - name: format!( - "function declaration `{fn_decl_name}` ({fn_decl_id:?}) violated \ - lowering invariant: seed_function_signatures_phase did not produce \ - an Arrow connective for this Fn; observed connective: {observed:?}" - ), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - span, - }, - ); - return outer_scope; - } - }; - let mut param_ports: Vec = Vec::with_capacity(params.len()); - let mut body_scope: HashMap = outer_scope.clone(); - let mut callable_scope: CallableScope = CallableScope::new(); - for (param, &input_decl) in params.iter().zip(param_decl_inputs.iter()) { - let port = dag.alloc_port(None); - match declaration_to_port_shape(input_decl, dag, param.ty.span()) { - Ok(ty) => dag.set_port_type(port, ty), - Err(diag) => dag.mark_unresolved(port, diag), - } - body_scope.insert(param.name.clone(), port); - if declaration_is_callable(dag, input_decl, 0) { - callable_scope.insert(param.name.clone(), input_decl); - } - param_ports.push(port); - } - - // 2. Compute return `TypeShape` from the seeded Arrow's output - // declaration (read above). Same single-construction-authority - // invariant as the parameter loop. - let (return_ty, return_type_diagnostic) = - match declaration_to_port_shape(return_decl_id, dag, return_type.span()) { - Ok(ty) => (Some(ty), None), - Err(diag) => (None, Some(diag)), - }; - - // 3. Mutual recursion check — same as M0. Reject with an - // Unresolved Bind value port AND set the Arrow body to - // `UserDefined(bind_id)` pointing at that Bind. `decide_transform`'s - // `UserDefined` arm reads the Bind's value port state: if it's - // Unresolved, every caller fails with "function has an invalid - // body," cascading the rejection through the normal - // upstream-failure mechanism. - // - // **R13 fix.** Earlier revisions set `body = ArrowBody::Pending` - // here, which `decide_transform` accepts as a realization-lag - // scaffold (signature type-checks, body walking skipped). That - // path doesn't read the Bind, so callers got Resolved types - // from an invalid fn — a FAIL-CLOSED violation. Using - // `UserDefined(bind_id)` routes callers through the - // Unresolved-body guard that poisons them correctly. The - // non-mutually-recursive rejection paths below (zero-param - // recursion, non-descent-provable recursion) already use this - // shape via the common bottom-of-function code. - if let Some(invalid_cluster) = mutual_recursion.invalid_by_member.get(&fn_decl_id) { - let err_port = dag.alloc_port(None); - let body_span = surface_expr_span(body).clone(); - dag.mark_unresolved( - err_port, - Diagnostic::ResolveError { - name: format!( - "cannot prove mutually-recursive cluster {{{}}} terminates", - invalid_cluster.members.join(", ") - ), - span: body_span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - }, - ); - let bind_id = dag.alloc_node_id(); - dag.push_node(Behavior::Bind(BindNode { - id: bind_id, - name: name.to_string(), - value: err_port, - params: param_ports, - span: body_span, - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - dag.declaration_mut(fn_decl_id).connective = TypeConnective::Arrow { - inputs: param_decl_inputs, - output: return_decl_id, - body: ArrowBody::UserDefined( - BindNodeId::from_bind_node(dag, bind_id) - .expect("UserDefined Arrow body bind id must point at a Bind"), - ), - }; - let mut outer_scope = outer_scope; - outer_scope.insert(name.to_string(), err_port); - return outer_scope; - } - - // `config_patch_layer` is expanded at call sites (`try_lower_config_patch_layer_invocation`). - // Do not lower the surface stub body (`base`) — that would silently discard `patch` on any - // invocation path that bypasses the interceptor. - if callable_is_v4_std_patch_config_patch_layer(dag, fn_decl_id) { - let body_span = surface_expr_span(body).clone(); - let err_port = dag.alloc_port(None); - dag.mark_unresolved( - err_port, - config_patch_layer_body_fallback_diagnostic(&body_span), - ); - if let Some(return_ty) = return_ty { - dag.set_port_type(err_port, return_ty); - } else if let Some(diag) = return_type_diagnostic { - dag.mark_unresolved(err_port, diag); - } - let bind_id = dag.alloc_node_id(); - dag.push_node(Behavior::Bind(BindNode { - id: bind_id, - name: name.to_string(), - value: err_port, - params: param_ports, - span: body_span, - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - dag.declaration_mut(fn_decl_id).connective = TypeConnective::Arrow { - inputs: param_decl_inputs, - output: return_decl_id, - body: ArrowBody::UserDefined( - BindNodeId::from_bind_node(dag, bind_id) - .expect("UserDefined Arrow body bind id must point at a Bind"), - ), - }; - let mut outer_scope = outer_scope; - outer_scope.insert(name.to_string(), err_port); - return outer_scope; - } - - // 4. Lower the body. - let body_start_index = dag.nodes().len(); - let lowered_body_return_port = lower_expr( - body, - dag, - &body_scope, - &callable_scope, - symbols, - Some(return_decl_id), - ); - let body_root = dag.port(lowered_body_return_port).produced_by; - let body_return_port = if return_type_diagnostic.is_some() { - dag.alloc_port(None) - } else { - lowered_body_return_port - }; - let body_span = surface_expr_span(body).clone(); - let body_end_index = dag.nodes().len(); - - let mutual_cluster = mutual_recursion.cluster_for_member(fn_decl_id); - - // 5. Handle recursion: bounded Loop wrapping (descent-provable) or - // fail-closed rejection (unprovable or zero-arg). Same M0 logic; the - // descent check operates on the unresolved operator-identifier shape - // (SurfaceExpr::Call with target "-"), per §8.9 Option A. - let mut pending_loop: Option = None; - let (bind_value_port, value_port) = if let Some(cluster) = mutual_cluster { - let slot = cluster.per_member_positions[&fn_decl_id]; - let loop_output = dag.alloc_port(None); - if let Some(return_ty) = return_ty { - dag.set_port_type(loop_output, return_ty); - } else if let Some(diag) = return_type_diagnostic.clone() { - dag.mark_unresolved(loop_output, diag); - } - pending_loop = Some(PendingMutualLoop { - bind_id: None, - source: param_ports[slot], - body_port: body_return_port, - loop_output, - body_root, - span: body_span.clone(), - }); - (body_return_port, loop_output) - } else if is_recursive(body, name, dag, symbols) { - if param_ports.is_empty() { - let err_port = dag.alloc_port(None); - dag.mark_unresolved( - err_port, - Diagnostic::ResolveError { - name: format!( - "function `{name}` is recursive but has no parameters; cannot terminate" - ), - span: body_span.clone(), - correction: witness_correction_for_decl( - dag, - return_decl_id, - body_span.clone(), - format!( - "replace the recursive body of `{name}` with a `{}` base case", - declaration_display_name(dag, return_decl_id) - ), - ) - .unwrap_or_else(|| { - crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ) - }), - }, - ); - (err_port, err_port) - } else if !descent_provable( - body, - dag, - param_decl_inputs[0], - name, - ¶ms[0].name, - &HashMap::new(), - symbols, - ) { - let err_port = dag.alloc_port(None); - dag.mark_unresolved( - err_port, - Diagnostic::ResolveError { - name: format!( - "cannot prove recursion in `{name}` terminates; expected each recursive call's first argument to be `{param} - ` or a structurally smaller recursive child", - param = ¶ms[0].name, - ), - span: body_span.clone(), - correction: witness_correction_for_decl( - dag, - return_decl_id, - body_span.clone(), - format!( - "replace the non-terminating body of `{name}` with a `{}` base case", - declaration_display_name(dag, return_decl_id) - ), - ).unwrap_or_else(|| crate::diagnostics::Correction::deferred_for_diagnostic_class("LoweringDiagnostic")), - }, - ); - (err_port, err_port) - } else { - let loop_id = dag.alloc_node_id(); - let loop_output = dag.alloc_port(Some(loop_id)); - if let Some(return_ty) = return_ty { - dag.set_port_type(loop_output, return_ty); - } else if let Some(diag) = return_type_diagnostic.clone() { - dag.mark_unresolved(loop_output, diag); - } - let loop_body_node = body_root.unwrap_or(loop_id); - dag.push_node(Behavior::Loop(LoopNode { - id: loop_id, - source: param_ports[0], - init: param_ports[0], - body: loop_body_node, - bound: LoopBound::Cardinality { - count: param_ports[0], - }, - output: loop_output, - span: body_span.clone(), - })); - (loop_output, loop_output) - } - } else { - (body_return_port, body_return_port) - }; - - if let Some(return_ty) = return_ty { - dag.set_port_type(bind_value_port, return_ty); - if value_port != bind_value_port { - dag.set_port_type(value_port, return_ty); - } - } else if let Some(diag) = return_type_diagnostic { - dag.mark_unresolved(bind_value_port, diag.clone()); - if value_port != bind_value_port { - dag.mark_unresolved(value_port, diag); - } - } - let bind_id = dag.alloc_node_id(); - dag.push_node(Behavior::Bind(BindNode { - id: bind_id, - name: name.to_string(), - value: bind_value_port, - params: param_ports, - span: body_span, - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - - if let Some(cluster_index) = mutual_recursion.by_member.get(&fn_decl_id).copied() { - let cluster_state = &mut mutual_state.clusters[cluster_index]; - if let Some(mut pending) = pending_loop { - pending.bind_id = Some(bind_id); - cluster_state.pending_loops.insert(fn_decl_id, pending); - } - let cluster_plan = &mutual_recursion.clusters[cluster_index]; - cluster_state.intra_cluster_transform_ids.extend( - dag.nodes()[body_start_index..body_end_index] - .iter() - .filter_map(Behavior::as_transform) - .filter_map(|transform| match transform.target { - TransformTarget::Callable(target_decl) => cluster_plan - .has_recursive_edge(fn_decl_id, callable_target_template(target_decl, dag)) - .then_some(transform.id), - _ => None, - }), - ); - } - - // 6. Fill in the function's Declaration with the Arrow connective. - dag.declaration_mut(fn_decl_id).connective = TypeConnective::Arrow { - inputs: param_decl_inputs, - output: return_decl_id, - body: ArrowBody::UserDefined( - BindNodeId::from_bind_node(dag, bind_id) - .expect("UserDefined Arrow body bind id must point at a Bind"), - ), - }; - - let mut outer_scope = outer_scope; - outer_scope.insert(name.to_string(), value_port); - outer_scope -} - -/// Convert a surface type annotation into a port-level `TypeShape`. -/// User code at M1(2.6) only accepts primitive type annotations -/// Wrap a pre-computed `DeclarationId` as a port `TypeShape`, with a -/// fail-closed check for fresh unresolved stubs. -/// -/// **Dissolution receipt — QW5 SINGLE AUTHORITY + R9 double-lower fix.** -/// Before M1(2.7) port typing hardcoded `"Int"|"Bool"|"String"` as a -/// whitelist parallel to `type_to_declaration_id`'s structural walk. -/// The whitelist dissolved into `type_to_declaration_id` (Class 1 -/// resolution). Before R9, the port path *re-called* -/// `type_to_declaration_id` in a separate helper, so compound types -/// like `List` allocated two anonymous declarations — one for -/// the Arrow input, one for the port TypeShape — with different -/// `DeclarationId`s. R9 collapses that: callers run -/// `type_to_declaration_id` **once** and pass the resulting id to -/// this helper, so the Arrow's declaration slot and the port's -/// `TypeShape` share identity. -/// -/// The fail-closed guard detects a fresh anonymous -/// `UnresolvedIdentifier` stub (name wasn't in the symbol table) -/// and returns `Err` so the caller marks the port `Unresolved`. The -/// resolve sweep ALSO fires against the stub at end of lowering, -/// but this path anchors the failure to the annotation span. -fn declaration_to_port_shape( - decl_id: DeclarationId, - dag: &Dag, - annotation_span: &SourceSpan, -) -> Result { - let decl = dag.declaration(decl_id); - if decl.name.is_none() { - if let TypeConnective::Atom(AtomPayload::UnresolvedIdentifier(name)) = &decl.connective { - return Err(Diagnostic::ResolveError { - name: format!("unknown type `{name}`"), - span: annotation_span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - }); - } - } - Ok(TypeShape::new(decl_id)) -} - -fn declaration_callable_inputs( - dag: &Dag, - current: DeclarationId, - depth: usize, -) -> Option> { - if depth >= 32 { - return None; - } - match &dag.declaration(current).connective { - TypeConnective::Arrow { inputs, .. } => Some(inputs.clone()), - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - declaration_callable_inputs(dag, *next, depth + 1) - } - TypeConnective::Instantiation { template, .. } => { - declaration_callable_inputs(dag, *template, depth + 1) - } - TypeConnective::Atom(AtomPayload::UnresolvedIdentifier(_)) - | TypeConnective::Atom(AtomPayload::TypeParam(_)) - | TypeConnective::Atom(AtomPayload::Literal(_)) - | TypeConnective::Conj { .. } - | TypeConnective::Disj { .. } - | TypeConnective::Cardinality(_) => None, - } -} - -fn declaration_is_callable(dag: &Dag, current: DeclarationId, depth: usize) -> bool { - declaration_callable_inputs(dag, current, depth).is_some() -} - -fn callable_target_template(target: DeclarationId, dag: &Dag) -> DeclarationId { - match &dag.declaration(target).connective { - TypeConnective::Instantiation { template, .. } => *template, - _ => target, - } -} - -fn declaration_callable_output( - dag: &Dag, - current: DeclarationId, - depth: usize, -) -> Option { - if depth >= 32 { - return None; - } - match &dag.declaration(current).connective { - TypeConnective::Arrow { output, .. } => Some(*output), - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - declaration_callable_output(dag, *next, depth + 1) - } - TypeConnective::Instantiation { template, .. } => { - declaration_callable_output(dag, *template, depth + 1) - } - TypeConnective::Atom(AtomPayload::UnresolvedIdentifier(_)) - | TypeConnective::Atom(AtomPayload::TypeParam(_)) - | TypeConnective::Atom(AtomPayload::Literal(_)) - | TypeConnective::Conj { .. } - | TypeConnective::Disj { .. } - | TypeConnective::Cardinality(_) => None, - } -} - -fn declaration_callable_signature( - dag: &Dag, - current: DeclarationId, - depth: usize, -) -> Option<(Vec, DeclarationId)> { - Some(( - declaration_callable_inputs(dag, current, depth)?, - declaration_callable_output(dag, current, depth)?, - )) -} - -fn lambda_synthetic_name(span: &SourceSpan) -> String { - format!("__anon_lambda_{}_{}", span.byte_start, span.byte_end) -} - -fn collect_lambda_free_names( - expr: &SurfaceExpr, - bound: &HashSet, - free: &mut HashSet, -) { - match expr { - SurfaceExpr::Literal { .. } => {} - SurfaceExpr::Var { name, .. } => { - if !bound.contains(name) { - free.insert(name.clone()); - } - } - SurfaceExpr::Path { segments, .. } => { - if let Some(head) = segments.first() { - if !bound.contains(head) { - free.insert(head.clone()); - } - } - } - SurfaceExpr::Call { target, args, .. } => { - if !bound.contains(target) { - free.insert(target.clone()); - } - for arg in args { - collect_lambda_free_names(arg, bound, free); - } - } - SurfaceExpr::VariantRecord { fields, .. } => { - for field in fields { - collect_lambda_free_names(&field.value, bound, free); - } - } - SurfaceExpr::Operator { args, .. } => { - for arg in args { - collect_lambda_free_names(arg, bound, free); - } - } - SurfaceExpr::Lambda { params, body, .. } => { - let mut inner_bound = bound.clone(); - inner_bound.extend(params.iter().cloned()); - collect_lambda_free_names(body, &inner_bound, free); - } - SurfaceExpr::If { - cond, - then_branch, - else_branch, - .. - } => { - collect_lambda_free_names(cond, bound, free); - collect_lambda_free_names(then_branch, bound, free); - collect_lambda_free_names(else_branch, bound, free); - } - SurfaceExpr::Match { - scrutinee, arms, .. - } => { - collect_lambda_free_names(scrutinee, bound, free); - for arm in arms { - let mut arm_bound = bound.clone(); - for binding in pattern_binding_names(&arm.pattern) { - arm_bound.insert(binding.to_string()); - } - collect_lambda_free_names(&arm.body, &arm_bound, free); - } - } - SurfaceExpr::Record { fields, .. } => { - for field in fields { - collect_lambda_free_names(&field.value, bound, free); - } - } - SurfaceExpr::List { elements, .. } => { - for element in elements { - collect_lambda_free_names(element, bound, free); - } - } - SurfaceExpr::Map { entries, .. } => { - for entry in entries { - collect_lambda_free_names(&entry.value, bound, free); - } - } - SurfaceExpr::PathCall { segments, args, .. } => { - if let Some(head) = segments.first() { - if !bound.contains(head) { - free.insert(head.clone()); - } - } - for arg in args { - collect_lambda_free_names(arg, bound, free); - } - } - } -} - -fn lower_lambda_expr( - params: &[String], - body: &SurfaceExpr, - span: &SourceSpan, - expected_decl: DeclarationId, - ctx: &mut LambdaLoweringContext<'_>, -) -> Result { - let connective = lower_lambda_expr_to_arrow(params, body, span, expected_decl, ctx)?; - let lambda_decl_id = ctx.dag.alloc_declaration_id(); - ctx.dag.push_declaration(Declaration { - id: lambda_decl_id, - name: None, - connective, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - Ok(lambda_decl_id) -} - -fn lower_lambda_expr_to_arrow( - params: &[String], - body: &SurfaceExpr, - span: &SourceSpan, - expected_decl: DeclarationId, - ctx: &mut LambdaLoweringContext<'_>, -) -> Result { - let Some((expected_inputs, expected_output)) = - declaration_callable_signature(ctx.dag, expected_decl, 0) - else { - return Err(Diagnostic::ResolveError { - name: "lambda expression requires an expected function type".to_string(), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - }); - }; - if expected_inputs.len() != params.len() { - return Err(Diagnostic::ResolveError { - name: format!( - "lambda parameter count mismatch: expected {} parameter(s) from the surrounding function type, found {}", - expected_inputs.len(), - params.len(), - ), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("LoweringDiagnostic"), - }); - } - - let mut free = HashSet::new(); - let bound: HashSet = params.iter().cloned().collect(); - collect_lambda_free_names(body, &bound, &mut free); - let mut free_names: Vec = free.into_iter().collect(); - free_names.sort(); - - let mut capture_ports: Vec = Vec::new(); - let mut body_scope: HashMap = HashMap::new(); - let mut body_callable_scope: CallableScope = CallableScope::new(); - for name in free_names { - let mut found_binding = false; - if let Some(&port) = ctx.scope.get(&name) { - capture_ports.push(port); - body_scope.insert(name.clone(), port); - found_binding = true; - } - if let Some(&decl_id) = ctx.callable_scope.get(&name) { - body_callable_scope.insert(name.clone(), decl_id); - found_binding = true; - } - if !found_binding && ctx.symbols.contains_key(&name) { - found_binding = true; - } - if !found_binding { - return Err(Diagnostic::ResolveError { - name, - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - }); - } - } - - let mut param_ports: Vec = Vec::with_capacity(params.len()); - for (name, input_decl) in params.iter().zip(expected_inputs.iter()) { - let port = ctx.dag.alloc_port(None); - let ty = declaration_to_port_shape(*input_decl, ctx.dag, span)?; - ctx.dag.set_port_type(port, ty); - body_scope.insert(name.clone(), port); - if declaration_is_callable(ctx.dag, *input_decl, 0) { - body_callable_scope.insert(name.clone(), *input_decl); - } - param_ports.push(port); - } - - let body_return_port = lower_expr( - body, - ctx.dag, - &body_scope, - &body_callable_scope, - ctx.symbols, - Some(expected_output), - ); - let bind_id = ctx.dag.alloc_node_id(); - let mut bind_params = capture_ports; - bind_params.extend(param_ports); - ctx.dag.push_node(Behavior::Bind(BindNode { - id: bind_id, - name: lambda_synthetic_name(span), - value: body_return_port, - params: bind_params, - span: span.clone(), - lane2_workflow: None, - emit_participation: Some(BindEmitParticipation::UserCallable), - })); - - Ok(TypeConnective::Arrow { - inputs: expected_inputs, - output: expected_output, - body: ArrowBody::UserDefined( - BindNodeId::from_bind_node(ctx.dag, bind_id) - .expect("UserDefined Arrow body bind id must point at a Bind"), - ), - }) -} - -fn resolve_callable_reference( - expr: &SurfaceExpr, - dag: &mut Dag, - callable_scope: &CallableScope, - symbols: &HashMap, -) -> DeclarationId { - match expr { - SurfaceExpr::Var { name, span } => callable_scope - .get(name) - .copied() - .or_else(|| symbols.get(name).copied()) - .unwrap_or_else(|| alloc_identifier_stub(dag, name, span)), - SurfaceExpr::Path { segments, span, .. } => { - alloc_identifier_stub(dag, &segments.join("."), span) - } - other => alloc_identifier_stub(dag, "__callable_argument__", surface_expr_span(other)), - } -} - -fn push_template_argument_binding( - arguments: &mut Vec, - parameter: DeclarationId, - value: DeclarationId, -) -> bool { - for existing in arguments.iter() { - if existing.parameter == parameter { - return existing.value == value; - } - } - arguments.push(TemplateArgument { parameter, value }); - true -} - -fn template_argument_value( - arguments: &[TemplateArgument], - parameter: DeclarationId, -) -> Option { - arguments - .iter() - .find(|arg| arg.parameter == parameter) - .map(|arg| arg.value) -} - -fn resolve_template_argument_value( - arguments: &[TemplateArgument], - current: DeclarationId, - depth: usize, -) -> DeclarationId { - if depth >= 32 { - return current; - } - let Some(next) = template_argument_value(arguments, current) else { - return current; - }; - if next == current { - return current; - } - resolve_template_argument_value(arguments, next, depth + 1) -} - -fn retained_template_arguments_for_target( - dag: &Dag, - base_target_decl: DeclarationId, - arguments: &[TemplateArgument], -) -> Vec { - let template = match &dag.declaration(base_target_decl).connective { - TypeConnective::Instantiation { template, .. } => *template, - _ => base_target_decl, - }; - let mut allowed: HashSet = dag - .declaration(template) - .type_params - .iter() - .copied() - .collect(); - if let Some(enclosing_disj) = enclosing_disj_for_variant_lower(dag, template) { - allowed.extend(dag.declaration(enclosing_disj).type_params.iter().copied()); - } - if let Some(inputs) = direct_invocation_input_decls(dag, template, 0) { - for input in inputs { - if declaration_is_callable(dag, input, 0) { - allowed.insert(input); - } - } - } - - let mut retained: Vec = Vec::new(); - for argument in arguments { - if !allowed.contains(&argument.parameter) { - continue; - } - let resolved_value = resolve_template_argument_value(arguments, argument.value, 0); - if let Some(existing) = retained - .iter_mut() - .find(|existing| existing.parameter == argument.parameter) - { - existing.value = resolved_value; - continue; - } - retained.push(TemplateArgument { - parameter: argument.parameter, - value: resolved_value, - }); - } - retained -} - -fn enclosing_disj_for_variant_lower( - dag: &Dag, - variant_decl_id: DeclarationId, -) -> Option { - dag.declarations().iter().find_map(|decl| { - let TypeConnective::Disj { variants } = &decl.connective else { - return None; - }; - variants - .iter() - .find(|variant| variant.ty == variant_decl_id) - .map(|_| decl.id) - }) -} - -fn callable_binding_conflict_diagnostic( - target: &str, - arg_index: usize, - span: &SourceSpan, -) -> Diagnostic { - Diagnostic::ResolveError { - name: format!( - "callable argument {} to `{target}` does not match the expected function type or conflicts with earlier template bindings", - arg_index + 1 - ), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("LoweringDiagnostic"), - } -} - -fn bind_expected_type_to_actual( - dag: &Dag, - expected_id: DeclarationId, - actual_id: DeclarationId, - arguments: &mut Vec, - depth: usize, -) -> bool { - if depth >= 32 { - return false; - } - let expected_decl = dag.declaration(expected_id); - match &expected_decl.connective { - TypeConnective::Atom(AtomPayload::TypeParam(_)) => { - if let Some(bound) = template_argument_value(arguments, expected_id) { - if bound != expected_id { - return bind_expected_type_to_actual( - dag, - bound, - actual_id, - arguments, - depth + 1, - ); - } - } - push_template_argument_binding(arguments, expected_id, actual_id) - } - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - bind_expected_type_to_actual(dag, *next, actual_id, arguments, depth + 1) - } - TypeConnective::Instantiation { - template, - arguments: expected_arguments, - } => { - let actual_decl = dag.declaration(actual_id); - match &actual_decl.connective { - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - bind_expected_type_to_actual(dag, expected_id, *next, arguments, depth + 1) - } - TypeConnective::Instantiation { - template: actual_template, - arguments: actual_arguments, - } => { - if *actual_template == expected_id - && expected_arguments.len() == actual_arguments.len() - { - return expected_arguments.iter().zip(actual_arguments.iter()).all( - |(expected, actual)| { - bind_expected_type_to_actual( - dag, - expected.value, - actual.value, - arguments, - depth + 1, - ) - }, - ); - } - if template != actual_template - || expected_arguments.len() != actual_arguments.len() - { - return false; - } - expected_arguments.iter().zip(actual_arguments.iter()).all( - |(expected, actual)| { - bind_expected_type_to_actual( - dag, - expected.value, - actual.value, - arguments, - depth + 1, - ) - }, - ) - } - _ => false, - } - } - TypeConnective::Arrow { inputs, output, .. } => { - let actual_decl = dag.declaration(actual_id); - match &actual_decl.connective { - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - bind_expected_type_to_actual(dag, expected_id, *next, arguments, depth + 1) - } - TypeConnective::Arrow { - inputs: actual_inputs, - output: actual_output, - .. - } => { - if inputs.len() != actual_inputs.len() { - return false; - } - inputs - .iter() - .zip(actual_inputs.iter()) - .all(|(expected, actual)| { - bind_expected_type_to_actual( - dag, - *expected, - *actual, - arguments, - depth + 1, - ) - }) - && bind_expected_type_to_actual( - dag, - *output, - *actual_output, - arguments, - depth + 1, - ) - } - _ => false, - } - } - TypeConnective::Cardinality(expected_payload) => { - let element = expected_payload.element(); - let bound = expected_payload.bound(); - let actual_decl = dag.declaration(actual_id); - match &actual_decl.connective { - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - bind_expected_type_to_actual(dag, expected_id, *next, arguments, depth + 1) - } - TypeConnective::Cardinality(actual_payload) if bound == actual_payload.bound() => { - bind_expected_type_to_actual( - dag, - element, - actual_payload.element(), - arguments, - depth + 1, - ) - } - _ => false, - } - } - _ => { - let actual_decl = dag.declaration(actual_id); - match &actual_decl.connective { - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - bind_expected_type_to_actual(dag, expected_id, *next, arguments, depth + 1) - } - _ => expected_id == actual_id, - } - } - } -} - -fn specialize_decl_for_lowering( - dag: &mut Dag, - current: DeclarationId, - arguments: &[TemplateArgument], - depth: usize, -) -> DeclarationId { - if arguments.is_empty() { - return current; - } - if depth >= 32 { - return current; - } - let decl = dag.declaration(current).clone(); - // Stage 3b correction generation must see refinement-bearing - // declarations as refinement-bearing expectations, not their base - // carrier. Lowering does not have a substituted-refined - // materialization path here, so preserve the declared edge and let - // downstream consumers fail closed instead of specializing through - // to a base witness like `Int`. - if decl.refinement.is_some() { - return current; - } - match decl.connective { - TypeConnective::Atom(AtomPayload::TypeParam(_)) => arguments - .iter() - .find(|arg| arg.parameter == current) - .map(|arg| arg.value) - .unwrap_or(current), - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - specialize_decl_for_lowering(dag, next, arguments, depth + 1) - } - TypeConnective::Instantiation { - template, - arguments: inner_arguments, - } => { - let specialized_arguments: Vec = inner_arguments - .iter() - .map(|arg| TemplateArgument { - parameter: arg.parameter, - value: specialize_decl_for_lowering(dag, arg.value, arguments, depth + 1), - }) - .collect(); - if specialized_arguments.len() == inner_arguments.len() - && specialized_arguments - .iter() - .zip(inner_arguments.iter()) - .all(|(lhs, rhs)| lhs.parameter == rhs.parameter && lhs.value == rhs.value) - { - return current; - } - if let Some(existing) = - find_equivalent_decl_instantiation_lower(dag, template, &specialized_arguments) - { - return existing; - } - let id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id, - name: None, - connective: TypeConnective::Instantiation { - template, - arguments: specialized_arguments, - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: decl.span, - }); - id - } - TypeConnective::Arrow { - inputs, - output, - body, - } => { - let specialized_inputs: Vec = inputs - .iter() - .map(|input| specialize_decl_for_lowering(dag, *input, arguments, depth + 1)) - .collect(); - let specialized_output = - specialize_decl_for_lowering(dag, output, arguments, depth + 1); - if specialized_inputs == inputs && specialized_output == output { - return current; - } - let id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id, - name: None, - connective: TypeConnective::Arrow { - inputs: specialized_inputs, - output: specialized_output, - body, - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: decl.span, - }); - id - } - TypeConnective::Conj { children } => { - let specialized_children: Vec = children - .iter() - .map(|child| Field { - label: child.label.clone(), - ty: specialize_decl_for_lowering(dag, child.ty, arguments, depth + 1), - }) - .collect(); - if specialized_children.len() == children.len() - && specialized_children - .iter() - .zip(children.iter()) - .all(|(lhs, rhs)| lhs.label == rhs.label && lhs.ty == rhs.ty) - { - return current; - } - let id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id, - // Specialized products stay `name: None`: reusing the template name - // would admit two `DeclarationId`s with the same Rust type label if - // both were ever emitted outside filtered surfaces. - // No `specialization_parent` here: unlike specialized anonymous `Disj`, - // emit has no consumer that must recover a template `Conj` label today; - // set the edge when a real downstream needs it (E-6 / same-PR consumer). - name: None, - connective: TypeConnective::Conj { - children: specialized_children, - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: decl.span, - }); - id - } - TypeConnective::Disj { variants } => { - let specialized_variants: Vec = variants - .iter() - .map(|variant| Field { - label: variant.label.clone(), - ty: specialize_decl_for_lowering(dag, variant.ty, arguments, depth + 1), - }) - .collect(); - if specialized_variants.len() == variants.len() - && specialized_variants - .iter() - .zip(variants.iter()) - .all(|(lhs, rhs)| lhs.label == rhs.label && lhs.ty == rhs.ty) - { - return current; - } - let id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id, - // P2: `Declaration::name` is the only surface-visible authority for - // `Dag::declaration_by_name` — never clone the template name onto a - // fresh `Disj` id (that admits a second winner in name-based lookup). - // Emit qualifies Rust match patterns via `Declaration::specialization_parent` - // (`rust_target::named_disj_enum_name_for_rust_match_emit`). - name: None, - connective: TypeConnective::Disj { - variants: specialized_variants, - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: Some(current), - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: decl.span, - }); - id - } - TypeConnective::Cardinality(_) - | TypeConnective::Atom(AtomPayload::UnresolvedIdentifier(_)) - | TypeConnective::Atom(AtomPayload::Literal(_)) => current, - } -} - -fn unresolved_port(dag: &mut Dag, diagnostic: Diagnostic) -> PortId { - let port = dag.alloc_port(None); - dag.mark_unresolved(port, diagnostic); - port -} - -fn lower_field_path_expr( - segments: &[String], - segment_spans: &[SourceSpan], - span: &SourceSpan, - dag: &mut Dag, - scope: &HashMap, - symbols: &HashMap, -) -> PortId { - let Some((head, rest)) = segments.split_first() else { - return unresolved_port( - dag, - Diagnostic::ResolveError { - name: "empty dotted path expression".to_string(), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - }, - ); - }; - // Path A: head is in local variable scope (fn params, let bindings, - // match-arm pattern bindings). Existing type-driven walk. - if let Some(&port) = scope.get(head) { - let mut current_port = port; - for (index, field_label) in rest.iter().enumerate() { - let node_id = dag.alloc_node_id(); - let output = dag.alloc_port(Some(node_id)); - let static_resolution = resolve_static_field_project(dag, current_port, field_label); - let field_span = segment_spans - .get(index + 1) - .cloned() - .unwrap_or_else(|| span.clone()); - dag.push_node(Behavior::Transform(TransformNode { - id: node_id, - target: static_resolution.map_or_else( - || TransformTarget::UnresolvedFieldProject { - field_label: field_label.clone(), - }, - |(_, _)| TransformTarget::ResolvedFieldProject { - field_label: field_label.clone(), - }, - ), - inputs: vec![current_port], - output, - span: field_span, - })); - if let Some((_, ty)) = static_resolution { - dag.set_port_type(output, ty); - } - current_port = output; - } - return current_port; - } - // Path B: DB-10 (3a.2) — head resolves to a `data` declaration - // with a structural value_body. Walk the compile-time value - // literal rather than performing a runtime FieldProject walk. - // `cfg.host` where cfg: Config = { host: 1, port: 8080 } becomes - // a Value(Int(1)) node directly. - if let Some(&decl_id) = symbols.get(head) { - let value_body_opt = dag.declaration(decl_id).value_body.clone(); - if let Some(value_body) = value_body_opt { - if let Some(port) = resolve_data_path(dag, &value_body, rest, span) { - return port; - } - return unresolved_port( - dag, - data_field_path_diagnostic(dag, decl_id, &value_body, rest, span), - ); - } - } - unresolved_port( - dag, - Diagnostic::ResolveError { - name: format!( - "dotted path `{}` is not a local field access; expression-position dotted paths currently require a local-variable head or a `data` declaration with a compile-time value", - segments.join("."), - ), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("LoweringDiagnostic"), - }, - ) -} - -fn data_declared_type_display_name(dag: &Dag, decl_id: DeclarationId) -> String { - dag.declaration(decl_id) - .meta_tag - .map(|ty| declaration_display_name(dag, ty)) - .unwrap_or_else(|| declaration_display_name(dag, decl_id)) -} - -fn data_field_path_diagnostic( - dag: &Dag, - decl_id: DeclarationId, - value_body: &crate::dag::ValueBody, - segments: &[String], - span: &SourceSpan, -) -> Diagnostic { - let type_name = data_declared_type_display_name(dag, decl_id); - let field = segments.first().map_or("", String::as_str); - let name = match value_body { - crate::dag::ValueBody::Scalar(_) => format!("{type_name} has no field {field}"), - crate::dag::ValueBody::Structural { .. } => { - format!( - "{type_name} has no compile-time scalar field path `{}`", - segments.join(".") - ) - } - crate::dag::ValueBody::Unparsed(_) => { - format!("{type_name} data value body is not lowered to a compile-time field value") - } - crate::dag::ValueBody::List(_) | crate::dag::ValueBody::Map(_) => { - format!( - "{type_name} data value does not support dotted field path `{}`", - segments.join(".") - ) - } - }; - Diagnostic::ResolveError { - name, - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - } -} - -/// DB-10 (3a.2): walk a sequence of field segments through a data -/// declaration's `ValueBody`, emitting a `Value` node at the terminal -/// scalar literal. Returns `None` if the path cannot be fully -/// resolved — caller falls back to an unresolved diagnostic. -/// -/// Only scalar literals terminate the walk; nested `Record` payloads -/// admit further descent but `List`, `Map`, and `Variant` terminal -/// reads are out of scope for 3a.2 and fall through to `None`. -/// Prereq-X1.a: walk a sequence of structural-body field segments -/// to a `FieldValue::Reference(decl_id)` leaf. Returns `None` if the -/// path traverses a non-structural value body, the leaf field is -/// missing, the leaf is a non-Reference value, or the segments are -/// empty. -fn resolve_field_value_reference( - value_body: &crate::dag::ValueBody, - segments: &[String], -) -> Option { - let crate::dag::ValueBody::Structural { fields } = value_body else { - return None; - }; - walk_structural_to_reference(fields, segments) -} - -/// Prereq-X1.a: resolve a `PathCall.segments` slice to a leaf -/// top-level function `DeclarationId`. Single resolution authority -/// shared by `is_recursive`, `descent_provable`, the -/// `ClusterDescentChecker` arm, `collect_recursive_callees`, and the -/// `lower_expr` X1.a arm — so all five agree by construction. -/// -/// Returns `None` when the head is not a top-level symbol, the head -/// declaration has no compile-time value body, the path leaf is not a -/// `FieldValue::Reference`, or the segments traverse a non-structural -/// value body. Non-callable leaves are accepted at this layer; the -/// lowerer enforces the Arrow check separately. -fn resolve_path_to_function_decl( - segments: &[String], - dag: &Dag, - symbols: &HashMap, -) -> Option { - let head = segments.first()?; - // Look up the head in the caller-supplied `symbols` map first - // (lowerer / is_recursive / descent_provable have the full - // top-level symbol table), then fall back to - // `Dag::declaration_by_name` so callers with narrower maps - // (e.g. `compute_mutually_recursive`'s `function_symbols`-only - // map) can still resolve `data`-binding heads. - let head_decl = match symbols.get(head).copied() { - Some(id) => id, - None => dag.declaration_by_name(head)?.id, - }; - let value_body = dag.declaration(head_decl).value_body.as_ref()?; - resolve_field_value_reference(value_body, &segments[1..]) -} - -fn walk_structural_to_reference( - fields: &[(String, crate::dag::FieldValue)], - segments: &[String], -) -> Option { - let (head, rest) = segments.split_first()?; - let field_value = fields - .iter() - .find(|(label, _)| label == head) - .map(|(_, v)| v)?; - if rest.is_empty() { - return match field_value { - crate::dag::FieldValue::Reference(id) => Some(*id), - _ => None, - }; - } - match field_value { - crate::dag::FieldValue::Record(inner) => walk_structural_to_reference(inner, rest), - _ => None, - } -} - -fn resolve_data_path( - dag: &mut Dag, - value_body: &crate::dag::ValueBody, - segments: &[String], - span: &SourceSpan, -) -> Option { - match value_body { - crate::dag::ValueBody::Unparsed(_) => None, - crate::dag::ValueBody::Scalar(bits) => { - if !segments.is_empty() { - return None; - } - Some(emit_literal_as_value_port(dag, bits.clone(), span)) - } - crate::dag::ValueBody::Structural { fields } => { - resolve_structural_field_path(dag, fields, segments, span) - } - crate::dag::ValueBody::List(_) => None, - crate::dag::ValueBody::Map(_) => None, - } -} - -fn resolve_structural_field_path( - dag: &mut Dag, - fields: &[(String, crate::dag::FieldValue)], - segments: &[String], - span: &SourceSpan, -) -> Option { - let (head, rest) = segments.split_first()?; - let field_value = fields - .iter() - .find(|(label, _)| label == head) - .map(|(_, v)| v.clone())?; - if rest.is_empty() { - return emit_field_value_as_port(dag, &field_value, span); - } - match &field_value { - crate::dag::FieldValue::Record(inner) => { - resolve_structural_field_path(dag, inner, rest, span) - } - _ => None, - } -} - -fn emit_field_value_as_port( - dag: &mut Dag, - fv: &crate::dag::FieldValue, - span: &SourceSpan, -) -> Option { - match fv { - crate::dag::FieldValue::Literal(bits) => { - Some(emit_literal_as_value_port(dag, bits.clone(), span)) - } - // Reference / Record / List / Variant terminal reads require - // more emission machinery than DB-10 covers (acceptance is - // scalar-at-leaf). Leave unresolved; call site falls back to - // an unresolved diagnostic. - _ => None, - } -} - -/// DB-10 (3a.2): emit a scalar literal from its `LiteralBits` -/// directly as a `Behavior::Value` node. Shared by -/// `ValueBody::Scalar` inlining and `FieldValue::Literal` terminal -/// reads. -fn emit_literal_as_value_port(dag: &mut Dag, bits: LiteralBits, span: &SourceSpan) -> PortId { - let node_id = dag.alloc_node_id(); - let output = dag.alloc_port(Some(node_id)); - dag.push_node(Behavior::Value(ValueNode { - id: node_id, - data: bits, - output, - span: span.clone(), - lane2_workflow: None, - })); - output -} - -fn lower_payload_binding(dag: &mut Dag, binding_name: &str) -> PayloadBinding { - let payload_port = dag.alloc_port(None); - PayloadBinding { - binding_name: binding_name.to_string(), - payload_port, - } -} - -fn lower_field_projection_from_port( - dag: &mut Dag, - input_port: PortId, - field_label: &str, - span: &SourceSpan, -) -> PortId { - let node_id = dag.alloc_node_id(); - let output = dag.alloc_port(Some(node_id)); - let static_resolution = resolve_static_field_project(dag, input_port, field_label); - dag.push_node(Behavior::Transform(TransformNode { - id: node_id, - target: static_resolution.map_or_else( - || TransformTarget::UnresolvedFieldProject { - field_label: field_label.to_string(), - }, - |(_, _)| TransformTarget::ResolvedFieldProject { - field_label: field_label.to_string(), - }, - ), - inputs: vec![input_port], - output, - span: span.clone(), - })); - if let Some((_, ty)) = static_resolution { - dag.set_port_type(output, ty); - } - output -} - -/// Pushes template argument frames from any outer `Instantiation` chain (outer → inner template) -/// so payload fields that use type parameters from the instantiated outer type resolve correctly. -fn push_lower_subst_instantiation_prefix( - dag: &Dag, - mut ty: DeclarationId, - subst: &mut LowerSubstStack, -) { - for _ in 0..32 { - match &dag.declaration(ty).connective { - TypeConnective::Instantiation { - template, - arguments, - } => { - subst.push(arguments.clone()); - ty = *template; - } - _ => break, - } - } -} - -fn variant_payload_fields_for_lowering( - dag: &Dag, - variant_decl: DeclarationId, - outer_instantiated_type: Option, -) -> Option> { - let mut subst = LowerSubstStack::default(); - if let Some(outer) = outer_instantiated_type { - push_lower_subst_instantiation_prefix(dag, outer, &mut subst); - } - let conj_id = walk_to_conj_decl_with_subst_lower(dag, variant_decl, &mut subst)?; - let TypeConnective::Conj { children } = &dag.declaration(conj_id).connective else { - return None; - }; - Some( - children - .iter() - .map(|child| { - let specialized = - resolve_decl_with_subst_lower(dag, child.ty, &subst, 0).unwrap_or(child.ty); - (child.label.clone(), specialized) - }) - .collect(), - ) -} - -/// E6-G0d: whether `variant_template` is listed as a variant arm on some -/// substrate `TypeConnective::Disj` (membership authority for constructor -/// execution, distinct from “walks to Conj”). -pub(crate) fn declaration_is_disj_variant_arm(dag: &Dag, variant_template: DeclarationId) -> bool { - dag.declarations().iter().any(|decl| { - matches!( - &decl.connective, - TypeConnective::Disj { variants } - if variants.iter().any(|v| v.ty == variant_template) - ) - }) -} - -/// E6-G0d: record constructor field **labels** in declaration order after the -/// same `Instantiation` / `TypeParam` walk as `walk_to_conj_decl_with_subst_lower`. -pub(crate) fn constructor_record_field_labels( - dag: &Dag, - record_target: DeclarationId, -) -> Option> { - let mut subst = LowerSubstStack::default(); - let conj_id = walk_to_conj_decl_with_subst_lower(dag, record_target, &mut subst)?; - let TypeConnective::Conj { children } = &dag.declaration(conj_id).connective else { - return None; - }; - Some(children.iter().map(|c| c.label.clone()).collect()) -} - -/// E6-G0d: variant constructor payload fields for runtime `RecordValue` assembly. -/// -/// Reuses [`variant_payload_fields_for_lowering`]. When the lowerer would have -/// threaded an outer expected type (generic sums) but the transform IR carries -/// only the callee, fall back to trying each declaration as an outer prefix -/// until the existing substrate walk succeeds — still a single authority -/// (`variant_payload_fields_for_lowering`), not a parallel registry. -/// -/// **Dissolution trigger:** delete this scan when `TransformTarget::Callable` (or -/// adjacent transform metadata) threads the same outer expected-type -/// `DeclarationId` the lowerer used at the constructor site, so the second -/// argument to [`variant_payload_fields_for_lowering`] is authoritative without -/// enumeration. -/// -/// In `debug_assertions` builds, every successful prefix is checked to agree with -/// the returned resolution so silent ambiguity cannot hide inconsistent payload -/// shapes during development. -pub(crate) fn eval_constructor_variant_payload_fields( - dag: &Dag, - callee_decl: DeclarationId, -) -> Option> { - let fields = if let Some(fields) = variant_payload_fields_for_lowering(dag, callee_decl, None) { - fields - } else { - let mut found = None; - for decl in dag.declarations() { - if let Some(fields) = - variant_payload_fields_for_lowering(dag, callee_decl, Some(decl.id)) - { - found = Some(fields); - break; - } - } - found? - }; - #[cfg(debug_assertions)] - debug_assert_variant_payload_prefix_scan_is_unambiguous(dag, callee_decl, &fields); - Some(fields) -} - -#[cfg(debug_assertions)] -fn debug_assert_variant_payload_prefix_scan_is_unambiguous( - dag: &Dag, - callee_decl: DeclarationId, - chosen: &[(String, DeclarationId)], -) { - if let Some(fields) = variant_payload_fields_for_lowering(dag, callee_decl, None) { - debug_assert_eq!( - fields, chosen, - "eval_constructor_variant_payload_fields: None-outer payload disagrees with chosen resolution" - ); - } - for decl in dag.declarations() { - if let Some(fields) = variant_payload_fields_for_lowering(dag, callee_decl, Some(decl.id)) { - debug_assert_eq!( - fields, chosen, - "eval_constructor_variant_payload_fields: prefix-scan payload disagrees with chosen resolution" - ); - } - } -} - -fn variant_payload_fields_for_lowering_with_subst( - dag: &Dag, - variant_decl: DeclarationId, - outer_subst: &LowerSubstStack, -) -> Option> { - let mut subst = outer_subst.clone(); - let conj_id = walk_to_conj_decl_with_subst_lower(dag, variant_decl, &mut subst)?; - let TypeConnective::Conj { children } = &dag.declaration(conj_id).connective else { - return None; - }; - Some( - children - .iter() - .map(|child| { - let specialized = - resolve_decl_with_subst_lower(dag, child.ty, &subst, 0).unwrap_or(child.ty); - (child.label.clone(), specialized) - }) - .collect(), - ) -} - -fn synthetic_pattern_payload_binding_name( - fields: &[SurfacePatternField], - span: &SourceSpan, -) -> String { - if fields.len() == 1 { - return fields[0].binding.clone(); - } - format!("__payload_{}_{}", span.byte_start, span.byte_end) -} - -struct LoweredMatchArm { - output: PortId, - body_node: Option, - pattern_name: String, - pattern_span: SourceSpan, - binding: Option, -} - -fn duplicate_payload_pattern_binding_diagnostic( - variant_name: &str, - binding_name: &str, - span: &SourceSpan, -) -> Diagnostic { - Diagnostic::ResolveError { - name: format!( - "named payload pattern `{variant_name}` binds `{binding_name}` more than once" - ), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - } -} - -struct VariantRecordExprRef<'a> { - target: &'a str, - fields: &'a [crate::parse::SurfaceRecordField], - span: &'a SourceSpan, -} - -/// Shared static-callable invocation lowerer, parametric over the -/// resolved callee `DeclarationId`. Both the `Call` arm and the X1.a -/// `PathCall` arm of `lower_expr` dispatch through this helper so the -/// resolved-decl identity flows forward without name re-resolution. -/// -/// `callable_diagnostic_name` is the human-readable label used in -/// callable-binding-conflict diagnostics (the bare target name for -/// `Call`; the dotted path for `PathCall`). It is purely diagnostic — -/// the substrate authority is always `base_target_decl`. -#[allow(clippy::too_many_arguments)] -fn lower_resolved_callable_invocation( - base_target_decl: DeclarationId, - callable_diagnostic_name: &str, - args: &[SurfaceExpr], - span: &SourceSpan, - dag: &mut Dag, - scope: &HashMap, - callable_scope: &CallableScope, - symbols: &HashMap, - expected_decl: Option, -) -> PortId { - if let Some(port) = try_lower_config_patch_layer_invocation( - base_target_decl, - args, - span, - dag, - scope, - callable_scope, - symbols, - expected_decl, - ) { - return port; - } - let target_inputs = direct_invocation_input_decls(dag, base_target_decl, 0); - let mut input_ports: Vec = Vec::new(); - let mut template_arguments: Vec = Vec::new(); - if let (Some(expected_result), Some(target_output)) = ( - expected_decl, - declaration_callable_output(dag, base_target_decl, 0), - ) { - let _ = bind_expected_type_to_actual( - dag, - target_output, - expected_result, - &mut template_arguments, - 0, - ); - } - for (idx, arg) in args.iter().enumerate() { - let raw_expected_input = target_inputs - .as_ref() - .and_then(|inputs| inputs.get(idx)) - .copied(); - let specialized_expected_input = raw_expected_input.map(|expected_decl| { - specialize_decl_for_lowering(dag, expected_decl, &template_arguments, 0) - }); - if let Some(expected_decl) = raw_expected_input { - if declaration_is_callable(dag, expected_decl, 0) { - let specialized_expected = specialized_expected_input.unwrap_or(expected_decl); - let actual_callable = match arg { - SurfaceExpr::Lambda { params, body, span } => { - let mut lambda_ctx = LambdaLoweringContext { - dag, - scope, - callable_scope, - symbols, - }; - match lower_lambda_expr( - params, - body, - span, - specialized_expected, - &mut lambda_ctx, - ) { - Ok(lambda_decl_id) => lambda_decl_id, - Err(diag) => { - report_declaration_error(lambda_ctx.dag, diag); - alloc_identifier_stub(lambda_ctx.dag, "__lambda__", span) - } - } - } - _ => resolve_callable_reference(arg, dag, callable_scope, symbols), - }; - let matches_expected = push_template_argument_binding( - &mut template_arguments, - expected_decl, - actual_callable, - ) && bind_expected_type_to_actual( - dag, - specialized_expected, - actual_callable, - &mut template_arguments, - 0, - ); - if !matches_expected { - let port = dag.alloc_port(None); - dag.mark_unresolved( - port, - callable_binding_conflict_diagnostic( - callable_diagnostic_name, - idx, - surface_expr_span(arg), - ), - ); - return port; - } - continue; - } - } - let lowered = lower_expr( - arg, - dag, - scope, - callable_scope, - symbols, - specialized_expected_input, - ); - if let Some(expected_decl) = raw_expected_input { - if let crate::dag::PortState::Resolved(actual_ty) = dag.port(lowered).state() { - let _ = bind_expected_type_to_actual( - dag, - expected_decl, - actual_ty.declaration, - &mut template_arguments, - 0, - ); - } - } - input_ports.push(lowered); - } - let retained_arguments = - retained_template_arguments_for_target(dag, base_target_decl, &template_arguments); - let target_decl = materialize_callable_target_with_retained_arguments( - dag, - base_target_decl, - retained_arguments, - span, - ); - let node_id = dag.alloc_node_id(); - let output = dag.alloc_port(Some(node_id)); - dag.push_node(Behavior::Transform(TransformNode { - id: node_id, - target: TransformTarget::Callable(target_decl), - inputs: input_ports, - output, - span: span.clone(), - })); - output -} - -fn lower_expr( - expr: &SurfaceExpr, - dag: &mut Dag, - scope: &HashMap, - callable_scope: &CallableScope, - symbols: &HashMap, - expected_decl: Option, -) -> PortId { - match expr { - SurfaceExpr::Literal { value, span } => { - let node_id = dag.alloc_node_id(); - let output = dag.alloc_port(Some(node_id)); - let data = match value { - SurfaceLiteral::Int(v) => LiteralBits::Int(v.clone()), - SurfaceLiteral::Bool(v) => LiteralBits::Bool(*v), - SurfaceLiteral::String(v) => LiteralBits::String(v.clone()), - SurfaceLiteral::Symbol(v) => LiteralBits::Symbol(v.clone()), - }; - dag.push_node(Behavior::Value(ValueNode { - id: node_id, - data, - output, - span: span.clone(), - lane2_workflow: None, - })); - output - } - SurfaceExpr::Var { name, span } => match scope.get(name) { - Some(port) => *port, - None => { - if let Some(target) = resolve_expected_variant_constructor(dag, expected_decl, name) - { - return lower_constructor_invocation(dag, target, Vec::new(), span.clone()); - } - // DB-10 (3a.2): if `name` resolves to a `data` decl - // with a scalar value_body, inline the value at this - // use site as a Value(LiteralBits) node. Emission then - // renders the target-native literal without extra - // wiring. Record-valued data references are currently - // unsupported — those sites fall through to the - // existing unresolved diagnostic (acceptance test - // `test_3a2_data_referenced_in_fn_body_compiles` - // uses scalar only). - if let Some(decl_id) = symbols.get(name) { - if let Some(crate::dag::ValueBody::Scalar(bits)) = - &dag.declaration(*decl_id).value_body - { - let bits = bits.clone(); - return emit_literal_as_value_port(dag, bits, span); - } - } - let port = dag.alloc_port(None); - let correction = expected_decl - .and_then(|decl| { - witness_correction_for_decl( - dag, - decl, - span.clone(), - format!( - "replace unresolved name `{name}` with a `{}` value", - declaration_display_name(dag, decl) - ), - ) - }) - .unwrap_or_else(|| { - crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ) - }); - dag.mark_unresolved( - port, - Diagnostic::ResolveError { - name: name.clone(), - span: span.clone(), - correction, - }, - ); - port - } - }, - SurfaceExpr::Call { target, args, span } => { - let Some(base_target_decl) = - resolve_expected_variant_constructor(dag, expected_decl, target) - .or_else(|| callable_scope.get(target).copied()) - .or_else(|| symbols.get(target).copied()) - else { - // (unresolved branch — kept inline to preserve diagnostic shape; - // resolved branch delegates to `lower_resolved_callable_invocation`) - for arg in args { - let _ = lower_expr(arg, dag, scope, callable_scope, symbols, None); - } - let port = dag.alloc_port(None); - let correction = expected_decl - .and_then(|decl| { - witness_correction_for_decl( - dag, - decl, - span.clone(), - format!( - "replace unresolved call `{target}` with a `{}` value", - declaration_display_name(dag, decl) - ), - ) - }) - .unwrap_or_else(|| { - crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ) - }); - let diagnostic_name = match expected_decl { - Some(exp) if walk_to_disj_decl(dag, exp).is_some() => format!( - "named constructor `{target}` is not a variant of the expected sum type `{}`", - declaration_display_name(dag, exp) - ), - _ => target.clone(), - }; - dag.mark_unresolved( - port, - Diagnostic::ResolveError { - name: diagnostic_name, - span: span.clone(), - correction, - }, - ); - return port; - }; - lower_resolved_callable_invocation( - base_target_decl, - target, - args, - span, - dag, - scope, - callable_scope, - symbols, - expected_decl, - ) - } - SurfaceExpr::VariantRecord { - target, - fields, - span, - } => lower_variant_record_expr( - VariantRecordExprRef { - target, - fields, - span, - }, - dag, - scope, - callable_scope, - symbols, - expected_decl, - ), - SurfaceExpr::Operator { op, args, span } => { - let input_ports: Vec = args - .iter() - .map(|a| lower_expr(a, dag, scope, callable_scope, symbols, None)) - .collect(); - let node_id = dag.alloc_node_id(); - let output = dag.alloc_port(Some(node_id)); - dag.push_node(Behavior::Transform(TransformNode { - id: node_id, - target: TransformTarget::Operator(*op), - inputs: input_ports, - output, - span: span.clone(), - })); - output - } - SurfaceExpr::Lambda { span, .. } => { - let port = dag.alloc_port(None); - dag.mark_unresolved( - port, - Diagnostic::ResolveError { - name: "lambda expression requires an expected function type at this position" - .to_string(), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - }, - ); - port - } - SurfaceExpr::If { - cond, - then_branch, - else_branch, - span, - } => { - let cond_port = lower_expr(cond, dag, scope, callable_scope, symbols, None); - // DB-11 (3a.3) arm-local refinement narrowing. If `cond` is - // a predicate applied to a scope-bound Var (e.g. `d != 0` - // where `d` is a parameter), allocate a narrowed port in - // the then-arm whose type carries a refinement matching - // the predicate. Call-site refinement discharge in - // `decide_transform` then sees the refinement on the - // narrowed port and accepts calls that would otherwise - // fail. No narrowing on the else-arm — by convention the - // else-arm's refinement would be the negation, and DB-11 - // does not model negated predicates (structural equality - // only). - let then_scope_owned = narrow_scope_for_predicate(cond, scope, symbols, dag); - let then_scope_ref = then_scope_owned.as_ref().unwrap_or(scope); - let then_port = lower_expr( - then_branch, - dag, - then_scope_ref, - callable_scope, - symbols, - expected_decl, - ); - let else_port = lower_expr( - else_branch, - dag, - scope, - callable_scope, - symbols, - expected_decl, - ); - let branch_id = dag.alloc_node_id(); - let branch_output = dag.alloc_port(Some(branch_id)); - let then_body = producer_of(dag, then_port).unwrap_or(branch_id); - let else_body = producer_of(dag, else_port).unwrap_or(branch_id); - // if-then-else is a match on Bool with two arms. Emit - // explicit pattern labels so the discriminator lives - // structurally on Path, not by positional convention. - // Infer resolves each "True"/"False" against Bool's - // Disj children. - dag.push_node(Behavior::Branch(BranchNode { - id: branch_id, - input: cond_port, - paths: vec![ - Path { - body: then_body, - output: then_port, - pattern: BranchPattern::UnresolvedVariant { - name: "True".to_string(), - span: surface_expr_span(then_branch).clone(), - }, - binding: None, - }, - Path { - body: else_body, - output: else_port, - pattern: BranchPattern::UnresolvedVariant { - name: "False".to_string(), - span: surface_expr_span(else_branch).clone(), - }, - binding: None, - }, - ], - output: branch_output, - span: span.clone(), - emit_participation: None, - })); - branch_output - } - SurfaceExpr::Match { - scrutinee, - arms, - span, - } => { - // Lower scrutinee and all arm bodies FIRST. `alloc_node_id` - // comes after so the Branch's id matches `nodes.len()` - // at push time (arm lowering pushes its own nodes). Same - // ordering pattern as the `If` arm above. - let scrutinee_port = lower_expr(scrutinee, dag, scope, callable_scope, symbols, None); - let mut lowered_arms: Vec = Vec::with_capacity(arms.len()); - for arm in arms { - let mut arm_scope = scope.clone(); - let (pattern_name, pattern_span, binding, arm_error) = match &arm.pattern { - SurfacePattern::BareVariant { name, span } => { - (name.clone(), span.clone(), None, None) - } - SurfacePattern::VariantWith { - name, - binding, - span, - } => { - let payload_binding = lower_payload_binding(dag, binding); - arm_scope.insert( - payload_binding.binding_name.clone(), - payload_binding.payload_port, - ); - (name.clone(), span.clone(), Some(payload_binding), None) - } - SurfacePattern::VariantFields { name, fields, span } => { - let payload_binding_name = - synthetic_pattern_payload_binding_name(fields, span); - let payload_binding = lower_payload_binding(dag, &payload_binding_name); - // Track names INTRODUCED by THIS pattern only, not the - // full outer scope. `arm_scope` was cloned from the - // enclosing scope at line 5057, so any outer binding - // (`let x = ...; match y { Foo { x } => ... }`) would - // otherwise fire a spurious duplicate-binding - // diagnostic. Pattern-local duplicates - // (`Foo { x: a, y: a }`) are still rejected. Match-arm - // shadowing of outer names then works the same way - // `VariantWith` already does (overwrite on insert). - let mut introduced: std::collections::HashSet = - std::collections::HashSet::new(); - let mut duplicate_binding = None; - for field in fields { - if !introduced.insert(field.binding.clone()) { - duplicate_binding = - Some(duplicate_payload_pattern_binding_diagnostic( - name, - &field.binding, - &field.span, - )); - break; - } - let projection = lower_field_projection_from_port( - dag, - payload_binding.payload_port, - &field.name, - &field.span, - ); - arm_scope.insert(field.binding.clone(), projection); - } - ( - name.clone(), - span.clone(), - Some(payload_binding), - duplicate_binding, - ) - } - }; - let arm_output_port = match arm_error { - Some(diag) => unresolved_port(dag, diag), - None => lower_expr( - &arm.body, - dag, - &arm_scope, - callable_scope, - symbols, - expected_decl, - ), - }; - let body_node = producer_of(dag, arm_output_port); - lowered_arms.push(LoweredMatchArm { - output: arm_output_port, - body_node, - pattern_name, - pattern_span, - binding, - }); - } - let branch_id = dag.alloc_node_id(); - let branch_output = dag.alloc_port(Some(branch_id)); - let paths: Vec = lowered_arms - .into_iter() - .map(|arm| Path { - body: arm.body_node.unwrap_or(branch_id), - output: arm.output, - pattern: BranchPattern::UnresolvedVariant { - name: arm.pattern_name, - span: arm.pattern_span, - }, - binding: arm.binding, - }) - .collect(); - dag.push_node(Behavior::Branch(BranchNode { - id: branch_id, - input: scrutinee_port, - paths, - output: branch_output, - span: span.clone(), - emit_participation: Some(BranchEmitParticipation::UserMatch), - })); - branch_output - } - SurfaceExpr::Record { fields, span } => lower_record_literal_expr( - fields, - span, - dag, - scope, - callable_scope, - symbols, - expected_decl, - ), - SurfaceExpr::List { elements, span } => lower_list_literal_expr( - elements, - span, - dag, - scope, - callable_scope, - symbols, - expected_decl, - ), - SurfaceExpr::Path { - segments, - segment_spans, - span, - } => lower_field_path_expr(segments, segment_spans, span, dag, scope, symbols), - SurfaceExpr::PathCall { - segments, - segment_spans: _, - args, - span, - } => { - // Prereq-X1.a: static call-on-field-access. Resolve the - // dotted-path callee through a `data` binding's - // structural value body to a top-level function decl, then - // dispatch through the existing `Call` lowering by - // constructing a synthetic `SurfaceExpr::Call` whose target - // is the resolved declaration's name. This reuses arity + - // per-argument type validation without duplicating the - // Call lowerer. - // - // Failure modes (each fail-closed with a typed diagnostic): - // - // - Empty path / non-`data` head / parameter-callee head: - // ResolveError naming the unsupported head and pointing - // at the X1.b prerequisite for parameter callees. - // - Missing/non-Reference field at the leaf: ResolveError. - // - Resolved declaration without a name: ResolveError. - // - // Parameter-callee dispatch (X1.b) is intentionally - // unsupported here; the diagnostic names the prerequisite. - let Some((head, rest)) = segments.split_first() else { - return unresolved_port( - dag, - Diagnostic::ResolveError { - name: "empty dotted path in call expression".to_string(), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - }, - ); - }; - // Parameter-callee head (X1.b): the head is a local-scope - // binding rather than a top-level `data` symbol. Surface a - // typed diagnostic naming the prerequisite — do not - // silently fall through. - if scope.contains_key(head) { - for arg in args { - let _ = lower_expr(arg, dag, scope, callable_scope, symbols, None); - } - return unresolved_port( - dag, - Diagnostic::ResolveError { - name: format!( - "call-on-field-access through parameter `{head}` is not yet supported (Prereq-X1.b: requires runtime-callee dispatch substrate); only static `data` binding callees are accepted in this slice" - ), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("LoweringDiagnostic"), - }, - ); - } - let Some(&head_decl) = symbols.get(head) else { - for arg in args { - let _ = lower_expr(arg, dag, scope, callable_scope, symbols, None); - } - return unresolved_port( - dag, - Diagnostic::ResolveError { - name: format!( - "call-on-field-access head `{head}` is not a top-level `data` declaration; static call-on-field-access (Prereq-X1.a) requires a `data` binding head" - ), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("LoweringDiagnostic"), - }, - ); - }; - let value_body_opt = dag.declaration(head_decl).value_body.clone(); - let Some(value_body) = value_body_opt else { - for arg in args { - let _ = lower_expr(arg, dag, scope, callable_scope, symbols, None); - } - return unresolved_port( - dag, - Diagnostic::ResolveError { - name: format!( - "call-on-field-access head `{head}` has no compile-time value body; static call-on-field-access requires a `data` binding with a structural value body" - ), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("LoweringDiagnostic"), - }, - ); - }; - let resolved_callee_decl = resolve_field_value_reference(&value_body, rest); - let Some(callee_decl_id) = resolved_callee_decl else { - for arg in args { - let _ = lower_expr(arg, dag, scope, callable_scope, symbols, None); - } - return unresolved_port( - dag, - Diagnostic::ResolveError { - name: format!( - "dotted path `{}` does not resolve to a callable function reference (expected `FieldValue::Reference` at leaf); the field may be a non-Arrow value, missing, or the path may traverse a non-structural value body", - segments.join(".") - ), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("LoweringDiagnostic"), - }, - ); - }; - // Verify the resolved leaf is callable (Arrow). A - // FieldValue::Reference to a non-callable declaration - // (e.g., a typed-but-non-Arrow data binding referenced as - // a field) must produce a typed non-callable diagnostic - // here rather than relying on the synthetic Call lowerer - // to surface something ambiguous downstream. - if !declaration_is_callable(dag, callee_decl_id, 0) { - for arg in args { - let _ = lower_expr(arg, dag, scope, callable_scope, symbols, None); - } - return unresolved_port( - dag, - Diagnostic::ResolveError { - name: format!( - "dotted path `{}` resolves to a non-callable declaration; X1.a static call-on-field-access requires the leaf to reference a top-level function (Arrow type)", - segments.join(".") - ), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("LoweringDiagnostic"), - }, - ); - } - // Authority preserved: the resolved `callee_decl_id` flows - // directly into `lower_resolved_callable_invocation` — - // **not** re-resolved by name through the synthetic-Call - // detour. The dotted-path display is the diagnostic label - // for callable-binding-conflict messages; the substrate - // identity is `callee_decl_id`. - let diagnostic_label = segments.join("."); - lower_resolved_callable_invocation( - callee_decl_id, - &diagnostic_label, - args, - span, - dag, - scope, - callable_scope, - symbols, - expected_decl, - ) - } - SurfaceExpr::Map { span, .. } => { - // Map literals are not lowerable as expressions in M1(2.8) — - // the parser admits them only in top-level data-body - // position, where `lower_data_item` handles the variant - // directly. A `SurfaceExpr::Map` reaching `lower_expr` means - // it appeared in expression position (function body, etc.), - // which is out of scope for the parser sub-lane. Fail-closed - // expression-level diagnostic via `unresolved_port` (the - // expression-position diagnostic-port channel) — not - // `report_declaration_error`, which is for declaration-level - // failures and would route the diagnostic through the wrong - // channel here. - unresolved_port( - dag, - Diagnostic::ResolveError { - name: "map literals are not yet supported in expression position (top-level data declarations only)".to_string(), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("LoweringDiagnostic"), - }, - ) - } - } -} - -fn lower_constructor_invocation( - dag: &mut Dag, - target: DeclarationId, - inputs: Vec, - span: SourceSpan, -) -> PortId { - let node_id = dag.alloc_node_id(); - let output = dag.alloc_port(Some(node_id)); - dag.push_node(Behavior::Transform(TransformNode { - id: node_id, - target: TransformTarget::Callable(target), - inputs, - output, - span, - })); - output -} - -fn materialize_callable_target_with_retained_arguments( - dag: &mut Dag, - base_target_decl: DeclarationId, - retained_arguments: Vec, - span: &SourceSpan, -) -> DeclarationId { - let (template, mut arguments) = match &dag.declaration(base_target_decl).connective { - TypeConnective::Instantiation { - template, - arguments, - } => (*template, arguments.clone()), - _ => (base_target_decl, Vec::new()), - }; - for argument in retained_arguments { - if let Some(existing) = arguments - .iter_mut() - .find(|existing| existing.parameter == argument.parameter) - { - existing.value = argument.value; - } else { - arguments.push(argument); - } - } - if arguments.is_empty() { - return template; - } - if let TypeConnective::Instantiation { - template: existing_template, - arguments: existing_arguments, - } = &dag.declaration(base_target_decl).connective - { - if *existing_template == template - && template_arguments_exact_match(existing_arguments, &arguments) - { - return base_target_decl; - } - } - - let instantiation_id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: instantiation_id, - name: None, - connective: TypeConnective::Instantiation { - template, - arguments, - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: span.clone(), - }); - instantiation_id -} - -fn template_arguments_exact_match(lhs: &[TemplateArgument], rhs: &[TemplateArgument]) -> bool { - lhs.len() == rhs.len() - && lhs - .iter() - .zip(rhs.iter()) - .all(|(lhs, rhs)| lhs.parameter == rhs.parameter && lhs.value == rhs.value) -} - -fn direct_invocation_input_decls( - dag: &Dag, - current: DeclarationId, - depth: usize, -) -> Option> { - if depth >= 32 { - return None; - } - match &dag.declaration(current).connective { - TypeConnective::Arrow { inputs, .. } => Some(inputs.clone()), - TypeConnective::Conj { children } => Some(children.iter().map(|child| child.ty).collect()), - TypeConnective::Instantiation { template, .. } => { - direct_invocation_input_decls(dag, *template, depth + 1) - } - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => { - direct_invocation_input_decls(dag, *next, depth + 1) - } - TypeConnective::Atom(AtomPayload::UnresolvedIdentifier(_)) - | TypeConnective::Atom(AtomPayload::TypeParam(_)) - | TypeConnective::Atom(AtomPayload::Literal(_)) - | TypeConnective::Disj { .. } - | TypeConnective::Cardinality(_) => None, - } -} - -fn lower_record_literal_expr( - fields: &[crate::parse::SurfaceRecordField], - span: &SourceSpan, - dag: &mut Dag, - scope: &HashMap, - callable_scope: &CallableScope, - symbols: &HashMap, - expected_decl: Option, -) -> PortId { - let Some(target_decl) = expected_decl else { - return unresolved_port( - dag, - Diagnostic::ResolveError { - name: "record literals require an expected record type at this position" - .to_string(), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - }, - ); - }; - let Some(conj_id) = walk_to_conj_decl(dag, target_decl) else { - return unresolved_port( - dag, - Diagnostic::ResolveError { - name: "record literal does not have an expected record type at this position" - .to_string(), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - }, - ); - }; - let expected_fields: Vec<(String, DeclarationId)> = match &dag.declaration(conj_id).connective { - TypeConnective::Conj { children } => children - .iter() - .map(|child| (child.label.clone(), child.ty)) - .collect(), - _ => unreachable!("walk_to_conj_decl returned non-Conj"), - }; - let mut seen_record_fields = HashSet::new(); - for field in fields { - if !seen_record_fields.insert(field.name.clone()) { - return unresolved_port( - dag, - Diagnostic::ResolveError { - name: format!("record literal repeats field `{}`", field.name), - span: field.span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - }, - ); - } - } - for field in fields { - if !expected_fields - .iter() - .any(|(label, _)| *label == field.name) - { - return unresolved_port( - dag, - Diagnostic::ResolveError { - name: format!( - "record literal has field `{}` but the expected type has no such field", - field.name - ), - span: field.span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - }, - ); - } - } - let mut inputs = Vec::with_capacity(expected_fields.len()); - for (label, field_ty) in expected_fields { - let Some(field) = fields.iter().find(|field| field.name == label) else { - return unresolved_port( - dag, - Diagnostic::ResolveError { - name: format!( - "record literal is missing required field `{label}` for the expected type" - ), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - }, - ); - }; - inputs.push(lower_expr( - &field.value, - dag, - scope, - callable_scope, - symbols, - Some(field_ty), - )); - } - lower_constructor_invocation(dag, target_decl, inputs, span.clone()) -} - -fn lower_variant_record_expr( - expr: VariantRecordExprRef<'_>, - dag: &mut Dag, - scope: &HashMap, - callable_scope: &CallableScope, - symbols: &HashMap, - expected_decl: Option, -) -> PortId { - let Some(variant_decl) = resolve_expected_variant_constructor(dag, expected_decl, expr.target) - else { - return unresolved_port( - dag, - Diagnostic::ResolveError { - name: format!( - "named constructor `{}` requires an expected sum type whose variants include `{}`", - expr.target, expr.target - ), - span: expr.span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("LoweringDiagnostic"), - }, - ); - }; - let Some(expected_fields) = - variant_payload_fields_for_lowering(dag, variant_decl, expected_decl) - else { - return unresolved_port( - dag, - Diagnostic::ResolveError { - name: format!( - "named constructor `{}` does not lower to a record payload shape", - expr.target - ), - span: expr.span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - }, - ); - }; - let mut seen_payload_fields = HashSet::new(); - for field in expr.fields { - if !seen_payload_fields.insert(field.name.clone()) { - return unresolved_port( - dag, - Diagnostic::ResolveError { - name: format!( - "named constructor `{}` repeats payload field `{}`", - expr.target, field.name - ), - span: field.span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - }, - ); - } - } - for field in expr.fields { - if !expected_fields - .iter() - .any(|(label, _)| label == &field.name) - { - return unresolved_port( - dag, - Diagnostic::ResolveError { - name: format!( - "named constructor `{}` has field `{}` but the payload has no such field", - expr.target, field.name - ), - span: field.span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - }, - ); - } - } - let mut inputs = Vec::with_capacity(expected_fields.len()); - for (label, field_ty) in expected_fields { - let Some(field) = expr.fields.iter().find(|field| field.name == label) else { - return unresolved_port( - dag, - Diagnostic::ResolveError { - name: format!( - "named constructor `{}` is missing required payload field `{label}`", - expr.target - ), - span: expr.span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - }, - ); - }; - inputs.push(lower_expr( - &field.value, - dag, - scope, - callable_scope, - symbols, - Some(field_ty), - )); - } - lower_constructor_invocation(dag, variant_decl, inputs, expr.span.clone()) -} - -fn lower_list_literal_expr( - elements: &[SurfaceExpr], - span: &SourceSpan, - dag: &mut Dag, - scope: &HashMap, - callable_scope: &CallableScope, - symbols: &HashMap, - expected_decl: Option, -) -> PortId { - let empty_decl = match symbols.get("empty").copied() { - Some(id) => id, - None => { - return unresolved_port( - dag, - Diagnostic::ResolveError { - name: "std `empty` constructor is unavailable while lowering a list literal" - .to_string(), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - }, - ); - } - }; - let singleton_decl = match symbols.get("singleton").copied() { - Some(id) => id, - None => { - return unresolved_port( - dag, - Diagnostic::ResolveError { - name: - "std `singleton` constructor is unavailable while lowering a list literal" - .to_string(), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - }, - ); - } - }; - let cons_decl = match symbols.get("cons").copied() { - Some(id) => id, - None => { - return unresolved_port( - dag, - Diagnostic::ResolveError { - name: "std `cons` constructor is unavailable while lowering a list literal" - .to_string(), - span: span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "LoweringDiagnostic", - ), - }, - ); - } - }; - - if elements.is_empty() { - return lower_constructor_invocation(dag, empty_decl, Vec::new(), span.clone()); - } - - let element_expected = expected_decl.and_then(|decl| list_element_type(dag, decl)); - let mut element_ports: Vec = elements - .iter() - .map(|element| { - lower_expr( - element, - dag, - scope, - callable_scope, - symbols, - element_expected, - ) - }) - .collect(); - let last = element_ports - .pop() - .expect("non-empty list literal has a last element"); - let mut current = lower_constructor_invocation( - dag, - singleton_decl, - vec![last], - surface_expr_span(elements.last().expect("non-empty")).clone(), - ); - while let Some(head) = element_ports.pop() { - current = lower_constructor_invocation(dag, cons_decl, vec![head, current], span.clone()); - } - current -} - -fn resolve_expected_variant_constructor( - dag: &mut Dag, - expected_decl: Option, - variant_name: &str, -) -> Option { - let expected_decl = expected_decl?; - let expected_span = dag.declaration(expected_decl).span.clone(); - let disj_id = walk_to_disj_decl(dag, expected_decl)?; - let variant_decl = match &dag.declaration(disj_id).connective { - TypeConnective::Disj { variants } => variants - .iter() - .find(|variant| variant.label == variant_name) - .map(|variant| variant.ty)?, - _ => unreachable!("walk_to_disj_decl returned non-Disj"), - }; - let instantiation_arguments = match &dag.declaration(expected_decl).connective { - TypeConnective::Instantiation { arguments, .. } if !arguments.is_empty() => { - Some(arguments.clone()) - } - _ => None, - }; - match instantiation_arguments { - Some(arguments) => { - let instantiation_id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: instantiation_id, - name: None, - connective: TypeConnective::Instantiation { - template: variant_decl, - arguments, - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: expected_span, - }); - Some(instantiation_id) - } - _ => Some(variant_decl), - } -} - -fn producer_of(dag: &Dag, port: PortId) -> Option { - dag.port(port).produced_by -} - -/// X1.a-aware recursive-call detection. -/// -/// `dag` and `symbols` are required so PathCall callees that resolve to -/// the current function (e.g. via `data fns: Fns = { rec: }; -/// fns.rec(arg)`) are caught — without that resolution, mutual recursion -/// through a `data`-binding indirection would bypass the decidability -/// gate (P4). -fn is_recursive( - expr: &SurfaceExpr, - self_name: &str, - dag: &Dag, - symbols: &HashMap, -) -> bool { - match expr { - SurfaceExpr::Literal { .. } - | SurfaceExpr::Var { .. } - | SurfaceExpr::Path { .. } - | SurfaceExpr::List { .. } => false, - SurfaceExpr::Call { target, args, .. } => { - if target == self_name { - return true; - } - args.iter() - .any(|a| is_recursive(a, self_name, dag, symbols)) - } - SurfaceExpr::VariantRecord { fields, .. } => fields - .iter() - .any(|field| is_recursive(&field.value, self_name, dag, symbols)), - SurfaceExpr::Operator { args, .. } => args - .iter() - .any(|a| is_recursive(a, self_name, dag, symbols)), - SurfaceExpr::If { - cond, - then_branch, - else_branch, - .. - } => { - is_recursive(cond, self_name, dag, symbols) - || is_recursive(then_branch, self_name, dag, symbols) - || is_recursive(else_branch, self_name, dag, symbols) - } - SurfaceExpr::Match { - scrutinee, arms, .. - } => { - is_recursive(scrutinee, self_name, dag, symbols) - || arms - .iter() - .any(|arm| is_recursive(&arm.body, self_name, dag, symbols)) - } - SurfaceExpr::Lambda { body, .. } => is_recursive(body, self_name, dag, symbols), - SurfaceExpr::Record { fields, .. } => fields - .iter() - .any(|f| is_recursive(&f.value, self_name, dag, symbols)), - SurfaceExpr::Map { entries, .. } => entries - .iter() - .any(|e| is_recursive(&e.value, self_name, dag, symbols)), - SurfaceExpr::PathCall { segments, args, .. } => { - // X1.a static path-call: resolve segments[0] through symbols - // → data binding's ValueBody → leaf FieldValue::Reference. - // If the leaf decl's name equals self_name, this PathCall is - // a recursive self-call (mutual or direct via data-binding - // indirection) and must trigger the decidability gate - // (INVARIANTS P4). - if let Some(leaf_decl) = resolve_path_to_function_decl(segments, dag, symbols) { - if dag.declaration(leaf_decl).name.as_deref() == Some(self_name) { - return true; - } - } - args.iter() - .any(|a| is_recursive(a, self_name, dag, symbols)) - } - } -} - -/// Partial termination analysis: every recursive self-call's first argument -/// must be `first_param - `. The surface shape is now -/// `SurfaceExpr::Operator { op: ArithmeticOp::Sub, args: [Var(first_param), -/// Literal(Int(k))] }` — the operator dispatch is committed at parse -/// time via `OperatorKind::Arithmetic(ArithmeticOp::Sub)`, so this check -/// is structural rather than a string match against `target == "-"`. -/// -/// **On the remaining string comparisons** (`target == self_name`, -/// `name == first_param`): these are *not* name-based dispatch. Both -/// sides are parser-stage identifier strings from a single parse tree -/// reaching `lower_fn_item_expr_body` together — no declaration table -/// lookup, no cross-module symbol resolution. `self_name` is the fn's -/// declared name and `first_param` is its parameter name, both -/// captured from `SurfaceItem::Fn` immediately above on the call -/// stack. The strings on the other side (`SurfaceExpr::Call.target`, -/// `SurfaceExpr::Var.name`) are raw parser tokens from the body of -/// that same fn. -/// -/// The alternative shape — comparing typed `NodeId`/`PortId` edges — -/// isn't available at M1(2.7) because the `BindNode` that owns this -/// function and its param ports doesn't exist yet: this analysis runs -/// *inside* `lower_fn_item_expr_body`, before the Bind is pushed onto -/// the node graph. A future post-lowering `DescentEvidence` lens -/// would walk the emitted Loop/Transform graph by typed id, but -/// that's a substrate extension, not a bridge to dissolve here. -#[derive(Debug, Clone, Default)] -struct StructuralBindingInfo { - whole_payload_recursive: bool, - recursive_fields: HashSet, -} - -fn bind_named_pattern_fields( - info: &StructuralBindingInfo, - fields: &[SurfacePatternField], - out: &mut HashMap, -) { - for field in fields { - let mut binding_info = StructuralBindingInfo::default(); - if info.recursive_fields.contains(&field.name) { - binding_info.whole_payload_recursive = true; - } - out.insert(field.binding.clone(), binding_info); - } -} - -fn descent_provable( - expr: &SurfaceExpr, - dag: &Dag, - first_param_decl: DeclarationId, - self_name: &str, - first_param: &str, - bindings: &HashMap, - symbols: &HashMap, -) -> bool { - match expr { - SurfaceExpr::Literal { .. } | SurfaceExpr::Var { .. } | SurfaceExpr::Path { .. } => true, - SurfaceExpr::Call { target, args, .. } => { - if target == self_name { - match args.first() { - None => false, - Some(first_arg) => { - if !is_strictly_smaller(first_arg, first_param, bindings) { - return false; - } - args.iter().skip(1).all(|a| { - descent_provable( - a, - dag, - first_param_decl, - self_name, - first_param, - bindings, - symbols, - ) - }) - } - } - } else { - args.iter().all(|a| { - descent_provable( - a, - dag, - first_param_decl, - self_name, - first_param, - bindings, - symbols, - ) - }) - } - } - SurfaceExpr::VariantRecord { fields, .. } => fields.iter().all(|field| { - descent_provable( - &field.value, - dag, - first_param_decl, - self_name, - first_param, - bindings, - symbols, - ) - }), - SurfaceExpr::Operator { args, .. } => args.iter().all(|a| { - descent_provable( - a, - dag, - first_param_decl, - self_name, - first_param, - bindings, - symbols, - ) - }), - SurfaceExpr::If { - cond, - then_branch, - else_branch, - .. - } => { - descent_provable( - cond, - dag, - first_param_decl, - self_name, - first_param, - bindings, - symbols, - ) && descent_provable( - then_branch, - dag, - first_param_decl, - self_name, - first_param, - bindings, - symbols, - ) && descent_provable( - else_branch, - dag, - first_param_decl, - self_name, - first_param, - bindings, - symbols, - ) - } - SurfaceExpr::Match { - scrutinee, arms, .. - } => { - if !descent_provable( - scrutinee, - dag, - first_param_decl, - self_name, - first_param, - bindings, - symbols, - ) { - return false; - } - - let scrutinee_is_first_param = matches!( - scrutinee.as_ref(), - SurfaceExpr::Var { name, .. } if name == first_param - ); - // Nested-match descent: an inner `match` whose scrutinee is a - // structural binding from an outer arm (e.g. `match xs { Cons(t1) - // => match t1 { Cons(t2) => f(t2) } }`) is itself unpacking a - // strict sub-value of the recursive type. The inner pattern's - // bindings are therefore also strict sub-values, so register them - // against the same recursive declaration the outer match did. - let scrutinee_is_recursive_binding = matches!( - scrutinee.as_ref(), - SurfaceExpr::Var { name, .. } - if bindings - .get(name) - .is_some_and(|info| info.whole_payload_recursive) - ); - let scrutinee_unpacks_recursive_type = - scrutinee_is_first_param || scrutinee_is_recursive_binding; - arms.iter().all(|arm| { - let mut arm_bindings = bindings.clone(); - if scrutinee_unpacks_recursive_type { - match &arm.pattern { - SurfacePattern::VariantWith { name, binding, .. } => { - if let Some(info) = - structural_binding_info_for_variant(dag, first_param_decl, name) - { - arm_bindings.insert(binding.clone(), info); - } - } - SurfacePattern::VariantFields { name, fields, .. } => { - if let Some(info) = - structural_binding_info_for_variant(dag, first_param_decl, name) - { - bind_named_pattern_fields(&info, fields, &mut arm_bindings); - } - } - SurfacePattern::BareVariant { .. } => {} - } - } - descent_provable( - &arm.body, - dag, - first_param_decl, - self_name, - first_param, - &arm_bindings, - symbols, - ) - }) - } - SurfaceExpr::Lambda { body, .. } => descent_provable( - body, - dag, - first_param_decl, - self_name, - first_param, - bindings, - symbols, - ), - SurfaceExpr::Record { fields, .. } => fields.iter().all(|f| { - descent_provable( - &f.value, - dag, - first_param_decl, - self_name, - first_param, - bindings, - symbols, - ) - }), - SurfaceExpr::List { elements, .. } => elements.iter().all(|element| { - descent_provable( - element, - dag, - first_param_decl, - self_name, - first_param, - bindings, - symbols, - ) - }), - SurfaceExpr::Map { entries, .. } => entries.iter().all(|entry| { - descent_provable( - &entry.value, - dag, - first_param_decl, - self_name, - first_param, - bindings, - symbols, - ) - }), - SurfaceExpr::PathCall { segments, args, .. } => { - // X1.a static path-call: if the resolved leaf decl name - // equals `self_name`, this is a recursive self-call via - // data-binding indirection. Apply the same descent rule - // as `Call`: first arg must be strictly smaller, all - // other args descent-provable. Otherwise treat as - // non-recursive — recurse into args only. - let path_resolves_to_self = resolve_path_to_function_decl(segments, dag, symbols) - .is_some_and(|leaf| dag.declaration(leaf).name.as_deref() == Some(self_name)); - if path_resolves_to_self { - match args.first() { - None => false, - Some(first_arg) => { - if !is_strictly_smaller(first_arg, first_param, bindings) { - return false; - } - args.iter().skip(1).all(|a| { - descent_provable( - a, - dag, - first_param_decl, - self_name, - first_param, - bindings, - symbols, - ) - }) - } - } - } else { - args.iter().all(|a| { - descent_provable( - a, - dag, - first_param_decl, - self_name, - first_param, - bindings, - symbols, - ) - }) - } - } - } -} - -fn is_strictly_smaller( - expr: &SurfaceExpr, - first_param: &str, - bindings: &HashMap, -) -> bool { - if is_structurally_smaller(expr, bindings) { - return true; - } - let SurfaceExpr::Operator { op, args, .. } = expr else { - return false; - }; - // Structural check — no string match. Subtract is one of the four - // arithmetic variants. - if !matches!(op, OperatorKind::Arithmetic(ArithmeticOp::Sub)) || args.len() != 2 { - return false; - } - let lhs_is_param = matches!( - &args[0], - SurfaceExpr::Var { name, .. } if name == first_param - ); - // RHS must be a positive integer literal AND within the descent-evidence - // carrier's `positive_amount_from_i64` materialization range - // (`dag.rs:1031-1032`, `1..=MAX_PEANO_MATERIALIZATION`). Without the - // upper cap, the termination prover would accept `f(n - 257)` while - // the per-call descent producer fails to materialize a - // `PositiveDescentAmount` and falls back to `SubValueUnknown` — - // parallel-authority split-brain (the same single-authority discipline - // Slice 3's ClusterDescentChecker fix established). - let rhs_in_descent_range = matches!( - &args[1], - SurfaceExpr::Literal { - value: SurfaceLiteral::Int(v), .. - } if v.parse::().ok().is_some_and(|n| (1..=MAX_PEANO_MATERIALIZATION).contains(&n)) - ); - lhs_is_param && rhs_in_descent_range -} - -fn is_structurally_smaller( - expr: &SurfaceExpr, - bindings: &HashMap, -) -> bool { - match expr { - SurfaceExpr::Var { name, .. } => bindings - .get(name) - .is_some_and(|info| info.whole_payload_recursive), - SurfaceExpr::Path { segments, .. } if segments.len() == 2 => bindings - .get(&segments[0]) - .is_some_and(|info| info.recursive_fields.contains(&segments[1])), - _ => false, - } -} - -fn structural_binding_info_for_variant( - dag: &Dag, - first_param_decl: DeclarationId, - variant_name: &str, -) -> Option { - let disj_id = walk_to_disj_decl(dag, first_param_decl)?; - let variant_decl_id = match &dag.declaration(disj_id).connective { - TypeConnective::Disj { variants } => variants - .iter() - .find(|variant| variant.label == variant_name) - .map(|variant| variant.ty)?, - _ => unreachable!("walk_to_disj_decl returned non-Disj"), - }; - let TypeConnective::Conj { children } = &dag.declaration(variant_decl_id).connective else { - return None; - }; - - let mut info = StructuralBindingInfo::default(); - if children.len() == 1 - && children[0].label.as_str() == "_0" - && recursive_decl_equivalent(dag, children[0].ty, first_param_decl) - { - info.whole_payload_recursive = true; - } - for child in children { - if recursive_decl_equivalent(dag, child.ty, first_param_decl) { - info.recursive_fields.insert(child.label.clone()); - } - } - Some(info) -} - -fn recursive_decl_equivalent(dag: &Dag, lhs: DeclarationId, rhs: DeclarationId) -> bool { - canonical_decl_for_descent(dag, lhs) == canonical_decl_for_descent(dag, rhs) -} - -fn canonical_decl_for_descent(dag: &Dag, start: DeclarationId) -> DeclarationId { - let mut current = start; - for _ in 0..32 { - match &dag.declaration(current).connective { - TypeConnective::Instantiation { template, .. } => current = *template, - TypeConnective::Atom(AtomPayload::ResolvedByStructure(next)) - | TypeConnective::Atom(AtomPayload::ResolvedByName(next)) => current = *next, - _ => return current, - } - } - current -} - -#[derive(Clone, Copy)] -struct FunctionSurfaceInfo<'a> { - name: &'a str, - decl_id: DeclarationId, - params: &'a [SurfaceParam], - body: &'a SurfaceExpr, -} - -#[derive(Clone)] -struct CallableSurfaceInfo<'a> { - name: &'a str, - body: &'a SurfaceExpr, - shadowed_names: Vec, - is_data_lambda: bool, -} - -/// `is_first` must parallel `items` (from [`collect_symbols`]). Only -/// first-authority surface items participate — same filter as -/// [`lower_bodies_phase`]'s body lowering loop — so duplicate `fn` -/// declarations cannot overwrite the mutual-recursion call graph with a -/// later duplicate's body. -fn compute_mutually_recursive( - items: &[SurfaceItem], - dag: &Dag, - symbols: &HashMap, - is_first: &[bool], -) -> MutualRecursionPlans { - debug_assert_eq!(items.len(), is_first.len()); - let mut order: Vec = Vec::new(); - let mut fn_infos: HashMap> = HashMap::new(); - let mut callable_infos: HashMap> = HashMap::new(); - let mut callable_symbols: HashMap = HashMap::new(); - for (idx, item) in items.iter().enumerate() { - if !is_first[idx] { - continue; - } - match item { - SurfaceItem::Fn { - name, params, body, .. - } => { - let Some(&decl_id) = symbols.get(name) else { - continue; - }; - order.push(decl_id); - fn_infos.insert( - decl_id, - FunctionSurfaceInfo { - name, - decl_id, - params, - body, - }, - ); - callable_infos.insert( - decl_id, - CallableSurfaceInfo { - name, - body, - shadowed_names: params.iter().map(|param| param.name.clone()).collect(), - is_data_lambda: false, - }, - ); - callable_symbols.insert(name.clone(), decl_id); - } - SurfaceItem::Data { - name, - body: - Some(SurfaceExpr::Lambda { - params, - body: lambda_body, - .. - }), - .. - } => { - let Some(&decl_id) = symbols.get(name) else { - continue; - }; - order.push(decl_id); - callable_infos.insert( - decl_id, - CallableSurfaceInfo { - name, - body: lambda_body, - shadowed_names: params.clone(), - is_data_lambda: true, - }, - ); - callable_symbols.insert(name.clone(), decl_id); - } - _ => {} - } - } - - let order_index: HashMap = order - .iter() - .enumerate() - .map(|(idx, decl_id)| (*decl_id, idx)) - .collect(); - let mut calls: HashMap> = HashMap::new(); - for decl_id in &order { - let Some(info) = callable_infos.get(decl_id) else { - continue; - }; - let mut callees = HashSet::new(); - let mut shadowed: HashSet = info.shadowed_names.iter().cloned().collect(); - collect_recursive_callees( - info.body, - &callable_symbols, - dag, - &mut shadowed, - &mut callees, - ); - let mut sorted_callees: Vec = callees.into_iter().collect(); - sorted_callees.sort_by_key(|callee| order_index.get(callee).copied().unwrap_or(usize::MAX)); - calls.insert(*decl_id, sorted_callees); - } - - let mut plans = MutualRecursionPlans::default(); - for members in strongly_connected_components(&order, &calls) { - let is_self_loop = members.len() == 1 - && calls - .get(&members[0]) - .is_some_and(|callees| callees.contains(&members[0])); - if members.len() == 1 && !is_self_loop { - continue; - } - let contains_data_lambda = members.iter().any(|member| { - callable_infos - .get(member) - .is_some_and(|info| info.is_data_lambda) - }); - if members.len() == 1 && !contains_data_lambda { - continue; - } - if contains_data_lambda { - let invalid = InvalidMutualCluster { - members: members - .iter() - .filter_map(|member| { - callable_infos.get(member).map(|info| info.name.to_string()) - }) - .collect(), - }; - for member in members { - plans.invalid_by_member.insert(member, invalid.clone()); - } - } else if let Some(per_member_positions) = - find_cluster_slot_assignment(&members, dag, &fn_infos, &callable_symbols, &calls) - { - let member_names: Vec = members - .iter() - .filter_map(|member| fn_infos.get(member).map(|info| info.name.to_string())) - .collect(); - let member_set: HashSet = members.iter().copied().collect(); - let recursive_edges = members - .iter() - .flat_map(|caller| { - calls - .get(caller) - .into_iter() - .flatten() - .copied() - .filter(|callee| member_set.contains(callee)) - .map(|callee| RecursiveEdge { - caller: *caller, - callee, - }) - }) - .collect(); - let cluster_index = plans.clusters.len(); - for member in &members { - plans.by_member.insert(*member, cluster_index); - } - plans.clusters.push(MutualClusterShape { - members, - member_names, - per_member_positions, - recursive_edges, - }); - } else { - let invalid = InvalidMutualCluster { - members: members - .iter() - .filter_map(|member| fn_infos.get(member).map(|info| info.name.to_string())) - .collect(), - }; - for member in members { - plans.invalid_by_member.insert(member, invalid.clone()); - } - } - } - plans -} - -fn strongly_connected_components( - order: &[DeclarationId], - calls: &HashMap>, -) -> Vec> { - let order_index: HashMap = order - .iter() - .enumerate() - .map(|(idx, decl_id)| (*decl_id, idx)) - .collect(); - let mut visited: HashSet = HashSet::new(); - let mut finish_order: Vec = Vec::new(); - - fn dfs( - node: DeclarationId, - calls: &HashMap>, - visited: &mut HashSet, - finish_order: &mut Vec, - ) { - if !visited.insert(node) { - return; - } - if let Some(callees) = calls.get(&node) { - for callee in callees { - dfs(*callee, calls, visited, finish_order); - } - } - finish_order.push(node); - } - - for decl_id in order { - dfs(*decl_id, calls, &mut visited, &mut finish_order); - } - - let mut reverse: HashMap> = - order.iter().map(|decl_id| (*decl_id, Vec::new())).collect(); - for (caller, callees) in calls { - for callee in callees { - reverse.entry(*callee).or_default().push(*caller); - } - } - - fn dfs_reverse( - node: DeclarationId, - reverse: &HashMap>, - assigned: &mut HashSet, - component: &mut Vec, - ) { - if !assigned.insert(node) { - return; - } - component.push(node); - if let Some(callers) = reverse.get(&node) { - for caller in callers { - dfs_reverse(*caller, reverse, assigned, component); - } - } - } - - let mut assigned: HashSet = HashSet::new(); - let mut components: Vec> = Vec::new(); - for decl_id in finish_order.into_iter().rev() { - if assigned.contains(&decl_id) { - continue; - } - let mut component = Vec::new(); - dfs_reverse(decl_id, &reverse, &mut assigned, &mut component); - component.sort_by_key(|member| order_index.get(member).copied().unwrap_or(usize::MAX)); - components.push(component); - } - components.sort_by_key(|component| { - component - .first() - .and_then(|member| order_index.get(member)) - .copied() - .unwrap_or(usize::MAX) - }); - components -} - -fn find_cluster_slot_assignment( - members: &[DeclarationId], - dag: &Dag, - fn_infos: &HashMap>, - function_symbols: &HashMap, - calls: &HashMap>, -) -> Option> { - if members.iter().any(|member| { - fn_infos - .get(member) - .map(|info| info.params.is_empty()) - .unwrap_or(true) - }) { - return None; - } - - fn search( - member_index: usize, - members: &[DeclarationId], - dag: &Dag, - fn_infos: &HashMap>, - function_symbols: &HashMap, - calls: &HashMap>, - assignment: &mut HashMap, - ) -> Option> { - if member_index == members.len() { - if validate_cluster_slot_assignment( - members, - dag, - fn_infos, - function_symbols, - calls, - assignment, - ) { - return Some(assignment.clone()); - } - return None; - } - - let member = &members[member_index]; - let info = fn_infos.get(member)?; - for slot in 0..info.params.len() { - assignment.insert(*member, slot); - if let Some(found) = search( - member_index + 1, - members, - dag, - fn_infos, - function_symbols, - calls, - assignment, - ) { - return Some(found); - } - } - assignment.remove(member); - None - } - - search( - 0, - members, - dag, - fn_infos, - function_symbols, - calls, - &mut HashMap::new(), - ) -} - -fn validate_cluster_slot_assignment( - members: &[DeclarationId], - dag: &Dag, - fn_infos: &HashMap>, - function_symbols: &HashMap, - calls: &HashMap>, - assignment: &HashMap, -) -> bool { - let cluster_members: HashSet = members.iter().copied().collect(); - members.iter().all(|member| { - let Some(info) = fn_infos.get(member) else { - return false; - }; - let Some(&slot) = assignment.get(member) else { - return false; - }; - let TypeConnective::Arrow { inputs, .. } = &dag.declaration(info.decl_id).connective else { - return false; - }; - let Some(param_decl) = inputs.get(slot).copied() else { - return false; - }; - let Some(param) = info.params.get(slot) else { - return false; - }; - let recursive_callees: HashSet = calls - .get(member) - .into_iter() - .flatten() - .copied() - .filter(|callee| cluster_members.contains(callee)) - .collect(); - let initial_shadowed: HashSet = info - .params - .iter() - .map(|surface_param| surface_param.name.clone()) - .collect(); - ClusterDescentChecker { - dag, - current_param_decl: param_decl, - current_param: ¶m.name, - recursive_callees: &recursive_callees, - assignment, - function_symbols, - } - .expr(info.body, &HashMap::new(), &initial_shadowed) - }) -} - -struct ClusterDescentChecker<'a> { - dag: &'a Dag, - current_param_decl: DeclarationId, - current_param: &'a str, - recursive_callees: &'a HashSet, - assignment: &'a HashMap, - function_symbols: &'a HashMap, -} - -impl ClusterDescentChecker<'_> { - fn expr( - &self, - expr: &SurfaceExpr, - bindings: &HashMap, - shadowed: &HashSet, - ) -> bool { - match expr { - SurfaceExpr::Literal { .. } | SurfaceExpr::Var { .. } | SurfaceExpr::Path { .. } => { - true - } - SurfaceExpr::Call { target, args, .. } => { - if !shadowed.contains(target) { - if let Some(&callee_decl) = self.function_symbols.get(target) { - if self.recursive_callees.contains(&callee_decl) { - let Some(&callee_slot) = self.assignment.get(&callee_decl) else { - return false; - }; - let Some(callee_arg) = args.get(callee_slot) else { - return false; - }; - if !is_strictly_smaller(callee_arg, self.current_param, bindings) { - return false; - } - } - } - } - args.iter().all(|arg| self.expr(arg, bindings, shadowed)) - } - SurfaceExpr::VariantRecord { fields, .. } => fields - .iter() - .all(|field| self.expr(&field.value, bindings, shadowed)), - SurfaceExpr::Operator { args, .. } => { - args.iter().all(|arg| self.expr(arg, bindings, shadowed)) - } - SurfaceExpr::If { - cond, - then_branch, - else_branch, - .. - } => { - self.expr(cond, bindings, shadowed) - && self.expr(then_branch, bindings, shadowed) - && self.expr(else_branch, bindings, shadowed) - } - SurfaceExpr::Match { - scrutinee, arms, .. - } => { - if !self.expr(scrutinee, bindings, shadowed) { - return false; - } - - let scrutinee_is_current_param = matches!( - scrutinee.as_ref(), - SurfaceExpr::Var { name, .. } if name == self.current_param - ); - // Same nested-match descent extension as `descent_provable`'s - // self-recursive arm (see comment there): an inner `match` - // whose scrutinee is itself a structural binding from an - // outer arm is unpacking a strict sub-value, so its - // pattern bindings inherit recursive-descent status. - // Without this mirror the cluster (SCC) authority enforces a - // stricter rule than the self-recursive authority — same - // termination fact, two acceptance rules. - let scrutinee_is_recursive_binding = matches!( - scrutinee.as_ref(), - SurfaceExpr::Var { name, .. } - if bindings - .get(name) - .is_some_and(|info| info.whole_payload_recursive) - ); - let scrutinee_unpacks_recursive_type = - scrutinee_is_current_param || scrutinee_is_recursive_binding; - arms.iter().all(|arm| { - let mut arm_bindings = bindings.clone(); - let mut arm_shadowed = shadowed.clone(); - for binding in pattern_binding_names(&arm.pattern) { - arm_shadowed.insert(binding.to_string()); - } - if scrutinee_unpacks_recursive_type { - match &arm.pattern { - SurfacePattern::VariantWith { name, binding, .. } => { - if let Some(info) = structural_binding_info_for_variant( - self.dag, - self.current_param_decl, - name, - ) { - arm_bindings.insert(binding.clone(), info); - } - } - SurfacePattern::VariantFields { name, fields, .. } => { - if let Some(info) = structural_binding_info_for_variant( - self.dag, - self.current_param_decl, - name, - ) { - bind_named_pattern_fields(&info, fields, &mut arm_bindings); - } - } - SurfacePattern::BareVariant { .. } => {} - } - } - self.expr(&arm.body, &arm_bindings, &arm_shadowed) - }) - } - SurfaceExpr::Lambda { params, body, .. } => { - let mut lambda_shadowed = shadowed.clone(); - lambda_shadowed.extend(params.iter().cloned()); - self.expr(body, bindings, &lambda_shadowed) - } - SurfaceExpr::Record { fields, .. } => fields - .iter() - .all(|field| self.expr(&field.value, bindings, shadowed)), - SurfaceExpr::List { elements, .. } => elements - .iter() - .all(|element| self.expr(element, bindings, shadowed)), - SurfaceExpr::Map { entries, .. } => entries - .iter() - .all(|entry| self.expr(&entry.value, bindings, shadowed)), - SurfaceExpr::PathCall { segments, args, .. } => { - // X1.a static path-call: resolve segments to a leaf - // top-level function decl. If the leaf is in this - // cluster's recursive-callee set, apply the same - // assigned-slot strict-descent check as the `Call` arm. - // Without this, mutual recursion via `data` indirection - // (e.g. `data fns: Fns = { a: f, b: g }; fn f(x) = - // fns.b(x); fn g(x) = fns.a(x)`) bypasses the cluster - // descent gate (P4). - if let Some(callee_decl) = - resolve_path_to_function_decl(segments, self.dag, self.function_symbols) - { - if self.recursive_callees.contains(&callee_decl) { - let Some(&callee_slot) = self.assignment.get(&callee_decl) else { - return false; - }; - let Some(callee_arg) = args.get(callee_slot) else { - return false; - }; - if !is_strictly_smaller(callee_arg, self.current_param, bindings) { - return false; - } - } - } - args.iter().all(|arg| self.expr(arg, bindings, shadowed)) - } - } - } -} - -fn collect_recursive_callees( - expr: &SurfaceExpr, - function_symbols: &HashMap, - dag: &Dag, - shadowed: &mut HashSet, - out: &mut HashSet, -) { - match expr { - SurfaceExpr::Literal { .. } | SurfaceExpr::Var { .. } | SurfaceExpr::Path { .. } => {} - SurfaceExpr::Call { target, args, .. } => { - if !shadowed.contains(target) { - if let Some(&callee_decl) = function_symbols.get(target) { - out.insert(callee_decl); - } - } - for a in args { - collect_recursive_callees(a, function_symbols, dag, shadowed, out); - } - } - SurfaceExpr::VariantRecord { fields, .. } => { - for field in fields { - collect_recursive_callees(&field.value, function_symbols, dag, shadowed, out); - } - } - SurfaceExpr::Operator { args, .. } => { - for a in args { - collect_recursive_callees(a, function_symbols, dag, shadowed, out); - } - } - SurfaceExpr::If { - cond, - then_branch, - else_branch, - .. - } => { - collect_recursive_callees(cond, function_symbols, dag, shadowed, out); - collect_recursive_callees(then_branch, function_symbols, dag, shadowed, out); - collect_recursive_callees(else_branch, function_symbols, dag, shadowed, out); - } - SurfaceExpr::Match { - scrutinee, arms, .. - } => { - collect_recursive_callees(scrutinee, function_symbols, dag, shadowed, out); - for arm in arms { - let mut arm_shadowed = shadowed.clone(); - for binding in pattern_binding_names(&arm.pattern) { - arm_shadowed.insert(binding.to_string()); - } - collect_recursive_callees(&arm.body, function_symbols, dag, &mut arm_shadowed, out); - } - } - SurfaceExpr::Lambda { params, body, .. } => { - let mut lambda_shadowed = shadowed.clone(); - lambda_shadowed.extend(params.iter().cloned()); - collect_recursive_callees(body, function_symbols, dag, &mut lambda_shadowed, out) - } - SurfaceExpr::Record { fields, .. } => { - for f in fields { - collect_recursive_callees(&f.value, function_symbols, dag, shadowed, out); - } - } - SurfaceExpr::List { elements, .. } => { - for element in elements { - collect_recursive_callees(element, function_symbols, dag, shadowed, out); - } - } - SurfaceExpr::Map { entries, .. } => { - for entry in entries { - collect_recursive_callees(&entry.value, function_symbols, dag, shadowed, out); - } - } - SurfaceExpr::PathCall { segments, args, .. } => { - // X1.a static path-call: resolve segments through the head's - // `data` ValueBody to a leaf `FieldValue::Reference(decl_id)` - // and insert that decl into the recursive-callee set. Without - // this, mutual recursion via a data-binding indirection - // bypasses the recursive-edge graph (P4). - let head_shadowed = segments.first().is_some_and(|head| shadowed.contains(head)); - if !head_shadowed { - if let Some(leaf_decl) = - resolve_path_to_function_decl(segments, dag, function_symbols) - { - out.insert(leaf_decl); - } - } - for a in args { - collect_recursive_callees(a, function_symbols, dag, shadowed, out); - } - } - } -} - -#[cfg(test)] -mod tests { - use super::*; - use crate::dag::Declaration; - use crate::dag::Field; - use crate::dag::LiteralBits; - use crate::dag::PortState; - use crate::diagnostics::positive_interval_width_unit_count_requires_nonnegative_units_literal_message; - use crate::diagnostics::{Diagnostic, SourceSpan}; - use std::collections::HashMap; - - fn test_span() -> SourceSpan { - SourceSpan::new("lower_decl_ref_test.v3", 0, 0) - } - - fn test_v4_std_patch_span() -> SourceSpan { - SourceSpan::new("src/v4/std/patch.dag", 0, 100) - } - - fn push_test_declaration( - dag: &mut Dag, - name: &str, - connective: TypeConnective, - meta_tag: Option, - ) -> DeclarationId { - let id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id, - name: Some(name.to_string()), - connective, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: test_span(), - }); - id - } - - fn push_anonymous_test_declaration(dag: &mut Dag, connective: TypeConnective) -> DeclarationId { - let id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id, - name: None, - connective, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: test_span(), - }); - id - } - - #[test] - fn structural_map_field_lowers_values_with_active_substitution() { - let mut dag = Dag::new(); - let int_id = dag.declaration_by_name("Int").expect("Int").id; - let string_id = dag.declaration_by_name("String").expect("String").id; - let map_id = dag.declaration_by_name("Map").expect("Map").id; - let map_key_param = dag.declaration(map_id).type_params[0]; - let map_value_param = dag.declaration(map_id).type_params[1]; - let c_param = push_anonymous_test_declaration( - &mut dag, - TypeConnective::Atom(AtomPayload::TypeParam("C".to_string())), - ); - let map_string_c = push_anonymous_test_declaration( - &mut dag, - TypeConnective::Instantiation { - template: map_id, - arguments: vec![ - TemplateArgument { - parameter: map_key_param, - value: string_id, - }, - TemplateArgument { - parameter: map_value_param, - value: c_param, - }, - ], - }, - ); - let mut subst = LowerSubstStack::default(); - subst.push(vec![TemplateArgument { - parameter: c_param, - value: int_id, - }]); - let span = test_span(); - let lowered = lower_structural_field_value( - "aggregate_int", - "table", - &SurfaceExpr::Map { - entries: vec![crate::parse_surface::SurfaceMapEntry { - key: "one".to_string(), - key_span: span.clone(), - value: SurfaceExpr::Literal { - value: SurfaceLiteral::Int("1".to_string()), - span: span.clone(), - }, - span: span.clone(), - }], - span: span.clone(), - }, - map_string_c, - &subst, - &HashMap::new(), - &mut dag, - None, - &span, - &HashSet::new(), - ) - .expect("Map value should lower under C := Int"); - let crate::dag::FieldValue::Map(map) = lowered else { - panic!("expected structural map field, got {lowered:?}"); - }; - assert_eq!( - map.entries(), - &[( - "one".to_string(), - crate::dag::FieldValue::Literal(LiteralBits::Int("1".to_string())) - )] - ); - - let k_param = push_anonymous_test_declaration( - &mut dag, - TypeConnective::Atom(AtomPayload::TypeParam("K".to_string())), - ); - let v_param = push_anonymous_test_declaration( - &mut dag, - TypeConnective::Atom(AtomPayload::TypeParam("V".to_string())), - ); - let map_k_v = push_anonymous_test_declaration( - &mut dag, - TypeConnective::Instantiation { - template: map_id, - arguments: vec![ - TemplateArgument { - parameter: map_key_param, - value: k_param, - }, - TemplateArgument { - parameter: map_value_param, - value: v_param, - }, - ], - }, - ); - let mut key_value_subst = LowerSubstStack::default(); - key_value_subst.push(vec![ - TemplateArgument { - parameter: k_param, - value: string_id, - }, - TemplateArgument { - parameter: v_param, - value: int_id, - }, - ]); - let lowered = lower_structural_field_value( - "aggregate_int", - "table", - &SurfaceExpr::Map { - entries: vec![crate::parse_surface::SurfaceMapEntry { - key: "one".to_string(), - key_span: span.clone(), - value: SurfaceExpr::Literal { - value: SurfaceLiteral::Int("1".to_string()), - span: span.clone(), - }, - span: span.clone(), - }], - span: span.clone(), - }, - map_k_v, - &key_value_subst, - &HashMap::new(), - &mut dag, - None, - &span, - &HashSet::new(), - ) - .expect("Map value should lower under K := String, V := Int"); - let crate::dag::FieldValue::Map(map) = lowered else { - panic!("expected structural map field, got {lowered:?}"); - }; - assert_eq!( - map.entries(), - &[( - "one".to_string(), - crate::dag::FieldValue::Literal(LiteralBits::Int("1".to_string())) - )] - ); - } - - #[test] - fn enforce_non_negative_unit_count_payload_rejects_negative_literal() { - std::thread::Builder::new() - .stack_size(8 * 1024 * 1024) - .spawn(|| { - let dag = Dag::new(); - let piw = dag - .declaration_by_name("PositiveIntervalWidth") - .expect("bootstrap PositiveIntervalWidth"); - let TypeConnective::Disj { variants } = &piw.connective else { - panic!("PositiveIntervalWidth must be a sum"); - }; - let unit_count_payload_ty = variants - .iter() - .find(|v| v.label == "UnitCount") - .expect("UnitCount variant") - .ty; - let span = test_span(); - let payload = vec![crate::dag::FieldValue::Literal(LiteralBits::Int( - "-1".to_string(), - ))]; - let err = enforce_non_negative_unit_count_payload( - &dag, - unit_count_payload_ty, - &payload, - &span, - ) - .expect_err("negative units must be rejected"); - let Diagnostic::ResolveError { name, .. } = err else { - panic!("expected ResolveError; got {err:?}"); - }; - assert_eq!( - name, - positive_interval_width_unit_count_requires_nonnegative_units_literal_message( - "-1" - ) - ); - }) - .expect("spawn enforce_non_negative_unit_count_payload test") - .join() - .expect("enforce_non_negative_unit_count_payload test panicked"); - } - - fn surface_named_type(name: &str) -> SurfaceType { - SurfaceType::Named { - name: name.to_string(), - span: test_span(), - } - } - - fn dimension_record_module(file: &str, type_params: &[&str]) -> SurfaceModule { - SurfaceModule { - items: vec![SurfaceItem::TypeRecord { - name: "Dimension".to_string(), - type_params: type_params - .iter() - .map(|param| (*param).to_string()) - .collect(), - fields: vec![SurfaceField { - name: "value".to_string(), - ty: surface_named_type("Carrier"), - }], - span: SourceSpan::new(file, 0, 1), - }], - } - } - - fn dimension_alias_module(file: &str) -> SurfaceModule { - SurfaceModule { - items: vec![SurfaceItem::TypeAlias { - name: "Dimension".to_string(), - type_params: vec!["Unit".to_string(), "Carrier".to_string()], - nominal_opaque: false, - target: surface_named_type("Carrier"), - refinement: None, - span: SourceSpan::new(file, 0, 1), - }], - } - } - - #[test] - fn non_std_dimension_record_does_not_receive_unit_phantom_bridge() { - let mut dag = Dag::empty(); - let module = dimension_record_module("user_dimension.dag", &["Unit", "Carrier"]); - - lower_into(&mut dag, &module); - - let dimension = dag - .declarations() - .iter() - .find(|decl| decl.name.as_deref() == Some("Dimension")) - .expect("test Dimension declaration allocated"); - assert!( - dimension.phantom_params.is_empty(), - "non-std Dimension declarations must not receive the std unit phantom convention" - ); - assert!( - dag.diagnostics().is_empty(), - "non-std Dimension should lower as an ordinary record without bridge diagnostics: {:?}", - dag.diagnostics().iter().collect::>() - ); - } - - #[test] - fn malformed_std_dimension_bridge_fails_closed() { - let mut dag = Dag::empty(); - let module = dimension_record_module(DIMENSION_STD_AUTHORITY_FILE, &["Carrier"]); - - lower_into(&mut dag, &module); - - let dimension = dag - .declarations() - .iter() - .find(|decl| decl.name.as_deref() == Some("Dimension")) - .expect("test Dimension declaration allocated"); - assert!(dimension.phantom_params.is_empty()); - assert!( - dag.diagnostics().iter().any(|(_, diagnostic)| { - matches!( - diagnostic, - Diagnostic::ResolveError { name, .. } - if name.contains("invalid std `Dimension` phantom bridge") - ) - }), - "malformed std Dimension must emit a fail-closed diagnostic: {:?}", - dag.diagnostics().iter().collect::>() - ); - } - - #[test] - fn non_record_std_dimension_bridge_fails_closed() { - let mut dag = Dag::empty(); - let module = dimension_alias_module(DIMENSION_STD_AUTHORITY_FILE); - - lower_into(&mut dag, &module); - - assert!( - dag.diagnostics().iter().any(|(_, diagnostic)| { - matches!( - diagnostic, - Diagnostic::ResolveError { name, .. } - if name.contains("must be a record declaration") - ) - }), - "std Dimension as a non-record type form must fail closed: {:?}", - dag.diagnostics().iter().collect::>() - ); - } - - #[test] - fn aliased_expected_type_accepts_same_typed_declaration_reference() { - let mut dag = Dag::new(); - let span = test_span(); - let style_type = push_test_declaration( - &mut dag, - "LocalStyle", - TypeConnective::Conj { - children: Vec::new(), - }, - None, - ); - let aliased_style = push_test_declaration( - &mut dag, - "AliasedLocalStyle", - TypeConnective::Instantiation { - template: style_type, - arguments: Vec::new(), - }, - None, - ); - let style_value = push_test_declaration( - &mut dag, - "local_style_value", - TypeConnective::Instantiation { - template: style_type, - arguments: Vec::new(), - }, - Some(style_type), - ); - let mut symbols = HashMap::new(); - symbols.insert("local_style_value".to_string(), style_value); - - let lowered = lower_structural_field_value( - "local_contract_value", - "style", - &SurfaceExpr::Var { - name: "local_style_value".to_string(), - span: span.clone(), - }, - aliased_style, - &LowerSubstStack::default(), - &symbols, - &mut dag, - None, - &span, - &HashSet::new(), - ); - - assert_eq!( - lowered, - Some(crate::dag::FieldValue::Reference(style_value)), - "alias-wrapped expected types should still accept same-typed declaration refs" - ); - } - - #[test] - fn declaration_ref_resolution_does_not_fall_back_to_global_names() { - let mut dag = Dag::new(); - let global_only = push_test_declaration( - &mut dag, - "global_only", - TypeConnective::Conj { - children: Vec::new(), - }, - None, - ); - - let resolved = resolve_field_value_as_declaration_ref( - &SurfaceExpr::Var { - name: "global_only".to_string(), - span: test_span(), - }, - &HashMap::new(), - &dag, - ); - - assert_eq!( - dag.declaration(global_only).name.as_deref(), - Some("global_only"), - "test setup should create the global declaration" - ); - assert_eq!( - resolved, None, - "declaration-ref lowering must fail closed when the name is not in scope" - ); - } - - #[test] - fn identifier_sweep_marks_name_keyed_resolution_provenance() { - let mut dag = Dag::new(); - let user_start = dag.declarations().len(); - let stub = alloc_identifier_stub(&mut dag, "Int", &test_span()); - - resolve_pending_identifiers_strict(&mut dag, user_start); - - assert!( - matches!( - dag.declaration(stub).connective, - TypeConnective::Atom(AtomPayload::ResolvedByName(_)) - ), - "strict identifier sweep must preserve name-fallback provenance on repaired stubs" - ); - } - - #[test] - fn fn_body_lowering_reports_non_arrow_seed_invariant_violation() { - let span = test_span(); - let return_type = SurfaceType::Named { - name: "Int".to_string(), - span: span.clone(), - }; - let body = SurfaceExpr::Literal { - value: SurfaceLiteral::Int("1".into()), - span: span.clone(), - }; - let module = SurfaceModule { - items: vec![SurfaceItem::Fn { - name: "bad_seed".to_string(), - type_params: Vec::new(), - params: Vec::new(), - return_type: return_type.clone(), - body: body.clone(), - span: span.clone(), - }], - }; - let mut dag = Dag::new(); - let (symbols, _is_first) = collect_symbols_phase(&mut dag, &module.items); - let mut mutual_state = MutualRecursionState::default(); - - lower_fn_item_expr_body( - "bad_seed", - &[], - &return_type, - &body, - &mut dag, - HashMap::new(), - &symbols, - &MutualRecursionPlans::default(), - &mut mutual_state, - ); - - assert!( - dag.diagnostics().iter().any(|(_, diagnostic)| { - matches!( - diagnostic, - Diagnostic::ResolveError { name, .. } - if name.contains("function declaration `bad_seed`") - && name.contains("seed_function_signatures_phase did not produce an Arrow connective") - && name.contains("observed connective") - ) - }), - "non-Arrow fn declarations at body lowering must fail closed with a diagnostic" - ); - } - - #[test] - fn unresolved_fn_return_annotation_leaves_bind_value_unresolved() { - let dag = match crate::compile_to_dag("fn bad() -> MissingType = 1", "bad_return.v3") { - Err(crate::CompileError::Semantic(dag)) => dag, - other => panic!("unknown return type must fail semantically, got {other:?}"), - }; - - let bind = dag - .nodes() - .iter() - .find_map(|node| match node { - Behavior::Bind(bind) if bind.name == "bad" => Some(bind), - _ => None, - }) - .expect("lowering should still emit the function Bind for inspection"); - let bind_port = dag.port(bind.value); - assert_eq!( - bind_port.state(), - &PortState::Unresolved, - "failed return annotation must leave the function Bind value unresolved" - ); - assert_eq!( - bind_port.value_type(), - None, - "failed return annotation must not fabricate a TypeShape on the Bind value" - ); - assert_ne!( - bind_port.value_type(), - dag.int_shape().as_ref(), - "failed return annotation must not expose the Int sentinel" - ); - assert_ne!( - bind_port.value_type(), - Some(&TypeShape::new(dag.declarations()[0].id)), - "failed return annotation must not expose DeclarationId(0) as a sentinel" - ); - - let value = dag - .nodes() - .iter() - .find_map(|node| match node { - Behavior::Value(value) if value.data == LiteralBits::Int("1".to_string()) => { - Some(value) - } - _ => None, - }) - .expect("literal function body should still lower to a ValueNode"); - assert_ne!( - value.output, bind.value, - "invalid return annotation must use a distinct diagnostic result port" - ); - - let diagnostic = dag - .diagnostics() - .get(bind.value) - .expect("Bind value unresolved state must carry the return annotation diagnostic"); - assert!( - matches!( - diagnostic, - Diagnostic::ResolveError { name, .. } if name == "unknown type `MissingType`" - ), - "expected unknown return type diagnostic on Bind value, got {diagnostic:?}" - ); - } - - #[test] - fn unresolved_fn_return_annotation_does_not_poison_borrowed_body_port() { - let dag = - match crate::compile_to_dag("fn bad(x: Int) -> MissingType = x", "bad_return_alias.v3") - { - Err(crate::CompileError::Semantic(dag)) => dag, - other => panic!("unknown return type must fail semantically, got {other:?}"), - }; - - let bind = dag - .nodes() - .iter() - .find_map(|node| match node { - Behavior::Bind(bind) if bind.name == "bad" => Some(bind), - _ => None, - }) - .expect("lowering should still emit the function Bind for inspection"); - let [param_port] = bind.params.as_slice() else { - panic!("test function should lower exactly one parameter"); - }; - - assert_ne!( - bind.value, *param_port, - "invalid return annotation must materialize a function-owned result port" - ); - assert_eq!( - dag.port(bind.value).state(), - &PortState::Unresolved, - "failed return annotation must leave the function Bind value unresolved" - ); - assert_eq!( - dag.port(bind.value).value_type(), - None, - "failed return annotation must not fabricate a TypeShape on the Bind value" - ); - - let int_shape = dag - .int_shape() - .expect("bootstrap should expose the Int type shape"); - assert_eq!( - dag.port(*param_port).state(), - &PortState::Resolved(int_shape), - "return annotation failure must not poison the borrowed parameter port" - ); - assert!( - dag.diagnostics().get(*param_port).is_none(), - "return annotation diagnostic must stay on the function result port" - ); - - let diagnostic = dag - .diagnostics() - .get(bind.value) - .expect("Bind value unresolved state must carry the return annotation diagnostic"); - assert!( - matches!( - diagnostic, - Diagnostic::ResolveError { name, .. } if name == "unknown type `MissingType`" - ), - "expected unknown return type diagnostic on Bind value, got {diagnostic:?}" - ); - } - - #[test] - fn unresolved_fn_return_annotation_does_not_poison_outer_scope_body_port() { - let dag = match crate::compile_to_dag( - "let y: Int = 1\nfn bad() -> MissingType = y", - "bad_return_outer_alias.v3", - ) { - Err(crate::CompileError::Semantic(dag)) => dag, - other => panic!("unknown return type must fail semantically, got {other:?}"), - }; - - let mut bad_bind = None; - let mut outer_bind = None; - for node in dag.nodes() { - if let Behavior::Bind(bind) = node { - match bind.name.as_str() { - "bad" => bad_bind = Some(bind), - "y" => outer_bind = Some(bind), - _ => {} - } - } - } - let bad_bind = bad_bind.expect("lowering should still emit the bad function Bind"); - let outer_bind = outer_bind.expect("test setup should lower the outer y binding"); - - assert_ne!( - bad_bind.value, outer_bind.value, - "invalid return annotation must not reuse an outer binding as the function result" - ); - assert_eq!( - dag.port(bad_bind.value).state(), - &PortState::Unresolved, - "failed return annotation must leave the function Bind value unresolved" - ); - assert!( - dag.port(bad_bind.value).value_type().is_none(), - "failed return annotation must not fabricate a TypeShape on the Bind value" - ); - - let int_shape = dag - .int_shape() - .expect("bootstrap should expose the Int type shape"); - assert_eq!( - dag.port(outer_bind.value).state(), - &PortState::Resolved(int_shape), - "return annotation failure must not poison the outer binding port" - ); - assert!( - dag.diagnostics().get(outer_bind.value).is_none(), - "return annotation diagnostic must stay on the function result port" - ); - - let diagnostic = dag - .diagnostics() - .get(bad_bind.value) - .expect("Bind value unresolved state must carry the return annotation diagnostic"); - assert!( - matches!( - diagnostic, - Diagnostic::ResolveError { name, .. } if name == "unknown type `MissingType`" - ), - "expected unknown return type diagnostic on Bind value, got {diagnostic:?}" - ); - } - - /// Receipt for `Declaration::specialization_parent` on specialized anonymous - /// `Disj` copies: the walker in `emit::rust_target` depends on this edge shape. - #[test] - fn specialize_decl_for_lowering_anonymous_disj_sets_specialization_parent() { - let mut dag = Dag::new(); - let t_param = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id: t_param, - name: None, - connective: TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: test_span(), - }); - let int_id = dag.int_shape().expect("bootstrap Int").declaration; - let template_id = push_test_declaration( - &mut dag, - "WithT", - TypeConnective::Disj { - variants: vec![Field { - label: "V".to_string(), - ty: t_param, - }], - }, - None, - ); - let specialized = specialize_decl_for_lowering( - &mut dag, - template_id, - &[TemplateArgument { - parameter: t_param, - value: int_id, - }], - 0, - ); - assert_ne!( - specialized, template_id, - "substituting T into the variant payload should allocate a fresh Disj" - ); - let anon = dag.declaration(specialized); - assert!(anon.name.is_none()); - assert_eq!( - anon.specialization_parent, - Some(template_id), - "Rust emit recovers the template enum via specialization_parent" - ); - let TypeConnective::Disj { variants } = &anon.connective else { - panic!("expected specialized Disj"); - }; - assert_eq!(variants.len(), 1); - assert_eq!(variants[0].ty, int_id); - } - - /// `dsl/std/render.dag` `repeat_string_loop` returns on `remaining <= 0` — empty for n∈{0,−}. - #[test] - fn fold_repeat_string_semantics_non_positive_n_empty() { - assert_eq!(fold_repeat_string_semantics("hi", 0).as_deref(), Some("")); - assert_eq!(fold_repeat_string_semantics("hi", -1).as_deref(), Some("")); - } - - #[test] - fn fold_repeat_string_semantics_gate_witness() { - assert_eq!(fold_repeat_string_semantics("x", 3).as_deref(), Some("xxx")); - } - - #[test] - fn fold_repeat_string_semantics_excess_n_fail_closed() { - assert!( - fold_repeat_string_semantics("x", super::REPEAT_STRING_FOLD_MAX_COUNT + 1).is_none() - ); - } - - #[test] - fn extract_config_patch_layer_operands_accepts_base_and_patch() { - let span = test_span(); - let args = vec![SurfaceExpr::Record { - fields: vec![ - SurfaceRecordField { - name: "base".to_string(), - value: SurfaceExpr::Var { - name: "defaults".to_string(), - span: span.clone(), - }, - span: span.clone(), - }, - SurfaceRecordField { - name: "patch".to_string(), - value: SurfaceExpr::Var { - name: "layer0".to_string(), - span: span.clone(), - }, - span: span.clone(), - }, - ], - span: span.clone(), - }]; - let (base, patch) = extract_config_patch_layer_operands(&args).expect("named operands"); - assert!(matches!(base, SurfaceExpr::Var { name, .. } if name == "defaults")); - assert!(matches!(patch, SurfaceExpr::Var { name, .. } if name == "layer0")); - } - - #[test] - fn extract_config_patch_layer_operands_rejects_wrong_labels() { - let span = test_span(); - let args = vec![SurfaceExpr::Record { - fields: vec![SurfaceRecordField { - name: "outer".to_string(), - value: SurfaceExpr::Var { - name: "x".to_string(), - span: span.clone(), - }, - span: span.clone(), - }], - span: span.clone(), - }]; - assert!(extract_config_patch_layer_operands(&args).is_none()); - } - - #[test] - fn extract_config_patch_layer_operands_rejects_missing_base_or_patch() { - let span = test_span(); - let only_base = vec![SurfaceExpr::Record { - fields: vec![SurfaceRecordField { - name: "base".to_string(), - value: SurfaceExpr::Var { - name: "defaults".to_string(), - span: span.clone(), - }, - span: span.clone(), - }], - span: span.clone(), - }]; - assert!(extract_config_patch_layer_operands(&only_base).is_none()); - } - - #[test] - fn config_patch_record_decl_materializes_for_empty_config_conj() { - let mut dag = Dag::new(); - let empty_cfg = push_anonymous_test_declaration( - &mut dag, - TypeConnective::Conj { - children: Vec::new(), - }, - ); - let field_patch_t_param = push_anonymous_test_declaration( - &mut dag, - TypeConnective::Atom(AtomPayload::TypeParam("PatchT".to_string())), - ); - let field_patch_tpl = { - let id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id, - name: Some("FieldPatch".to_string()), - connective: TypeConnective::Conj { - children: Vec::new(), - }, - type_params: vec![field_patch_t_param], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: test_v4_std_patch_span(), - }); - id - }; - let _ = field_patch_tpl; - let patch_decl = config_patch_record_decl_for_config(&mut dag, empty_cfg, &test_span()) - .expect("empty Config"); - let TypeConnective::Conj { children } = &dag.declaration(patch_decl).connective else { - panic!("expected patch record Conj"); - }; - assert!(children.is_empty()); - } - - #[test] - fn surface_field_access_expr_projects_call_site_carrier() { - let span = test_span(); - let carrier = SurfaceExpr::Var { - name: "defaults".to_string(), - span: span.clone(), - }; - let access = surface_field_access_expr(&carrier, "line_length", &span).expect("path"); - assert!(matches!( - access, - SurfaceExpr::Path { segments, .. } - if segments == ["defaults", "line_length"] - )); - } - - fn list_instantiation_element(dag: &Dag, list_inst: DeclarationId) -> DeclarationId { - let TypeConnective::Instantiation { arguments, .. } = - &dag.declaration(list_inst).connective - else { - panic!("expected List instantiation"); - }; - arguments[0].value - } - - /// Nested `List` config fields must materialize as `FieldPatch>`, not - /// `FieldPatch>`, when `ConfigPatchRecord` is applied to `Config`. - #[test] - fn materialize_config_patch_record_substitutes_nested_list_type_param() { - let mut dag = Dag::new(); - let int_id = dag.int_shape().expect("bootstrap Int").declaration; - let list_tpl = dag.declaration_by_name("List").expect("bootstrap List").id; - let list_tpl_param = template_param_id(&dag, list_tpl, 0).expect("List type param"); - - let t_param = push_anonymous_test_declaration( - &mut dag, - TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - ); - - let list_t = push_anonymous_test_declaration( - &mut dag, - TypeConnective::Instantiation { - template: list_tpl, - arguments: vec![TemplateArgument { - parameter: list_tpl_param, - value: t_param, - }], - }, - ); - - let config_tpl = { - let id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id, - name: Some("Cfg".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "magics".to_string(), - ty: list_t, - }], - }, - type_params: vec![t_param], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: test_span(), - }); - id - }; - - let field_patch_t_param = push_anonymous_test_declaration( - &mut dag, - TypeConnective::Atom(AtomPayload::TypeParam("PatchT".to_string())), - ); - let field_patch_tpl = { - let id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id, - name: Some("FieldPatch".to_string()), - connective: TypeConnective::Conj { - children: Vec::new(), - }, - type_params: vec![field_patch_t_param], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: test_v4_std_patch_span(), - }); - id - }; - - let mut symbols = HashMap::new(); - symbols.insert("Cfg".to_string(), config_tpl); - symbols.insert("Int".to_string(), int_id); - symbols.insert("FieldPatch".to_string(), field_patch_tpl); - - let span = test_span(); - let args = [TypeAngleArg::TypeExpr { - ty: Box::new(SurfaceType::Parameterized { - name: "Cfg".to_string(), - args: vec![TypeAngleArg::TypeExpr { - ty: Box::new(SurfaceType::Named { - name: "Int".to_string(), - span: span.clone(), - }), - }], - span: span.clone(), - }), - }]; - - let patch_conj = materialize_config_patch_record_connective( - &mut dag, - &symbols, - &HashMap::new(), - &args, - &span, - ) - .expect("Cfg is a record"); - - let TypeConnective::Conj { children } = patch_conj else { - panic!("expected patch Conj"); - }; - assert_eq!(children.len(), 1); - let patch_magics = children[0].ty; - let inner = { - let TypeConnective::Instantiation { arguments, .. } = - &dag.declaration(patch_magics).connective - else { - panic!("expected FieldPatch instantiation"); - }; - arguments[0].value - }; - let list_inner = list_instantiation_element(&dag, inner); - assert_eq!( - list_inner, int_id, - "patch field must be FieldPatch>, not FieldPatch>" - ); - assert_ne!( - list_inner, t_param, - "must not fall back to unspecialized List type param" - ); - } - - /// `ConfigPatchRecord` must substitute through a config type alias (`BlackCfg = Cfg`), - /// not only through direct `ConfigPatchRecord>`. - #[test] - fn materialize_config_patch_record_substitutes_through_config_type_alias() { - let mut dag = Dag::new(); - let int_id = dag.int_shape().expect("bootstrap Int").declaration; - let list_tpl = dag.declaration_by_name("List").expect("bootstrap List").id; - let list_tpl_param = template_param_id(&dag, list_tpl, 0).expect("List type param"); - let t_param = push_anonymous_test_declaration( - &mut dag, - TypeConnective::Atom(AtomPayload::TypeParam("T".to_string())), - ); - let list_t = push_anonymous_test_declaration( - &mut dag, - TypeConnective::Instantiation { - template: list_tpl, - arguments: vec![TemplateArgument { - parameter: list_tpl_param, - value: t_param, - }], - }, - ); - let cfg_tpl = { - let id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id, - name: Some("Cfg".to_string()), - connective: TypeConnective::Conj { - children: vec![Field { - label: "magics".to_string(), - ty: list_t, - }], - }, - type_params: vec![t_param], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: test_span(), - }); - id - }; - let cfg_int = push_anonymous_test_declaration( - &mut dag, - TypeConnective::Instantiation { - template: cfg_tpl, - arguments: vec![TemplateArgument { - parameter: t_param, - value: int_id, - }], - }, - ); - let field_patch_t_param = push_anonymous_test_declaration( - &mut dag, - TypeConnective::Atom(AtomPayload::TypeParam("PatchT".to_string())), - ); - let field_patch_tpl = { - let id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id, - name: Some("FieldPatch".to_string()), - connective: TypeConnective::Conj { - children: Vec::new(), - }, - type_params: vec![field_patch_t_param], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: test_v4_std_patch_span(), - }); - id - }; - let config_patch_param = push_anonymous_test_declaration( - &mut dag, - TypeConnective::Atom(AtomPayload::TypeParam("Config".to_string())), - ); - let config_patch_record_tpl = { - let id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id, - name: Some("ConfigPatchRecord".to_string()), - connective: TypeConnective::Conj { - children: Vec::new(), - }, - type_params: vec![config_patch_param], - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: test_v4_std_patch_span(), - }); - id - }; - - let mut symbols = HashMap::new(); - symbols.insert("Cfg".to_string(), cfg_tpl); - symbols.insert("BlackCfg".to_string(), cfg_int); - symbols.insert("Int".to_string(), int_id); - symbols.insert("FieldPatch".to_string(), field_patch_tpl); - symbols.insert("ConfigPatchRecord".to_string(), config_patch_record_tpl); - - let span = test_span(); - let args = [TypeAngleArg::TypeExpr { - ty: Box::new(SurfaceType::Named { - name: "BlackCfg".to_string(), - span: span.clone(), - }), - }]; - - let patch_conj = materialize_config_patch_record_connective( - &mut dag, - &symbols, - &HashMap::new(), - &args, - &span, - ) - .expect("alias-bound config lowers to a record"); - - let TypeConnective::Conj { children } = patch_conj else { - panic!("expected patch Conj"); - }; - let patch_magics = children[0].ty; - let inner = { - let TypeConnective::Instantiation { arguments, .. } = - &dag.declaration(patch_magics).connective - else { - panic!("expected FieldPatch instantiation"); - }; - arguments[0].value - }; - let list_inner = list_instantiation_element(&dag, inner); - assert_eq!(list_inner, int_id); - } - - #[test] - fn config_patch_record_materialization_requires_imported_template_name() { - let mut dag = Dag::new(); - let int_id = dag.int_shape().expect("bootstrap Int").declaration; - let field_patch_tpl = dag.declaration_by_name("FieldPatch"); - let field_patch_tpl = if let Some(decl) = field_patch_tpl { - decl.id - } else { - push_anonymous_test_declaration( - &mut dag, - TypeConnective::Conj { - children: Vec::new(), - }, - ) - }; - let mut symbols = HashMap::new(); - symbols.insert("Int".to_string(), int_id); - symbols.insert("FieldPatch".to_string(), field_patch_tpl); - // Deliberately omit `ConfigPatchRecord` from symbols — surface spelling alone must not run - // the projection hook. - - let span = test_span(); - let ty = SurfaceType::Parameterized { - name: "ConfigPatchRecord".to_string(), - args: vec![TypeAngleArg::TypeExpr { - ty: Box::new(SurfaceType::Named { - name: "Int".to_string(), - span: span.clone(), - }), - }], - span: span.clone(), - }; - - assert!( - !surface_parameterized_name_resolves_to_template( - &dag, - &symbols, - &HashMap::new(), - "ConfigPatchRecord", - "ConfigPatchRecord", - ), - "unimported surface name must not match the patch template" - ); - - let connective = type_to_connective(&ty, &symbols, &HashMap::new(), &mut dag); - assert!( - matches!( - connective, - TypeConnective::Instantiation { .. } - | TypeConnective::Atom(AtomPayload::UnresolvedIdentifier(_)) - ), - "expected ordinary instantiation/stub, not materialized patch Conj, got {connective:?}" - ); - assert!( - !matches!(connective, TypeConnective::Conj { .. }), - "must not materialize without imported ConfigPatchRecord template" - ); - } - - #[test] - fn surface_parameterized_name_requires_v4_std_patch_authority() { - let mut dag = Dag::new(); - let homograph = { - let id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id, - name: Some("ConfigPatchRecord".to_string()), - connective: TypeConnective::Conj { - children: Vec::new(), - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: test_span(), - }); - id - }; - let canonical = { - let id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id, - name: Some("ConfigPatchRecord".to_string()), - connective: TypeConnective::Conj { - children: Vec::new(), - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: test_v4_std_patch_span(), - }); - id - }; - let mut symbols = HashMap::new(); - symbols.insert("ConfigPatchRecord".to_string(), homograph); - assert!( - !surface_parameterized_name_resolves_to_template( - &dag, - &symbols, - &HashMap::new(), - "ConfigPatchRecord", - "ConfigPatchRecord", - ), - "same-named non-patch.dag declaration must not authorize projection" - ); - symbols.insert("ConfigPatchRecord".to_string(), canonical); - assert!(surface_parameterized_name_resolves_to_template( - &dag, - &symbols, - &HashMap::new(), - "ConfigPatchRecord", - "ConfigPatchRecord", - )); - } - - #[test] - fn callable_is_v4_std_patch_config_patch_layer_rejects_homograph() { - let mut dag = Dag::new(); - let patch_span = test_v4_std_patch_span(); - let homograph = { - let id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id, - name: Some("config_patch_layer".to_string()), - connective: TypeConnective::Arrow { - inputs: Vec::new(), - output: dag.int_shape().expect("Int").declaration, - body: ArrowBody::NoBody, - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: test_span(), - }); - id - }; - let canonical = { - let id = dag.alloc_declaration_id(); - dag.push_declaration(Declaration { - id, - name: Some("config_patch_layer".to_string()), - connective: TypeConnective::Arrow { - inputs: Vec::new(), - output: dag.int_shape().expect("Int").declaration, - body: ArrowBody::NoBody, - }, - type_params: Vec::new(), - phantom_params: Vec::new(), - meta_tag: None, - specialization_parent: None, - inhabits: None, - value_body: None, - refinement: None, - nominal_opacity: None, - span: patch_span.clone(), - }); - id - }; - assert!(!callable_is_v4_std_patch_config_patch_layer( - &dag, homograph - )); - assert!(callable_is_v4_std_patch_config_patch_layer(&dag, canonical)); - } -} diff --git a/src/v3/compiler/src/lower_helpers_generated.rs b/src/v3/compiler/src/lower_helpers_generated.rs deleted file mode 100644 index 840ef11333d..00000000000 --- a/src/v3/compiler/src/lower_helpers_generated.rs +++ /dev/null @@ -1,227 +0,0 @@ -// AUTO-GENERATED from `src/v3/lenses/lower_helpers.dag` via -// `emit_rust_module`. Regenerate instead of hand-editing. - -pub fn expr_span(p0: &parse_surface::SurfaceExpr) -> SourceByteSpan { - match p0 { - SurfaceExpr::Literal { - value: __e_value, - span: __e_span, - } => SourceByteSpan { - byte_start: (__e_span).byte_start, - byte_end: (__e_span).byte_end, - }, - SurfaceExpr::Var { - name: __e_name, - span: __e_span, - } => SourceByteSpan { - byte_start: (__e_span).byte_start, - byte_end: (__e_span).byte_end, - }, - SurfaceExpr::Path { - segments: __e_segments, - segment_spans: __e_segment_spans, - span: __e_span, - } => SourceByteSpan { - byte_start: (__e_span).byte_start, - byte_end: (__e_span).byte_end, - }, - SurfaceExpr::Call { - target: __e_target, - args: __e_args, - span: __e_span, - } => SourceByteSpan { - byte_start: (__e_span).byte_start, - byte_end: (__e_span).byte_end, - }, - SurfaceExpr::VariantRecord { - target: __e_target, - fields: __e_fields, - span: __e_span, - } => SourceByteSpan { - byte_start: (__e_span).byte_start, - byte_end: (__e_span).byte_end, - }, - SurfaceExpr::Operator { - op: __e_op, - args: __e_args, - span: __e_span, - } => SourceByteSpan { - byte_start: (__e_span).byte_start, - byte_end: (__e_span).byte_end, - }, - SurfaceExpr::Lambda { - params: __e_params, - body: __e_body, - span: __e_span, - } => SourceByteSpan { - byte_start: (__e_span).byte_start, - byte_end: (__e_span).byte_end, - }, - SurfaceExpr::If { - cond: __e_cond, - then_branch: __e_then_branch, - else_branch: __e_else_branch, - span: __e_span, - } => SourceByteSpan { - byte_start: (__e_span).byte_start, - byte_end: (__e_span).byte_end, - }, - SurfaceExpr::Match { - scrutinee: __e_scrutinee, - arms: __e_arms, - span: __e_span, - } => SourceByteSpan { - byte_start: (__e_span).byte_start, - byte_end: (__e_span).byte_end, - }, - SurfaceExpr::Record { - fields: __e_fields, - span: __e_span, - } => SourceByteSpan { - byte_start: (__e_span).byte_start, - byte_end: (__e_span).byte_end, - }, - SurfaceExpr::List { - elements: __e_elements, - span: __e_span, - } => SourceByteSpan { - byte_start: (__e_span).byte_start, - byte_end: (__e_span).byte_end, - }, - SurfaceExpr::Map { - entries: __e_entries, - span: __e_span, - } => SourceByteSpan { - byte_start: (__e_span).byte_start, - byte_end: (__e_span).byte_end, - }, - SurfaceExpr::PathCall { - segments: __e_segments, - segment_spans: __e_segment_spans, - args: __e_args, - span: __e_span, - } => SourceByteSpan { - byte_start: (__e_span).byte_start, - byte_end: (__e_span).byte_end, - }, - } -} -pub fn item_span(p0: &parse_surface::SurfaceItem) -> SourceByteSpan { - match p0 { - SurfaceItem::Let { - name: __i_name, - type_ann: __i_type_ann, - expr: __i_expr, - } => expr_span(__i_expr), - SurfaceItem::Fn { - name: __i_name, - type_params: __i_type_params, - params: __i_params, - return_type: __i_return_type, - body: __i_body, - span: __i_span, - } => SourceByteSpan { - byte_start: (__i_span).byte_start, - byte_end: (__i_span).byte_end, - }, - SurfaceItem::FnExternalBody { - name: __i_name, - type_params: __i_type_params, - params: __i_params, - return_type: __i_return_type, - body_span: __i_body_span, - span: __i_span, - } => SourceByteSpan { - byte_start: (__i_span).byte_start, - byte_end: (__i_span).byte_end, - }, - SurfaceItem::Data { - name: __i_name, - ty: __i_ty, - body: __i_body, - body_span: __i_body_span, - span: __i_span, - } => SourceByteSpan { - byte_start: (__i_span).byte_start, - byte_end: (__i_span).byte_end, - }, - SurfaceItem::Module { - path: __i_path, - span: __i_span, - } => SourceByteSpan { - byte_start: (__i_span).byte_start, - byte_end: (__i_span).byte_end, - }, - SurfaceItem::Import { - path: __i_path, - names: __i_names, - span: __i_span, - } => SourceByteSpan { - byte_start: (__i_span).byte_start, - byte_end: (__i_span).byte_end, - }, - SurfaceItem::TypeAtom { - name: __i_name, - type_params: __i_type_params, - span: __i_span, - } => SourceByteSpan { - byte_start: (__i_span).byte_start, - byte_end: (__i_span).byte_end, - }, - SurfaceItem::TypeRecord { - name: __i_name, - type_params: __i_type_params, - fields: __i_fields, - span: __i_span, - } => SourceByteSpan { - byte_start: (__i_span).byte_start, - byte_end: (__i_span).byte_end, - }, - SurfaceItem::TypeSum { - name: __i_name, - type_params: __i_type_params, - variants: __i_variants, - inhabits: __i_inhabits, - span: __i_span, - } => SourceByteSpan { - byte_start: (__i_span).byte_start, - byte_end: (__i_span).byte_end, - }, - SurfaceItem::TypeAlias { - name: __i_name, - type_params: __i_type_params, - nominal_opaque: __i_nominal_opaque, - target: __i_target, - refinement: __i_refinement, - span: __i_span, - } => SourceByteSpan { - byte_start: (__i_span).byte_start, - byte_end: (__i_span).byte_end, - }, - } -} -pub fn pattern_binding_names(p0: &parse_surface::SurfacePattern) -> Vec { - match p0 { - SurfacePattern::BareVariant { name: _, span: _ } => Vec::new(), - SurfacePattern::VariantWith { - name: __v_name, - binding: __v_binding, - span: __v_span, - } => vec![(__v_binding).clone()], - SurfacePattern::VariantFields { - name: __v_name, - fields: __v_fields, - span: __v_span, - } => pattern_field_bindings(__v_fields), - } -} -pub fn pattern_field_bindings(p0: &[parse_surface::SurfacePatternField]) -> Vec { - match p0 { - [] => Vec::new(), - [__list_head, __list_tail @ ..] => { - let mut __list = pattern_field_bindings(__list_tail); - __list.insert(0, ((__list_head).binding).clone()); - __list - } - } -} diff --git a/src/v3/compiler/src/memory_peak_cost.rs b/src/v3/compiler/src/memory_peak_cost.rs deleted file mode 100644 index e4a0603eb7c..00000000000 --- a/src/v3/compiler/src/memory_peak_cost.rs +++ /dev/null @@ -1,132 +0,0 @@ -//! Memory-peak composition for the symbolic cost lens (gate #94 — `memory_peak_cost_basis_demonstrated`). -//! -//! Work-style costs compose with `sequential` / `iterate` (time adds, loops multiply). Memory -//! **peak** over alternative control-flow paths uses **max**, not sum — see -//! `docs/design-lens-application-surface.md` §4.3 and -//! `docs/audit/t-user-authored-cost-basis-discipline-worked-examples.md` (worked example 2). -//! -//! This module is the interim **cost-lens-owned** Rust authority until class-5 bodies can name -//! memory-dimension folds in `v3.std.algebra` and until the `EnforcedApplication` fold consumes -//! `apply_lens(cost, …)` sites end-to-end (`docs/r3-program-plan.md` gate #91 consumer). - -use crate::dag::{dominates, max_path, SymbolicCost}; - -/// Peak memory across **alternative** control-flow possibilities (typically **branch arms**): -/// asymptotic **`max`/dominance** of the modeled arm peaks—the same **`dominant` → `max_path`** -/// basis used for branch sibling arms in `src/v3/lenses/cost.dag`. -/// -/// This is **not** work-style sequencing (`sequential` / sum along a single path). Separate -/// composition rules apply when allocations **overlap** in time (live-range overlap)—not modeled -/// here; callers encode overlap facts in the composed `SymbolicCost` before invoking this helper. -#[must_use] -pub fn compose_branch_memory_peak(a: SymbolicCost, b: SymbolicCost) -> SymbolicCost { - max_path(&[a, b]) -} - -/// Enforce-mode lens check: observed peak **exceeds** the user-declared budget. -/// -/// Aligns with `LensEnforcement.violates(declared_budget, projected)` (`src/v3/std/lens_application.dag`): -/// per substrate comment, **`violates` is true iff observed EXCEEDS the budget** — **reflexive** -/// dominance must **not** count as violation (equality is compliant). -/// -/// Under the **`SymbolicCost` partial order** ([`dominates`]), **`declared_budget` dominates -/// `observed_peak`** means the budget asymptotically **covers** the peak (budget is looser / -/// tying on the declared bound). **`!dominates(budget, peak)`** therefore means the contract is -/// not certified: **strict exceed** where comparable, and **fail-closed** wherever the order is -/// **incomparable** (distinct size variables without a dominance edge). -#[must_use] -pub fn memory_peak_enforcement_violates( - declared_budget: &SymbolicCost, - observed_peak: &SymbolicCost, -) -> bool { - !dominates(declared_budget, observed_peak) -} - -#[cfg(test)] -mod tests { - use super::*; - use crate::dag::{max_path, DegreeAtLeastTwo, PortId, SizeVariable}; - - fn var(p: PortId) -> SizeVariable { - // Mirrors `unnamed_size_variable` / absent `display_name`; substrate lists BOTH fields at - // `src/v3/std/algebra.dag` (`type SizeVariable { source_port display_name?: String }`). - SizeVariable { - source_port: p, - display_name: None, - } - } - - #[test] - fn compose_branch_memory_peak_delegates_to_max_path() { - // Pin the authoritative composition operator: branch / peak merges must not drift. - let p0 = PortId::test_raw(110); - let p1 = PortId::test_raw(111); - let a = SymbolicCost::LinearCost { _0: var(p0) }; - let b = SymbolicCost::LogCost { _0: var(p1) }; - assert_eq!( - compose_branch_memory_peak(a.clone(), b.clone()), - max_path(&[a, b]) - ); - } - - #[test] - fn enforcement_violates_when_peak_exceeds_budget() { - let p = PortId::test_raw(200); - let n = var(p); - let budget = SymbolicCost::LogCost { _0: n.clone() }; - let peak = SymbolicCost::LinearCost { _0: n }; - assert!(memory_peak_enforcement_violates(&budget, &peak)); - } - - #[test] - fn enforcement_clean_when_budget_covers_peak() { - let p = PortId::test_raw(201); - let n = var(p); - let budget = SymbolicCost::LinearCost { _0: n.clone() }; - let peak = SymbolicCost::LogCost { _0: n }; - assert!(!memory_peak_enforcement_violates(&budget, &peak)); - } - - #[test] - fn enforcement_clean_when_budget_ties_observed_peak_under_dominance() { - let p = PortId::test_raw(202); - let n = var(p); - let cost = SymbolicCost::LinearCost { _0: n.clone() }; - assert!( - !memory_peak_enforcement_violates(&cost, &SymbolicCost::LinearCost { _0: n }), - "reflexive asymptotic pairs must not violate (EXCEEDS is strict over = in the contract)" - ); - } - - #[test] - fn enforcement_violates_on_incomparable_size_variables_fail_closed() { - let a = SymbolicCost::LinearCost { - _0: var(PortId::test_raw(203)), - }; - let b = SymbolicCost::LinearCost { - _0: var(PortId::test_raw(204)), - }; - assert!( - memory_peak_enforcement_violates(&a, &b), - "incomparable `LinearCost` keys must not pass Enforce silently" - ); - } - - #[test] - fn branch_style_peak_over_two_quadratic_arms_normalizes_budget_sharpness_check() { - let p = PortId::test_raw(300); - let n = var(p); - let q = SymbolicCost::PolynomialCost { - var: n.clone(), - degree: DegreeAtLeastTwo::TWO, - }; - let peak_branch = compose_branch_memory_peak(q.clone(), q); - assert!( - memory_peak_enforcement_violates( - &SymbolicCost::LinearCost { _0: n.clone() }, - &peak_branch - ), - "O(n²) peak should exceed O(n) declared budget", - ); - } -} diff --git a/src/v3/compiler/src/omni_shape_b_openapi.rs b/src/v3/compiler/src/omni_shape_b_openapi.rs deleted file mode 100644 index 6d26c5606be..00000000000 --- a/src/v3/compiler/src/omni_shape_b_openapi.rs +++ /dev/null @@ -1,850 +0,0 @@ -//! Shape B OpenAPI and documentation demonstration helpers. -//! -//! OpenAPI and Markdown are deliberately not compiler emit targets: Shape B -//! artifacts are user-program outputs derived from a compiled DAG, while -//! `emit.rs` remains scoped to Shape A programming-language targets. This -//! module provides the narrow Rust-side receipt used by the R3 demo until the -//! equivalent `.dag` programs can own the artifact projections. -//! -//! P5 bridge bound: `project_openapi_yaml`, `project_markdown_documentation`, -//! `project_sql_ddl_schema`, and `project_rust_backend_service` are one fixture-scoped R3 -//! T-Omni-Shape-B receipt over `RestEndpointBinding` rows. They are not new -//! compiler targets and must not grow into a general backend framework. -//! Dissolution trigger: queued brief -//! `docs/briefs/r3-omni-openapi-backend-bridge-dissolution.md`. - -use std::collections::{BTreeMap, BTreeSet}; -use std::fmt::Write as _; - -use crate::dag::{ - Declaration, DeclarationId, FieldValue, HttpMethodScalar, LiteralBits, TypeConnective, - ValueBody, -}; -use crate::Dag; - -#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)] -pub struct RestRoute { - pub method: HttpMethodScalar, - pub path: String, - pub path_parameters: Vec, -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum ProjectOpenApiError { - MalformedOperation { declaration: String, detail: String }, -} - -#[derive(Debug, Clone, Copy)] -struct RestRouteSchema { - http_method: DeclarationId, - url_path_token: DeclarationId, -} - -pub fn extract_rest_routes(dag: &Dag) -> Result, ProjectOpenApiError> { - let rest_endpoint_binding = canonical_rest_endpoint_binding(dag); - let mut routes = BTreeSet::new(); - for decl in dag.declarations() { - let Some(ValueBody::List(rows)) = &decl.value_body else { - continue; - }; - let Some(schema) = rest_route_schema(dag, decl, rest_endpoint_binding)? else { - continue; - }; - for row in rows { - let fields = record_fields(row).ok_or_else(|| { - malformed( - decl.name.as_deref(), - "service operation rows must be records", - ) - })?; - let endpoint = record_field(fields, "endpoint").ok_or_else(|| { - malformed( - decl.name.as_deref(), - "service operation row missing `endpoint` field", - ) - })?; - let endpoint_fields = require_record( - decl.name.as_deref().unwrap_or(""), - "endpoint", - endpoint, - )?; - let method = parse_http_method( - dag, - schema, - decl.name.as_deref().unwrap_or(""), - record_field(endpoint_fields, "method").ok_or_else(|| { - malformed(decl.name.as_deref(), "endpoint missing `method` field") - })?, - )?; - let path = parse_path_template( - dag, - schema, - decl.name.as_deref().unwrap_or(""), - record_field(endpoint_fields, "path").ok_or_else(|| { - malformed(decl.name.as_deref(), "endpoint missing `path` field") - })?, - )?; - routes.insert(RestRoute { - method, - path: path.path, - path_parameters: path.parameters, - }); - } - } - Ok(routes) -} - -fn rest_route_schema( - dag: &Dag, - decl: &Declaration, - rest_endpoint_binding: Option, -) -> Result, ProjectOpenApiError> { - let Some(element) = list_element_type(dag, decl) else { - return Ok(None); - }; - let TypeConnective::Conj { children } = &dag.declaration(element).connective else { - return Ok(None); - }; - let Some(endpoint_field) = children.iter().find(|field| field.label == "endpoint") else { - return Ok(None); - }; - if Some(endpoint_field.ty) != rest_endpoint_binding { - return Ok(None); - } - let TypeConnective::Conj { children } = &dag.declaration(endpoint_field.ty).connective else { - return Ok(None); - }; - let Some(method_ty) = field_type(children, "method") else { - return Err(malformed( - decl.name.as_deref(), - "RestEndpointBinding missing `method` field", - )); - }; - let Some(path_ty) = field_type(children, "path") else { - return Err(malformed( - decl.name.as_deref(), - "RestEndpointBinding missing `path` field", - )); - }; - - let TypeConnective::Conj { children } = &dag.declaration(path_ty).connective else { - return Err(malformed( - decl.name.as_deref(), - "endpoint.path type must be a PathTemplate record", - )); - }; - let Some(tokens_ty) = field_type(children, "tokens") else { - return Err(malformed( - decl.name.as_deref(), - "PathTemplate missing `tokens` field", - )); - }; - let TypeConnective::Instantiation { - template, - arguments, - } = &dag.declaration(tokens_ty).connective - else { - return Err(malformed( - decl.name.as_deref(), - "PathTemplate.tokens must be a List", - )); - }; - if Some(*template) != dag.list_template() { - return Err(malformed( - decl.name.as_deref(), - "PathTemplate.tokens must use the canonical List template", - )); - } - let Some(url_path_token_ty) = arguments.first().map(|arg| arg.value) else { - return Err(malformed( - decl.name.as_deref(), - "PathTemplate.tokens missing element type", - )); - }; - - Ok(Some(RestRouteSchema { - http_method: method_ty, - url_path_token: url_path_token_ty, - })) -} - -fn canonical_rest_endpoint_binding(dag: &Dag) -> Option { - let mut matches = dag.declarations().iter().filter(|decl| { - decl.name.as_deref() == Some("RestEndpointBinding") - && decl.span.file == "src/v3/std/services.dag" - }); - let id = matches.next()?.id; - if matches.next().is_some() { - None - } else { - Some(id) - } -} - -fn list_element_type(dag: &Dag, decl: &Declaration) -> Option { - match &decl.connective { - TypeConnective::Instantiation { - template, - arguments, - } if Some(*template) == dag.list_template() => arguments.first().map(|arg| arg.value), - _ => None, - } -} - -pub fn project_openapi_yaml(dag: &Dag) -> Result { - let routes = extract_rest_routes(dag)?; - let mut out = String::from( - "openapi: 3.1.0\ninfo:\n title: GunBC generated service\n version: 0.1.0\npaths:\n", - ); - if routes.is_empty() { - out.push_str(" {}\n"); - return Ok(out); - } - - let mut routes_by_path: BTreeMap<&str, Vec<&RestRoute>> = BTreeMap::new(); - for route in &routes { - routes_by_path - .entry(route.path.as_str()) - .or_default() - .push(route); - } - - for (path, path_routes) in routes_by_path { - out.push_str(" "); - out.push_str(&yaml_quoted(path)); - out.push_str(":\n"); - for route in path_routes { - out.push_str(" "); - out.push_str(&route.method.token().to_ascii_lowercase()); - out.push_str(":\n operationId: "); - out.push_str(&yaml_plain_operation_id(route.method, &route.path)); - if !route.path_parameters.is_empty() { - out.push_str("\n parameters:\n"); - for parameter in &route.path_parameters { - append_path_parameter_yaml(&mut out, parameter); - } - } - out.push_str("\n responses:\n '200':\n description: OK\n"); - } - } - Ok(out) -} - -pub fn project_markdown_documentation(dag: &Dag) -> Result { - let routes = extract_rest_routes(dag)?; - let mut out = String::from( - "# GunBC generated service\n\n| Method | Path | Path parameters |\n| --- | --- | --- |\n", - ); - if routes.is_empty() { - out.push_str("| _none_ | _none_ | _none_ |\n"); - return Ok(out); - } - for route in routes { - out.push_str("| "); - out.push_str(&markdown_table_cell(route.method.token())); - out.push_str(" | "); - out.push_str(&markdown_code_span_table_cell(&route.path)); - out.push_str(" | "); - if route.path_parameters.is_empty() { - out.push_str("_none_"); - } else { - for (index, parameter) in route.path_parameters.iter().enumerate() { - if index > 0 { - out.push_str(", "); - } - out.push_str(&markdown_code_span_table_cell(parameter)); - } - } - out.push_str(" |\n"); - } - Ok(out) -} - -pub fn project_sql_ddl_schema(dag: &Dag) -> Result { - let routes = extract_rest_routes(dag)?; - let mut methods = BTreeSet::new(); - for route in &routes { - methods.insert(route.method); - } - - let mut out = String::from( - "-- GunBC generated service route schema.\n\ - -- Shape B SQL DDL projection; not a compiler target.\n\ - CREATE TABLE omni_service_routes (\n\ - method TEXT NOT NULL,\n\ - path_template TEXT NOT NULL,\n", - ); - if !methods.is_empty() { - out.push_str(" CHECK (method IN ("); - for (index, method) in methods.iter().enumerate() { - if index > 0 { - out.push_str(", "); - } - out.push_str(&sql_string_literal(method.token())); - } - out.push_str(")),\n"); - } - out.push_str( - " PRIMARY KEY (method, path_template)\n\ - );\n", - ); - if routes.is_empty() { - out.push_str("\n-- no routes declared\n"); - return Ok(out); - } - out.push_str("\nINSERT INTO omni_service_routes (method, path_template) VALUES\n"); - for (index, route) in routes.iter().enumerate() { - out.push_str(" ("); - out.push_str(&sql_string_literal(route.method.token())); - out.push_str(", "); - out.push_str(&sql_string_literal(&route.path)); - out.push(')'); - if index + 1 == routes.len() { - out.push_str(";\n"); - } else { - out.push_str(",\n"); - } - } - Ok(out) -} - -/// Emits the narrow runnable-backend side of the R3 omni OpenAPI demo. -/// -/// This is deliberately fixture-scoped bridge code. It consumes the same -/// canonical `RestRoute` projection as OpenAPI/Markdown to prove the full-stack -/// same-DAG property now, then dissolves via -/// `docs/briefs/r3-omni-openapi-backend-bridge-dissolution.md`. -pub fn project_rust_backend_service(dag: &Dag) -> Result { - let routes = extract_rest_routes(dag)?; - let mut out = String::from( - r#"use std::io::{Read, Write}; -use std::net::TcpListener; - -#[derive(Clone, Copy)] -struct Route { - method: &'static str, - path: &'static str, -} - -const ROUTES: &[Route] = &[ -"#, - ); - for route in &routes { - out.push_str(" Route { method: "); - out.push_str(&rust_string_literal(route.method.token())); - out.push_str(", path: "); - out.push_str(&rust_string_literal(&route.path)); - out.push_str(" },\n"); - } - out.push_str( - r#"]; - -fn route_status(method: &str, path: &str) -> u16 { - if ROUTES - .iter() - .any(|route| route.method == method && path_matches(route.path, path)) - { - 200 - } else { - 404 - } -} - -fn path_matches(template: &str, path: &str) -> bool { - let template = strip_leading_slash(template); - let path = strip_leading_slash(path); - let template_parts: Vec<_> = template.split('/').collect(); - let path_parts: Vec<_> = path.split('/').collect(); - if template_parts.len() != path_parts.len() { - return false; - } - template_parts - .iter() - .zip(path_parts.iter()) - .all(|(template_part, path_part)| segment_matches(template_part, path_part)) -} - -fn strip_leading_slash(value: &str) -> &str { - value.strip_prefix('/').unwrap_or(value) -} - -fn segment_matches(template: &str, path: &str) -> bool { - let mut remainder = path; - let mut rest = template; - while let Some(start) = rest.find('{') { - let literal = &rest[..start]; - if !remainder.starts_with(literal) { - return false; - } - remainder = &remainder[literal.len()..]; - let after_open = &rest[start + 1..]; - let Some(end) = after_open.find('}') else { - return false; - }; - let after_param = &after_open[end + 1..]; - if let Some(next_literal_start) = after_param.find('{') { - let next_literal = &after_param[..next_literal_start]; - if next_literal.is_empty() { - return false; - } - let Some(boundary) = remainder.find(next_literal) else { - return false; - }; - let param_value = &remainder[..boundary]; - if !slash_free_non_empty(param_value) { - return false; - } - remainder = &remainder[boundary..]; - rest = after_param; - } else { - if after_param.is_empty() { - return slash_free_non_empty(remainder); - } - let Some(value) = remainder.strip_suffix(after_param) else { - return false; - }; - return slash_free_non_empty(value); - } - } - remainder == rest -} - -fn slash_free_non_empty(value: &str) -> bool { - !value.is_empty() && !value.contains('/') -} - -fn respond(request: &str) -> String { - let request_line = request.lines().next().unwrap_or(""); - let mut parts = request_line.split_whitespace(); - let method = parts.next().unwrap_or(""); - let path = parts.next().unwrap_or(""); - let status = route_status(method, path); - let reason = if status == 200 { "OK" } else { "Not Found" }; - format!("HTTP/1.1 {status} {reason}\r\ncontent-length: 0\r\n\r\n") -} - -fn serve(addr: &str) -> std::io::Result<()> { - let listener = TcpListener::bind(addr)?; - for stream in listener.incoming() { - let mut stream = stream?; - let mut request = [0_u8; 2048]; - let bytes = stream.read(&mut request)?; - let response = respond(&String::from_utf8_lossy(&request[..bytes])); - stream.write_all(response.as_bytes())?; - } - Ok(()) -} - -fn main() { - let args: Vec = std::env::args().collect(); - match args.as_slice() { - [_, flag, method, path] if flag == "--probe" => { - println!("{}", route_status(method, path)); - } - [_, flag, addr] if flag == "--serve" => { - serve(addr).expect("serve backend"); - } - _ => { - for route in ROUTES { - println!("{} {}", route.method, route.path); - } - } - } -} -"#, - ); - Ok(out) -} - -fn append_path_parameter_yaml(out: &mut String, parameter: &str) { - out.push_str(" - name: "); - out.push_str(&yaml_double_quoted(parameter)); - out.push_str( - "\n in: path\n required: true\n schema:\n type: string\n", - ); -} - -fn malformed(declaration: Option<&str>, detail: impl Into) -> ProjectOpenApiError { - ProjectOpenApiError::MalformedOperation { - declaration: declaration.unwrap_or("").to_string(), - detail: detail.into(), - } -} - -fn record_fields(value: &FieldValue) -> Option<&[(String, FieldValue)]> { - match value { - FieldValue::Record(fields) => Some(fields.as_slice()), - _ => None, - } -} - -fn require_record<'a>( - declaration: &str, - field: &str, - value: &'a FieldValue, -) -> Result<&'a [(String, FieldValue)], ProjectOpenApiError> { - record_fields(value).ok_or_else(|| ProjectOpenApiError::MalformedOperation { - declaration: declaration.to_string(), - detail: format!("`{field}` must be a record"), - }) -} - -fn record_field<'a>(fields: &'a [(String, FieldValue)], label: &str) -> Option<&'a FieldValue> { - fields.iter().find(|(l, _)| l == label).map(|(_, v)| v) -} - -fn field_type(fields: &[crate::dag::Field], label: &str) -> Option { - fields - .iter() - .find(|field| field.label == label) - .map(|field| field.ty) -} - -fn parse_http_method( - dag: &Dag, - schema: RestRouteSchema, - declaration: &str, - value: &FieldValue, -) -> Result { - let FieldValue::Variant { - constructor, - payload, - } = value - else { - return Err(ProjectOpenApiError::MalformedOperation { - declaration: declaration.to_string(), - detail: "`endpoint.method` must be an HttpMethod variant".to_string(), - }); - }; - if !payload.is_empty() { - return Err(ProjectOpenApiError::MalformedOperation { - declaration: declaration.to_string(), - detail: "HttpMethod variants must not carry payload".to_string(), - }); - } - let label = - variant_label_in_parent(dag, schema.http_method, *constructor).ok_or_else(|| { - ProjectOpenApiError::MalformedOperation { - declaration: declaration.to_string(), - detail: "HttpMethod constructor is not a variant of HttpMethod".to_string(), - } - })?; - HttpMethodScalar::from_token(&label).ok_or_else(|| ProjectOpenApiError::MalformedOperation { - declaration: declaration.to_string(), - detail: "HttpMethod constructor is outside the modeled HTTP method set".to_string(), - }) -} - -#[derive(Debug, Clone, PartialEq, Eq)] -struct ParsedPathTemplate { - path: String, - parameters: Vec, -} - -fn parse_path_template( - dag: &Dag, - schema: RestRouteSchema, - declaration: &str, - value: &FieldValue, -) -> Result { - let fields = require_record(declaration, "endpoint.path", value)?; - let tokens = - record_field(fields, "tokens").ok_or_else(|| ProjectOpenApiError::MalformedOperation { - declaration: declaration.to_string(), - detail: "PathTemplate missing `tokens` field".to_string(), - })?; - let FieldValue::List(tokens) = tokens else { - return Err(ProjectOpenApiError::MalformedOperation { - declaration: declaration.to_string(), - detail: "PathTemplate.tokens must be a list".to_string(), - }); - }; - let mut pieces = Vec::with_capacity(tokens.len()); - let mut parameters = Vec::new(); - for token in tokens { - let FieldValue::Variant { - constructor, - payload, - } = token - else { - return Err(ProjectOpenApiError::MalformedOperation { - declaration: declaration.to_string(), - detail: "PathTemplate token must be a UrlPathToken variant".to_string(), - }); - }; - let label = - variant_label_in_parent(dag, schema.url_path_token, *constructor).ok_or_else(|| { - ProjectOpenApiError::MalformedOperation { - declaration: declaration.to_string(), - detail: "token constructor is not a variant of UrlPathToken".to_string(), - } - })?; - let text = single_string_payload(payload).ok_or_else(|| { - ProjectOpenApiError::MalformedOperation { - declaration: declaration.to_string(), - detail: format!("{label} token payload must contain one string"), - } - })?; - match label.as_str() { - "LiteralToken" => pieces.push(text), - "ParamToken" => { - pieces.push(format!("{{{text}}}")); - parameters.push(text); - } - other => { - return Err(ProjectOpenApiError::MalformedOperation { - declaration: declaration.to_string(), - detail: format!("unsupported UrlPathToken variant `{other}`"), - }) - } - } - } - let path = pieces.concat(); - Ok(ParsedPathTemplate { - path: if path.starts_with('/') { - path - } else { - format!("/{path}") - }, - parameters, - }) -} - -fn variant_label_in_parent( - dag: &Dag, - parent: DeclarationId, - constructor: DeclarationId, -) -> Option { - let TypeConnective::Disj { variants } = &dag.declaration(parent).connective else { - return None; - }; - variants - .iter() - .find(|variant| variant.ty == constructor) - .map(|variant| variant.label.clone()) -} - -fn single_string_payload(payload: &[FieldValue]) -> Option { - let [value] = payload else { - return None; - }; - match value { - FieldValue::Literal(LiteralBits::String(value)) => Some(value.clone()), - FieldValue::Record(fields) => fields.iter().find_map(|(label, value)| { - if label == "text" || label == "name" { - match value { - FieldValue::Literal(LiteralBits::String(value)) => Some(value.clone()), - _ => None, - } - } else { - None - } - }), - _ => None, - } -} - -fn yaml_quoted(value: &str) -> String { - format!("'{}'", value.replace('\'', "''")) -} - -fn sql_string_literal(value: &str) -> String { - format!("'{}'", value.replace('\'', "''")) -} - -fn rust_string_literal(value: &str) -> String { - let mut literal = String::from("\""); - for ch in value.chars() { - match ch { - '\\' => literal.push_str("\\\\"), - '"' => literal.push_str("\\\""), - '\n' => literal.push_str("\\n"), - '\r' => literal.push_str("\\r"), - '\t' => literal.push_str("\\t"), - other if other.is_control() => { - write!(&mut literal, "\\u{{{:X}}}", other as u32).expect("write to String"); - } - other => literal.push(other), - } - } - literal.push('"'); - literal -} - -fn yaml_double_quoted(value: &str) -> String { - let mut quoted = String::from("\""); - for ch in value.chars() { - match ch { - '\\' => quoted.push_str("\\\\"), - '"' => quoted.push_str("\\\""), - '\n' => quoted.push_str("\\n"), - '\r' => quoted.push_str("\\r"), - '\t' => quoted.push_str("\\t"), - other if other.is_control() => { - write!(&mut quoted, "\\u{:04X}", other as u32).expect("write to String"); - } - other => quoted.push(other), - } - } - quoted.push('"'); - quoted -} - -fn yaml_plain_operation_id(method: HttpMethodScalar, path: &str) -> String { - let mut suffix = String::new(); - for ch in path.trim_matches('/').chars() { - if ch.is_ascii_alphanumeric() { - suffix.push(ch); - } else { - write!(&mut suffix, "_x{:X}_", ch as u32).expect("write to String"); - } - } - format!("{}_{}", method.token().to_ascii_lowercase(), suffix) -} - -fn markdown_table_cell(value: &str) -> String { - value.replace('\\', "\\\\").replace('|', "\\|") -} - -fn markdown_code_span(value: &str) -> String { - let delimiter = "`".repeat(max_backtick_run(value) + 1); - if value.starts_with('`') || value.ends_with('`') { - format!("{delimiter} {value} {delimiter}") - } else { - format!("{delimiter}{value}{delimiter}") - } -} - -fn markdown_code_span_table_cell(value: &str) -> String { - markdown_code_span(value).replace('|', "\\|") -} - -fn max_backtick_run(value: &str) -> usize { - let mut max = 0; - let mut current = 0; - for ch in value.chars() { - if ch == '`' { - current += 1; - max = max.max(current); - } else { - current = 0; - } - } - max -} - -#[cfg(test)] -mod tests { - use super::*; - use crate::compile_to_dag; - - const SERVICE_FIXTURE: &str = r#" -module t.openapi_malformed_projection - -import std.types { GET } -import std.effects { LiteralToken } -import v3.std.services { RestEndpointBinding } - -type DemoOperation { - endpoint: RestEndpointBinding -} - -data service_operations: List = [ - { - endpoint: { - method: GET, - path: { tokens: [LiteralToken { text: "users" }] } - } - } -] -"#; - - fn compiled_service_fixture() -> Dag { - std::thread::Builder::new() - .name("openapi_malformed_projection_compile".to_string()) - .stack_size(32 * 1024 * 1024) - .spawn(|| { - compile_to_dag(SERVICE_FIXTURE, "openapi_malformed_projection_fixture.dag") - .expect("service fixture compiles") - }) - .expect("spawn larger-stack compile thread") - .join() - .expect("larger-stack compile thread completes") - } - - fn service_operations_id(dag: &Dag) -> DeclarationId { - dag.declarations() - .iter() - .find(|decl| decl.name.as_deref() == Some("service_operations")) - .expect("service_operations declaration exists") - .id - } - - fn replace_first_service_row(dag: &mut Dag, replacement: FieldValue) { - let service_operations = service_operations_id(dag); - let ValueBody::List(rows) = dag - .declaration_mut(service_operations) - .value_body - .as_mut() - .expect("service_operations has value body") - else { - panic!("service_operations is a list"); - }; - rows[0] = replacement; - } - - #[test] - fn extract_rest_routes_rejects_non_record_service_rows() { - let mut dag = compiled_service_fixture(); - replace_first_service_row( - &mut dag, - FieldValue::Literal(LiteralBits::String("not a record".to_string())), - ); - - assert_eq!( - extract_rest_routes(&dag), - Err(ProjectOpenApiError::MalformedOperation { - declaration: "service_operations".to_string(), - detail: "service operation rows must be records".to_string(), - }) - ); - } - - #[test] - fn extract_rest_routes_rejects_service_rows_missing_endpoint() { - let mut dag = compiled_service_fixture(); - replace_first_service_row(&mut dag, FieldValue::Record(vec![])); - - assert_eq!( - extract_rest_routes(&dag), - Err(ProjectOpenApiError::MalformedOperation { - declaration: "service_operations".to_string(), - detail: "service operation row missing `endpoint` field".to_string(), - }) - ); - } - - #[test] - fn path_parameter_names_are_quoted_for_yaml_structure() { - let mut yaml = String::new(); - - append_path_parameter_yaml(&mut yaml, "id:\nrequired: false"); - - assert_eq!( - yaml, - " - name: \"id:\\nrequired: false\"\n in: path\n required: true\n schema:\n type: string\n" - ); - } - - #[test] - fn markdown_code_cells_choose_safe_delimiters_and_escape_table_delimiters() { - assert_eq!(markdown_code_span_table_cell("a|b`c\\d"), "``a\\|b`c\\d``"); - assert_eq!( - markdown_code_span_table_cell("a``b```c"), - "````a``b```c````" - ); - assert_eq!(markdown_code_span_table_cell("\\path"), "`\\path`"); - assert_eq!(markdown_code_span_table_cell("`x"), "`` `x ``"); - assert_eq!(markdown_code_span_table_cell("x`"), "`` x` ``"); - } -} diff --git a/src/v3/compiler/src/operators_generated.rs b/src/v3/compiler/src/operators_generated.rs deleted file mode 100644 index a74cd171d3b..00000000000 --- a/src/v3/compiler/src/operators_generated.rs +++ /dev/null @@ -1,66 +0,0 @@ -// AUTO-GENERATED from `src/v3/compiler/operators.dag` via -// `emit_rust_module`. Regenerate instead of hand-editing. - -pub fn from_symbol(p0: &str) -> Option { - if p0 == "+" { - Some(OperatorKind::Arithmetic(ArithmeticOp::Add)) - } else if p0 == "-" { - Some(OperatorKind::Arithmetic(ArithmeticOp::Sub)) - } else if p0 == "*" { - Some(OperatorKind::Arithmetic(ArithmeticOp::Mul)) - } else if p0 == "/" { - Some(OperatorKind::Arithmetic(ArithmeticOp::Div)) - } else if p0 == "==" { - Some(OperatorKind::Comparison(ComparisonOp::Eq)) - } else if p0 == "!=" { - Some(OperatorKind::Comparison(ComparisonOp::Ne)) - } else if p0 == "<" { - Some(OperatorKind::Comparison(ComparisonOp::Lt)) - } else if p0 == "<=" { - Some(OperatorKind::Comparison(ComparisonOp::Le)) - } else if p0 == ">" { - Some(OperatorKind::Comparison(ComparisonOp::Gt)) - } else if p0 == ">=" { - Some(OperatorKind::Comparison(ComparisonOp::Ge)) - } else if p0 == "&&" { - Some(OperatorKind::Logical(LogicalOp::And)) - } else if p0 == "||" { - Some(OperatorKind::Logical(LogicalOp::Or)) - } else { - None - } -} - -pub fn symbol(p0: OperatorKind) -> String { - match p0 { - OperatorKind::Arithmetic(ArithmeticOp::Add) => String::from("+"), - OperatorKind::Arithmetic(ArithmeticOp::Sub) => String::from("-"), - OperatorKind::Arithmetic(ArithmeticOp::Mul) => String::from("*"), - OperatorKind::Arithmetic(ArithmeticOp::Div) => String::from("/"), - OperatorKind::Comparison(ComparisonOp::Eq) => String::from("=="), - OperatorKind::Comparison(ComparisonOp::Ne) => String::from("!="), - OperatorKind::Comparison(ComparisonOp::Lt) => String::from("<"), - OperatorKind::Comparison(ComparisonOp::Le) => String::from("<="), - OperatorKind::Comparison(ComparisonOp::Gt) => String::from(">"), - OperatorKind::Comparison(ComparisonOp::Ge) => String::from(">="), - OperatorKind::Logical(LogicalOp::And) => String::from("&&"), - OperatorKind::Logical(LogicalOp::Or) => String::from("||"), - } -} - -pub fn algebra_field_name(p0: OperatorKind) -> String { - match p0 { - OperatorKind::Arithmetic(ArithmeticOp::Add) => String::from("add"), - OperatorKind::Arithmetic(ArithmeticOp::Sub) => String::from("sub"), - OperatorKind::Arithmetic(ArithmeticOp::Mul) => String::from("mul"), - OperatorKind::Arithmetic(ArithmeticOp::Div) => String::from("div"), - OperatorKind::Comparison(ComparisonOp::Eq) => String::from("eq"), - OperatorKind::Comparison(ComparisonOp::Ne) => String::from("ne"), - OperatorKind::Comparison(ComparisonOp::Lt) => String::from("lt"), - OperatorKind::Comparison(ComparisonOp::Le) => String::from("le"), - OperatorKind::Comparison(ComparisonOp::Gt) => String::from("gt"), - OperatorKind::Comparison(ComparisonOp::Ge) => String::from("ge"), - OperatorKind::Logical(LogicalOp::And) => String::from("meet"), - OperatorKind::Logical(LogicalOp::Or) => String::from("join"), - } -} diff --git a/src/v3/compiler/src/parse_generated.rs b/src/v3/compiler/src/parse_generated.rs deleted file mode 100644 index 79b32c2710c..00000000000 --- a/src/v3/compiler/src/parse_generated.rs +++ /dev/null @@ -1,2055 +0,0 @@ -// AUTO-GENERATED from `src/v3/std/parse_surface.dag` (Surface carriers) -// via `regen_parse` + `parse_parser_body.txt`. Regenerate instead of hand-editing. - -use crate::diagnostics::{Diagnostic, SourceSpan}; -use crate::operators::{LogicalOp, OperatorKind}; -pub use crate::parse_surface::{ - SurfaceExpr, SurfaceField, SurfaceItem, SurfaceLiteral, SurfaceMapEntry, SurfaceMatchArm, - SurfaceModule, SurfaceParam, SurfacePattern, SurfacePatternField, SurfaceRecordField, - SurfaceType, SurfaceVariant, TypeAngleArg, VariantPayload, -}; -use crate::parse_tables::{ - binary_op_at_level, bracket_role, is_type_rhs_boundary_keyword, primary_atom_class, - primary_prefix_dispatch, soft_keyword_ident_spelling, top_level_item_dispatch, BinaryOpLevel, - BracketRole, ItemDispatchKind, PrimaryAtomClass, PrimaryPrefixDispatch, -}; -use crate::tokenize::{Token, TokenKind}; -use std::collections::HashSet; - -impl SurfaceType { - pub fn span(&self) -> &SourceSpan { - match self { - SurfaceType::Named { span, .. } - | SurfaceType::Parameterized { span, .. } - | SurfaceType::Optional { span, .. } - | SurfaceType::Arrow { span, .. } => span, - } - } -} - -impl TypeAngleArg { - pub fn span(&self) -> &SourceSpan { - match self { - TypeAngleArg::TypeExpr { ty } => ty.span(), - TypeAngleArg::WidthNatLiteral { span, .. } => span, - } - } -} - -// RESIDUAL SEMANTIC AUTHORITY — recursive-descent parse algorithm. -// This is **parser staging**, not SG-2c closure: the Surface carrier schema lives in -// `src/v3/std/parse_surface.dag`, the binary-operator-at-precedence-level table lives in -// `parse_tables.dag` (SG-2c-1 grammar-tables prototype), and `regen_parse` splices this -// fragment after the emitted `Surface*` definitions inside `parse_generated.rs`. -// -// **SG-2c-1 reduction (not retirement).** The per-precedence-level functions below -// (`parse_logical_or`, `parse_logical_and`, `parse_comparison`, `parse_additive`, -// `parse_term`) used to open-code the token → `OperatorKind` mapping in five separate -// match blocks. That mapping is now authored as `binary_op_*` data rows in -// `parse_tables.dag` and consumed here via `binary_op_at_level`. The SG-2c -// `parse_primary` cluster: SG-2c-6 `PrimaryPrefixRow` + `primary_prefix_dispatch` -// (prefix openers) and SG-2c-7 `PrimaryAtomRow` + `primary_atom_class` (int/bool/ -// string/lambda/ident atomic forms). The parser's control flow — cursor mechanics, -// recursive descent, error recovery, span fusion — remains semantic authority in -// this file. -// -// Dissolution trigger (SG-2c proper): delete this file when parse **logic** is -// structurally `.dag`-owned (SELF_HOSTING §6 Phase 4a direct port or Phase 4b -// grammar-as-data) and `regen_parse` emits the full module without any external -// Rust body fragment. SG-2c proper is blocked on a named substrate capability — -// recursive list-body emission over `List` with cursor threading — declared -// in `src/v3/std/list.dag:13-15` ("the current compiler still lacks full structural -// recursion + list-body emission support"). Until that lands, any `.dag` port of -// the recursive-descent algorithm routes through a hidden Rust host layer. -// - -/// Host-authored names that may appear as the sole RHS identifier of a -/// `type T = U` **alias** even when `U` is not declared in the same module -/// (bootstrap / prelude spellings). Keep this list conservative: expand it -/// when integration tests surface a legitimate `type X = Builtin` alias the -/// two-pass disambiguator mis-classified as a nullary sum. -const PRELUDE_BARE_RHS_ALIAS_IDENTS: &[&str] = &[ - "Bit", - "Bool", - "Char", - "Classical", - "Double", - "Float", - "Float32", - "Float64", - "Int", - "Int8", - "Int16", - "Int32", - "Int64", - "List", - "Map", - "Nat", - "Never", - "Str", - "String", - "Set", - "UInt", - "UInt8", - "UInt16", - "UInt32", - "UInt64", - "Unit", - "Vec", - "Void", - "Word8", - "Word16", - "Word32", - "Word64", -]; - -/// Build the identifier set for which a bare `type T = U` RHS must classify -/// as [`SurfaceItem::TypeAlias`]: prelude spellings, explicit `import … { … }` -/// names, and every `type` / `data` LHS in the module (declaration order does -/// not matter — forward aliases to sibling types stay aliases). Local generic -/// binders are declaration-scoped and are added only at the RHS lookahead site. -fn collect_bare_rhs_alias_reference_idents(items: &[SurfaceItem]) -> HashSet { - let mut out = HashSet::new(); - for name in PRELUDE_BARE_RHS_ALIAS_IDENTS { - out.insert((*name).to_string()); - } - for item in items { - match item { - SurfaceItem::Import { names, .. } => { - for n in names { - out.insert(n.clone()); - } - } - SurfaceItem::TypeRecord { name, .. } - | SurfaceItem::TypeSum { name, .. } - | SurfaceItem::TypeAlias { name, .. } - | SurfaceItem::TypeAtom { name, .. } => { - out.insert(name.clone()); - } - SurfaceItem::Data { name, .. } => { - out.insert(name.clone()); - } - _ => {} - } - } - out -} - -pub fn parse(tokens: &[Token], file: &str) -> Result { - let pass1_items = { - let mut parser = Parser { - tokens, - pos: 0, - file, - bare_rhs_alias_reference_idents: None, - }; - let mut items = Vec::new(); - while !parser.at_eof() { - items.push(parser.parse_item()?); - } - items - }; - let refs = collect_bare_rhs_alias_reference_idents(&pass1_items); - let mut parser = Parser { - tokens, - pos: 0, - file, - bare_rhs_alias_reference_idents: Some(refs), - }; - let mut items = Vec::new(); - while !parser.at_eof() { - items.push(parser.parse_item()?); - } - Ok(SurfaceModule { items }) -} - -struct Parser<'a> { - tokens: &'a [Token], - pos: usize, - file: &'a str, - /// `None` during pass 1 (bare-RHS sum disambiguation disabled). `Some` during - /// pass 2: a bare `type T = U` is [`SurfaceItem::TypeSum`] iff `U` is **not** - /// in this set (prelude + imports + module `type`/`data` LHS names). - bare_rhs_alias_reference_idents: Option>, -} - -impl<'a> Parser<'a> { - fn peek(&self) -> &Token { - &self.tokens[self.pos] - } - - fn bump(&mut self) -> &Token { - let t = &self.tokens[self.pos]; - self.pos += 1; - t - } - - fn at_eof(&self) -> bool { - matches!(self.peek().kind, TokenKind::Eof) - } - - fn expect_kind(&mut self, expected: TokenKind) -> Result { - let token = self.bump().clone(); - if token.kind == expected { - Ok(token) - } else { - Err(Diagnostic::ParseError { - message: format!("expected {expected:?}, got {:?}", token.kind), - span: token.span, - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "ParseError", - ), - }) - } - } - - /// Parse the next top-level item. Every surface form emits a real - /// `SurfaceItem` — the earlier "parser-absorbed" path was deleted - /// at M1(2.7) per the QW1/QW2/QW3 scaffold-honesty fix. Module, - /// import, and data items lower to no-ops (or declaration-only - /// scaffolds) at M1(2.7), but the parsed facts flow forward. - /// - /// **SG-2c-2 keyword→dispatch edge is table-owned:** which `TokenKind` - /// opens which item form comes from `parse_tables.dag` (`TopLevelItemKwRow`), - /// projected by `regen_parse_tables` into `parse_tables::top_level_item_dispatch`. - /// This function only maps `ItemDispatchKind` → the corresponding `parse_*_item` - /// entry point (control flow stays here; the keyword set is not open-coded). - fn parse_item(&mut self) -> Result { - let tk = &self.peek().kind; - match top_level_item_dispatch(tk) { - Some(ItemDispatchKind::Let) => self.parse_let_item(), - Some(ItemDispatchKind::Fn) => self.parse_fn_item(), - Some(ItemDispatchKind::Type) => self.parse_type_item(), - Some(ItemDispatchKind::Module) => self.parse_module_item(), - Some(ItemDispatchKind::Import) => self.parse_import_item(), - Some(ItemDispatchKind::Data) => self.parse_data_item(), - None => Err(Diagnostic::ParseError { - message: format!( - "expected `let`, `fn`, `type`, `module`, `import`, or `data`, got {tk:?}" - ), - span: self.peek().span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "ParseError", - ), - }), - } - } - - /// Parse `module foo.bar.baz` into a `SurfaceItem::Module { path }`. - /// At M1(2.7) lowering is a no-op, but the parsed path survives - /// for M2 module scoping to consume. - fn parse_module_item(&mut self) -> Result { - let kw = self.expect_kind(TokenKind::KwModule)?; - let path = self.parse_dotted_path()?; - // The dotted path ends at the last parsed identifier; use its - // span's end as the item's end. `parse_dotted_path` doesn't - // return spans, so fall back to the current position's - // previous token span. The simplest correct thing: use the - // last token consumed by peek-1. - let end = self.tokens[self.pos.saturating_sub(1)].span.byte_end; - Ok(SurfaceItem::Module { - path, - span: SourceSpan::new(self.file, kw.span.byte_start, end), - }) - } - - /// Parse `import foo.bar { Name1, Name2 }` into - /// `SurfaceItem::Import { path, names }`. The names list is - /// optional (bare `import foo.bar` imports everything). - fn parse_import_item(&mut self) -> Result { - let kw = self.expect_kind(TokenKind::KwImport)?; - let path = self.parse_dotted_path()?; - let mut names: Vec = Vec::new(); - if matches!(self.peek().kind, TokenKind::LBrace) { - self.bump(); - if !matches!(self.peek().kind, TokenKind::RBrace) { - loop { - names.push(self.parse_ident()?); - if matches!(self.peek().kind, TokenKind::Comma) { - self.bump(); - continue; - } - break; - } - } - self.expect_kind(TokenKind::RBrace)?; - } - let end = self.tokens[self.pos.saturating_sub(1)].span.byte_end; - Ok(SurfaceItem::Import { - path, - names, - span: SourceSpan::new(self.file, kw.span.byte_start, end), - }) - } - - /// Parse `data name: Type = { body }` into `SurfaceItem::Data`. - /// - /// **M1(3) PR-B change:** the body is now attempted as a record - /// literal first. A 3-token lookahead (`{`, `Ident`, `:`) decides - /// between: - /// - /// - **Record literal**: the body is parsed as a - /// `SurfaceExpr::Record { fields, span }` and stored in - /// `SurfaceItem::Data.body = Some(...)`. Lowering runs - /// inhabitance checking against the type annotation (walks - /// the Conj children, matches labels, validates literal-only - /// field values) and produces a - /// `ValueBody::Structural { fields }` on the declaration. - /// - **Unparseable body**: any body whose first three tokens - /// don't match `{ Ident :` falls back to the brace-skip path - /// (preserving the span) and `SurfaceItem::Data.body = None`. - /// Lowering produces a `ValueBody::Unparsed(span)` scaffold - /// which `reject_user_unparsed_scaffolds` rejects for user - /// code and tolerates for bootstrap fixtures (R14 behavior). - /// - /// The lookahead is unambiguous because record field syntax - /// starts with `Ident :` and no other valid body shape does. - fn parse_data_item(&mut self) -> Result { - let kw = self.expect_kind(TokenKind::KwData)?; - let name = self.parse_ident()?; - self.expect_kind(TokenKind::Colon)?; - let ty = self.parse_type_expr()?; - self.expect_kind(TokenKind::Eq)?; - // DB-10 (3a.2): `data x: T = ` accepts three body shapes: - // 1. Record literal (`{ name: v, ... }`) — lowered to - // ValueBody::Structural via inhabitance checking. - // 2. Opaque brace body (`{ ... }` without record-literal - // shape) — preserved as ValueBody::Unparsed. - // 3. Scalar expression (no leading `{`) — lowered to - // ValueBody::Scalar. Required for scalar constants - // like `data answer: Int = 42` that `compiler.dag` uses. - if !matches!(self.peek().kind, TokenKind::LBrace) { - let body_expr = self.parse_expr()?; - let body_span_ref = expr_span(&body_expr); - let body_start = body_span_ref.byte_start; - let body_end = body_span_ref.byte_end; - return Ok(SurfaceItem::Data { - name, - ty, - body: Some(body_expr), - body_span: SourceSpan::new(self.file, body_start, body_end), - span: SourceSpan::new(self.file, kw.span.byte_start, body_end), - }); - } - // Peek three tokens for the record-literal lookahead. - let open_span = self.peek().span.clone(); - let is_record_literal = self.looks_like_record_literal(); - if is_record_literal { - let body_expr = self.parse_record_literal()?; - let body_end = match &body_expr { - SurfaceExpr::Record { span, .. } => span.byte_end, - _ => unreachable!("parse_record_literal always returns Record"), - }; - return Ok(SurfaceItem::Data { - name, - ty, - body: Some(body_expr), - body_span: SourceSpan::new(self.file, open_span.byte_start, body_end), - span: SourceSpan::new(self.file, kw.span.byte_start, body_end), - }); - } - // Sibling lookahead for map literals (`{ String : ...`). Routes - // string-keyed `{...}` data bodies into `parse_map_literal`, - // emitting `SurfaceExpr::Map`. Disambiguation is unambiguous: - // record-literal lookahead requires `{ Ident :`; map-literal - // requires `{ StringLit :`. Bare `{}` (empty) and any other - // shape continue to fall through to `skip_brace_balanced`. - if self.looks_like_map_literal() { - let body_expr = self.parse_map_literal()?; - let body_end = match &body_expr { - SurfaceExpr::Map { span, .. } => span.byte_end, - _ => unreachable!("parse_map_literal always returns Map"), - }; - return Ok(SurfaceItem::Data { - name, - ty, - body: Some(body_expr), - body_span: SourceSpan::new(self.file, open_span.byte_start, body_end), - span: SourceSpan::new(self.file, kw.span.byte_start, body_end), - }); - } - let end = self.skip_brace_balanced()?; - let body_span = SourceSpan::new(self.file, open_span.byte_start, end); - Ok(SurfaceItem::Data { - name, - ty, - body: None, - body_span, - span: SourceSpan::new(self.file, kw.span.byte_start, end), - }) - } - - /// 3-token lookahead for record-literal disambiguation (`parse_data_item`, - /// brace-bodied `fn` on `.v3`). Returns `true` when: - /// - /// - **`{}`**: `LBrace` immediately followed by `RBrace` (empty record). - /// - **`{ label: expr`**: `LBrace`, then a field label token (`Ident(_)` or any - /// token accepted via `soft_keyword_ident_spelling`, e.g. `KwType` for - /// `type:`), then `:` — same label set as `parse_field_label`. - /// - /// Otherwise returns `false` so callers can try map-literal lookahead or - /// other paths. - fn looks_like_record_literal(&self) -> bool { - let t0 = self.tokens.get(self.pos); - let t1 = self.tokens.get(self.pos + 1); - let t2 = self.tokens.get(self.pos + 2); - match (t0, t1) { - (Some(a), Some(b)) - if matches!(a.kind, TokenKind::LBrace) && matches!(b.kind, TokenKind::RBrace) => - { - true - } - _ => match (t0, t1, t2) { - (Some(a), Some(b), Some(c)) => { - matches!(a.kind, TokenKind::LBrace) - && (matches!(b.kind, TokenKind::Ident(_)) - || soft_keyword_ident_spelling(&b.kind).is_some()) - && matches!(c.kind, TokenKind::Colon) - } - _ => false, - }, - } - } - - /// Parse a record literal starting at `{`. Called from - /// `parse_data_item` after `looks_like_record_literal` confirms - /// the lookahead. Reads `label: expr` pairs separated by `,` (or - /// whitespace), terminated by `}`. Each field's value is any - /// `SurfaceExpr` — lowering (not parsing) enforces the literal- - /// only restriction. - fn parse_record_literal(&mut self) -> Result { - let open = self.expect_kind(TokenKind::LBrace)?; - let mut fields: Vec = Vec::new(); - while !matches!(self.peek().kind, TokenKind::RBrace) { - let (field_name, name_span) = self.parse_field_label()?; - self.expect_kind(TokenKind::Colon)?; - let value = self.parse_expr()?; - let field_end = expr_span(&value).byte_end; - fields.push(SurfaceRecordField { - name: field_name, - value, - span: SourceSpan::new(self.file, name_span.byte_start, field_end), - }); - // Accept an optional comma between fields (whitespace - // alone is also permitted). - if matches!(self.peek().kind, TokenKind::Comma) { - self.bump(); - } - } - let close = self.expect_kind(TokenKind::RBrace)?; - Ok(SurfaceExpr::Record { - fields, - span: SourceSpan::new(self.file, open.span.byte_start, close.span.byte_end), - }) - } - - /// 3-token lookahead for the map-literal disambiguation in - /// `parse_data_item`. Returns `true` when the next three tokens are - /// `{`, then `StringLit(_)`, then `:` — the unambiguous start of a - /// map-literal entry. Sibling to `looks_like_record_literal` - /// (`{ Ident :`); the two are mutually exclusive at the entry token - /// because a string-literal token is structurally distinct from an - /// identifier token. Empty `{}` falls through to neither (and routes - /// into `skip_brace_balanced` per the existing scaffolded-body - /// path) — string-key non-empty maps are the only shape this lane - /// admits; empty-map syntax is deferred until a real consumer needs - /// it (no consumer in the 22-declaration survey produces an empty - /// map literal at the top level). - fn looks_like_map_literal(&self) -> bool { - let t0 = self.tokens.get(self.pos); - let t1 = self.tokens.get(self.pos + 1); - let t2 = self.tokens.get(self.pos + 2); - match (t0, t1, t2) { - (Some(a), Some(b), Some(c)) => { - matches!(a.kind, TokenKind::LBrace) - && matches!(b.kind, TokenKind::StringLit(_)) - && matches!(c.kind, TokenKind::Colon) - } - _ => false, - } - } - - /// Parse a map literal starting at `{`. Called from - /// `parse_data_item` after `looks_like_map_literal` confirms the - /// lookahead. Reads `"key": expr` pairs separated by `,` (or - /// whitespace), terminated by `}`. Each entry's key is the parsed - /// string-literal contents (the parser only enters this path after - /// `looks_like_map_literal` matched a `StringLit` token; any - /// non-string key here is an internal invariant violation). - fn parse_map_literal(&mut self) -> Result { - let open = self.expect_kind(TokenKind::LBrace)?; - let mut entries: Vec = Vec::new(); - while !matches!(self.peek().kind, TokenKind::RBrace) { - let key_token = self.bump().clone(); - let (key, key_span) = match key_token.kind { - TokenKind::StringLit(s) => (s, key_token.span.clone()), - other => { - return Err(Diagnostic::ParseError { - message: format!( - "expected string-literal key in map literal, got {other:?}" - ), - span: key_token.span, - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "ParseError", - ), - }); - } - }; - self.expect_kind(TokenKind::Colon)?; - let value = self.parse_expr()?; - let value_end = expr_span(&value).byte_end; - entries.push(SurfaceMapEntry { - key, - key_span: key_span.clone(), - value, - span: SourceSpan::new(self.file, key_span.byte_start, value_end), - }); - if matches!(self.peek().kind, TokenKind::Comma) { - self.bump(); - } - } - let close = self.expect_kind(TokenKind::RBrace)?; - Ok(SurfaceExpr::Map { - entries, - span: SourceSpan::new(self.file, open.span.byte_start, close.span.byte_end), - }) - } - - fn parse_named_expr_fields( - &mut self, - ) -> Result<(Vec, SourceSpan), Diagnostic> { - let open = self.expect_kind(TokenKind::LBrace)?; - let mut fields: Vec = Vec::new(); - while !matches!(self.peek().kind, TokenKind::RBrace) { - let (field_name, name_span) = self.parse_field_label()?; - self.expect_kind(TokenKind::Colon)?; - let value = self.parse_expr()?; - let field_end = expr_span(&value).byte_end; - fields.push(SurfaceRecordField { - name: field_name, - value, - span: SourceSpan::new(self.file, name_span.byte_start, field_end), - }); - if matches!(self.peek().kind, TokenKind::Comma) { - self.bump(); - } - } - let close = self.expect_kind(TokenKind::RBrace)?; - Ok(( - fields, - SourceSpan::new(self.file, open.span.byte_start, close.span.byte_end), - )) - } - - fn parse_named_pattern_fields( - &mut self, - ) -> Result<(Vec, SourceSpan), Diagnostic> { - let open = self.expect_kind(TokenKind::LBrace)?; - let mut fields: Vec = Vec::new(); - while !matches!(self.peek().kind, TokenKind::RBrace) { - let (field_name, name_span) = self.parse_field_label()?; - self.expect_kind(TokenKind::Colon)?; - let binding_token = self.bump().clone(); - let binding = match binding_token.kind { - TokenKind::Ident(binding) => binding, - other => { - return Err(Diagnostic::ParseError { - message: format!( - "expected binding name in named payload match pattern after `{field_name}:`, got {other:?}" - ), - span: binding_token.span, - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("ParseError"), - }); - } - }; - fields.push(SurfacePatternField { - name: field_name, - binding, - span: SourceSpan::new(self.file, name_span.byte_start, binding_token.span.byte_end), - }); - if matches!(self.peek().kind, TokenKind::Comma) { - self.bump(); - } - } - let close = self.expect_kind(TokenKind::RBrace)?; - Ok(( - fields, - SourceSpan::new(self.file, open.span.byte_start, close.span.byte_end), - )) - } - - fn brace_starts_match_arms(&self) -> bool { - if !matches!(self.peek().kind, TokenKind::LBrace) { - return false; - } - let mut depth = 0usize; - let mut idx = self.pos; - let mut only_empty_block_so_far = true; - while let Some(token) = self.tokens.get(idx) { - match token.kind { - TokenKind::LBrace => depth += 1, - TokenKind::RBrace => { - if depth == 0 { - return false; - } - depth -= 1; - if depth == 0 { - // `match x {}` is a valid empty-arm block that - // should parse and fail later during lowering/ - // validation as non-exhaustive, not be - // reinterpreted as `x {}` (a named constructor - // expression with empty fields). - return only_empty_block_so_far; - } - } - TokenKind::FatArrow if depth == 1 => return true, - _ if depth == 1 => only_empty_block_so_far = false, - TokenKind::Eof => return false, - _ => {} - } - idx += 1; - } - false - } - - fn parse_dotted_path(&mut self) -> Result, Diagnostic> { - let mut path = vec![self.parse_ident()?]; - while matches!(self.peek().kind, TokenKind::Dot) { - self.bump(); - path.push(self.parse_ident()?); - } - Ok(path) - } - - /// Consume a brace-balanced token range starting at the current - /// `{` and returning the byte offset of the matching `}`. Used for - /// opaque fn/data bodies at M1(2.6). Errors if EOF is reached - /// before the braces balance. - fn skip_brace_balanced(&mut self) -> Result { - let open = self.expect_kind(TokenKind::LBrace)?; - let mut depth: i32 = 1; - loop { - if self.at_eof() { - return Err(Diagnostic::ParseError { - message: "unterminated block body: reached EOF before closing `}`".to_string(), - span: open.span, - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "ParseError", - ), - }); - } - let token = self.bump().clone(); - match token.kind { - TokenKind::LBrace => depth += 1, - TokenKind::RBrace => { - depth -= 1; - if depth == 0 { - return Ok(token.span.byte_end); - } - } - _ => {} - } - } - } - - fn parse_let_item(&mut self) -> Result { - self.expect_kind(TokenKind::KwLet)?; - let name = self.parse_ident()?; - let type_ann = if matches!(self.peek().kind, TokenKind::Colon) { - self.bump(); - Some(self.parse_type_expr()?) - } else { - None - }; - self.expect_kind(TokenKind::Eq)?; - let expr = self.parse_expr()?; - Ok(SurfaceItem::Let { - name, - type_ann, - expr, - }) - } - - /// User `.v3` modules parse brace-bodied `fn` bodies as real - /// `SurfaceExpr` trees (single expression, record literal, or - /// `parse_expr` + `FnExternalBody` fallback for multi-statement - /// blocks). Authority `.dag` sources (`dsl/std`, `src/v3/std`, - /// compiler/spec fixtures, etc.) keep the legacy brace-skip → - /// `FnExternalBody` path so bootstrap snapshots and staged std - /// `ArrowBody::Unparsed` contracts stay byte-stable until a - /// dedicated bootstrap regen lane opts the corpus in. - fn fn_brace_body_parse_as_expression(&self) -> bool { - self.file.ends_with(".v3") - } - - /// After `{`, `parse_expr` fails immediately on `KwLet` (statements are not - /// expressions). Only that shape uses `FnExternalBody` + brace-skip on - /// `parse_expr` `Err` — other failures are malformed single-expression probes - /// and must surface the parser diagnostic (fail-closed at parse time). - fn fn_brace_body_expr_err_falls_back_to_external(&self, first_inner_token_pos: usize) -> bool { - matches!( - self.tokens.get(first_inner_token_pos).map(|t| &t.kind), - Some(TokenKind::KwLet) - ) - } - - /// Brace-bodied `fn` **record** lookahead: must stay aligned with - /// `parse_field_label` / `parse_record_literal` (same entry shapes as - /// `parse_data_item`: `{}`, `{ ident: expr`, `{ type: expr`, …). - fn fn_brace_body_looks_like_record_literal(&self) -> bool { - self.looks_like_record_literal() - } - - fn parse_fn_item(&mut self) -> Result { - let fn_kw = self.expect_kind(TokenKind::KwFn)?; - let name = self.parse_ident()?; - let type_params = self.parse_optional_type_params()?; - self.expect_kind(TokenKind::LParen)?; - let params = self.parse_params()?; - self.expect_kind(TokenKind::RParen)?; - self.expect_kind(TokenKind::Arrow)?; - let return_type = self.parse_type_expr()?; - match &self.peek().kind { - TokenKind::Eq => { - // Expression-body form: `fn f(x) -> T = expr`. - self.bump(); - let body_expr = self.parse_expr()?; - let end = expr_span(&body_expr).byte_end; - Ok(SurfaceItem::Fn { - name, - type_params, - params, - return_type, - body: body_expr, - span: SourceSpan::new(self.file, fn_kw.span.byte_start, end), - }) - } - TokenKind::LBrace => { - // Brace-bodied `fn f(x) -> T { body }`. - // - // Non-`.v3` sources (staged `.dag` corpus): preserve the - // legacy `FnExternalBody` + brace-skip path — see - // `fn_brace_body_parse_as_expression`. - // - // `.v3` user sources: when `{` begins a record literal (`{}` or - // `{ label: expr, ... }`, including `{ type: ... }` via - // `parse_field_label` soft keywords) or a string-key **map** - // literal (`{ "key": expr, ... }` — same disambiguation order as - // `parse_data_item`), parse that surface form. Otherwise probe a - // single `SurfaceExpr` through the closing `}`. - // - // Otherwise try a single complete `SurfaceExpr` through the - // closing `}`. If the expression parses but does not exhaust - // the brace (e.g. multi-`let` sequences), rewind and fall back to - // `FnExternalBody` + brace-skip. If `parse_expr` errors and the - // first inner token is `let`, use the same fallback (statement - // scaffold); otherwise propagate the parse diagnostic. - if !self.fn_brace_body_parse_as_expression() { - let open = self.peek().span.clone(); - let end = self.skip_brace_balanced()?; - let body_span = SourceSpan::new(self.file, open.byte_start, end); - return Ok(SurfaceItem::FnExternalBody { - name, - type_params, - params, - return_type, - body_span, - span: SourceSpan::new(self.file, fn_kw.span.byte_start, end), - }); - } - if self.fn_brace_body_looks_like_record_literal() { - let body_expr = self.parse_record_literal()?; - let end = expr_span(&body_expr).byte_end; - Ok(SurfaceItem::Fn { - name, - type_params, - params, - return_type, - body: body_expr, - span: SourceSpan::new(self.file, fn_kw.span.byte_start, end), - }) - } else if self.looks_like_map_literal() { - let body_expr = self.parse_map_literal()?; - let end = expr_span(&body_expr).byte_end; - Ok(SurfaceItem::Fn { - name, - type_params, - params, - return_type, - body: body_expr, - span: SourceSpan::new(self.file, fn_kw.span.byte_start, end), - }) - } else { - let checkpoint = self.pos; - self.expect_kind(TokenKind::LBrace)?; - let first_inner_token_pos = self.pos; - match self.parse_expr() { - Ok(body_expr) => { - if matches!(self.peek().kind, TokenKind::RBrace) { - let close = self.expect_kind(TokenKind::RBrace)?; - let end = close.span.byte_end; - Ok(SurfaceItem::Fn { - name, - type_params, - params, - return_type, - body: body_expr, - span: SourceSpan::new(self.file, fn_kw.span.byte_start, end), - }) - } else { - self.pos = checkpoint; - let open = self.peek().span.clone(); - let end = self.skip_brace_balanced()?; - let body_span = SourceSpan::new(self.file, open.byte_start, end); - Ok(SurfaceItem::FnExternalBody { - name, - type_params, - params, - return_type, - body_span, - span: SourceSpan::new(self.file, fn_kw.span.byte_start, end), - }) - } - } - Err(diag) => { - if self.fn_brace_body_expr_err_falls_back_to_external( - first_inner_token_pos, - ) { - self.pos = checkpoint; - let open = self.peek().span.clone(); - let end = self.skip_brace_balanced()?; - let body_span = SourceSpan::new(self.file, open.byte_start, end); - Ok(SurfaceItem::FnExternalBody { - name, - type_params, - params, - return_type, - body_span, - span: SourceSpan::new(self.file, fn_kw.span.byte_start, end), - }) - } else { - self.pos = checkpoint; - Err(diag) - } - } - } - } - } - other => Err(Diagnostic::ParseError { - message: format!("expected `=` or `{{` after fn return type, got {other:?}"), - span: self.peek().span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "ParseError", - ), - }), - } - } - - fn parse_type_item(&mut self) -> Result { - let type_kw = self.expect_kind(TokenKind::KwType)?; - let name_token = self.bump().clone(); - let name = match &name_token.kind { - TokenKind::Ident(n) => n.clone(), - other => { - return Err(Diagnostic::ParseError { - message: format!("expected type name, got {other:?}"), - span: name_token.span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "ParseError", - ), - }); - } - }; - let type_params = self.parse_optional_type_params()?; - - match &self.peek().kind { - TokenKind::LBrace => { - self.bump(); - let fields = self.parse_record_fields()?; - let close = self.expect_kind(TokenKind::RBrace)?; - Ok(SurfaceItem::TypeRecord { - name, - type_params, - fields, - span: SourceSpan::new(self.file, type_kw.span.byte_start, close.span.byte_end), - }) - } - TokenKind::Ident(ref s) if s == "inhabits" => { - let clause_start = self.peek().span.byte_start; - self.bump(); - let inhabits = self.parse_type_expr()?; - let eq = self.expect_kind(TokenKind::Eq)?; - let inhabits_clause_span = - SourceSpan::new(self.file, clause_start, eq.span.byte_end); - self.parse_type_rhs_after_eq( - name, - type_params, - type_kw.span, - Some(inhabits), - Some(inhabits_clause_span), - false, - None, - ) - } - TokenKind::Ident(ref s) if s == "nominal_opaque" => { - self.bump(); - let eq = self.expect_kind(TokenKind::Eq)?; - self.parse_type_rhs_after_eq( - name, - type_params, - type_kw.span, - None, - None, - true, - Some(eq.span.clone()), - ) - } - TokenKind::Eq => { - self.bump(); - self.parse_type_rhs_after_eq( - name, - type_params, - type_kw.span, - None, - None, - false, - None, - ) - } - _ => Ok(SurfaceItem::TypeAtom { - name, - type_params, - span: SourceSpan::new(self.file, type_kw.span.byte_start, name_token.span.byte_end), - }), - } - } - - fn parse_optional_type_params(&mut self) -> Result, Diagnostic> { - if !matches!(self.peek().kind, TokenKind::Lt) { - return Ok(Vec::new()); - } - self.bump(); - let mut params = vec![self.parse_ident()?]; - while matches!(self.peek().kind, TokenKind::Comma) { - self.bump(); - params.push(self.parse_ident()?); - } - self.expect_kind(TokenKind::Gt)?; - Ok(params) - } - - /// Record field labels reuse [`Self::parse_ident`] semantics but also - /// accept `type` — the tokenizer maps it to [`TokenKind::KwType`], yet - /// `dsl/std/resources.dag` names a field `type` on `ResourceHandle`. Field - /// position is unambiguous (`type` cannot start a type expression here). - fn parse_field_label(&mut self) -> Result<(String, SourceSpan), Diagnostic> { - let name_token = self.bump().clone(); - let name = if let TokenKind::Ident(name) = &name_token.kind { - name.clone() - } else if let Some(spelling) = soft_keyword_ident_spelling(&name_token.kind) { - spelling.to_string() - } else { - return Err(Diagnostic::ParseError { - message: format!("expected field label, got {:?}", name_token.kind), - span: name_token.span, - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "ParseError", - ), - }); - }; - Ok((name, name_token.span)) - } - - fn parse_record_fields(&mut self) -> Result, Diagnostic> { - let mut fields = Vec::new(); - while !matches!(self.peek().kind, TokenKind::RBrace) { - let (name, _) = self.parse_field_label()?; - self.expect_kind(TokenKind::Colon)?; - let ty = self.parse_type_expr()?; - fields.push(SurfaceField { name, ty }); - if matches!(self.peek().kind, TokenKind::Comma | TokenKind::Semicolon) { - self.bump(); - } - } - Ok(fields) - } - - /// After `type Name =`, decide between TypeSum (one-or-more variants - /// separated by `|`, or a **single** variant without a top-level `|` when - /// it opens as `Variant { ... }` / `Variant(...)` — PR-A.3 EvalStrategy - /// carrier) and TypeAlias (a single type expression). A variant looks like - /// `Ident`, `Ident(...)`, or `Ident { ... }`. A type expression can start - /// with `Ident<...>` (parameterized), `fn(...)` (arrow), or a bare `Ident` - /// at RHS end (alias to another type — **not** a nullary sum; use - /// `Variant()` for a single nullary sum variant without `|`). - /// - /// Optional alias-RHS `where` (DB-11): `where [, ]*` parses - /// to `SurfaceExpr` (comma-separated parts fold as left-associated `&&`). - #[allow(clippy::too_many_arguments)] - fn parse_type_rhs_after_eq( - &mut self, - name: String, - type_params: Vec, - type_kw_span: SourceSpan, - inhabits: Option, - inhabits_clause_span: Option, - nominal_opaque: bool, - nominal_opaque_clause_span: Option, - ) -> Result { - if !self.rhs_is_sum(&type_params) { - if inhabits.is_some() { - return Err(Diagnostic::ParseError { - message: String::from( - "`inhabits` is only supported when the type RHS is a sum (`A | B | ...`)", - ), - span: inhabits_clause_span - .clone() - .unwrap_or_else(|| type_kw_span.clone()), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "ParseError", - ), - }); - } - let target = self.parse_type_expr()?; - let (refinement, end) = if matches!(self.peek().kind, TokenKind::KwWhere) { - self.parse_type_alias_where_tail()? - } else { - (None, target.span().byte_end) - }; - return Ok(SurfaceItem::TypeAlias { - name, - type_params, - nominal_opaque, - target, - refinement, - span: SourceSpan::new(self.file, type_kw_span.byte_start, end), - }); - } - if nominal_opaque { - return Err(Diagnostic::ParseError { - message: String::from( - "`nominal_opaque` is only supported when the type RHS is an alias", - ), - span: nominal_opaque_clause_span - .clone() - .unwrap_or_else(|| type_kw_span.clone()), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "ParseError", - ), - }); - } - - let variants = self.parse_sum_variants()?; - let end = variants - .last() - .map(|v| v.span.byte_end) - .unwrap_or(type_kw_span.byte_end); - Ok(SurfaceItem::TypeSum { - name, - type_params, - variants, - inhabits, - span: SourceSpan::new(self.file, type_kw_span.byte_start, end), - }) - } - - fn fold_type_alias_where_parts(&self, mut parts: Vec) -> SurfaceExpr { - debug_assert!(!parts.is_empty()); - if parts.len() == 1 { - return parts.pop().expect("len checked"); - } - let mut lhs = parts.remove(0); - for rhs in parts { - let start = crate::lower_helpers::expr_span(&lhs).byte_start; - let end = crate::lower_helpers::expr_span(&rhs).byte_end; - lhs = SurfaceExpr::Operator { - op: OperatorKind::Logical(LogicalOp::And), - args: vec![lhs, rhs], - span: SourceSpan::new(self.file, start, end), - }; - } - lhs - } - - /// After `where`, parse one or more comma-separated expressions until the - /// next top-level item boundary (commas inside calls/parens stay inside - /// `parse_expr`). - /// - /// **Legacy `dsl/std/types.dag` constraint spellings** (`pattern("…")`, - /// `range(min: 1, max: 5)`, `brand("…")`, bare `non_empty`, …) share this - /// same expression surface — there is no parallel implicit-subject - /// micro-grammar: they must tokenize as `SurfaceExpr` so SG-2 can parse - /// the std corpus. `parse_call_args` recognizes `f(a: x, b: y)`-shaped - /// opens so inner commas in `range(min: …, max: …)` are not mistaken for - /// top-level `where` segment separators (they desugar to a single - /// `Record` argument). The same path covers **one** bound, e.g. - /// `range(min: 1)` (still `Ident` + `:` after `(`). SG-2 - /// `handwritten_parser_accepts_types_dag` tokenizes and parses the full - /// `dsl/std/types.dag` corpus; PB-1’s committed `bootstrap_std_generated.rs` - /// snapshot carries **no** parse-phase `Diagnostic` rows for that file. - /// **Lowering** does not emit `Bool` predicate bodies for - /// `dsl/std/types.dag` until helpers resolve (see - /// `lower_type_alias_refinements_phase` / `alloc_deferred_types_dag_refinement_placeholder` - /// in `lower.rs`): a **placeholder** `Declaration::refinement` carries the - /// fact that a `where` was authored (P3 — not a silent `None`), while PB-1 - /// stays diagnostic-clean. - fn parse_type_alias_where_tail(&mut self) -> Result<(Option, u32), Diagnostic> { - self.expect_kind(TokenKind::KwWhere)?; - let mut parts = vec![self.parse_expr()?]; - while matches!(self.peek().kind, TokenKind::Comma) { - self.bump(); - parts.push(self.parse_expr()?); - } - let end = crate::lower_helpers::expr_span(parts.last().expect("at least one where-part")) - .byte_end; - let combined = self.fold_type_alias_where_parts(parts); - Ok((Some(combined), end)) - } - - /// Lookahead: after `=`, is the RHS a sum? True when (a) a top-level `|` - /// exists before the next item boundary, or (b) the RHS opens as - /// `Variant {` / `Variant(` at depth zero (single-variant sum without `|`). - /// Tracks paren/brace depth so a `|` inside a payload list doesn't confuse - /// the scan. [`Self::parse_sum_variants`] skips a **leading** run of `|` - /// tokens so `| A | B` and `A | B` both parse. - /// - /// Do **not** treat [`TokenKind::Ident`] `inhabits` as an item boundary: it - /// can spell a sum variant / record field (see [`Self::parse_field_label`], - /// [`Self::parse_variant`]). - /// - /// [`TokenKind::KwType`] is likewise accepted as a variant/field spelling, - /// but it also begins every top-level `type` declaration. Whitespace is - /// not tokenized, so distinguish `type | …` (variant label) from - /// `type Name =` / `type Name<` / `type Name inhabits` (next decl) via a - /// two-token lookahead when depth is zero. - fn rhs_is_sum(&self, local_alias_reference_idents: &[String]) -> bool { - if self.rhs_opens_single_variant_sum_shape(local_alias_reference_idents) { - return true; - } - let mut i = self.pos; - let mut depth: i32 = 0; - while i < self.tokens.len() { - if let Some(role) = bracket_role(&self.tokens[i].kind) { - match role { - BracketRole::Opener => { - depth += 1; - i += 1; - continue; - } - BracketRole::Closer => { - if depth == 0 { - return false; - } - depth -= 1; - i += 1; - continue; - } - } - } - match &self.tokens[i].kind { - TokenKind::Pipe if depth == 0 => return true, - TokenKind::KwType if depth == 0 => { - let next = self.tokens.get(i + 1).map(|t| &t.kind); - let next2 = self.tokens.get(i + 2).map(|t| &t.kind); - let next_decl = match (next, next2) { - (Some(TokenKind::Ident(_)), Some(TokenKind::Eq | TokenKind::Lt)) => true, - (Some(TokenKind::Ident(_)), Some(TokenKind::Ident(s))) - if s == "inhabits" => - { - true - } - _ => false, - }; - if next_decl { - return false; - } - } - TokenKind::KwWhere | TokenKind::Eof if depth == 0 => return false, - _ if depth == 0 && is_type_rhs_boundary_keyword(&self.tokens[i].kind) => { - return false; - } - _ => {} - } - i += 1; - } - false - } - - /// After `=`, does the RHS open as a single sum variant without a top-level - /// `|`? True for `Variant { ... }`, `Variant(...)` / `Variant()`, and bare - /// `Variant` when the spelling is not a known alias target. False for - /// `Variant` — that begins a parameterized **alias** RHS - /// (`parse_type_expr`), not a variant payload. - fn rhs_opens_single_variant_sum_shape(&self, local_alias_reference_idents: &[String]) -> bool { - let i = self.pos; - let Some(t0) = self.tokens.get(i) else { - return false; - }; - let label = match &t0.kind { - TokenKind::Ident(s) => Some(s.as_str()), - _ => soft_keyword_ident_spelling(&t0.kind), - }; - let Some(label) = label else { - return false; - }; - if matches!( - self.tokens.get(i + 1).map(|t| &t.kind), - Some(TokenKind::LBrace) | Some(TokenKind::LParen) - ) { - return true; - } - let Some(refs) = &self.bare_rhs_alias_reference_idents else { - return false; - }; - if refs.contains(label) - || local_alias_reference_idents - .iter() - .any(|name| name == label) - { - return false; - } - matches!( - self.tokens.get(i + 1).map(|t| &t.kind), - Some(TokenKind::KwWhere | TokenKind::Eof) - ) || self - .tokens - .get(i + 1) - .is_some_and(|t| is_type_rhs_boundary_keyword(&t.kind)) - } - - fn parse_sum_variants(&mut self) -> Result, Diagnostic> { - while matches!(self.peek().kind, TokenKind::Pipe) { - self.bump(); - } - let mut variants = vec![self.parse_variant()?]; - while matches!(self.peek().kind, TokenKind::Pipe) { - self.bump(); - variants.push(self.parse_variant()?); - } - Ok(variants) - } - - fn parse_variant(&mut self) -> Result { - let name_token = self.bump().clone(); - let name = if let TokenKind::Ident(name) = &name_token.kind { - name.clone() - } else if let Some(spelling) = soft_keyword_ident_spelling(&name_token.kind) { - spelling.to_string() - } else { - return Err(Diagnostic::ParseError { - message: format!("expected variant name, got {:?}", name_token.kind), - span: name_token.span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "ParseError", - ), - }); - }; - match &self.peek().kind { - TokenKind::LParen => { - self.bump(); - let payload = self.parse_type_expr_list_until(TokenKind::RParen)?; - let close = self.expect_kind(TokenKind::RParen)?; - Ok(SurfaceVariant { - name, - payload: VariantPayload::Positional(payload), - span: SourceSpan::new( - self.file, - name_token.span.byte_start, - close.span.byte_end, - ), - }) - } - TokenKind::LBrace => { - self.bump(); - let fields = self.parse_record_fields()?; - let close = self.expect_kind(TokenKind::RBrace)?; - Ok(SurfaceVariant { - name, - payload: VariantPayload::Record(fields), - span: SourceSpan::new( - self.file, - name_token.span.byte_start, - close.span.byte_end, - ), - }) - } - _ => Ok(SurfaceVariant { - name, - payload: VariantPayload::Positional(Vec::new()), - span: name_token.span, - }), - } - } - - fn parse_params(&mut self) -> Result, Diagnostic> { - let mut params = Vec::new(); - if matches!(self.peek().kind, TokenKind::RParen) { - return Ok(params); - } - loop { - let name = self.parse_ident()?; - self.expect_kind(TokenKind::Colon)?; - let ty = self.parse_type_expr()?; - // DB-11 (3a.3): optional refinement predicate after the - // parameter's type. Parsed as an ordinary expression in - // the parameter's scope; lowering resolves operators - // against the parameter's type algebra. - let refinement = if matches!(self.peek().kind, TokenKind::KwWhere) { - self.bump(); - Some(self.parse_expr()?) - } else { - None - }; - params.push(SurfaceParam { - name, - ty, - refinement, - }); - if matches!(self.peek().kind, TokenKind::Comma) { - self.bump(); - continue; - } - break; - } - Ok(params) - } - - fn parse_type_expr(&mut self) -> Result { - let mut ty = self.parse_atom_type()?; - while matches!(self.peek().kind, TokenKind::Question) { - let q = self.bump().clone(); - let start = ty.span().byte_start; - ty = SurfaceType::Optional { - inner: Box::new(ty), - span: SourceSpan::new(self.file, start, q.span.byte_end), - }; - } - Ok(ty) - } - - fn parse_atom_type(&mut self) -> Result { - if matches!(self.peek().kind, TokenKind::KwFn) { - let fn_tok = self.bump().clone(); - self.expect_kind(TokenKind::LParen)?; - let inputs = self.parse_type_expr_list_until(TokenKind::RParen)?; - self.expect_kind(TokenKind::RParen)?; - self.expect_kind(TokenKind::Arrow)?; - let output = self.parse_type_expr()?; - let end = output.span().byte_end; - return Ok(SurfaceType::Arrow { - inputs, - output: Box::new(output), - span: SourceSpan::new(self.file, fn_tok.span.byte_start, end), - }); - } - - let token = self.bump().clone(); - let name = match token.kind { - TokenKind::Ident(n) => n, - other => { - return Err(Diagnostic::ParseError { - message: format!("expected type name, got {other:?}"), - span: token.span, - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "ParseError", - ), - }); - } - }; - - if matches!(self.peek().kind, TokenKind::Lt) && self.looks_like_type_args() { - self.bump(); - let args = self.parse_type_angle_arg_list_until_gt()?; - let close = self.expect_kind(TokenKind::Gt)?; - Ok(SurfaceType::Parameterized { - name, - args, - span: SourceSpan::new(self.file, token.span.byte_start, close.span.byte_end), - }) - } else { - Ok(SurfaceType::Named { - name, - span: token.span, - }) - } - } - - /// `<` is ambiguous: type-parameter delimiter vs. less-than operator. In - /// type position (parse_atom_type), we only see `<` after a bare Ident, so - /// it's always type args. In expression position (parse_comparison), - /// parse_atom_type is not called. This helper exists for defensive future - /// callers and currently always returns true. - fn looks_like_type_args(&self) -> bool { - true - } - - /// Decimal width literal permitted **only** inside `<…>` type-argument lists - /// (e.g. `Int<64>`). Standalone `let x: 64 = …` must stay a parse error — gate #60 - /// (single authority: this fragment is spliced by `regen_parse`; do not edit only - /// `parse_generated.rs` without updating here). - fn parse_width_nat_type_argument(&mut self) -> Result { - let token = self.bump().clone(); - match token.kind { - TokenKind::IntLit(decimal) => Ok(TypeAngleArg::WidthNatLiteral { - decimal, - span: token.span, - }), - other => Err(Diagnostic::ParseError { - message: format!("expected decimal width literal, got {other:?}"), - span: token.span, - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "ParseError", - ), - }), - } - } - - fn parse_type_angle_arg_list_until_gt(&mut self) -> Result, Diagnostic> { - let end = TokenKind::Gt; - let mut args = Vec::new(); - if self.peek().kind == end { - return Ok(args); - } - loop { - if matches!(self.peek().kind, TokenKind::IntLit(_)) { - args.push(self.parse_width_nat_type_argument()?); - } else { - let ty = self.parse_type_expr()?; - args.push(TypeAngleArg::TypeExpr { ty: Box::new(ty) }); - } - if matches!(self.peek().kind, TokenKind::Comma) { - self.bump(); - continue; - } - break; - } - Ok(args) - } - - fn parse_type_expr_list_until( - &mut self, - end: TokenKind, - ) -> Result, Diagnostic> { - let mut types = Vec::new(); - if self.peek().kind == end { - return Ok(types); - } - loop { - types.push(self.parse_type_expr()?); - if matches!(self.peek().kind, TokenKind::Comma) { - self.bump(); - continue; - } - break; - } - Ok(types) - } - - fn parse_ident(&mut self) -> Result { - let token = self.bump().clone(); - match token.kind { - TokenKind::Ident(name) => Ok(name), - other => Err(Diagnostic::ParseError { - message: format!("expected identifier, got {other:?}"), - span: token.span, - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "ParseError", - ), - }), - } - } - - fn parse_expr(&mut self) -> Result { - self.parse_logical_or() - } - - // Per-precedence-level functions below are lowest-to-highest binding - // (Or → And → Comparison → Additive → Multiplicative). The token → - // `OperatorKind` map for each level is authored declaratively in - // `parse_tables.dag` and consumed via `binary_op_at_level`; this file - // owns control flow (chaining, non-chaining, span fusion) only. - - fn parse_logical_or(&mut self) -> Result { - let mut lhs = self.parse_logical_and()?; - while let Some(op) = binary_op_at_level(&self.peek().kind, BinaryOpLevel::Or) { - self.bump(); - let rhs = self.parse_logical_and()?; - let start = expr_span(&lhs).byte_start; - let end = expr_span(&rhs).byte_end; - lhs = SurfaceExpr::Operator { - op, - args: vec![lhs, rhs], - span: SourceSpan::new(self.file, start, end), - }; - } - Ok(lhs) - } - - fn parse_logical_and(&mut self) -> Result { - let mut lhs = self.parse_comparison()?; - while let Some(op) = binary_op_at_level(&self.peek().kind, BinaryOpLevel::And) { - self.bump(); - let rhs = self.parse_comparison()?; - let start = expr_span(&lhs).byte_start; - let end = expr_span(&rhs).byte_end; - lhs = SurfaceExpr::Operator { - op, - args: vec![lhs, rhs], - span: SourceSpan::new(self.file, start, end), - }; - } - Ok(lhs) - } - - fn parse_comparison(&mut self) -> Result { - let lhs = self.parse_additive()?; - if let Some(op) = binary_op_at_level(&self.peek().kind, BinaryOpLevel::Comparison) { - self.bump(); - let rhs = self.parse_additive()?; - let start = expr_span(&lhs).byte_start; - let end = expr_span(&rhs).byte_end; - Ok(SurfaceExpr::Operator { - op, - args: vec![lhs, rhs], - span: SourceSpan::new(self.file, start, end), - }) - } else { - Ok(lhs) - } - } - - fn parse_additive(&mut self) -> Result { - let mut lhs = self.parse_term()?; - while let Some(op) = binary_op_at_level(&self.peek().kind, BinaryOpLevel::Additive) { - self.bump(); - let rhs = self.parse_term()?; - let start = expr_span(&lhs).byte_start; - let end = expr_span(&rhs).byte_end; - lhs = SurfaceExpr::Operator { - op, - args: vec![lhs, rhs], - span: SourceSpan::new(self.file, start, end), - }; - } - Ok(lhs) - } - - fn parse_term(&mut self) -> Result { - let mut lhs = self.parse_pipe()?; - while let Some(op) = binary_op_at_level(&self.peek().kind, BinaryOpLevel::Multiplicative) { - self.bump(); - let rhs = self.parse_pipe()?; - let start = expr_span(&lhs).byte_start; - let end = expr_span(&rhs).byte_end; - lhs = SurfaceExpr::Operator { - op, - args: vec![lhs, rhs], - span: SourceSpan::new(self.file, start, end), - }; - } - Ok(lhs) - } - - fn parse_pipe(&mut self) -> Result { - let mut lhs = self.parse_primary()?; - while matches!(self.peek().kind, TokenKind::PipeArrow) { - self.bump(); - lhs = self.parse_pipe_target(lhs)?; - } - Ok(lhs) - } - - fn parse_pipe_target(&mut self, lhs: SurfaceExpr) -> Result { - let start = expr_span(&lhs).byte_start; - let target_token = self.bump().clone(); - let target_expr = match target_token.kind { - TokenKind::Ident(name) => self.parse_ident_expr(name, target_token.span.clone())?, - other => { - return Err(Diagnostic::ParseError { - message: format!( - "expected function name after `|>`, got {other:?} — pipe desugars only to `f` or `f(...)`" - ), - span: target_token.span, - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("ParseError"), - }); - } - }; - match target_expr { - SurfaceExpr::Var { name, span } => Ok(SurfaceExpr::Call { - target: name, - args: vec![lhs], - span: SourceSpan::new(self.file, start, span.byte_end), - }), - SurfaceExpr::Call { - target, - mut args, - span, - } => { - let mut injected_args = Vec::with_capacity(args.len() + 1); - injected_args.push(lhs); - injected_args.append(&mut args); - Ok(SurfaceExpr::Call { - target, - args: injected_args, - span: SourceSpan::new(self.file, start, span.byte_end), - }) - } - SurfaceExpr::Path { span, .. } => Err(Diagnostic::ParseError { - message: - "expected function name or call after `|>`; dotted paths are not callable in the current surface grammar" - .to_string(), - span, - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("ParseError"), - }), - SurfaceExpr::PathCall { span, .. } => Err(Diagnostic::ParseError { - message: - "expected function name or call after `|>`; dotted-path calls are not pipe targets in the current surface grammar" - .to_string(), - span, - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("ParseError"), - }), - SurfaceExpr::VariantRecord { span, .. } => Err(Diagnostic::ParseError { - message: - "expected function name or call after `|>`; named constructor literals are values, not callable pipe targets" - .to_string(), - span, - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("ParseError"), - }), - _ => unreachable!("parse_ident_expr only returns Var, Call, Path, PathCall, or VariantRecord"), - } - } - - fn parse_primary(&mut self) -> Result { - let peek = &self.peek().kind; - // Map literals share the `{` prefix with record literals. Top-level `data` - // disambiguates via `looks_like_map_literal` before `parse_record_literal`; - // mirror that here so nested `Map` fields (e.g. GitHub Actions - // `with:`) can use string keys like `"fetch-depth"`. - if matches!(peek, TokenKind::LBrace) && self.looks_like_map_literal() { - return self.parse_map_literal(); - } - match primary_prefix_dispatch(peek) { - Some(PrimaryPrefixDispatch::If) => return self.parse_if(), - Some(PrimaryPrefixDispatch::Match) => return self.parse_match(), - Some(PrimaryPrefixDispatch::Record) => return self.parse_record_literal(), - Some(PrimaryPrefixDispatch::List) => return self.parse_list_literal(), - Some(PrimaryPrefixDispatch::Caret) => return self.parse_caret(), - None => {} - } - let token = self.bump().clone(); - let cls = primary_atom_class(&token.kind).ok_or_else(|| Diagnostic::ParseError { - message: format!("expected primary expression, got {:?}", token.kind), - span: token.span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("ParseError"), - })?; - match (cls, token.kind) { - (PrimaryAtomClass::IntLiteral, TokenKind::IntLit(value)) => Ok(SurfaceExpr::Literal { - value: SurfaceLiteral::Int(value), - span: token.span, - }), - (PrimaryAtomClass::True, TokenKind::KwTrue) => Ok(SurfaceExpr::Literal { - value: SurfaceLiteral::Bool(true), - span: token.span, - }), - (PrimaryAtomClass::False, TokenKind::KwFalse) => Ok(SurfaceExpr::Literal { - value: SurfaceLiteral::Bool(false), - span: token.span, - }), - (PrimaryAtomClass::String, TokenKind::StringLit(value)) => Ok(SurfaceExpr::Literal { - value: SurfaceLiteral::String(value), - span: token.span, - }), - (PrimaryAtomClass::Pipe, TokenKind::Pipe) => self.parse_lambda(token.span), - (PrimaryAtomClass::Ident, TokenKind::Ident(name)) => { - self.parse_ident_expr(name, token.span) - } - (class, other) => Err(Diagnostic::ParseError { - message: format!( - "internal: primary-atom class {class:?} does not match `TokenKind` {other:?} \ - (fix `PrimaryAtomRow` in `parse_tables.dag` or `regen_parse_tables` output)" - ), - span: token.span, - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "ParseError", - ), - }), - } - } - - /// `^IDENT` → opaque `Symbol` literal (spelling only; no name resolution). - /// `^(Expr)` → `discriminant(Expr)` surface sugar (reify ctor name of value). - fn parse_caret(&mut self) -> Result { - let caret = self.expect_kind(TokenKind::Caret)?; - let start = caret.span.byte_start; - match &self.peek().kind { - TokenKind::Ident(_name) => { - let ident = self.bump().clone(); - let TokenKind::Ident(spelling) = ident.kind else { - unreachable!("peek matched Ident"); - }; - Ok(SurfaceExpr::Literal { - value: SurfaceLiteral::Symbol(spelling), - span: SourceSpan::new(self.file, start, ident.span.byte_end), - }) - } - TokenKind::LParen => { - self.bump(); - let inner = self.parse_expr()?; - let close = self.expect_kind(TokenKind::RParen)?; - Ok(SurfaceExpr::Call { - target: "discriminant".to_string(), - args: vec![inner], - span: SourceSpan::new(self.file, start, close.span.byte_end), - }) - } - other => Err(Diagnostic::ParseError { - message: format!( - "expected identifier or `(` after `^` (symbol literal or discriminant), got {other:?}" - ), - span: self.peek().span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("ParseError"), - }), - } - } - - fn parse_list_literal(&mut self) -> Result { - let open = self.expect_kind(TokenKind::LBracket)?; - let mut elements = Vec::new(); - while !matches!(self.peek().kind, TokenKind::RBracket) { - elements.push(self.parse_expr()?); - if matches!(self.peek().kind, TokenKind::Comma) { - self.bump(); - } else if !matches!(self.peek().kind, TokenKind::RBracket) { - return Err(Diagnostic::ParseError { - message: format!( - "expected `,` or `]` in list literal, got {:?}", - self.peek().kind - ), - span: self.peek().span.clone(), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "ParseError", - ), - }); - } - } - let close = self.expect_kind(TokenKind::RBracket)?; - Ok(SurfaceExpr::List { - elements, - span: SourceSpan::new(self.file, open.span.byte_start, close.span.byte_end), - }) - } - - fn parse_ident_expr( - &mut self, - name: String, - span: SourceSpan, - ) -> Result { - if matches!(self.peek().kind, TokenKind::LParen) { - self.bump(); - let args = self.parse_call_args()?; - let close = self.expect_kind(TokenKind::RParen)?; - let start = span.byte_start; - let end = close.span.byte_end; - Ok(SurfaceExpr::Call { - target: name, - args, - span: SourceSpan::new(self.file, start, end), - }) - } else if matches!(self.peek().kind, TokenKind::LBrace) && !self.brace_starts_match_arms() { - let (fields, fields_span) = self.parse_named_expr_fields()?; - Ok(SurfaceExpr::VariantRecord { - target: name, - fields, - span: SourceSpan::new(self.file, span.byte_start, fields_span.byte_end), - }) - } else if matches!(self.peek().kind, TokenKind::Dot) { - // Member-access chain: Ident (. Ident)+. Always - // reads at least one additional segment because - // the Dot is in the peek. Lowers to - // `SurfaceExpr::Path` for downstream resolution - // via top-level symbol + Conj-child walk by label. - let mut segments = vec![name]; - let mut segment_spans = vec![span.clone()]; - let start = span.byte_start; - let mut end = span.byte_end; - while matches!(self.peek().kind, TokenKind::Dot) { - self.bump(); - let next = self.bump().clone(); - match next.kind { - TokenKind::Ident(n) => { - end = next.span.byte_end; - segments.push(n); - segment_spans.push(next.span.clone()); - } - other => { - return Err(Diagnostic::ParseError { - message: format!( - "expected identifier after `.` in dotted path, got {other:?}" - ), - span: next.span, - correction: - crate::diagnostics::Correction::deferred_for_diagnostic_class( - "ParseError", - ), - }); - } - } - } - // Prereq-X1: `.(args)` is call-on-field-access. - // After the dotted-segment walk, peek for `(`. If present, - // consume the call args and emit `PathCall`. The lowerer - // (Prereq-X1.a) only accepts `PathCall` whose head segment - // is a static `data` binding with `ValueBody::Structural`; - // parameter heads (X1.b) and other runtime-sourced heads - // produce typed lowering diagnostics. - if matches!(self.peek().kind, TokenKind::LParen) { - self.bump(); - let args = self.parse_call_args()?; - let close = self.expect_kind(TokenKind::RParen)?; - return Ok(SurfaceExpr::PathCall { - segments, - segment_spans, - args, - span: SourceSpan::new(self.file, start, close.span.byte_end), - }); - } - Ok(SurfaceExpr::Path { - segments, - segment_spans, - span: SourceSpan::new(self.file, start, end), - }) - } else { - Ok(SurfaceExpr::Var { name, span }) - } - } - - fn parse_lambda(&mut self, open_span: SourceSpan) -> Result { - let mut params = Vec::new(); - if !matches!(self.peek().kind, TokenKind::Pipe) { - loop { - let token = self.bump().clone(); - match token.kind { - TokenKind::Ident(name) => params.push(name), - other => { - return Err(Diagnostic::ParseError { - message: format!( - "expected identifier in lambda parameter list, got {other:?}" - ), - span: token.span, - correction: - crate::diagnostics::Correction::deferred_for_diagnostic_class( - "ParseError", - ), - }); - } - } - if matches!(self.peek().kind, TokenKind::Comma) { - self.bump(); - continue; - } - break; - } - } - self.expect_kind(TokenKind::Pipe)?; - let body = self.parse_expr()?; - let end = expr_span(&body).byte_end; - Ok(SurfaceExpr::Lambda { - params, - body: Box::new(body), - span: SourceSpan::new(self.file, open_span.byte_start, end), - }) - } - - /// True when the next argument is `label:` — enables `f(a: 1, b: 2)` call sugar - /// that desugars to `f(Record { a: 1, b: 2 })` so `types.dag` refinements like - /// `range(min: 1, max: 5)` parse without changing the `SurfaceExpr::Call` shape. - fn call_args_open_with_named_field(&self) -> bool { - matches!( - self.tokens.get(self.pos).map(|t| &t.kind), - Some(TokenKind::Ident(_)) - ) && matches!( - self.tokens.get(self.pos + 1).map(|t| &t.kind), - Some(TokenKind::Colon) - ) - } - - /// Parse `label: expr` groups separated by commas until `)` (not consumed). - fn parse_paren_named_field_call_args(&mut self) -> Result { - let start = self.peek().span.byte_start; - let mut fields: Vec = Vec::new(); - loop { - let (field_name, name_span) = self.parse_field_label()?; - self.expect_kind(TokenKind::Colon)?; - let value = self.parse_expr()?; - let field_end = expr_span(&value).byte_end; - fields.push(SurfaceRecordField { - name: field_name, - value, - span: SourceSpan::new(self.file, name_span.byte_start, field_end), - }); - if matches!(self.peek().kind, TokenKind::Comma) { - self.bump(); - continue; - } - break; - } - let end = fields.last().map(|f| f.span.byte_end).unwrap_or(start); - Ok(SurfaceExpr::Record { - fields, - span: SourceSpan::new(self.file, start, end), - }) - } - - fn parse_call_args(&mut self) -> Result, Diagnostic> { - let mut args = Vec::new(); - if matches!(self.peek().kind, TokenKind::RParen) { - return Ok(args); - } - if self.call_args_open_with_named_field() { - args.push(self.parse_paren_named_field_call_args()?); - return Ok(args); - } - loop { - args.push(self.parse_expr()?); - if matches!(self.peek().kind, TokenKind::Comma) { - self.bump(); - continue; - } - break; - } - Ok(args) - } - - fn parse_if(&mut self) -> Result { - let if_token = self.bump().clone(); - debug_assert!(matches!(if_token.kind, TokenKind::KwIf)); - let cond = self.parse_expr()?; - self.expect_kind(TokenKind::KwThen)?; - let then_branch = self.parse_expr()?; - self.expect_kind(TokenKind::KwElse)?; - let else_branch = self.parse_expr()?; - let start = if_token.span.byte_start; - let end = expr_span(&else_branch).byte_end; - Ok(SurfaceExpr::If { - cond: Box::new(cond), - then_branch: Box::new(then_branch), - else_branch: Box::new(else_branch), - span: SourceSpan::new(self.file, start, end), - }) - } - - /// Parse a `match { => ... }` - /// expression. At M1(2.8) patterns are limited to bare variant - /// constructors (`Ident`), positional single-payload captures - /// (`Variant(binding)`), and named-payload captures - /// (`Variant { field: binding }`). Arms are brace-separated with - /// optional comma between them for readability; we accept either. - fn parse_match(&mut self) -> Result { - let match_token = self.bump().clone(); - debug_assert!(matches!(match_token.kind, TokenKind::KwMatch)); - let scrutinee = self.parse_expr()?; - self.expect_kind(TokenKind::LBrace)?; - let mut arms: Vec = Vec::new(); - while !matches!(self.peek().kind, TokenKind::RBrace) { - arms.push(self.parse_match_arm()?); - // Accept an optional comma between arms. - if matches!(self.peek().kind, TokenKind::Comma) { - self.bump(); - } - } - let close = self.expect_kind(TokenKind::RBrace)?; - let start = match_token.span.byte_start; - let end = close.span.byte_end; - Ok(SurfaceExpr::Match { - scrutinee: Box::new(scrutinee), - arms, - span: SourceSpan::new(self.file, start, end), - }) - } - - fn parse_match_arm(&mut self) -> Result { - let name_token = self.bump().clone(); - let pattern = match &name_token.kind { - TokenKind::Ident(name) => { - if matches!(self.peek().kind, TokenKind::LParen) { - self.bump(); - let binding_token = self.bump().clone(); - let binding_name = match &binding_token.kind { - TokenKind::Ident(binding) => binding.clone(), - other => { - return Err(Diagnostic::ParseError { - message: format!( - "expected binding name in payload match pattern after `{name}(`, got {other:?}" - ), - span: binding_token.span, - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("ParseError"), - }); - } - }; - let close = self.expect_kind(TokenKind::RParen)?; - SurfacePattern::VariantWith { - name: name.clone(), - binding: binding_name, - span: SourceSpan::new( - self.file, - name_token.span.byte_start, - close.span.byte_end, - ), - } - } else if matches!(self.peek().kind, TokenKind::LBrace) { - let (fields, fields_span) = self.parse_named_pattern_fields()?; - SurfacePattern::VariantFields { - name: name.clone(), - fields, - span: SourceSpan::new( - self.file, - name_token.span.byte_start, - fields_span.byte_end, - ), - } - } else { - SurfacePattern::BareVariant { - name: name.clone(), - span: name_token.span.clone(), - } - } - } - other => { - return Err(Diagnostic::ParseError { - message: format!( - "expected variant name in match pattern, got {other:?} — M1(2.8) supports `Variant => expr`, `Variant(binding) => expr`, and `Variant {{ field: binding }} => expr`" - ), - span: name_token.span, - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("ParseError"), - }); - } - }; - self.expect_kind(TokenKind::FatArrow)?; - let body = self.parse_expr()?; - let start = name_token.span.byte_start; - let end = expr_span(&body).byte_end; - Ok(SurfaceMatchArm { - pattern, - body, - span: SourceSpan::new(self.file, start, end), - }) - } -} - -pub(crate) fn expr_span(expr: &SurfaceExpr) -> &SourceSpan { - match expr { - SurfaceExpr::Literal { span, .. } - | SurfaceExpr::Var { span, .. } - | SurfaceExpr::Path { span, .. } - | SurfaceExpr::Call { span, .. } - | SurfaceExpr::VariantRecord { span, .. } - | SurfaceExpr::Operator { span, .. } - | SurfaceExpr::Lambda { span, .. } - | SurfaceExpr::If { span, .. } - | SurfaceExpr::Match { span, .. } - | SurfaceExpr::Record { span, .. } - | SurfaceExpr::List { span, .. } - | SurfaceExpr::Map { span, .. } - | SurfaceExpr::PathCall { span, .. } => span, - } -} diff --git a/src/v3/compiler/src/parse_surface_generated.rs b/src/v3/compiler/src/parse_surface_generated.rs deleted file mode 100644 index ab4b115263a..00000000000 --- a/src/v3/compiler/src/parse_surface_generated.rs +++ /dev/null @@ -1,254 +0,0 @@ -// AUTO-GENERATED from `src/v3/std/parse_surface.dag`. -// Regenerate instead of hand-editing. - -#[derive(Debug, Clone, PartialEq, Eq)] -pub struct SurfaceModule { - pub items: Vec, -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub struct SurfaceParam { - pub name: String, - pub ty: SurfaceType, - pub refinement: Option, -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub struct SurfaceField { - pub name: String, - pub ty: SurfaceType, -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub struct SurfaceVariant { - pub name: String, - pub payload: VariantPayload, - pub span: SourceSpan, -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub struct SurfaceRecordField { - pub name: String, - pub value: SurfaceExpr, - pub span: SourceSpan, -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub struct SurfaceMapEntry { - pub key: String, - pub key_span: SourceSpan, - pub value: SurfaceExpr, - pub span: SourceSpan, -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub struct SurfaceMatchArm { - pub pattern: SurfacePattern, - pub body: SurfaceExpr, - pub span: SourceSpan, -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub struct SurfacePatternField { - pub name: String, - pub binding: String, - pub span: SourceSpan, -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum VariantPayload { - Positional(Vec), - Record(Vec), -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum TypeAngleArg { - TypeExpr { - ty: Box, - }, - WidthNatLiteral { - decimal: String, - span: SourceSpan, - }, -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum SurfaceType { - Named { - name: String, - span: SourceSpan, - }, - Parameterized { - name: String, - args: Vec, - span: SourceSpan, - }, - Optional { - inner: Box, - span: SourceSpan, - }, - Arrow { - inputs: Vec, - output: Box, - span: SourceSpan, - }, -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum SurfacePattern { - BareVariant { - name: String, - span: SourceSpan, - }, - VariantWith { - name: String, - binding: String, - span: SourceSpan, - }, - VariantFields { - name: String, - fields: Vec, - span: SourceSpan, - }, -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum SurfaceLiteral { - Int(String), - Bool(bool), - String(String), - Symbol(String), -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum SurfaceExpr { - Literal { - value: SurfaceLiteral, - span: SourceSpan, - }, - Var { - name: String, - span: SourceSpan, - }, - Path { - segments: Vec, - segment_spans: Vec, - span: SourceSpan, - }, - Call { - target: String, - args: Vec, - span: SourceSpan, - }, - PathCall { - segments: Vec, - segment_spans: Vec, - args: Vec, - span: SourceSpan, - }, - VariantRecord { - target: String, - fields: Vec, - span: SourceSpan, - }, - Operator { - op: OperatorKind, - args: Vec, - span: SourceSpan, - }, - Lambda { - params: Vec, - body: Box, - span: SourceSpan, - }, - If { - cond: Box, - then_branch: Box, - else_branch: Box, - span: SourceSpan, - }, - Match { - scrutinee: Box, - arms: Vec, - span: SourceSpan, - }, - Record { - fields: Vec, - span: SourceSpan, - }, - List { - elements: Vec, - span: SourceSpan, - }, - Map { - entries: Vec, - span: SourceSpan, - }, -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum SurfaceItem { - Let { - name: String, - type_ann: Option, - expr: SurfaceExpr, - }, - Fn { - name: String, - type_params: Vec, - params: Vec, - return_type: SurfaceType, - body: SurfaceExpr, - span: SourceSpan, - }, - FnExternalBody { - name: String, - type_params: Vec, - params: Vec, - return_type: SurfaceType, - body_span: SourceSpan, - span: SourceSpan, - }, - Data { - name: String, - ty: SurfaceType, - body: Option, - body_span: SourceSpan, - span: SourceSpan, - }, - Module { - path: Vec, - span: SourceSpan, - }, - Import { - path: Vec, - names: Vec, - span: SourceSpan, - }, - TypeAtom { - name: String, - type_params: Vec, - span: SourceSpan, - }, - TypeRecord { - name: String, - type_params: Vec, - fields: Vec, - span: SourceSpan, - }, - TypeSum { - name: String, - type_params: Vec, - variants: Vec, - inhabits: Option, - span: SourceSpan, - }, - TypeAlias { - name: String, - type_params: Vec, - nominal_opaque: bool, - target: SurfaceType, - refinement: Option, - span: SourceSpan, - }, -} diff --git a/src/v3/compiler/src/parse_tables_generated.rs b/src/v3/compiler/src/parse_tables_generated.rs deleted file mode 100644 index bd6a16236c5..00000000000 --- a/src/v3/compiler/src/parse_tables_generated.rs +++ /dev/null @@ -1,178 +0,0 @@ -// AUTO-GENERATED from `src/v3/compiler/parse_tables.dag` via -// `regen_parse_tables`. Regenerate instead of hand-editing. - -use crate::dag::{ArithmeticOp, ComparisonOp, LogicalOp, OperatorKind}; -use crate::tokenize::TokenKind; - -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum BinaryOpLevel { - Or, - And, - Comparison, - Additive, - Multiplicative, -} - -/// Token-to-`OperatorKind` map for the parser's per-precedence-level -/// functions. Authored as `binary_op_*: BinaryOpRow` rows in -/// `src/v3/compiler/parse_tables.dag`; regenerated by `regen_parse_tables`. -pub fn binary_op_at_level(tk: &TokenKind, level: BinaryOpLevel) -> Option { - match (tk, level) { - (TokenKind::AmpAmp, BinaryOpLevel::And) => Some(OperatorKind::Logical(LogicalOp::And)), - (TokenKind::EqEq, BinaryOpLevel::Comparison) => { - Some(OperatorKind::Comparison(ComparisonOp::Eq)) - } - (TokenKind::Ge, BinaryOpLevel::Comparison) => { - Some(OperatorKind::Comparison(ComparisonOp::Ge)) - } - (TokenKind::Gt, BinaryOpLevel::Comparison) => { - Some(OperatorKind::Comparison(ComparisonOp::Gt)) - } - (TokenKind::Le, BinaryOpLevel::Comparison) => { - Some(OperatorKind::Comparison(ComparisonOp::Le)) - } - (TokenKind::Lt, BinaryOpLevel::Comparison) => { - Some(OperatorKind::Comparison(ComparisonOp::Lt)) - } - (TokenKind::Minus, BinaryOpLevel::Additive) => { - Some(OperatorKind::Arithmetic(ArithmeticOp::Sub)) - } - (TokenKind::NotEq, BinaryOpLevel::Comparison) => { - Some(OperatorKind::Comparison(ComparisonOp::Ne)) - } - (TokenKind::PipePipe, BinaryOpLevel::Or) => Some(OperatorKind::Logical(LogicalOp::Or)), - (TokenKind::Plus, BinaryOpLevel::Additive) => { - Some(OperatorKind::Arithmetic(ArithmeticOp::Add)) - } - (TokenKind::Slash, BinaryOpLevel::Multiplicative) => { - Some(OperatorKind::Arithmetic(ArithmeticOp::Div)) - } - (TokenKind::Star, BinaryOpLevel::Multiplicative) => { - Some(OperatorKind::Arithmetic(ArithmeticOp::Mul)) - } - _ => None, - } -} - -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum ItemDispatchKind { - Data, - Fn, - Import, - Let, - Module, - Type, -} - -/// Top-level item keyword (`parse_item`) → dispatch class. -/// `ItemDispatchKind` is emitted from unique `Kw`-stripped labels of -/// `TopLevelItemKwRow { token_variant }` rows — not authored as a substrate coproduct. -pub fn top_level_item_dispatch(kind: &TokenKind) -> Option { - match kind { - TokenKind::KwData => Some(ItemDispatchKind::Data), - TokenKind::KwFn => Some(ItemDispatchKind::Fn), - TokenKind::KwImport => Some(ItemDispatchKind::Import), - TokenKind::KwLet => Some(ItemDispatchKind::Let), - TokenKind::KwModule => Some(ItemDispatchKind::Module), - TokenKind::KwType => Some(ItemDispatchKind::Type), - _ => None, - } -} - -/// Keyword membership table for top-level type-RHS boundary lookahead. -/// Projected from the existing `TopLevelItemKwRow` rows in -/// `src/v3/compiler/parse_tables.dag`. -pub fn is_type_rhs_boundary_keyword(kind: &TokenKind) -> bool { - matches!( - kind, - TokenKind::KwData - | TokenKind::KwFn - | TokenKind::KwImport - | TokenKind::KwLet - | TokenKind::KwModule - | TokenKind::KwType - ) -} - -/// Keyword tokens that the parser accepts as bare identifier spellings -/// in label/name positions (`parse_field_label`, `parse_variant`). -/// Projected from `SoftKeywordIdentRow { token_variant }` rows in -/// `src/v3/compiler/parse_tables.dag`. -pub fn soft_keyword_ident_spelling(kind: &TokenKind) -> Option<&'static str> { - match kind { - TokenKind::KwType => Some("type"), - _ => None, - } -} - -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum BracketRole { - Closer, - Opener, -} - -/// Bracket opener/closer role for depth-tracking token scans -/// (`skip_where_clause`, `rhs_is_sum` in `parse_parser_body.txt`). -/// Authored as `bracket_*: BracketRow` rows in -/// `src/v3/compiler/parse_tables.dag`; regenerated by `regen_parse_tables`. -pub fn bracket_role(kind: &TokenKind) -> Option { - match kind { - TokenKind::LBrace => Some(BracketRole::Opener), - TokenKind::LBracket => Some(BracketRole::Opener), - TokenKind::LParen => Some(BracketRole::Opener), - TokenKind::RBrace => Some(BracketRole::Closer), - TokenKind::RBracket => Some(BracketRole::Closer), - TokenKind::RParen => Some(BracketRole::Closer), - _ => None, - } -} - -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum PrimaryPrefixDispatch { - Caret, - If, - List, - Match, - Record, -} - -/// Peek token at the start of `parse_primary` → which dedicated parser to run. -/// Authored as `primary_prefix_*: PrimaryPrefixRow` rows in -/// `src/v3/compiler/parse_tables.dag`; regenerated by `regen_parse_tables`. -/// `PrimaryPrefixDispatch` is emitted from those rows — not a substrate coproduct. -pub fn primary_prefix_dispatch(kind: &TokenKind) -> Option { - match kind { - TokenKind::Caret => Some(PrimaryPrefixDispatch::Caret), - TokenKind::KwIf => Some(PrimaryPrefixDispatch::If), - TokenKind::KwMatch => Some(PrimaryPrefixDispatch::Match), - TokenKind::LBrace => Some(PrimaryPrefixDispatch::Record), - TokenKind::LBracket => Some(PrimaryPrefixDispatch::List), - _ => None, - } -} - -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum PrimaryAtomClass { - False, - Ident, - IntLiteral, - Pipe, - String, - True, -} - -/// After the `parse_primary` prefix pass, the bumped token is one of the -/// atomic primary forms. Authored as `primary_atom_*: PrimaryAtomRow` rows in -/// `src/v3/compiler/parse_tables.dag`; regenerated by `regen_parse_tables`. -/// `PrimaryAtomClass` is emitted from those rows — not a substrate coproduct. -pub fn primary_atom_class(kind: &TokenKind) -> Option { - match kind { - TokenKind::Ident(_) => Some(PrimaryAtomClass::Ident), - TokenKind::IntLit(_) => Some(PrimaryAtomClass::IntLiteral), - TokenKind::KwFalse => Some(PrimaryAtomClass::False), - TokenKind::KwTrue => Some(PrimaryAtomClass::True), - TokenKind::Pipe => Some(PrimaryAtomClass::Pipe), - TokenKind::StringLit(_) => Some(PrimaryAtomClass::String), - _ => None, - } -} diff --git a/src/v3/compiler/src/pb_method_template_projection.rs b/src/v3/compiler/src/pb_method_template_projection.rs deleted file mode 100644 index 4b6ab40c29e..00000000000 --- a/src/v3/compiler/src/pb_method_template_projection.rs +++ /dev/null @@ -1,1447 +0,0 @@ -//! PB-Bootstrap-Process consumer hook: project `MethodTemplateContract` rows -//! from the full bootstrap `Dag`. -//! -//! Implements **R3 row 85 / PB #1560 Gap 4** per the decision in -//! `docs/decisions/r3-row85-method-template-read-surface.md`. The single -//! row authority remains `src/v3/std/{rust,python,go}_method_template_contracts.dag`; -//! this module exposes a target-keyed structural projection of those rows -//! over the lowered bootstrap `Dag` so PB-zero / v2-retirement consumers can -//! select rows by target + `MethodRef` without: -//! -//! - importing `v3.std.*` into v2 crates (Gap 4 acceptance A1), -//! - introducing a second `Map` template-text authority (A2), -//! - copying any template strings into v2 sources (A3). -//! -//! All five `MethodTemplateContract` fields (`dag_method`, `runtime_template`, -//! `emit_template`, `wraps_result`, `placeholder_convention`) are preserved -//! by typed Rust mirrors below (A4). `emit_template` and -//! `placeholder_convention` are sum carriers; their substrate identity is -//! preserved as constructor-tagged enums, not flattened to strings. -//! -//! Gap 4 only — `LanguageSpec.method_templates` rewrite (Gap 5) and v2 leaf -//! emit migration are sequenced strictly after this hook lands. No v2 -//! consumer is migrated by this module. - -use std::collections::HashMap; - -use crate::dag::{Dag, DeclarationId, FieldValue, LiteralBits, TypeConnective, ValueBody}; - -/// Target language whose `MethodTemplateContract` row list is being projected. -/// -/// 🟢 TERMINAL at the per-target row-list scope. The three inhabitants -/// mirror the three closed list-declaration authorities under -/// `src/v3/std/{rust,python,go}_method_template_contracts.dag`. New -/// targets land by adding a row-list authority + a constructor here -/// together; no other dissolution path applies. -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -pub enum MethodTemplateTarget { - Rust, - Python, - Go, -} - -impl MethodTemplateTarget { - /// Per-target list-declaration name in the bootstrap `Dag`. The strings - /// here mirror the data declaration names in - /// `src/v3/std/{rust,python,go}_method_template_contracts.dag` and are - /// the *names of structural declarations*, not template text. - fn list_declaration_name(self) -> &'static str { - match self { - MethodTemplateTarget::Rust => "rust_method_template_contracts", - MethodTemplateTarget::Python => "python_method_template_contracts", - MethodTemplateTarget::Go => "go_method_template_contracts", - } - } -} - -/// Projected `MethodEmitTemplate` (substrate sum at -/// `src/v3/std/emit_model.dag:469-474`). -/// -/// 🟢 TERMINAL at target method-emission-template scope, inheriting the -/// terminality of the substrate carrier (`MethodEmitTemplate` is marked -/// 🟢 TERMINAL at `emit_model.dag:453`). The two-variant split between -/// inline-lambda and function-reference renderings is the closed semantic -/// case the substrate already locks; new variants here would mean the -/// substrate carrier itself moved. -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum MethodEmitTemplateProjection { - Single { - template: String, - }, - HigherOrder { - inline_template: String, - fn_ref_template: String, - }, -} - -/// Projected `PlaceholderConvention` (substrate sum at -/// `src/v3/std/emit_model.dag:449-451`). -/// -/// 🟢 TERMINAL: nullary two-inhabitant sum (`IndexedArgs | NamedArg`) that -/// mirrors the closed substrate carrier. New conventions land by editing -/// the substrate sum first; this projection follows. -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum PlaceholderConventionProjection { - IndexedArgs, - NamedArg, -} - -/// Projected single `MethodTemplateContract` row. -/// -/// `dag_method` is the `DeclarationId` of the `MethodDeclaration` that the -/// row's `MethodRef.decl` field references (the typed, fail-closed substrate -/// identity for the method). Consumers select rows by target + -/// `dag_method` to recover the `(target, method)` template pair. -#[derive(Debug, Clone)] -pub struct MethodTemplateContractRow { - pub dag_method: DeclarationId, - pub runtime_template: String, - pub emit_template: MethodEmitTemplateProjection, - pub wraps_result: bool, - pub placeholder_convention: PlaceholderConventionProjection, -} - -/// Fail-closed projection error. Every observable mismatch between the -/// bootstrap `Dag` shape and the `MethodTemplateContract` substrate carrier -/// surfaces here as a typed value (per `INVARIANTS.md` C-8). -/// -/// 🟢 TERMINAL at the projection's bootstrap-mismatch scope. Each variant -/// names a specific structural class the row authorities cannot satisfy; -/// new variants only land if substrate shape grows a new sub-fact (which -/// would itself follow §P1). The carrier is therefore a closed -/// substrate-mismatch enumeration, not a transitional grab-bag. -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum MethodTemplateProjectionError { - /// Per-target row-list declaration is absent from the bootstrap `Dag`. - /// Should be impossible if `BOOTSTRAP_FIXTURE_PATH_KEYS` (`bootstrap.rs`) - /// stays in lockstep with `bootstrap_fixture_authority` and - /// `regen_bootstrap --verify` is green; surfaced rather than panicked - /// so consumers can act on it. - ListDeclarationMissing { name: &'static str }, - /// List declaration has no value body (i.e., not a `data` declaration). - ListDeclarationLacksValueBody { name: &'static str }, - /// List declaration's value body is not `ValueBody::List` — violates the - /// `bootstrap_method_template_contracts_lower_to_list_with_empty_diagnostics` - /// gate per the row-85 decision doc. - ListDeclarationValueBodyNotList { name: &'static str }, - /// Row at the given index in the named list is not a record literal. - RowNotRecord { - list: &'static str, - row_index: usize, - }, - /// Row is a declaration reference, but the referenced declaration is not - /// present in the bootstrap `Dag`. - RowReferenceMissing { - list: &'static str, - row_index: usize, - decl_id: DeclarationId, - }, - /// Row is a declaration reference, but the referenced declaration is not a - /// `data` declaration carrying a structural `MethodTemplateContract` body. - RowReferenceNotStructural { - list: &'static str, - row_index: usize, - decl_id: DeclarationId, - }, - /// Row is a declaration reference, but the referenced declaration does - /// not instantiate the `MethodTemplateContract` carrier. A structural - /// lookalike row is still not a contract row authority. - RowReferenceNotMethodTemplateContract { - list: &'static str, - row_index: usize, - decl_id: DeclarationId, - }, - /// Row is missing one of the five required fields. - RowMissingField { - list: &'static str, - row_index: usize, - field: &'static str, - }, - /// Row carries a duplicate field — two entries share a label. The - /// substrate-side `MethodTemplateContract` (and `MethodRef`) carriers - /// declare each field exactly once; duplicates would mean two - /// authorities for the same row coordinate (P2 single-authority). - RowDuplicateField { - list: &'static str, - row_index: usize, - record: &'static str, - field: &'static str, - first_field_index: usize, - duplicate_field_index: usize, - }, - /// Row carries a field whose label is not one of the closed schema - /// (`MethodTemplateContract` = five fields; `MethodRef` = one field). - /// Extra substrate fields land via the substrate carrier, not via - /// projection-side acceptance, so unknown labels surface here rather - /// than being silently ignored (P2 / C-8). - RowUnknownField { - list: &'static str, - row_index: usize, - record: &'static str, - field: String, - field_index: usize, - }, - /// `dag_method` field is not the `MethodRef { decl }` record shape. - DagMethodNotMethodRefRecord { - list: &'static str, - row_index: usize, - }, - /// `MethodRef.decl` is not a typed substrate reference. - MethodRefDeclNotReference { - list: &'static str, - row_index: usize, - }, - /// `MethodRef.decl` references a declaration that does not satisfy - /// the substrate-side `MethodDeclaration` *data-binding* contract - /// (`src/v3/std/methods.dag` + `dsl/std/methods.dag`). Mirrors the - /// Stratum A registry gate - /// (`src/v3/grounding_tests/src/stratum_a.rs::method_registry_name`): - /// the binding must (a) instantiate `MethodDeclaration`, (b) carry - /// a `Structural` value body, (c) have a closed single-`name` field - /// schema, (d) and the `name` value must be a string literal. The - /// `reason` payload identifies which sub-check failed. - MethodRefDeclNotMethodDeclaration { - list: &'static str, - row_index: usize, - decl_id: DeclarationId, - reason: MethodDeclarationBindingViolation, - }, - /// `method_template_contract_row` was called with a `dag_method` - /// `DeclarationId` that does not satisfy the - /// `MethodDeclaration` data-binding contract (same shape and - /// `reason` taxonomy as `MethodRefDeclNotMethodDeclaration`). The - /// helper validates at entry so callers cannot conflate - /// "valid method, no row" with "caller handed in a non-method - /// declaration." - LookupKeyNotMethodDeclaration { - decl_id: DeclarationId, - reason: MethodDeclarationBindingViolation, - }, - /// `MethodDeclaration` itself is missing from the bootstrap `Dag`. - /// Should be impossible if the std fixtures lower cleanly; surfaced - /// rather than panicked so consumers can act on it. - MethodDeclarationCarrierMissing, - /// `runtime_template` field is not a string literal. - RuntimeTemplateNotString { - list: &'static str, - row_index: usize, - }, - /// `wraps_result` field is not a bool literal. - WrapsResultNotBool { - list: &'static str, - row_index: usize, - }, - /// `placeholder_convention` field is not a substrate variant constructor. - PlaceholderConventionNotVariant { - list: &'static str, - row_index: usize, - }, - /// `placeholder_convention` constructor name is unknown. - PlaceholderConventionUnknown { - list: &'static str, - row_index: usize, - constructor: Option, - }, - /// `placeholder_convention` is a nullary sum (`IndexedArgs | NamedArg`), - /// but the variant payload is non-empty. Mirrors the substrate-side - /// canonical-row check - /// `placeholder_convention_canonical_rejects_payload_for_nullary_indexed_args` - /// in `src/v3/grounding_tests/src/stratum_a.rs`. - PlaceholderConventionPayloadNotEmpty { - list: &'static str, - row_index: usize, - constructor: &'static str, - payload_len: usize, - }, - /// `emit_template` field is not a substrate variant constructor. - EmitTemplateNotVariant { - list: &'static str, - row_index: usize, - }, - /// `emit_template` constructor name is unknown. - EmitTemplateUnknownConstructor { - list: &'static str, - row_index: usize, - constructor: Option, - }, - /// `emit_template` `SingleTemplate` payload shape mismatch (expected one - /// string-typed `template` field). - EmitTemplateSinglePayloadShape { - list: &'static str, - row_index: usize, - }, - /// `emit_template` `HigherOrderTemplates` payload shape mismatch - /// (expected two string-typed fields: `inline_template`, `fn_ref_template`). - EmitTemplateHigherOrderPayloadShape { - list: &'static str, - row_index: usize, - }, - /// The `(target, dag_method)` direct lookup helper found more than one row - /// for the same `MethodDeclaration` in the per-target list. Per-target - /// uniqueness by `dag_method` is the substrate-side claim - /// (`method_template_contract_per_target_dag_method_unique`); the helper - /// surfaces a violation rather than silently selecting the first row - /// (P2 single-authority + P3 fail-closed at the public lookup boundary). - DuplicateMethodTemplateRow { - list: &'static str, - first_row_index: usize, - duplicate_row_index: usize, - }, -} - -/// Granular reason for a `MethodDeclaration` data-binding contract failure. -/// -/// 🟢 TERMINAL at the substrate-side data-binding contract scope -/// (`src/v3/std/methods.dag` + Stratum A `method_registry_name`). Each -/// variant maps one of the four sub-checks the contract requires; the -/// substrate-side contract is closed (`MethodDeclaration` carries a -/// single `name: String` field), so this enumeration is closed too. -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum MethodDeclarationBindingViolation { - /// Connective is not `TypeConnective::Instantiation { template, .. }`. - /// Rules out type / sum / record declarations. - ConnectiveNotInstantiation, - /// `Instantiation` connective, but `template` does not match - /// `MethodDeclaration`'s declaration id. Rules out instantiations of - /// unrelated targets. - InstantiationTemplateNotMethodDeclaration, - /// `value_body` is `None`. Rules out type aliases of the form - /// `type Foo = MethodDeclaration`. - ValueBodyMissing, - /// `value_body` is `Some(_)` but not `ValueBody::Structural`. Rules - /// out `List` / `Map` / scalar bodies that would be wrong-shaped for - /// a `MethodDeclaration` data binding. - ValueBodyNotStructural, - /// `Structural` body, but its field set does not match the closed - /// `MethodDeclaration` schema (single `name` field). Mirrors - /// `enforce_closed_record_schema` in Stratum A. - StructuralFieldsNotClosedNameOnly { observed_labels: Vec }, - /// Closed-schema match, but the `name` field's `FieldValue` is not - /// `Literal(LiteralBits::String(_))`. - NameNotStringLiteral, -} - -/// Project the `MethodTemplateContract` rows for `target` from the full -/// bootstrap `Dag` snapshot. -/// -/// The expected source for `dag` is `generated_full_bootstrap_dag()` (or its -/// equivalent under PB-1-e dissolution-first per #1558 — see the -/// row-85 decision doc §"Non-Fork Ratchet"). Calling on a partially-built -/// `Dag` that is missing the per-target list authorities surfaces -/// [`MethodTemplateProjectionError::ListDeclarationMissing`] rather than -/// panicking. -/// -/// **Boundary contract:** this is the canonical PB-zero consumer hook for -/// row text. v2-side migrations consume `Vec` and -/// must not store or carry parallel `Map` template tables; -/// the structural carrier is the typed projection above. -pub fn method_template_contract_rows( - dag: &Dag, - target: MethodTemplateTarget, -) -> Result, MethodTemplateProjectionError> { - let list_name = target.list_declaration_name(); - let decl = dag - .declaration_by_name(list_name) - .ok_or(MethodTemplateProjectionError::ListDeclarationMissing { name: list_name })?; - let body = decl - .value_body - .as_ref() - .ok_or(MethodTemplateProjectionError::ListDeclarationLacksValueBody { name: list_name })?; - let ValueBody::List(rows) = body else { - return Err( - MethodTemplateProjectionError::ListDeclarationValueBodyNotList { name: list_name }, - ); - }; - - let projected: Vec = rows - .iter() - .enumerate() - .map(|(row_index, row)| project_row(dag, list_name, row_index, row)) - .collect::>()?; - - // Per-target uniqueness by `dag_method` is the substrate-side claim - // (`method_template_contract_per_target_dag_method_unique`). Enforce it - // at the canonical row-list boundary so v2-retirement consumers that - // build their own keyed tables from the projection cannot silently - // observe two authorities for the same `(target, MethodRef)` pair. - let mut first_seen: HashMap = HashMap::with_capacity(projected.len()); - for (index, row) in projected.iter().enumerate() { - if let Some(prior) = first_seen.get(&row.dag_method) { - return Err(MethodTemplateProjectionError::DuplicateMethodTemplateRow { - list: list_name, - first_row_index: *prior, - duplicate_row_index: index, - }); - } - first_seen.insert(row.dag_method, index); - } - - Ok(projected) -} - -/// Direct `(target, dag_method)` lookup helper for Gap-5 / leaf-emit -/// consumers. Returns the row whose `dag_method` matches `dag_method`, or -/// `None` if the per-target list does not contain a row keyed by that -/// `MethodDeclaration`. -/// -/// **Fail-closed on non-method keys.** `dag_method` must instantiate -/// `MethodDeclaration` — the helper validates this at entry so a caller -/// cannot conflate two distinct states: "valid `MethodDeclaration` with -/// no row for this target" (returns `Ok(None)`) versus "caller supplied -/// a declaration that is not a `MethodDeclaration` at all" (returns -/// [`MethodTemplateProjectionError::LookupKeyNotMethodDeclaration`]). -/// This mirrors the per-row `MethodRef.decl` check the projection -/// already enforces; until `DeclarationRef` -/// refinement-typing lands, this is the only place the boundary can -/// hold. -/// -/// Other typed projection failures — including -/// [`MethodTemplateProjectionError::DuplicateMethodTemplateRow`], which is -/// enforced at the canonical row-list boundary in -/// [`method_template_contract_rows`] — bubble through. -pub fn method_template_contract_row( - dag: &Dag, - target: MethodTemplateTarget, - dag_method: DeclarationId, -) -> Result, MethodTemplateProjectionError> { - let method_declaration_id = method_declaration_carrier_id(dag)?; - if let Err(reason) = - validate_method_declaration_data_binding(dag, dag_method, method_declaration_id) - { - return Err( - MethodTemplateProjectionError::LookupKeyNotMethodDeclaration { - decl_id: dag_method, - reason, - }, - ); - } - let rows = method_template_contract_rows(dag, target)?; - Ok(rows.into_iter().find(|row| row.dag_method == dag_method)) -} - -/// Locate the `MethodDeclaration` carrier declaration in the bootstrap -/// `Dag` once. Surfaces [`MethodTemplateProjectionError::MethodDeclarationCarrierMissing`] -/// when the carrier is absent rather than panicking. -pub(crate) fn method_declaration_carrier_id( - dag: &Dag, -) -> Result { - Ok(dag - .declaration_by_name("MethodDeclaration") - .ok_or(MethodTemplateProjectionError::MethodDeclarationCarrierMissing)? - .id) -} - -/// Validate that `decl_id` references a `MethodDeclaration` *data binding* -/// per the substrate-side contract (`src/v3/std/methods.dag` + -/// `dsl/std/methods.dag`). -/// -/// Mirrors `src/v3/grounding_tests/src/stratum_a.rs::method_registry_name` -/// so projection-side and Stratum A-side enforcement of the same gate -/// stay in lockstep. Four sub-checks must all pass: -/// -/// 1. **Connective is `Instantiation`.** Rules out type / sum / record -/// declarations. -/// 2. **`Instantiation.template == MethodDeclaration`.** Rules out -/// instantiations of unrelated targets. -/// 3. **`value_body` is `Some(ValueBody::Structural { .. })`.** Rules -/// out type aliases (`type Foo = MethodDeclaration`, no value body) -/// and wrong-shaped data bindings (`List` / `Map` / scalar bodies). -/// 4. **`Structural` fields are exactly `[name]` with a string literal -/// value.** Closed schema check — mirrors -/// `enforce_closed_record_schema` in Stratum A. Rules out extra -/// fields, missing `name`, duplicate `name`, and non-string-literal -/// `name` values. -/// -/// On success returns the projected method name (`name` field's string -/// literal). On failure returns the typed -/// [`MethodDeclarationBindingViolation`] reason. -/// -/// Both `project_dag_method` (per-row) and `method_template_contract_row` -/// (lookup helper) consume this helper so the data-binding identity is -/// factored once. -pub(crate) fn validate_method_declaration_data_binding( - dag: &Dag, - decl_id: DeclarationId, - method_declaration_id: DeclarationId, -) -> Result { - let referenced = dag.declaration(decl_id); - - // (1) + (2) Connective + template. - let template = match &referenced.connective { - TypeConnective::Instantiation { template, .. } => *template, - _ => return Err(MethodDeclarationBindingViolation::ConnectiveNotInstantiation), - }; - if template != method_declaration_id { - return Err(MethodDeclarationBindingViolation::InstantiationTemplateNotMethodDeclaration); - } - - // (3) Value body present and Structural. - let value_body = referenced - .value_body - .as_ref() - .ok_or(MethodDeclarationBindingViolation::ValueBodyMissing)?; - let ValueBody::Structural { fields } = value_body else { - return Err(MethodDeclarationBindingViolation::ValueBodyNotStructural); - }; - - // (4) Closed `[name]` schema with string-literal value. Reject any - // duplicate or unknown label, require `name` to be present exactly - // once. Mirrors Stratum A's enforce_closed_record_schema. - const EXPECTED: &[&str] = &["name"]; - let name_count = fields.iter().filter(|(label, _)| label == "name").count(); - let any_unknown = fields - .iter() - .any(|(label, _)| !EXPECTED.contains(&label.as_str())); - if fields.len() != EXPECTED.len() || name_count != 1 || any_unknown { - let observed_labels: Vec = fields.iter().map(|(label, _)| label.clone()).collect(); - return Err( - MethodDeclarationBindingViolation::StructuralFieldsNotClosedNameOnly { - observed_labels, - }, - ); - } - let (_, name_value) = fields - .iter() - .find(|(label, _)| label == "name") - .expect("closed-schema check above guarantees a single `name` field"); - match name_value { - FieldValue::Literal(LiteralBits::String(s)) => Ok(s.clone()), - _ => Err(MethodDeclarationBindingViolation::NameNotStringLiteral), - } -} - -fn project_row( - dag: &Dag, - list: &'static str, - row_index: usize, - row: &FieldValue, -) -> Result { - let fields = match row { - FieldValue::Record(fields) => fields, - FieldValue::Reference(decl_id) => { - let decl = dag.declaration_opt(decl_id).ok_or( - MethodTemplateProjectionError::RowReferenceMissing { - list, - row_index, - decl_id: *decl_id, - }, - )?; - let method_template_contract = dag.method_template_contract_decl().ok_or( - MethodTemplateProjectionError::RowReferenceNotMethodTemplateContract { - list, - row_index, - decl_id: *decl_id, - }, - )?; - let TypeConnective::Instantiation { template, .. } = &decl.connective else { - return Err( - MethodTemplateProjectionError::RowReferenceNotMethodTemplateContract { - list, - row_index, - decl_id: *decl_id, - }, - ); - }; - if *template != method_template_contract { - return Err( - MethodTemplateProjectionError::RowReferenceNotMethodTemplateContract { - list, - row_index, - decl_id: *decl_id, - }, - ); - } - match decl.value_body.as_ref() { - Some(ValueBody::Structural { fields }) => fields, - _ => { - return Err(MethodTemplateProjectionError::RowReferenceNotStructural { - list, - row_index, - decl_id: *decl_id, - }); - } - } - } - _ => return Err(MethodTemplateProjectionError::RowNotRecord { list, row_index }), - }; - - const EXPECTED: &[&str] = &[ - "dag_method", - "runtime_template", - "emit_template", - "wraps_result", - "placeholder_convention", - ]; - let lookup = closed_record_lookup(list, row_index, "MethodTemplateContract", fields, EXPECTED)?; - - let dag_method_value = lookup_required(list, row_index, &lookup, "dag_method")?; - let dag_method = project_dag_method(dag, list, row_index, dag_method_value)?; - - let runtime_template_value = lookup_required(list, row_index, &lookup, "runtime_template")?; - let runtime_template = match runtime_template_value { - FieldValue::Literal(LiteralBits::String(s)) => s.clone(), - _ => { - return Err(MethodTemplateProjectionError::RuntimeTemplateNotString { - list, - row_index, - }); - } - }; - - let emit_template_value = lookup_required(list, row_index, &lookup, "emit_template")?; - let emit_template = project_emit_template(dag, list, row_index, emit_template_value)?; - - let wraps_result_value = lookup_required(list, row_index, &lookup, "wraps_result")?; - let wraps_result = match wraps_result_value { - FieldValue::Literal(LiteralBits::Bool(b)) => *b, - _ => return Err(MethodTemplateProjectionError::WrapsResultNotBool { list, row_index }), - }; - - let placeholder_value = lookup_required(list, row_index, &lookup, "placeholder_convention")?; - let placeholder_convention = project_placeholder(dag, list, row_index, placeholder_value)?; - - Ok(MethodTemplateContractRow { - dag_method, - runtime_template, - emit_template, - wraps_result, - placeholder_convention, - }) -} - -/// Validate that `fields` carries exactly the closed set of `expected` -/// labels — no duplicates, no unknowns. Missing labels are not reported -/// here (the per-field `lookup_required` calls below surface those as -/// `RowMissingField` so the error names *which* field is missing). -/// -/// Returns a label-to-`FieldValue` map for the present fields; collisions -/// surface as `RowDuplicateField` and unknown labels surface as -/// `RowUnknownField`. `record` names the carrier (e.g. -/// `"MethodTemplateContract"` or `"MethodRef"`) for diagnostic context. -fn closed_record_lookup<'a>( - list: &'static str, - row_index: usize, - record: &'static str, - fields: &'a [(String, FieldValue)], - expected: &[&'static str], -) -> Result, MethodTemplateProjectionError> { - let mut lookup: HashMap<&'static str, &FieldValue> = HashMap::with_capacity(expected.len()); - let mut first_seen_index: HashMap<&'static str, usize> = HashMap::with_capacity(expected.len()); - for (field_index, (label, value)) in fields.iter().enumerate() { - // Resolve the row-side `String` label to its `&'static str` in - // `expected`. Holding the static reference avoids re-scanning the - // expected slice (and the `.expect()` re-borrow) on the duplicate - // path; non-membership surfaces as `RowUnknownField`. - let Some(static_label) = expected.iter().copied().find(|exp| *exp == label.as_str()) else { - return Err(MethodTemplateProjectionError::RowUnknownField { - list, - row_index, - record, - field: label.clone(), - field_index, - }); - }; - if let Some(prior_index) = first_seen_index.get(static_label) { - return Err(MethodTemplateProjectionError::RowDuplicateField { - list, - row_index, - record, - field: static_label, - first_field_index: *prior_index, - duplicate_field_index: field_index, - }); - } - lookup.insert(static_label, value); - first_seen_index.insert(static_label, field_index); - } - Ok(lookup) -} - -fn lookup_required<'a>( - list: &'static str, - row_index: usize, - lookup: &HashMap<&'a str, &'a FieldValue>, - field: &'static str, -) -> Result<&'a FieldValue, MethodTemplateProjectionError> { - lookup - .get(field) - .copied() - .ok_or(MethodTemplateProjectionError::RowMissingField { - list, - row_index, - field, - }) -} - -fn project_dag_method( - dag: &Dag, - list: &'static str, - row_index: usize, - value: &FieldValue, -) -> Result { - let FieldValue::Record(method_ref_fields) = value else { - return Err(MethodTemplateProjectionError::DagMethodNotMethodRefRecord { list, row_index }); - }; - // `MethodRef` is a single-field carrier (`{ decl: DeclarationRef }`) - // per `src/v3/std/methods.dag`. Apply the same closed-schema check - // as the outer row so duplicates (`{ decl: a, decl: b }`) and - // unknown extras (`{ decl: ..., extra: ... }`) surface as typed - // errors instead of being silently ignored. - const METHOD_REF_FIELDS: &[&str] = &["decl"]; - let lookup = closed_record_lookup( - list, - row_index, - "MethodRef", - method_ref_fields, - METHOD_REF_FIELDS, - )?; - let decl_value = lookup - .get("decl") - .copied() - .ok_or(MethodTemplateProjectionError::DagMethodNotMethodRefRecord { list, row_index })?; - let decl_id = match decl_value { - FieldValue::Reference(decl_id) => *decl_id, - _ => { - return Err(MethodTemplateProjectionError::MethodRefDeclNotReference { - list, - row_index, - }); - } - }; - // `src/v3/std/methods.dag` calls out the boundary contract: today's - // substrate grammar can't express `DeclarationRef`, - // so the projection enforces fail-closed at the boundary that - // `decl` references a `MethodDeclaration`-instantiating data binding. - // Pattern mirrors `method_registry_test.rs::method_registry_covers_*`. - let method_declaration_id = method_declaration_carrier_id(dag)?; - if let Err(reason) = - validate_method_declaration_data_binding(dag, decl_id, method_declaration_id) - { - return Err( - MethodTemplateProjectionError::MethodRefDeclNotMethodDeclaration { - list, - row_index, - decl_id, - reason, - }, - ); - } - Ok(decl_id) -} - -fn project_emit_template( - dag: &Dag, - list: &'static str, - row_index: usize, - value: &FieldValue, -) -> Result { - let FieldValue::Variant { - constructor, - payload, - } = value - else { - return Err(MethodTemplateProjectionError::EmitTemplateNotVariant { list, row_index }); - }; - let constructor_label = disj_variant_label(dag, "MethodEmitTemplate", *constructor); - match constructor_label { - Some("SingleTemplate") => { - // Payload shape (positional, per FieldValue::Variant): one - // `template: String` field. Lowering produces a single - // record-shaped payload entry whose only field is `template`. - let template = single_template_payload(list, row_index, payload)?; - Ok(MethodEmitTemplateProjection::Single { template }) - } - Some("HigherOrderTemplates") => { - let (inline_template, fn_ref_template) = - higher_order_payload(list, row_index, payload)?; - Ok(MethodEmitTemplateProjection::HigherOrder { - inline_template, - fn_ref_template, - }) - } - other => Err( - MethodTemplateProjectionError::EmitTemplateUnknownConstructor { - list, - row_index, - constructor: other.map(str::to_string), - }, - ), - } -} - -/// Recover a sum-variant label by walking the parent `Disj` declaration's -/// variant list. Variant constructor declarations themselves do not carry -/// `name`; identity flows through the parent's `variants[i].label`. Mirrors -/// the pattern used in `tests/integration/method_template_contract_test.rs` -/// (`method_emit_template_variant_label`). -fn disj_variant_label<'a>( - dag: &'a Dag, - parent_name: &str, - constructor: DeclarationId, -) -> Option<&'a str> { - let parent = dag.declaration_by_name(parent_name)?; - let TypeConnective::Disj { variants } = &parent.connective else { - return None; - }; - variants - .iter() - .find(|variant| variant.ty == constructor) - .map(|variant| variant.label.as_str()) -} - -fn single_template_payload( - list: &'static str, - row_index: usize, - payload: &[FieldValue], -) -> Result { - // `Variant.payload` is positional per the substrate carrier - // (`FieldValue::Variant` doc-comment). `SingleTemplate { template: String }` - // therefore lowers to a single-element payload carrying the string literal. - match payload { - [FieldValue::Literal(LiteralBits::String(s))] => Ok(s.clone()), - _ => Err(MethodTemplateProjectionError::EmitTemplateSinglePayloadShape { list, row_index }), - } -} - -fn higher_order_payload( - list: &'static str, - row_index: usize, - payload: &[FieldValue], -) -> Result<(String, String), MethodTemplateProjectionError> { - // `HigherOrderTemplates { inline_template: String, fn_ref_template: String }` - // lowers to a two-element positional payload carrying the two string - // literals in declaration order. - match payload { - [FieldValue::Literal(LiteralBits::String(inline)), FieldValue::Literal(LiteralBits::String(fn_ref))] => { - Ok((inline.clone(), fn_ref.clone())) - } - _ => Err( - MethodTemplateProjectionError::EmitTemplateHigherOrderPayloadShape { list, row_index }, - ), - } -} - -fn project_placeholder( - dag: &Dag, - list: &'static str, - row_index: usize, - value: &FieldValue, -) -> Result { - let FieldValue::Variant { - constructor, - payload, - } = value - else { - return Err( - MethodTemplateProjectionError::PlaceholderConventionNotVariant { list, row_index }, - ); - }; - let constructor_label = disj_variant_label(dag, "PlaceholderConvention", *constructor); - // `PlaceholderConvention` is a nullary sum (`IndexedArgs | NamedArg`) - // per `src/v3/std/emit_model.dag:449-451`. A non-empty payload would - // mean a malformed bootstrap row (e.g., `IndexedArgs(false)`) that the - // projection must surface as a typed error rather than silently - // discarding. Mirrors the substrate-side canonical-row check in - // `src/v3/grounding_tests/src/stratum_a.rs`. - let (label, projection) = match constructor_label { - Some("IndexedArgs") => ("IndexedArgs", PlaceholderConventionProjection::IndexedArgs), - Some("NamedArg") => ("NamedArg", PlaceholderConventionProjection::NamedArg), - other => { - return Err( - MethodTemplateProjectionError::PlaceholderConventionUnknown { - list, - row_index, - constructor: other.map(str::to_string), - }, - ); - } - }; - if !payload.is_empty() { - return Err( - MethodTemplateProjectionError::PlaceholderConventionPayloadNotEmpty { - list, - row_index, - constructor: label, - payload_len: payload.len(), - }, - ); - } - Ok(projection) -} - -#[cfg(test)] -mod tests { - //! Unit tests for projection-internal failure modes that require - //! crate-private `Dag` mutation to construct (e.g., injecting a - //! malformed value body that the on-disk row authorities cannot - //! produce). Behavior tests over the green bootstrap Dag live in - //! `tests/integration/pb_method_template_projection_test.rs`. - - use super::*; - use crate::generated_full_bootstrap_dag; - - /// Inject a non-empty payload onto the `placeholder_convention` variant - /// of the row at `row_index` of the named per-target list. Mutates only - /// the in-memory `Dag`; the row authority sources on disk are - /// untouched. - fn inject_extra_placeholder_payload(dag: &mut Dag, list_name: &str, row_index: usize) { - let decl_id = dag - .declaration_by_name(list_name) - .unwrap_or_else(|| panic!("`{list_name}` missing from bootstrap")) - .id; - let decl = dag.declaration_mut(decl_id); - let body = decl - .value_body - .as_mut() - .unwrap_or_else(|| panic!("`{list_name}` has no value body")); - let ValueBody::List(rows) = body else { - panic!("`{list_name}` value body is not a List"); - }; - let row = rows - .get_mut(row_index) - .unwrap_or_else(|| panic!("row {row_index} missing from `{list_name}`")); - let FieldValue::Record(fields) = row else { - panic!("row {row_index} is not a Record"); - }; - let placeholder_value = fields - .iter_mut() - .find(|(label, _)| label == "placeholder_convention") - .map(|(_, value)| value) - .expect("placeholder_convention field"); - let FieldValue::Variant { payload, .. } = placeholder_value else { - panic!("placeholder_convention must be a Variant"); - }; - payload.push(FieldValue::Literal(LiteralBits::Bool(false))); - } - - /// Duplicate the row at `row_index` of the named per-target list by - /// pushing a clone onto the end of the list. The two rows share a - /// `dag_method`, breaking per-target uniqueness — the substrate-side - /// claim `method_template_contract_per_target_dag_method_unique`. - /// Mutates only the in-memory `Dag`. - fn duplicate_row(dag: &mut Dag, list_name: &str, row_index: usize) { - let decl_id = dag - .declaration_by_name(list_name) - .unwrap_or_else(|| panic!("`{list_name}` missing from bootstrap")) - .id; - let decl = dag.declaration_mut(decl_id); - let body = decl - .value_body - .as_mut() - .unwrap_or_else(|| panic!("`{list_name}` has no value body")); - let ValueBody::List(rows) = body else { - panic!("`{list_name}` value body is not a List"); - }; - let clone = rows - .get(row_index) - .unwrap_or_else(|| panic!("row {row_index} missing from `{list_name}`")) - .clone(); - rows.push(clone); - } - - fn replace_row_with_reference( - dag: &mut Dag, - list_name: &str, - row_index: usize, - replacement: DeclarationId, - ) { - let decl_id = dag.declaration_by_name(list_name).expect("list").id; - let decl = dag.declaration_mut(decl_id); - let body = decl.value_body.as_mut().expect("value body"); - let ValueBody::List(rows) = body else { - panic!("not a list"); - }; - let row = rows.get_mut(row_index).expect("row"); - *row = FieldValue::Reference(replacement); - } - - /// Mutate the row at `row_index` of `list_name` by adding a second - /// field with `field_label` (cloned from the first occurrence). Used - /// by the closed-schema duplicate-field tests below. - fn duplicate_field_on_row(dag: &mut Dag, list_name: &str, row_index: usize, field_label: &str) { - let decl_id = dag.declaration_by_name(list_name).expect("list").id; - let decl = dag.declaration_mut(decl_id); - let body = decl.value_body.as_mut().expect("value body"); - let ValueBody::List(rows) = body else { - panic!("not a list"); - }; - let row = rows.get_mut(row_index).expect("row"); - let FieldValue::Record(fields) = row else { - panic!("row not record"); - }; - let (orig_label, orig_value) = fields - .iter() - .find(|(label, _)| label == field_label) - .map(|(label, value)| (label.clone(), value.clone())) - .expect("field to clone"); - fields.push((orig_label, orig_value)); - } - - /// Replace the row at `row_index` of `list_name` so that, after the - /// existing fields, an unknown-labelled field is appended (used by - /// the closed-schema unknown-field tests below). - fn append_unknown_field_on_row( - dag: &mut Dag, - list_name: &str, - row_index: usize, - unknown_label: &str, - ) { - let decl_id = dag.declaration_by_name(list_name).expect("list").id; - let decl = dag.declaration_mut(decl_id); - let body = decl.value_body.as_mut().expect("value body"); - let ValueBody::List(rows) = body else { - panic!("not a list"); - }; - let row = rows.get_mut(row_index).expect("row"); - let FieldValue::Record(fields) = row else { - panic!("row not record"); - }; - fields.push(( - unknown_label.to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - )); - } - - #[test] - fn duplicate_field_on_row_surfaces_typed_error() { - let mut dag = generated_full_bootstrap_dag(); - duplicate_field_on_row( - &mut dag, - "rust_method_template_contracts", - 0, - "runtime_template", - ); - let result = method_template_contract_rows(&dag, MethodTemplateTarget::Rust); - match result { - Err(MethodTemplateProjectionError::RowDuplicateField { - record, - field, - first_field_index, - duplicate_field_index, - .. - }) => { - assert_eq!(record, "MethodTemplateContract"); - assert_eq!(field, "runtime_template"); - assert_ne!(first_field_index, duplicate_field_index); - } - other => panic!("expected RowDuplicateField, got {other:?}"), - } - } - - #[test] - fn unknown_field_on_row_surfaces_typed_error() { - let mut dag = generated_full_bootstrap_dag(); - append_unknown_field_on_row( - &mut dag, - "rust_method_template_contracts", - 0, - "renamed_field", - ); - let result = method_template_contract_rows(&dag, MethodTemplateTarget::Rust); - match result { - Err(MethodTemplateProjectionError::RowUnknownField { record, field, .. }) => { - assert_eq!(record, "MethodTemplateContract"); - assert_eq!(field, "renamed_field"); - } - other => panic!("expected RowUnknownField, got {other:?}"), - } - } - - #[test] - fn reference_row_requires_method_template_contract_instance() { - let mut dag = generated_full_bootstrap_dag(); - let non_contract_structural = dag - .declaration_by_name("count_method") - .expect("count_method MethodDeclaration") - .id; - replace_row_with_reference( - &mut dag, - "rust_method_template_contracts", - 0, - non_contract_structural, - ); - - let result = method_template_contract_rows(&dag, MethodTemplateTarget::Rust); - match result { - Err(MethodTemplateProjectionError::RowReferenceNotMethodTemplateContract { - list, - row_index, - decl_id, - }) => { - assert_eq!(list, "rust_method_template_contracts"); - assert_eq!(row_index, 0); - assert_eq!(decl_id, non_contract_structural); - } - other => panic!( - "expected RowReferenceNotMethodTemplateContract for structural lookalike row, got {other:?}" - ), - } - } - - /// Inject a duplicate or unknown field into the inner `MethodRef` - /// record at `dag_method` for the row at `row_index`. - fn mutate_method_ref( - dag: &mut Dag, - list_name: &str, - row_index: usize, - kind: MethodRefMutation<'_>, - ) { - let decl_id = dag.declaration_by_name(list_name).expect("list").id; - let decl = dag.declaration_mut(decl_id); - let body = decl.value_body.as_mut().expect("value body"); - let ValueBody::List(rows) = body else { - panic!("not a list"); - }; - let row = rows.get_mut(row_index).expect("row"); - let FieldValue::Record(fields) = row else { - panic!("row not record"); - }; - let (_, dag_method_value) = fields - .iter_mut() - .find(|(label, _)| label == "dag_method") - .expect("dag_method field"); - let FieldValue::Record(method_ref_fields) = dag_method_value else { - panic!("dag_method not record"); - }; - match kind { - MethodRefMutation::Duplicate => { - let (label, value) = method_ref_fields - .iter() - .find(|(label, _)| label == "decl") - .map(|(label, value)| (label.clone(), value.clone())) - .expect("decl field"); - method_ref_fields.push((label, value)); - } - MethodRefMutation::AppendUnknown(label) => { - method_ref_fields.push(( - label.to_string(), - FieldValue::Literal(LiteralBits::Bool(false)), - )); - } - } - } - - /// 🟢 TERMINAL at the test-local `MethodRef` mutation scope. Names the - /// two ways an in-memory `Dag` row can break the closed `MethodRef` - /// schema: duplicate the existing `decl` field, or append a field with - /// an unknown label. Both modes drive the closed-schema check in - /// `closed_record_lookup`. Test-only; not part of the projection's - /// public surface. - enum MethodRefMutation<'a> { - Duplicate, - AppendUnknown(&'a str), - } - - #[test] - fn method_ref_decl_alias_without_value_body_surfaces_typed_error() { - // `src/v3/std/methods.dag` requires a *data binding* - // (`data _method: MethodDeclaration = { name: "..." }`), - // not just any declaration whose connective resolves to - // `MethodDeclaration`. A type alias like - // `type Foo = MethodDeclaration` lowers to an `Instantiation` - // connective with **no `value_body`**; without the value-body - // guard, that shape would pass the connective check alone. - // - // Simulate the alias-shape by stripping `value_body` from a real - // `MethodDeclaration` data binding (`count_method`) and asserting - // the typed error fires for both the per-row check - // (`MethodRefDeclNotMethodDeclaration`) and the lookup helper - // (`LookupKeyNotMethodDeclaration`). - let mut dag = generated_full_bootstrap_dag(); - let count_method_id = dag - .declaration_by_name("count_method") - .expect("count_method MethodDeclaration in bootstrap") - .id; - dag.declaration_mut(count_method_id).value_body = None; - - // Per-row path: row 0 of `rust_method_template_contracts` is the - // `count_method` row, so projecting it should now surface - // `MethodRefDeclNotMethodDeclaration` with `ValueBodyMissing` - // reason instead of returning a row. - let row_result = method_template_contract_rows(&dag, MethodTemplateTarget::Rust); - match row_result { - Err(MethodTemplateProjectionError::MethodRefDeclNotMethodDeclaration { - decl_id, - reason, - .. - }) => { - assert_eq!(decl_id, count_method_id); - assert_eq!(reason, MethodDeclarationBindingViolation::ValueBodyMissing); - } - other => panic!( - "expected MethodRefDeclNotMethodDeclaration for alias-shaped target, got {other:?}" - ), - } - - // Lookup-helper path: same key, same shape; the helper validates - // at entry and surfaces `LookupKeyNotMethodDeclaration` with the - // same reason. - let helper_result = - method_template_contract_row(&dag, MethodTemplateTarget::Rust, count_method_id); - match helper_result { - Err(MethodTemplateProjectionError::LookupKeyNotMethodDeclaration { - decl_id, - reason, - }) => { - assert_eq!(decl_id, count_method_id); - assert_eq!(reason, MethodDeclarationBindingViolation::ValueBodyMissing); - } - other => { - panic!("expected LookupKeyNotMethodDeclaration for alias-shaped key, got {other:?}") - } - } - } - - #[test] - fn method_ref_decl_not_method_declaration_surfaces_typed_error() { - // `src/v3/std/methods.dag` enforces fail-closed at the projection - // boundary that `MethodRef.decl` instantiates `MethodDeclaration`, - // because today's substrate grammar can't express - // `DeclarationRef`. Mutate the first row's - // `MethodRef.decl` to point at a declaration that is not a - // `MethodDeclaration` instance (`MethodTemplateContract` itself - // is a type declaration, not a `MethodDeclaration` data binding) - // and assert the typed error. - let mut dag = generated_full_bootstrap_dag(); - let non_method_id = dag - .declaration_by_name("MethodTemplateContract") - .expect("MethodTemplateContract type") - .id; - - let list_decl_id = dag - .declaration_by_name("rust_method_template_contracts") - .expect("list") - .id; - let decl = dag.declaration_mut(list_decl_id); - let body = decl.value_body.as_mut().expect("value body"); - let ValueBody::List(rows) = body else { - panic!("not a list"); - }; - let row = rows.get_mut(0).expect("row 0"); - let FieldValue::Record(fields) = row else { - panic!("row not record"); - }; - let dag_method_value = fields - .iter_mut() - .find(|(label, _)| label == "dag_method") - .map(|(_, value)| value) - .expect("dag_method field"); - let FieldValue::Record(method_ref_fields) = dag_method_value else { - panic!("dag_method not record"); - }; - let decl_field_value = method_ref_fields - .iter_mut() - .find(|(label, _)| label == "decl") - .map(|(_, value)| value) - .expect("decl field"); - *decl_field_value = FieldValue::Reference(non_method_id); - - let result = method_template_contract_rows(&dag, MethodTemplateTarget::Rust); - match result { - Err(MethodTemplateProjectionError::MethodRefDeclNotMethodDeclaration { - list, - row_index, - decl_id, - reason, - }) => { - assert_eq!(list, "rust_method_template_contracts"); - assert_eq!(row_index, 0); - assert_eq!(decl_id, non_method_id); - // `MethodTemplateContract` is a type declaration (Conj), - // not an Instantiation — connective sub-check fails first. - assert_eq!( - reason, - MethodDeclarationBindingViolation::ConnectiveNotInstantiation - ); - } - other => panic!( - "expected MethodRefDeclNotMethodDeclaration for non-MethodDeclaration target, got {other:?}" - ), - } - } - - #[test] - fn method_ref_decl_extra_field_surfaces_closed_schema_violation() { - // A MethodDeclaration data binding with an extra field (beyond the - // closed `[name]` schema) must surface - // `StructuralFieldsNotClosedNameOnly`. Mirrors Stratum A's - // `enforce_closed_record_schema` gate. - let mut dag = generated_full_bootstrap_dag(); - let count_method_id = dag - .declaration_by_name("count_method") - .expect("count_method") - .id; - let decl = dag.declaration_mut(count_method_id); - let body = decl.value_body.as_mut().expect("value body"); - let ValueBody::Structural { fields } = body else { - panic!("expected Structural body"); - }; - fields.push(( - "alias".to_string(), - FieldValue::Literal(LiteralBits::String("count_alias".to_string())), - )); - - let result = method_template_contract_rows(&dag, MethodTemplateTarget::Rust); - match result { - Err(MethodTemplateProjectionError::MethodRefDeclNotMethodDeclaration { - reason: - MethodDeclarationBindingViolation::StructuralFieldsNotClosedNameOnly { - observed_labels, - }, - .. - }) => { - assert!(observed_labels.contains(&"name".to_string())); - assert!(observed_labels.contains(&"alias".to_string())); - } - other => { - panic!("expected StructuralFieldsNotClosedNameOnly for extra field, got {other:?}") - } - } - } - - #[test] - fn method_ref_decl_name_not_string_literal_surfaces_typed_error() { - // A MethodDeclaration data binding whose `name` value is not a - // string literal must surface - // `MethodDeclarationBindingViolation::NameNotStringLiteral`. - let mut dag = generated_full_bootstrap_dag(); - let count_method_id = dag - .declaration_by_name("count_method") - .expect("count_method") - .id; - let decl = dag.declaration_mut(count_method_id); - let body = decl.value_body.as_mut().expect("value body"); - let ValueBody::Structural { fields } = body else { - panic!("expected Structural body"); - }; - let (_, name_value) = fields - .iter_mut() - .find(|(label, _)| label == "name") - .expect("name field"); - // Replace with a Bool literal — wrong shape for the contract. - *name_value = FieldValue::Literal(LiteralBits::Bool(true)); - - let result = method_template_contract_rows(&dag, MethodTemplateTarget::Rust); - match result { - Err(MethodTemplateProjectionError::MethodRefDeclNotMethodDeclaration { - reason: MethodDeclarationBindingViolation::NameNotStringLiteral, - .. - }) => {} - other => panic!("expected NameNotStringLiteral for non-string name, got {other:?}"), - } - } - - #[test] - fn duplicate_field_on_method_ref_surfaces_typed_error() { - let mut dag = generated_full_bootstrap_dag(); - mutate_method_ref( - &mut dag, - "rust_method_template_contracts", - 0, - MethodRefMutation::Duplicate, - ); - let result = method_template_contract_rows(&dag, MethodTemplateTarget::Rust); - match result { - Err(MethodTemplateProjectionError::RowDuplicateField { record, field, .. }) => { - assert_eq!(record, "MethodRef"); - assert_eq!(field, "decl"); - } - other => panic!("expected RowDuplicateField for MethodRef, got {other:?}"), - } - } - - #[test] - fn unknown_field_on_method_ref_surfaces_typed_error() { - let mut dag = generated_full_bootstrap_dag(); - mutate_method_ref( - &mut dag, - "rust_method_template_contracts", - 0, - MethodRefMutation::AppendUnknown("nickname"), - ); - let result = method_template_contract_rows(&dag, MethodTemplateTarget::Rust); - match result { - Err(MethodTemplateProjectionError::RowUnknownField { record, field, .. }) => { - assert_eq!(record, "MethodRef"); - assert_eq!(field, "nickname"); - } - other => panic!("expected RowUnknownField for MethodRef, got {other:?}"), - } - } - - #[test] - fn duplicate_row_surfaces_typed_error_at_canonical_row_list_api() { - // Per-target uniqueness by `dag_method` is the substrate-side claim - // `method_template_contract_per_target_dag_method_unique`. The - // canonical row-list API enforces this at the public boundary so - // every consumer (direct row-list consumer or `(target, dag_method)` - // lookup helper) observes the same fail-closed behavior. Gap 5 / - // leaf-emit consumers building their own keyed tables from the - // projection cannot silently observe two authorities for the same - // `(target, MethodRef)` pair. - let mut dag = generated_full_bootstrap_dag(); - duplicate_row(&mut dag, "rust_method_template_contracts", 0); - - // Canonical row-list API surfaces the duplicate. - let list_result = method_template_contract_rows(&dag, MethodTemplateTarget::Rust); - match list_result { - Err(MethodTemplateProjectionError::DuplicateMethodTemplateRow { - list, - first_row_index, - duplicate_row_index, - }) => { - assert_eq!(list, "rust_method_template_contracts"); - assert_ne!(first_row_index, duplicate_row_index); - } - other => panic!( - "expected DuplicateMethodTemplateRow at row-list API for duplicate (target, dag_method), got {other:?}" - ), - } - - // Lookup helper inherits the fail-closed shape via the row-list - // API; no separate uniqueness path on the helper. - let count_method_id = dag - .declaration_by_name("count_method") - .expect("count_method MethodDeclaration in bootstrap Dag") - .id; - let helper_result = - method_template_contract_row(&dag, MethodTemplateTarget::Rust, count_method_id); - assert!( - matches!( - helper_result, - Err(MethodTemplateProjectionError::DuplicateMethodTemplateRow { .. }) - ), - "lookup helper must inherit duplicate-row fail-closed via row-list API; got {helper_result:?}" - ); - } - - #[test] - fn malformed_placeholder_payload_surfaces_typed_error() { - // PlaceholderConvention is a nullary sum (`IndexedArgs | NamedArg`). - // A malformed bootstrap row carrying a non-empty placeholder payload - // must surface as `PlaceholderConventionPayloadNotEmpty`, not - // silently project to `IndexedArgs` / `NamedArg` with the payload - // discarded. Mirrors the substrate-side canonical-row check - // `placeholder_convention_canonical_rejects_payload_for_nullary_indexed_args` - // in `src/v3/grounding_tests/src/stratum_a.rs`. - let mut dag = generated_full_bootstrap_dag(); - inject_extra_placeholder_payload(&mut dag, "rust_method_template_contracts", 0); - - let result = method_template_contract_rows(&dag, MethodTemplateTarget::Rust); - match result { - Err(MethodTemplateProjectionError::PlaceholderConventionPayloadNotEmpty { - list, - row_index, - payload_len, - .. - }) => { - assert_eq!(list, "rust_method_template_contracts"); - assert_eq!(row_index, 0); - assert!(payload_len >= 1, "expected non-empty payload to be reported"); - } - other => panic!( - "expected PlaceholderConventionPayloadNotEmpty for malformed placeholder, got {other:?}" - ), - } - } -} diff --git a/src/v3/compiler/src/pipeline_authority.rs b/src/v3/compiler/src/pipeline_authority.rs deleted file mode 100644 index 70f86a7f828..00000000000 --- a/src/v3/compiler/src/pipeline_authority.rs +++ /dev/null @@ -1,261 +0,0 @@ -use crate::dag::{Dag, DeclarationId, FieldValue, TypeConnective, ValueBody}; - -#[cfg(test)] -pub(crate) const PIPELINE_AUTHORITY_FILE: &str = "src/v3/compiler/pipeline.dag"; - -const PIPELINE_STAGE_BINDING_TYPE: &str = "PipelineStageBinding"; - -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub(crate) enum PipelineSnapshotKind { - Surface, - Dag, - Text, -} - -#[derive(Debug, Clone)] -pub(crate) struct PipelineStageAuthority { - // Read by `bootstrap::materialize_pipeline_realizations` when feature - // `bootstrap-regen-fresh` is enabled. - #[cfg_attr(not(feature = "bootstrap-regen-fresh"), allow(dead_code))] - pub(crate) stage: DeclarationId, - pub(crate) stage_name: String, - #[cfg_attr(not(feature = "bootstrap-regen-fresh"), allow(dead_code))] - pub(crate) realization: DeclarationId, - #[cfg_attr(not(feature = "bootstrap-regen-fresh"), allow(dead_code))] - pub(crate) realization_name: String, - pub(crate) snapshot_kind: PipelineSnapshotKind, -} - -/// Pipeline stage order, read structurally from `PipelineStageBinding` -/// declarations in the Dag. The declaration order of the bindings in -/// `pipeline.dag` is the **sole runtime ordering authority** on this path. -/// -/// **DB-16 case 2c / T-Bridge-Retirement disposition (PB review, PR #1171, -/// 2026-04-29):** `fn compile { … }` still lowers to `ArrowBody::Unparsed` — the -/// lowered Dag does **not** carry an ordered list of stage names inside the -/// compile arrow. Without that structural witness, a fail-closed cross-check -/// against the human-readable `compile` body cannot use the substrate query -/// surface alone. Prior attempts used either `include_str!("../pipeline.dag")` -/// (compile-time embed) or `std::fs::read_to_string` + span slicing (runtime -/// source-text side channel); both are rejected for `bridge_include_str_side_channels_retired` -/// in this lane. **Compile-body vs binding drift detection is therefore -/// suspended** until derivation provides a single authored carrier or a -/// lowered structural compile-body representation. Callers must keep -/// `PipelineStageBinding` declaration order and the `compile` orchestrator body -/// in sync by review/regen discipline until then. -pub(crate) fn ordered_pipeline_stages(dag: &Dag) -> Result, String> { - let binding_type_id = dag - .declaration_by_name(PIPELINE_STAGE_BINDING_TYPE) - .map(|decl| decl.id) - .ok_or_else(|| { - format!("missing pipeline authority type `{PIPELINE_STAGE_BINDING_TYPE}`") - })?; - - let mut ordered: Vec = Vec::new(); - let mut seen_stages: Vec = Vec::new(); - - for declaration in dag.declarations() { - if declaration.meta_tag != Some(binding_type_id) { - continue; - } - let Some(ValueBody::Structural { fields }) = &declaration.value_body else { - let binding_name = declaration - .name - .as_deref() - .unwrap_or(""); - return Err(format!( - "pipeline stage binding `{binding_name}` must carry a structural value body" - )); - }; - - let stage = require_decl_ref(fields, "stage", declaration.name.as_deref())?; - let realization = require_decl_ref(fields, "realization", declaration.name.as_deref())?; - let snapshot_kind = require_snapshot_kind(dag, fields, declaration.name.as_deref())?; - - let stage_name = dag.declaration(stage).name.clone().ok_or_else(|| { - format!( - "pipeline stage binding `{}` points at unnamed stage declaration `{}`", - declaration - .name - .as_deref() - .unwrap_or(""), - stage.raw() - ) - })?; - let realization_name = dag.declaration(realization).name.clone().ok_or_else(|| { - format!( - "pipeline stage binding `{}` points at unnamed realization declaration `{}`", - declaration - .name - .as_deref() - .unwrap_or(""), - realization.raw() - ) - })?; - - if seen_stages.contains(&stage) { - return Err(format!( - "pipeline stage `{stage_name}` has multiple stage bindings" - )); - } - seen_stages.push(stage); - - ordered.push(PipelineStageAuthority { - stage, - stage_name, - realization, - realization_name, - snapshot_kind, - }); - } - - if ordered.is_empty() { - return Err("pipeline authority contains no stage bindings".to_string()); - } - - Ok(ordered) -} - -/// Pipeline stage names in authority order. Thin wrapper over -/// `ordered_pipeline_stages` for callers that only need the names. -pub(crate) fn pipeline_compile_order_names(dag: &Dag) -> Result, String> { - Ok(ordered_pipeline_stages(dag)? - .into_iter() - .map(|stage| stage.stage_name) - .collect()) -} - -fn require_decl_ref( - fields: &[(String, FieldValue)], - label: &str, - binding_name: Option<&str>, -) -> Result { - fields - .iter() - .find(|(field, _)| field == label) - .and_then(|(_, value)| match value { - FieldValue::Reference(id) => Some(*id), - _ => None, - }) - .ok_or_else(|| { - format!( - "pipeline stage binding `{}` is missing required DeclarationRef field `{label}`", - binding_name.unwrap_or("") - ) - }) -} - -fn require_snapshot_kind( - dag: &Dag, - fields: &[(String, FieldValue)], - binding_name: Option<&str>, -) -> Result { - let snapshot_type_id = dag - .declaration_by_name("PipelineSnapshotKind") - .map(|decl| decl.id) - .ok_or_else(|| "missing pipeline authority type `PipelineSnapshotKind`".to_string())?; - let value = fields - .iter() - .find(|(field, _)| field == "snapshot") - .map(|(_, value)| value) - .ok_or_else(|| { - format!( - "pipeline stage binding `{}` is missing required `snapshot` field", - binding_name.unwrap_or("") - ) - })?; - - let constructor = match value { - FieldValue::Variant { - constructor, - payload, - } => { - if !payload.is_empty() { - return Err(format!( - "pipeline stage binding `{}` has non-empty snapshot payload", - binding_name.unwrap_or("") - )); - } - *constructor - } - _ => { - return Err(format!( - "pipeline stage binding `{}` must use a PipelineSnapshotKind variant for `snapshot`", - binding_name.unwrap_or("") - )) - } - }; - - let TypeConnective::Disj { variants } = &dag.declaration(snapshot_type_id).connective else { - return Err( - "pipeline authority type `PipelineSnapshotKind` must lower to a sum".to_string(), - ); - }; - let label = variants - .iter() - .find(|variant| variant.ty == constructor) - .map(|variant| variant.label.as_str()) - .ok_or_else(|| { - format!( - "pipeline stage binding `{}` uses snapshot constructor `{}` that does not belong to `PipelineSnapshotKind`", - binding_name.unwrap_or(""), - constructor.raw() - ) - })?; - - match label { - "SnapshotSurface" => Ok(PipelineSnapshotKind::Surface), - "SnapshotDag" => Ok(PipelineSnapshotKind::Dag), - "SnapshotText" => Ok(PipelineSnapshotKind::Text), - other => Err(format!( - "pipeline stage binding `{}` uses unknown snapshot constructor `{other}`", - binding_name.unwrap_or("") - )), - } -} - -#[cfg(test)] -mod tests { - use super::*; - use crate::dag::ArrowBody; - - const PIPELINE_COMPILE_FN: &str = "compile"; - - #[test] - fn ordered_pipeline_stages_authority_is_pipeline_stage_binding_only() { - let dag = Dag::new(); - let names = pipeline_compile_order_names(&dag).expect("bootstrap pipeline stages"); - assert_eq!( - names, - vec![ - "parse".to_string(), - "lower".to_string(), - "infer".to_string(), - "compute_ownership".to_string(), - "lens_complexity".to_string(), - "emit".to_string(), - ], - "ordering is structural declaration order of PipelineStageBinding rows; update this test when pipeline.dag stage set changes" - ); - } - - #[test] - fn pipeline_compile_body_remains_unparsed_blocking_structural_retirement() { - let dag = Dag::new(); - let compile = dag - .declarations() - .iter() - .find(|decl| { - decl.name.as_deref() == Some(PIPELINE_COMPILE_FN) - && decl.span.file == PIPELINE_AUTHORITY_FILE - }) - .expect("pipeline `compile` declaration"); - let TypeConnective::Arrow { body, .. } = &compile.connective else { - panic!("`compile` must be an arrow declaration"); - }; - assert!( - matches!(body, ArrowBody::Unparsed(_)), - "case 2c: `compile` has no lowered ordered stage list — R3 bridge_include_str_side_channels_retired cannot be satisfied here without a new substrate fact; see module doc on ordered_pipeline_stages" - ); - } -} diff --git a/src/v3/compiler/src/post_emit_verifier.rs b/src/v3/compiler/src/post_emit_verifier.rs deleted file mode 100644 index a07c2ff1c3e..00000000000 --- a/src/v3/compiler/src/post_emit_verifier.rs +++ /dev/null @@ -1,638 +0,0 @@ -//! E-5 / Lane 1 Stage 1c PR 4 — shared test harness that reads each -//! target's `CleanEmissionContract.post_emit_verifier` record and -//! invokes the declared verifier against an emitted source file. -//! -//! Before this module, each pilot roundtrip test (`emit_rust_…`, -//! `emit_go_…`, `emit_python_…`) hardcoded the verifier command + -//! args in Rust. That divergence is exactly what the contract is -//! supposed to eliminate — the spec file declares the verifier -//! config; the harness reads it; nothing drifts. Adding a new target -//! (Swift, Kotlin, Verilog) requires only a `CleanEmissionContract` -//! data item, not a new Rust roundtrip helper. -//! -//! The harness is deliberately minimal: -//! - `parse_post_emit_verifier` walks the declared structural fields -//! of a `python_clean_emission` / `rust_clean_emission` / -//! `go_clean_emission` declaration and extracts the four -//! consumed fields (`command`, `args`, `expected_exit_code`, -//! `output_policy`) of the `PostEmitVerifier` record into a typed -//! binding. (`syntax_only` is authored on the spec but not yet -//! consumed by any Rust-side consumer — see -//! `PostEmitVerifierBinding` doc.) -//! - `run_post_emit_verifier` invokes the contract command via -//! [`crate::bounded_host_command`] (wall-bounded wait + capped I/O), -//! then applies the binding's `expected_exit_code` + `output_policy`. -//! -//! Scope caveat — calling convention: the harness assumes the -//! verifier takes the source file as its final positional argument. -//! That shape fits every target declared today (`rustc `, -//! `gofmt -l `, `python3 -m py_compile `), but the -//! `PostEmitVerifier` record does not yet encode argument-placement -//! structurally. A verifier that wants stdin, a fixed `-o` slot, or -//! a non-terminal source-path position cannot be expressed without -//! extending the contract shape. When such a target concretely -//! arrives, the fix is a structural extension to `PostEmitVerifier` -//! (e.g. `source_position: SourcePositionPolicy`), not a bespoke -//! Rust branch inside this runner — same discipline as -//! `pattern_bindings` / `output_policy`. - -use std::fmt; -use std::io::Write; -use std::path::Path; -use std::process::Command; - -use crate::bounded_host_command::{self, DEFAULT_WALL_TIMEOUT}; - -use crate::dag::{DeclarationId, FieldValue, LiteralBits}; -use crate::emit::{emit_go_text, emit_python_text, emit_rust_text, EmitTarget}; -use crate::emit_rust_roundtrip_fixtures::{GO_EMIT_EXCLUDE, PYTHON_EMIT_EXCLUDE}; -use crate::Dag; - -/// Shape-A targets whose `CleanEmissionContract.post_emit_verifier` is landed today. -pub const SHAPE_A_POST_EMIT_TARGETS: &[EmitTarget] = - &[EmitTarget::Rust, EmitTarget::Go, EmitTarget::Python]; - -pub fn post_emit_target_label(target: EmitTarget) -> &'static str { - match target { - EmitTarget::Rust => "rust", - EmitTarget::Go => "go", - EmitTarget::Python => "python", - } -} - -fn post_emit_default_source_filename(target: EmitTarget) -> &'static str { - match target { - EmitTarget::Rust => "main.rs", - EmitTarget::Go => "main.go", - EmitTarget::Python => "main.py", - } -} - -/// Whether a `PROGRAM_FIXTURES` row participates in post-emit verification for `target`. -pub fn fixture_supports_post_emit_target(fixture_name: &str, target: EmitTarget) -> bool { - match target { - EmitTarget::Rust => true, - EmitTarget::Go => !GO_EMIT_EXCLUDE.contains(&fixture_name), - EmitTarget::Python => !PYTHON_EMIT_EXCLUDE.contains(&fixture_name), - } -} - -/// Typed read of `data _clean_emission.post_emit_verifier`. -/// Every field here is a structural declaration on the contract that -/// the runner actively consults — no defaults, no fallbacks; a -/// missing or malformed field fires `VerifierParseError::MalformedSpec` -/// at parse time so the spec-file drift surfaces loudly rather than -/// silently hand the runner a partially-filled binding. -/// -/// The authored `PostEmitVerifier` record has a fifth field, -/// `syntax_only: Bool`, which the current runner does not consume — -/// it is metadata about the verifier's depth (shallow syntax check -/// vs full compile) that downstream schedulers (per-PR CI vs -/// nightly) will dispatch on. Per E-6, a spec field lands only with -/// a same-PR consumer; this binding therefore does NOT parse -/// `syntax_only` yet. The field remains in `std/clean_emission.dag` -/// because the three existing target spec files already declare it -/// (landed in PRs 1/2/3 alongside the rest of the contract shape); -/// a follow-up PR that adds the first downstream consumer will -/// add the parse + storage here atomically. -#[derive(Debug, Clone, PartialEq, Eq)] -pub struct PostEmitVerifierBinding { - pub command: String, - pub args: Vec, - pub expected_exit_code: i64, - pub output_policy: VerifierOutputPolicyBinding, -} - -/// Typed mirror of `std.clean_emission.VerifierOutputPolicy`. Only -/// closed variants — adding a new policy is a spec extension, not a -/// runner override. -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum VerifierOutputPolicyBinding { - IgnoreVerifierOutput, - RequireEmptyStdout, - RequireEmptyStderr, - RequireEmptyStdoutAndStderr, -} - -/// Contract-parse failures. Callers that want to surface the -/// underlying declaration in a diagnostic propagate this error -/// directly — the `DeclarationId` points at the -/// `*_clean_emission` data item so spec-authors can find the -/// offending record. -#[derive(Debug, Clone)] -pub enum VerifierParseError { - MissingDeclaration, - MalformedSpec { - declaration: DeclarationId, - detail: &'static str, - }, -} - -/// Runner failures. `SpecUnavailable` fires when the bootstrap dag lacks a -/// clean-emission spec or the contract record cannot be parsed. -/// `InvocationFailed` fires when the OS cannot spawn the verifier process -/// (binary missing from PATH, etc.); `WrongExitCode` and `PolicyViolation` -/// fire after a successful spawn when the verdict does not match the contract. -#[derive(Debug)] -pub enum VerifierRunError { - SpecUnavailable { - detail: String, - }, - InvocationFailed { - command: String, - io_error: String, - }, - WrongExitCode { - expected: i64, - actual: Option, - stdout: String, - stderr: String, - }, - PolicyViolation { - policy: VerifierOutputPolicyBinding, - stdout: String, - stderr: String, - }, -} - -/// Parse `.post_emit_verifier` into a typed -/// binding. `spec_declaration` is the id of a -/// `*_clean_emission: CleanEmissionContract` data item (obtained via -/// `dag.rust_clean_emission_spec()` / `dag.go_clean_emission_spec()` -/// / `dag.python_clean_emission_spec()`). -pub fn parse_post_emit_verifier( - dag: &Dag, - spec_declaration: DeclarationId, -) -> Result { - let decl = dag.declaration(spec_declaration); - let Some(crate::dag::ValueBody::Structural { fields }) = &decl.value_body else { - return Err(VerifierParseError::MalformedSpec { - declaration: spec_declaration, - detail: "clean_emission spec must be a structural data item", - }); - }; - let verifier_value = fields - .iter() - .find(|(label, _)| label == "post_emit_verifier") - .map(|(_, value)| value) - .ok_or(VerifierParseError::MalformedSpec { - declaration: spec_declaration, - detail: "clean_emission is missing required `post_emit_verifier` field", - })?; - let FieldValue::Record(verifier_fields) = verifier_value else { - return Err(VerifierParseError::MalformedSpec { - declaration: spec_declaration, - detail: "clean_emission.post_emit_verifier must be a structural record", - }); - }; - - let command = require_string(verifier_fields, "command", spec_declaration)?; - let args = require_string_list(verifier_fields, "args", spec_declaration)?; - let expected_exit_code = require_int(verifier_fields, "expected_exit_code", spec_declaration)?; - let output_policy = - parse_output_policy(dag, verifier_fields, "output_policy", spec_declaration)?; - - Ok(PostEmitVerifierBinding { - command, - args, - expected_exit_code, - output_policy, - }) -} - -/// Invoke the verifier against `source_path` and apply the -/// contract's verdict semantics. The source file path is appended -/// as the final positional argument — every declared verifier -/// today expects the file as its last argument -/// (`rustc ` / `gofmt -l ` / `python3 -m py_compile -/// `). -pub fn run_post_emit_verifier( - binding: &PostEmitVerifierBinding, - source_path: &Path, -) -> Result<(), VerifierRunError> { - let mut command = Command::new(&binding.command); - command.args(&binding.args).arg(source_path); - // Rustc (and py_compile to a lesser extent) produce artifacts - // next to / in cwd. Pinning cwd to the source's parent directory - // contains those artifacts inside the caller's tmp dir instead - // of dropping them into the workspace root. - // - // `Path::parent()` returns `Some("")` for single-component - // relative paths (e.g. `main.rs`); `current_dir("")` fails the - // spawn on most platforms. Filter empties so relative paths in - // the current directory fall through to the inherited cwd - // instead of rejecting valid inputs at spawn time. - if let Some(parent) = source_path - .parent() - .filter(|parent| !parent.as_os_str().is_empty()) - { - command.current_dir(parent); - } - let label = format!("post_emit_verifier `{}`", binding.command); - let output = bounded_host_command::host_command_output( - &label, - DEFAULT_WALL_TIMEOUT, - bounded_host_command::prepare_host_command(command), - ) - .map_err(|err| VerifierRunError::InvocationFailed { - command: binding.command.clone(), - io_error: err, - })?; - - let exit_code = output.status.code(); - let stdout = String::from_utf8_lossy(&output.stdout).into_owned(); - let stderr = String::from_utf8_lossy(&output.stderr).into_owned(); - - if exit_code.map(i64::from) != Some(binding.expected_exit_code) { - return Err(VerifierRunError::WrongExitCode { - expected: binding.expected_exit_code, - actual: exit_code, - stdout, - stderr, - }); - } - - let policy = binding.output_policy; - let stdout_empty = stdout.trim().is_empty(); - let stderr_empty = stderr.trim().is_empty(); - let ok = match policy { - VerifierOutputPolicyBinding::IgnoreVerifierOutput => true, - VerifierOutputPolicyBinding::RequireEmptyStdout => stdout_empty, - VerifierOutputPolicyBinding::RequireEmptyStderr => stderr_empty, - VerifierOutputPolicyBinding::RequireEmptyStdoutAndStderr => stdout_empty && stderr_empty, - }; - if !ok { - return Err(VerifierRunError::PolicyViolation { - policy, - stdout, - stderr, - }); - } - Ok(()) -} - -impl fmt::Display for VerifierRunError { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - match self { - VerifierRunError::SpecUnavailable { detail } => { - write!(f, "post_emit_verifier contract unavailable: {detail}") - } - VerifierRunError::InvocationFailed { command, io_error } => { - write!(f, "failed to invoke `{command}`: {io_error}") - } - VerifierRunError::WrongExitCode { - expected, - actual, - stdout, - stderr, - } => write!( - f, - "verifier exit {actual:?} != expected {expected}; stdout:\n{stdout}\nstderr:\n{stderr}" - ), - VerifierRunError::PolicyViolation { - policy, - stdout, - stderr, - } => write!( - f, - "verifier output policy {policy:?} violated; stdout:\n{stdout}\nstderr:\n{stderr}" - ), - } - } -} - -/// Resolve the cached `*_clean_emission` declaration for a Shape-A target. -pub fn clean_emission_spec( - dag: &Dag, - target: EmitTarget, -) -> Result { - let spec = match target { - EmitTarget::Rust => dag.rust_clean_emission_spec(), - EmitTarget::Go => dag.go_clean_emission_spec(), - EmitTarget::Python => dag.python_clean_emission_spec(), - }; - spec.ok_or(VerifierParseError::MissingDeclaration) -} - -/// Run the target's declared `post_emit_verifier` against an on-disk source file. -pub fn verify_emitted_source_file( - dag: &Dag, - target: EmitTarget, - source_path: &Path, -) -> Result<(), VerifierRunError> { - let spec = clean_emission_spec(dag, target).map_err(verifier_parse_error_to_run_error)?; - let binding = parse_post_emit_verifier(dag, spec).map_err(verifier_parse_error_to_run_error)?; - run_post_emit_verifier(&binding, source_path) -} - -fn verifier_parse_error_to_run_error(err: VerifierParseError) -> VerifierRunError { - VerifierRunError::SpecUnavailable { - detail: err.to_string(), - } -} - -impl fmt::Display for VerifierParseError { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - match self { - VerifierParseError::MissingDeclaration => { - write!(f, "clean_emission spec not found in bootstrap dag") - } - VerifierParseError::MalformedSpec { detail, .. } => { - write!(f, "malformed clean_emission spec: {detail}") - } - } - } -} - -/// Emit `program_dag` for `target`, write the source into `scratch_dir`, and -/// apply the contract's `post_emit_verifier`. `program_dag` must be a -/// `compile_to_dag` result (bootstrap carries clean-emission specs). -pub fn verify_program_emitted_source( - program_dag: &Dag, - target: EmitTarget, - scratch_dir: &Path, - file_stem: &str, -) -> Result<(), String> { - let emitted = emit_text_for_target(program_dag, target)?; - std::fs::create_dir_all(scratch_dir) - .map_err(|e| format!("create scratch {}: {e}", scratch_dir.display()))?; - let filename = format!("{file_stem}_{}", post_emit_default_source_filename(target)); - let src_path = scratch_dir.join(filename); - let mut file = std::fs::File::create(&src_path) - .map_err(|e| format!("create {}: {e}", src_path.display()))?; - file.write_all(emitted.as_bytes()) - .map_err(|e| format!("write {}: {e}", src_path.display()))?; - verify_emitted_source_file(program_dag, target, &src_path).map_err(|e| { - format!( - "{} post_emit_verifier for `{file_stem}`: {e}", - post_emit_target_label(target) - ) - }) -} - -/// Every **applicable** Shape-A target must accept the emitted source for `program_dag`. -/// Skips Go/Python when `fixture_name` is listed in `GO_EMIT_EXCLUDE` / -/// `PYTHON_EMIT_EXCLUDE` (same rule as omni emit gates). -pub fn verify_program_emitted_source_all_targets( - program_dag: &Dag, - scratch_dir: &Path, - file_stem: &str, - fixture_name: &str, -) -> Result<(), String> { - let mut failures = Vec::new(); - for &target in SHAPE_A_POST_EMIT_TARGETS { - if !fixture_supports_post_emit_target(fixture_name, target) { - continue; - } - if let Err(msg) = verify_program_emitted_source(program_dag, target, scratch_dir, file_stem) - { - failures.push(msg); - } - } - if failures.is_empty() { - Ok(()) - } else { - Err(failures.join("\n")) - } -} - -fn emit_text_for_target(program_dag: &Dag, target: EmitTarget) -> Result { - match target { - EmitTarget::Rust => emit_rust_text(program_dag).map_err(|e| format!("{e:?}")), - EmitTarget::Go => emit_go_text(program_dag).map_err(|e| format!("{e:?}")), - EmitTarget::Python => emit_python_text(program_dag).map_err(|e| format!("{e:?}")), - } -} - -fn require_string( - fields: &[(String, FieldValue)], - name: &'static str, - declaration: DeclarationId, -) -> Result { - fields - .iter() - .find(|(label, _)| label == name) - .and_then(|(_, value)| match value { - FieldValue::Literal(LiteralBits::String(s)) => Some(s.clone()), - _ => None, - }) - .ok_or(VerifierParseError::MalformedSpec { - declaration, - detail: "required string field missing or malformed", - }) -} - -fn require_int( - fields: &[(String, FieldValue)], - name: &'static str, - declaration: DeclarationId, -) -> Result { - fields - .iter() - .find(|(label, _)| label == name) - .and_then(|(_, value)| match value { - FieldValue::Literal(LiteralBits::Int(s)) => s.parse::().ok(), - _ => None, - }) - .ok_or(VerifierParseError::MalformedSpec { - declaration, - detail: "required int field missing or malformed", - }) -} - -fn require_string_list( - fields: &[(String, FieldValue)], - name: &'static str, - declaration: DeclarationId, -) -> Result, VerifierParseError> { - let value = fields - .iter() - .find(|(label, _)| label == name) - .map(|(_, value)| value) - .ok_or(VerifierParseError::MalformedSpec { - declaration, - detail: "required list field missing", - })?; - let FieldValue::List(entries) = value else { - return Err(VerifierParseError::MalformedSpec { - declaration, - detail: "required field must be a list", - }); - }; - let mut out = Vec::with_capacity(entries.len()); - for entry in entries { - let FieldValue::Literal(LiteralBits::String(s)) = entry else { - return Err(VerifierParseError::MalformedSpec { - declaration, - detail: "list entries must be string literals", - }); - }; - out.push(s.clone()); - } - Ok(out) -} - -fn parse_output_policy( - dag: &Dag, - fields: &[(String, FieldValue)], - name: &'static str, - declaration: DeclarationId, -) -> Result { - let value = fields - .iter() - .find(|(label, _)| label == name) - .map(|(_, value)| value) - .ok_or(VerifierParseError::MalformedSpec { - declaration, - detail: "required variant field missing", - })?; - let FieldValue::Variant { - constructor, - payload, - } = value - else { - return Err(VerifierParseError::MalformedSpec { - declaration, - detail: "output_policy must be a VerifierOutputPolicy variant", - }); - }; - if !payload.is_empty() { - return Err(VerifierParseError::MalformedSpec { - declaration, - detail: "VerifierOutputPolicy variants must not carry payload fields", - }); - } - // Variant resolution dispatches on the cached - // `VerifierOutputPolicyVariants` typed handles — the Dag - // resolves the Disj's variant ids once at bootstrap end and - // every downstream consumer compares `DeclarationId`s here. No - // variant.label string lookups at parse time; INVARIANTS.md - // §Layer opacity / §Semantic authority forbids post-lowering - // consumers from reaching for names. Mirrors the PR 2.5 - // `PatternBindingRuleVariants` structure. - let variants = dag.verifier_output_policy_variants(); - let ignore_output = variants - .ignore_output - .ok_or(VerifierParseError::MalformedSpec { - declaration, - detail: "VerifierOutputPolicy.IgnoreVerifierOutput declaration was not found", - })?; - let require_empty_stdout = - variants - .require_empty_stdout - .ok_or(VerifierParseError::MalformedSpec { - declaration, - detail: "VerifierOutputPolicy.RequireEmptyStdout declaration was not found", - })?; - let require_empty_stderr = - variants - .require_empty_stderr - .ok_or(VerifierParseError::MalformedSpec { - declaration, - detail: "VerifierOutputPolicy.RequireEmptyStderr declaration was not found", - })?; - let require_empty_stdout_and_stderr = - variants - .require_empty_stdout_and_stderr - .ok_or(VerifierParseError::MalformedSpec { - declaration, - detail: - "VerifierOutputPolicy.RequireEmptyStdoutAndStderr declaration was not found", - })?; - if *constructor == ignore_output { - Ok(VerifierOutputPolicyBinding::IgnoreVerifierOutput) - } else if *constructor == require_empty_stdout { - Ok(VerifierOutputPolicyBinding::RequireEmptyStdout) - } else if *constructor == require_empty_stderr { - Ok(VerifierOutputPolicyBinding::RequireEmptyStderr) - } else if *constructor == require_empty_stdout_and_stderr { - Ok(VerifierOutputPolicyBinding::RequireEmptyStdoutAndStderr) - } else { - Err(VerifierParseError::MalformedSpec { - declaration, - detail: "output_policy constructor is not a known VerifierOutputPolicy variant", - }) - } -} - -#[cfg(test)] -mod tests { - use super::*; - - /// Parse the Rust contract and assert the structural fields - /// match the declared values in `src/v3/spec/rust.dag`. Proves - /// the parser consumes the shared substrate correctly without - /// hardcoding any of the target-specific command / args values. - #[test] - fn parses_rust_post_emit_verifier_contract() { - let dag = crate::dag::Dag::new(); - let spec = dag - .rust_clean_emission_spec() - .expect("rust_clean_emission cached"); - let binding = parse_post_emit_verifier(&dag, spec).expect("parse"); - assert_eq!(binding.command, "rustc"); - assert_eq!(binding.args, vec!["--edition=2021", "-D", "warnings"]); - assert_eq!(binding.expected_exit_code, 0); - assert_eq!( - binding.output_policy, - VerifierOutputPolicyBinding::IgnoreVerifierOutput - ); - } - - #[test] - fn parses_go_post_emit_verifier_contract() { - let dag = crate::dag::Dag::new(); - let spec = dag - .go_clean_emission_spec() - .expect("go_clean_emission cached"); - let binding = parse_post_emit_verifier(&dag, spec).expect("parse"); - assert_eq!(binding.command, "gofmt"); - assert_eq!(binding.args, vec!["-l"]); - assert_eq!(binding.expected_exit_code, 0); - assert_eq!( - binding.output_policy, - VerifierOutputPolicyBinding::RequireEmptyStdout - ); - } - - #[test] - fn parses_python_post_emit_verifier_contract() { - let dag = crate::dag::Dag::new(); - let spec = dag - .python_clean_emission_spec() - .expect("python_clean_emission cached"); - let binding = parse_post_emit_verifier(&dag, spec).expect("parse"); - assert_eq!(binding.command, "python3"); - assert_eq!(binding.args, vec!["-m", "py_compile"]); - assert_eq!(binding.expected_exit_code, 0); - assert_eq!( - binding.output_policy, - VerifierOutputPolicyBinding::IgnoreVerifierOutput - ); - } - - /// Regression: `Path::parent()` returns `Some("")` for - /// single-component relative paths like `main.rs`. Setting - /// `current_dir("")` fails the spawn on most platforms, so the - /// runner used to reject valid inputs whenever callers passed - /// a bare relative filename. The fix filters empty parents so - /// the spawn inherits the ambient cwd instead. This test uses - /// an environment-probe binary that exists on every - /// POSIX-shaped test runner and expects exit 0 regardless of - /// the path passed; the specific file does not need to exist - /// because the probe doesn't read it. - #[cfg(unix)] - #[test] - fn run_accepts_single_component_relative_source_path() { - use std::path::PathBuf; - let binding = PostEmitVerifierBinding { - command: "true".to_string(), - args: Vec::new(), - expected_exit_code: 0, - output_policy: VerifierOutputPolicyBinding::IgnoreVerifierOutput, - }; - let relative = PathBuf::from("main.rs"); - run_post_emit_verifier(&binding, &relative) - .expect("single-component relative source path must not fail the spawn"); - } -} diff --git a/src/v3/compiler/src/process_exit.rs b/src/v3/compiler/src/process_exit.rs deleted file mode 100644 index d4b83262d3e..00000000000 --- a/src/v3/compiler/src/process_exit.rs +++ /dev/null @@ -1,19 +0,0 @@ -//! Host-side mirror of `dsl/std/process.dag` `ProcessExit`. -//! -//! **SG-0 / bounded-seed receipt:** hand-authored path is enumerated in -//! `EXPECTED_HAND_AUTHORED_NON_TEST` in `sg0_census_test.rs` (not -//! `GENERATED_FILES` / `build.rs` output). -//! -//! Used by PB-1 emitted bin-shim `main.rs` shells (`emit_rust_bin_shim`) so -//! generated sources can `match` on the same structural shape the `.dag` -//! substrate declares, without inventing a parallel exit carrier. - -// Practice 4 (coproduct checkpoint, `docs/modeling-discipline.md` §P1): 🟢 GREEN — -// terminal host mirror of `dsl/std/process.dag` `ProcessExit`; no extra variants -// or semantics beyond that substrate coproduct. `ExitFailure.code` uses `i64` -// — the same host width as `LiteralBits::Int` / substrate `Int` in `dag.rs`. -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum ProcessExit { - ExitSuccess, - ExitFailure { code: i64, reason: String }, -} diff --git a/src/v3/compiler/src/r1c_e_gates.rs b/src/v3/compiler/src/r1c_e_gates.rs deleted file mode 100644 index 32db7034e3c..00000000000 --- a/src/v3/compiler/src/r1c_e_gates.rs +++ /dev/null @@ -1,525 +0,0 @@ -//! R1C-E — emit-gate check functions shared by the host `#[test]` harness and -//! the `r1c_e_emit_gates` `bin` (the `ExecuteCommand` logical child for the -//! T-Emit `.dag` `TestClaim` wrappers; the `.dag` source is spliced into a -//! `Dag` at integration-test compile time via `env!("CARGO_BIN_EXE_…")` — -//! see the integration-test driver for the on-disk path of the template). -//! -//! Each `check_*` returns `Ok(())` when the gate holds, or `Err(String)` with a -//! human-readable failure detail. The `bin` maps `Ok` → exit 0 / `Err` → exit 1 -//! (no stdout/stderr capture by `ExecuteCommand` — exit code is the receipt). -//! `#[test]` callers panic with the detail to preserve the original failure -//! message. -//! -//! **Single source of truth.** The `#[test]` harness and the `bin` both call -//! these functions; do not duplicate the assertion bodies into either caller. -//! -//! **Public surface (R1 close scaffold).** The module is `pub` only so the -//! single bin in this crate can call it (Cargo bins compile against the public -//! lib API). Downstream crates must not depend on `r1c_e_gates::*`; this is a -//! scaffold that dissolves at R1 close together with the wrappers themselves. - -use std::io::Write; -use std::path::Path; -use std::path::PathBuf; -use std::process::{Command, Stdio}; -use std::sync::atomic::{AtomicUsize, Ordering}; -use std::sync::OnceLock; - -use crate::compile_to_dag; -use crate::emit::emit; -use crate::emit::EmitTarget; -use crate::emit_rust::{emit_rust, emit_rust_module}; -use crate::emit_rust_roundtrip_fixtures::{ - ProgramFixture, ReflectedExpected, GO_EMIT_EXCLUDE, PROGRAM_FIXTURES, PYTHON_EMIT_EXCLUDE, - REFLECTED_FIXTURES, -}; -use crate::post_emit_verifier::verify_program_emitted_source_all_targets; - -/// `emit_generic_bounds_survive` (host receipt: `m1_3_emit_rust_test::emit_generic_bounds_survive`, -/// PR #650 post-mortem). -/// -/// Pins the **Rust type line** for callable parameters: `impl Fn(...) -> ... + Clone`, -/// not `&impl Fn`. Body avoids higher-order `f(...)` calls — those are a separate -/// emit seam; this receipt only pins the parameter type spelling. -pub fn check_generic_bounds_survive() -> Result<(), String> { - let src = "fn twice(f: fn(Int) -> Int) -> Int = 0\n"; - let dag = compile_to_dag(src, "r1c_e_generic_bounds.v3") - .map_err(|e| format!("compile failed: {e:?}"))?; - let out = emit_rust_module(&dag).map_err(|e| format!("emit failed: {e:?}"))?; - - let sig = "fn twice(p0: impl Fn(i64) -> i64 + Clone) -> i64"; - if !out.contains(sig) { - return Err(format!( - "callable param should carry synthesized + Clone (downstream rustc / stage0 contract); got:\n{out}" - )); - } - if out.contains("&impl Fn") { - return Err(format!( - "borrowed callable param type must not be spelled as &impl Fn; got:\n{out}" - )); - } - Ok(()) -} - -// === emit_rust_fixtures_rustc_green (batched rustc program + reflected harness) === - -/// Directory containing `libv3_compiler-*.rlib` for the current build. Test -/// executables sit in `…/target/debug/deps/`; the `r1c_e_emit_gates` bin is in -/// `…/target/debug/` and links against the same `dependency=…/deps` layout. -fn rustc_deps_dir() -> PathBuf { - let exe = std::env::current_exe().expect("current exe"); - let parent = exe.parent().expect("parent of current exe"); - if parent.file_name() == Some(std::ffi::OsStr::new("deps")) { - parent.to_path_buf() - } else { - parent.join("deps") - } -} - -/// Resolves `lib{crate}-*.rlib` in the deps directory for the running executable. -/// -/// Picks the file with the newest `modified()` time; on equal mtimes, uses -/// [`Path`] order so the choice is deterministic (avoids flake from `read_dir` -/// order). **Assumes** a single Cargo build is writing this `target` tree — -/// concurrent `cargo` invocations racing the same `deps/` dir are unsupported -/// and may select the wrong artifact. -fn find_current_rlib(crate_name: &str) -> PathBuf { - let prefix = format!("lib{crate_name}-"); - let deps = rustc_deps_dir(); - let mut matches: Vec = std::fs::read_dir(&deps) - .unwrap_or_else(|e| panic!("read {}: {e}", deps.display())) - .filter_map(|entry| { - let path = entry.ok()?.path(); - let file_name = path.file_name()?.to_str()?; - if file_name.starts_with(&prefix) && file_name.ends_with(".rlib") { - Some(path) - } else { - None - } - }) - .collect(); - fn mtime(path: &Path) -> Option { - std::fs::metadata(path).and_then(|m| m.modified()).ok() - } - matches.sort_by(|a, b| { - mtime(a) - .cmp(&mtime(b)) - .then_with(|| a.as_os_str().cmp(b.as_os_str())) - }); - matches.pop().unwrap_or_else(|| { - panic!( - "no `{prefix}*.rlib` in {} (build `v3-compiler` for this target first)", - deps.display() - ) - }) -} - -/// How the rustc harness should link: standalone programs vs `v3_compiler` rlib -/// (reflected fixtures import `v3_compiler::dag` at runtime). -enum HarnessLinkMode { - Standalone, - WithV3Compiler, -} - -struct R1cERustcHarness { - scratch_dir: PathBuf, - child_index: AtomicUsize, -} - -impl R1cERustcHarness { - fn new(scope: &str) -> Self { - let pid = std::process::id(); - let scratch_dir = std::env::temp_dir().join(format!("r1c_e_{scope}_{pid}")); - Self { - scratch_dir, - child_index: AtomicUsize::new(0), - } - } - - fn next_child_dir(&self) -> PathBuf { - let id = self.child_index.fetch_add(1, Ordering::Relaxed); - let path = self.scratch_dir.join(format!("c{id}")); - std::fs::create_dir_all(&path).expect("create harness child dir"); - path - } - - fn compile(&self, rust_source: &str, bin_name: &str, mode: HarnessLinkMode) -> PathBuf { - let tmp_dir = self.next_child_dir(); - let src_path = tmp_dir.join("main.rs"); - let bin_path = tmp_dir.join(bin_name); - std::fs::File::create(&src_path) - .and_then(|mut f| f.write_all(rust_source.as_bytes())) - .expect("write harness source"); - - let mut cmd = Command::new("rustc"); - cmd.env_remove("RUSTC_BOOTSTRAP") - .arg("--edition=2021") - .arg(&src_path) - .arg("-o") - .arg(&bin_path); - - if let HarnessLinkMode::WithV3Compiler = mode { - let deps = rustc_deps_dir(); - let rlib = find_current_rlib("v3_compiler"); - cmd.arg("-L") - .arg(format!("dependency={}", deps.display())) - .arg("--extern") - .arg(format!("v3_compiler={}", rlib.display())); - } - - let status = cmd - .stdout(Stdio::inherit()) - .stderr(Stdio::inherit()) - .status() - .expect("invoke rustc — install a rust toolchain to run this gate"); - assert!(status.success(), "rustc failed on harness source"); - bin_path - } - - fn run(bin: &Path, args: &[&str]) -> String { - let output = Command::new(bin) - .args(args) - .output() - .expect("run compiled harness"); - if !output.status.success() { - panic!( - "compiled harness failed for args {args:?}: {}", - String::from_utf8_lossy(&output.stderr) - ); - } - String::from_utf8_lossy(&output.stdout).trim().to_string() - } -} - -static EMIT_RUST_HARNESS: OnceLock = OnceLock::new(); -static PROGRAM_HARNESS_BIN: OnceLock = OnceLock::new(); -static REFLECTED_HARNESS_BIN: OnceLock = OnceLock::new(); - -fn emit_rust_harness() -> &'static R1cERustcHarness { - EMIT_RUST_HARNESS.get_or_init(|| R1cERustcHarness::new("emit_rust_r1c_e")) -} - -fn build_program_harness() -> PathBuf { - let mut body = String::new(); - for fixture in PROGRAM_FIXTURES { - let emitted = emit_rust( - &compile_to_dag(fixture.source, "program_fixture.v3").expect("compiles to dag"), - ) - .expect("emit_rust"); - let emitted_pub_main = emitted.replace("fn main()", "pub fn main()"); - body.push_str(&format!( - "#[allow(warnings, clippy::all)] pub mod {name} {{ {emitted} }}\n", - name = fixture.name, - emitted = emitted_pub_main, - )); - } - body.push_str( - "fn main() { \ - let name = std::env::args().nth(1).expect(\"program fixture name\"); \ - match name.as_str() { \ - ", - ); - for fixture in PROGRAM_FIXTURES { - body.push_str(&format!("\"{0}\" => {0}::main(), ", fixture.name)); - } - body.push_str( - "other => panic!(\"unknown program fixture: {other}\"), \ - } \ - }\n", - ); - emit_rust_harness().compile(&body, "main_bin", HarnessLinkMode::Standalone) -} - -fn program_harness_bin() -> &'static Path { - PROGRAM_HARNESS_BIN - .get_or_init(build_program_harness) - .as_path() -} - -/// Run the batched program fixture harness (same binary as `m1_3_emit_rust_test` host path). -pub fn run_rust_program_fixture(name: &str) -> String { - R1cERustcHarness::run(program_harness_bin(), &[name]) -} - -fn build_reflected_harness() -> PathBuf { - let mut body = String::new(); - for fixture in REFLECTED_FIXTURES { - let module = emit_rust_module( - &compile_to_dag(fixture.module.source, "reflected_fixture.v3").expect("compiles"), - ) - .expect("emits"); - body.push_str(&format!( - "#[allow(warnings, clippy::all)] \ - pub mod {name} {{ \ - use v3_compiler::dag::*; \ - use v3_compiler::diagnostics::*; \ - {module} \ - pub fn run() -> i64 {{ {wrapper} }} \ - }}\n", - name = fixture.module.name, - wrapper = fixture.wrapper_body, - )); - } - body.push_str( - "fn main() { \ - let name = std::env::args().nth(1).expect(\"test name arg\"); \ - let value: i64 = match name.as_str() { \ - ", - ); - for fixture in REFLECTED_FIXTURES { - body.push_str(&format!("\"{0}\" => {0}::run(), ", fixture.module.name)); - } - body.push_str( - "other => panic!(\"unknown reflected harness test: {other}\"), \ - }; \ - println!(\"{value}\"); \ - }\n", - ); - emit_rust_harness().compile(&body, "reflected_bin", HarnessLinkMode::WithV3Compiler) -} - -fn reflected_harness_bin() -> &'static Path { - REFLECTED_HARNESS_BIN - .get_or_init(build_reflected_harness) - .as_path() -} - -/// Run the batched reflected-module fixture harness. -pub fn run_rust_reflected_fixture(name: &str) -> String { - R1cERustcHarness::run(reflected_harness_bin(), &[name]) -} - -/// `emit_rust_fixtures_rustc_green` — full matrix: all program + reflected -/// roundtrip expectations. -pub fn check_emit_rust_fixtures_rustc_green() -> Result<(), String> { - let mut failures: Vec = Vec::new(); - for fixture in PROGRAM_FIXTURES { - let stdout = run_rust_program_fixture(fixture.name); - if stdout != fixture.expected_stdout { - failures.push(format!( - "program {:?}: expected {:?}, got {stdout:?}", - fixture.name, fixture.expected_stdout, - )); - } - } - for fixture in REFLECTED_FIXTURES { - let stdout = run_rust_reflected_fixture(fixture.module.name); - let (ok, label) = match &fixture.expected_stdout { - ReflectedExpected::Exact(expected) => (stdout == *expected, format!("{expected:?}")), - ReflectedExpected::PositiveInt => ( - stdout.parse::().is_ok_and(|n| n > 0), - "positive integer".to_owned(), - ), - }; - if !ok { - failures.push(format!( - "reflected {:?}: expected {label}, got {stdout:?}", - fixture.module.name, - )); - } - } - if failures.is_empty() { - Ok(()) - } else { - Err(format!( - "{} fixture(s) failed:\n{}", - failures.len(), - failures.join("\n") - )) - } -} - -// === multi_target_emit_verification (E-5 post_emit_verifier on user programs) === - -/// Every `PROGRAM_FIXTURES` row must pass each **applicable** Shape-A target's declared -/// `post_emit_verifier` (rustc / gofmt / py_compile), honoring `GO_EMIT_EXCLUDE` / -/// `PYTHON_EMIT_EXCLUDE`. Closes the gap where M1 only cargo-checks the self-host -/// `src/v4` tree and `Compiles` ignores emission. -pub fn check_program_fixtures_post_emit_clean_all_targets() -> Result<(), String> { - let scratch_root = std::env::temp_dir().join(format!("r1c_e_post_emit_{}", std::process::id())); - std::fs::create_dir_all(&scratch_root).map_err(|e| format!("create scratch: {e}"))?; - let mut failures = Vec::new(); - for fixture in PROGRAM_FIXTURES { - let dag = compile_to_dag(fixture.source, "r1c_e_post_emit.v3") - .map_err(|e| format!("compile `{}`: {e:?}", fixture.name))?; - let scratch = scratch_root.join(fixture.name); - if let Err(msg) = - verify_program_emitted_source_all_targets(&dag, &scratch, fixture.name, fixture.name) - { - failures.push(format!("{}: {msg}", fixture.name)); - } - let _ = std::fs::remove_dir_all(&scratch); - } - let _ = std::fs::remove_dir_all(&scratch_root); - if failures.is_empty() { - Ok(()) - } else { - Err(format!( - "{} fixture(s) failed post_emit_verifier:\n{}", - failures.len(), - failures.join("\n") - )) - } -} - -// === emit_omni_demo_fixtures_green (multi-target) === - -struct OmniTmpDir(PathBuf); - -impl OmniTmpDir { - fn new(tag: u64) -> Self { - let path = std::env::temp_dir().join(format!("v3_r1c_e_omni_{tag}_{}", std::process::id())); - std::fs::create_dir_all(&path).expect("omni tmp dir"); - Self(path) - } - fn path(&self) -> &Path { - &self.0 - } -} - -impl Drop for OmniTmpDir { - fn drop(&mut self) { - let _ = std::fs::remove_dir_all(&self.0); - } -} - -/// Monotonic tag for each `OmniTmpDir` (`v3_r1c_e_omni_{tag}_{pid}`). Rust, Go, and -/// Python paths each `fetch_add` so concurrent scratch dirs never share one `tag`. -static OMNI_TMP_TAG: AtomicUsize = AtomicUsize::new(0); - -fn omni_fixtures() -> Vec<&'static ProgramFixture> { - PROGRAM_FIXTURES - .iter() - .filter(|f| !GO_EMIT_EXCLUDE.contains(&f.name)) - .filter(|f| !PYTHON_EMIT_EXCLUDE.contains(&f.name)) - .collect() -} - -fn omni_rust_stdout(source: &str) -> Result { - let id = OMNI_TMP_TAG.fetch_add(1, Ordering::Relaxed) as u64; - let dag = - compile_to_dag(source, "omni_parity_r1c_e.v3").map_err(|e| format!("compile: {e:?}"))?; - let rendered = emit_rust(&dag).map_err(|e| format!("Rust emit: {e:?}"))?; - let tmp = OmniTmpDir::new(id); - let src_path = tmp.path().join("main.rs"); - let bin_path = tmp.path().join("main_bin"); - std::fs::File::create(&src_path) - .and_then(|mut f| f.write_all(rendered.as_bytes())) - .map_err(|e| format!("write rust: {e}"))?; - let compile = Command::new("rustc") - .env_remove("RUSTC_BOOTSTRAP") - .arg(&src_path) - .arg("-o") - .arg(&bin_path) - .stdout(Stdio::inherit()) - .stderr(Stdio::inherit()) - .status() - .map_err(|e| format!("invoke rustc: {e}"))?; - if !compile.success() { - return Err(format!("rustc failed on emitted source:\n{rendered}")); - } - let run = Command::new(&bin_path) - .output() - .map_err(|e| format!("run binary: {e}"))?; - if !run.status.success() { - return Err("compiled rust binary exited non-zero".to_string()); - } - Ok(String::from_utf8_lossy(&run.stdout).trim().to_string()) -} - -fn omni_go_stdout(fixture_name: &str, source: &str) -> Result { - let dag = compile_to_dag(source, "omni_parity_r1c_e.v3") - .map_err(|e| format!("compile `{fixture_name}`: {e:?}"))?; - let rendered = emit(&dag, EmitTarget::Go) - .map_err(|e| format!("Go emit `{fixture_name}`: {e:?}"))? - .text; - let id = OMNI_TMP_TAG.fetch_add(1, Ordering::Relaxed) as u64; - let tmp = OmniTmpDir::new(id); - let src_path = tmp.path().join("main.go"); - std::fs::File::create(&src_path) - .and_then(|mut f| f.write_all(rendered.as_bytes())) - .map_err(|e| format!("write go: {e}"))?; - let run = Command::new("go") - .arg("run") - .arg(&src_path) - .current_dir(tmp.path()) - .output() - .map_err(|e| format!("go run `{fixture_name}`: {e}"))?; - if !run.status.success() { - return Err(format!( - "go run failed for `{fixture_name}`:\nstdout:\n{}\nstderr:\n{}", - String::from_utf8_lossy(&run.stdout), - String::from_utf8_lossy(&run.stderr) - )); - } - Ok(String::from_utf8_lossy(&run.stdout).trim().to_string()) -} - -fn omni_python_stdout(fixture_name: &str, source: &str) -> Result { - let dag = compile_to_dag(source, "omni_parity_r1c_e.v3") - .map_err(|e| format!("compile `{fixture_name}`: {e:?}"))?; - let rendered = emit(&dag, EmitTarget::Python) - .map_err(|e| format!("Python emit `{fixture_name}`: {e:?}"))? - .text; - let id = OMNI_TMP_TAG.fetch_add(1, Ordering::Relaxed) as u64; - let tmp = OmniTmpDir::new(id); - let src_path = tmp.path().join("main.py"); - std::fs::File::create(&src_path) - .and_then(|mut f| f.write_all(rendered.as_bytes())) - .map_err(|e| format!("write py: {e}"))?; - let run = Command::new("python3") - .arg(&src_path) - .output() - .map_err(|e| format!("python3 `{fixture_name}`: {e}"))?; - if !run.status.success() { - return Err(format!( - "python3 failed for `{fixture_name}`:\nstderr:\n{}", - String::from_utf8_lossy(&run.stderr) - )); - } - Ok(String::from_utf8_lossy(&run.stdout).trim().to_string()) -} - -fn omni_toolchain_available(cmd: &str, probe_arg: &str) -> bool { - Command::new(cmd) - .arg(probe_arg) - .stdout(Stdio::null()) - .stderr(Stdio::null()) - .status() - .ok() - .is_some_and(|s| s.success()) -} - -/// `emit_omni_demo_fixtures_green` — all omni targets agree with Rust baselines -/// (host: `m1_5_emit_omni_demo_test::emit_omni_demo_fixtures_green`). -pub fn check_omni_demo_fixtures_green() -> Result<(), String> { - if !omni_toolchain_available("go", "version") { - return Err("go toolchain not found — this gate requires go on PATH".to_string()); - } - if !omni_toolchain_available("python3", "--version") { - return Err("python3 toolchain not found — this gate requires python3 on PATH".to_string()); - } - let fixtures = omni_fixtures(); - if fixtures.is_empty() { - return Err("omni fixture set is empty after excludes".to_string()); - } - for fixture in fixtures { - let rust = omni_rust_stdout(fixture.source) - .map_err(|e| format!("omni rust `{}`: {e}", fixture.name))?; - let go = omni_go_stdout(fixture.name, fixture.source)?; - if go != rust { - return Err(format!( - "Go output diverged from Rust for `{}` (go={go:?} rust={rust:?})", - fixture.name - )); - } - let py = omni_python_stdout(fixture.name, fixture.source)?; - if py != rust { - return Err(format!( - "Python output diverged from Rust for `{}` (py={py:?} rust={rust:?})", - fixture.name - )); - } - } - Ok(()) -} diff --git a/src/v3/compiler/src/r3_fc_lane2_loop_witness.rs b/src/v3/compiler/src/r3_fc_lane2_loop_witness.rs deleted file mode 100644 index f59ab07a6e1..00000000000 --- a/src/v3/compiler/src/r3_fc_lane2_loop_witness.rs +++ /dev/null @@ -1,312 +0,0 @@ -//! R3 T-Free-Consequences: optional `lane2_workflow` on the workflow root from an **authored -//! comment** in the claim `source` string. -//! -//! **Modeling tension (explicit):** `docs/design-db18-workflow-effect-carrier.md` targets workflow / -//! loop shape as **lowering-only** substrate facts. This module is a **harness side channel**: it -//! fabricates `WorkflowEffect::LoopEffect` from a magic comment after parse/lower, so downstream -//! lenses can read the same carrier lowering will eventually own. That is intentional **Pattern A -//! author-now debt**, not the end-state authority model. -//! -//! **Program budget (P5 receipt):** `ROADMAP.md` §"Reflective integration patterns" — bullet -//! **"R3 second-batch auto-loop scaffold (T-Free-Consequences gates #46–#48)"** authorizes this path -//! and names the single dissolution trigger. SG-0 net-add PRs must pair with Director-budget class -//! **(b)** citing that ROADMAP URL, not research-only briefs as sole authority. Shape discussion (not -//! authorization) remains in `docs/briefs/r3-v-auto-loop-parallelism-cross-target-witness-shapes.md`. -//! -//! **Paired scaffold:** [`crate::lens_declaration_apply::apply_lens_declaration`] special-cases lens -//! `auto_loop_parallelism_pending_lens` when `program_under_test` is `Some`; dissolve **together** -//! with this scanner when lowering installs `lane2_workflow` from surface syntax. -//! -//! **Scope — global `compile_to_dag`, not `cfg(test)`:** [`crate::compile_to_dag`] and -//! `compile_onto_parse_surface_free_bootstrap` always call into this module after `infer`. Any -//! `.v3` source that includes the magic directive therefore stages `lane2_workflow` on the workflow -//! **Bind shell** ([`Dag::workflow_lane2_subject`]) in that compile. This is deliberate: claim programs and ordinary programs share one -//! pipeline, and activation is **opt-in** via the `gunbc::r3_free_consequences::…` namespaced prefix -//! (not a test-only hook). Reading that staged fact through `auto_loop_parallelism_pending_lens` -//! still requires the test-runner / lens path to pass `program_under_test: Some(_)`. -//! -//! **Dissolution:** delete this scan and the magic-comment contract when lowering authors loop -//! `lane2_workflow` facts; remove the lens name-key branch in the same change set. - -use std::collections::BTreeMap; - -use crate::dag::{ - CallableRef, Dag, HttpMethodScalar, InputField, Operation, PathTemplate, RestEndpointBinding, - UrlPathToken, WorkflowEffect, -}; -use crate::diagnostics::{Correction, Diagnostic, SourceSpan}; - -fn lane2_witness_operation( - dag: &Dag, - name: &str, - method: HttpMethodScalar, - tokens: Vec, -) -> Operation { - let callable = dag - .declaration_by_name(name) - .expect("bootstrap should provide requested method declaration") - .id; - let inputs = tokens - .iter() - .filter_map(|token| match token { - UrlPathToken::ParamToken { name } => Some((name.clone(), InputField {})), - UrlPathToken::LiteralToken { .. } => None, - }) - .collect::>(); - Operation { - callable: CallableRef { decl: callable }, - inputs, - endpoint: RestEndpointBinding { - method, - path: PathTemplate { tokens }, - }, - } -} - -const DIRECTIVE_PREFIX: &str = "// gunbc::r3_free_consequences::lane2_loop_witness:"; - -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -enum WitnessKind { - ReadOnlyLoop, - UpsertLoop, - /// Present in source: do not register `lane2_workflow` (unproven / sequential default). - Unproven, -} - -enum WitnessScan { - Absent, - Ok { - kind: WitnessKind, - directive_span: SourceSpan, - }, - Malformed { - span: SourceSpan, - message: String, - }, -} - -fn scan_witness(source: &str, file: &str) -> WitnessScan { - let mut i = 0usize; - while i < source.len() { - let line_end = source[i..] - .find('\n') - .map(|p| i + p) - .unwrap_or(source.len()); - let line_no_nl = &source[i..line_end]; - let ws_leading = line_no_nl.len() - line_no_nl.trim_start().len(); - let trimmed = line_no_nl.trim(); - let trimmed_start = i + ws_leading; - let trimmed_end = trimmed_start + trimmed.len(); - - if let Some(rest) = trimmed.strip_prefix(DIRECTIVE_PREFIX) { - let token = rest.trim(); - if token.is_empty() { - return WitnessScan::Malformed { - span: SourceSpan::new(file, trimmed_start as u32, trimmed_end as u32), - message: "`lane2_loop_witness` directive requires a token: read_only, upsert_dependent, or unproven".to_string(), - }; - } - let kind = match token { - "read_only" => WitnessKind::ReadOnlyLoop, - "upsert_dependent" => WitnessKind::UpsertLoop, - "unproven" => WitnessKind::Unproven, - _ => { - return WitnessScan::Malformed { - span: SourceSpan::new(file, trimmed_start as u32, trimmed_end as u32), - message: format!( - "unknown `lane2_loop_witness` directive token `{token}`; expected read_only | upsert_dependent | unproven" - ), - }; - } - }; - return WitnessScan::Ok { - kind, - directive_span: SourceSpan::new(file, trimmed_start as u32, trimmed_end as u32), - }; - } - - i = if line_end < source.len() { - line_end + 1 - } else { - line_end - }; - } - WitnessScan::Absent -} - -/// If `source` carries a `lane2_loop_witness` directive, register the matching -/// [`WorkflowEffect::LoopEffect`] on [`Dag::workflow_lane2_subject`] (last `Bind` shell). -/// -/// Fail-closed: a `read_only` / `upsert_dependent` directive **must** stage `lane2_workflow` or emit -/// a diagnostic (no silent collapse into the same sequential scalar as a missing carrier). -pub fn apply_authored_lane2_loop_witness(dag: &mut Dag, source: &str, file: &str) { - match scan_witness(source, file) { - WitnessScan::Absent => {} - WitnessScan::Malformed { span, message } => { - dag.attach_diagnostic(Diagnostic::ParseError { - message, - span, - correction: Correction::deferred_for_diagnostic_class("Lane2LoopWitnessDiagnostic"), - }); - } - WitnessScan::Ok { - kind, - directive_span, - } => { - if matches!(kind, WitnessKind::Unproven) { - return; - } - let wf = match kind { - WitnessKind::ReadOnlyLoop => WorkflowEffect::LoopEffect { - body: Box::new(WorkflowEffect::LinearEffect { - ops: vec![lane2_witness_operation( - dag, - "get_method", - HttpMethodScalar::Get, - vec![], - )], - }), - }, - WitnessKind::UpsertLoop => WorkflowEffect::LoopEffect { - body: Box::new(WorkflowEffect::LinearEffect { - ops: vec![lane2_witness_operation( - dag, - "map_insert_method", - HttpMethodScalar::Put, - vec![UrlPathToken::ParamToken { - name: "id".to_string(), - }], - )], - }), - }, - WitnessKind::Unproven => unreachable!("filtered above"), - }; - let Some(subject) = dag.workflow_lane2_subject() else { - dag.attach_diagnostic(Diagnostic::ParseError { - message: "`lane2_loop_witness` directive requires a workflow shell `Bind` to attach `lane2_workflow`; this program has no `Bind`".to_string(), - span: directive_span, - correction: Correction::deferred_for_diagnostic_class("Lane2LoopWitnessDiagnostic"), - }); - return; - }; - if !dag.try_register_lane2_workflow_effect(subject, wf) { - dag.attach_diagnostic(Diagnostic::ParseError { - message: "`lane2_loop_witness`: cannot attach `lane2_workflow` (substrate supports Value/Bind nodes only)".to_string(), - span: directive_span, - correction: Correction::deferred_for_diagnostic_class("Lane2LoopWitnessDiagnostic"), - }); - } - } - } -} - -#[cfg(test)] -mod tests { - use crate::compile_to_dag; - use crate::dag::{operation_effect_shape, EffectShape, IdempotentShape, WorkflowEffect}; - use crate::diagnostics::Diagnostic; - use crate::CompileError; - - #[test] - fn directive_on_a_later_line_is_found_after_non_matching_comments() { - let src = "// unrelated preamble comment\n// gunbc::r3_free_consequences::lane2_loop_witness: read_only\nlet _: Int = 0\n"; - let dag = compile_to_dag(src, "witness_after_preamble.v3").expect("compile"); - let subject = dag.workflow_lane2_subject().expect("lane2 subject"); - assert_eq!( - crate::loop_iteration_parallel_emission_indicator(&dag, subject), - 1 - ); - } - - #[test] - fn read_only_directive_registers_loop_workflow() { - let src = "// gunbc::r3_free_consequences::lane2_loop_witness: read_only\nlet _: Int = 0\n"; - let dag = compile_to_dag(src, "witness_read.v3").expect("compile"); - let subject = dag.workflow_lane2_subject().expect("lane2 subject"); - let wf = dag - .lane2_workflow_effect_at(&subject) - .expect("lane2_workflow staged"); - assert!(matches!( - wf, - WorkflowEffect::LoopEffect { body } - if matches!( - body.as_ref(), - WorkflowEffect::LinearEffect { ops } - if ops.len() == 1 - && matches!( - operation_effect_shape(&dag, &ops[0]), - Some(EffectShape::IsIdempotent(IdempotentShape::ReadEffect)) - ) - ) - )); - assert_eq!( - crate::loop_iteration_parallel_emission_indicator(&dag, subject), - 1 - ); - } - - #[test] - fn upsert_directive_registers_sequential_body() { - let src = - "// gunbc::r3_free_consequences::lane2_loop_witness: upsert_dependent\nlet _: Int = 0\n"; - let dag = compile_to_dag(src, "witness_upsert.v3").expect("compile"); - let subject = dag.workflow_lane2_subject().expect("lane2 subject"); - let wf = dag - .lane2_workflow_effect_at(&subject) - .expect("lane2_workflow staged"); - assert!(matches!( - wf, - WorkflowEffect::LoopEffect { body } - if matches!( - body.as_ref(), - WorkflowEffect::LinearEffect { ops } - if ops.len() == 1 - && matches!( - operation_effect_shape(&dag, &ops[0]), - Some(EffectShape::IsIdempotent(IdempotentShape::UpsertEffect { .. })) - ) - ) - )); - assert_eq!( - crate::loop_iteration_parallel_emission_indicator(&dag, subject), - 0 - ); - } - - #[test] - fn unproven_directive_leaves_lane2_absent() { - let src = "// gunbc::r3_free_consequences::lane2_loop_witness: unproven\nlet _: Int = 0\n"; - let dag = compile_to_dag(src, "witness_none.v3").expect("compile"); - let subject = dag.workflow_lane2_subject().expect("lane2 subject"); - assert!(dag.lane2_workflow_effect_at(&subject).is_none()); - assert_eq!( - crate::loop_iteration_parallel_emission_indicator(&dag, subject), - 0 - ); - } - - #[test] - fn unknown_directive_token_is_parse_error() { - let file = "witness_typo.v3"; - let src = "// gunbc::r3_free_consequences::lane2_loop_witness: typo\nlet _: Int = 0\n"; - let err = compile_to_dag(src, file).expect_err("diagnostic"); - let CompileError::Semantic(dag) = err else { - panic!("expected semantic failure"); - }; - // Contract: malformed witness token surfaces as `Diagnostic::ParseError` on the claim file. - // Avoid substring-matching diagnostic prose (TESTING.md / INVARIANTS P3); span + variant only. - let mut parse_error_spans = 0u32; - for (_, d) in dag.diagnostics().iter() { - if let Diagnostic::ParseError { span, .. } = d { - assert_eq!(span.file, file); - parse_error_spans += 1; - } - } - assert_eq!( - parse_error_spans, - 1, - "expected exactly one ParseError for malformed witness token, diagnostics={:?}", - dag.diagnostics().iter().collect::>() - ); - } -} diff --git a/src/v3/compiler/src/r3_gate_87_cementing_regen_runner_suites.rs b/src/v3/compiler/src/r3_gate_87_cementing_regen_runner_suites.rs deleted file mode 100644 index bd0d06d2ea3..00000000000 --- a/src/v3/compiler/src/r3_gate_87_cementing_regen_runner_suites.rs +++ /dev/null @@ -1,140 +0,0 @@ -//! R3 gate #87 — PB-B-1 runner table for `tests/dag/t_r3_gate_87_cementing_regen_*.dag` harnesses. -//! -//! **INVARIANTS P2 / single authority:** `R3_GATE_87_CEMENTING_REGEN_SUITES` is the only merge-visible -//! inventory for which harnesses `t_pb_b_1_dag_runner_test` executes. `cementing_dispatch` and -//! `r3_gate_87_lens_cementing_regen_receipts_test` consume the same table so `.dag` Band-C receipts -//! cannot pass `CementingDispatchMatchesProjection` without a matching runner row. - -use std::collections::BTreeSet; -use std::path::Path; - -/// `LensRegistryEntry.name` values implied by [`R3_GATE_87_CEMENTING_REGEN_SUITES`] harness `file` -/// paths (`t_r3_gate_87_cementing_regen_.dag`). **Single authority** for the gate-#87 -/// inventory ratchet: `r3_gate_87_lens_cementing_regen_receipts_test` compares live `regen.dag` -/// names against this set so a new registry row cannot ship without a matching runner row. -pub fn r3_gate_87_cementing_regen_lens_names_for_runner_table() -> BTreeSet { - R3_GATE_87_CEMENTING_REGEN_SUITES - .iter() - .map(|(_, file, _, _)| lens_name_from_gate_87_harness_path(file)) - .collect() -} - -/// Module stems (`tests/dag/.dag`) enumerated in [`R3_GATE_87_CEMENTING_REGEN_SUITES`]. -/// [`crate::cementing_dispatch::evaluate_cementing_dispatch_projection`] requires every -/// `kind == "dag"` receipt in `cementing_dispatch.dag` to use one of these stems so the dispatch -/// list cannot drift from the T-PB-B-1 runner. -pub fn r3_gate_87_cementing_regen_pb_b1_dag_module_stems() -> BTreeSet { - R3_GATE_87_CEMENTING_REGEN_SUITES - .iter() - .map(|(_, file, _, _)| { - Path::new(file) - .file_stem() - .and_then(|s| s.to_str()) - .unwrap_or_else(|| { - panic!("R3_GATE_87_CEMENTING_REGEN_SUITES: invalid harness path `{file}`") - }) - .to_string() - }) - .collect() -} - -// R3 gate #87 — every `LensRegistryEntry` in `src/v3/compiler/regen.dag` has a -// `src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_.dag` harness evaluated here. -const R3_GATE_87_CEMENTING_HARNESS_PATH_PREFIX: &str = - "src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_"; -const R3_GATE_87_CEMENTING_HARNESS_PATH_SUFFIX: &str = ".dag"; - -fn lens_name_from_gate_87_harness_path(file: &str) -> String { - file.strip_prefix(R3_GATE_87_CEMENTING_HARNESS_PATH_PREFIX) - .and_then(|rest| rest.strip_suffix(R3_GATE_87_CEMENTING_HARNESS_PATH_SUFFIX)) - .unwrap_or_else(|| { - panic!( - "R3_GATE_87_CEMENTING_REGEN_SUITES: harness path must be \ - `{prefix}{suffix}`, got `{file}`", - prefix = R3_GATE_87_CEMENTING_HARNESS_PATH_PREFIX, - suffix = R3_GATE_87_CEMENTING_HARNESS_PATH_SUFFIX, - ) - }) - .to_string() -} - -pub const R3_GATE_87_CEMENTING_REGEN_SUITES: &[(&str, &str, &str, &[&str])] = &[ - ( - include_str!("../tests/dag/t_r3_gate_87_cementing_regen_cost.dag"), - "src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_cost.dag", - "r3_gate_87_cementing_regen_cost_suite", - &[ - "cementing_regen_cost_merge_sort_lens_output_equals", - "cementing_regen_cost", - ], - ), - ( - include_str!("../tests/dag/t_r3_gate_87_cementing_regen_cost_symbolic.dag"), - "src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_cost_symbolic.dag", - "r3_gate_87_cementing_regen_cost_symbolic_suite", - &[ - "cementing_regen_cost_symbolic", - "cementing_regen_cost_symbolic_countdown", - ], - ), - ( - include_str!("../tests/dag/t_r3_gate_87_cementing_regen_cost_target_realization.dag"), - "src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_cost_target_realization.dag", - "r3_gate_87_cementing_regen_cost_target_realization_suite", - &["cementing_regen_cost_target_realization"], - ), - ( - include_str!("../tests/dag/t_r3_gate_87_cementing_regen_effect_enumeration.dag"), - "src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_effect_enumeration.dag", - "r3_gate_87_cementing_regen_effect_enumeration_suite", - &["cementing_regen_effect_enumeration"], - ), - ( - include_str!("../tests/dag/t_r3_gate_87_cementing_regen_idempotency.dag"), - "src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_idempotency.dag", - "r3_gate_87_cementing_regen_idempotency_suite", - &["cementing_regen_idempotency"], - ), - ( - include_str!("../tests/dag/t_r3_gate_87_cementing_regen_infer_helpers.dag"), - "src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_infer_helpers.dag", - "r3_gate_87_cementing_regen_infer_helpers_suite", - &["cementing_regen_infer_helpers"], - ), - ( - include_str!("../tests/dag/t_r3_gate_87_cementing_regen_lower_helpers.dag"), - "src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_lower_helpers.dag", - "r3_gate_87_cementing_regen_lower_helpers_suite", - &["cementing_regen_lower_helpers"], - ), - ( - include_str!("../tests/dag/t_r3_gate_87_cementing_regen_parallelism.dag"), - "src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_parallelism.dag", - "r3_gate_87_cementing_regen_parallelism_suite", - &["cementing_regen_parallelism"], - ), - ( - include_str!("../tests/dag/t_r3_gate_87_cementing_regen_provenance.dag"), - "src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_provenance.dag", - "r3_gate_87_cementing_regen_provenance_suite", - &["cementing_regen_provenance"], - ), - ( - include_str!("../tests/dag/t_r3_gate_87_cementing_regen_structural_resolution.dag"), - "src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_structural_resolution.dag", - "r3_gate_87_cementing_regen_structural_resolution_suite", - &["cementing_regen_structural_resolution"], - ), - ( - include_str!("../tests/dag/t_r3_gate_87_cementing_regen_unused_parameters.dag"), - "src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_unused_parameters.dag", - "r3_gate_87_cementing_regen_unused_parameters_suite", - &["cementing_regen_unused_parameters"], - ), - ( - include_str!("../tests/dag/t_r3_gate_87_cementing_regen_variant_payload.dag"), - "src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_variant_payload.dag", - "r3_gate_87_cementing_regen_variant_payload_suite", - &["cementing_regen_variant_payload"], - ), -]; diff --git a/src/v3/compiler/src/regen_bootstrap_emit.rs b/src/v3/compiler/src/regen_bootstrap_emit.rs deleted file mode 100644 index 1feb00cea47..00000000000 --- a/src/v3/compiler/src/regen_bootstrap_emit.rs +++ /dev/null @@ -1,1003 +0,0 @@ -use std::fmt::Write as FmtWrite; -use std::io::Write as IoWrite; -use std::process::{Command, Stdio}; - -use crate::dag::{ - ArithmeticOp, ArrowBody, AtomPayload, Behavior, BindEmitParticipation, BindNode, - BranchEmitParticipation, BranchNode, BranchPattern, CardinalityBound, Cluster, ClusterId, - ComparisonOp, Dag, Declaration, DeclarationId, Field, FieldMap, FieldValue, IntraClusterCall, - LiteralBits, LogicalOp, LoopBound, LoopNode, MemberDescent, NodeId, NominalOpacity, - NonEmptyList, NonSingletonList, OperatorKind, Path, PayloadBinding, PhantomParameter, PortId, - PortState, TemplateArgument, TransformNode, TransformTarget, TypeConnective, ValueBody, - ValueNode, -}; -use crate::diagnostics::{Diagnostic, DiagnosticAttribution}; - -pub fn render_bootstrap_generated_rs( - dag: &Dag, - authority_label: &str, - function_name: &str, -) -> Result { - let header = format!( - "// AUTO-GENERATED from `{authority_label}` via `regen_bootstrap`.\n\ - // Regenerate instead of hand-editing.\n\n" - ); - let rust = emit_bootstrap_module(dag, function_name); - rustfmt_stdout(&format!("{header}{rust}")) -} - -pub fn render_bootstrap_std_generated_rs(dag: &Dag) -> Result { - render_bootstrap_generated_rs(dag, "dsl/std/*.dag", "bootstrapped_std_fixture_dag") -} - -fn rustfmt_stdout(combined: &str) -> Result { - let mut child = Command::new("rustfmt") - .arg("--emit") - .arg("stdout") - .stdin(Stdio::piped()) - .stdout(Stdio::piped()) - .spawn() - .map_err(|e| format!("spawn rustfmt: {e}"))?; - child - .stdin - .as_mut() - .unwrap() - .write_all(combined.as_bytes()) - .map_err(|e| format!("write rustfmt stdin: {e}"))?; - let output = child - .wait_with_output() - .map_err(|e| format!("wait rustfmt: {e}"))?; - if !output.status.success() { - return Err(format!( - "rustfmt failed: {}", - String::from_utf8_lossy(&output.stderr) - )); - } - String::from_utf8(output.stdout).map_err(|e| format!("rustfmt stdout utf-8: {e}")) -} - -fn emit_bootstrap_module(dag: &Dag, function_name: &str) -> String { - let nodes_fn = format!("{function_name}_nodes"); - let declarations_fn = format!("{function_name}_declarations"); - let ports_fn = format!("{function_name}_ports"); - let diagnostics_fn = format!("{function_name}_diagnostics"); - let clusters_fn = format!("{function_name}_clusters"); - let optional_match_disjs_fn = format!("{function_name}_optional_match_disjs"); - - let mut out = String::new(); - out.push_str(&format!("pub(crate) fn {function_name}() -> Dag {{\n")); - out.push_str(" Dag {\n"); - push_field(&mut out, "nodes", &format!("{nodes_fn}()"), 2); - push_field(&mut out, "declarations", &format!("{declarations_fn}()"), 2); - push_field(&mut out, "ports", &format!("{ports_fn}()"), 2); - push_field(&mut out, "diagnostics", &format!("{diagnostics_fn}()"), 2); - push_field(&mut out, "next_node_id", &dag.nodes().len().to_string(), 2); - push_field( - &mut out, - "next_declaration_id", - &dag.declarations().len().to_string(), - 2, - ); - push_field(&mut out, "next_port_id", &dag.ports().len().to_string(), 2); - out.push_str(" primitives: PrimitiveCache::default(),\n"); - out.push_str(" substrate_markers: SubstrateMarkers::default(),\n"); - out.push_str(" realization_metas: RealizationMetaCache::default(),\n"); - out.push_str(" target_syntax: TargetSyntaxCache::default(),\n"); - out.push_str(" stdlib_types: StdlibTypeCache::default(),\n"); - out.push_str(" emit_anchors: EmitAnchorCache::default(),\n"); - out.push_str(" pattern_binding_rule_variants: PatternBindingRuleVariants::default(),\n"); - out.push_str(" variant_payload_field_access_rule_variants: VariantPayloadFieldAccessRuleVariants::default(),\n"); - out.push_str( - " verifier_output_policy_variants: VerifierOutputPolicyVariants::default(),\n", - ); - out.push_str(" callable_strategy_variants: CallableStrategyVariants::default(),\n"); - out.push_str(" emit_model_variants: EmitModelVariants::default(),\n"); - push_field(&mut out, "clusters", &format!("{clusters_fn}()"), 2); - push_field( - &mut out, - "optional_match_disjs", - &format!("{optional_match_disjs_fn}()"), - 2, - ); - push_field( - &mut out, - "declaration_append_begin_after_bootstrap", - &dag.declarations().len().to_string(), - 2, - ); - out.push_str(" }\n"); - out.push_str("}\n"); - out.push_str(&format!( - "\n#[allow(clippy::vec_init_then_push)]\nfn {nodes_fn}() -> Vec {{\n {}\n}}\n", - render_behaviors(dag.nodes()) - )); - out.push_str(&format!( - "\n#[allow(clippy::vec_init_then_push)]\nfn {declarations_fn}() -> Vec {{\n {}\n}}\n", - render_declarations(dag.declarations()) - )); - out.push_str(&format!( - "\nfn {ports_fn}() -> HashMap {{\n {}\n}}\n", - render_ports(dag) - )); - out.push_str(&format!( - "\nfn {diagnostics_fn}() -> DiagnosticTable {{\n {}\n}}\n", - render_diagnostics(dag) - )); - out.push_str(&format!( - "\nfn {clusters_fn}() -> Vec {{\n {}\n}}\n", - render_clusters(dag) - )); - out.push_str(&format!( - "\nfn {optional_match_disjs_fn}() -> HashMap {{\n {}\n}}\n", - render_optional_match_disjs(dag) - )); - out -} - -fn push_field(out: &mut String, name: &str, value: &str, indent: usize) { - let padding = " ".repeat(indent * 4); - let _ = writeln!(out, "{padding}{name}: {value},"); -} - -fn render_declarations(declarations: &[Declaration]) -> String { - if declarations.is_empty() { - return "Vec::new()".to_string(); - } - let mut out = format!( - "{{ let mut declarations = Vec::with_capacity({});\n", - declarations.len() - ); - for declaration in declarations { - let _ = writeln!( - out, - " declarations.push({});", - render_declaration(declaration) - ); - } - out.push_str(" declarations }\n"); - out -} - -fn render_declaration(declaration: &Declaration) -> String { - format!( - "Declaration {{ id: {}, name: {}, connective: {}, type_params: {}, phantom_params: {}, meta_tag: {}, specialization_parent: {}, inhabits: {}, value_body: {}, refinement: {}, nominal_opacity: {}, span: {} }}", - render_declaration_id(declaration.id), - render_opt_string(declaration.name.as_deref()), - render_type_connective(&declaration.connective), - render_declaration_id_vec(&declaration.type_params), - render_phantom_params(&declaration.phantom_params), - render_opt_declaration_id(declaration.meta_tag), - render_opt_declaration_id(declaration.specialization_parent), - render_opt_declaration_id(declaration.inhabits), - render_opt_value_body(declaration.value_body.as_ref()), - render_opt_declaration_id(declaration.refinement), - render_opt_nominal_opacity(declaration.nominal_opacity.as_ref()), - render_source_span(&declaration.span), - ) -} - -fn render_opt_nominal_opacity(opacity: Option<&NominalOpacity>) -> String { - match opacity { - None => "None".to_string(), - Some(o) => { - let ids: Vec = o - .permitted_accessors - .iter() - .map(|id| render_declaration_id(*id)) - .collect(); - format!( - "Some(NominalOpacity {{ permitted_accessors: vec![{}] }})", - ids.join(", ") - ) - } - } -} - -fn render_phantom_params(params: &[PhantomParameter]) -> String { - if params.is_empty() { - return "Vec::new()".to_string(); - } - let rendered: Vec = params - .iter() - .map(|param| { - format!( - "PhantomParameter {{ parameter: {}, algebra: {} }}", - render_declaration_id(param.parameter), - render_declaration_id(param.algebra) - ) - }) - .collect(); - format!("vec![{}]", rendered.join(", ")) -} - -fn render_type_connective(connective: &TypeConnective) -> String { - match connective { - TypeConnective::Atom(payload) => { - format!("TypeConnective::Atom({})", render_atom_payload(payload)) - } - TypeConnective::Conj { children } => { - format!( - "TypeConnective::Conj {{ children: {} }}", - render_fields(children) - ) - } - TypeConnective::Disj { variants } => { - format!( - "TypeConnective::Disj {{ variants: {} }}", - render_fields(variants) - ) - } - TypeConnective::Arrow { - inputs, - output, - body, - } => format!( - "TypeConnective::Arrow {{ inputs: {}, output: {}, body: {} }}", - render_declaration_id_vec(inputs), - render_declaration_id(*output), - render_arrow_body(body), - ), - TypeConnective::Cardinality(payload) => format!( - "TypeConnective::Cardinality(CardinalityPayload::new_unchecked_bypassing_idempotence({}, {}))", - render_declaration_id(payload.element()), - render_cardinality_bound(&payload.bound()), - ), - TypeConnective::Instantiation { - template, - arguments, - } => format!( - "TypeConnective::Instantiation {{ template: {}, arguments: {} }}", - render_declaration_id(*template), - render_template_arguments(arguments), - ), - } -} - -fn render_fields(fields: &[Field]) -> String { - let values: Vec = fields - .iter() - .map(|field| { - format!( - "Field {{ label: {:?}.to_string(), ty: {} }}", - field.label, - render_declaration_id(field.ty) - ) - }) - .collect(); - render_vec(&values) -} - -fn render_atom_payload(payload: &AtomPayload) -> String { - match payload { - AtomPayload::Literal(bits) => { - format!("AtomPayload::Literal({})", render_literal_bits(bits)) - } - AtomPayload::UnresolvedIdentifier(name) => { - format!("AtomPayload::UnresolvedIdentifier({name:?}.to_string())") - } - AtomPayload::ResolvedByStructure(id) => { - format!( - "AtomPayload::ResolvedByStructure({})", - render_declaration_id(*id) - ) - } - AtomPayload::ResolvedByName(id) => { - format!( - "AtomPayload::ResolvedByName({})", - render_declaration_id(*id) - ) - } - AtomPayload::TypeParam(name) => format!("AtomPayload::TypeParam({name:?}.to_string())"), - } -} - -fn render_arrow_body(body: &ArrowBody) -> String { - match body { - ArrowBody::UserDefined(id) => format!( - "ArrowBody::UserDefined(BindNodeId::new_unchecked({}))", - render_node_id(id.node_id()) - ), - ArrowBody::ExternalRealization(id) => { - format!( - "ArrowBody::ExternalRealization({})", - render_declaration_id(*id) - ) - } - ArrowBody::Pending => "ArrowBody::Pending".to_string(), - ArrowBody::NoBody => "ArrowBody::NoBody".to_string(), - ArrowBody::Unparsed(span) => format!("ArrowBody::Unparsed({})", render_source_span(span)), - } -} - -fn render_cardinality_bound(bound: &CardinalityBound) -> String { - match bound { - CardinalityBound::Exact(value) => format!("CardinalityBound::Exact({value})"), - CardinalityBound::AtMostOne => "CardinalityBound::AtMostOne".to_string(), - CardinalityBound::Unbounded => "CardinalityBound::Unbounded".to_string(), - } -} - -fn render_template_arguments(arguments: &[TemplateArgument]) -> String { - let values: Vec = arguments - .iter() - .map(|arg| { - format!( - "TemplateArgument {{ parameter: {}, value: {} }}", - render_declaration_id(arg.parameter), - render_declaration_id(arg.value) - ) - }) - .collect(); - render_vec(&values) -} - -fn render_opt_value_body(value_body: Option<&ValueBody>) -> String { - match value_body { - Some(value_body) => format!("Some({})", render_value_body(value_body)), - None => "None".to_string(), - } -} - -fn render_value_body(value_body: &ValueBody) -> String { - match value_body { - ValueBody::Unparsed(span) => format!("ValueBody::Unparsed({})", render_source_span(span)), - ValueBody::Structural { fields } => { - format!( - "ValueBody::Structural {{ fields: {} }}", - render_named_field_values(fields) - ) - } - ValueBody::Scalar(bits) => format!("ValueBody::Scalar({})", render_literal_bits(bits)), - ValueBody::List(values) => { - let rendered: Vec = values.iter().map(render_field_value).collect(); - format!("ValueBody::List({})", render_vec(&rendered)) - } - ValueBody::Map(entries) => { - format!( - "ValueBody::Map({})", - render_field_map("ValueBody::Map", entries) - ) - } - } -} - -fn render_field_map(context: &str, map: &FieldMap) -> String { - format!( - "FieldMap::from_entries({}).expect({context:?})", - render_named_field_values(map.entries()) - ) -} - -fn render_named_field_values(fields: &[(String, FieldValue)]) -> String { - let values: Vec = fields - .iter() - .map(|(label, value)| format!("({label:?}.to_string(), {})", render_field_value(value))) - .collect(); - render_vec(&values) -} - -fn render_field_value(value: &FieldValue) -> String { - match value { - FieldValue::Literal(bits) => format!("FieldValue::Literal({})", render_literal_bits(bits)), - FieldValue::Reference(id) => { - format!("FieldValue::Reference({})", render_declaration_id(*id)) - } - FieldValue::Record(fields) => { - format!("FieldValue::Record({})", render_named_field_values(fields)) - } - FieldValue::List(values) => { - let rendered: Vec = values.iter().map(render_field_value).collect(); - format!("FieldValue::List({})", render_vec(&rendered)) - } - FieldValue::Map(entries) => { - format!( - "FieldValue::Map({})", - render_field_map("FieldValue::Map", entries) - ) - } - FieldValue::Variant { - constructor, - payload, - } => { - let rendered: Vec = payload.iter().map(render_field_value).collect(); - format!( - "FieldValue::Variant {{ constructor: {}, payload: {} }}", - render_declaration_id(*constructor), - render_vec(&rendered) - ) - } - } -} - -fn render_behaviors(behaviors: &[Behavior]) -> String { - if behaviors.is_empty() { - return "Vec::new()".to_string(); - } - let mut out = format!( - "{{ let mut nodes = Vec::with_capacity({});\n", - behaviors.len() - ); - for behavior in behaviors { - let _ = writeln!(out, " nodes.push({});", render_behavior(behavior)); - } - out.push_str(" nodes }\n"); - out -} - -fn render_behavior(behavior: &Behavior) -> String { - match behavior { - Behavior::Value(node) => format!("Behavior::Value({})", render_value_node(node)), - Behavior::Transform(node) => { - format!("Behavior::Transform({})", render_transform_node(node)) - } - Behavior::Branch(node) => format!("Behavior::Branch({})", render_branch_node(node)), - Behavior::Loop(node) => format!("Behavior::Loop({})", render_loop_node(node)), - Behavior::Bind(node) => format!("Behavior::Bind({})", render_bind_node(node)), - } -} - -fn render_value_node(node: &ValueNode) -> String { - format!( - "ValueNode {{ id: {}, data: {}, output: {}, span: {}, lane2_workflow: {} }}", - render_node_id(node.id), - render_literal_bits(&node.data), - render_port_id(node.output), - render_source_span(&node.span), - render_lane2_workflow("ValueNode", node.id, node.lane2_workflow()), - ) -} - -fn render_transform_node(node: &TransformNode) -> String { - format!( - "TransformNode {{ id: {}, target: {}, inputs: {}, output: {}, span: {} }}", - render_node_id(node.id), - render_transform_target(&node.target), - render_port_id_vec(&node.inputs), - render_port_id(node.output), - render_source_span(&node.span), - ) -} - -fn render_branch_node(node: &BranchNode) -> String { - format!( - "BranchNode {{ id: {}, input: {}, paths: {}, output: {}, span: {}, emit_participation: {} }}", - render_node_id(node.id), - render_port_id(node.input), - render_paths(&node.paths), - render_port_id(node.output), - render_source_span(&node.span), - render_opt_branch_emit_participation(node.emit_participation()), - ) -} - -fn render_loop_node(node: &LoopNode) -> String { - format!( - "LoopNode {{ id: {}, source: {}, init: {}, body: {}, bound: {}, output: {}, span: {} }}", - render_node_id(node.id), - render_port_id(node.source), - render_port_id(node.init), - render_node_id(node.body), - render_loop_bound(&node.bound), - render_port_id(node.output), - render_source_span(&node.span), - ) -} - -fn render_bind_node(node: &BindNode) -> String { - format!( - "BindNode {{ id: {}, name: {:?}.to_string(), value: {}, params: {}, span: {}, lane2_workflow: {}, emit_participation: {} }}", - render_node_id(node.id), - node.name, - render_port_id(node.value), - render_port_id_vec(&node.params), - render_source_span(&node.span), - render_lane2_workflow("BindNode", node.id, node.lane2_workflow()), - render_opt_bind_emit_participation(node.emit_participation()), - ) -} - -fn render_opt_bind_emit_participation(p: Option) -> String { - match p { - None => "None".to_string(), - Some(BindEmitParticipation::UserCallable) => { - "Some(BindEmitParticipation::UserCallable)".to_string() - } - } -} - -fn render_opt_branch_emit_participation(p: Option) -> String { - match p { - None => "None".to_string(), - Some(BranchEmitParticipation::UserMatch) => { - "Some(BranchEmitParticipation::UserMatch)".to_string() - } - } -} - -fn render_lane2_workflow( - behavior: &str, - node_id: NodeId, - workflow: Option<&crate::dag::WorkflowEffect>, -) -> String { - match workflow { - None => "None".to_string(), - Some(_) => panic!( - "regen_bootstrap does not yet support serializing lane2_workflow on {behavior} {:?}", - node_id - ), - } -} - -fn render_transform_target(target: &TransformTarget) -> String { - match target { - TransformTarget::Callable(id) => { - format!("TransformTarget::Callable({})", render_declaration_id(*id)) - } - TransformTarget::UnresolvedFieldProject { field_label } => { - format!("TransformTarget::UnresolvedFieldProject {{ field_label: {field_label:?}.to_string() }}") - } - TransformTarget::ResolvedFieldProject { field_label } => format!( - "TransformTarget::ResolvedFieldProject {{ field_label: {field_label:?}.to_string() }}" - ), - TransformTarget::Operator(kind) => { - format!("TransformTarget::Operator({})", render_operator_kind(kind)) - } - } -} - -fn render_operator_kind(kind: &OperatorKind) -> String { - match kind { - OperatorKind::Arithmetic(op) => { - format!("OperatorKind::Arithmetic({})", render_arithmetic_op(op)) - } - OperatorKind::Comparison(op) => { - format!("OperatorKind::Comparison({})", render_comparison_op(op)) - } - OperatorKind::Logical(op) => format!("OperatorKind::Logical({})", render_logical_op(op)), - } -} - -fn render_arithmetic_op(op: &ArithmeticOp) -> String { - match op { - ArithmeticOp::Add => "ArithmeticOp::Add".to_string(), - ArithmeticOp::Sub => "ArithmeticOp::Sub".to_string(), - ArithmeticOp::Mul => "ArithmeticOp::Mul".to_string(), - ArithmeticOp::Div => "ArithmeticOp::Div".to_string(), - } -} - -fn render_comparison_op(op: &ComparisonOp) -> String { - match op { - ComparisonOp::Eq => "ComparisonOp::Eq".to_string(), - ComparisonOp::Ne => "ComparisonOp::Ne".to_string(), - ComparisonOp::Lt => "ComparisonOp::Lt".to_string(), - ComparisonOp::Le => "ComparisonOp::Le".to_string(), - ComparisonOp::Gt => "ComparisonOp::Gt".to_string(), - ComparisonOp::Ge => "ComparisonOp::Ge".to_string(), - } -} - -fn render_logical_op(op: &LogicalOp) -> String { - match op { - LogicalOp::And => "LogicalOp::And".to_string(), - LogicalOp::Or => "LogicalOp::Or".to_string(), - } -} - -fn render_paths(paths: &[Path]) -> String { - let values: Vec = paths - .iter() - .map(|path| { - format!( - "Path {{ body: {}, output: {}, pattern: {}, binding: {} }}", - render_node_id(path.body), - render_port_id(path.output), - render_branch_pattern(&path.pattern), - render_opt_payload_binding(path.binding.as_ref()), - ) - }) - .collect(); - render_vec(&values) -} - -fn render_branch_pattern(pattern: &BranchPattern) -> String { - match pattern { - BranchPattern::UnresolvedVariant { name, span } => format!( - "BranchPattern::UnresolvedVariant {{ name: {name:?}.to_string(), span: {} }}", - render_source_span(span) - ), - BranchPattern::ResolvedVariant(id) => { - format!( - "BranchPattern::ResolvedVariant({})", - render_declaration_id(*id) - ) - } - } -} - -fn render_opt_payload_binding(binding: Option<&PayloadBinding>) -> String { - match binding { - Some(binding) => format!( - "Some(PayloadBinding {{ binding_name: {:?}.to_string(), payload_port: {} }})", - binding.binding_name, - render_port_id(binding.payload_port) - ), - None => "None".to_string(), - } -} - -fn render_loop_bound(bound: &LoopBound) -> String { - match bound { - LoopBound::Cardinality { count } => { - format!( - "LoopBound::Cardinality {{ count: {} }}", - render_port_id(*count) - ) - } - LoopBound::Descent { cluster, measure } => { - format!( - "LoopBound::Descent {{ cluster: {}, measure: {} }}", - render_cluster_id(*cluster), - render_port_id(*measure) - ) - } - } -} - -fn render_ports(dag: &Dag) -> String { - let ports = dag.ports(); - if ports.is_empty() { - return "HashMap::new()".to_string(); - } - let mut out = String::from("{ let mut ports = HashMap::new();\n"); - for port in &ports { - let _ = writeln!( - out, - " ports.insert({}, Port {{ id: {}, state: {}, produced_by: {} }});", - render_port_id(port.id()), - render_port_id(port.id()), - render_port_state(port.state()), - render_opt_node_id(port.produced_by), - ); - } - out.push_str(" ports }\n"); - out -} - -fn render_port_state(state: &PortState) -> String { - match state { - PortState::Uninferred => "PortState::Uninferred".to_string(), - PortState::Resolved(shape) => { - format!( - "PortState::Resolved(TypeShape::new({}))", - render_declaration_id(shape.declaration) - ) - } - PortState::Unresolved => "PortState::Unresolved".to_string(), - } -} - -fn render_diagnostic_attribution(attribution: &DiagnosticAttribution) -> String { - match attribution { - DiagnosticAttribution::Unattributed => "DiagnosticAttribution::Unattributed".to_string(), - DiagnosticAttribution::BootstrapAuthority(key) => format!( - "DiagnosticAttribution::BootstrapAuthority(crate::diagnostics::BootstrapAuthorityKey::new({:?}))", - key.path() - ), - } -} - -fn render_diagnostics(dag: &Dag) -> String { - let mut entries: Vec<_> = dag.diagnostics().iter_attributed().collect(); - entries.sort_by_key(|(port, _, _)| port.raw()); - if entries.is_empty() { - return "DiagnosticTable::new()".to_string(); - } - let mut out = String::from("{ let mut table = DiagnosticTable::new();\n"); - for (port, diagnostic, attribution) in entries { - let _ = writeln!( - out, - " table.insert({}, {}, {});", - render_port_id(port), - render_diagnostic(diagnostic), - render_diagnostic_attribution(attribution), - ); - } - out.push_str(" table }\n"); - out -} - -fn render_diagnostic(diagnostic: &Diagnostic) -> String { - match diagnostic { - Diagnostic::TokenizerError { - message, - span, - correction, - } => format!( - "Diagnostic::TokenizerError {{ message: {message:?}.to_string(), span: {}, correction: {} }}", - render_source_span(span), - render_correction(correction), - ), - Diagnostic::ParseError { - message, - span, - correction, - } => format!( - "Diagnostic::ParseError {{ message: {message:?}.to_string(), span: {}, correction: {} }}", - render_source_span(span), - render_correction(correction), - ), - Diagnostic::TypeMismatch { - expected, - actual, - span, - correction, - } => format!( - "Diagnostic::TypeMismatch {{ expected: TypeShape::new({}), actual: TypeShape::new({}), span: {}, correction: {} }}", - render_declaration_id(expected.declaration), - render_declaration_id(actual.declaration), - render_source_span(span), - render_correction(correction), - ), - Diagnostic::ArityMismatch { - function, - expected, - actual, - span, - correction, - } => format!( - "Diagnostic::ArityMismatch {{ function: {function:?}.to_string(), expected: {expected}, actual: {actual}, span: {}, correction: {} }}", - render_source_span(span), - render_correction(correction), - ), - Diagnostic::ResolveError { - name, - span, - correction, - } => format!( - "Diagnostic::ResolveError {{ name: {name:?}.to_string(), span: {}, correction: {} }}", - render_source_span(span), - render_correction(correction), - ), - Diagnostic::UnitMismatch { - operator, - parameter, - expected, - actual, - span, - correction, - } => format!( - "Diagnostic::UnitMismatch {{ operator: {operator:?}.to_string(), parameter: {parameter:?}.to_string(), expected: TypeShape::new({}), actual: TypeShape::new({}), span: {}, correction: {} }}", - render_declaration_id(expected.declaration), - render_declaration_id(actual.declaration), - render_source_span(span), - render_correction(correction), - ), - Diagnostic::BranchConditionNotBool { - port, - actual_type, - span, - correction, - } => format!( - "Diagnostic::BranchConditionNotBool {{ port: {}, actual_type: {}, span: {}, correction: {} }}", - render_port_id(*port), - render_opt_type_shape(*actual_type), - render_source_span(span), - render_correction(correction), - ), - Diagnostic::MagnitudeOutOfRange { - literal, - target, - range_min_inclusive, - range_max_inclusive, - expected, - span, - correction, - } => format!( - "Diagnostic::MagnitudeOutOfRange {{ literal: {literal:?}.to_string(), target: {target:?}.to_string(), range_min_inclusive: {range_min_inclusive:?}.to_string(), range_max_inclusive: {range_max_inclusive:?}.to_string(), expected: TypeShape::new({}), span: {}, correction: {} }}", - render_declaration_id(expected.declaration), - render_source_span(span), - render_correction(correction), - ), - Diagnostic::MalformedIntegerRangeFact { - message, - span, - correction, - } => format!( - "Diagnostic::MalformedIntegerRangeFact {{ message: {message:?}.to_string(), span: {}, correction: {} }}", - render_source_span(span), - render_correction(correction), - ), - Diagnostic::NominalOpacityViolation { - declaration, - accessor, - span, - correction, - } => format!( - "Diagnostic::NominalOpacityViolation {{ declaration: {}, accessor: {}, span: {}, correction: {} }}", - render_declaration_id(*declaration), - render_opt_declaration_id(*accessor), - render_source_span(span), - render_correction(correction), - ), - } -} - -fn render_correction(correction: &crate::diagnostics::Correction) -> String { - match correction { - crate::diagnostics::Correction::LiveCorrection { witness } => { - format!( - "crate::diagnostics::Correction::live({:?}, {}, {:?})", - witness.description, - render_source_span(&witness.span), - witness.new_source, - ) - } - crate::diagnostics::Correction::DeferredCorrection { - reason, - retirement_plan, - } => { - format!( - "crate::diagnostics::Correction::deferred({:?}, {:?}, {:?})", - reason, retirement_plan.owner, retirement_plan.exit_condition - ) - } - } -} - -fn render_clusters(dag: &Dag) -> String { - let values: Vec = dag.clusters().iter().map(render_cluster).collect(); - render_vec(&values) -} - -fn render_cluster(cluster: &Cluster) -> String { - format!( - "Cluster {{ members: {}, intra_cluster_calls: {} }}", - render_non_singleton_member_descents(&cluster.members), - render_non_empty_intra_cluster_calls(&cluster.intra_cluster_calls), - ) -} - -fn render_non_singleton_member_descents(values: &NonSingletonList) -> String { - format!( - "NonSingletonList {{ first: {}, second: {}, rest: {} }}", - render_member_descent(&values.first), - render_member_descent(&values.second), - render_vec( - &values - .rest - .iter() - .map(render_member_descent) - .collect::>() - ), - ) -} - -fn render_member_descent(value: &MemberDescent) -> String { - format!( - "MemberDescent {{ param: ParamRef {{ member: {}, slot: {} }} }}", - render_node_id(value.param.member_of()), - value.param.slot_of(), - ) -} - -fn render_non_empty_intra_cluster_calls(values: &NonEmptyList) -> String { - format!( - "NonEmptyList {{ first: {}, rest: {} }}", - render_intra_cluster_call(&values.first), - render_vec( - &values - .rest - .iter() - .map(render_intra_cluster_call) - .collect::>() - ), - ) -} - -fn render_intra_cluster_call(value: &IntraClusterCall) -> String { - format!( - "IntraClusterCall {{ transform: TransformRef({}) }}", - render_node_id(value.transform.node_id()) - ) -} - -fn render_optional_match_disjs(dag: &Dag) -> String { - let mut entries: Vec<_> = dag.optional_match_disjs().iter().collect(); - entries.sort_by_key(|(key, _)| key.raw()); - if entries.is_empty() { - return "HashMap::new()".to_string(); - } - let mut out = String::from("{ let mut map = HashMap::new();\n"); - for (key, value) in entries { - let _ = writeln!( - out, - " map.insert({}, {});", - render_declaration_id(*key), - render_declaration_id(*value) - ); - } - out.push_str(" map }\n"); - out -} - -fn render_literal_bits(bits: &LiteralBits) -> String { - match bits { - LiteralBits::Int(value) => format!("LiteralBits::Int({value:?}.to_string())"), - LiteralBits::Bool(value) => format!("LiteralBits::Bool({value})"), - LiteralBits::String(value) => format!("LiteralBits::String({value:?}.to_string())"), - LiteralBits::Symbol(value) => format!("LiteralBits::Symbol({value:?}.to_string())"), - } -} - -fn render_source_span(span: &crate::diagnostics::SourceSpan) -> String { - format!( - "SourceSpan::new({:?}, {}, {})", - span.file, span.byte_start, span.byte_end - ) -} - -fn render_opt_type_shape(shape: Option) -> String { - match shape { - Some(shape) => format!( - "Some(TypeShape::new({}))", - render_declaration_id(shape.declaration) - ), - None => "None".to_string(), - } -} - -fn render_declaration_id_vec(values: &[DeclarationId]) -> String { - let rendered: Vec = values.iter().map(|id| render_declaration_id(*id)).collect(); - render_vec(&rendered) -} - -fn render_port_id_vec(values: &[PortId]) -> String { - let rendered: Vec = values.iter().map(|id| render_port_id(*id)).collect(); - render_vec(&rendered) -} - -fn render_opt_declaration_id(id: Option) -> String { - match id { - Some(id) => format!("Some({})", render_declaration_id(id)), - None => "None".to_string(), - } -} - -fn render_opt_node_id(id: Option) -> String { - match id { - Some(id) => format!("Some({})", render_node_id(id)), - None => "None".to_string(), - } -} - -fn render_opt_string(value: Option<&str>) -> String { - match value { - Some(value) => format!("Some({value:?}.to_string())"), - None => "None".to_string(), - } -} - -fn render_declaration_id(id: DeclarationId) -> String { - format!("DeclarationId({})", id.raw()) -} - -fn render_port_id(id: PortId) -> String { - format!("PortId({})", id.raw()) -} - -fn render_node_id(id: NodeId) -> String { - format!("NodeId({})", id.raw()) -} - -fn render_cluster_id(id: ClusterId) -> String { - format!("ClusterId({})", id.raw()) -} - -fn render_vec(values: &[String]) -> String { - if values.is_empty() { - "vec![]".to_string() - } else { - format!("vec![{}]", values.join(", ")) - } -} diff --git a/src/v3/compiler/src/regen_lens_driver.rs b/src/v3/compiler/src/regen_lens_driver.rs deleted file mode 100644 index 5e2e35da512..00000000000 --- a/src/v3/compiler/src/regen_lens_driver.rs +++ /dev/null @@ -1,266 +0,0 @@ -//! Unified lens-regen driver for `src/v3/compiler/regen.dag`. -//! -//! Reads every `data _entry: LensRegistryEntry` record out of the -//! bootstrap `Dag`, compiles the referenced `.dag` lens, and writes the -//! `emit_rust_module` projection to the declared output path. Adding a new -//! lens is an edit to `regen.dag`, not to this driver. -//! -//! **R3 gate #7 (`regen_lens_dot_rs_retired`):** the former program-sized -//! `src/bin/regen_lens.rs` shim is retired from the SG-0 hand-authored census. -//! The `regen_lens` Cargo `[[bin]]` target is the thin `main` in -//! `src/regen_lens_entry.rs`, which constructs the bootstrap `Dag` once and -//! delegates here. -//! -//! Usage (unchanged for operators): -//! cargo run -p v3-compiler --bin regen_lens -//! cargo run -p v3-compiler --bin regen_lens -- --lens cost - -use std::collections::HashMap; -use std::env; -use std::io::Write; -use std::path::{Path, PathBuf}; -use std::process::{Command, Stdio}; - -use crate::dag::{Dag, FieldValue, LiteralBits, ValueBody}; -use crate::emit_rust::emit_rust_module; -use crate::generated_files::GENERATED_FILES; -use crate::process_exit::ProcessExit; -use crate::{compile_to_dag, CompileError}; - -const LENS_REGISTRY_ENTRY_TYPE: &str = "LensRegistryEntry"; - -struct Entry { - name: String, - lens_file: String, - generated_file: String, -} - -/// Entry surface for PB-1 bin-shim staging (`ProcessExit` carrier). -/// -/// `dag` must be the bootstrap `Dag` from `Dag::new()` — the same authority used for -/// `LensRegistryEntry` enumeration. Call sites store that `Dag` in a local and pass `&dag` -/// (`let dag = Dag::new(); regen_lens_main(&dag)` in the `regen_lens` bin), not `&Dag::new()`. -pub fn regen_lens_main(dag: &Dag) -> ProcessExit { - match run(dag) { - Ok(()) => ProcessExit::ExitSuccess, - Err(message) => ProcessExit::ExitFailure { - code: 1, - reason: message, - }, - } -} - -fn run(dag: &Dag) -> Result<(), String> { - let requested_name = parse_args()?; - - if !dag.diagnostics().is_empty() { - return Err(format!( - "bootstrap Dag carries {} diagnostic(s): {:#?}", - dag.diagnostics().len(), - dag.diagnostics() - )); - } - - let entries = read_registry(dag)?; - if entries.is_empty() { - return Err("lens registry is empty; check `src/v3/compiler/regen.dag`".to_string()); - } - - let root = workspace_root(); - let mut processed = 0usize; - for entry in &entries { - if let Some(requested) = &requested_name { - if entry.name != *requested { - continue; - } - } - regen_entry(&root, entry)?; - processed += 1; - } - - if processed == 0 { - let known: Vec<&str> = entries.iter().map(|e| e.name.as_str()).collect(); - return Err(format!( - "no lens entry matches `--lens {}`; known: {}", - requested_name.unwrap_or_default(), - known.join(", ") - )); - } - Ok(()) -} - -fn parse_args() -> Result, String> { - let mut requested: Option = None; - let mut args = env::args().skip(1); - while let Some(arg) = args.next() { - match arg.as_str() { - "--lens" => { - requested = Some( - args.next() - .ok_or_else(|| "--lens requires a name".to_string())?, - ); - } - other => return Err(format!("unknown argument `{other}`")), - } - } - Ok(requested) -} - -fn workspace_root() -> PathBuf { - // src/v3/compiler/Cargo.toml lives 3 levels below the workspace - // root; the registry entries record paths relative to that root. - PathBuf::from(env!("CARGO_MANIFEST_DIR")) - .join("..") - .join("..") - .join("..") -} - -fn read_registry(dag: &Dag) -> Result, String> { - let entry_type_id = dag - .declaration_by_name(LENS_REGISTRY_ENTRY_TYPE) - .map(|decl| decl.id) - .ok_or_else(|| format!("missing `{LENS_REGISTRY_ENTRY_TYPE}` in bootstrap Dag"))?; - - let mut entries: Vec = Vec::new(); - // Dedup maps: record the FIRST binding that introduced each key, - // so a duplicate error names both the existing owner and the - // colliding binding. `--lens ` is a singleton key and - // `generated_file` is the output an entry writes to; either - // collision would make the registry ambiguous or let two - // entries race to clobber the same file. - let mut seen_name: HashMap = HashMap::new(); - let mut seen_generated_file: HashMap = HashMap::new(); - - for decl in dag.declarations() { - if decl.meta_tag != Some(entry_type_id) { - continue; - } - let binding_name = decl.name.as_deref().unwrap_or(""); - let Some(ValueBody::Structural { fields }) = &decl.value_body else { - return Err(format!( - "lens registry entry `{binding_name}` must carry a structural value body" - )); - }; - let entry = Entry { - name: require_string(fields, "name", binding_name)?, - lens_file: require_string(fields, "lens_file", binding_name)?, - generated_file: require_string(fields, "generated_file", binding_name)?, - }; - - if let Some(prior_binding) = seen_name.get(&entry.name) { - return Err(format!( - "lens registry has duplicate `name` field `{name}`: first declared by `{prior_binding}`, re-declared by `{binding_name}`", - name = entry.name, - )); - } - if let Some(prior_binding) = seen_generated_file.get(&entry.generated_file) { - return Err(format!( - "lens registry has duplicate `generated_file` path `{path}`: first declared by `{prior_binding}`, re-declared by `{binding_name}`", - path = entry.generated_file, - )); - } - seen_name.insert(entry.name.clone(), binding_name.to_string()); - seen_generated_file.insert(entry.generated_file.clone(), binding_name.to_string()); - entries.push(entry); - } - Ok(entries) -} - -fn require_string( - fields: &[(String, FieldValue)], - label: &str, - binding_name: &str, -) -> Result { - fields - .iter() - .find(|(field_label, _)| field_label == label) - .and_then(|(_, value)| match value { - FieldValue::Literal(LiteralBits::String(s)) => Some(s.clone()), - _ => None, - }) - .ok_or_else(|| { - format!("lens registry entry `{binding_name}` is missing String field `{label}`") - }) -} - -fn regen_entry(root: &Path, entry: &Entry) -> Result<(), String> { - // Single-authority gate: the registry's `generated_file` path - // must also be registered in `REGEN_OUTPUTS` (surfaced as - // `v3_compiler::generated_files::GENERATED_FILES`). SG-0 treats - // that manifest as the sole producer-owned partition; if - // `regen.dag` and `REGEN_OUTPUTS` drift, the driver would - // silently write to a path the SG-0 census doesn't know about. - // Fail closed here rather than rely on the downstream census to - // notice — the error points the reviewer at the two authorities - // that must stay in lockstep. - if !GENERATED_FILES.iter().any(|p| *p == entry.generated_file) { - return Err(format!( - "registry / manifest drift: `regen.dag` declares \ - `generated_file = \"{path}\"` (lens `{lens}`) but the \ - path is not registered in `REGEN_OUTPUTS` in \ - `src/v3/compiler/build.rs`. Add the path to `REGEN_OUTPUTS` \ - (or remove it from `regen.dag`) so the two authorities stay \ - in lockstep. Both are SG-0's producer-owned manifest; \ - writing to a path outside the manifest would be silent \ - drift.", - path = entry.generated_file, - lens = entry.name, - )); - } - - let lens_path = root.join(&entry.lens_file); - let out_path = root.join(&entry.generated_file); - - let source = std::fs::read_to_string(&lens_path) - .map_err(|e| format!("read {}: {e}", lens_path.display()))?; - let dag = compile_to_dag(&source, &entry.lens_file).map_err(|e| match e { - CompileError::Semantic(dag) => format!( - "compile {}: {}", - entry.lens_file, - dag.diagnostics() - .iter() - .map(|d| format!("{d:?}")) - .collect::>() - .join("; ") - ), - other => format!("compile {}: {other:?}", entry.lens_file), - })?; - let raw = emit_rust_module(&dag).map_err(|e| format!("emit {}: {e:?}", entry.lens_file))?; - let header = format!( - "// AUTO-GENERATED from `{}` via\n\ - // `emit_rust_module`. Regenerate instead of hand-editing.\n\n", - entry.lens_file - ); - let combined = format!("{header}{raw}"); - let formatted = rustfmt_stdin(&combined)?; - std::fs::write(&out_path, &formatted) - .map_err(|e| format!("write {}: {e}", out_path.display()))?; - println!("wrote {}", out_path.display()); - Ok(()) -} - -fn rustfmt_stdin(source: &str) -> Result { - let mut child = Command::new("rustfmt") - .arg("--emit") - .arg("stdout") - .stdin(Stdio::piped()) - .stdout(Stdio::piped()) - .spawn() - .map_err(|e| format!("spawn rustfmt: {e}"))?; - child - .stdin - .as_mut() - .expect("rustfmt stdin") - .write_all(source.as_bytes()) - .map_err(|e| format!("write rustfmt stdin: {e}"))?; - let output = child - .wait_with_output() - .map_err(|e| format!("wait rustfmt: {e}"))?; - if !output.status.success() { - return Err(format!( - "rustfmt failed: {}", - String::from_utf8_lossy(&output.stderr) - )); - } - String::from_utf8(output.stdout).map_err(|e| format!("rustfmt output not utf8: {e}")) -} diff --git a/src/v3/compiler/src/regen_lens_entry.rs b/src/v3/compiler/src/regen_lens_entry.rs deleted file mode 100644 index a3a08c63b9d..00000000000 --- a/src/v3/compiler/src/regen_lens_entry.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! Thin Cargo `[[bin]]` entry for `regen_lens`. -//! -//! **R3 gate #7 (`regen_lens_dot_rs_retired`):** keeps the `regen_lens` binary -//! name and CLI surface stable while retiring the legacy -//! `src/bin/regen_lens.rs` path from the SG-0 hand-authored census. - -use std::io::Write; -use std::process::ExitCode; - -use v3_compiler::dag::Dag; -use v3_compiler::process_exit::ProcessExit; -use v3_compiler::regen_lens_driver::regen_lens_main; - -fn main() -> ExitCode { - let dag = Dag::new(); - match regen_lens_main(&dag) { - ProcessExit::ExitSuccess => ExitCode::SUCCESS, - ProcessExit::ExitFailure { code, reason } => { - let _ = writeln!(std::io::stderr(), "{reason}"); - ExitCode::from(code.clamp(1, 255) as u8) - } - } -} diff --git a/src/v3/compiler/src/regen_parse_emit.rs b/src/v3/compiler/src/regen_parse_emit.rs deleted file mode 100644 index b519f589bce..00000000000 --- a/src/v3/compiler/src/regen_parse_emit.rs +++ /dev/null @@ -1,124 +0,0 @@ -//! Shared `regen_parse` emission: compile `src/v3/std/parse_surface.dag`, emit -//! `parse_generated.rs` body, run `rustfmt --emit stdout`. Used by the -//! `regen_parse` binary (writes the file) and by hermetic integration tests -//! (compare in-memory only). - -use std::fmt; -use std::io::Write; -use std::process::{Command, Stdio}; - -use crate::compile_parse_surface_std_authority_dag; -use crate::CompileError; - -const HEADER: &str = "// AUTO-GENERATED from `src/v3/std/parse_surface.dag` (Surface carriers)\n\ - // via `regen_parse` + `parse_parser_body.txt`. Regenerate instead of hand-editing.\n\n"; - -/// Failure compiling the authority DAG or running `rustfmt` on the combined module text. -#[derive(Debug)] -pub enum RenderParseGeneratedError { - Compile(Box), - Rustfmt(String), -} - -impl fmt::Display for RenderParseGeneratedError { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - match self { - Self::Rustfmt(msg) => write!(f, "{msg}"), - Self::Compile(e) => match e.as_ref() { - CompileError::Semantic(d) => { - writeln!(f, "compile failed:")?; - for (_, diag) in d.diagnostics().iter() { - writeln!(f, " {diag:?}")?; - } - Ok(()) - } - other => write!(f, "{other:?}"), - }, - } - } -} - -/// Compile [`parse_surface_source`] with [`compile_parse_surface_std_authority_dag`], splice -/// [`parser_body`], format with `rustfmt --emit stdout`. Does not read or write workspace paths. -pub fn render_parse_generated_rs( - parse_surface_source: &str, - parse_surface_file: &str, - parser_body: &str, -) -> Result { - let _dag = compile_parse_surface_std_authority_dag(parse_surface_source, parse_surface_file) - .map_err(|e| RenderParseGeneratedError::Compile(Box::new(e)))?; - let rust = emit_parse_module(parser_body); - let combined = format!("{HEADER}{rust}"); - rustfmt_stdout(&combined).map_err(RenderParseGeneratedError::Rustfmt) -} - -fn rustfmt_stdout(combined: &str) -> Result { - let mut child = Command::new("rustfmt") - .arg("--emit") - .arg("stdout") - .stdin(Stdio::piped()) - .stdout(Stdio::piped()) - .spawn() - .map_err(|e| format!("spawn rustfmt: {e}"))?; - child - .stdin - .as_mut() - .unwrap() - .write_all(combined.as_bytes()) - .map_err(|e| format!("write rustfmt stdin: {e}"))?; - let output = child - .wait_with_output() - .map_err(|e| format!("wait rustfmt: {e}"))?; - if !output.status.success() { - return Err(format!( - "rustfmt failed: {}", - String::from_utf8_lossy(&output.stderr) - )); - } - String::from_utf8(output.stdout).map_err(|e| format!("rustfmt stdout utf-8: {e}")) -} - -fn emit_parse_module(parser_body: &str) -> String { - let mut out = String::new(); - out.push_str("use crate::diagnostics::{Diagnostic, SourceSpan};\n"); - out.push_str( - "pub use crate::parse_surface::{SurfaceExpr, SurfaceField, SurfaceItem, SurfaceLiteral, \ - SurfaceMapEntry, SurfaceMatchArm, SurfaceModule, SurfaceParam, SurfacePattern, \ - SurfacePatternField, SurfaceRecordField, SurfaceType, SurfaceVariant, TypeAngleArg, \ - VariantPayload};\n", - ); - out.push_str( - "use crate::parse_tables::{binary_op_at_level, bracket_role, is_type_rhs_boundary_keyword, \ - primary_atom_class, primary_prefix_dispatch, soft_keyword_ident_spelling, \ - top_level_item_dispatch, \ - BinaryOpLevel, BracketRole, ItemDispatchKind, PrimaryAtomClass, PrimaryPrefixDispatch};\n", - ); - out.push_str("use crate::tokenize::{Token, TokenKind};\n"); - out.push_str("use crate::operators::{LogicalOp, OperatorKind};\n"); - out.push_str("use std::collections::HashSet;\n\n"); - out.push_str( - r#"impl SurfaceType { - pub fn span(&self) -> &SourceSpan { - match self { - SurfaceType::Named { span, .. } - | SurfaceType::Parameterized { span, .. } - | SurfaceType::Optional { span, .. } - | SurfaceType::Arrow { span, .. } => span, - } - } -} - -impl TypeAngleArg { - pub fn span(&self) -> &SourceSpan { - match self { - TypeAngleArg::TypeExpr { ty } => ty.span(), - TypeAngleArg::WidthNatLiteral { span, .. } => span, - } - } -} - -"#, - ); - out.push_str(parser_body); - out -} diff --git a/src/v3/compiler/src/regen_parse_tables_emit.rs b/src/v3/compiler/src/regen_parse_tables_emit.rs deleted file mode 100644 index b820999e9ed..00000000000 --- a/src/v3/compiler/src/regen_parse_tables_emit.rs +++ /dev/null @@ -1,1285 +0,0 @@ -//! Shared `regen_parse_tables` emission: compile `parse_tables.dag` + -//! `tokenize.dag`, cross-validate rows, project into `parse_tables_generated.rs`, -//! run `rustfmt --emit stdout`. -//! -//! **Tables projected.** **SG-2c-1:** `BinaryOpRow` → `binary_op_at_level` (plus -//! shared-syntax checks below). **SG-2c-2:** `TopLevelItemKwRow.token_variant` -//! rows → Rust `ItemDispatchKind` + `top_level_item_dispatch` (dispatch labels -//! derived via `Kw`-strip; validated against `tokenize.dag`'s `TokenKind`). -//! **SG-2c-3:** existing `TopLevelItemKwRow.token_variant` rows also project -//! `is_type_rhs_boundary_keyword` for the parser's shared top-level item -//! boundary set. **SG-2c-5:** `SoftKeywordIdentRow` → `soft_keyword_ident_spelling`. -//! **SG-2c-6 / SG-2c-7 (parse_primary cluster):** `PrimaryPrefixRow` → -//! `primary_prefix_dispatch`; `PrimaryAtomRow` → `primary_atom_class` for the -//! post-prefix atomic token set in the same `parse_primary` function. -//! -//! Used by the `regen_parse_tables` binary (writes the file) and by the -//! hermetic integration snapshot test (compare in-memory only — avoids a -//! `cargo run` subprocess that blows the 2s per-test ratchet on cold CI). -//! -//! **Cross-validation against v3 projection of shared authority.** -//! `dag_operators` in `syntax.dag` owns external .dag syntax reality, including -//! operators v3 does not yet parse end-to-end. `v3_supported_dag_operators` is -//! the explicit current v3 capability projection as a symbol subset. Each -//! `BinaryOpRow` in `parse_tables.dag` is checked against that projection: the -//! row's `operator_symbol` must appear in `v3_supported_dag_operators`, while -//! binding power and binop facts are read from the corresponding -//! `dag_operators` row (the coarse parser precedence level covers a contiguous -//! bp range — see `level_for_bp`). If the v3 projection shifts, regen fails -//! closed here without forcing v3 to support every externally modeled operator. -//! -//! **SG-1a scaffold extension.** `syntax.dag`'s operator-list bodies still -//! lower as `ValueBody::Unparsed` (same scaffold `regen_tokenize` extends), so -//! this bridge reads the raw source text. When the shared authority lowers -//! structurally, the raw-text extractor folds into a typed read — same -//! dissolution trigger as `regen_tokenize`. - -use std::collections::BTreeSet; -use std::fmt; -use std::io::Write; -use std::process::{Command, Stdio}; - -use crate::compile_to_dag; -use crate::dag::{ - ArithmeticOp, ComparisonOp, Dag, Field, FieldValue, LiteralBits, LogicalOp, OperatorKind, - TypeConnective, ValueBody, -}; -use crate::operators; -use crate::CompileError; - -const HEADER: &str = "// AUTO-GENERATED from `src/v3/compiler/parse_tables.dag` via\n\ - // `regen_parse_tables`. Regenerate instead of hand-editing.\n\n"; - -/// Failure compiling either authority DAG or running `rustfmt` on the combined module text. -#[derive(Debug)] -pub enum RenderParseTablesGeneratedError { - Compile(Box), - Rustfmt(String), -} - -impl fmt::Display for RenderParseTablesGeneratedError { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - match self { - Self::Rustfmt(msg) => write!(f, "{msg}"), - Self::Compile(e) => match e.as_ref() { - CompileError::Semantic(d) => { - writeln!(f, "compile failed:")?; - for (_, diag) in d.diagnostics().iter() { - writeln!(f, " {diag:?}")?; - } - Ok(()) - } - other => write!(f, "{other:?}"), - }, - } - } -} - -/// Compile `parse_tables.dag` and `tokenize.dag`, cross-validate rows, emit -/// `parse_tables_generated.rs`, format with `rustfmt --emit stdout`. -/// -/// Validation: `BinaryOpRow` vs `tokenize.dag` + `operators.dag` + shared-syntax -/// `v3_supported_dag_operators`; `TopLevelItemKwRow` vs `tokenize.dag` + `Kw`-strip dispatch -/// labels (SG-2c-2/SG-2c-3); `SoftKeywordIdentRow` vs `tokenize.dag` + shared keyword set -/// (SG-2c-5); `PrimaryPrefixRow` / `PrimaryAtomRow` vs `tokenize.dag` + regen -/// dispatch labels (SG-2c-6/SG-2c-7). -/// Does not read or write workspace paths. -pub fn render_parse_tables_generated_rs( - parse_tables_source: &str, - parse_tables_file: &str, - tokenize_source: &str, - tokenize_file: &str, - shared_syntax_source: &str, -) -> Result { - let tables_dag = compile_authority(parse_tables_source, parse_tables_file)?; - let tokenize_dag = compile_authority(tokenize_source, tokenize_file)?; - let shared_operators = extract_v3_supported_operator_bps(shared_syntax_source); - let shared_keywords = extract_shared_keyword_set(shared_syntax_source); - - let token_variants = collect_variant_labels(&tokenize_dag, "TokenKind"); - let keyword_token_variants = collect_variant_labels(&tokenize_dag, "KeywordTokenKind"); - let levels = collect_variant_labels(&tables_dag, "BinaryOpLevel"); - let rows = collect_binary_op_rows(&tables_dag, &token_variants, &levels, &shared_operators); - - // SG-2c-2: Rust `ItemDispatchKind` variants are **only** the unique `Kw`-stripped - // labels from `TopLevelItemKwRow` rows below — never - // `collect_variant_labels(dag, "ItemDispatchKind")`; `parse_tables.dag` does not - // author that coproduct (M7 single authority on `token_variant` rows). - let item_kw_rows = collect_top_level_item_kw_rows(&tables_dag, &token_variants); - let mut item_dispatch_variants: Vec = - item_kw_rows.iter().map(|r| r.dispatch.clone()).collect(); - item_dispatch_variants.sort_unstable(); - item_dispatch_variants.dedup(); - let soft_keyword_ident_rows = collect_soft_keyword_ident_rows( - &tables_dag, - &token_variants, - &keyword_token_variants, - &shared_keywords, - ); - - // SG-2c-4: bracket opener/closer role table. `BracketRole` is - // projection-only (same shape as `ItemDispatchKind`): authored rows - // only carry `token_variant`; role is derived from the `L`/`R` - // prefix at regen time. - let bracket_rows = collect_bracket_rows(&tables_dag, &token_variants); - let primary_prefix_rows = collect_primary_prefix_rows(&tables_dag, &token_variants); - let mut primary_prefix_variants: Vec = primary_prefix_rows - .iter() - .map(|r| r.dispatch.clone()) - .collect(); - primary_prefix_variants.sort_unstable(); - primary_prefix_variants.dedup(); - let primary_atom_rows = collect_primary_atom_rows(&tables_dag, &token_variants); - let mut primary_atom_variants: Vec = primary_atom_rows - .iter() - .map(|r| r.dispatch.clone()) - .collect(); - primary_atom_variants.sort_unstable(); - primary_atom_variants.dedup(); - let module = EmitParseTablesModule { - levels: &levels, - binary_op_rows: &rows, - item_dispatch_variants: &item_dispatch_variants, - item_kw_rows: &item_kw_rows, - soft_keyword_ident_rows: &soft_keyword_ident_rows, - bracket_rows: &bracket_rows, - primary_prefix_variants: &primary_prefix_variants, - primary_prefix_rows: &primary_prefix_rows, - primary_atom_variants: &primary_atom_variants, - primary_atom_rows: &primary_atom_rows, - }; - let rust = emit_module(&module); - let combined = format!("{HEADER}{rust}"); - rustfmt_stdout(&combined).map_err(RenderParseTablesGeneratedError::Rustfmt) -} - -/// Coarse parser precedence level implied by a shared-authority -/// `left_bp`. The five levels in `BinaryOpLevel` each correspond to one -/// per-precedence-level parser function in `parse_parser_body.txt`, -/// which accepts a contiguous bp band: -/// - `Or` ← bp 5/6 (`||`) -/// - `And` ← bp 7/8 (`&&`) -/// - `Comparison` ← bp 9/10 or 11/12 (`== != < <= > >=`) -/// - `Additive` ← bp 13/14 (`+ -`) -/// - `Multiplicative` ← bp 15/16 (`* /`) -/// -/// If the shared authority introduces an operator at a bp outside these -/// bands, regen fails closed (`BinaryOpLevel` does not yet cover it). -fn level_for_bp(left_bp: i64) -> Option<&'static str> { - match left_bp { - 5 => Some("Or"), - 7 => Some("And"), - 9 | 11 => Some("Comparison"), - 13 => Some("Additive"), - 15 => Some("Multiplicative"), - _ => None, - } -} - -fn compile_authority(source: &str, file: &str) -> Result { - compile_to_dag(source, file).map_err(|e| RenderParseTablesGeneratedError::Compile(Box::new(e))) -} - -fn collect_variant_labels(dag: &Dag, type_name: &str) -> Vec { - let decl = dag - .declarations() - .iter() - .find(|d| d.name.as_deref() == Some(type_name)) - .unwrap_or_else(|| panic!("missing `{type_name}` declaration")); - let TypeConnective::Disj { variants } = &decl.connective else { - panic!("`{type_name}`: expected Disj"); - }; - variants.iter().map(|v| v.label.clone()).collect() -} - -struct BinaryOpRow { - token_variant: String, - operator_symbol: String, - level: String, -} - -/// Scratch shape for SG-2c-2 emission: `dispatch` is derived from `token_variant` -/// (`Kw`-strip rule); it is never read from the `.dag` row body (substrate carries -/// only `token_variant`). -struct TopLevelItemKwRow { - token_variant: String, - dispatch: String, -} - -struct SoftKeywordIdentRow { - token_variant: String, - spelling: String, -} - -fn collect_binary_op_rows( - dag: &Dag, - token_variants: &[String], - levels: &[String], - shared_operators: &std::collections::BTreeMap, -) -> Vec { - let token_variant_set: BTreeSet<&str> = token_variants.iter().map(String::as_str).collect(); - let level_set: BTreeSet<&str> = levels.iter().map(String::as_str).collect(); - - let level_type_id = dag - .declarations() - .iter() - .find(|d| d.name.as_deref() == Some("BinaryOpLevel")) - .map(|d| d.id) - .expect("BinaryOpLevel declaration"); - let TypeConnective::Disj { - variants: level_variants, - } = &dag.declaration(level_type_id).connective - else { - panic!("BinaryOpLevel should be a Disj"); - }; - - // Discover rows by typed fact (`decl.meta_tag == BinaryOpRow`), - // not by `name.starts_with("binary_op_")`. Mirrors the registry - // pattern `regen_lens` uses against `LensRegistryEntry`; avoids - // baking a name-prefix calling convention into the consumer, - // which would let a mistyped row escape (a `BinaryOpRow` bound - // to a name that happens not to start with `binary_op_`) or a - // correctly-prefixed row of the wrong type sneak in. - let binary_op_row_type_id = dag - .declarations() - .iter() - .find(|d| d.name.as_deref() == Some("BinaryOpRow")) - .map(|d| d.id) - .expect("BinaryOpRow declaration"); - - let mut rows: Vec = Vec::new(); - let mut seen_token_variants: BTreeSet = BTreeSet::new(); - for decl in dag.declarations() { - if decl.meta_tag != Some(binary_op_row_type_id) { - continue; - } - let name = decl.name.as_deref().unwrap_or(""); - let Some(ValueBody::Structural { fields }) = &decl.value_body else { - panic!("`parse_tables.dag::{name}`: `BinaryOpRow` binding must carry a structural value body"); - }; - let token_variant = string_field(fields, "token_variant", name); - let operator_symbol = string_field(fields, "operator_symbol", name); - let level = variant_field(fields, "level", level_variants, name, "BinaryOpLevel"); - - assert!( - token_variant_set.contains(token_variant.as_str()), - "`parse_tables.dag::{name}`: token_variant `{token_variant}` is not a \ - `TokenKind` variant in `tokenize.dag`" - ); - assert!( - level_set.contains(level.as_str()), - "`parse_tables.dag::{name}`: level `{level}` is not a `BinaryOpLevel` variant" - ); - let operator_kind = operators::from_symbol(&operator_symbol).unwrap_or_else(|| { - panic!( - "`parse_tables.dag::{name}`: operator_symbol `{operator_symbol}` has no \ - `OperatorKind` mapping in `operators.dag::from_symbol`" - ) - }); - // Structural cross-validation against the v3-supported - // projection in `dsl/extdeps/languages/dag/syntax.dag`. Three - // joins, closing three drift surfaces: - // (1) symbol ∈ `v3_supported_dag_operators` — operator is in - // the current v3 tokenizer/parser/operator capability - // subset; capability drift fails regen here without - // shrinking external `dag_operators`. - // (2) projected `left_bp` implies the declared `level` via - // `level_for_bp` — precedence drift fails closed. - // (3) `operators.dag::from_symbol(symbol)` returns an - // `OperatorKind` whose leaf variant matches the projected - // `binop` name — `symbol → OperatorKind` drift between - // `operators.dag` and `v3_supported_dag_operators` fails closed. - // Together, these turn `parse_tables.dag` into a structural - // projection of the v3 capability subset rather than a parallel - // restatement of it. - let shared = shared_operators.get(&operator_symbol).unwrap_or_else(|| { - panic!( - "`parse_tables.dag::{name}`: operator_symbol `{operator_symbol}` is not declared \ - in `v3_supported_dag_operators` at `dsl/extdeps/languages/dag/syntax.dag`. Every \ - v3 binary-operator row must be grounded in the v3 capability projection so drift \ - fails closed without shrinking external `dag_operators`." - ) - }); - let expected_level = level_for_bp(shared.left_bp).unwrap_or_else(|| { - panic!( - "`parse_tables.dag::{name}`: shared-syntax `{operator_symbol}` has `left_bp = {}`, \ - which falls outside any `BinaryOpLevel` bp band. Either the shared authority moved \ - the operator's precedence or a new band is needed in `level_for_bp` + `BinaryOpLevel`.", - shared.left_bp - ) - }); - assert!( - expected_level == level, - "`parse_tables.dag::{name}`: declared level `{level}` disagrees with shared-syntax \ - authority. `v3_supported_dag_operators` assigns `{operator_symbol}` `left_bp = {}` which \ - implies level `{expected_level}`. Either update the row to match or reclassify \ - `left_bp = {}` in `level_for_bp`.", - shared.left_bp, - shared.left_bp - ); - let actual_binop = operator_kind_binop_name(operator_kind); - assert!( - actual_binop == shared.binop_name, - "`parse_tables.dag::{name}`: `operators.dag::from_symbol(\"{operator_symbol}\")` returns \ - `OperatorKind` leaf `{actual_binop}`, but `v3_supported_dag_operators` in \ - `dsl/extdeps/languages/dag/syntax.dag` records `binop: {}` for the same symbol. One of \ - the two authorities drifted — fix both to agree before shipping.", - shared.binop_name - ); - assert!( - seen_token_variants.insert(token_variant.clone()), - "`parse_tables.dag`: duplicate row for `TokenKind::{token_variant}`" - ); - - rows.push(BinaryOpRow { - token_variant, - operator_symbol, - level, - }); - } - rows.sort_by(|a, b| a.token_variant.cmp(&b.token_variant)); - rows -} - -fn collect_top_level_item_kw_rows(dag: &Dag, token_variants: &[String]) -> Vec { - let token_variant_set: BTreeSet<&str> = token_variants.iter().map(String::as_str).collect(); - - let row_type_id = dag - .declarations() - .iter() - .find(|d| d.name.as_deref() == Some("TopLevelItemKwRow")) - .map(|d| d.id) - .expect("TopLevelItemKwRow declaration"); - - let mut rows: Vec = Vec::new(); - let mut seen_token_variants: BTreeSet = BTreeSet::new(); - for decl in dag.declarations() { - if decl.meta_tag != Some(row_type_id) { - continue; - } - let name = decl.name.as_deref().unwrap_or(""); - let Some(ValueBody::Structural { fields }) = &decl.value_body else { - panic!( - "`parse_tables.dag::{name}`: `TopLevelItemKwRow` binding must carry a structural value body" - ); - }; - let token_variant = string_field(fields, "token_variant", name); - - assert!( - token_variant_set.contains(token_variant.as_str()), - "`parse_tables.dag::{name}`: token_variant `{token_variant}` is not a \ - `TokenKind` variant in `tokenize.dag`" - ); - - let dispatch = item_dispatch_label_from_kw_token_variant(&token_variant, name); - - assert!( - seen_token_variants.insert(token_variant.clone()), - "`parse_tables.dag`: duplicate top-level item row for `TokenKind::{token_variant}`" - ); - - rows.push(TopLevelItemKwRow { - token_variant, - dispatch, - }); - } - rows.sort_by(|a, b| a.token_variant.cmp(&b.token_variant)); - rows -} - -struct BracketRow { - token_variant: String, - role: String, -} - -/// Scratch shape for SG-2c-6 emission: `dispatch` is derived from `token_variant` -/// at regen time — not read from the `.dag` row body. -struct PrimaryPrefixRow { - token_variant: String, - dispatch: String, -} - -struct PrimaryAtomRow { - token_variant: String, - dispatch: String, -} - -/// `BracketRow.token_variant` is the sole authored field; role is derived -/// from the `L`/`R` prefix (same one-authority shape as `TopLevelItemKwRow` → -/// `ItemDispatchKind`, where dispatch is `strip_prefix("Kw")`). No separate -/// `role` field is read from `.dag` and no substrate `BracketRole` coproduct -/// is authored — the emitted Rust enum is projection-only. -fn collect_bracket_rows(dag: &Dag, token_variants: &[String]) -> Vec { - let token_variant_set: BTreeSet<&str> = token_variants.iter().map(String::as_str).collect(); - - let row_type_id = dag - .declarations() - .iter() - .find(|d| d.name.as_deref() == Some("BracketRow")) - .map(|d| d.id) - .expect("BracketRow declaration"); - - let mut rows: Vec = Vec::new(); - let mut seen_token_variants: BTreeSet = BTreeSet::new(); - for decl in dag.declarations() { - if decl.meta_tag != Some(row_type_id) { - continue; - } - let name = decl.name.as_deref().unwrap_or(""); - let Some(ValueBody::Structural { fields }) = &decl.value_body else { - panic!( - "`parse_tables.dag::{name}`: `BracketRow` binding must carry a structural value body" - ); - }; - let token_variant = string_field(fields, "token_variant", name); - - assert!( - token_variant_set.contains(token_variant.as_str()), - "`parse_tables.dag::{name}`: token_variant `{token_variant}` is not a \ - `TokenKind` variant in `tokenize.dag`" - ); - let role = bracket_role_from_token_variant(&token_variant, name); - assert!( - seen_token_variants.insert(token_variant.clone()), - "`parse_tables.dag`: duplicate bracket row for `TokenKind::{token_variant}`" - ); - - rows.push(BracketRow { - token_variant, - role: role.to_string(), - }); - } - rows.sort_by(|a, b| a.token_variant.cmp(&b.token_variant)); - rows -} - -/// Collect `PrimaryAtomRow` facts for SG-2c-7; `PrimaryAtomClass` labels are -/// derived at regen (see `primary_atom_class_label_from_token_variant`). -fn collect_primary_atom_rows(dag: &Dag, token_variants: &[String]) -> Vec { - let token_variant_set: BTreeSet<&str> = token_variants.iter().map(String::as_str).collect(); - - let row_type_id = dag - .declarations() - .iter() - .find(|d| d.name.as_deref() == Some("PrimaryAtomRow")) - .map(|d| d.id) - .expect("PrimaryAtomRow declaration"); - - let mut rows: Vec = Vec::new(); - let mut seen_token_variants: BTreeSet = BTreeSet::new(); - for decl in dag.declarations() { - if decl.meta_tag != Some(row_type_id) { - continue; - } - let name = decl.name.as_deref().unwrap_or(""); - let Some(ValueBody::Structural { fields }) = &decl.value_body else { - panic!( - "`parse_tables.dag::{name}`: `PrimaryAtomRow` binding must carry a structural value body" - ); - }; - let token_variant = string_field(fields, "token_variant", name); - - assert!( - token_variant_set.contains(token_variant.as_str()), - "`parse_tables.dag::{name}`: token_variant `{token_variant}` is not a \ - `TokenKind` variant in `tokenize.dag`" - ); - - let dispatch = primary_atom_class_label_from_token_variant(&token_variant, name); - - assert!( - seen_token_variants.insert(token_variant.clone()), - "`parse_tables.dag`: duplicate primary-atom row for `TokenKind::{token_variant}`" - ); - - rows.push(PrimaryAtomRow { - token_variant, - dispatch, - }); - } - rows.sort_by(|a, b| a.token_variant.cmp(&b.token_variant)); - rows -} - -/// `PrimaryAtomRow.token_variant` is the sole authored key; the Rust -/// `PrimaryAtomClass` label is a closed allowlist at regen — not a second -/// field in `parse_tables.dag`. -fn primary_atom_class_label_from_token_variant(token_variant: &str, decl_name: &str) -> String { - let label = match token_variant { - "IntLit" => "IntLiteral", - "KwTrue" => "True", - "KwFalse" => "False", - "StringLit" => "String", - "Pipe" => "Pipe", - "Ident" => "Ident", - other => panic!( - "`parse_tables.dag::{decl_name}`: token_variant `{other}` is not in the SG-2c-7 \ - primary-atom allowlist (IntLit, KwTrue, KwFalse, StringLit, Pipe, Ident)" - ), - }; - assert_dispatch_label_is_rust_identifier(label, decl_name); - label.to_string() -} - -/// Rust `match` pattern on `&TokenKind` for payload-carrying variants; nullary -/// `TokenKind` use the identifier alone. -fn token_kind_pattern_ref(token_variant: &str) -> String { - match token_variant { - "Ident" => "Ident(_)".to_string(), - "IntLit" => "IntLit(_)".to_string(), - "StringLit" => "StringLit(_)".to_string(), - other => other.to_string(), - } -} - -/// `SoftKeywordIdentRow.token_variant` is authoritative; spelling is the -/// lowercased `Kw` suffix, not a second authored string field. -fn collect_soft_keyword_ident_rows( - dag: &Dag, - token_variants: &[String], - keyword_token_variants: &[String], - shared_keywords: &BTreeSet, -) -> Vec { - let token_variant_set: BTreeSet<&str> = token_variants.iter().map(String::as_str).collect(); - let keyword_token_variant_set: BTreeSet<&str> = - keyword_token_variants.iter().map(String::as_str).collect(); - - let row_type_id = dag - .declarations() - .iter() - .find(|d| d.name.as_deref() == Some("SoftKeywordIdentRow")) - .map(|d| d.id) - .expect("SoftKeywordIdentRow declaration"); - - let mut rows: Vec = Vec::new(); - let mut seen_token_variants: BTreeSet = BTreeSet::new(); - for decl in dag.declarations() { - if decl.meta_tag != Some(row_type_id) { - continue; - } - let name = decl.name.as_deref().unwrap_or(""); - let Some(ValueBody::Structural { fields }) = &decl.value_body else { - panic!( - "`parse_tables.dag::{name}`: `SoftKeywordIdentRow` binding must carry a structural value body" - ); - }; - let token_variant = string_field(fields, "token_variant", name); - assert!( - token_variant_set.contains(token_variant.as_str()), - "`parse_tables.dag::{name}`: token_variant `{token_variant}` is not a \ - `TokenKind` variant in `tokenize.dag`" - ); - assert!( - keyword_token_variant_set.contains(token_variant.as_str()), - "`parse_tables.dag::{name}`: token_variant `{token_variant}` is not a \ - `KeywordTokenKind` variant in `tokenize.dag`" - ); - let spelling = - soft_keyword_ident_spelling_from_token_variant(&token_variant, name, shared_keywords); - assert!( - seen_token_variants.insert(token_variant.clone()), - "`parse_tables.dag`: duplicate soft-keyword-ident row for `TokenKind::{token_variant}`" - ); - rows.push(SoftKeywordIdentRow { - token_variant, - spelling, - }); - } - rows.sort_by(|a, b| a.token_variant.cmp(&b.token_variant)); - rows -} - -/// Collect `PrimaryPrefixRow` facts for SG-2c-6; dispatch labels are derived -/// at regen (see `primary_prefix_dispatch_label_from_token_variant`). -fn collect_primary_prefix_rows(dag: &Dag, token_variants: &[String]) -> Vec { - let token_variant_set: BTreeSet<&str> = token_variants.iter().map(String::as_str).collect(); - - let row_type_id = dag - .declarations() - .iter() - .find(|d| d.name.as_deref() == Some("PrimaryPrefixRow")) - .map(|d| d.id) - .expect("PrimaryPrefixRow declaration"); - - let mut rows: Vec = Vec::new(); - let mut seen_token_variants: BTreeSet = BTreeSet::new(); - for decl in dag.declarations() { - if decl.meta_tag != Some(row_type_id) { - continue; - } - let name = decl.name.as_deref().unwrap_or(""); - let Some(ValueBody::Structural { fields }) = &decl.value_body else { - panic!( - "`parse_tables.dag::{name}`: `PrimaryPrefixRow` binding must carry a structural value body" - ); - }; - let token_variant = string_field(fields, "token_variant", name); - - assert!( - token_variant_set.contains(token_variant.as_str()), - "`parse_tables.dag::{name}`: token_variant `{token_variant}` is not a \ - `TokenKind` variant in `tokenize.dag`" - ); - - let dispatch = primary_prefix_dispatch_label_from_token_variant(&token_variant, name); - - assert!( - seen_token_variants.insert(token_variant.clone()), - "`parse_tables.dag`: duplicate primary-prefix row for `TokenKind::{token_variant}`" - ); - - rows.push(PrimaryPrefixRow { - token_variant, - dispatch, - }); - } - rows.sort_by(|a, b| a.token_variant.cmp(&b.token_variant)); - rows -} - -/// `PrimaryPrefixRow.token_variant` is authoritative; dispatch label is -/// `strip_prefix("Kw")` for keyword openers, else `LBrace` → `Record`, -/// `LBracket` → `List` — no separately authored substrate enum. -fn primary_prefix_dispatch_label_from_token_variant( - token_variant: &str, - decl_name: &str, -) -> String { - if let Some(rest) = token_variant.strip_prefix("Kw") { - assert!( - !rest.is_empty(), - "`parse_tables.dag::{decl_name}`: token_variant `{token_variant}` has nothing after `Kw`" - ); - assert_dispatch_label_is_rust_identifier(rest, decl_name); - return rest.to_string(); - } - match token_variant { - "LBrace" => "Record".to_string(), - "LBracket" => "List".to_string(), - "Caret" => "Caret".to_string(), - other => panic!( - "`parse_tables.dag::{decl_name}`: token_variant `{other}` must be `Kw*` or \ - `LBrace` / `LBracket` / `Caret` (primary prefix openers)" - ), - } -} - -/// Derive `BracketRole` from the `L`/`R` prefix of a bracketing `TokenKind` -/// variant name. Single authority for opener/closer: row authors only the -/// token variant, role projects structurally — no parallel field in `.dag`. -fn bracket_role_from_token_variant(token_variant: &str, decl_name: &str) -> &'static str { - if token_variant.starts_with('L') { - "Opener" - } else if token_variant.starts_with('R') { - "Closer" - } else { - panic!( - "`parse_tables.dag::{decl_name}`: bracket token_variant `{token_variant}` does \ - not start with `L` or `R`; every bracketing `TokenKind` variant must carry one \ - of those prefixes so role can be projected from the token authority." - ) - } -} - -/// `TopLevelItemKwRow.token_variant` is authoritative; dispatch label is -/// `strip_prefix("Kw")` — there is no separately authored substrate enum. -fn item_dispatch_label_from_kw_token_variant(token_variant: &str, decl_name: &str) -> String { - let Some(rest) = token_variant.strip_prefix("Kw") else { - panic!( - "`parse_tables.dag::{decl_name}`: token_variant `{token_variant}` must start with \ - `Kw` (dispatch label is the remainder; no parallel coproduct in `parse_tables.dag`)" - ); - }; - assert!( - !rest.is_empty(), - "`parse_tables.dag::{decl_name}`: token_variant `{token_variant}` has nothing after `Kw`" - ); - assert_dispatch_label_is_rust_identifier(rest, decl_name); - // `format!("Kw{rest}") == token_variant` would be tautological after a successful - // `strip_prefix("Kw")`; identifier validation above is the substantive guard. - rest.to_string() -} - -fn soft_keyword_ident_spelling_from_token_variant( - token_variant: &str, - decl_name: &str, - shared_keywords: &BTreeSet, -) -> String { - let spelling = keyword_spelling_for_token_variant(token_variant, decl_name); - assert!( - shared_keywords.contains(&spelling), - "`parse_tables.dag::{decl_name}`: token_variant `{token_variant}` expects keyword \ - `{spelling}` from `dsl/extdeps/languages/dag/syntax.dag::dag_keyword_set`" - ); - spelling -} - -fn keyword_spelling_for_token_variant(token_variant: &str, decl_name: &str) -> String { - let label = item_dispatch_label_from_kw_token_variant(token_variant, decl_name); - assert!( - label.chars().all(|c| c.is_ascii_alphanumeric() || c == '_'), - "`parse_tables.dag::{decl_name}`: soft keyword spelling source `{label}` must be ASCII identifier characters" - ); - label.to_ascii_lowercase() -} - -fn assert_dispatch_label_is_rust_identifier(label: &str, decl_name: &str) { - let mut chars = label.chars(); - let Some(first) = chars.next() else { - panic!("`parse_tables.dag::{decl_name}`: empty dispatch label"); - }; - assert!( - first.is_ascii_alphabetic() || first == '_', - "`parse_tables.dag::{decl_name}`: dispatch `{label}` must start with ASCII letter or `_`" - ); - assert!( - chars.all(|c| c.is_ascii_alphanumeric() || c == '_'), - "`parse_tables.dag::{decl_name}`: dispatch `{label}` must be ASCII identifier characters" - ); -} - -fn string_field(fields: &[(String, FieldValue)], key: &str, name: &str) -> String { - match fields.iter().find(|(k, _)| k == key).map(|(_, v)| v) { - Some(FieldValue::Literal(LiteralBits::String(s))) => s.clone(), - other => panic!("`{name}`: field `{key}` should be a string literal, got {other:?}"), - } -} - -fn variant_field( - fields: &[(String, FieldValue)], - key: &str, - variants: &[Field], - name: &str, - type_label: &str, -) -> String { - let fv = fields - .iter() - .find(|(k, _)| k == key) - .map(|(_, v)| v) - .unwrap_or_else(|| panic!("`{name}`: missing field `{key}`")); - let FieldValue::Variant { - constructor, - payload, - } = fv - else { - panic!("`{name}`: field `{key}` should be a variant value, got {fv:?}"); - }; - assert!( - payload.is_empty(), - "`{name}`: field `{key}` expects a nullary variant" - ); - variants - .iter() - .find(|v| v.ty == *constructor) - .map(|v| v.label.clone()) - .unwrap_or_else(|| { - panic!( - "`{name}`: field `{key}` constructor {constructor:?} is not a {type_label} variant" - ) - }) -} - -/// Render an `OperatorKind` as the Rust source expression that constructs it. -/// Structural projection — reads the value, emits the matching constructor -/// path — with no symbol → operator table. The symbol → `OperatorKind` -/// authority is `operators.dag::from_symbol`; this driver consumes that -/// projection via [`operators::from_symbol`] and only formats the result. -fn operator_kind_expr(op: OperatorKind) -> String { - match op { - OperatorKind::Arithmetic(a) => format!( - "OperatorKind::Arithmetic(ArithmeticOp::{})", - arithmetic_variant(a) - ), - OperatorKind::Comparison(c) => format!( - "OperatorKind::Comparison(ComparisonOp::{})", - comparison_variant(c) - ), - OperatorKind::Logical(l) => { - format!("OperatorKind::Logical(LogicalOp::{})", logical_variant(l)) - } - } -} - -fn arithmetic_variant(a: ArithmeticOp) -> &'static str { - match a { - ArithmeticOp::Add => "Add", - ArithmeticOp::Sub => "Sub", - ArithmeticOp::Mul => "Mul", - ArithmeticOp::Div => "Div", - } -} - -fn comparison_variant(c: ComparisonOp) -> &'static str { - match c { - ComparisonOp::Eq => "Eq", - ComparisonOp::Ne => "Ne", - ComparisonOp::Lt => "Lt", - ComparisonOp::Le => "Le", - ComparisonOp::Gt => "Gt", - ComparisonOp::Ge => "Ge", - } -} - -fn logical_variant(l: LogicalOp) -> &'static str { - match l { - LogicalOp::And => "And", - LogicalOp::Or => "Or", - } -} - -/// Row bundles for `emit_module`. SG-2c tables accrue enough parameters that -/// a single carrier keeps the emission entry under clippy's `too_many_arguments` -/// threshold (`-D warnings` in CI). -struct EmitParseTablesModule<'a> { - levels: &'a [String], - binary_op_rows: &'a [BinaryOpRow], - item_dispatch_variants: &'a [String], - item_kw_rows: &'a [TopLevelItemKwRow], - soft_keyword_ident_rows: &'a [SoftKeywordIdentRow], - bracket_rows: &'a [BracketRow], - primary_prefix_variants: &'a [String], - primary_prefix_rows: &'a [PrimaryPrefixRow], - primary_atom_variants: &'a [String], - primary_atom_rows: &'a [PrimaryAtomRow], -} - -fn emit_module(ctx: &EmitParseTablesModule<'_>) -> String { - let EmitParseTablesModule { - levels, - binary_op_rows: rows, - item_dispatch_variants, - item_kw_rows, - soft_keyword_ident_rows, - bracket_rows, - primary_prefix_variants, - primary_prefix_rows, - primary_atom_variants, - primary_atom_rows, - } = *ctx; - // `BracketRole` variants are the set of distinct roles derived from the - // authored rows (projection-only). Matches the `ItemDispatchKind` pattern: - // unique labels, sorted, no substrate coproduct. - let mut bracket_roles: Vec = bracket_rows.iter().map(|r| r.role.clone()).collect(); - bracket_roles.sort_unstable(); - bracket_roles.dedup(); - let mut s = String::new(); - s.push_str("use crate::dag::{ArithmeticOp, ComparisonOp, LogicalOp, OperatorKind};\n"); - s.push_str("use crate::tokenize::TokenKind;\n\n"); - - s.push_str("#[derive(Debug, Clone, Copy, PartialEq, Eq)]\n"); - s.push_str("pub enum BinaryOpLevel {\n"); - for level in levels { - s.push_str(&format!(" {level},\n")); - } - s.push_str("}\n\n"); - - s.push_str( - "/// Token-to-`OperatorKind` map for the parser's per-precedence-level\n\ - /// functions. Authored as `binary_op_*: BinaryOpRow` rows in\n\ - /// `src/v3/compiler/parse_tables.dag`; regenerated by `regen_parse_tables`.\n", - ); - s.push_str( - "pub fn binary_op_at_level(tk: &TokenKind, level: BinaryOpLevel) -> Option {\n", - ); - s.push_str(" match (tk, level) {\n"); - for row in rows { - let op = operators::from_symbol(&row.operator_symbol) - .expect("validated in collect_binary_op_rows"); - s.push_str(&format!( - " (TokenKind::{}, BinaryOpLevel::{}) => Some({}),\n", - row.token_variant, - row.level, - operator_kind_expr(op) - )); - } - s.push_str(" _ => None,\n"); - s.push_str(" }\n"); - s.push_str("}\n\n"); - - s.push_str("#[derive(Debug, Clone, Copy, PartialEq, Eq)]\n"); - s.push_str("pub enum ItemDispatchKind {\n"); - for v in item_dispatch_variants { - s.push_str(&format!(" {v},\n")); - } - s.push_str("}\n\n"); - - s.push_str( - "/// Top-level item keyword (`parse_item`) → dispatch class.\n\ - /// `ItemDispatchKind` is emitted from unique `Kw`-stripped labels of\n\ - /// `TopLevelItemKwRow { token_variant }` rows — not authored as a substrate coproduct.\n", - ); - s.push_str("pub fn top_level_item_dispatch(kind: &TokenKind) -> Option {\n"); - s.push_str(" match kind {\n"); - for row in item_kw_rows { - s.push_str(&format!( - " TokenKind::{} => Some(ItemDispatchKind::{}),\n", - row.token_variant, row.dispatch - )); - } - s.push_str(" _ => None,\n"); - s.push_str(" }\n"); - s.push_str("}\n"); - s.push_str( - "\n/// Keyword membership table for top-level type-RHS boundary lookahead.\n\ - /// Projected from the existing `TopLevelItemKwRow` rows in\n\ - /// `src/v3/compiler/parse_tables.dag`.\n", - ); - s.push_str("pub fn is_type_rhs_boundary_keyword(kind: &TokenKind) -> bool {\n"); - s.push_str(" matches!(kind, "); - for (idx, row) in item_kw_rows.iter().enumerate() { - if idx > 0 { - s.push_str(" | "); - } - s.push_str(&format!("TokenKind::{}", row.token_variant)); - } - s.push_str(")\n"); - s.push_str("}\n\n"); - - s.push_str( - "/// Keyword tokens that the parser accepts as bare identifier spellings\n\ - /// in label/name positions (`parse_field_label`, `parse_variant`).\n\ - /// Projected from `SoftKeywordIdentRow { token_variant }` rows in\n\ - /// `src/v3/compiler/parse_tables.dag`.\n", - ); - s.push_str("pub fn soft_keyword_ident_spelling(kind: &TokenKind) -> Option<&'static str> {\n"); - s.push_str(" match kind {\n"); - for row in soft_keyword_ident_rows { - s.push_str(&format!( - " TokenKind::{} => Some({:?}),\n", - row.token_variant, row.spelling - )); - } - s.push_str(" _ => None,\n"); - s.push_str(" }\n"); - s.push_str("}\n\n"); - - s.push_str("#[derive(Debug, Clone, Copy, PartialEq, Eq)]\n"); - s.push_str("pub enum BracketRole {\n"); - for role in &bracket_roles { - s.push_str(&format!(" {role},\n")); - } - s.push_str("}\n\n"); - - s.push_str( - "/// Bracket opener/closer role for depth-tracking token scans\n\ - /// (`skip_where_clause`, `rhs_is_sum` in `parse_parser_body.txt`).\n\ - /// Authored as `bracket_*: BracketRow` rows in\n\ - /// `src/v3/compiler/parse_tables.dag`; regenerated by `regen_parse_tables`.\n", - ); - s.push_str("pub fn bracket_role(kind: &TokenKind) -> Option {\n"); - s.push_str(" match kind {\n"); - for row in bracket_rows { - s.push_str(&format!( - " TokenKind::{} => Some(BracketRole::{}),\n", - row.token_variant, row.role - )); - } - s.push_str(" _ => None,\n"); - s.push_str(" }\n"); - s.push_str("}\n\n"); - - s.push_str("#[derive(Debug, Clone, Copy, PartialEq, Eq)]\n"); - s.push_str("pub enum PrimaryPrefixDispatch {\n"); - for v in primary_prefix_variants { - s.push_str(&format!(" {v},\n")); - } - s.push_str("}\n\n"); - - s.push_str( - "/// Peek token at the start of `parse_primary` → which dedicated parser to run.\n\ - /// Authored as `primary_prefix_*: PrimaryPrefixRow` rows in\n\ - /// `src/v3/compiler/parse_tables.dag`; regenerated by `regen_parse_tables`.\n\ - /// `PrimaryPrefixDispatch` is emitted from those rows — not a substrate coproduct.\n", - ); - s.push_str( - "pub fn primary_prefix_dispatch(kind: &TokenKind) -> Option {\n", - ); - s.push_str(" match kind {\n"); - for row in primary_prefix_rows { - s.push_str(&format!( - " TokenKind::{} => Some(PrimaryPrefixDispatch::{}),\n", - row.token_variant, row.dispatch - )); - } - s.push_str(" _ => None,\n"); - s.push_str(" }\n"); - s.push_str("}\n\n"); - - s.push_str("#[derive(Debug, Clone, Copy, PartialEq, Eq)]\n"); - s.push_str("pub enum PrimaryAtomClass {\n"); - for v in primary_atom_variants { - s.push_str(&format!(" {v},\n")); - } - s.push_str("}\n\n"); - - s.push_str( - "/// After the `parse_primary` prefix pass, the bumped token is one of the\n\ - /// atomic primary forms. Authored as `primary_atom_*: PrimaryAtomRow` rows in\n\ - /// `src/v3/compiler/parse_tables.dag`; regenerated by `regen_parse_tables`.\n\ - /// `PrimaryAtomClass` is emitted from those rows — not a substrate coproduct.\n", - ); - s.push_str("pub fn primary_atom_class(kind: &TokenKind) -> Option {\n"); - s.push_str(" match kind {\n"); - for row in primary_atom_rows { - let pat = token_kind_pattern_ref(&row.token_variant); - s.push_str(&format!( - " TokenKind::{} => Some(PrimaryAtomClass::{}),\n", - pat, row.dispatch - )); - } - s.push_str(" _ => None,\n"); - s.push_str(" }\n"); - s.push_str("}\n"); - s -} - -fn rustfmt_stdout(source: &str) -> Result { - let mut child = Command::new("rustfmt") - .arg("--emit") - .arg("stdout") - .stdin(Stdio::piped()) - .stdout(Stdio::piped()) - .spawn() - .map_err(|e| format!("spawn rustfmt: {e}"))?; - child - .stdin - .as_mut() - .unwrap() - .write_all(source.as_bytes()) - .map_err(|e| format!("write rustfmt stdin: {e}"))?; - let output = child - .wait_with_output() - .map_err(|e| format!("wait rustfmt: {e}"))?; - if !output.status.success() { - return Err(format!( - "rustfmt failed: {}", - String::from_utf8_lossy(&output.stderr) - )); - } - String::from_utf8(output.stdout).map_err(|e| format!("rustfmt stdout utf-8: {e}")) -} - -/// SG-1a scaffold extension: read operator projection data directly from -/// `syntax.dag` source text because `dag_operators` still lowers as -/// `ValueBody::Unparsed` (same state `regen_tokenize` encountered). A trimmed -/// view of `OperatorSpec` is sufficient for regen cross-validation against -/// `parse_tables.dag`. -#[derive(Clone)] -pub(crate) struct SharedOperatorSpec { - pub left_bp: i64, - /// Variant name from the external authority's `binop` field, e.g. - /// `"Or"`, `"Add"`, `"Eq"`. Matches the leaf variant label - /// inside the corresponding `OperatorKind` (see - /// `operator_kind_binop_name`), which is the structural join - /// that closes `symbol → OperatorKind` drift between - /// `operators.dag` and `v3_supported_dag_operators`. - pub binop_name: String, -} - -/// Returns a symbol → (left_bp, binop_name) map for the current v3-supported -/// operator projection by filtering external `dag_operators` with the explicit -/// `v3_supported_dag_operators` symbol set. Fails closed on malformed input. -/// Dissolution trigger: when `dag_operators` lowers structurally, swap this -/// extractor for a typed read — same lane as `regen_tokenize`'s -/// `assert_shared_syntax_raw_source_scaffold_still_required`. -fn extract_v3_supported_operator_bps( - source: &str, -) -> std::collections::BTreeMap { - let supported_symbols = extract_v3_supported_operator_symbols(source); - let external_operators = extract_shared_operator_bps(source); - let mut out = std::collections::BTreeMap::new(); - for symbol in supported_symbols { - let spec = external_operators.get(&symbol).unwrap_or_else(|| { - panic!( - "`v3_supported_dag_operators` symbol `{symbol}` is not present in external `dag_operators`" - ) - }); - out.insert(symbol, spec.clone()); - } - out -} - -fn extract_shared_operator_bps( - source: &str, -) -> std::collections::BTreeMap { - let section = extract_balanced_section(source, "data dag_operators", '[', ']'); - let mut out = std::collections::BTreeMap::new(); - // Each entry is `OperatorSpec { symbol: "X", left_bp: N, right_bp: M, binop: Y, ... }`. - // Parse sequentially: symbol (string) → left_bp (int) → binop (bare identifier). - let mut rest = section; - loop { - let Some(sym_idx) = rest.find("symbol:") else { - break; - }; - let after_sym = &rest[sym_idx + "symbol:".len()..]; - let quote_idx = after_sym - .find('"') - .expect("missing string literal for `symbol` in `dag_operators`"); - let (symbol, consumed) = parse_string_literal(&after_sym[quote_idx..]); - let tail = &after_sym[quote_idx + consumed..]; - - let bp_idx = tail - .find("left_bp:") - .expect("OperatorSpec missing `left_bp` field"); - let after_bp = &tail[bp_idx + "left_bp:".len()..]; - let after_bp_trimmed = after_bp.trim_start(); - let num_end = after_bp_trimmed - .find(|c: char| !c.is_ascii_digit()) - .unwrap_or(after_bp_trimmed.len()); - let bp: i64 = after_bp_trimmed[..num_end] - .parse() - .unwrap_or_else(|_| panic!("malformed left_bp for symbol `{symbol}`")); - let tail = &after_bp_trimmed[num_end..]; - - let binop_idx = tail - .find("binop:") - .expect("OperatorSpec missing `binop` field"); - let after_binop = &tail[binop_idx + "binop:".len()..]; - let after_binop_trimmed = after_binop.trim_start(); - let ident_end = after_binop_trimmed - .find(|c: char| !c.is_ascii_alphanumeric() && c != '_') - .unwrap_or(after_binop_trimmed.len()); - let binop_name = after_binop_trimmed[..ident_end].to_string(); - - assert!( - out.insert( - symbol.clone(), - SharedOperatorSpec { - left_bp: bp, - binop_name, - }, - ) - .is_none(), - "duplicate `dag_operators` row for symbol `{symbol}`" - ); - rest = &after_binop_trimmed[ident_end..]; - } - out -} - -fn extract_v3_supported_operator_symbols(source: &str) -> BTreeSet { - let section = extract_balanced_section(source, "data v3_supported_dag_operators", '{', '}'); - let mut out = BTreeSet::new(); - let mut rest = section; - loop { - let Some(quote_idx) = rest.find('"') else { - break; - }; - let (symbol, consumed) = parse_string_literal(&rest[quote_idx..]); - assert!( - out.insert(symbol.clone()), - "duplicate `v3_supported_dag_operators` row for symbol `{symbol}`" - ); - rest = &rest[quote_idx + consumed..]; - } - out -} - -fn extract_shared_keyword_set(source: &str) -> BTreeSet { - let section = extract_balanced_section(source, "data dag_keyword_set", '{', '}'); - let mut out = BTreeSet::new(); - let mut rest = section; - loop { - let Some(quote_idx) = rest.find('"') else { - break; - }; - let (keyword, consumed) = parse_string_literal(&rest[quote_idx..]); - assert!( - out.insert(keyword.clone()), - "duplicate `dag_keyword_set` row for keyword `{keyword}`" - ); - rest = &rest[quote_idx + consumed..]; - } - out -} - -/// Variant-name projection of an `OperatorKind` — the leaf label inside -/// the nested enum (e.g. `Or`, `Add`, `Eq`). The v3-supported projection's -/// `OperatorSpec.binop` uses the same vocabulary, so comparing on this -/// label is the structural join that closes `symbol → OperatorKind` -/// drift between `operators.dag` and `v3_supported_dag_operators` — without a -/// parallel name-to-name table (the projection is a pure value read). -fn operator_kind_binop_name(op: OperatorKind) -> &'static str { - match op { - OperatorKind::Arithmetic(a) => arithmetic_variant(a), - OperatorKind::Comparison(c) => comparison_variant(c), - OperatorKind::Logical(l) => logical_variant(l), - } -} - -fn extract_balanced_section<'a>(source: &'a str, anchor: &str, open: char, close: char) -> &'a str { - let anchor_idx = source - .find(anchor) - .unwrap_or_else(|| panic!("missing `{anchor}` in shared syntax authority")); - let tail = &source[anchor_idx..]; - let open_rel = tail - .find(open) - .unwrap_or_else(|| panic!("missing `{open}` after `{anchor}`")); - let start = anchor_idx + open_rel; - let mut depth = 0usize; - for (offset, ch) in source[start..].char_indices() { - if ch == open { - depth += 1; - } else if ch == close { - depth -= 1; - if depth == 0 { - return &source[start + open.len_utf8()..start + offset]; - } - } - } - panic!("unterminated `{open}` section `{anchor}`"); -} - -fn parse_string_literal(source: &str) -> (String, usize) { - assert!( - source.starts_with('"'), - "string literal expects to start at a quote" - ); - let mut out = String::new(); - let mut escaped = false; - for (idx, ch) in source[1..].char_indices() { - if escaped { - out.push(ch); - escaped = false; - continue; - } - match ch { - '\\' => escaped = true, - '"' => return (out, idx + 2), - other => out.push(other), - } - } - panic!("unterminated string literal in shared syntax authority"); -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn unsupported_external_operator_duplicates_fail_closed() { - let source = r#" -data dag_operators: List = [ - OperatorSpec { symbol: "||", left_bp: 5, right_bp: 6, binop: Or, algebra_field: none }, - OperatorSpec { symbol: "??", left_bp: 8, right_bp: 9, binop: NullCoalesce, algebra_field: none }, - OperatorSpec { symbol: "??", left_bp: 8, right_bp: 9, binop: NullCoalesce, algebra_field: none } -] - -data v3_supported_dag_operators: Map = { - "||": true -} -"#; - let err = match std::panic::catch_unwind(|| extract_v3_supported_operator_bps(source)) { - Ok(_) => panic!("duplicate unsupported external operator should panic"), - Err(err) => err, - }; - let msg = err - .downcast_ref::() - .map(String::as_str) - .or_else(|| err.downcast_ref::<&str>().copied()) - .unwrap_or(""); - assert!( - msg.contains("duplicate `dag_operators` row for symbol `??`"), - "unexpected panic: {msg}" - ); - } -} diff --git a/src/v3/compiler/src/regen_tokenize.rs b/src/v3/compiler/src/regen_tokenize.rs deleted file mode 100644 index 228e47c45fb..00000000000 --- a/src/v3/compiler/src/regen_tokenize.rs +++ /dev/null @@ -1,1191 +0,0 @@ -//! Regenerate `tokenize_generated.rs` from `src/v3/compiler/tokenize.dag`. -//! -//! Scanner controls and tokenizer-local punctuation come from the lowered -//! tokenizer Dag, while token types are imported from `src/v3/std/tokenize.dag`. -//! Dedicated keywords are derived from the lowered shared syntax authority at -//! `dsl/extdeps/languages/dag/syntax.dag`. Shared operators still use the -//! bounded raw-source bridge until `dag_operators` lowers structurally. - -use std::collections::BTreeSet; -use std::io::Write; -use std::process::{Command, Stdio}; - -use crate::compile_to_dag; -use crate::dag::{ - AtomPayload, Dag, DeclarationId, FieldValue, LiteralBits, TypeConnective, ValueBody, -}; -use crate::generated_files::GENERATED_FILES; -use crate::CompileError; - -const GENERATED_FILE: &str = "src/v3/compiler/src/tokenize_generated.rs"; -const TOKENIZE_AUTHORITY_FILE: &str = "src/v3/compiler/tokenize.dag"; -const TOKEN_STD_AUTHORITY_FILE: &str = "src/v3/std/tokenize.dag"; -const SHARED_SYNTAX_FILE: &str = "dsl/extdeps/languages/dag/syntax.dag"; - -const HEADER: &str = "// AUTO-GENERATED from `src/v3/compiler/tokenize.dag` via\n\ - // `regen_tokenize`. Regenerate instead of hand-editing.\n\n"; - -/// Regenerated `tokenize_generated.rs` body: header + `rustfmt` stdout, no disk write. -/// -/// Used by `regen_tokenize` CLI and SG-1 authority tests (in-process; avoids nested Cargo). -pub fn tokenize_generated_rust_formatted(manifest_dir: &std::path::Path) -> String { - let dag_path = manifest_dir.join("tokenize.dag"); - let source = std::fs::read_to_string(&dag_path).expect("read tokenize.dag"); - let dag = compile_authority_dag(&source, TOKENIZE_AUTHORITY_FILE); - let shared_syntax_source = read_shared_syntax_source(manifest_dir); - let shared_syntax_dag = compile_shared_syntax_dag(&shared_syntax_source); - let shared_syntax = - SharedSyntaxAuthority::from_authority(&shared_syntax_dag, &shared_syntax_source); - let rust = generate(&dag, &shared_syntax); - let combined = format!("{HEADER}{rust}"); - rustfmt_stdout(&combined) -} - -/// Single-authority gate + write path for the `regen_tokenize` binary. -pub fn write_tokenize_generated_rs(manifest_dir: &std::path::Path) { - // Single-authority gate: the output path this driver writes must - // be registered in `REGEN_OUTPUTS` (surfaced as - // `generated_files::GENERATED_FILES`). SG-0 treats that - // manifest as the sole producer-owned partition; writing to a path - // outside the manifest would silently drift the census. - assert!( - GENERATED_FILES.contains(&GENERATED_FILE), - "`regen_tokenize` writes `{GENERATED_FILE}` but that path is not \ - registered in `REGEN_OUTPUTS` in `src/v3/compiler/build.rs`. \ - Add the path to `REGEN_OUTPUTS` so the two authorities stay in \ - lockstep. Both are SG-0's producer-owned manifest; writing \ - to a path outside the manifest would be silent drift." - ); - - let formatted = tokenize_generated_rust_formatted(manifest_dir); - let out_path = manifest_dir.join("src").join("tokenize_generated.rs"); - std::fs::write(&out_path, &formatted).expect("write tokenize_generated.rs"); - println!("wrote {}", out_path.display()); -} - -fn rustfmt_stdout(combined: &str) -> String { - let mut child = Command::new("rustfmt") - .arg("--emit") - .arg("stdout") - .stdin(Stdio::piped()) - .stdout(Stdio::piped()) - .spawn() - .expect("spawn rustfmt"); - child - .stdin - .as_mut() - .unwrap() - .write_all(combined.as_bytes()) - .unwrap(); - let output = child.wait_with_output().expect("rustfmt"); - assert!(output.status.success(), "rustfmt failed"); - String::from_utf8(output.stdout).expect("utf8") -} - -fn compile_authority_dag(source: &str, file: &str) -> Dag { - compile_to_dag(source, file).unwrap_or_else(|e| match e { - CompileError::Semantic(d) => { - let mut msg = format!("compile {file} failed:\n"); - for (_, diag) in d.diagnostics().iter() { - msg.push_str(&format!(" {diag:?}\n")); - } - panic!("{msg}"); - } - other => panic!("compile {file}: {other:?}"), - }) -} - -fn read_shared_syntax_source(manifest_dir: &std::path::Path) -> String { - let repo_root = manifest_dir - .parent() - .and_then(|path| path.parent()) - .and_then(|path| path.parent()) - .expect("src/v3/compiler should have a repo root ancestor"); - let syntax_path = repo_root.join(SHARED_SYNTAX_FILE); - std::fs::read_to_string(&syntax_path).unwrap_or_else(|e| { - panic!( - "read shared syntax authority `{}` from {}: {e}", - SHARED_SYNTAX_FILE, - syntax_path.display() - ) - }) -} - -fn compile_shared_syntax_dag(source: &str) -> Dag { - match compile_to_dag(source, SHARED_SYNTAX_FILE) { - Ok(dag) => dag, - Err(CompileError::Semantic(dag)) => dag, - Err(other) => panic!("compile {SHARED_SYNTAX_FILE}: {other:?}"), - } -} - -fn generate(dag: &Dag, shared_syntax: &SharedSyntaxAuthority) -> String { - let keywords = collect_keyword_rows(dag, shared_syntax); - let ascii_scan_order = collect_ascii_scan_order(dag); - let puncts = collect_punct_rows(dag, shared_syntax); - let line_comment_prefix = string_data_named(dag, "line_comment_prefix"); - let string_delim = string_data_named(dag, "string_literal_delimiter"); - assert_eq!( - string_delim.len(), - 1, - "string_literal_delimiter must be one byte, got {string_delim:?}" - ); - let diag_unterm_esc = string_data_named(dag, "diagnostic_unterminated_string_escape"); - let diag_unterm_lit = string_data_named(dag, "diagnostic_unterminated_string_literal"); - let diag_int_pre = string_data_named(dag, "diagnostic_invalid_integer_literal_prefix"); - let diag_int_suf = string_data_named(dag, "diagnostic_invalid_integer_literal_suffix"); - let escapes = collect_string_escape_rows(dag); - let minus_infix_labels = collect_minus_infix_only_after_token_kinds(dag); - - let mut out = String::new(); - out.push_str("use crate::diagnostics::{Diagnostic, SourceSpan};\n"); - out.push_str(&emit_char_scanner_class_scaffolding(&ascii_scan_order)); - out.push_str(&emit_token_kind_enum(dag)); - out.push_str( - r#"#[derive(Debug, Clone)] -pub struct Token { - pub kind: TokenKind, - pub span: SourceSpan, -} - -"#, - ); - out.push_str(&emit_tokenize_fn( - &keywords, - &line_comment_prefix, - string_delim.as_bytes()[0], - &diag_unterm_esc, - &diag_unterm_lit, - &diag_int_pre, - &diag_int_suf, - &escapes, - &ascii_scan_order, - &minus_infix_labels, - )); - out.push_str(&emit_punctuation_token(&puncts)); - out -} - -fn collect_minus_infix_only_after_token_kinds(dag: &Dag) -> Vec { - let decl = dag - .declarations() - .iter() - .find(|d| d.name.as_deref() == Some("minus_infix_only_after_token_kinds")) - .unwrap_or_else(|| { - panic!( - "missing `minus_infix_only_after_token_kinds` data in `{TOKENIZE_AUTHORITY_FILE}`" - ) - }); - let Some(ValueBody::List(values)) = decl.value_body.as_ref() else { - panic!( - "`minus_infix_only_after_token_kinds` in `{TOKENIZE_AUTHORITY_FILE}` must be a list" - ); - }; - let mut out = Vec::new(); - for value in values { - match value { - FieldValue::Literal(LiteralBits::String(s)) => out.push(s.clone()), - other => panic!( - "`minus_infix_only_after_token_kinds`: expected string literal elements, got {other:?}" - ), - } - } - assert!( - !out.is_empty(), - "`minus_infix_only_after_token_kinds` must not be empty" - ); - out -} - -fn token_kind_pattern_for_minus_disambiguation(label: &str) -> &'static str { - match label { - "Ident" => "TokenKind::Ident(_)", - "IntLit" => "TokenKind::IntLit(_)", - "StringLit" => "TokenKind::StringLit(_)", - "KwTrue" => "TokenKind::KwTrue", - "KwFalse" => "TokenKind::KwFalse", - "RParen" => "TokenKind::RParen", - "RBracket" => "TokenKind::RBracket", - "RBrace" => "TokenKind::RBrace", - other => panic!( - "unsupported `{other}` in `minus_infix_only_after_token_kinds`; \ - add a `TokenKind` arm to `token_kind_pattern_for_minus_disambiguation` \ - in `regen_tokenize.rs`" - ), - } -} - -fn emit_minus_prefixed_decimal_allowed(labels: &[String]) -> String { - assert!( - !labels.is_empty(), - "`minus_infix_only_after_token_kinds` must name at least one variant" - ); - let mut inner = String::new(); - for (idx, label) in labels.iter().enumerate() { - let pat = token_kind_pattern_for_minus_disambiguation(label); - if idx == 0 { - inner.push_str(pat); - } else { - inner.push_str("\n | "); - inner.push_str(pat); - } - } - format!( - "fn minus_prefixed_decimal_allowed(prev: Option<&TokenKind>) -> bool {{\n\ - !matches!(\n\ - prev,\n\ - Some(\n\ - {inner}\n\ - )\n\ - )\n\ -}}\n\n" - ) -} - -fn emit_char_scanner_class_scaffolding(scan_order: &[String]) -> String { - assert!( - scan_order.len() == 4, - "`ascii_scan_order` in `tokenize.dag` must list exactly 4 class names" - ); - assert!( - scan_order - .iter() - .collect::>() - .len() - == scan_order.len(), - "`ascii_scan_order` in `tokenize.dag` must not contain duplicates" - ); - - let mut out = String::new(); - out.push_str("\n#[derive(Debug, Clone, Copy, PartialEq, Eq)]\n"); - out.push_str("pub enum ScannerCharClass {\n"); - for class in scan_order { - out.push_str(&format!(" {class},\n")); - } - out.push_str("}\n\n"); - - out.push_str("#[inline]\n"); - out.push_str("pub fn byte_matches(byte: u8, class: ScannerCharClass) -> bool {\n"); - out.push_str(" match class {\n"); - for class in scan_order { - let expr = ascii_scan_class_predicate(class); - out.push_str(&format!(" ScannerCharClass::{class} => {expr},\n")); - } - out.push_str(" }\n}\n\n"); - - out -} - -fn ascii_scan_class_predicate(class_name: &str) -> &'static str { - // TRACKED SCAFFOLD (see `tokenize.dag` header — P5 / CHARACTER-LEVEL row): - // Hand-Rust codegen mirror of **`dsl/std/unicode.dag::char_in_class`** predicates. - // - // **Dissolution pointer (explicit ROADMAP row + next step):** - // `ROADMAP.md` **Post-merge debt** → **`char_in_class` interpreter parity (tokenizer bridge - // finish, PR #693)** — parity harness vs evaluator, then retire this mirror alongside - // structural `tokenize.dag` read (same migration gate as **Character-level - // under-consumption …** §step (3)). - match class_name { - "Whitespace" => "matches!(byte, b'\\t' | b'\\n' | b'\\x0c' | b'\\r' | b' ')", - "Digit" => "byte.is_ascii_digit()", - "IdentStart" => "byte.is_ascii_lowercase() || byte.is_ascii_uppercase() || byte == 0x5f", - "IdentContinue" => "byte.is_ascii_alphanumeric() || byte == 0x5f", - _ => panic!("unsupported scanner class `{class_name}` in `ascii_scan_order`"), - } -} - -fn collect_ascii_scan_order(dag: &Dag) -> Vec { - let scan_decl = dag - .declarations() - .iter() - .find(|d| d.name.as_deref() == Some("ascii_scan_order")) - .unwrap_or_else(|| panic!("missing `ascii_scan_order` in `{TOKENIZE_AUTHORITY_FILE}`")); - - let char_class_decl = dag - .declarations() - .iter() - .find(|d| d.name.as_deref() == Some("CharClass")) - .unwrap_or_else(|| panic!("missing `CharClass` in `{TOKENIZE_AUTHORITY_FILE}`")); - - let TypeConnective::Disj { - variants: char_class_variants, - } = &char_class_decl.connective - else { - panic!("`CharClass` should be a disj declaration"); - }; - - let Some(ValueBody::List(values)) = scan_decl.value_body.as_ref() else { - panic!("`ascii_scan_order` in `{TOKENIZE_AUTHORITY_FILE}` must be a list"); - }; - - let mut out = Vec::new(); - for value in values { - let FieldValue::Variant { - constructor, - payload, - } = value - else { - panic!("`ascii_scan_order` elements must be constructor values"); - }; - assert!( - payload.is_empty(), - "`ascii_scan_order` class entries must be nullary constructors" - ); - let label = char_class_variants - .iter() - .find(|field| field.ty == *constructor) - .map(|field| field.label.clone()) - .unwrap_or_else(|| { - panic!( - "`ascii_scan_order` contains constructor {:?} not owned by `CharClass`", - constructor - ) - }); - out.push(label); - } - - let expected = ["Whitespace", "Digit", "IdentStart", "IdentContinue"]; - for class in &expected { - assert!( - out.contains(&class.to_string()), - "`ascii_scan_order` in `{TOKENIZE_AUTHORITY_FILE}` must include `{class}`" - ); - } - - out -} - -fn string_data_named(dag: &Dag, expected_name: &str) -> String { - let decl = dag - .declarations() - .iter() - .find(|d| d.name.as_deref() == Some(expected_name)) - .unwrap_or_else(|| panic!("missing `{expected_name}` data in `{TOKENIZE_AUTHORITY_FILE}`")); - match &decl.value_body { - Some(ValueBody::Scalar(LiteralBits::String(s))) => s.clone(), - Some(ValueBody::Structural { fields }) => { - if let Some((_, FieldValue::Literal(LiteralBits::String(s)))) = fields.first() { - s.clone() - } else { - panic!("`{expected_name}`: expected string scalar or single string field") - } - } - other => panic!("`{expected_name}`: expected string data, got {other:?}"), - } -} - -fn collect_string_escape_rows(dag: &Dag) -> Vec<(u8, i64)> { - let mut rows = Vec::new(); - for decl in dag.declarations() { - let Some(name) = &decl.name else { - continue; - }; - if !name.starts_with("string_escape_") { - continue; - } - let Some(ValueBody::Structural { fields }) = &decl.value_body else { - continue; - }; - let suffix = extract_string_field(fields, "suffix"); - let codepoint = extract_int_field(fields, "output_codepoint"); - assert_eq!(suffix.len(), 1, "{name}: escape suffix must be one byte"); - rows.push((suffix.as_bytes()[0], codepoint)); - } - rows.sort_by_key(|x| x.0); - rows -} - -fn rust_byte_string_literal(prefix: &str) -> String { - let mut out = String::from("b\""); - for b in prefix.bytes() { - match b { - b'\\' => out.push_str("\\\\"), - b'"' => out.push_str("\\\""), - b'\n' => out.push_str("\\n"), - b'\r' => out.push_str("\\r"), - b'\t' => out.push_str("\\t"), - 32..=126 => out.push(b as char), - _ => panic!("non-printable byte in line_comment_prefix: {b:?}"), - } - } - out.push('"'); - out -} - -fn rust_string_literal_for_rust_source(s: &str) -> String { - format!("{s:?}") -} - -fn emit_token_kind_enum(dag: &Dag) -> String { - let decl = dag - .declarations() - .iter() - .find(|d| d.name.as_deref() == Some("TokenKind")) - .unwrap_or_else(|| { - panic!( - "missing `TokenKind` declaration while compiling `{TOKENIZE_AUTHORITY_FILE}`; \ - expected it to be imported from `{TOKEN_STD_AUTHORITY_FILE}`" - ) - }); - let TypeConnective::Disj { variants } = &decl.connective else { - panic!("TokenKind: expected Disj"); - }; - let mut lines = vec![ - "#[derive(Debug, Clone, PartialEq, Eq)]".to_string(), - "pub enum TokenKind {".to_string(), - ]; - for v in variants { - let payload = dag.declaration(v.ty); - let arm = match &payload.connective { - TypeConnective::Conj { children } if children.is_empty() => format!(" {},", v.label), - TypeConnective::Conj { children } if children.len() == 1 => { - let field = &children[0]; - let rust_ty = rust_type_for_decl_id(dag, field.ty); - let field_name = &field.label; - if field_name == "_0" { - format!(" {}({rust_ty}),", v.label) - } else if field_name == "name" && rust_ty == "String" { - format!(" {}(String),", v.label) - } else if field_name == "value" && rust_ty == "Int" { - format!(" {}(i64),", v.label) - } else { - format!(" {} {{ {}: {rust_ty} }},", v.label, field_name) - } - } - TypeConnective::Atom(atom) => { - use crate::dag::AtomPayload; - match atom { - AtomPayload::Literal(_) => { - panic!("unexpected literal atom for variant {}", v.label) - } - AtomPayload::UnresolvedIdentifier(_) => panic!("unexpected unresolved id"), - AtomPayload::ResolvedByStructure(_) | AtomPayload::ResolvedByName(_) => { - panic!("unexpected resolved atom for {}", v.label) - } - AtomPayload::TypeParam(_) => panic!("unexpected type param"), - } - } - other => panic!( - "TokenKind variant {}: unexpected payload {other:?}", - v.label - ), - }; - lines.push(arm); - } - lines.push("}".to_string()); - lines.push(String::new()); - lines.join("\n") -} - -fn rust_type_for_decl_id(dag: &Dag, id: DeclarationId) -> String { - let decl = dag.declaration(id); - if let Some(name) = &decl.name { - match name.as_str() { - "String" => return "String".to_string(), - "Int" | "Int64" => return "i64".to_string(), - _ => {} - } - } - match &decl.connective { - TypeConnective::Atom(ap) => match ap { - AtomPayload::ResolvedByName(inner) | AtomPayload::ResolvedByStructure(inner) => { - rust_type_for_decl_id(dag, *inner) - } - _ => panic!("rust_type_for_decl_id: unexpected atom {ap:?}"), - }, - TypeConnective::Instantiation { template, .. } => { - let template_decl = dag.declaration(*template); - match template_decl.name.as_deref() { - Some("String") => "String".to_string(), - Some("Int") | Some("Int64") => "i64".to_string(), - other => panic!("unsupported instantiated type {other:?}"), - } - } - other => panic!("rust_type_for_decl_id: unsupported connective for field type: {other:?}"), - } -} - -fn collect_keyword_rows(dag: &Dag, shared_syntax: &SharedSyntaxAuthority) -> Vec<(String, String)> { - let shared_keywords: BTreeSet<_> = shared_syntax.keywords.iter().cloned().collect(); - let mut rows = collect_variant_labels(dag, "KeywordTokenKind") - .into_iter() - .map(|kind| { - let spelling = keyword_spelling_for_token_kind(&kind); - assert!( - shared_keywords.contains(&spelling), - "`KeywordTokenKind::{kind}` expects keyword `{spelling}`, \ - but `{SHARED_SYNTAX_FILE}` does not declare it in `dag_keyword_set`" - ); - assert_token_kind_variant_exists(dag, &kind, "KeywordTokenKind"); - (spelling, kind) - }) - .collect::>(); - rows.sort_by(|a, b| a.0.cmp(&b.0)); - rows -} - -fn collect_punct_rows(dag: &Dag, shared_syntax: &SharedSyntaxAuthority) -> Vec<(String, String)> { - let punct_variants: BTreeSet<_> = collect_variant_labels(dag, "PunctTokenKind") - .into_iter() - .collect(); - let mut rows = Vec::new(); - let mut covered_kinds = BTreeSet::new(); - - for pattern in &shared_syntax.operators { - match classify_shared_operator_for_tokenizer(pattern, &shared_syntax.v3_supported_operators) - { - SharedOperatorTokenizerBoundary::Tokenized { kind } => { - assert!( - punct_variants.contains(kind), - "shared syntax operator `{pattern}` is classified as tokenizer punctuation \ - `PunctTokenKind::{kind}`, but `{TOKENIZE_AUTHORITY_FILE}` does not declare \ - that variant" - ); - assert_token_kind_variant_exists(dag, kind, "PunctTokenKind"); - assert!( - covered_kinds.insert(kind.to_string()), - "shared syntax operator `{pattern}` maps to duplicate punctuation kind \ - `PunctTokenKind::{kind}`" - ); - rows.push((pattern.clone(), kind.to_string())); - } - SharedOperatorTokenizerBoundary::ParserOnlyDebt { reason } => { - assert!( - !reason.is_empty(), - "parser-only shared operator `{pattern}` should carry a dissolution note" - ); - } - } - } - - let shared_operator_patterns: BTreeSet<_> = shared_syntax.operators.iter().cloned().collect(); - for decl in dag.declarations() { - let Some(name) = &decl.name else { - continue; - }; - if !name.starts_with("local_punct_") { - continue; - } - let Some(ValueBody::Structural { fields }) = &decl.value_body else { - continue; - }; - let pattern = extract_string_field(fields, "pattern"); - assert!( - !shared_operator_patterns.contains(&pattern), - "tokenizer-local punctuation row `{name}` duplicates shared operator `{pattern}` \ - from `{SHARED_SYNTAX_FILE}`" - ); - let kind = extract_nullary_variant_field(fields, "kind", "PunctTokenKind", dag); - assert_token_kind_variant_exists(dag, &kind, "PunctTokenKind"); - assert!( - covered_kinds.insert(kind.clone()), - "duplicate punctuation kind `PunctTokenKind::{kind}` across shared/local authority inputs" - ); - rows.push((pattern, kind)); - } - - let mut seen_patterns = BTreeSet::new(); - for (pattern, _) in &rows { - assert!( - seen_patterns.insert(pattern.clone()), - "duplicate punctuation pattern `{pattern}` across shared/local authority inputs" - ); - } - let missing_kinds: Vec<_> = punct_variants.difference(&covered_kinds).cloned().collect(); - assert!( - missing_kinds.is_empty(), - "`{TOKENIZE_AUTHORITY_FILE}` declares `PunctTokenKind` variants {:?} that are not covered \ - by either the SG-1a shared-operator bridge or `local_punct_*` rows. Every punctuation \ - kind must come from exactly one authority input so drift fails closed.", - missing_kinds - ); - rows.sort_by(|a, b| a.0.cmp(&b.0)); - rows -} - -fn collect_variant_labels(dag: &Dag, type_name: &str) -> Vec { - let decl = dag - .declarations() - .iter() - .find(|d| d.name.as_deref() == Some(type_name)) - .unwrap_or_else(|| panic!("missing `{type_name}` declaration")); - let TypeConnective::Disj { variants } = &decl.connective else { - panic!("`{type_name}`: expected Disj"); - }; - variants - .iter() - .map(|variant| variant.label.clone()) - .collect() -} - -fn keyword_spelling_for_token_kind(kind: &str) -> String { - kind.strip_prefix("Kw") - .unwrap_or_else(|| panic!("keyword token kind `{kind}` should start with `Kw`")) - .to_ascii_lowercase() -} - -// SG-1a operator bridge: shared operators still lower through raw-source reads. -// `v3_supported_dag_operators` is the single support/exclusion projection; this -// table only maps supported symbols to their current tokenizer variant. -enum SharedOperatorTokenizerBoundary { - Tokenized { kind: &'static str }, - ParserOnlyDebt { reason: &'static str }, -} - -fn classify_shared_operator_for_tokenizer( - pattern: &str, - v3_supported: &BTreeSet, -) -> SharedOperatorTokenizerBoundary { - if !v3_supported.contains(pattern) { - return SharedOperatorTokenizerBoundary::ParserOnlyDebt { - reason: "operator is declared in external dag_operators but excluded from \ - v3_supported_dag_operators until v3 parses it end-to-end", - }; - } - match pattern { - "==" => SharedOperatorTokenizerBoundary::Tokenized { kind: "EqEq" }, - "!=" => SharedOperatorTokenizerBoundary::Tokenized { kind: "NotEq" }, - "<" => SharedOperatorTokenizerBoundary::Tokenized { kind: "Lt" }, - "<=" => SharedOperatorTokenizerBoundary::Tokenized { kind: "Le" }, - ">" => SharedOperatorTokenizerBoundary::Tokenized { kind: "Gt" }, - ">=" => SharedOperatorTokenizerBoundary::Tokenized { kind: "Ge" }, - "+" => SharedOperatorTokenizerBoundary::Tokenized { kind: "Plus" }, - "-" => SharedOperatorTokenizerBoundary::Tokenized { kind: "Minus" }, - "*" => SharedOperatorTokenizerBoundary::Tokenized { kind: "Star" }, - "/" => SharedOperatorTokenizerBoundary::Tokenized { kind: "Slash" }, - "&&" => SharedOperatorTokenizerBoundary::Tokenized { kind: "AmpAmp" }, - "||" => SharedOperatorTokenizerBoundary::Tokenized { kind: "PipePipe" }, - "|>" => SharedOperatorTokenizerBoundary::Tokenized { kind: "PipeArrow" }, - "." => SharedOperatorTokenizerBoundary::Tokenized { kind: "Dot" }, - other => panic!( - "`v3_supported_dag_operators` includes `{other}`, but the SG-1a tokenizer bridge has \ - no TokenKind mapping for it. Add tokenizer/parser/operator support or remove it from \ - the v3 projection." - ), - } -} - -struct SharedSyntaxAuthority { - keywords: Vec, - operators: Vec, - v3_supported_operators: BTreeSet, -} - -impl SharedSyntaxAuthority { - fn from_authority(dag: &Dag, source: &str) -> Self { - let keywords = match data_body_named(dag, "dag_keyword_set") { - ValueBody::Map(entries) => entries - .entries() - .iter() - .map(|(key, _)| key.clone()) - .collect(), - other => panic!("dag_keyword_set: expected ValueBody::Map, got {other:?}"), - }; - let operators = parse_named_string_fields( - extract_balanced_section(source, "data dag_operators", '[', ']'), - "symbol", - ); - let v3_supported_operators: BTreeSet<_> = parse_all_string_literals( - extract_balanced_section(source, "data v3_supported_dag_operators", '{', '}'), - ) - .into_iter() - .collect(); - Self { - keywords, - operators, - v3_supported_operators, - } - } -} - -fn data_body_named<'a>(dag: &'a Dag, expected_name: &str) -> &'a ValueBody { - let decl = dag - .declarations() - .iter() - .find(|d| d.name.as_deref() == Some(expected_name)) - .unwrap_or_else(|| panic!("missing `{expected_name}` data in `{SHARED_SYNTAX_FILE}`")); - decl.value_body - .as_ref() - .unwrap_or_else(|| panic!("`{expected_name}` has no lowered value body")) -} - -fn extract_balanced_section<'a>(source: &'a str, anchor: &str, open: char, close: char) -> &'a str { - let anchor_idx = source - .find(anchor) - .unwrap_or_else(|| panic!("missing `{anchor}` in `{SHARED_SYNTAX_FILE}`")); - let tail = &source[anchor_idx..]; - let open_rel = tail - .find(open) - .unwrap_or_else(|| panic!("missing `{open}` after `{anchor}` in `{SHARED_SYNTAX_FILE}`")); - let start = anchor_idx + open_rel; - let mut depth = 0usize; - for (offset, ch) in source[start..].char_indices() { - if ch == open { - depth += 1; - } else if ch == close { - depth -= 1; - if depth == 0 { - return &source[start + open.len_utf8()..start + offset]; - } - } - } - panic!( - "unterminated `{}` section `{anchor}` in `{SHARED_SYNTAX_FILE}`", - open - ); -} - -fn parse_named_string_fields(section: &str, field_name: &str) -> Vec { - let needle = format!("{field_name}:"); - let mut out = Vec::new(); - let mut rest = section; - while let Some(idx) = rest.find(&needle) { - let after_field = &rest[idx + needle.len()..]; - let quote_idx = after_field.find('"').unwrap_or_else(|| { - panic!("missing string literal for `{field_name}` in `{SHARED_SYNTAX_FILE}`") - }); - let (value, consumed) = parse_string_literal(&after_field[quote_idx..]); - out.push(value); - rest = &after_field[quote_idx + consumed..]; - } - out -} - -fn parse_all_string_literals(section: &str) -> Vec { - let mut out = Vec::new(); - let mut rest = section; - while let Some(idx) = rest.find('"') { - let (value, consumed) = parse_string_literal(&rest[idx..]); - out.push(value); - rest = &rest[idx + consumed..]; - } - out -} - -fn parse_string_literal(source: &str) -> (String, usize) { - assert!( - source.starts_with('"'), - "string literal parser expects to start at a quote" - ); - let mut out = String::new(); - let mut escaped = false; - for (idx, ch) in source[1..].char_indices() { - if escaped { - out.push(ch); - escaped = false; - continue; - } - match ch { - '\\' => escaped = true, - '"' => return (out, idx + 2), - other => out.push(other), - } - } - panic!("unterminated string literal while parsing `{SHARED_SYNTAX_FILE}`"); -} - -fn extract_nullary_variant_field( - fields: &[(String, FieldValue)], - key: &str, - expected_type_name: &str, - dag: &Dag, -) -> String { - let fv = fields - .iter() - .find_map(|(k, v)| (k == key).then_some(v)) - .unwrap_or_else(|| panic!("missing field {key}")); - let FieldValue::Variant { - constructor, - payload, - } = fv - else { - panic!("field {key}: expected nullary variant value"); - }; - assert!( - payload.is_empty(), - "field {key}: expected nullary variant, got payload of len {}", - payload.len() - ); - - let expected_type_decl = dag - .declarations() - .iter() - .find(|d| d.name.as_deref() == Some(expected_type_name)) - .unwrap_or_else(|| panic!("missing `{expected_type_name}` declaration")); - let TypeConnective::Disj { variants } = &expected_type_decl.connective else { - panic!("`{expected_type_name}`: expected Disj"); - }; - variants - .iter() - .find(|field| field.ty == *constructor) - .map(|field| field.label.clone()) - .unwrap_or_else(|| { - panic!( - "field {key}: constructor id {:?} is not a variant of `{expected_type_name}`", - constructor - ) - }) -} - -fn assert_token_kind_variant_exists(dag: &Dag, label: &str, source_type_name: &str) { - let token_kind_decl = dag - .declarations() - .iter() - .find(|d| d.name.as_deref() == Some("TokenKind")) - .unwrap_or_else(|| panic!("missing `TokenKind` declaration")); - let TypeConnective::Disj { variants } = &token_kind_decl.connective else { - panic!("`TokenKind`: expected Disj"); - }; - assert!( - variants.iter().any(|field| field.label == label), - "`{source_type_name}` variant `{label}` has no matching `TokenKind` variant" - ); -} - -fn extract_string_field(fields: &[(String, FieldValue)], key: &str) -> String { - let fv = fields - .iter() - .find_map(|(k, v)| (k == key).then_some(v)) - .unwrap_or_else(|| panic!("missing field {key}")); - match fv { - FieldValue::Literal(LiteralBits::String(s)) => s.clone(), - _ => panic!("field {key}: expected string literal"), - } -} - -fn extract_int_field(fields: &[(String, FieldValue)], key: &str) -> i64 { - let fv = fields - .iter() - .find_map(|(k, v)| (k == key).then_some(v)) - .unwrap_or_else(|| panic!("missing field {key}")); - match fv { - FieldValue::Literal(LiteralBits::Int(s)) => s.parse::().unwrap_or_else(|_| { - panic!("field {key}: expected int literal decimal string, got {s:?}") - }), - _ => panic!("field {key}: expected int literal"), - } -} - -#[allow(clippy::too_many_arguments)] // Codegen: one projection bundle per `tokenize.dag` surface. -fn emit_tokenize_fn( - keywords: &[(String, String)], - line_comment_prefix: &str, - string_delim_byte: u8, - diag_unterm_esc: &str, - diag_unterm_lit: &str, - diag_int_pre: &str, - diag_int_suf: &str, - escapes: &[(u8, i64)], - ascii_scan_order: &[String], - minus_infix_only_after: &[String], -) -> String { - let ensure_classes = |required: &[&str]| { - for name in required { - assert!( - ascii_scan_order.iter().any(|class| class == name), - "`ascii_scan_order` in tokenize.dag missing `{name}`" - ); - } - }; - ensure_classes(&["Whitespace", "Digit", "IdentStart", "IdentContinue"]); - - let mut arms = String::new(); - for (spelling, kind) in keywords { - arms.push_str(&format!( - " \"{}\" => TokenKind::{},\n", - spelling, kind - )); - } - let line_comment_lit = rust_byte_string_literal(line_comment_prefix); - let diag_esc = rust_string_literal_for_rust_source(diag_unterm_esc); - let int_pre = rust_string_literal_for_rust_source(diag_int_pre); - let int_suf = rust_string_literal_for_rust_source(diag_int_suf); - let delim_lit = rust_byte_literal(string_delim_byte); - - let mut escape_arms = String::new(); - for (suf, cp) in escapes { - escape_arms.push_str(&format!( - " {} => content.push(core::char::from_u32({}_u32).unwrap()),\n", - rust_byte_literal(*suf), - cp - )); - } - - let mut s = String::new(); - s.push_str(&emit_minus_prefixed_decimal_allowed(minus_infix_only_after)); - s.push_str("pub fn tokenize(source: &str, file: &str) -> Result, Diagnostic> {\n"); - s.push_str(" let bytes = source.as_bytes();\n"); - s.push_str(" let mut pos: usize = 0;\n"); - s.push_str(" let mut tokens = Vec::new();\n\n"); - s.push_str(&format!( - " const LINE_COMMENT_PREFIX: &[u8] = {};\n", - line_comment_lit - )); - s.push_str(" while pos < bytes.len() {\n"); - s.push_str(" let byte = bytes[pos];\n\n"); - s.push_str(" let start = pos;\n\n"); - s.push_str( - " if byte == b'-'\n && bytes.get(pos + 1).is_some_and(|b| byte_matches(*b, ScannerCharClass::Digit))\n && minus_prefixed_decimal_allowed(tokens.last().map(|t: &Token| &t.kind))\n {\n", - ); - s.push_str(" let mut end = pos + 1;\n"); - s.push_str( - " while end < bytes.len() && byte_matches(bytes[end], ScannerCharClass::Digit) {\n", - ); - s.push_str(" end += 1;\n"); - s.push_str(" }\n"); - s.push_str(" let literal = &source[pos + 1..end];\n"); - s.push_str( - " let magnitude: u128 = literal.parse().map_err(|_| Diagnostic::TokenizerError {\n", - ); - s.push_str(&format!( - " message: format!(\"{{}}{{}}{{}}\", {}, literal, {}),\n", - int_pre, int_suf - )); - s.push_str(" span: SourceSpan::new(file, start as u32, end as u32),\n"); - s.push_str(" correction: crate::diagnostics::Correction::deferred_for_diagnostic_class(\"TokenizerError\"),\n"); - s.push_str(" })?;\n"); - s.push_str(" const MAX_SIGNED_ABS: u128 = 1u128 << 127;\n"); - s.push_str(" if magnitude > MAX_SIGNED_ABS {\n"); - s.push_str(" return Err(Diagnostic::TokenizerError {\n"); - s.push_str( - " message: format!(\"integer literal out of range for signed decimal literal: `-{}` (|m| > 2^127)\", literal),\n", - ); - s.push_str(" span: SourceSpan::new(file, start as u32, end as u32),\n"); - s.push_str(" correction: crate::diagnostics::Correction::deferred_for_diagnostic_class(\"TokenizerError\"),\n"); - s.push_str(" });\n"); - s.push_str(" }\n"); - s.push_str(" let value = if magnitude == 0 {\n"); - s.push_str(" \"0\".to_string()\n"); - s.push_str(" } else {\n"); - s.push_str(" format!(\"-{}\", magnitude)\n"); - s.push_str(" };\n"); - s.push_str(" tokens.push(Token {\n"); - s.push_str(" kind: TokenKind::IntLit(value),\n"); - s.push_str(" span: SourceSpan::new(file, start as u32, end as u32),\n"); - s.push_str(" });\n"); - s.push_str(" pos = end;\n"); - s.push_str(" continue;\n"); - s.push_str(" }\n\n"); - for class in ascii_scan_order { - if class == "Whitespace" { - s.push_str(" if byte_matches(byte, ScannerCharClass::Whitespace) {\n"); - s.push_str(" pos += 1;\n"); - s.push_str(" continue;\n"); - s.push_str(" }\n\n"); - } else if class == "Digit" { - s.push_str(" if byte_matches(byte, ScannerCharClass::Digit) {\n"); - s.push_str(" let mut end = pos;\n"); - s.push_str( - " while end < bytes.len() && byte_matches(bytes[end], ScannerCharClass::Digit) {\n", - ); - s.push_str(" end += 1;\n"); - s.push_str(" }\n"); - s.push_str(" let literal = &source[start..end];\n"); - s.push_str( - " let magnitude: u128 = literal.parse().map_err(|_| Diagnostic::TokenizerError {\n", - ); - s.push_str(&format!( - " message: format!(\"{{}}{{}}{{}}\", {}, literal, {}),\n", - int_pre, int_suf - )); - s.push_str(" span: SourceSpan::new(file, start as u32, end as u32),\n"); - s.push_str(" correction: crate::diagnostics::Correction::deferred_for_diagnostic_class(\"TokenizerError\"),\n"); - s.push_str(" })?;\n"); - s.push_str(" let value = magnitude.to_string();\n"); - s.push_str(" tokens.push(Token {\n"); - s.push_str(" kind: TokenKind::IntLit(value),\n"); - s.push_str(" span: SourceSpan::new(file, start as u32, end as u32),\n"); - s.push_str(" });\n"); - s.push_str(" pos = end;\n"); - s.push_str(" continue;\n"); - s.push_str(" }\n\n"); - } else if class == "IdentStart" { - s.push_str(" if byte_matches(byte, ScannerCharClass::IdentStart) {\n"); - s.push_str(" let mut end = pos;\n"); - s.push_str( - " while end < bytes.len() && byte_matches(bytes[end], ScannerCharClass::IdentContinue) {\n", - ); - s.push_str(" end += 1;\n"); - s.push_str(" }\n"); - s.push_str(" let text = &source[start..end];\n"); - s.push_str(" let kind = match text {\n"); - s.push_str(&arms); - s.push_str(" _ => TokenKind::Ident(text.to_string()),\n"); - s.push_str(" };\n"); - s.push_str(" tokens.push(Token {\n"); - s.push_str(" kind,\n"); - s.push_str(" span: SourceSpan::new(file, start as u32, end as u32),\n"); - s.push_str(" });\n"); - s.push_str(" pos = end;\n"); - s.push_str(" continue;\n"); - s.push_str(" }\n\n"); - } else if class == "IdentContinue" { - s.push_str(" if byte_matches(byte, ScannerCharClass::IdentContinue) {\n"); - s.push_str(" let mut end = pos;\n"); - s.push_str( - " while end < bytes.len() && byte_matches(bytes[end], ScannerCharClass::IdentContinue) {\n", - ); - s.push_str(" end += 1;\n"); - s.push_str(" }\n"); - s.push_str(" let text = &source[start..end];\n"); - s.push_str(" let kind = match text {\n"); - s.push_str(&arms); - s.push_str(" _ => TokenKind::Ident(text.to_string()),\n"); - s.push_str(" };\n"); - s.push_str(" tokens.push(Token {\n"); - s.push_str(" kind,\n"); - s.push_str(" span: SourceSpan::new(file, start as u32, end as u32),\n"); - s.push_str(" });\n"); - s.push_str(" pos = end;\n"); - s.push_str(" continue;\n"); - s.push_str(" }\n\n"); - } else { - panic!( - "unsupported scanner class `{}` in `ascii_scan_order`", - class - ); - } - } - s.push_str(" // Line comment prefix from `tokenize.dag` (`line_comment_prefix`).\n"); - s.push_str(" if bytes.len() >= pos + LINE_COMMENT_PREFIX.len()\n"); - s.push_str( - " && bytes[pos..pos + LINE_COMMENT_PREFIX.len()].eq(LINE_COMMENT_PREFIX)\n", - ); - s.push_str(" {\n"); - s.push_str(" pos += LINE_COMMENT_PREFIX.len();\n"); - s.push_str(" while pos < bytes.len() && bytes[pos] != b'\\n' {\n"); - s.push_str(" pos += 1;\n"); - s.push_str(" }\n"); - s.push_str(" continue;\n"); - s.push_str(" }\n\n"); - s.push_str(" if let Some((kind, width)) = punctuation_token(bytes, pos) {\n"); - s.push_str(" tokens.push(Token {\n"); - s.push_str(" kind,\n"); - s.push_str( - " span: SourceSpan::new(file, start as u32, (start + width) as u32),\n", - ); - s.push_str(" });\n"); - s.push_str(" pos += width;\n"); - s.push_str(" continue;\n"); - s.push_str(" }\n\n"); - s.push_str( - " // String literal (`string_literal_delimiter` + `StringEscapeSpec` rows).\n", - ); - s.push_str(&format!(" if byte == {} {{\n", delim_lit)); - s.push_str(" let mut end = pos + 1;\n"); - s.push_str(" let mut content = String::new();\n"); - s.push_str(" let mut terminated = false;\n"); - s.push_str(" while end < bytes.len() {\n"); - s.push_str(" match bytes[end] {\n"); - s.push_str(&format!(" {} => {{\n", delim_lit)); - s.push_str(" terminated = true;\n"); - s.push_str(" end += 1;\n"); - s.push_str(" break;\n"); - s.push_str(" }\n"); - s.push_str(" b'\\\\' => {\n"); - s.push_str(" let Some(escaped) = bytes.get(end + 1).copied() else {\n"); - s.push_str(" return Err(Diagnostic::TokenizerError {\n"); - s.push_str(&format!( - " message: {}.to_string(),\n", - diag_esc - )); - s.push_str(" span: SourceSpan::new(file, start as u32, (end + 1) as u32),\n"); - s.push_str(" correction: crate::diagnostics::Correction::deferred_for_diagnostic_class(\"TokenizerError\"),\n"); - s.push_str(" });\n"); - s.push_str(" };\n"); - s.push_str(" match escaped {\n"); - s.push_str(&escape_arms); - s.push_str(" other => {\n"); - s.push_str(" content.push('\\\\');\n"); - s.push_str(" content.push(other as char);\n"); - s.push_str(" }\n"); - s.push_str(" }\n"); - s.push_str(" end += 2;\n"); - s.push_str(" }\n"); - s.push_str(" other => {\n"); - s.push_str(" content.push(other as char);\n"); - s.push_str(" end += 1;\n"); - s.push_str(" }\n"); - s.push_str(" }\n"); - s.push_str(" }\n"); - s.push_str(" if !terminated {\n"); - s.push_str(" return Err(Diagnostic::TokenizerError {\n"); - s.push_str(&format!( - " message: {}.to_string(),\n", - rust_string_literal_for_rust_source(diag_unterm_lit) - )); - s.push_str(" span: SourceSpan::new(file, start as u32, end as u32),\n"); - s.push_str(" correction: crate::diagnostics::Correction::deferred_for_diagnostic_class(\"TokenizerError\"),\n"); - s.push_str(" });\n"); - s.push_str(" }\n"); - s.push_str(" tokens.push(Token {\n"); - s.push_str(" kind: TokenKind::StringLit(content),\n"); - s.push_str(" span: SourceSpan::new(file, start as u32, end as u32),\n"); - s.push_str(" });\n"); - s.push_str(" pos = end;\n"); - s.push_str(" continue;\n"); - s.push_str(" }\n\n"); - s.push_str(" return Err(Diagnostic::TokenizerError {\n"); - s.push_str(" message: format!(\"unexpected byte `{}`\", byte as char),\n"); - s.push_str(" span: SourceSpan::new(file, start as u32, (start + 1) as u32),\n"); - s.push_str(" correction: crate::diagnostics::Correction::deferred_for_diagnostic_class(\"TokenizerError\"),\n"); - s.push_str(" });\n"); - s.push_str(" }\n\n"); - s.push_str(" tokens.push(Token {\n"); - s.push_str(" kind: TokenKind::Eof,\n"); - s.push_str(" span: SourceSpan::new(file, bytes.len() as u32, bytes.len() as u32),\n"); - s.push_str(" });\n"); - s.push_str(" Ok(tokens)\n"); - s.push_str("}\n\n"); - s -} - -fn emit_punctuation_token(puncts: &[(String, String)]) -> String { - let mut two = Vec::new(); - let mut one = Vec::new(); - for (pat, kind) in puncts { - let bs: Vec = pat.bytes().collect(); - match bs.as_slice() { - [a, b] => two.push((*a, *b, kind.clone())), - [a] => one.push((*a, kind.clone())), - _ => panic!("unsupported punct width {} for {pat}", bs.len()), - }; - } - two.sort_by(|a, b| (a.0, a.1).cmp(&(b.0, b.1))); - one.sort_by_key(|x| x.0); - - let mut arms = String::new(); - for (a, b, kind) in &two { - arms.push_str(&format!( - " ({}, Some({})) => Some((TokenKind::{}, 2)),\n", - rust_byte_literal(*a), - rust_byte_literal(*b), - kind - )); - } - for (a, kind) in &one { - arms.push_str(&format!( - " ({}, _) => Some((TokenKind::{}, 1)),\n", - rust_byte_literal(*a), - kind - )); - } - arms.push_str(" _ => None,\n"); - - format!( - "fn punctuation_token(bytes: &[u8], pos: usize) -> Option<(TokenKind, usize)> {{\n\ - let first = bytes[pos];\n\ - let second = bytes.get(pos + 1).copied();\n\ - match (first, second) {{\n\ -{arms} }}\n\ -}}\n" - ) -} - -fn rust_byte_literal(b: u8) -> String { - match b { - b'\'' => "b'\\''".to_string(), - b'\\' => "b'\\\\'".to_string(), - _ => format!("b'{}'", b as char), - } -} diff --git a/src/v3/compiler/src/self_host_receipt_p0.rs b/src/v3/compiler/src/self_host_receipt_p0.rs deleted file mode 100644 index 8373644d405..00000000000 --- a/src/v3/compiler/src/self_host_receipt_p0.rs +++ /dev/null @@ -1,117 +0,0 @@ -//! P0 prerequisite pin: stable top-level JSON keys in `target/self_host/receipt.json`. -//! -//! Authority (workspace-root paths as code — not file-relative rustdoc URLs): -//! `docs/briefs/r3-pb-t-fixedpoint-worker.md` §P0 readiness checklist (DB-8 mechanical ratchet); -//! `docs/db-history/db-8.md`; `docs/design-fixed-point-ratchet.md`. -//! `self_host_fixed_point` consumes these identifiers so renames are deliberate (trend readers / DB-8). - -/// Pipeline snapshot fixed-point on [`crate::default_fixed_point_source`] (always `ok` when the binary runs past that stage). -pub const K_PIPELINE_FIXED_POINT_DEFAULT_SOURCE: &str = "pipeline_fixed_point_default_source"; - -/// `dsl/gunbc/compiler.dag` parse outcome under v3 (`ok` or encoded error string). -pub const K_COMPILER_DAG_V3_PARSE: &str = "compiler_dag_v3_parse"; - -/// Overall receipt status (`completed` or `failed_self_host_slice` today). -pub const K_STATUS: &str = "status"; - -/// Keys emitted on every path (parse failure still includes pipeline + parse + status). -pub const ALWAYS_EMITTED_TOP_LEVEL_KEYS: &[&str] = &[ - K_PIPELINE_FIXED_POINT_DEFAULT_SOURCE, - K_COMPILER_DAG_V3_PARSE, - K_STATUS, -]; - -/// Serialized top-level property opener emitted by `self_host_fixed_point` today -/// (`src/v3/compiler/src/bin/self_host_fixed_point.rs`, `run`): two ASCII spaces, `"`, key, `":` -/// — same shape as `format!(" \"{}\":"` / `format!(" \"{}\": {},\n", …` using -/// `K_PIPELINE_FIXED_POINT_DEFAULT_SOURCE`, `K_COMPILER_DAG_V3_PARSE`, and `K_STATUS` (and the -/// parse-error branch). If the emitter changes indentation or switches to `serde_json` pretty-print -/// with different spacing, update this needle in the same change. -/// -/// **Emitter anchors in `run` (search for `receipt_p0::K_` on `receipt`):** -/// 1. **Pipeline** — first field after `{`: `format!(..., K_PIPELINE_FIXED_POINT_DEFAULT_SOURCE)` with -/// a string literal value (`"ok"`). -/// 2. **`compiler_dag_v3_parse`** — `match` `Ok`: `format!(..., K_COMPILER_DAG_V3_PARSE)` + `"ok"`; `Err`: -/// `format!(..., K_COMPILER_DAG_V3_PARSE, json_string(&msg))`. -/// 3. **`status`** — last field before closing `}`: `format!(..., K_STATUS, json_string(exit_status))`. -/// -/// **False positives:** a `contains` needle could match inside a quoted JSON value; the fixed -/// snake_case P0 key names and the receipt's flat object shape keep that risk negligible for this -/// bounded DB-8 trend surface. -fn top_level_property_needle(key: &str) -> String { - let mut needle = String::with_capacity(key.len() + 8); - needle.push_str(" \""); - needle.push_str(key); - needle.push_str("\":"); - needle -} - -fn missing_always_emitted_key_properties(json_body: &str) -> Vec<&'static str> { - ALWAYS_EMITTED_TOP_LEVEL_KEYS - .iter() - .copied() - .filter(|key| !json_body.contains(&top_level_property_needle(key))) - .collect() -} - -/// Every [`ALWAYS_EMITTED_TOP_LEVEL_KEYS`] entry must appear as a top-level JSON property using -/// [`top_level_property_needle`]'s shape so the serialized receipt cannot drift from the P0 pin -/// without failing closed before `write_receipt`. Sole public entry point for this contract check. -pub fn validate_receipt_json_always_emitted_keys(json_body: &str) -> Result<(), String> { - let missing = missing_always_emitted_key_properties(json_body); - if missing.is_empty() { - Ok(()) - } else { - Err(format!( - "receipt.json missing always-emitted P0 keys: {}", - missing.join(", ") - )) - } -} - -#[cfg(test)] -mod tests { - use std::collections::HashSet; - - #[test] - fn always_emitted_keys_are_unique_nonempty() { - let mut seen = HashSet::new(); - for key in super::ALWAYS_EMITTED_TOP_LEVEL_KEYS { - assert!(!key.is_empty(), "empty key"); - assert!(seen.insert(*key), "duplicate key {key}"); - } - } - - #[test] - fn validate_accepts_minimal_receipt_shape() { - let body = r#"{ - "pipeline_fixed_point_default_source": "ok", - "compiler_dag_v3_parse": "ok", - "status": "completed" -} -"#; - super::validate_receipt_json_always_emitted_keys(body).unwrap(); - } - - #[test] - fn validate_rejects_missing_pipeline_key() { - let body = r#"{ - "compiler_dag_v3_parse": "ok", - "status": "completed" -} -"#; - let err = super::validate_receipt_json_always_emitted_keys(body).unwrap_err(); - assert!(err.contains("pipeline_fixed_point_default_source"), "{err}"); - } - - #[test] - fn validate_rejects_missing_status_key() { - let body = r#"{ - "pipeline_fixed_point_default_source": "ok", - "compiler_dag_v3_parse": "x", -} -"#; - let err = super::validate_receipt_json_always_emitted_keys(body).unwrap_err(); - assert!(err.contains("status"), "{err}"); - } -} diff --git a/src/v3/compiler/src/serialize_generated.rs b/src/v3/compiler/src/serialize_generated.rs deleted file mode 100644 index 03b089220e5..00000000000 --- a/src/v3/compiler/src/serialize_generated.rs +++ /dev/null @@ -1,210 +0,0 @@ -// AUTO-GENERATED from `src/v3/std/parse_surface.dag`. -// Regenerate instead of hand-editing. - -#[derive(Debug, Clone, PartialEq, Eq)] -pub struct DagDifference { - pub detail: String, -} - -pub fn serialize_dag(dag: &Dag) -> Vec { - let mut out = String::new(); - out.push_str(&format!( - "APPEND_BEGIN {}\n", - dag.post_bootstrap_declaration_append_begin() - )); - for declaration in dag.declarations() { - out.push_str(&format!( - "DECL {} {:?}\n", - declaration.id.raw(), - declaration - )); - } - for behavior in dag.nodes() { - out.push_str(&serialize_behavior(behavior)); - } - for port in dag.ports() { - out.push_str(&format!("PORT {} {:?}\n", port.id().raw(), port)); - } - let mut diagnostics: Vec<_> = dag.diagnostics().iter().collect(); - diagnostics.sort_by_key(|(port, _)| port.raw()); - for (port, diagnostic) in diagnostics { - out.push_str(&format!( - "DIAG port={} {}\n", - port.raw(), - render_diagnostic(diagnostic) - )); - } - out.into_bytes() -} - -pub fn first_difference(lhs: &Dag, rhs: &Dag) -> Option { - if lhs.post_bootstrap_declaration_append_begin() != rhs.post_bootstrap_declaration_append_begin() - { - return Some(DagDifference { - detail: format!( - "declaration append begin mismatch: pass1={}, pass2={}", - lhs.post_bootstrap_declaration_append_begin(), - rhs.post_bootstrap_declaration_append_begin(), - ), - }); - } - - let lhs_decls = lhs.declarations(); - let rhs_decls = rhs.declarations(); - if lhs_decls.len() != rhs_decls.len() { - return Some(DagDifference { - detail: format!( - "declaration count mismatch: pass1={}, pass2={}", - lhs_decls.len(), - rhs_decls.len() - ), - }); - } - for (left, right) in lhs_decls.iter().zip(rhs_decls.iter()) { - if format!("{left:?}") != format!("{right:?}") { - let name = left - .name - .as_deref() - .or(right.name.as_deref()) - .unwrap_or(""); - return Some(DagDifference { - detail: format!( - "declaration {} `{}` diverged: pass1=`{:?}`, pass2=`{:?}`", - left.id.raw(), - name, - left, - right - ), - }); - } - } - - let lhs_nodes = lhs.nodes(); - let rhs_nodes = rhs.nodes(); - if lhs_nodes.len() != rhs_nodes.len() { - return Some(DagDifference { - detail: format!( - "behavior count mismatch: pass1={}, pass2={}", - lhs_nodes.len(), - rhs_nodes.len() - ), - }); - } - for (left, right) in lhs_nodes.iter().zip(rhs_nodes.iter()) { - if format!("{left:?}") != format!("{right:?}") { - return Some(DagDifference { - detail: format!("behavior diverged: pass1=`{:?}`, pass2=`{:?}`", left, right), - }); - } - } - - let lhs_clusters = lhs.clusters(); - let rhs_clusters = rhs.clusters(); - if lhs_clusters.len() != rhs_clusters.len() { - return Some(DagDifference { - detail: format!( - "cluster count mismatch: pass1={}, pass2={}", - lhs_clusters.len(), - rhs_clusters.len() - ), - }); - } - for (left, right) in lhs_clusters.iter().zip(rhs_clusters.iter()) { - if format!("{left:?}") != format!("{right:?}") { - return Some(DagDifference { - detail: format!("cluster diverged: pass1=`{:?}`, pass2=`{:?}`", left, right), - }); - } - } - - let lhs_ports = lhs.ports(); - let rhs_ports = rhs.ports(); - if lhs_ports.len() != rhs_ports.len() { - return Some(DagDifference { - detail: format!( - "port count mismatch: pass1={}, pass2={}", - lhs_ports.len(), - rhs_ports.len() - ), - }); - } - for (left, right) in lhs_ports.iter().zip(rhs_ports.iter()) { - if format!("{left:?}") != format!("{right:?}") { - return Some(DagDifference { - detail: format!("port diverged: pass1=`{:?}`, pass2=`{:?}`", left, right), - }); - } - } - - let mut lhs_diags: Vec<_> = lhs.diagnostics().iter().collect(); - let mut rhs_diags: Vec<_> = rhs.diagnostics().iter().collect(); - lhs_diags.sort_by_key(|(port, _)| port.raw()); - rhs_diags.sort_by_key(|(port, _)| port.raw()); - if lhs_diags.len() != rhs_diags.len() { - return Some(DagDifference { - detail: format!( - "diagnostic count mismatch: pass1={}, pass2={}", - lhs_diags.len(), - rhs_diags.len() - ), - }); - } - for ((left_port, left_diag), (right_port, right_diag)) in lhs_diags.iter().zip(rhs_diags.iter()) - { - let left = format!( - "DIAG port={} {}", - left_port.raw(), - render_diagnostic(left_diag) - ); - let right = format!( - "DIAG port={} {}", - right_port.raw(), - render_diagnostic(right_diag) - ); - if left != right { - return Some(DagDifference { - detail: format!("diagnostic diverged: pass1=`{left}`, pass2=`{right}`"), - }); - } - } - - let mut lhs_optional_match_disjs: Vec<_> = lhs.optional_match_disjs().iter().collect(); - let mut rhs_optional_match_disjs: Vec<_> = rhs.optional_match_disjs().iter().collect(); - lhs_optional_match_disjs.sort_by_key(|(key, _)| key.raw()); - rhs_optional_match_disjs.sort_by_key(|(key, _)| key.raw()); - if lhs_optional_match_disjs.len() != rhs_optional_match_disjs.len() { - return Some(DagDifference { - detail: format!( - "optional_match_disjs count mismatch: pass1={}, pass2={}", - lhs_optional_match_disjs.len(), - rhs_optional_match_disjs.len() - ), - }); - } - for ((left_key, left_value), (right_key, right_value)) in lhs_optional_match_disjs - .iter() - .zip(rhs_optional_match_disjs.iter()) - { - if left_key != right_key || left_value != right_value { - return Some(DagDifference { - detail: format!( - "optional_match_disjs diverged: pass1=`({}, {})`, pass2=`({}, {})`", - left_key.raw(), - left_value.raw(), - right_key.raw(), - right_value.raw() - ), - }); - } - } - - None -} - -fn serialize_behavior(behavior: &Behavior) -> String { - format!("BEHAV {:?}\n", behavior) -} - -fn render_diagnostic(diagnostic: &Diagnostic) -> String { - format!("{diagnostic:?}") -} diff --git a/src/v3/compiler/src/test_runner.rs b/src/v3/compiler/src/test_runner.rs deleted file mode 100644 index 320c5cf8c92..00000000000 --- a/src/v3/compiler/src/test_runner.rs +++ /dev/null @@ -1,8144 +0,0 @@ -use std::collections::BTreeSet; -use std::io::Write; -use std::process::{Command, Stdio}; -use std::time::{Duration, Instant}; - -use crate::cementing_dispatch; -use crate::dag::{ - AtomPayload, Behavior, BindNode, Dag, Declaration, DeclarationId, FieldValue, LiteralBits, - NodeId, ParallelismUnsupportedKind, Path, PortId, PortState, SymbolicCost, TypeConnective, - ValueBody, WorkflowIdempotencyReport, WorkflowParallelismReport, -}; -use crate::diagnostics::Diagnostic; -use crate::emit::python_target::last_emit_python_program_top_level_value_bind_name; -use crate::emit::rust_target::last_emit_rust_program_top_level_value_bind_name; -use crate::emit::{emit_go_text, emit_python_text, last_emit_go_program_top_level_value_bind_name}; -use crate::evaluator::{ - evaluate_body, EvalError, EvalFrame, EvalStateStack, EvalStrategy, InputEvaluationOrder, Value, -}; -use crate::generated_files::GENERATED_FILES; -use crate::infer::type_shapes_equivalent; -use crate::lens_cost::{cost_of, CostLookup}; -use crate::lens_cost_symbolic::{symbolic_cost_lookup, SymbolicCostLookup}; -use crate::lens_cost_target_realization::type_realization_meta; -use crate::lens_declaration_apply::{ - apply_lens_declaration, field_value_from_value_body, int_associativity_holds_all_triples, - int_identity_witness_holds, reflect_program_dag_nodes_in_file, ASSOCIATIVITY_WITNESS_TRIPLES, - COMMUTATIVITY_WITNESS_PAIRS, IDENTITY_WITNESS_CANDIDATES, IDENTITY_WITNESS_SAMPLES, -}; -use crate::lens_effect_enumeration::{enumerate_effects, TransactionalPattern}; -use crate::lens_provenance::{origin_of, Origin}; -use crate::lens_structural_resolution; -use crate::lens_unused_parameters::{UnusedParametersConfig, UnusedParametersLens}; -use crate::types::TypeShape; -use crate::{ - analyze_parallelism, analyze_symbolic_cost_dimension, analyze_workflow, - compare_stage_snapshots, compile_stage_snapshots, compile_to_dag, default_fixed_point_source, - CompileError, DimensionReport, -}; - -const SG0_CENSUS_SOURCE: &str = include_str!(concat!( - env!("CARGO_MANIFEST_DIR"), - "/tests/integration/self_gen0_census_test.rs" -)); -const INFER_HELPERS_SOURCE: &str = include_str!(concat!( - env!("CARGO_MANIFEST_DIR"), - "/../lenses/infer_helpers.dag" -)); - -/// `.dag` path for [`TestPredicate::SubstrateResearchDeferredClaim`] (TC1 / R2 substrate research). -/// The runner fail-closes unless the `TestClaim` is declared in this fixture file. -const TC1_SUBSTRATE_LENS_ETA_DEFERRED_FIXTURE: &str = - "src/v3/compiler/tests/fixtures/tc1_substrate_lens_eta_equivalence_deferred.dag"; - -/// §1.8 gate #11 — canonical `TestClaim.name` for TC1 η-equivalence executable slice. -const TC1_ETA_EQUIVALENCE_EXECUTABLE_CLAIM: &str = "tc1_eta_equivalence_executable"; - -/// `TestClaim.source` programs must expose these 0-arity entry binds for the runner to locate -/// workflow roots (`analyze_symbolic_cost_dimension` per Path A / E6-G1.a static representative). -const TC1_ETA_EXECUTABLE_DIRECT_ENTRY: &str = "tc1_eta_exec_direct"; -const TC1_ETA_EXECUTABLE_ETA_ENTRY: &str = "tc1_eta_exec_eta_expanded"; - -/// Fixture suffix for [`TC1_ETA_EQUIVALENCE_EXECUTABLE_CLAIM`] — fail-closed vs stray reuse of the -/// canonical claim name outside the strict-fire module. -const TC1_SUBSTRATE_LENS_ETA_STRICT_FIRE_FIXTURE_SUFFIX: &str = - "tc1_substrate_lens_eta_equivalence_strict_fire.dag"; - -/// R3 gate #12 strict-fire (`tc2_church_rosser_strict_fire.dag`): `BinaryDimensionReportEquals` -/// payload must reference these **fixture-local** `DimensionReport` role declarations (not -/// the deferred `tc2_leftfirst_strategy_dimension_report` names) so routing is keyed off declared -/// predicate edges per INVARIANTS P2. -const TC2_CHURCH_ROSSER_STRICT_FIRE_LEFT_REPORT: &str = - "tc2_church_rosser_strict_fire_left_dimension_report"; -const TC2_CHURCH_ROSSER_STRICT_FIRE_RIGHT_REPORT: &str = - "tc2_church_rosser_strict_fire_right_dimension_report"; - -/// R3 §1.8 gate #13 — canonical `TestClaim.name` for the TC3 Pattern-A second-mover executable. -const TC3_PATTERN_A_SECOND_MOVER_EXECUTABLE_CLAIM: &str = "tc3_pattern_a_second_mover_executable"; - -/// `TC3_PATTERN_A_*_REPORT`: fixture-local `DimensionReport` role declarations (carrier `Dag` -/// per Q-Reification Option A) the runner pattern-matches to dispatch the gate-#13 executable -/// arm. Names mirror `tc3_strong_normalization_strict_fire.dag` lines 41-42. -const TC3_PATTERN_A_BASELINE_REPORT: &str = "tc3_evaluation_step_baseline_dimension_report"; -const TC3_PATTERN_A_COMPARE_REPORT: &str = "tc3_evaluation_step_compare_dimension_report"; - -/// Dimension-name keys for the TC3 second-mover bounded-runner reports. Distinct strings so the -/// equivalence check sees a non-vacuous projection-pair (baseline eval-step vs compare / -/// termination-evidence projection). -const TC3_PATTERN_A_BASELINE_DIMENSION_NAME: &str = "tc3_pattern_a_second_mover:eval_step:baseline"; -const TC3_PATTERN_A_COMPARE_DIMENSION_NAME: &str = "tc3_pattern_a_second_mover:eval_step:compare"; - -/// R3 gate #43 (`LensOutputEquals` witness in `r3_free_consequences_first_batch.dag`). -/// -/// Compared as `Some(R3_PARALLEL_EMIT_WITNESS_LENS_NAME)` — **not** `Some("…")` inline — so -/// `canonical_lens_name_dispatch_arms_pinned` does not treat this as a new string-literal name -/// dispatch arm on the canonical lens bridge (see disposition: -/// `docs/briefs/r2-pb-canonical-lens-bridge-disposition.md`). -const R3_PARALLEL_EMIT_WITNESS_LENS_NAME: &str = "r3_auto_parallelism_parallel_emit_witness"; - -/// R3 gate #45 (`LensOutputEquals` witness in `r3_free_consequences_first_batch.dag`). -/// -/// Compared as `Some(R3_BRANCH_ARMS_SERIALIZE_WITNESS_LENS_NAME)` — **not** `Some("…")` inline — -/// so `canonical_lens_name_dispatch_arms_pinned` does not treat this as a new string-literal name -/// dispatch arm on the canonical lens bridge. -const R3_BRANCH_ARMS_SERIALIZE_WITNESS_LENS_NAME: &str = - "r3_auto_parallelism_branch_arms_serialize_witness"; - -/// R3 gate #50 (`LensOutputEquals` witness in `r3_free_consequences_first_batch.dag`). -/// -/// A one-shot pure call may emit a direct call / inlined expression, but must not introduce -/// memoization scaffolding. Repeated-call caching remains deferred to the purity+cost lens -/// composition producer. -const R3_ONE_SHOT_NO_MEMO_WITNESS_LENS_NAME: &str = "r3_auto_memoization_one_shot_no_cache_witness"; -// L5 scaffold: this duplicates the fixture marker type names until -// `std.verification.ForAllTargets` carries a typed target/toolchain edge set. -const L5_REQUIRED_TOOLCHAINS: &[&str] = - &["L5RustcToolchain", "L5Python3Toolchain", "L5GoToolchain"]; - -/// Host-written forward fold for structural depth costs (see `src/v3/lenses/complexity.dag`). -/// -/// T-LaneE `DifferentialEquals` compares this receipt to [`crate::lens_cost::cost_of`] (emit output -/// from the same `.dag`). The implementations are **independently maintained** so the gate can -/// fail if the generator drifts from the spec (P3 / api-review #764). -/// -/// D1 `apply_lens_declaration` on canonical `cost_of` is **not** used: lowering that lens -/// introduces substrate `Loop` for list recursion, and [`crate::lens_declaration_apply::EvalCtx::eval_loop`] -/// returns [`crate::lens_declaration_apply::LensApplyError::UnimplementedLoopBound`] until iteration semantics -/// land. **Dissolution:** delete this host mirror once D1 can interpret those `Loop` nodes and route -/// `v3_program_cost` through `apply_lens_declaration` on `cost_of`. -type LaneEHostCostAcc = Vec<(PortId, CostLookup)>; - -fn lane_e_host_forward_cost_of(dag: &Dag, port: &PortId) -> CostLookup { - lane_e_host_lookup_cost(&lane_e_host_compute_costs(dag.nodes()), port) -} - -fn lane_e_host_compute_costs(nodes: &[Behavior]) -> LaneEHostCostAcc { - // Prepend via `insert(0, …)` matches `complexity_lens_generated` cons order so `lane_e_host_lookup_cost` - // agrees with emit (first match wins; order only matters if duplicate ports shadow). Do not - // reorder without a parity check — delete this receipt once D1 runs canonical `cost_of`. - let mut acc = lane_e_host_seed_bind_params(nodes); - for behavior in nodes { - let entry = lane_e_host_entry_for(&acc, behavior); - acc.insert(0, entry); - } - acc -} - -fn lane_e_host_seed_bind_params(nodes: &[Behavior]) -> LaneEHostCostAcc { - match nodes { - [] => Vec::new(), - [head, tail @ ..] => { - let mut left = lane_e_host_params_of(head); - left.extend(lane_e_host_seed_bind_params(tail)); - left - } - } -} - -fn lane_e_host_params_of(behavior: &Behavior) -> LaneEHostCostAcc { - match behavior { - Behavior::Value(_) | Behavior::Transform(_) | Behavior::Branch(_) | Behavior::Loop(_) => { - Vec::new() - } - Behavior::Bind(bind) => lane_e_host_param_entries(&bind.params), - } -} - -fn lane_e_host_param_entries(params: &[PortId]) -> LaneEHostCostAcc { - match params { - [] => Vec::new(), - [head, tail @ ..] => { - let mut list = lane_e_host_param_entries(tail); - list.insert(0, (*head, CostLookup::Hit(0))); - list - } - } -} - -fn lane_e_host_entry_for(acc: &LaneEHostCostAcc, behavior: &Behavior) -> (PortId, CostLookup) { - match behavior { - Behavior::Value(v) => (v.result_port(), CostLookup::Hit(0)), - Behavior::Transform(t) => ( - t.result_port(), - lane_e_host_add_one(&lane_e_host_sum_costs(acc, &t.inputs)), - ), - Behavior::Branch(b) => ( - b.result_port(), - lane_e_host_add_one(&lane_e_host_add_cost( - &lane_e_host_lookup_cost(acc, &b.input), - &lane_e_host_max_path_cost(acc, &b.paths), - )), - ), - Behavior::Loop(l) => ( - l.result_port(), - lane_e_host_add_one(&lane_e_host_add_cost( - &lane_e_host_lookup_cost(acc, &l.source), - &lane_e_host_lookup_cost(acc, &l.init), - )), - ), - Behavior::Bind(bind) => { - let rp = bind.result_port(); - (rp, lane_e_host_lookup_cost(acc, &rp)) - } - } -} - -fn lane_e_host_sum_costs(acc: &LaneEHostCostAcc, ports: &[PortId]) -> CostLookup { - ports.iter().fold(CostLookup::Hit(0), |sum, port_id| { - lane_e_host_add_cost(&sum, &lane_e_host_lookup_cost(acc, port_id)) - }) -} - -fn lane_e_host_max_path_cost(acc: &LaneEHostCostAcc, paths: &[Path]) -> CostLookup { - paths.iter().fold(CostLookup::Hit(0), |best, path| { - lane_e_host_max_cost(&best, &lane_e_host_lookup_cost(acc, &path.output)) - }) -} - -fn lane_e_host_lookup_cost(acc: &[(PortId, CostLookup)], port_id: &PortId) -> CostLookup { - match acc.split_first() { - None => CostLookup::Miss, - Some(((port, cost), tail)) => { - if port == port_id { - cost.clone() - } else { - lane_e_host_lookup_cost(tail, port_id) - } - } - } -} - -fn lane_e_host_add_one(c: &CostLookup) -> CostLookup { - match c { - CostLookup::Miss => CostLookup::Miss, - CostLookup::Hit(n) => CostLookup::Hit(n + 1), - } -} - -fn lane_e_host_add_cost(a: &CostLookup, b: &CostLookup) -> CostLookup { - match a { - CostLookup::Miss => CostLookup::Miss, - CostLookup::Hit(x) => match b { - CostLookup::Miss => CostLookup::Miss, - CostLookup::Hit(y) => CostLookup::Hit(*x + *y), - }, - } -} - -fn lane_e_host_max_cost(a: &CostLookup, b: &CostLookup) -> CostLookup { - match a { - CostLookup::Miss => CostLookup::Miss, - CostLookup::Hit(x) => match b { - CostLookup::Miss => CostLookup::Miss, - CostLookup::Hit(y) => CostLookup::Hit((*x).max(*y)), - }, - } -} - -/// T-LaneE `DifferentialEquals` cost lineage: **v3** = host forward fold (spec mirror above); -/// **v2** = Rust-generated [`cost_of`] (`complexity_lens_generated`). -fn eval_lane_e_differential_cost_lineage( - lineage_name: &str, - program_dag: &Dag, - bind_port: PortId, -) -> Result { - match lineage_name { - "v3_program_cost" => Ok(lane_e_host_forward_cost_of(program_dag, &bind_port)), - "v2_oracle_cost" => Ok(cost_of(program_dag, &bind_port)), - _ => Err(format!( - "unsupported lineage `{lineage_name}` for T-LaneE `DifferentialEquals` cost (expected `v3_program_cost` or `v2_oracle_cost`)" - )), - } -} - -fn w1_parse_single_int_stdout_carve_out(stdout: &str) -> Result { - let trimmed = stdout.trim(); - if trimmed.is_empty() { - return Err( - "W1 rust_emit_output: empty stdout after trim (transitional Int-only stdout parse \ - carve-out authorized for slice-1 only; dissolution: substrate `ProgramObservation` \ - + observation-channel / `ValueKind` per `docs/briefs/r3-pr-e8-w1-output-producer-contract-blocker.md`)" - .to_string(), - ); - } - let parts: Vec<&str> = trimmed.split_whitespace().collect(); - if parts.len() != 1 { - return Err(format!( - "W1 rust_emit_output: stdout must be exactly one integer token (transitional carve-out); \ - got {parts:?} (dissolution: typed observation channel + `ValueKind`)" - )); - } - parts[0].parse::().map_err(|_| { - format!( - "W1 rust_emit_output: stdout token `{}` is not a valid i64 (transitional Int-only carve-out)", - parts[0] - ) - }) -} - -/// RAII guard: delete the W1 rustc scratch directory on return or panic (best-effort `remove_dir_all`). -struct W1RustEmitScratchGuard { - dir: std::path::PathBuf, -} - -impl W1RustEmitScratchGuard { - fn new(dir: std::path::PathBuf) -> Self { - Self { dir } - } -} - -impl Drop for W1RustEmitScratchGuard { - fn drop(&mut self) { - let _ = std::fs::remove_dir_all(&self.dir); - } -} - -fn w1_rust_emit_output_int( - program_dag: &Dag, - output_bind: &BindNode, - claim_file: &str, -) -> Result { - // **Transitional producer identity (contract 1):** only the spelling `rust_emit_output` is - // accepted at the `DifferentialEquals` subject/oracle `DeclarationRef` site, fail-closed - // elsewhere in `eval_differential_equals`. **Dissolution:** substrate producer-role markers - // replace name-keyed recognition (`docs/briefs/r3-pr-e8-w1-output-producer-contract-blocker.md`). - let last_bind = match last_emit_rust_program_top_level_value_bind_name(program_dag) { - Ok(Some(name)) => name, - Ok(None) => { - return Err( - "W1 rust_emit_output: compiled program has no top-level value binds (emit_rust program \ - mode requires at least one); dissolution: PB-Runtime-generated target-language tests" - .to_string(), - ); - } - Err(e) => { - return Err(format!( - "W1 rust_emit_output: cannot resolve emit-rust print target (same `RealizationIndexes` \ - path as `emit_rust_with_mode`): {e:?}" - )); - } - }; - if last_bind != output_bind.name { - return Err(format!( - "W1 rust_emit_output: `ProgramOutputBind.output_ref` must name the **last** top-level \ - value bind after `source_filtering` (same bind `emit_rust` program-mode `main` prints; \ - see `last_emit_rust_program_top_level_value_bind_name`) — expected `{last_bind}`, got `{}` \ - (claim file `{claim_file}`; transitional coupling; dissolution: PB-Runtime harness + typed \ - observation channel)", - output_bind.name - )); - } - let rust_src = std::thread::scope(|s| -> Result { - let handle = std::thread::Builder::new() - .stack_size(8 * 1024 * 1024) - .spawn_scoped(s, || crate::emit_rust::emit_rust(program_dag)) - .map_err(|e| format!("W1 rust_emit_output: spawn emit worker: {e}"))?; - let joined = handle - .join() - .map_err(|_| "W1 rust_emit_output: emit worker panicked".to_string())?; - joined.map_err(|e| { - format!( - "W1 rust_emit_output: emit_rust failed (use #1485-approved `emit_rust` / `emit_rust_with_mode` path only; dissolution: PB-Runtime-generated tests): {e:?}" - ) - }) - })?; - let stamp = std::time::SystemTime::now() - .duration_since(std::time::UNIX_EPOCH) - .map(|d| d.as_nanos()) - .unwrap_or(0); - let scratch = std::env::temp_dir().join(format!( - "gunbc_w1_rust_emit_{}_{}", - std::process::id(), - stamp - )); - std::fs::create_dir_all(&scratch).map_err(|e| { - format!( - "W1 rust_emit_output: create scratch dir {}: {e}", - scratch.display() - ) - })?; - let _scratch_guard = W1RustEmitScratchGuard::new(scratch.clone()); - let src_path = scratch.join("main.rs"); - let bin_path = scratch.join("w1_emit_eval_out"); - let mut file = std::fs::File::create(&src_path) - .map_err(|e| format!("W1 rust_emit_output: create {}: {e}", src_path.display()))?; - file.write_all(rust_src.as_bytes()) - .map_err(|e| format!("W1 rust_emit_output: write {}: {e}", src_path.display()))?; - - let mut rustc = Command::new("rustc"); - // Same stable-toolchain contract as boundary rustc harnesses (strip bootstrap leakage). - // Wall-bounded `spawn` + pipe drain (not `status()` / not unbounded `output()`): piped stderr - // can stall `rustc`; a wedged compile must fail-closed like [`EXECUTE_COMMAND_WALL_TIMEOUT`]. - rustc - .env_remove("RUSTC_BOOTSTRAP") - .arg("--edition=2021") - .arg(&src_path) - .arg("-o") - .arg(&bin_path); - let compile_out = crate::bounded_host_command::host_command_output( - "W1 rust_emit_output: rustc", - EXECUTE_COMMAND_WALL_TIMEOUT, - crate::bounded_host_command::prepare_host_command(rustc), - )?; - if !compile_out.status.success() { - let stderr = String::from_utf8_lossy(&compile_out.stderr); - let stdout = String::from_utf8_lossy(&compile_out.stdout); - return Err(format!( - "W1 rust_emit_output: rustc failed (exit {:?}); rustc stdout:\n{}\nrustc stderr:\n{}; \ - dissolution: PB-Runtime owns compilation policy for generated tests", - compile_out.status.code(), - stdout.trim_end(), - stderr.trim_end(), - )); - } - let run = crate::bounded_host_command::host_command_output( - "W1 rust_emit_output: emitted binary", - EXECUTE_COMMAND_WALL_TIMEOUT, - crate::bounded_host_command::prepare_host_command(Command::new(&bin_path)), - )?; - if !run.status.success() { - let stderr = String::from_utf8_lossy(&run.stderr); - let stdout = String::from_utf8_lossy(&run.stdout); - return Err(format!( - "W1 rust_emit_output: emitted Rust binary exited with {:?}; stdout:\n{}\nstderr:\n{}; \ - dissolution: PB-Runtime-generated tests own exit-status / stdio policy", - run.status.code(), - stdout.trim_end(), - stderr.trim_end(), - )); - } - w1_parse_single_int_stdout_carve_out(&String::from_utf8_lossy(&run.stdout)) -} - -fn w1_dag_eval_output_int(program_dag: &Dag, output_bind: &BindNode) -> Result { - // **Dissolution:** `dag_eval_output` collapses into PR-B eager evaluation + witness construction - // (`docs/briefs/r2-pr-b-2-runner-extension-bundle.md`); this arm is the first runner bridge only. - if !output_bind.params.is_empty() { - return Err(format!( - "W1 dag_eval_output: bind `{}` must be a top-level value bind (empty `params`); got callable-shaped bind", - output_bind.name - )); - } - let producer = program_dag - .resolve_producer_opt(&output_bind.value) - .ok_or_else(|| { - format!( - "W1 dag_eval_output: bind `{}` value port has no producer node in compiled program Dag", - output_bind.name - ) - })?; - let entry = producer.id(); - let strategy = crate::evaluator::EvalStrategy::ApplicativeOrder { - input_order: crate::evaluator::InputEvaluationOrder::LeftFirst, - }; - let mut state = - crate::evaluator::EvalStateStack::with_root_frame(crate::evaluator::EvalFrame::empty()); - let value = crate::evaluator::evaluate_body(program_dag, entry, &mut state, strategy) - .map_err(|e| { - format!( - "W1 dag_eval_output: `evaluate_body` / `eval_node` error on bind `{}` (no-memo eager `ApplicativeOrder` / `LeftFirst` at call site per #1485 fire criteria): {e:?}", - output_bind.name - ) - })?; - match &value { - crate::evaluator::Value::LiteralValue(LiteralBits::Int(s)) => s.parse::().map_err(|_| { - format!( - "W1 dag_eval_output: Int literal is not a valid i64 decimal string for bind `{}`", - output_bind.name - ) - }), - other => Err(format!( - "W1 dag_eval_output: only `Value::LiteralValue(Int)` is supported for slice-1 Int parity \ - (transitional debt; dissolution: substrate `ValueKind` widening + observation normalization): {other:?}" - )), - } -} - -fn w1_differential_equals_lineage_int( - lineage: &str, - program_dag: &Dag, - output_bind: &BindNode, - claim_file: &str, -) -> Result { - match lineage { - "rust_emit_output" => w1_rust_emit_output_int(program_dag, output_bind, claim_file), - "dag_eval_output" => w1_dag_eval_output_int(program_dag, output_bind), - _ => Err(format!( - "W1 internal error: unknown lineage `{lineage}` (expected rust_emit_output or dag_eval_output)" - )), - } -} - -fn l5_parse_single_int_stdout_carve_out(target: &str, stdout: &str) -> Result { - w1_parse_single_int_stdout_carve_out(stdout) - .map_err(|msg| msg.replace("W1 rust_emit_output", &format!("L5 {target}_emit_output"))) -} - -fn l5_target_scratch(label: &str) -> Result<(std::path::PathBuf, W1RustEmitScratchGuard), String> { - let stamp = std::time::SystemTime::now() - .duration_since(std::time::UNIX_EPOCH) - .map(|d| d.as_nanos()) - .unwrap_or(0); - let scratch = - std::env::temp_dir().join(format!("gunbc_l5_{label}_{}_{}", std::process::id(), stamp)); - std::fs::create_dir_all(&scratch) - .map_err(|e| format!("L5 {label}: create scratch dir {}: {e}", scratch.display()))?; - let guard = W1RustEmitScratchGuard::new(scratch.clone()); - Ok((scratch, guard)) -} - -fn l5_rust_emit_output_int(program_dag: &Dag, claim_file: &str) -> Result { - // Match the W1 Rust emitter path: `emit_rust` can recurse deeply on generated programs, while - // the Python/Go text emitters are currently shallow enough to run on the caller stack. - let rust_src = std::thread::scope(|s| -> Result { - let handle = std::thread::Builder::new() - .stack_size(8 * 1024 * 1024) - .spawn_scoped(s, || crate::emit_rust::emit_rust(program_dag)) - .map_err(|e| format!("L5 rust_emit_output: spawn emit worker: {e}"))?; - let joined = handle - .join() - .map_err(|_| "L5 rust_emit_output: emit worker panicked".to_string())?; - joined.map_err(|e| format!("L5 rust_emit_output: emit_rust failed: {e:?}")) - })?; - let (scratch, _scratch_guard) = l5_target_scratch("rust_emit_output")?; - let src_path = scratch.join("main.rs"); - let bin_path = scratch.join("l5_emit_out"); - let mut file = std::fs::File::create(&src_path) - .map_err(|e| format!("L5 rust_emit_output: create {}: {e}", src_path.display()))?; - file.write_all(rust_src.as_bytes()) - .map_err(|e| format!("L5 rust_emit_output: write {}: {e}", src_path.display()))?; - crate::post_emit_verifier::verify_emitted_source_file( - program_dag, - crate::emit::EmitTarget::Rust, - &src_path, - ) - .map_err(|e| format!("L5 rust_emit_output: {e}"))?; - - let mut rustc = Command::new("rustc"); - rustc - .env_remove("RUSTC_BOOTSTRAP") - .arg("--edition=2021") - .arg(&src_path) - .arg("-o") - .arg(&bin_path); - let compile_out = crate::bounded_host_command::host_command_output( - "L5 rust_emit_output: rustc", - EXECUTE_COMMAND_WALL_TIMEOUT, - crate::bounded_host_command::prepare_host_command(rustc), - )?; - if !compile_out.status.success() { - return Err(format!( - "L5 rust_emit_output: rustc failed for claim file `{claim_file}` (exit {:?}); stdout:\n{}\nstderr:\n{}", - compile_out.status.code(), - String::from_utf8_lossy(&compile_out.stdout).trim_end(), - String::from_utf8_lossy(&compile_out.stderr).trim_end() - )); - } - let run = crate::bounded_host_command::host_command_output( - "L5 rust_emit_output: emitted binary", - EXECUTE_COMMAND_WALL_TIMEOUT, - crate::bounded_host_command::prepare_host_command(Command::new(&bin_path)), - )?; - if !run.status.success() { - return Err(format!( - "L5 rust_emit_output: emitted Rust binary exited with {:?}; stdout:\n{}\nstderr:\n{}", - run.status.code(), - String::from_utf8_lossy(&run.stdout).trim_end(), - String::from_utf8_lossy(&run.stderr).trim_end() - )); - } - l5_parse_single_int_stdout_carve_out("rust", &String::from_utf8_lossy(&run.stdout)) -} - -fn l5_python_emit_output_int(program_dag: &Dag) -> Result { - let python_src = emit_python_text(program_dag) - .map_err(|e| format!("L5 python_emit_output: emit_python failed: {e:?}"))?; - let (scratch, _scratch_guard) = l5_target_scratch("python_emit_output")?; - let src_path = scratch.join("main.py"); - let mut file = std::fs::File::create(&src_path) - .map_err(|e| format!("L5 python_emit_output: create {}: {e}", src_path.display()))?; - file.write_all(python_src.as_bytes()) - .map_err(|e| format!("L5 python_emit_output: write {}: {e}", src_path.display()))?; - crate::post_emit_verifier::verify_emitted_source_file( - program_dag, - crate::emit::EmitTarget::Python, - &src_path, - ) - .map_err(|e| format!("L5 python_emit_output: {e}"))?; - let mut run_cmd = Command::new("python3"); - run_cmd.arg(&src_path); - let run = crate::bounded_host_command::host_command_output( - "L5 python_emit_output: python3", - EXECUTE_COMMAND_WALL_TIMEOUT, - crate::bounded_host_command::prepare_host_command(run_cmd), - )?; - if !run.status.success() { - return Err(format!( - "L5 python_emit_output: python3 exited with {:?}; stdout:\n{}\nstderr:\n{}", - run.status.code(), - String::from_utf8_lossy(&run.stdout).trim_end(), - String::from_utf8_lossy(&run.stderr).trim_end() - )); - } - l5_parse_single_int_stdout_carve_out("python", &String::from_utf8_lossy(&run.stdout)) -} - -fn l5_go_emit_output_int(program_dag: &Dag) -> Result { - let go_src = emit_go_text(program_dag) - .map_err(|e| format!("L5 go_emit_output: emit_go failed: {e:?}"))?; - let (scratch, _scratch_guard) = l5_target_scratch("go_emit_output")?; - let src_path = scratch.join("main.go"); - let mut file = std::fs::File::create(&src_path) - .map_err(|e| format!("L5 go_emit_output: create {}: {e}", src_path.display()))?; - file.write_all(go_src.as_bytes()) - .map_err(|e| format!("L5 go_emit_output: write {}: {e}", src_path.display()))?; - crate::post_emit_verifier::verify_emitted_source_file( - program_dag, - crate::emit::EmitTarget::Go, - &src_path, - ) - .map_err(|e| format!("L5 go_emit_output: {e}"))?; - let mut run_cmd = Command::new("go"); - run_cmd.arg("run").arg(&src_path); - let run = crate::bounded_host_command::host_command_output( - "L5 go_emit_output: go run", - EXECUTE_COMMAND_WALL_TIMEOUT, - crate::bounded_host_command::prepare_host_command(run_cmd), - )?; - if !run.status.success() { - return Err(format!( - "L5 go_emit_output: go run exited with {:?}; stdout:\n{}\nstderr:\n{}", - run.status.code(), - String::from_utf8_lossy(&run.stdout).trim_end(), - String::from_utf8_lossy(&run.stderr).trim_end() - )); - } - l5_parse_single_int_stdout_carve_out("go", &String::from_utf8_lossy(&run.stdout)) -} - -fn l5_cross_target_outputs_int(claim: &TestClaimValue, output_bind_name: &str) -> ClaimResult { - let program_dag = match compile_to_dag(&claim.source, &claim.file_name) { - Ok(dag) => dag, - Err(CompileError::Semantic(dag)) => { - return ClaimResult::Fail(format!( - "ForAllTargets(L5): claim `source` / `{}` compiled with diagnostics: {:?}", - claim.file_name, - dag.diagnostics().iter().collect::>() - )); - } - Err(err) => { - return ClaimResult::Fail(format!( - "ForAllTargets(L5): claim `source` / `{}` did not compile: {err:?}", - claim.file_name - )); - } - }; - - let Some(output_bind) = find_bind(&program_dag, output_bind_name, &claim.file_name) else { - return ClaimResult::Fail(format!( - "ForAllTargets(L5): declared ProgramOutputBind `{output_bind_name}` was not found in `{}`", - claim.file_name - )); - }; - let selectors = [ - ( - "rust", - last_emit_rust_program_top_level_value_bind_name(&program_dag) - .map_err(|e| format!("{e:?}")), - ), - ( - "python", - last_emit_python_program_top_level_value_bind_name(&program_dag) - .map_err(|e| format!("{e:?}")), - ), - ( - "go", - last_emit_go_program_top_level_value_bind_name(&program_dag) - .map_err(|e| format!("{e:?}")), - ), - ]; - for (target, selected) in selectors { - let selected = match selected { - Ok(Some(name)) => name, - Ok(None) => { - return ClaimResult::Fail(format!( - "ForAllTargets(L5): {target} emitter has no top-level value bind to observe" - )); - } - Err(e) => { - return ClaimResult::Fail(format!( - "ForAllTargets(L5): cannot resolve {target} emitted print target: {e}" - )); - } - }; - if selected != output_bind.name { - return ClaimResult::Fail(format!( - "ForAllTargets(L5): declared ProgramOutputBind must name the {target} emitted top-level output bind; expected `{selected}`, got `{}`", - output_bind.name - )); - } - } - - let rust = match l5_rust_emit_output_int(&program_dag, &claim.file_name) { - Ok(v) => v, - Err(msg) => return ClaimResult::Fail(msg), - }; - let python = match l5_python_emit_output_int(&program_dag) { - Ok(v) => v, - Err(msg) => return ClaimResult::Fail(msg), - }; - let go = match l5_go_emit_output_int(&program_dag) { - Ok(v) => v, - Err(msg) => return ClaimResult::Fail(msg), - }; - - if rust == python && python == go { - ClaimResult::Pass - } else { - ClaimResult::Fail(format!( - "ForAllTargets(L5): cross-target Int mismatch for `{}`: rust={rust}, python={python}, go={go}", - claim.file_name - )) - } -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum ClaimResult { - Pass, - Fail(String), - /// Runner does not implement this path yet; message is surfaced to tests and logs. - NotYetImplemented(String), -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub struct ClaimEvaluation { - pub claim_name: String, - pub result: ClaimResult, -} - -/// Typed failure modes for [`eval_algebraic_law_for_claim_program`] (C-5: no string -/// sub-match on `Err` to classify behavior — discriminate on this enum). -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum AlgebraicLawProgramError { - /// Law kind is not implemented in the public helper (M1.5 harness: treat as runner-deferred). - UnsupportedLaw { law_label: String }, - /// Predicate payload or referenced structure is invalid for evaluation. - MalformedPayload(String), -} - -/// Hermetic `AlgebraicLaw` evaluation against a compiled claim program (`program_dag`). -/// -/// **`Associativity` / `Commutativity` / `Identity` — bounded operational witnesses, not substrate law proof:** -/// uses [`int_associativity_holds_all_triples`](crate::lens_declaration_apply::int_associativity_holds_all_triples) -/// over [`ASSOCIATIVITY_WITNESS_TRIPLES`](crate::lens_declaration_apply::ASSOCIATIVITY_WITNESS_TRIPLES) so a -/// single lucky `(a,b,c)` cannot certify a false law; `Commutativity` uses -/// [`COMMUTATIVITY_WITNESS_PAIRS`](crate::lens_declaration_apply::COMMUTATIVITY_WITNESS_PAIRS) the same way; -/// `Identity` uses [`int_identity_witness_holds`](crate::lens_declaration_apply::int_identity_witness_holds) -/// over [`IDENTITY_WITNESS_SAMPLES`](crate::lens_declaration_apply::IDENTITY_WITNESS_SAMPLES) / -/// [`IDENTITY_WITNESS_CANDIDATES`](crate::lens_declaration_apply::IDENTITY_WITNESS_CANDIDATES), requiring a -/// **unique** candidate element so ambiguous finite-table fits fail closed. -/// These paths do **not** consume quantified facts declared on `OrderedRing` / semigroup carriers -/// in `std.algebra` (those are not yet first-class runner inputs). Treating `Pass` here as full -/// algebraic law evidence would be weaker than a substrate-backed law check. **Dissolution:** wire -/// `AlgebraicLaw` to declared law metadata / witnesses on disk and reserve sample-only checks to -/// explicit testgen predicates, or return [`ClaimResult::NotYetImplemented`] until that substrate -/// surface exists. -/// -/// `lens_ref` is a [`FieldValue::Reference`] into `fixture_dag`; the runner resolves the **name** -/// and looks up the same name in `program_dag`. -pub fn eval_algebraic_law_for_claim_program( - fixture_dag: &Dag, - program_dag: &Dag, - payload: &[FieldValue], -) -> Result { - let (law, lens_ref) = algebraic_law_payload_fields(payload)?; - let (law_label, law_payload) = variant_fields(fixture_dag, law)?; - match law_label.as_str() { - "Associativity" | "Commutativity" | "Identity" => {} - // `Distributivity` is intentionally absent from AlgebraicLawKind. If a future substrate - // enum extension adds it, route implementation through INVARIANTS P1 first instead of - // encoding it through another predicate or overloading an existing law. - other => { - return Err(AlgebraicLawProgramError::UnsupportedLaw { - law_label: other.to_string(), - }); - } - } - let lens_name = declaration_ref_name(fixture_dag, lens_ref)?; - let Some(target) = program_dag.declaration_by_name(&lens_name) else { - return Ok(false); - }; - match law_label.as_str() { - "Associativity" => { - if !law_payload.is_empty() { - return Err(AlgebraicLawProgramError::MalformedPayload( - "Associativity should be payload-free".to_string(), - )); - } - int_associativity_holds_all_triples( - program_dag, - target.id, - ASSOCIATIVITY_WITNESS_TRIPLES, - ) - .map_err(|e| { - AlgebraicLawProgramError::MalformedPayload(format!("lens apply error: {e:?}")) - }) - } - "Commutativity" => { - if !law_payload.is_empty() { - return Err(AlgebraicLawProgramError::MalformedPayload( - "Commutativity should be payload-free".to_string(), - )); - } - int_commutativity_holds_all_pairs(program_dag, target.id, COMMUTATIVITY_WITNESS_PAIRS) - .map_err(|e| { - AlgebraicLawProgramError::MalformedPayload(format!("lens apply error: {e:?}")) - }) - } - "Identity" => { - if !law_payload.is_empty() { - return Err(AlgebraicLawProgramError::MalformedPayload( - "Identity should be payload-free".to_string(), - )); - } - int_identity_witness_holds( - program_dag, - target.id, - IDENTITY_WITNESS_SAMPLES, - IDENTITY_WITNESS_CANDIDATES, - ) - .map_err(|e| { - AlgebraicLawProgramError::MalformedPayload(format!("lens apply error: {e:?}")) - }) - } - _ => unreachable!("unsupported AlgebraicLawKind returned before lens resolution"), - } -} - -/// Compile-time ratchet (PR #741 / codex P1): `Associativity` must not regress to checking one -/// lucky `(a, b, c)` triple — the gate is a correctness signal only when the witness set has -/// material breadth (see `lens_declaration_apply::ASSOCIATIVITY_WITNESS_TRIPLES`). -const _: () = assert!(ASSOCIATIVITY_WITNESS_TRIPLES.len() > 1); -const _: () = assert!(IDENTITY_WITNESS_SAMPLES.len() > 1); - -/// Shared structural-value comparator for runner-side value-domain checks. -/// -/// PR-B.3 uses this for `AlgebraicLaw::Commutativity`; PR-B.4 should reuse this authority when -/// per-target structural-output normalization lands instead of introducing a second comparator. -pub fn runner_structural_values_equal(left: &FieldValue, right: &FieldValue) -> bool { - left == right -} - -/// Transitional PR-B.3 runner scaffold: evaluate `a ⊕ b == b ⊕ a` over the bounded Int witness -/// table. Dissolution hook: replace sample-table checks with first-class substrate law witnesses -/// consumed by PR-B evaluator / PB-Runtime once lens algebra facts are declared. -fn int_commutativity_holds_all_pairs( - program_dag: &Dag, - lens_decl_id: DeclarationId, - pairs: &[(i64, i64)], -) -> Result { - let int = |n: i64| FieldValue::Literal(LiteralBits::Int(n.to_string())); - for &(a, b) in pairs { - let left = apply_lens_declaration(program_dag, None, lens_decl_id, &[int(a), int(b)])?; - let right = apply_lens_declaration(program_dag, None, lens_decl_id, &[int(b), int(a)])?; - if !runner_structural_values_equal(&left, &right) { - return Ok(false); - } - } - Ok(true) -} - -const _: () = assert!(COMMUTATIVITY_WITNESS_PAIRS.len() > 1); - -// --- `TestPredicate::ExecuteCommand` (PB-Runtime) — shared by `TestRunner` and M1.5 testgen --- - -/// Extracts `(command, args, expect_exit_code)` from `ExecuteCommand` lowered payloads -/// (positional `Conj` fields or a single `Record`). Matches `m1_5_testgen` historical parser. -pub fn parse_execute_command_fields(payload: &[FieldValue]) -> Option<(String, Vec, i64)> { - match payload { - [FieldValue::Record(fields)] => { - let command = execute_command_string_field(fields, "command")?; - let expect_exit_code = fields - .iter() - .find(|(label, _)| label == "expect_exit_code") - .and_then(|(_, value)| match value { - FieldValue::Literal(LiteralBits::Int(s)) => s.parse::().ok(), - _ => None, - })?; - let args = fields - .iter() - .find(|(label, _)| label == "args") - .and_then(|(_, value)| list_string_literal_values(value))?; - Some((command, args, expect_exit_code)) - } - [cmd, args, code] => { - let FieldValue::Literal(LiteralBits::String(command)) = cmd else { - return None; - }; - let argv = list_string_literal_values(args)?; - let FieldValue::Literal(LiteralBits::Int(expect_s)) = code else { - return None; - }; - let expect_exit_code = expect_s.parse::().ok()?; - Some((command.clone(), argv, expect_exit_code)) - } - _ => None, - } -} - -fn execute_command_string_field(fields: &[(String, FieldValue)], label: &str) -> Option { - fields - .iter() - .find(|(l, _)| l == label) - .and_then(|(_, v)| match v { - FieldValue::Literal(LiteralBits::String(s)) => Some(s.clone()), - _ => None, - }) -} - -fn list_string_literal_values(value: &FieldValue) -> Option> { - let FieldValue::List(items) = value else { - return None; - }; - let mut out = Vec::with_capacity(items.len()); - for item in items { - let FieldValue::Literal(LiteralBits::String(s)) = item else { - return None; - }; - out.push(s.clone()); - } - Some(out) -} - -/// Hard wall-clock for [`evaluate_execute_command_exit_code`]: fail-closed `ClaimResult::Fail` -/// (not hang / not unbounded) so checked-in `TestClaim` data cannot block CI on a runaway child. -/// Adjusting the limit is policy; the substrate has no per-claim override today. -pub const EXECUTE_COMMAND_WALL_TIMEOUT: Duration = - crate::bounded_host_command::DEFAULT_WALL_TIMEOUT; - -const EXECUTE_COMMAND_WAIT_POLL: Duration = Duration::from_millis(20); - -const SHELL_DASH_C_BACKGROUND_STEMS: [&str; 5] = ["sh", "bash", "dash", "ksh", "zsh"]; -const SHELL_C_BACKGROUND_UNBOUNDED_FAIL: &str = "ExecuteCommand: shell `-c` script has a `&` that may be an unmodelled **background** \ - job (after eliding `&&` and `n>&m` / `&>`-style fd spellings) — a direct `Child` wait is not \ - a full process boundary. Rephrase (e.g. a direct tool, or a `-c` string that does not rely on \ - shell `&` background) — P3/P4."; - -/// Path stem in [`SHELL_DASH_C_BACKGROUND_STEMS`] (helper for shell `-c` / background guard). -fn shell_dash_c_background_stem_is_shell(arg: &str) -> bool { - let s = std::path::Path::new(arg) - .file_name() - .and_then(|x| x.to_str()) - .unwrap_or(arg); - SHELL_DASH_C_BACKGROUND_STEMS.contains(&s) -} - -/// `sh` and `dash` do not treat `&>` as a single bash-style redirect token — the same bytes can -/// be `&` (background) + `>` (api-review openai-pro gpt-5-5-pro, PR #792: P3/P4). -fn shell_stem_is_posix_sh_or_dash(shell_path: &str) -> bool { - let s = std::path::Path::new(shell_path) - .file_name() - .and_then(|x| x.to_str()) - .unwrap_or(shell_path); - matches!(s, "sh" | "dash") -} - -/// Whether `&>` / `&>>` may be elided as non-background `&` spellings (bash/ksh/zsh). For -/// `sh`/`dash` and unknown interpreter, we **do not** elide — see -/// [`shell_dash_c_may_start_background_after_eliding_artifacts`]. -fn shell_interpreter_allows_bash_style_ampersand_gt_redirect(interpreter: Option<&str>) -> bool { - match interpreter { - None => false, - Some(s) if shell_stem_is_posix_sh_or_dash(s) => false, - Some(_) => true, - } -} - -/// The `-c` (or combined `-?c?`) at `c_flag_index` is run by the nearest preceding shell in -/// `args`, or by `leading_hint` when the slice is `["-c", "script"]` / `["-ec", "script"]` only -/// (e.g. `env(1)` + `sh -c` — the shell is not `args[0]` of the tail). -fn shell_interpreter_for_c_flag<'a>( - args: &'a [String], - c_flag_index: usize, - leading_hint: Option<&'a str>, -) -> Option<&'a str> { - if c_flag_index > 0 && shell_dash_c_background_stem_is_shell(&args[c_flag_index - 1]) { - return Some(args[c_flag_index - 1].as_str()); - } - if c_flag_index == 0 { - return leading_hint; - } - None -} - -/// `true` if a bare `&` may be shell background, scanning **all** `"-c"` and combined `-?c?` invocations -/// in `args`, and **recursing** when a `-c` (or combined) **script** value is a shell path stem and -/// more argv follow — e.g. `sh -c sh -ec "sleep&"` (POSIX: `-c` takes one script word, then -/// `argv` continues) would otherwise be mis-read as a script of `sh` only (PR #792 inline; P4). -/// -/// Production uses [`shell_argv_may_start_unbounded_background_with_hint`]; this wrapper is for -/// unit tests only. -#[cfg(test)] -fn shell_argv_may_start_unbounded_background(args: &[String]) -> bool { - shell_argv_may_start_unbounded_background_with_hint(args, None) -} - -/// Like [`shell_argv_may_start_unbounded_background`], but when `args` is only the **tail** after a -/// known shell (e.g. `["-c", "…"]` for `env sh -c …`), pass that shell as `leading_hint` so `&>` / -/// POSIX elision is correct (openai-pro PR #792). -fn shell_argv_may_start_unbounded_background_with_hint( - args: &[String], - leading_hint: Option<&str>, -) -> bool { - const MAX_NEST: u32 = 32; - - fn is_combined_c_not_exact(a: &str) -> bool { - if a == "-c" || a.starts_with("--") { - return false; - } - a.strip_prefix('-') - .is_some_and(|f| !f.is_empty() && !f.starts_with('-') && f.chars().any(|ch| ch == 'c')) - } - - fn check_slice(args: &[String], depth: u32, leading_hint: Option<&str>) -> bool { - // P3 / P4: if we cannot finish scanning, fail closed — a depth escape must not be taken as - // "no unbounded background" and allow a spawn past the policy guard (api-review codex 3a2a9f64). - if depth > MAX_NEST { - return true; - } - for i in 0..args.len() { - if &args[i] == "-c" { - if let Some(s) = args.get(i + 1) { - let intr = shell_interpreter_for_c_flag(args, i, leading_hint); - if shell_dash_c_may_start_background_after_eliding_artifacts(s, intr) { - return true; - } - if i + 2 < args.len() && shell_dash_c_background_stem_is_shell(s) { - let mut inner = vec![s.to_string()]; - inner.extend_from_slice(&args[i + 2..]); - let inner_leading = inner - .first() - .filter(|a| shell_dash_c_background_stem_is_shell(a)) - .map(|a| a.as_str()); - if check_slice(&inner, depth + 1, inner_leading) { - return true; - } - } - } - } - } - for i in 0..args.len() { - let a = &args[i]; - if a.starts_with("--") || a == "-c" { - continue; - } - if is_combined_c_not_exact(a) { - if let Some(s) = args.get(i + 1) { - let intr = shell_interpreter_for_c_flag(args, i, leading_hint); - if shell_dash_c_may_start_background_after_eliding_artifacts(s, intr) { - return true; - } - if i + 2 < args.len() && shell_dash_c_background_stem_is_shell(s) { - let mut inner = vec![s.to_string()]; - inner.extend_from_slice(&args[i + 2..]); - let inner_leading = inner - .first() - .filter(|a| shell_dash_c_background_stem_is_shell(a)) - .map(|a| a.as_str()); - if check_slice(&inner, depth + 1, inner_leading) { - return true; - } - } - } - } - } - false - } - let inner_leading = args - .first() - .filter(|a| shell_dash_c_background_stem_is_shell(a)) - .map(|a| a.as_str()); - let hint = leading_hint.or(inner_leading); - check_slice(args, 0, hint) -} - -/// Heuristic: on POSIX shells with `-c`, a *shell background* `&` (not part of `&&` / fd -/// redirect spellings) means the child may exit 0 while other work still runs. We are not a full -/// sh parser: strip a few *common* `&` spellings, then if `&` remains, fail-closed (P3/P4). See -/// `shell_dash_c_may_start_background_after_eliding_artifacts` tests in this module. -/// -/// The top-level `command` need not be a shell (e.g. `env(1)` with `["sh", "-c", "…&"]`); a shell -/// **anywhere** in `args` (path stem) with a following `-c` in the same tail is checked (api-review -/// 994fa40d). For each such index `j`, the guard runs on **`args[j + 1..]`** (the **argv tail after -/// the shell executable**), not `args[j..]`, so we do not double-count the shell token as if it were -/// part of the combined-flag script (api-review e99b53e7, codex). Nested re-exec (script token is -/// `sh`/`bash`/…, rest is another `-c`/`-ec`) is handled by [`shell_argv_may_start_unbounded_background`]. -fn reject_unbounded_shell_background(command: &str, args: &[String]) -> Option { - let fail = || ClaimResult::Fail(SHELL_C_BACKGROUND_UNBOUNDED_FAIL.to_string()); - - let stem = std::path::Path::new(command) - .file_name() - .and_then(|s| s.to_str()) - .unwrap_or(command); - if SHELL_DASH_C_BACKGROUND_STEMS.contains(&stem) - && shell_argv_may_start_unbounded_background_with_hint(args, Some(command)) - { - return Some(fail()); - } - for j in 0..args.len() { - if !shell_dash_c_background_stem_is_shell(&args[j]) { - continue; - } - if shell_argv_may_start_unbounded_background_with_hint(&args[j + 1..], Some(&args[j])) { - return Some(fail()); - } - } - None -} - -/// `sh`/`bash`/… with `-c` in **any** common spelling: standalone `"-c"`, or combined single-dash -/// flags that include the `c` option (e.g. `"-ec"`, `"-lc"`) with the next argument as the script. -/// The `-c` / combined-flag token may appear **anywhere** in the slice (e.g. `["sh", "-ec", "cmd"]` or -/// `["-ec", "cmd"]`); codex PR #792, api-review e99b53e7: first-arg-only special case missed -/// `env sh -ec "…&"`. Production guard uses [`shell_argv_may_start_unbounded_background`]; -/// this helper is kept for **unit** tests and doc parity only. -/// -/// **Not a model of the P3/P4 guard:** it returns the script for the *first* `-c` or combined -/// `-?c?` in argv order. For `["sh", "-c", "sh", "-ec", "…&"]` that first script word is the -/// *shell token* `sh` — a correct *slice-local* read, not the same as “what might background.” -/// [`shell_argv_may_start_unbounded_background`] recurses for that case; the pre-spawn code never -/// calls this helper. Confusion with `args[j+1..]` for `env sh -ec` is a false alarm: the tail is -/// `["-ec", "script"]` and [`check_slice`]’s `s` is `args[i+1]` for the matched flag at `i`, not a -/// mis-attached `shell_dash_c_script_string` (PR #792 inline, 2026-04-25). -#[cfg(test)] -fn shell_dash_c_script_string(args: &[String]) -> Option<&str> { - for (i, a) in args.iter().enumerate() { - if a == "-c" { - return args.get(i + 1).map(String::as_str); - } - if a.starts_with("--") { - continue; - } - if let Some(flags) = a.strip_prefix('-') { - if !flags.is_empty() && !flags.starts_with('-') && flags.chars().any(|ch| ch == 'c') { - return args.get(i + 1).map(String::as_str); - } - } - } - None -} - -/// Strips a few *non-background* `&` patterns from a `-c` string, then returns `true` only if -/// a bare `&` (likely background) may remain. Not a sh grammar; conservative only where -/// we would otherwise false-positive `true && true`, `2>&1`, `n>&m`, and the default-fd shorthand -/// `>&d` (e.g. `>&2` in `command >&2`). **Quoted** `&` (e.g. `echo \"&\"`) -/// is not modeled and may be fail-closed as if it were a background `&` — an acceptable -/// false-reject; user should rephrase without relying on a literal `&` in the `-c` string. This is -/// the likeliest UX foot-gun for hand-authored `.dag` claims (api-review 994fa40d). -/// -/// `interpreter` is the path or stem of the shell that will run this `-c` script. On POSIX -/// `sh`/`dash`, `&>` is **not** a single redirect token — the same bytes can background a command -/// before `>` — so we **fail closed** if the script contains `&>` / `&>>` and do not elide (openai-pro -/// gpt-5-5-pro, PR #792). For `bash`/`ksh`/`zsh` we elide `&>` as a non-background spelling. If the -/// interpreter is unknown, we do not elide `&>` (fail closed on any `&>` in the script). -/// -/// **TODO(dissolution, T-PB-B, input shaping):** retire literal `String::replace` here when -/// `ExecuteCommand`’s `command`+`args` are narrow enough to forbid ambiguous `sh -c` (schema gate), -/// or a **typed** hermetic host runner supersedes the shell escape hatch, or a real `sh` subset -/// parser is shared with CI policy — *input* heuristics are a smell on the same seam as P2(a) on -/// outcomes, but this path only **rejects** (no accept-on-text-match for claim truth). **Do not** -/// grow the elision list ad hoc — that deepens the bridge; link new work to a dissolution (Claude -/// e99b53e7). -fn shell_dash_c_may_start_background_after_eliding_artifacts( - script: &str, - interpreter: Option<&str>, -) -> bool { - if !shell_interpreter_allows_bash_style_ampersand_gt_redirect(interpreter) - && (script.contains("&>>") || script.contains("&>")) - { - return true; - } - let mut t = script.to_string(); - while t.contains("&&") { - t = t.replace("&&", " "); - } - t = t.replace("2>&1", ""); - t = t.replace("1>&2", ""); - t = t.replace("2>&2", ""); - t = t.replace("1>&1", ""); - t = t.replace("0>&1", ""); - if shell_interpreter_allows_bash_style_ampersand_gt_redirect(interpreter) { - t = t.replace("&>>", " "); - t = t.replace("&>", " "); - } - for a in 0u8..=9 { - for b in 0u8..=9 { - t = t.replace(&format!("{a}>&{b}"), ""); - } - } - // `>&d` = default stdout to fd d (e.g. `>&2` in `done >&2`); not a background `&`. - for d in 0u8..=9 { - t = t.replace(&format!(">&{d}"), ""); - } - t.contains('&') -} - -// On Linux, wrap the logical `command` + `args` in a **user + PID namespace** (util-linux -// `unshare(1)` with `-c` = map current user, `-f` fork, `-p` new PID namespace) so the first -// exec'd process in the new namespace is PID 1 (init rôle for that namespace): when it exits, -// the kernel tears down the contained subtree, closing the "direct child matched exit, -// grandchildren still run" host escape **for this path** (PR #792: P3/P4). Other Unix and -// Windows: no unprivileged one-shot equivalent; wall bound + pgrp signal on timeout + the -// `sh -c` `&` heuristic only. -// -// **Setup detection — `gunbc_execute_command_bootstrap` helper (P2(c) structural, post-#1063).** -// The unshare target is the helper binary from `src/v3/execute_command_bootstrap`, NOT a -// `sh -c` script. The helper writes the same three sentinel bytes on fd 3 — `s`, `e`, `f` — -// but crucially calls `fcntl(3, F_SETFD, FD_CLOEXEC)` on fd 3 immediately *before* -// `execvp(3)`. On successful `execvp` the kernel atomically closes fd 3 in the new image -// — the user command **cannot** inherit a writable sentinel fd, eliminating the -// `b"sef"`-spoof discriminator gap that was unreachable in pure POSIX sh (no portable -// `fcntl` primitive between probe and `exec`). `argv[1]` is the logical program; `argv[2..]` -// are its args. See `gunbc_execute_command_bootstrap` source for the exact protocol; the -// classifier in this file consumes the same byte vocabulary as before. -// -// After wait, parent reads up to [`UNSHARE_READY_PIPE_MAX`] bytes: -// -// - `b""` → util-linux exited before the helper ran → `NamespaceSetupFailed`. -// - `b"s"` → helper ran, executable probe rejected → `LogicalCommandNotExecutable`. -// - `b"se"` → helper `execvp`'d the user command (kernel atomically closed fd 3 via -// `FD_CLOEXEC`; user inherits no writable sentinel fd) → exit is the logical exit → -// `LogicalCommandExeced`. -// - `b"sef"` → helper's `execvp` returned (TOCTOU x-bit removal, `ENOEXEC`, `ETXTBSY`, etc.) -// → exec failed post-probe → `LogicalExecFailed`. **Structurally unspoofable now** that -// fd 3 has CLOEXEC before `execvp` — only the helper itself can produce `f` on the -// sentinel. -// - anything else with `b"se"` prefix → defensively classified as `LogicalCommandExeced` -// (P2(d) defense-in-depth). With the helper-binary CLOEXEC story, this branch should be -// unreachable in practice, but the classifier preserves the no-implicit-re-execution -// guarantee even under a hypothetical helper bug. -// - anything not starting with `b"s"` or whose `s`-prefix didn't reach `e` → -// `NamespaceSetupFailed`. Bootstrap never committed to `exec`, so the direct fallback is -// the *first* logical run. -// -// **No setup-string authority** (P2(a)/(b)/(e)): wrapper stderr is `/dev/null`; only -// structural channel is the typed sentinel pipe; classification is exact-byte. -// **No implicit re-execution** (P2(d)): on `NamespaceSetupFailed` the direct fallback is -// the *first* logical run, not a recovery re-exec. -// **No spoofable discriminator** (P2(c), structural): the helper sets `FD_CLOEXEC` on fd 3 -// between writing `e` and calling `execvp`; successful exec atomically closes fd 3 in the -// new image, so the user cannot write any byte to the sentinel post-`exec`. - -/// Anonymous pipe used as the unshare-bootstrap setup sentinel. The child inherits the write -/// end as fd 3 (set in `pre_exec` via `dup2`). After spawn the parent closes its copy of the -/// write end so EOF becomes observable on the read end. After wait the parent reads up to -/// [`UNSHARE_READY_PIPE_MAX`] bytes — the bytes written by the bootstrap classify the run. -#[cfg(target_os = "linux")] -struct UnshareReadyPipe { - read_fd: std::os::fd::RawFd, - /// `Some(_)` until [`Self::close_write_end_in_parent`] runs once after `spawn`. - write_fd: Option, -} - -/// One byte beyond the longest canonical-protocol sentinel (`b"sef"` = 3 bytes). The extra -/// slot lets stray bytes after `se`/`sef` (from the user writing to the inherited fd 3 -/// post-`exec`) be observed by the classifier — those patterns map to -/// `LogicalCommandExeced` rather than triggering a fallback re-run (P2(d)). -/// (api-review claude-opus-4-7 sha 793a57ef sizing rationale; codex sha 7297b04a P2(d) -/// hardening for the post-`se` stray-byte case.) -#[cfg(target_os = "linux")] -const UNSHARE_READY_PIPE_MAX: usize = 4; - -#[cfg(target_os = "linux")] -impl UnshareReadyPipe { - fn new() -> std::io::Result { - let mut fds = [0i32; 2]; - if unsafe { libc::pipe2(fds.as_mut_ptr(), libc::O_CLOEXEC) } != 0 { - return Err(std::io::Error::last_os_error()); - } - Ok(UnshareReadyPipe { - read_fd: fds[0], - write_fd: Some(fds[1]), - }) - } - - fn write_fd_for_child(&self) -> std::os::fd::RawFd { - self.write_fd.expect("write fd consumed before spawn") - } - - fn close_write_end_in_parent(&mut self) { - if let Some(fd) = self.write_fd.take() { - unsafe { libc::close(fd) }; - } - } - - /// Reads up to [`UNSHARE_READY_PIPE_MAX`] bytes after the child exits and the parent's - /// write end is closed. Bounded — the bootstrap writes at most 3 sentinel bytes. - /// - /// **Caller ordering contract.** This is a *blocking* `libc::read` loop. It must be - /// called only after both (a) [`Self::close_write_end_in_parent`] has run and (b) the - /// child has been reaped (either via `child_wait_for_execute_command` returning - /// successfully, or after `kill_process_group_on_timeout` + `child.wait`). Together - /// those guarantee EOF on the read end. Calling this *before* the child is reaped while - /// the child still holds an open fd 3 (e.g. pre-`exec` sh, or post-failed-`exec` sh - /// after the EXIT trap fires) would deadlock if the child has not yet exited. - /// - /// **Typed errors (api-review openai-pro/gpt-5-5-pro sha 9fea084e).** A real `read(2)` - /// failure is surfaced as `Err(io::Error)` rather than collapsed into a short sentinel: - /// the caller routes that to a typed `WaitFailed::Io` outcome, NOT a fall-back to - /// direct, because after the unshare child has been reaped we cannot rule out that the - /// logical command already ran — running it again via direct fallback would be implicit - /// re-execution. `EINTR` is retried in-loop because the read is idempotent on a - /// closed-write-end pipe. `n == 0` is a clean EOF. - fn read_sentinel(&self) -> std::io::Result> { - let mut buf = [0u8; UNSHARE_READY_PIPE_MAX]; - let mut total = 0usize; - while total < buf.len() { - let n = unsafe { - libc::read( - self.read_fd, - buf.as_mut_ptr().add(total) as *mut libc::c_void, - buf.len() - total, - ) - }; - if n > 0 { - total += n as usize; - continue; - } - if n == 0 { - // Clean EOF — all writers closed. - break; - } - // n < 0: real read error. - let err = std::io::Error::last_os_error(); - if err.kind() == std::io::ErrorKind::Interrupted { - // EINTR — retry. Idempotent on a closed-write-end pipe. - continue; - } - return Err(err); - } - Ok(buf[..total].to_vec()) - } -} - -#[cfg(target_os = "linux")] -impl Drop for UnshareReadyPipe { - fn drop(&mut self) { - if let Some(fd) = self.write_fd.take() { - unsafe { libc::close(fd) }; - } - unsafe { libc::close(self.read_fd) }; - } -} - -/// Override env var for the helper binary path (used in tests where the workspace target -/// layout may not match `current_exe`'s parent — e.g., when running a single-crate test in -/// isolation). Production callers should not set this; the runtime walkup is the canonical -/// resolution. -#[cfg(target_os = "linux")] -const GUNBC_EXECUTE_COMMAND_BOOTSTRAP_PATH_ENV: &str = "GUNBC_EXECUTE_COMMAND_BOOTSTRAP"; - -/// True iff `path` is a regular file that the calling process can actually `execve` — -/// i.e. it exists, is a regular file (not a directory or symlink-to-directory), AND the -/// effective uid/gid has execute permission per `access(2)` with `X_OK`. We don't trust -/// `Path::exists()` (would pass directories) and we don't trust a bare mode-bit check -/// (would pass `--x------` files our uid cannot exec, leading to `EACCES` at exec time -/// → empty sentinel → `NamespaceSetupFailed` → direct fallback runs the logical command, -/// silently converting setup-failure into a possible `Matched` logical exit). -/// -/// `access(2)` is the kernel-supplied atomic check that combines uid/gid against the file -/// permissions (api-review codex sha 523776b BLOCKING follow-up + sha 143b7da5 BLOCKING -/// original; together close the P2(c) silent-direct-fallback class for the helper path). -#[cfg(target_os = "linux")] -fn is_regular_executable_file(path: &std::path::Path) -> bool { - use std::os::unix::ffi::OsStrExt; - let Ok(meta) = std::fs::metadata(path) else { - return false; - }; - if !meta.is_file() { - return false; - } - // Build a NUL-terminated byte vec for libc::access. Reject paths containing interior - // NULs (cannot be passed to access(2) at all). - let bytes = path.as_os_str().as_bytes(); - if bytes.contains(&0) { - return false; - } - let mut c_path = Vec::with_capacity(bytes.len() + 1); - c_path.extend_from_slice(bytes); - c_path.push(0); - // SAFETY: c_path is NUL-terminated; access(2) is signal-safe and read-only. - let rc = unsafe { libc::access(c_path.as_ptr() as *const libc::c_char, libc::X_OK) }; - rc == 0 -} - -/// Locates the `gunbc_execute_command_bootstrap` helper binary at runtime. The cargo -/// workspace layout puts it at `target//gunbc_execute_command_bootstrap`. Tests -/// run from `target//deps/v3_compiler-` (one level deeper) so we walk up -/// once. An env override (`GUNBC_EXECUTE_COMMAND_BOOTSTRAP`) takes precedence for cases -/// where the helper is installed elsewhere. -/// -/// **Validates that candidates are regular executable files**, not just present paths -/// (P2(c) hardening — see [`is_regular_executable_file`]). -/// -/// Returns `Err(message)` if the helper cannot be located or fails validation — the caller -/// surfaces this as a typed `SetupFailed` so a misconfigured deployment cannot silently -/// degrade to a spoofable bootstrap path. -#[cfg(target_os = "linux")] -fn locate_unshare_bootstrap_helper() -> Result { - use std::path::PathBuf; - if let Ok(p) = std::env::var(GUNBC_EXECUTE_COMMAND_BOOTSTRAP_PATH_ENV) { - if !p.is_empty() { - let path = PathBuf::from(p); - if !path.exists() { - return Err(format!( - "{GUNBC_EXECUTE_COMMAND_BOOTSTRAP_PATH_ENV} points to nonexistent path: {}", - path.display() - )); - } - if !is_regular_executable_file(&path) { - return Err(format!( - "{GUNBC_EXECUTE_COMMAND_BOOTSTRAP_PATH_ENV} points to a path that is not a regular executable file: {}", - path.display() - )); - } - return Ok(path); - } - } - let exe = std::env::current_exe().map_err(|e| format!("current_exe() failed: {e}"))?; - let dir = exe - .parent() - .ok_or_else(|| "current_exe has no parent dir".to_string())?; - // target//gunbc_execute_command_bootstrap (binary running directly). - let candidate = dir.join("gunbc_execute_command_bootstrap"); - if is_regular_executable_file(&candidate) { - return Ok(candidate); - } - // target//deps/- → walk up one to target//. - if let Some(parent) = dir.parent() { - let candidate = parent.join("gunbc_execute_command_bootstrap"); - if is_regular_executable_file(&candidate) { - return Ok(candidate); - } - } - Err(format!( - "gunbc_execute_command_bootstrap not found relative to current_exe ({}); \ - build the workspace (`cargo build --workspace`) or set {} to its absolute path", - exe.display(), - GUNBC_EXECUTE_COMMAND_BOOTSTRAP_PATH_ENV - )) -} - -#[cfg(target_os = "linux")] -fn build_execute_command_unshare( - helper: &std::path::Path, - command: &str, - args: &[String], - ready: &UnshareReadyPipe, -) -> Command { - let mut c = Command::new("unshare"); - c.args(["-c", "-f", "-p", "--"]) - .arg(helper) - .arg(command) - .args(args) - .stdin(Stdio::null()) - .stdout(Stdio::null()) - // Wrapper stderr is /dev/null: P2(a)/(b) — no shared diagnostic channel between - // helper and parent; the structural setup signal is the ready-pipe sentinel. - .stderr(Stdio::null()); - let write_fd = ready.write_fd_for_child(); - { - use std::os::unix::process::CommandExt; - unsafe { - c.pre_exec(move || { - if libc::setpgid(0, 0) != 0 { - return Err(std::io::Error::last_os_error()); - } - // Move the ready-pipe write end to fd 3 WITHOUT FD_CLOEXEC. fd 3 must - // survive the parent's `exec("unshare")` and unshare's own `exec(helper)`; - // the helper binary itself sets FD_CLOEXEC on fd 3 immediately before its - // final `execvp` of the user command — that's the structural close that - // prevents the user from inheriting a writable sentinel fd (P2(c) closure, - // #1063). - // - // dup2(src, dst) clears CLOEXEC on dst *only when src != dst*. POSIX - // specifies that `dup2(fildes, fildes)` is a no-op (returns fildes2 - // unchanged) — so if a low-fd allocation in the child has already placed - // our write_fd AT fd 3, dup2 leaves fd 3 with whatever flags it had, - // including the O_CLOEXEC we set on `pipe2(O_CLOEXEC)`. The kernel would - // then close fd 3 atomically on `exec("unshare")` and the helper would - // never see the sentinel — silently bypassing the helper path. Explicitly - // clear FD_CLOEXEC after dup2 to defend against that case. - // (api-review codex sha c535f4c BLOCKING.) - if libc::dup2(write_fd, 3) < 0 { - return Err(std::io::Error::last_os_error()); - } - if libc::fcntl(3, libc::F_SETFD, 0) < 0 { - return Err(std::io::Error::last_os_error()); - } - Ok(()) - }); - } - } - c -} - -/// Classifies the [`UnshareReadyPipe`] sentinel after the unshare wrapper exits. -#[cfg(target_os = "linux")] -#[derive(Copy, Clone, Debug, Eq, PartialEq)] -enum UnshareBootstrapStage { - /// `b""` — helper never ran; util-linux failed before fork/exec into the helper. - NamespaceSetupFailed, - /// `b"s"` — helper ran, `execvp`-equivalent probe rejected the logical command. - LogicalCommandNotExecutable, - /// `b"se"` — helper `execvp`'d the logical command; observed exit is its exit. - LogicalCommandExeced, - /// `b"sef"` — helper's `execvp` returned (TOCTOU, `ENOEXEC`, `ETXTBSY`, etc.); the - /// helper wrote `f` after the failure. The observed exit is the helper's, not the - /// logical command's — must NOT be classified as a logical exit (P2(c)). Structurally - /// unspoofable: the helper sets `FD_CLOEXEC` on fd 3 before `execvp`, so a successful - /// exec atomically closes fd 3 in the user image and only the helper itself can write - /// `f` (post-#1063). - LogicalExecFailed, -} - -#[cfg(target_os = "linux")] -fn unshare_bootstrap_stage_from_sentinel(sentinel: &[u8]) -> UnshareBootstrapStage { - // **P2(d) hardening (api-review codex sha 7297b04a, REQUEST_CHANGES).** - // The bootstrap writes `e` only *after* the executable probe passes and is committed to - // `exec(2)`. So once `s` then `e` have been observed, the logical command DID start - // running — any sentinel bytes beyond `se` come from the user process (fd 3 is - // intentionally inherited; CLOEXEC at this layer is impossible in pure POSIX sh per - // manager STOP / #856 escalation). Re-routing those `se*` patterns to - // `NamespaceSetupFailed` would trigger a *second* logical run via the direct fallback — - // exactly the implicit-re-execution this PR is meant to close. - // - // Therefore anything whose prefix is `b"se"` is classified as the user having executed: - // - `b"se"` → `LogicalCommandExeced` (canonical) - // - `b"sef"` → `LogicalExecFailed` (canonical post-`exec` failure via EXIT trap) - // - `b"se*"` → `LogicalCommandExeced` (user ran + post-`exec` stray write) - // - // Patterns that did NOT reach `e` (`b""`, `b"s"`, anything not starting with `s` or `se`) - // are safe to fail-closed because the bootstrap never committed to `exec` — re-running - // via direct fallback is the *first* logical run, not a second. - match sentinel { - b"" => UnshareBootstrapStage::NamespaceSetupFailed, - b"s" => UnshareBootstrapStage::LogicalCommandNotExecutable, - b"sef" => UnshareBootstrapStage::LogicalExecFailed, - bs if bs.starts_with(b"se") => UnshareBootstrapStage::LogicalCommandExeced, - _ => UnshareBootstrapStage::NamespaceSetupFailed, - } -} - -/// Configure `Command` for the host check: no capture, and on Unix a new process group for the -/// child so a timeout can `kill(2)` the whole process group. On Linux this is the **non-unshare** -/// path; see [`build_execute_command_unshare`]. -fn build_execute_command_process(command: &str, args: &[String]) -> Command { - let mut c = Command::new(command); - c.args(args) - .stdin(Stdio::null()) - .stdout(Stdio::null()) - .stderr(Stdio::null()); - #[cfg(unix)] - { - use std::os::unix::process::CommandExt; - unsafe { - c.pre_exec(|| { - if libc::setpgid(0, 0) != 0 { - return Err(std::io::Error::last_os_error()); - } - Ok(()) - }); - } - } - c -} - -/// Best-effort: signal the process **group** (see `setpgid` in `pre_exec`); then `Child::kill` for -/// portability. A successful `sh -c '…&'`-style path is pre-blocked; `wait` after a SIGKILL is -/// still unbounded in the API, but the child is reaped in practice. -#[cfg(unix)] -fn kill_process_group_on_timeout(child: &mut std::process::Child) { - use libc::{kill, SIGKILL}; - let p = child.id() as i32; - if p != 0 { - if unsafe { kill(-p, SIGKILL) } < 0 { - let _ = child.kill(); - } - } else { - let _ = child.kill(); - } -} -#[cfg(not(unix))] -fn kill_process_group_on_timeout(child: &mut std::process::Child) { - let _ = child.kill(); -} - -/// Typed wait failure. Mapped to [`ExecuteCommandHostOutcome::WaitFailed`] by the caller. -#[derive(Debug, Clone, PartialEq, Eq)] -enum ChildWaitFail { - WallTimeout { wall_time: Duration }, - Io(String), -} - -/// Wall-bounded `try_wait` loop. With wrapper stderr at `/dev/null` (P2(b)) there is no pipe to -/// drain — simple poll until the child exits or the deadline trips. -fn child_wait_for_execute_command( - child: &mut std::process::Child, - wall_time: Duration, -) -> Result { - let deadline = Instant::now() + wall_time; - loop { - match child.try_wait() { - Ok(Some(status)) => return Ok(status), - Ok(None) => { - if Instant::now() >= deadline { - kill_process_group_on_timeout(child); - let _ = child.wait(); - return Err(ChildWaitFail::WallTimeout { wall_time }); - } - std::thread::sleep(EXECUTE_COMMAND_WAIT_POLL); - } - Err(err) => return Err(ChildWaitFail::Io(format!("{err}"))), - } - } -} - -/// Spawns a host process and checks exit status. Used by the Rust `TestRunner` and the M1.5 -/// harness (single canonical path per PB-Runtime brief). Core logic is -/// [`evaluate_execute_command_host_outcome`] ([`ExecuteCommandHostOutcome`]); this function and -/// [`evaluate_execute_command_exit_code_with_wall_time`] map to [`ClaimResult`] at the -/// reporting edge. -/// -/// - **No stdout/stderr capture** — `stdin`/`stdout`/`stderr` are the null device. Only the -/// exit code is read. -/// - **Wall clock** — [`EXECUTE_COMMAND_WALL_TIMEOUT`]. -/// - **Linux**: user+PID namespace via `unshare(1)` + the `gunbc_execute_command_bootstrap` helper binary that signals setup -/// progress on a sentinel ready-pipe (fd 3). On namespace setup failure the runner falls -/// back to a direct `Child` once as the *first* logical run (P2(d): no implicit re-exec -/// of an already-run logical command). -/// - **Heuristic on `&` in `sh`/`bash`/… `-c` scripts (all hosts)** — bare shell background `&` -/// (after eliding `&&` and a few `>&`/`&>` token spellings) is rejected pre-spawn. -pub fn evaluate_execute_command_exit_code( - command: &str, - args: &[String], - expect_exit_code: i64, -) -> ClaimResult { - evaluate_execute_command_exit_code_with_wall_time( - command, - args, - expect_exit_code, - EXECUTE_COMMAND_WALL_TIMEOUT, - ) -} - -/// String form for the exit-mismatch **reporting** edge; **not** used for M1.5 or other -/// semantic classification — that uses [`ExecuteCommandHostOutcome::Mismatch`]. -pub const EXECUTE_COMMAND_EXIT_CODE_MISMATCH_MSG_PREFIX: &str = - "ExecuteCommand exit code mismatch: expected "; - -/// Single typed authority for the host predicate. **All** consumers branch on this enum; -/// `Fail(String)` is rendered only at the reporting edge by [`Self::into_claim_result`]. -/// **P2(a)–(e) realization (T-PB-B Worker 4):** -/// - (a) typed results: variants only; no `Other(ClaimResult)` partial carrier. -/// - (b) isolated logical-child I/O: wrapper stderr is `/dev/null`; the helper binary inherits stdio normally and -/// logical stderr to `/dev/null` before `exec`. The only structural channel between -/// bootstrap and parent is the [`UnshareReadyPipe`] sentinel (typed bytes, not strings). -/// - (c) setup ≠ logical exit: `SetupFailed` and `SpawnFailed` are distinct from -/// `Matched`/`Mismatch` — they cannot be reinterpreted in one hop. -/// - (d) no implicit re-execution: namespace setup failure → direct fallback runs as the -/// *first* logical run (the unshare wrapper never reached `exec`). The empty-stderr -/// relaunch and non-zero host-confirmation re-execs are deleted. -/// - (e) drains and authority: no draining is necessary — wrapper stderr is `/dev/null`, so -/// no parent-readable stream can be claimed as evidence by a later step. -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum ExecuteCommandHostOutcome { - /// Logical exit equaled the claim. - Matched, - /// Logical exit observed and did not match the claim. M1.5 maps this alone to - /// propositional `false` for the exit predicate. - Mismatch { expected: i64, actual: i64 }, - /// Pre-spawn input policy rejected the claim (e.g. shell `&` background). - PolicyRejected { policy: PolicyReject }, - /// `Command::spawn` failed, or the unshare bootstrap detected the logical command was - /// not executable. `wrapper` is `Some(_)` only when the unshare wrapper itself failed to - /// spawn before falling back to direct. - SpawnFailed { - wrapper: Option, - direct: String, - }, - /// Namespace / wrapper setup failed *before* the logical command ran. Only produced when - /// the direct fallback also could not spawn — a successful direct fallback becomes the - /// authoritative run and is reported as `Matched` / `Mismatch` / etc. - SetupFailed { reason: SetupFailReason }, - /// Wait-loop failure: timeout, IO, or signal-termination (no exit code). - WaitFailed(WaitFail), -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum PolicyReject { - /// `sh -c` script with a bare `&` not elidable as `&&` / fd redirect. - ShellBackgroundUnbounded, -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum SetupFailReason { - /// `unshare(1)` exited before the helper ran (namespace / clone / permission). The runner - /// attempted a direct fallback; this carrier is only produced when that fallback also - /// failed to spawn. - NamespaceSetupAndDirectSpawnFailed { direct: String }, - /// The `gunbc_execute_command_bootstrap` helper binary could not be located at runtime - /// (build-graph misconfiguration: `cargo test -p v3-compiler` without a prior - /// `cargo build -p execute-command-bootstrap`, or the `GUNBC_EXECUTE_COMMAND_BOOTSTRAP` - /// override pointing at a missing path). Distinct from `NamespaceSetupAndDirectSpawnFailed` - /// because no `unshare(1)` or direct `Child` was attempted — surfacing this as that - /// variant would lie about which steps failed (api-review cursor/composer-2 sha 7dd7825b). - HelperBinaryMissing { reason: String }, -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum WaitFail { - WallTimeout { - wall_time: Duration, - }, - Io(String), - /// Child terminated by signal — `ExitStatus::code()` returned `None`. - TerminatedBySignal, -} - -impl ExecuteCommandHostOutcome { - /// [`ClaimResult`] for [`TestRunner`] and `.dag` reporting; match on - /// [`ExecuteCommandHostOutcome`] before calling when you need typed discrimination. - pub fn into_claim_result(self) -> ClaimResult { - match self { - ExecuteCommandHostOutcome::Matched => ClaimResult::Pass, - ExecuteCommandHostOutcome::Mismatch { expected, actual } => ClaimResult::Fail(format!( - "{EXECUTE_COMMAND_EXIT_CODE_MISMATCH_MSG_PREFIX}{expected}, got {actual}" - )), - ExecuteCommandHostOutcome::PolicyRejected { policy } => match policy { - PolicyReject::ShellBackgroundUnbounded => { - ClaimResult::Fail(SHELL_C_BACKGROUND_UNBOUNDED_FAIL.to_string()) - } - }, - ExecuteCommandHostOutcome::SpawnFailed { wrapper, direct } => match wrapper { - Some(w) => ClaimResult::Fail(format!( - "ExecuteCommand: unshare(1) wrapper failed to spawn: {w}; direct spawn also failed: {direct} (P3/P4 — util-linux/namespace or host binary path)" - )), - None => ClaimResult::Fail(format!("ExecuteCommand spawn error: {direct}")), - }, - ExecuteCommandHostOutcome::SetupFailed { reason } => match reason { - SetupFailReason::NamespaceSetupAndDirectSpawnFailed { direct } => { - ClaimResult::Fail(format!( - "ExecuteCommand: namespace setup failed and direct fallback spawn also failed: {direct}" - )) - } - SetupFailReason::HelperBinaryMissing { reason } => ClaimResult::Fail(format!( - "ExecuteCommand: gunbc_execute_command_bootstrap helper not found: {reason}" - )), - }, - ExecuteCommandHostOutcome::WaitFailed(w) => match w { - WaitFail::WallTimeout { wall_time } => ClaimResult::Fail(format!( - "ExecuteCommand: process exceeded {:.2}s wall-clock limit (timeout — process group / child killed, fail-closed)", - wall_time.as_secs_f64() - )), - WaitFail::Io(err) => ClaimResult::Fail(format!( - "ExecuteCommand: wait on child failed: {err}" - )), - WaitFail::TerminatedBySignal => ClaimResult::Fail( - "ExecuteCommand: child terminated by signal (no host exit code)".to_string(), - ), - }, - } - } -} - -/// M1.5 and other **boolean** predicate reads: only these outcomes map to propositional -/// true/false; all other results are `Err(ClaimResult)` (not "false" for the claim). -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum ExecuteCommandM1_5Proposition { - Satisfied, - UnsatisfiedExitMismatch, -} - -/// Distinguish "exit ≠ expect" from timeout, spawn error, `&` policy, signal, etc. `Err` is -/// the rendered [`ClaimResult`] (use [`evaluate_execute_command_host_outcome`] directly when -/// you need the typed discriminant). -pub fn evaluate_execute_command_m1_5( - command: &str, - args: &[String], - expect_exit_code: i64, -) -> Result { - match evaluate_execute_command_host_outcome( - command, - args, - expect_exit_code, - EXECUTE_COMMAND_WALL_TIMEOUT, - ) { - ExecuteCommandHostOutcome::Matched => Ok(ExecuteCommandM1_5Proposition::Satisfied), - ExecuteCommandHostOutcome::Mismatch { .. } => { - Ok(ExecuteCommandM1_5Proposition::UnsatisfiedExitMismatch) - } - other => Err(other.into_claim_result()), - } -} - -/// Core host run: typed outcome. See [`ExecuteCommandHostOutcome`] for the P2(a)–(e) -/// realization. Map to [`ClaimResult`] with [`ExecuteCommandHostOutcome::into_claim_result`] -/// for [`TestRunner`]. -pub fn evaluate_execute_command_host_outcome( - command: &str, - args: &[String], - expect_exit_code: i64, - wall_time: Duration, -) -> ExecuteCommandHostOutcome { - if reject_unbounded_shell_background(command, args).is_some() { - return ExecuteCommandHostOutcome::PolicyRejected { - policy: PolicyReject::ShellBackgroundUnbounded, - }; - } - #[cfg(target_os = "linux")] - { - run_linux_unshare_then_direct(command, args, expect_exit_code, wall_time) - } - #[cfg(not(target_os = "linux"))] - { - run_direct(command, args, expect_exit_code, wall_time, None) - } -} - -/// Direct (non-unshare) host run. `wrapper_err` is `Some(_)` when this is the fallback after -/// `unshare(1)` itself failed to spawn; it is preserved in `SpawnFailed { wrapper, direct }` -/// if direct also fails, so the caller does not lose the wrapper-side reason. -fn run_direct( - command: &str, - args: &[String], - expect_exit_code: i64, - wall_time: Duration, - wrapper_err: Option, -) -> ExecuteCommandHostOutcome { - let mut child = match build_execute_command_process(command, args).spawn() { - Ok(c) => c, - Err(e) => { - return ExecuteCommandHostOutcome::SpawnFailed { - wrapper: wrapper_err, - direct: format!("{e}"), - }; - } - }; - finish_after_wait(&mut child, expect_exit_code, wall_time) -} - -#[cfg(target_os = "linux")] -fn run_linux_unshare_then_direct( - command: &str, - args: &[String], - expect_exit_code: i64, - wall_time: Duration, -) -> ExecuteCommandHostOutcome { - // Locate the helper binary BEFORE creating the pipe. If the helper is missing this is a - // configuration error — surface as a typed `SetupFailed` so a misconfigured deployment - // cannot silently degrade through `run_direct` (which would skip the unshare containment - // entirely without the operator knowing). - let helper = match locate_unshare_bootstrap_helper() { - Ok(p) => p, - Err(reason) => { - return ExecuteCommandHostOutcome::SetupFailed { - reason: SetupFailReason::HelperBinaryMissing { reason }, - }; - } - }; - let mut ready = match UnshareReadyPipe::new() { - Ok(p) => p, - Err(e) => { - // pipe2 failed — drop the unshare path entirely and try direct. - return run_direct( - command, - args, - expect_exit_code, - wall_time, - Some(format!("ready-pipe: {e}")), - ); - } - }; - let mut child = match build_execute_command_unshare(&helper, command, args, &ready).spawn() { - Ok(c) => c, - Err(e_unshare) => { - return run_direct( - command, - args, - expect_exit_code, - wall_time, - Some(format!("{e_unshare}")), - ); - } - }; - // Close parent's write end so the read end sees EOF after the child exits. - ready.close_write_end_in_parent(); - - let status = match child_wait_for_execute_command(&mut child, wall_time) { - Ok(s) => s, - Err(ChildWaitFail::WallTimeout { wall_time }) => { - return ExecuteCommandHostOutcome::WaitFailed(WaitFail::WallTimeout { wall_time }); - } - Err(ChildWaitFail::Io(err)) => { - return ExecuteCommandHostOutcome::WaitFailed(WaitFail::Io(err)); - } - }; - - let sentinel = match ready.read_sentinel() { - Ok(bytes) => bytes, - Err(io_err) => { - // Sentinel read failed (real error, not EINTR — that's retried in-loop). After - // the unshare child has been reaped we cannot rule out that the logical command - // already ran. Surfacing as a typed wait-failure (NOT a `NamespaceSetupFailed` → - // direct fallback) avoids implicit re-execution. (api-review openai-pro/ - // gpt-5-5-pro sha 9fea084e.) - return ExecuteCommandHostOutcome::WaitFailed(WaitFail::Io(format!( - "ready-pipe read: {io_err}" - ))); - } - }; - match unshare_bootstrap_stage_from_sentinel(&sentinel) { - UnshareBootstrapStage::LogicalCommandExeced => { - classify_logical_exit(status, expect_exit_code) - } - UnshareBootstrapStage::LogicalCommandNotExecutable => { - ExecuteCommandHostOutcome::SpawnFailed { - wrapper: None, - direct: format!( - "logical command `{command}` not executable (no such file or not in PATH)" - ), - } - } - UnshareBootstrapStage::LogicalExecFailed => { - // Probe passed but `execvp(3)` returned a failure (TOCTOU, ENOEXEC, ETXTBSY, - // ...). The wrapper exit code is the helper binary's, NOT the logical command's - // — surface as `SpawnFailed` so a claim expecting (e.g.) 126 cannot Match an - // unexec'd binary (P2(c) regression manager flagged on draft review). - ExecuteCommandHostOutcome::SpawnFailed { - wrapper: None, - direct: format!( - "logical command `{command}` failed to exec after executable probe passed (TOCTOU/ENOEXEC/ETXTBSY)" - ), - } - } - UnshareBootstrapStage::NamespaceSetupFailed => { - // util-linux exited before the helper binary ran. Direct fallback is the *first* - // logical run, not a recovery re-exec (P2(d)). - match build_execute_command_process(command, args).spawn() { - Ok(mut direct_child) => { - finish_after_wait(&mut direct_child, expect_exit_code, wall_time) - } - Err(e) => ExecuteCommandHostOutcome::SetupFailed { - reason: SetupFailReason::NamespaceSetupAndDirectSpawnFailed { - direct: format!("{e}"), - }, - }, - } - } - } -} - -fn finish_after_wait( - child: &mut std::process::Child, - expect_exit_code: i64, - wall_time: Duration, -) -> ExecuteCommandHostOutcome { - match child_wait_for_execute_command(child, wall_time) { - Ok(status) => classify_logical_exit(status, expect_exit_code), - Err(ChildWaitFail::WallTimeout { wall_time }) => { - ExecuteCommandHostOutcome::WaitFailed(WaitFail::WallTimeout { wall_time }) - } - Err(ChildWaitFail::Io(err)) => ExecuteCommandHostOutcome::WaitFailed(WaitFail::Io(err)), - } -} - -fn classify_logical_exit( - status: std::process::ExitStatus, - expect_exit_code: i64, -) -> ExecuteCommandHostOutcome { - let Some(actual) = status.code().map(i64::from) else { - return ExecuteCommandHostOutcome::WaitFailed(WaitFail::TerminatedBySignal); - }; - if actual == expect_exit_code { - ExecuteCommandHostOutcome::Matched - } else { - ExecuteCommandHostOutcome::Mismatch { - expected: expect_exit_code, - actual, - } - } -} - -fn evaluate_execute_command_exit_code_with_wall_time( - command: &str, - args: &[String], - expect_exit_code: i64, - wall_time: Duration, -) -> ClaimResult { - evaluate_execute_command_host_outcome(command, args, expect_exit_code, wall_time) - .into_claim_result() -} - -#[derive(Debug, Clone)] -pub struct TestClaimValue { - pub claim_name: String, - pub declaration_file: String, - pub source: String, - pub file_name: String, - pub predicate: FieldValue, - pub requires: Vec, -} - -pub struct TestRunner<'a> { - dag: &'a Dag, -} - -/// Resolved `PerfBaselineMeasurement` carrier read from a `.dag data` -/// declaration body. Consumed by [`TestRunner::eval_perf_within_baseline`] -/// to apply the Director-locked Tier-3 budget thresholds (`r3-structure.md` -/// §225). Carrier shape mirrors `src/v3/std/substrate.dag` `PerfBaselineMeasurement`. -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -struct PerfMeasurement { - median_ns: i64, - p99_ns: i64, -} - -/// Which budget axis overflowed when computing thresholds; produced by -/// [`compute_perf_budget_bounds`]. Single-authority for the §225 ratio -/// arithmetic — both the runtime evaluator and unit tests call through -/// this function so the `× 2` / `× 5` constants live in one place. -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -enum PerfBudgetOverflow { - Median, - P99, -} - -/// Apply the Director-locked §225 ratio thresholds to a baseline: -/// `median_bound = baseline.median_ns × 2`, `p99_bound = baseline.p99_ns × 5` -/// where `baseline.p99_ns` is the **absolute** p99 (`median_ns + p99_delta_ns` -/// from substrate `PerfBaselineMeasurement`). -/// Saturate-on-overflow → `Err(PerfBudgetOverflow::*)` so the runtime can -/// fail-closed without silently wrapping. Single-authority for the budget -/// arithmetic per `INVARIANTS.md` P2. -fn compute_perf_budget_bounds(baseline: PerfMeasurement) -> Result<(i64, i64), PerfBudgetOverflow> { - let median_bound = baseline - .median_ns - .checked_mul(2) - .ok_or(PerfBudgetOverflow::Median)?; - let p99_bound = baseline - .p99_ns - .checked_mul(5) - .ok_or(PerfBudgetOverflow::P99)?; - Ok((median_bound, p99_bound)) -} - -/// Typed resolver failures for [`TestRunner::perf_baseline_measurement`]. -/// Per `CODING.md` typed-error discipline: raw `String` is reserved for the -/// `ClaimResult::Fail` boundary at [`PerfMeasurementResolveError::into_claim_fail`]; -/// inner helpers carry structural variants. -/// -/// **🟢 TERMINAL coproduct** (per `docs/modeling-discipline.md` Practice 4 -/// classification checkpoint). Variants enumerate failure shapes when reading a -/// `PerfBaselineMeasurement` data declaration: missing declaration, wrong -/// connective, missing/wrong-kind fields, negative `Nat` literals where the -/// substrate requires nonnegative durations, or `median_ns + p99_delta_ns` overflow -/// when constructing absolute p99 for evaluation. -#[derive(Debug, Clone, PartialEq, Eq)] -enum PerfMeasurementResolveError { - /// `DeclarationId` did not resolve via [`Dag::declaration_opt`] — - /// substrate-integrity violation. - MissingDeclaration, - /// Declaration's `value_body` is not `ValueBody::Structural` (e.g. - /// `Unparsed`, `Scalar`, `List`, or `None`); a `PerfBaselineMeasurement` - /// data declaration must be a record literal. - WrongConnective, - /// Required field absent from the structural record body. - MissingField { field: &'static str }, - /// Required field present but not `FieldValue::Literal(LiteralBits::Int(_))`. - WrongFieldKind { field: &'static str }, - /// Field is an `Int` literal but negative while `PerfBaselineMeasurement` uses - /// `Nat` in `substrate.dag` (fail-closed vs silently treating delta as signed). - NegativeNatLiteral { field: &'static str }, - /// `median_ns + p99_delta_ns` does not fit in `i64` (substrate uses `Nat`; - /// absolute p99 construction is fail-closed). - P99ConstructionOverflow, -} - -impl PerfMeasurementResolveError { - /// Convert the typed error into `ClaimResult::Fail` reason text with the - /// role label preserved for triage. - fn into_claim_fail(self, role: &str) -> String { - match self { - Self::MissingDeclaration => format!( - "PerfWithinBaseline `{role}`: declaration id did not resolve in DAG \ - (substrate-integrity violation)" - ), - Self::WrongConnective => format!( - "PerfWithinBaseline `{role}`: declaration is not a structural record \ - (expected `PerfBaselineMeasurement {{ median_ns, p99_delta_ns }}`)" - ), - Self::MissingField { field } => { - format!("PerfWithinBaseline `{role}`: record is missing required field `{field}`") - } - Self::WrongFieldKind { field } => { - format!("PerfWithinBaseline `{role}`: field `{field}` is not an Int literal") - } - Self::NegativeNatLiteral { field } => format!( - "PerfWithinBaseline `{role}`: field `{field}` must be a nonnegative Nat literal" - ), - Self::P99ConstructionOverflow => format!( - "PerfWithinBaseline `{role}`: median_ns + p99_delta_ns overflowed i64 \ - (absolute p99 construction fail-closed)" - ), - } - } -} - -enum ProgramInputRole { - ProgramInput, - ProgramOutputBind { output_bind_name: String }, -} - -impl ProgramInputRole { - fn output_bind_name(&self) -> Option<&str> { - match self { - Self::ProgramInput => None, - Self::ProgramOutputBind { output_bind_name } => Some(output_bind_name), - } - } - - fn is_program_input(&self) -> bool { - matches!(self, Self::ProgramInput) - } -} - -#[derive(Debug, Clone, PartialEq, Eq)] -enum DiagnosticDetailFilter { - Any, - Contains(String), -} - -fn tc2_church_rosser_strict_fire_report_role_ids( - dag: &Dag, - left_id: DeclarationId, - right_id: DeclarationId, -) -> bool { - declaration_has_exact_name(dag, left_id, TC2_CHURCH_ROSSER_STRICT_FIRE_LEFT_REPORT) - && declaration_has_exact_name(dag, right_id, TC2_CHURCH_ROSSER_STRICT_FIRE_RIGHT_REPORT) -} - -fn declaration_has_exact_name(dag: &Dag, id: DeclarationId, expected: &str) -> bool { - dag.declaration(id).name.as_deref() == Some(expected) -} - -fn tc3_pattern_a_second_mover_strict_fire_report_role_ids( - dag: &Dag, - left_id: DeclarationId, - right_id: DeclarationId, -) -> bool { - declaration_has_exact_name(dag, left_id, TC3_PATTERN_A_BASELINE_REPORT) - && declaration_has_exact_name(dag, right_id, TC3_PATTERN_A_COMPARE_REPORT) -} - -/// Build one TC3 second-mover projection report by evaluating the program under the supplied -/// applicative `InputEvaluationOrder`. The baseline projection runs `LeftFirst`; the compare -/// projection runs `RightFirst`. Strong-normalization is the load-bearing claim — under any -/// terminating reduction order the program reaches the same top-level `Value`, so the two -/// projections (genuinely distinct evaluator runs through `evaluate_body`) must agree on -/// `Value` for `BinaryDimensionReportEquals` to Pass. The resulting envelope carries the -/// projection's `dimension_name` so the report-pair is non-vacuous in the equivalence check. -fn build_tc3_pattern_a_second_mover_projection_report( - program_dag: &Dag, - bind_id: NodeId, - dimension_name: &str, - order: InputEvaluationOrder, -) -> Result<(DimensionReport, Value), EvalError> { - let frame = EvalFrame::from_bindings(Vec::<(PortId, Value)>::new()).expect("empty root frame"); - let mut state = EvalStateStack::with_root_frame(frame); - let strategy = EvalStrategy::ApplicativeOrder { input_order: order }; - let value = evaluate_body(program_dag, bind_id, &mut state, strategy)?; - let report = DimensionReport::DimensionOk { - dimension_name: dimension_name.to_string(), - composed: program_dag.clone(), - witnesses: Vec::new(), - }; - Ok((report, value)) -} - -/// Receipt for the TC3 Pattern-A second-mover **host slice** (bounded runner bridge). -/// -/// Load-bearing: identical evaluated top-level [`Value`]s under genuinely distinct evaluator -/// runs — `LeftFirst` (baseline projection) vs `RightFirst` (compare projection). For -/// strongly-normalizing programs every reduction order yields the same value; disagreement here -/// is a strong-normalization counterexample on this representative. Envelope: both sides are -/// [`DimensionReport::DimensionOk`] with empty witness lists (scaffold) and distinct -/// `dimension_name` strings so the two projection roles were exercised. `composed` is the same -/// lowered-program `Dag` clone by construction; a future substrate-side eval-step / bounded-step -/// producer (per `r3-evaluator-tc3-d4-eval-step-producer-worker.md`) would supply non-vacuous -/// witnesses / divergent carriers. -fn tc3_pattern_a_second_mover_dimension_reports_equivalent_under_binary_equals( - left: &DimensionReport, - left_value: &Value, - right: &DimensionReport, - right_value: &Value, -) -> bool { - if left_value != right_value { - return false; - } - match (left, right) { - ( - DimensionReport::DimensionOk { - witnesses: lw, - dimension_name: na, - .. - }, - DimensionReport::DimensionOk { - witnesses: rw, - dimension_name: nb, - .. - }, - ) => na != nb && lw.is_empty() && rw.is_empty(), - _ => false, - } -} - -fn tc2_church_rosser_strategy_dimension_name(order: InputEvaluationOrder) -> String { - match order { - InputEvaluationOrder::LeftFirst => { - "tc2_church_rosser:ApplicativeOrder:LeftFirst".to_string() - } - InputEvaluationOrder::RightFirst => { - "tc2_church_rosser:ApplicativeOrder:RightFirst".to_string() - } - } -} - -fn build_tc2_church_rosser_strategy_dimension_report( - program_dag: &Dag, - bind_id: NodeId, - order: InputEvaluationOrder, -) -> Result<(DimensionReport, Value), EvalError> { - let frame = EvalFrame::from_bindings(Vec::<(PortId, Value)>::new()).expect("empty root frame"); - let mut state = EvalStateStack::with_root_frame(frame); - let dimension_name = tc2_church_rosser_strategy_dimension_name(order.clone()); - let strategy = EvalStrategy::ApplicativeOrder { input_order: order }; - let value = evaluate_body(program_dag, bind_id, &mut state, strategy)?; - let report = DimensionReport::DimensionOk { - dimension_name, - composed: program_dag.clone(), - witnesses: Vec::new(), - }; - Ok((report, value)) -} - -/// Receipt for the TC2 Church-Rosser **host slice** (bounded runner bridge). -/// -/// Load-bearing: identical evaluated top-level [`Value`]s under `LeftFirst` vs `RightFirst`. -/// Envelope: both sides are [`DimensionReport::DimensionOk`] with empty witness lists (scaffold), -/// and distinct `dimension_name` strings so the two requested strategies were exercised. -/// `composed` is always the same lowered-program `Dag` clone by construction, so it is not used -/// for inequality here (a future substrate producer would supply non-vacuous witnesses / carriers). -fn tc2_church_rosser_dimension_reports_equivalent_under_binary_equals( - left: &DimensionReport, - left_value: &Value, - right: &DimensionReport, - right_value: &Value, -) -> bool { - if left_value != right_value { - return false; - } - match (left, right) { - ( - DimensionReport::DimensionOk { - witnesses: lw, - dimension_name: na, - .. - }, - DimensionReport::DimensionOk { - witnesses: rw, - dimension_name: nb, - .. - }, - ) => na != nb && lw.is_empty() && rw.is_empty(), - _ => false, - } -} - -impl<'a> TestRunner<'a> { - pub fn new(dag: &'a Dag) -> Self { - Self { dag } - } - - pub fn run_suite(&self, suite_name: &str) -> Vec { - let Some(suite) = self.dag.declaration_by_name(suite_name) else { - return vec![ClaimEvaluation { - claim_name: suite_name.to_string(), - result: ClaimResult::Fail(format!("TestSuite `{suite_name}` not found")), - }]; - }; - let Some(fields) = structural_fields(suite) else { - return vec![ClaimEvaluation { - claim_name: suite_name.to_string(), - result: ClaimResult::Fail(format!("TestSuite `{suite_name}` is not structural")), - }]; - }; - let Some(FieldValue::List(claims)) = field(fields, "claims") else { - return vec![ClaimEvaluation { - claim_name: suite_name.to_string(), - result: ClaimResult::Fail(format!("TestSuite `{suite_name}` is missing `claims`")), - }]; - }; - claims - .iter() - .map(|entry| self.run_suite_entry(suite_name, entry)) - .collect() - } - - fn run_suite_entry(&self, suite_name: &str, entry: &FieldValue) -> ClaimEvaluation { - let Some((label, payload)) = self.variant_value(entry) else { - return ClaimEvaluation { - claim_name: suite_name.to_string(), - result: ClaimResult::Fail(format!( - "TestSuite `{suite_name}` claim entry is not a SuiteClaim variant: {entry:?}" - )), - }; - }; - // Both `SuiteClaim` variants are single-argument coproduct arms - // (`Enumerated(TestClaim)` / `Quantified(QuantifiedTestClaim)`) — any - // other payload arity is ill-shaped and must fail closed at the - // boundary (INVARIANTS P3). - if payload.len() != 1 { - return ClaimEvaluation { - claim_name: suite_name.to_string(), - result: ClaimResult::Fail(format!( - "TestSuite `{suite_name}` `{label}` expects exactly 1 payload argument, got {}: {payload:?}", - payload.len() - )), - }; - } - let Some(FieldValue::Reference(id)) = payload.first() else { - return ClaimEvaluation { - claim_name: suite_name.to_string(), - result: ClaimResult::Fail(format!( - "TestSuite `{suite_name}` `{label}` payload is not a reference: {payload:?}" - )), - }; - }; - let decl = self.dag.declaration(*id); - let decl_label = decl - .name - .clone() - .unwrap_or_else(|| format!("Declaration#{}", id.raw())); - match label.as_str() { - "Enumerated" => match TestClaimValue::from_declaration(decl) { - Ok(claim) => self.run_claim(&claim), - Err(reason) => ClaimEvaluation { - claim_name: decl_label, - result: ClaimResult::Fail(reason), - }, - }, - "Quantified" => match parse_quantified_test_claim_for_evaluation(self.dag, decl) { - Ok(parsed) => self.evaluate_quantified_test_claim(parsed), - Err(reason) => ClaimEvaluation { - claim_name: decl_label, - result: ClaimResult::Fail(reason), - }, - }, - other => ClaimEvaluation { - claim_name: suite_name.to_string(), - result: ClaimResult::Fail(format!( - "TestSuite `{suite_name}` unknown SuiteClaim variant `{other}`" - )), - }, - } - } - - fn evaluate_quantified_test_claim(&self, q: ParsedQuantifiedTestClaim) -> ClaimEvaluation { - let ParsedQuantifiedTestClaim { - name: claim_name, - declaration_file, - shapes, - quantifier, - predicate, - requires, - } = q; - - match quantifier { - QuantifierKind::ForAll => { - if shapes.is_empty() { - return ClaimEvaluation { - claim_name, - result: ClaimResult::Pass, - }; - } - // Tri-state fold (codex/api-review): decisive Fail short-circuits; accumulate first - // NotYetImplemented and continue — refute ∃ decisive counterexample before surfacing - // deferred predicate scaffolding (design-tests-as-data-completeness §8.1). - let mut pending_nyi: Option<(usize, String, String)> = None; - for (idx, (source, file_name)) in shapes.iter().enumerate() { - let claim = TestClaimValue { - claim_name: claim_name.clone(), - declaration_file: declaration_file.clone(), - source: source.clone(), - file_name: file_name.clone(), - predicate: predicate.clone(), - requires: requires.clone(), - }; - match self.run_claim(&claim).result { - ClaimResult::Pass => {} - ClaimResult::Fail(msg) => { - return ClaimEvaluation { - claim_name: claim_name.clone(), - result: ClaimResult::Fail(format!( - "QuantifiedTestClaim `{claim_name}` ForAll failed at sample {} of {} (`{file_name}`): {msg}", - idx + 1, - shapes.len(), - )), - }; - } - ClaimResult::NotYetImplemented(msg) => { - if pending_nyi.is_none() { - pending_nyi = Some((idx + 1, file_name.clone(), msg)); - } - } - } - } - if let Some((sample_idx, file_name, msg)) = pending_nyi { - let cn = claim_name.clone(); - return ClaimEvaluation { - claim_name, - result: ClaimResult::NotYetImplemented(format!( - "QuantifiedTestClaim `{cn}` ForAll predicate NotYetImplemented at sample {sample_idx} of {} (`{file_name}`): {msg}; quantifier fold: no decisive Fail among other samples — cannot certify universal quantification until deferred predicate(s) land", - shapes.len(), - )), - }; - } - ClaimEvaluation { - claim_name, - result: ClaimResult::Pass, - } - } - QuantifierKind::Exists => { - if shapes.is_empty() { - return ClaimEvaluation { - claim_name: claim_name.clone(), - result: ClaimResult::Fail(format!( - "QuantifiedTestClaim `{claim_name}` Exists found no witness among 0 programs" - )), - }; - } - // Tri-state fold: seek a decisive Pass; skip Fail; defer first NYI but keep scanning — - // order must not suppress a later witness (§8.1 symmetry vs ForAll fail-fast). - let mut pending_nyi: Option<(usize, String, String)> = None; - for (idx, (source, file_name)) in shapes.iter().enumerate() { - let claim = TestClaimValue { - claim_name: claim_name.clone(), - declaration_file: declaration_file.clone(), - source: source.clone(), - file_name: file_name.clone(), - predicate: predicate.clone(), - requires: requires.clone(), - }; - match self.run_claim(&claim).result { - ClaimResult::Pass => { - return ClaimEvaluation { - claim_name, - result: ClaimResult::Pass, - }; - } - ClaimResult::Fail(_) => {} - ClaimResult::NotYetImplemented(msg) => { - if pending_nyi.is_none() { - pending_nyi = Some((idx + 1, file_name.clone(), msg)); - } - } - } - } - if let Some((sample_idx, file_name, msg)) = pending_nyi { - let cn = claim_name.clone(); - return ClaimEvaluation { - claim_name, - result: ClaimResult::NotYetImplemented(format!( - "QuantifiedTestClaim `{cn}` Exists predicate NotYetImplemented at sample {sample_idx} of {} (`{file_name}`): {msg}; quantifier fold: no decisive Pass among samples — cannot certify existential witness until deferred predicate(s) land", - shapes.len(), - )), - }; - } - let msg = format!( - "QuantifiedTestClaim `{}` Exists found no witness among {} programs", - claim_name, - shapes.len() - ); - ClaimEvaluation { - claim_name, - result: ClaimResult::Fail(msg), - } - } - } - } - - pub fn run_claim(&self, claim: &TestClaimValue) -> ClaimEvaluation { - let result = match self.variant_value(&claim.predicate) { - Some((label, payload)) => { - if !claim.requires.is_empty() - && !matches!(label.as_str(), "MockBackedInvariant" | "ForAllTargets") - { - ClaimResult::Fail(format!( - "TestClaim `{}` declares {} resource requirement(s), but predicate `{}` does not consume `requires`", - claim.claim_name, - claim.requires.len(), - label - )) - } else { - match label.as_str() { - "Compiles" => self.eval_compiles(claim), - "FailsWithDiagnostic" => self.eval_fails_with_diagnostic(claim, &payload), - "OutputEquals" => self.eval_output_equals(claim, &payload), - "PortHasState" => self.eval_port_has_state(claim, &payload), - "DeclarationHasRefinement" => { - self.eval_declaration_has_refinement(claim, &payload) - } - "CostBounded" => self.eval_cost_bounded(claim, &payload), - "PerfWithinBaseline" => self.eval_perf_within_baseline(claim, &payload), - "LensOutputEquals" => self.eval_lens_output_equals(claim, &payload), - "DifferentialEquals" => self.eval_differential_equals(claim, &payload), - "ForAllTargets" => self.eval_for_all_targets(claim, &payload), - "BinaryDimensionReportEquals" => { - self.eval_binary_dimension_report_equals(claim, &payload) - } - "SymbolicCostExprEquals" => { - self.eval_symbolic_cost_expr_equals_shape(claim, &payload, None) - } - "SymbolicCostExprEqualsForBindParam" => { - self.eval_symbolic_cost_expr_equals_for_bind_param(claim, &payload) - } - "AlgebraicLaw" => self.eval_algebraic_law(claim, &payload), - "ExecuteCommand" => self.eval_execute_command(claim, &payload), - "CensusBoundCheck" => self.eval_census_bound_check_shape(claim, &payload), - "CensusSubsetCount" => self.eval_census_subset_count_shape(claim, &payload), - "FixedPointConverges" => { - self.eval_fixed_point_converges_shape(claim, &payload) - } - "RatchetZero" => self.eval_ratchet_zero_shape(claim, &payload), - "BridgeLedgerZero" => self.eval_bridge_ledger_zero(claim, &payload), - "GeneratedFromDag" => self.eval_generated_from_dag_shape(claim, &payload), - "CementingDispatchMatchesProjection" => { - match cementing_dispatch::evaluate_cementing_dispatch_projection( - self.dag, - claim.declaration_file.as_str(), - &payload, - ) { - Ok(()) => ClaimResult::Pass, - Err(reason) => ClaimResult::Fail(reason), - } - } - "ReleaseDeferredClaim" => { - self.eval_release_deferred_claim_shape(claim, &payload) - } - "SubstrateResearchDeferredClaim" => { - self.eval_substrate_research_deferred_claim_shape(claim, &payload) - } - "MockBackedInvariant" => { - if !claim.requires.is_empty() { - if let Err(reason) = self.validate_resource_requirements(claim) { - return ClaimEvaluation { - claim_name: claim.claim_name.clone(), - result: ClaimResult::Fail(reason), - }; - } - } - let inner = self.eval_mock_backed_invariant(claim, &payload); - if claim.requires.is_empty() { - match inner { - ClaimResult::Pass => ClaimResult::NotYetImplemented( - "MockBackedInvariant: `TestClaim.requires` is empty — DB-15 mock \ - obligations attach only on `requires` as `ResourceReference` edges; \ - hermetic subject/invariant application succeeded but is not a mock-backed \ - receipt until at least one obligation is declared." - .to_string(), - ), - other => other, - } - } else { - inner - } - } - other => ClaimResult::NotYetImplemented(format!( - "TestPredicate::{other} is not wired in the Rust runner yet" - )), - } - } - } - None => ClaimResult::Fail("predicate is not a structural variant".to_string()), - }; - ClaimEvaluation { - claim_name: claim.claim_name.clone(), - result, - } - } - - fn eval_compiles(&self, claim: &TestClaimValue) -> ClaimResult { - match compile_to_dag(&claim.source, &claim.file_name) { - Ok(_) => ClaimResult::Pass, - Err(CompileError::Semantic(_)) => { - ClaimResult::Fail("compiled with diagnostics".to_string()) - } - Err(err) => { - ClaimResult::Fail(format!("compile failed before semantic analysis: {err:?}")) - } - } - } - - fn eval_fails_with_diagnostic( - &self, - claim: &TestClaimValue, - payload: &[FieldValue], - ) -> ClaimResult { - let [reference] = payload else { - return ClaimResult::Fail( - "FailsWithDiagnostic payload should be a DiagnosticReference".to_string(), - ); - }; - match compile_to_dag(&claim.source, &claim.file_name) { - Ok(_) => ClaimResult::Fail("source compiled cleanly".to_string()), - Err(CompileError::Semantic(dag)) => match self.diagnostic_matches(&dag, reference) { - Ok(true) => ClaimResult::Pass, - Ok(false) => ClaimResult::Fail("expected diagnostic was not found".to_string()), - Err(reason) => ClaimResult::Fail(reason), - }, - Err(CompileError::Tokenize(diagnostic)) | Err(CompileError::Parse(diagnostic)) => { - match self.diagnostic_matches_single(&diagnostic, reference) { - Ok(true) => ClaimResult::Pass, - Ok(false) => ClaimResult::Fail("expected diagnostic was not found".to_string()), - Err(reason) => ClaimResult::Fail(reason), - } - } - } - } - - fn eval_output_equals(&self, claim: &TestClaimValue, payload: &[FieldValue]) -> ClaimResult { - let [FieldValue::Literal(LiteralBits::String(expected))] = payload else { - return ClaimResult::Fail("OutputEquals payload should be a String".to_string()); - }; - let dag = match compile_to_dag(&claim.source, &claim.file_name) { - Ok(dag) => dag, - Err(err) => return ClaimResult::Fail(format!("source did not compile: {err:?}")), - }; - let Some(value) = dag - .declarations() - .iter() - .find(|decl| decl.span.file == claim.file_name && decl.value_body.is_some()) - .and_then(|decl| decl.value_body.as_ref()) - else { - return ClaimResult::Fail("no data declaration value found".to_string()); - }; - let actual = render_value_body(&dag, value); - if actual == *expected { - ClaimResult::Pass - } else { - ClaimResult::Fail(format!("expected `{expected}`, got `{actual}`")) - } - } - - fn eval_port_has_state(&self, claim: &TestClaimValue, payload: &[FieldValue]) -> ClaimResult { - let [FieldValue::Literal(LiteralBits::String(bind_name)), expected_state] = payload else { - return ClaimResult::Fail( - "PortHasState payload should be (String, PortStateExpectation)".to_string(), - ); - }; - let dag = match compile_to_dag(&claim.source, &claim.file_name) { - Ok(dag) => dag, - Err(CompileError::Semantic(dag)) => dag, - Err(err) => return ClaimResult::Fail(format!("source did not lower: {err:?}")), - }; - let Some(bind) = find_bind(&dag, bind_name, &claim.file_name) else { - return ClaimResult::Fail(format!("bind `{bind_name}` not found")); - }; - let Some((label, payload)) = self.variant_value(expected_state) else { - return ClaimResult::Fail("state expectation is not a variant".to_string()); - }; - if !payload.is_empty() { - return ClaimResult::Fail("state expectation should not carry payload".to_string()); - } - let matches = matches!( - (label.as_str(), dag.port(bind.value).state()), - ("Resolved", PortState::Resolved(_)) - | ("Unresolved", PortState::Uninferred | PortState::Unresolved) - ); - if matches { - ClaimResult::Pass - } else { - ClaimResult::Fail(format!("bind `{bind_name}` state did not match `{label}`")) - } - } - - fn eval_declaration_has_refinement( - &self, - claim: &TestClaimValue, - payload: &[FieldValue], - ) -> ClaimResult { - let name = match payload { - [FieldValue::Literal(LiteralBits::String(name))] => name.clone(), - [single] => { - let Some(fields) = record_fields(single) else { - return ClaimResult::Fail( - "DeclarationHasRefinement: expected `{ declaration_name: String }` record \ - or a bare String payload" - .to_string(), - ); - }; - match string_field(fields, "declaration_name") { - Ok(s) => s, - Err(e) => return ClaimResult::Fail(e), - } - } - _ => { - return ClaimResult::Fail(format!( - "DeclarationHasRefinement: expected one payload field, got {}", - payload.len() - )); - } - }; - let dag = match compile_to_dag(&claim.source, &claim.file_name) { - Ok(dag) => dag, - Err(CompileError::Semantic(_)) => { - return ClaimResult::Fail("compiled with diagnostics".to_string()); - } - Err(err) => { - return ClaimResult::Fail(format!( - "DeclarationHasRefinement: compile failed before structural check: {err:?}" - )); - } - }; - let Some(decl) = dag.declaration_by_name(&name) else { - return ClaimResult::Fail(format!( - "DeclarationHasRefinement: declaration `{name}` not found in `{}`", - claim.file_name - )); - }; - if decl.refinement.is_some() { - ClaimResult::Pass - } else { - ClaimResult::Fail(format!( - "DeclarationHasRefinement: declaration `{name}` has no lowered `refinement` edge" - )) - } - } - - fn eval_lens_output_equals( - &self, - claim: &TestClaimValue, - payload: &[FieldValue], - ) -> ClaimResult { - let [lens_fv, input_fv, expected_fv] = payload else { - return ClaimResult::Fail(format!( - "LensOutputEquals payload should be exactly three DeclarationRef fields \ - (lens_ref, input_ref, expected_ref); got {} payload slot(s)", - payload.len() - )); - }; - let lens_id = match self.resolve_declaration_ref_id(lens_fv, "lens_ref") { - Ok(id) => id, - Err(msg) => return ClaimResult::Fail(msg), - }; - let input_id = match self.resolve_declaration_ref_id(input_fv, "input_ref") { - Ok(id) => id, - Err(msg) => return ClaimResult::Fail(msg), - }; - let expected_id = match self.resolve_declaration_ref_id(expected_fv, "expected_ref") { - Ok(id) => id, - Err(msg) => return ClaimResult::Fail(msg), - }; - - let lens_decl = self.dag.declaration(lens_id); - let input_decl = self.dag.declaration(input_id); - let expected_decl = self.dag.declaration(expected_id); - - let lens_name = decl_display_name(lens_id, lens_decl); - let input_name = decl_display_name(input_id, input_decl); - let expected_name = decl_display_name(expected_id, expected_decl); - - let program_input = match self.program_input_role(input_decl) { - Ok(role) => role, - Err(msg) => return ClaimResult::Fail(format!("LensOutputEquals: {msg}")), - }; - - if input_decl.value_body.is_none() && program_input.is_none() { - return ClaimResult::Fail(format!( - "LensOutputEquals: input_ref `{input_name}` has no value body" - )); - } - if expected_decl.value_body.is_none() { - return ClaimResult::Fail(format!( - "LensOutputEquals: expected_ref `{expected_name}` has no value body" - )); - } - - // INVARIANTS P2 (executable single authority): `lens_ref` is the runner's lens identity. - // The lens body is applied from the same fixture Dag that resolved the `DeclarationRef`; - // reflected `FieldValue` List / Behavior variant ids therefore come from that Dag as well. - // `TestClaim.source` is the program under test, not a second lens-body authority. - // INVARIANTS P3 / TESTING: `TestClaim.source` must lower cleanly — never ignore - // tokenize/parse failures and fall back to the fixture graph (that would let malformed - // programs `Pass` when inputs/lens resolve only from the fixture). - let program_dag = match compile_to_dag(&claim.source, &claim.file_name) { - Ok(dag) => dag, - Err(CompileError::Semantic(dag)) => { - return ClaimResult::Fail(format!( - "LensOutputEquals: claim `source` / `{}` failed inference: {:?}", - claim.file_name, - dag.diagnostics().iter().collect::>() - )); - } - Err(err) => { - return ClaimResult::Fail(format!( - "LensOutputEquals: claim `source` / `{}` did not compile: {err:?}", - claim.file_name - )); - } - }; - - if let Some(result) = self.eval_gate_87_cementing_projection( - lens_decl.name.as_deref(), - &lens_name, - &program_dag, - &claim.file_name, - expected_decl, - &expected_name, - ) { - return result; - } - - // R3 gate #43 (`auto_parallelism_independent_binds_emit_parallel`): independent top-level - // binds must emit a parallel Rust schedule (`std::thread::scope`). Structural witness via - // program text — dissolution when ordinary DB-20 parallelism lens output reaches `.dag`. - if lens_decl.name.as_deref() == Some(R3_PARALLEL_EMIT_WITNESS_LENS_NAME) { - let expected_int = match expected_decl.value_body.as_ref() { - Some(ValueBody::Scalar(LiteralBits::Int(s))) => match s.parse::() { - Ok(v) => v, - Err(_) => { - return ClaimResult::Fail(format!( - "LensOutputEquals(r3_auto_parallelism_parallel_emit_witness): expected Int literal is not a valid i64 decimal for `{expected_name}`" - )); - } - }, - _ => { - return ClaimResult::Fail(format!( - "LensOutputEquals(r3_auto_parallelism_parallel_emit_witness): expected_ref `{expected_name}` must be `data …: Int = `" - )); - } - }; - let emitted = match crate::emit_rust::emit_rust(&program_dag) { - Ok(s) => s, - Err(err) => { - return ClaimResult::Fail(format!( - "LensOutputEquals(r3_auto_parallelism_parallel_emit_witness): emit_rust failed for `{}`: {err:?}", - claim.file_name - )); - } - }; - let parallel = emitted.contains("thread::scope"); - let computed_int = i64::from(parallel); - return if computed_int == expected_int { - ClaimResult::Pass - } else { - ClaimResult::Fail(format!( - "LensOutputEquals(r3_auto_parallelism_parallel_emit_witness): expected `{expected_int}` (1 = parallel schedule), computed `{computed_int}` for `{}`", - claim.file_name - )) - }; - } - - // R3 gate #50 (`auto_memoization_no_caching_for_one_shot`): one-shot call sites must not - // emit memo/cache scaffolding. Structural witness via emitted Rust text; dissolution when - // the AutoMemoizationEvidence producer reaches `.dag`. - if lens_decl.name.as_deref() == Some(R3_ONE_SHOT_NO_MEMO_WITNESS_LENS_NAME) { - let expected_int = match expected_decl.value_body.as_ref() { - Some(ValueBody::Scalar(LiteralBits::Int(s))) => match s.parse::() { - Ok(v) => v, - Err(_) => { - return ClaimResult::Fail(format!( - "LensOutputEquals(r3_auto_memoization_one_shot_no_cache_witness): expected Int literal is not a valid i64 decimal for `{expected_name}`" - )); - } - }, - _ => { - return ClaimResult::Fail(format!( - "LensOutputEquals(r3_auto_memoization_one_shot_no_cache_witness): expected_ref `{expected_name}` must be `data ...: Int = `" - )); - } - }; - let emitted = match crate::emit_rust::emit_rust(&program_dag) { - Ok(s) => s, - Err(err) => { - return ClaimResult::Fail(format!( - "LensOutputEquals(r3_auto_memoization_one_shot_no_cache_witness): emit_rust failed for `{}`: {err:?}", - claim.file_name - )); - } - }; - let scaffolding_absent = !emitted.contains("memo") - && !emitted.contains("Memo") - && !emitted.contains("cache") - && !emitted.contains("Cache") - && !emitted.contains("HashMap"); - let computed_int = i64::from(scaffolding_absent); - return if computed_int == expected_int { - ClaimResult::Pass - } else { - ClaimResult::Fail(format!( - "LensOutputEquals(r3_auto_memoization_one_shot_no_cache_witness): expected `{expected_int}` (1 = no memo/cache scaffolding), computed `{computed_int}` for `{}`", - claim.file_name - )) - }; - } - - // T-LaneE cost receipt: `ProgramOutputBind` is the structural contract for a claim - // source output-bind cost check. Dispatch on that input role, not on lens declaration - // spelling; otherwise the canonical lens-name bridge would survive under a helper. - if let Some(cost_bind) = program_input - .as_ref() - .and_then(ProgramInputRole::output_bind_name) - { - if !self.lens_has_program_output_cost_signature(lens_id) { - return ClaimResult::Fail(format!( - "LensOutputEquals: input_ref `{input_name}` inhabits ProgramOutputBind, \ - but lens `{lens_name}` does not have the structural cost signature \ - `fn(Dag, PortId) -> Lookup`" - )); - } - let Some(bind) = find_bind(&program_dag, cost_bind, &claim.file_name) else { - return ClaimResult::Fail(format!( - "LensOutputEquals(cost_of): bind `{cost_bind}` not found in `{}`", - claim.file_name - )); - }; - let computed = cost_of(&program_dag, &bind.value); - // M1(2.8): `Lookup` is not yet structurally authorable in `data` bodies for this - // fixture module — compare the lens `Hit(n)` against a scalar `Int` witness. - let expected_int = match expected_decl.value_body.as_ref() { - Some(ValueBody::Scalar(LiteralBits::Int(s))) => match s.parse::() { - Ok(v) => v, - Err(_) => { - return ClaimResult::Fail(format!( - "LensOutputEquals(cost_of): expected Int literal is not a valid i64 decimal for `{expected_name}`" - )); - } - }, - _ => { - return ClaimResult::Fail(format!( - "LensOutputEquals(cost_of): expected_ref `{expected_name}` must be `data …: Int = ` (M1(2.8); `Lookup` data literals are deferred)" - )); - } - }; - return match computed { - CostLookup::Hit(v) if v == expected_int => ClaimResult::Pass, - CostLookup::Hit(v) => ClaimResult::Fail(format!( - "LensOutputEquals(cost_of): expected `{expected_int}`, computed `{v}` for bind `{cost_bind}`" - )), - CostLookup::Miss => ClaimResult::Fail( - "LensOutputEquals(cost_of): computed cost is Miss (malformed program)".to_string(), - ), - }; - } - // R3 gate #45 (`auto_parallelism_branch_arms_serialize`): emitted Rust for the claim - // source must lower the Bool branch to `if … else` and contain no `thread::scope` - // scheduling — branch arms are exclusive alternatives, not parallel work. Structural - // witness via program text; dissolution when ordinary DB-20 parallelism lens output - // reaches `.dag` (see docs/design-free-consequences.md, `parallelism.dag` STUB). - if lens_decl.name.as_deref() == Some(R3_BRANCH_ARMS_SERIALIZE_WITNESS_LENS_NAME) { - let expected_int = match expected_decl.value_body.as_ref() { - Some(ValueBody::Scalar(LiteralBits::Int(s))) => match s.parse::() { - Ok(v) => v, - Err(_) => { - return ClaimResult::Fail(format!( - "LensOutputEquals(r3_auto_parallelism_branch_arms_serialize_witness): expected Int literal is not a valid i64 decimal for `{expected_name}`" - )); - } - }, - _ => { - return ClaimResult::Fail(format!( - "LensOutputEquals(r3_auto_parallelism_branch_arms_serialize_witness): expected_ref `{expected_name}` must be `data …: Int = `" - )); - } - }; - let emitted = match crate::emit_rust::emit_rust(&program_dag) { - Ok(s) => s, - Err(err) => { - return ClaimResult::Fail(format!( - "LensOutputEquals(r3_auto_parallelism_branch_arms_serialize_witness): emit_rust failed for `{}`: {err:?}", - claim.file_name - )); - } - }; - // Branch lowered to `if … else` (template `if {cond} { {then} } else { {else} }`) - // and arm bodies are not wrapped in scoped-thread spawn scheduling. - let serialized = emitted.contains("} else {") && !emitted.contains("thread::scope"); - let computed_int = i64::from(serialized); - return if computed_int == expected_int { - ClaimResult::Pass - } else { - ClaimResult::Fail(format!( - "LensOutputEquals(r3_auto_parallelism_branch_arms_serialize_witness): expected `{expected_int}` (1 = serialized branch arms), computed `{computed_int}` for `{}`", - claim.file_name - )) - }; - } - - let reflects_claim_program = program_input - .as_ref() - .is_some_and(ProgramInputRole::is_program_input); - - let input_field = if reflects_claim_program { - // P2: `id_space` must be the same `Dag` `apply_lens_declaration` will use for the - // lens, so reflected `List` / `Behavior` variant `DeclarationId`s are not mixed across - // graphs. - match reflect_program_dag_nodes_in_file(&program_dag, &claim.file_name, self.dag) { - Ok(v) => v, - Err(err) => { - return ClaimResult::Fail(format!( - "LensOutputEquals: could not reflect `Dag` nodes from claim program: {err:?}" - )); - } - } - } else { - match &input_decl.value_body { - Some(body) => match field_value_from_value_body(self.dag, body) { - Ok(v) => v, - Err(err) => { - return ClaimResult::Fail(format!( - "LensOutputEquals: could not lower input_ref `{input_name}` value: {err:?}" - )); - } - }, - None => { - return ClaimResult::Fail(format!( - "LensOutputEquals: input_ref `{input_name}` has no value body (use ProgramInput when the input `Dag` is only available via `TestClaim.source`)" - )); - } - } - }; - - let expected_field = match field_value_from_value_body( - self.dag, - expected_decl.value_body.as_ref().expect("checked"), - ) { - Ok(v) => v, - Err(err) => { - return ClaimResult::Fail(format!( - "LensOutputEquals: could not lower expected_ref `{expected_name}` value: {err:?}" - )); - } - }; - - let program_under_test = if reflects_claim_program { - Some(&program_dag) - } else { - None - }; - let computed = match apply_lens_declaration( - self.dag, - program_under_test, - lens_id, - std::slice::from_ref(&input_field), - ) { - Ok(v) => v, - Err(err) => { - return ClaimResult::Fail(format!( - "LensOutputEquals: applying lens `{lens_name}` failed: {err:?}" - )); - } - }; - - if computed == expected_field { - ClaimResult::Pass - } else { - ClaimResult::Fail(format!( - "LensOutputEquals: expected {} for `{expected_name}`, computed {} for lens `{lens_name}` (input `{input_name}`)", - render_field_value(self.dag, &expected_field), - render_field_value(self.dag, &computed), - )) - } - } - - fn eval_gate_87_cementing_projection( - &self, - lens_decl_name: Option<&str>, - lens_name: &str, - program_dag: &Dag, - file_name: &str, - expected_decl: &Declaration, - expected_name: &str, - ) -> Option { - let computed = match lens_decl_name? { - "gate87_cost_target_realization_meta_present" => { - i64::from(type_realization_meta(program_dag).is_some()) - } - "gate87_effect_enumeration_no_transaction" => i64::from(matches!( - enumerate_effects(program_dag).transaction, - TransactionalPattern::NoTransaction - )), - "gate87_provenance_literal_origin_source" => { - let Some(bind) = find_bind(program_dag, "lit", file_name) else { - return Some(ClaimResult::Fail(format!( - "LensOutputEquals({lens_name}): bind `lit` not found in `{file_name}`" - ))); - }; - i64::from(matches!( - origin_of(program_dag, &bind.value), - Origin::Source { .. } - )) - } - "gate87_structural_resolution_no_violations" => { - i64::from(lens_structural_resolution::check(program_dag).is_empty()) - } - "gate87_unused_parameters_no_findings" => i64::from( - UnusedParametersLens::new(program_dag) - .query(&UnusedParametersConfig::default()) - .is_empty(), - ), - "gate87_parallelism_literal_no_workflow_projection" => { - let Some(bind) = find_bind(program_dag, "lit", file_name) else { - return Some(ClaimResult::Fail(format!( - "LensOutputEquals({lens_name}): bind `lit` not found in `{file_name}`" - ))); - }; - let report = analyze_parallelism(program_dag, bind.id); - i64::from(matches!( - report, - WorkflowParallelismReport::ParallelismUnsupported(detail) - if detail.kind == ParallelismUnsupportedKind::NoWorkflowProjection - )) - } - "gate87_idempotency_literal_no_lane2_workflow" => { - let Some(bind) = find_bind(program_dag, "lit", file_name) else { - return Some(ClaimResult::Fail(format!( - "LensOutputEquals({lens_name}): bind `lit` not found in `{file_name}`" - ))); - }; - let report = analyze_workflow(program_dag, bind.id); - i64::from(matches!( - report, - WorkflowIdempotencyReport::IdempotencyUnsupported(detail) - if detail.variant_name == "Lane2WorkflowRoot" - )) - } - _ => return None, - }; - - let expected = match expected_int_literal(expected_decl, expected_name, lens_name) { - Ok(v) => v, - Err(result) => return Some(result), - }; - Some(if computed == expected { - ClaimResult::Pass - } else { - ClaimResult::Fail(format!( - "LensOutputEquals({lens_name}): expected `{expected}`, computed `{computed}`" - )) - }) - } - - fn eval_symbolic_cost_expr_equals_shape( - &self, - claim: &TestClaimValue, - payload: &[FieldValue], - expected_param_index: Option, - ) -> ClaimResult { - let [expected_fv] = payload else { - return ClaimResult::Fail(format!( - "SymbolicCostExprEquals payload should be exactly one DeclarationRef field \ - (expected); got {} payload slot(s)", - payload.len() - )); - }; - let expected_id = match self.resolve_declaration_ref_id(expected_fv, "expected") { - Ok(id) => id, - Err(msg) => return ClaimResult::Fail(msg), - }; - let expected_decl = self.dag.declaration(expected_id); - let expected_name = decl_display_name(expected_id, expected_decl); - let Some(expected_body) = expected_decl.value_body.as_ref() else { - return ClaimResult::Fail(format!( - "SymbolicCostExprEquals: expected `{expected_name}` has no value body to compare against" - )); - }; - if let Err(reason) = self.validate_symbolic_cost_ref(expected_id, "expected") { - return ClaimResult::Fail(reason); - } - let expected_field = match field_value_for_symbolic_cost_expected(self.dag, expected_body) { - Ok(v) => v, - Err(err) => { - return ClaimResult::Fail(format!( - "SymbolicCostExprEquals: could not lower expected `{expected_name}` to a \ - structural value: {err:?}" - )); - } - }; - let expected_pattern = - match field_value_to_symbolic_cost_eq_pattern(self.dag, &expected_field) { - Ok(p) => p, - Err(msg) => return ClaimResult::Fail(msg), - }; - self.eval_symbolic_cost_expr_equals_pattern(claim, expected_pattern, expected_param_index) - } - - fn eval_symbolic_cost_expr_equals_pattern( - &self, - claim: &TestClaimValue, - expected_pattern: SymbolicCostEqPattern, - expected_param_index: Option, - ) -> ClaimResult { - let program_dag = match compile_to_dag(&claim.source, &claim.file_name) { - Ok(dag) => dag, - Err(CompileError::Semantic(dag)) => { - return ClaimResult::Fail(format!( - "SymbolicCostExprEquals: claim `source` / `{}` failed inference: {:?}", - claim.file_name, - dag.diagnostics().iter().collect::>() - )); - } - Err(err) => { - return ClaimResult::Fail(format!( - "SymbolicCostExprEquals: claim `source` / `{}` did not compile: {err:?}", - claim.file_name - )); - } - }; - - let bind_name = match last_emit_rust_program_top_level_value_bind_name(&program_dag) { - Ok(Some(name)) => name, - Ok(None) => { - let bind_names: Vec = program_dag - .nodes() - .iter() - .filter_map(Behavior::as_bind) - .filter(|bind| bind.span.file == claim.file_name) - .filter(|bind| !bind.name.starts_with(" name.clone(), - [] => { - return ClaimResult::Fail( - "SymbolicCostExprEquals: claim program has no top-level bind for the \ - symbolic-cost lens" - .to_string(), - ); - } - names => { - return ClaimResult::Fail(format!( - "SymbolicCostExprEquals: claim program has no top-level value bind and \ - contains multiple function binds {names:?}; add a value bind or keep \ - the function-cost fixture to one bind" - )); - } - } - } - Err(err) => { - return ClaimResult::Fail(format!( - "SymbolicCostExprEquals: cannot resolve emit-rust print target bind for `{}`: {err:?}", - claim.file_name - )); - } - }; - let Some(bind) = find_bind(&program_dag, &bind_name, &claim.file_name) else { - return ClaimResult::Fail(format!( - "SymbolicCostExprEquals: bind `{bind_name}` not found in `{}`", - claim.file_name - )); - }; - let expected_pattern = match resolve_symbolic_cost_param_refs_for_bind( - expected_pattern, - bind, - expected_param_index, - ) { - Ok(pattern) => pattern, - Err(msg) => return ClaimResult::Fail(msg), - }; - - let computed = match symbolic_cost_lookup(&program_dag, &bind.value) { - SymbolicCostLookup::Hit(cost) => cost, - SymbolicCostLookup::Miss => { - return ClaimResult::Fail(format!( - "SymbolicCostExprEquals: `symbolic_cost_lookup` returned Miss for bind `{bind_name}` \ - in `{}`", - claim.file_name - )); - } - }; - let computed_pattern = symbolic_cost_to_eq_pattern(&computed); - if computed_pattern == expected_pattern { - ClaimResult::Pass - } else { - ClaimResult::Fail(format!( - "SymbolicCostExprEquals: for bind `{bind_name}` in `{}`, expected pattern \ - {expected_pattern:?}, computed pattern {computed_pattern:?} (from symbolic-cost lens)", - claim.file_name - )) - } - } - - fn eval_symbolic_cost_expr_equals_for_bind_param( - &self, - claim: &TestClaimValue, - payload: &[FieldValue], - ) -> ClaimResult { - let [expected_fv, param_fv] = payload else { - return ClaimResult::Fail(format!( - "SymbolicCostExprEqualsForBindParam payload should be exactly two fields \ - (expected, param); got {} payload slot(s)", - payload.len() - )); - }; - let param_index = match bind_param_ref_index(param_fv) { - Ok(index) => index, - Err(msg) => return ClaimResult::Fail(msg), - }; - let expected_id = match self.resolve_declaration_ref_id(expected_fv, "expected") { - Ok(id) => id, - Err(msg) => return ClaimResult::Fail(msg), - }; - let expected_decl = self.dag.declaration(expected_id); - let expected_name = decl_display_name(expected_id, expected_decl); - let Some(expected_body) = expected_decl.value_body.as_ref() else { - return ClaimResult::Fail(format!( - "SymbolicCostExprEqualsForBindParam: expected `{expected_name}` has no value body \ - to compare against" - )); - }; - if let Err(reason) = self.validate_symbolic_cost_bind_param_expected_ref(expected_id) { - return ClaimResult::Fail(reason); - } - let expected_field = match field_value_from_value_body(self.dag, expected_body) { - Ok(v) => v, - Err(err) => { - return ClaimResult::Fail(format!( - "SymbolicCostExprEqualsForBindParam: could not lower expected \ - `{expected_name}` to a structural value: {err:?}" - )); - } - }; - let expected_pattern = match field_value_to_symbolic_cost_bind_param_expected_pattern( - self.dag, - &expected_field, - ) { - Ok(p) => p, - Err(msg) => return ClaimResult::Fail(msg), - }; - self.eval_symbolic_cost_expr_equals_pattern(claim, expected_pattern, Some(param_index)) - } - - /// Boundary check that `decl_id` references a declaration whose declared - /// type is `SymbolicCost`. The runner walks transparent aliases (no-arg - /// instantiations + ResolvedBy* atoms) to handle `data X: SymbolicCost - /// = ConstantCost(0)`-style declarations whose connective is an alias to - /// the algebra type. Same shape as `validate_dimension_report_ref`, - /// scoped to a single nominal type instead of `DimensionReport`. - fn validate_symbolic_cost_ref( - &self, - decl_id: DeclarationId, - field_label: &str, - ) -> Result<(), String> { - let symbolic_cost_id = self - .dag - .declaration_by_name("SymbolicCost") - .map(|decl| decl.id) - .ok_or_else(|| { - format!( - "SymbolicCostExprEquals `{field_label}`: \ - `SymbolicCost` type not found in bootstrap" - ) - })?; - let decl = self.dag.declaration(decl_id); - // For `fn`-shaped expected refs, walk through the arrow output; - // otherwise normalize the declaration itself. - let candidate = match &decl.connective { - TypeConnective::Arrow { output, .. } => *output, - _ => decl_id, - }; - if self.normalize_transparent_type(candidate) == symbolic_cost_id { - return Ok(()); - } - Err(format!( - "SymbolicCostExprEquals `{field_label}` must reference a declaration of type \ - `SymbolicCost`; `{}` does not (declared type does not normalize to `SymbolicCost`).", - decl_display_name(decl_id, decl) - )) - } - - fn validate_symbolic_cost_bind_param_expected_ref( - &self, - decl_id: DeclarationId, - ) -> Result<(), String> { - let expected_id = self - .dag - .declaration_by_name("SymbolicCostBindParamExpected") - .map(|decl| decl.id) - .ok_or_else(|| { - "SymbolicCostExprEqualsForBindParam: `SymbolicCostBindParamExpected` type not \ - found in bootstrap" - .to_string() - })?; - let decl = self.dag.declaration(decl_id); - let candidate = match &decl.connective { - TypeConnective::Arrow { output, .. } => *output, - _ => decl_id, - }; - if self.normalize_transparent_type(candidate) == expected_id { - return Ok(()); - } - Err(format!( - "SymbolicCostExprEqualsForBindParam `expected` must reference a declaration of type \ - `SymbolicCostBindParamExpected`; `{}` does not.", - decl_display_name(decl_id, decl) - )) - } - - fn eval_binary_dimension_report_equals( - &self, - claim: &TestClaimValue, - payload: &[FieldValue], - ) -> ClaimResult { - let [left_fv, right_fv] = payload else { - return ClaimResult::Fail(format!( - "BinaryDimensionReportEquals payload should be exactly two DeclarationRef fields \ - (left_report_ref, right_report_ref); got {} payload slot(s)", - payload.len() - )); - }; - let left_id = match self.resolve_declaration_ref_id(left_fv, "left_report_ref") { - Ok(id) => id, - Err(msg) => return ClaimResult::Fail(msg), - }; - let right_id = match self.resolve_declaration_ref_id(right_fv, "right_report_ref") { - Ok(id) => id, - Err(msg) => return ClaimResult::Fail(msg), - }; - let left_name = decl_display_name(left_id, self.dag.declaration(left_id)); - let right_name = decl_display_name(right_id, self.dag.declaration(right_id)); - let left_carrier = match self.validate_dimension_report_ref(left_id, "left_report_ref") { - Ok(carrier) => carrier, - Err(reason) => return ClaimResult::Fail(reason), - }; - let right_carrier = match self.validate_dimension_report_ref(right_id, "right_report_ref") { - Ok(carrier) => carrier, - Err(reason) => return ClaimResult::Fail(reason), - }; - if !self.dimension_report_carriers_equivalent(left_carrier, right_carrier) { - return ClaimResult::Fail(format!( - "BinaryDimensionReportEquals requires both refs to produce DimensionReport \ - for the same carrier C; `{left_name}` uses `{}` but `{right_name}` uses `{}`", - decl_display_name(left_carrier, self.dag.declaration(left_carrier)), - decl_display_name(right_carrier, self.dag.declaration(right_carrier)) - )); - } - if let Some(result) = self.try_eval_tc1_eta_equivalence_executable( - claim, - left_carrier, - left_name.as_str(), - right_name.as_str(), - ) { - return result; - } - if self.type_ref_normalizes_to_named(left_carrier, "Dag") - && tc2_church_rosser_strict_fire_report_role_ids(self.dag, left_id, right_id) - { - return self.eval_tc2_church_rosser_binary_dimension_report_equals_claim( - claim, - &left_name, - &right_name, - ); - } - if self.type_ref_normalizes_to_named(left_carrier, "Dag") - && tc3_pattern_a_second_mover_strict_fire_report_role_ids(self.dag, left_id, right_id) - && claim.claim_name == TC3_PATTERN_A_SECOND_MOVER_EXECUTABLE_CLAIM - { - return self.eval_tc3_pattern_a_second_mover_binary_dimension_report_equals_claim( - claim, - &left_name, - &right_name, - ); - } - ClaimResult::NotYetImplemented(format!( - "BinaryDimensionReportEquals: structural shape is valid for `{left_name}` and \ - `{right_name}`, but runner evaluation waits for generic DimensionReport \ - production/evaluation substrate; serialized report comparison is intentionally \ - unsupported" - )) - } - - /// R3 §1.8 gate #11 (`tc1_eta_equivalence_executable`): Path A executable receipt. - /// - /// **Typed `.dag` authority:** `BinaryDimensionReportEquals` still names - /// `DimensionReport` — structural envelope only until substrate delivers a - /// non-proxy fold (see below). - /// - /// **Runtime authority (this slice):** the runner compares - /// [`crate::analyze_symbolic_cost_dimension`] at two η-pair workflow roots in - /// `TestClaim.source` (`tc1_eta_exec_direct` and `tc1_eta_exec_eta_expanded` entry binds). That is a **bounded proxy**: - /// `DimensionReport`, not `DimensionReport`, so the Pass - /// line is an intentional *proxy* until the real carrier fold exists. **P5 / single-authority - /// forward:** dissolution + carrier-aligned witness is tracked at **gunbc#1972** (substrate / - /// Evaluator canvas-tier producer for `Tc1EtaLensObservation`); this gate is expected to - /// migrate off symbolic-cost proxy comparison when #1972 closes the fold path (upgrade the - /// assertion body to compare produced `Tc1EtaLensObservation` reports, not `SymbolicCost`). - /// - /// Comparison uses [`tc1_eta_equivalence_symbolic_cost_reports_equivalent`] — **root - /// `composed` `SymbolicCost` only** (not full witness-spine equality), so an η-expanded extra - /// call frame cannot false-fail solely on spine length while the root asymptotic bound stays - /// identical for this representative. - fn try_eval_tc1_eta_equivalence_executable( - &self, - claim: &TestClaimValue, - left_carrier: DeclarationId, - left_report_ref_name: &str, - right_report_ref_name: &str, - ) -> Option { - if claim.claim_name != TC1_ETA_EQUIVALENCE_EXECUTABLE_CLAIM { - return None; - } - if !claim - .declaration_file - .ends_with(TC1_SUBSTRATE_LENS_ETA_STRICT_FIRE_FIXTURE_SUFFIX) - { - return Some(ClaimResult::Fail(format!( - "tc1_eta_equivalence_executable: expected claim declaration in `*{TC1_SUBSTRATE_LENS_ETA_STRICT_FIRE_FIXTURE_SUFFIX}`, got `{}`", - claim.declaration_file - ))); - } - let carrier_decl = self.dag.declaration(left_carrier); - if carrier_decl.name.as_deref() != Some("Tc1EtaLensObservation") { - return Some(ClaimResult::Fail(format!( - "BinaryDimensionReportEquals `{left_report_ref_name}` / `{right_report_ref_name}`: \ - tc1_eta_equivalence_executable requires carrier `Tc1EtaLensObservation`, got {:?}", - carrier_decl.name - ))); - } - - let program_dag = match compile_to_dag(&claim.source, &claim.file_name) { - Ok(dag) => dag, - Err(CompileError::Semantic(dag)) => { - return Some(ClaimResult::Fail(format!( - "tc1_eta_equivalence_executable: claim `source` / `{}` failed inference: {:?}", - claim.file_name, - dag.diagnostics().iter().collect::>() - ))); - } - Err(err) => { - return Some(ClaimResult::Fail(format!( - "tc1_eta_equivalence_executable: claim `source` / `{}` did not compile: {err:?}", - claim.file_name - ))); - } - }; - - let Some(left_bind) = find_bind( - &program_dag, - TC1_ETA_EXECUTABLE_DIRECT_ENTRY, - &claim.file_name, - ) else { - return Some(ClaimResult::Fail(format!( - "tc1_eta_equivalence_executable: missing η-pair entry bind `{TC1_ETA_EXECUTABLE_DIRECT_ENTRY}` in `{}`", - claim.file_name - ))); - }; - let Some(right_bind) = - find_bind(&program_dag, TC1_ETA_EXECUTABLE_ETA_ENTRY, &claim.file_name) - else { - return Some(ClaimResult::Fail(format!( - "tc1_eta_equivalence_executable: missing η-pair entry bind `{TC1_ETA_EXECUTABLE_ETA_ENTRY}` in `{}`", - claim.file_name - ))); - }; - - let left_report = analyze_symbolic_cost_dimension(&program_dag, left_bind.id); - let right_report = analyze_symbolic_cost_dimension(&program_dag, right_bind.id); - - Some(tc1_eta_equivalence_symbolic_cost_reports_equivalent( - left_report, - right_report, - )) - } - - /// R3 gate #12 (`tc2_church_rosser_strict_fire.dag`): `BinaryDimensionReportEquals` payload - /// references the fixture-local `tc2_church_rosser_strict_fire_left_dimension_report` / - /// `tc2_church_rosser_strict_fire_right_dimension_report` `DimensionReport` roles. - /// The runner materializes one [`DimensionReport::DimensionOk`] per eager applicative - /// [`InputEvaluationOrder`] for the claim program's top-level bind and applies the bounded - /// confluence receipt in [`tc2_church_rosser_dimension_reports_equivalent_under_binary_equals`]. - /// - /// Generic `BinaryDimensionReportEquals` over arbitrary `DimensionReport` producers remains - /// NYI at the boundary until substrate producers land. - fn eval_tc2_church_rosser_binary_dimension_report_equals_claim( - &self, - claim: &TestClaimValue, - left_report_label: &str, - right_report_label: &str, - ) -> ClaimResult { - if claim.source.trim().is_empty() { - return ClaimResult::NotYetImplemented(format!( - "BinaryDimensionReportEquals: structural shape is valid for `{left_report_label}` \ - and `{right_report_label}`, but executable TC2 Church-Rosser comparison requires a \ - non-empty `TestClaim.source` program slice" - )); - } - - let program_dag = match compile_to_dag(&claim.source, &claim.file_name) { - Ok(dag) => dag, - Err(CompileError::Semantic(dag)) => { - return ClaimResult::Fail(format!( - "BinaryDimensionReportEquals `{left_report_label}` / `{right_report_label}`: \ - claim `source` / `{}` failed inference: {:?}", - claim.file_name, - dag.diagnostics().iter().collect::>() - )); - } - Err(err) => { - return ClaimResult::Fail(format!( - "BinaryDimensionReportEquals `{left_report_label}` / `{right_report_label}`: \ - claim `source` / `{}` did not compile: {err:?}", - claim.file_name - )); - } - }; - if !program_dag.diagnostics().is_empty() { - return ClaimResult::Fail(format!( - "BinaryDimensionReportEquals `{left_report_label}` / `{right_report_label}`: \ - expected empty diagnostics on `{}`, got {:?}", - claim.file_name, - program_dag.diagnostics().iter().collect::>() - )); - } - - let bind_name = match last_emit_rust_program_top_level_value_bind_name(&program_dag) { - Ok(Some(name)) => name, - Ok(None) => { - return ClaimResult::Fail(format!( - "BinaryDimensionReportEquals `{left_report_label}` / `{right_report_label}`: \ - program has no top-level value bind (same convention as \ - `last_emit_rust_program_top_level_value_bind_name`)" - )); - } - Err(err) => { - return ClaimResult::Fail(format!( - "BinaryDimensionReportEquals `{left_report_label}` / `{right_report_label}`: \ - cannot resolve top-level value bind for `{}`: {err:?}", - claim.file_name - )); - } - }; - let Some(bind) = find_bind(&program_dag, &bind_name, &claim.file_name) else { - return ClaimResult::Fail(format!( - "BinaryDimensionReportEquals `{left_report_label}` / `{right_report_label}`: \ - bind `{bind_name}` not found in `{}`", - claim.file_name - )); - }; - if !bind.params.is_empty() { - return ClaimResult::Fail(format!( - "BinaryDimensionReportEquals `{left_report_label}` / `{right_report_label}`: \ - bind `{bind_name}` must be a value bind with no parameters (got {} parameter port(s))", - bind.params.len() - )); - } - - let (left_report, left_value) = match build_tc2_church_rosser_strategy_dimension_report( - &program_dag, - bind.id, - InputEvaluationOrder::LeftFirst, - ) { - Ok(pair) => pair, - Err(err) => { - return ClaimResult::Fail(format!( - "BinaryDimensionReportEquals `{left_report_label}`: LeftFirst evaluation \ - failed while materializing `DimensionReport`: {err:?}" - )); - } - }; - let (right_report, right_value) = match build_tc2_church_rosser_strategy_dimension_report( - &program_dag, - bind.id, - InputEvaluationOrder::RightFirst, - ) { - Ok(pair) => pair, - Err(err) => { - return ClaimResult::Fail(format!( - "BinaryDimensionReportEquals `{right_report_label}`: RightFirst evaluation \ - failed while materializing `DimensionReport`: {err:?}" - )); - } - }; - - if tc2_church_rosser_dimension_reports_equivalent_under_binary_equals( - &left_report, - &left_value, - &right_report, - &right_value, - ) { - ClaimResult::Pass - } else { - ClaimResult::Fail(format!( - "BinaryDimensionReportEquals `{left_report_label}` / `{right_report_label}`: \ - strategy-keyed `DimensionReport` disagree — left={left_report:?} \ - (value={left_value:?}) vs right={right_report:?} (value={right_value:?})" - )) - } - } - - /// R3 §1.8 gate #13 (`tc3_strong_normalization_strict_fire.dag`): `BinaryDimensionReportEquals` - /// payload references the fixture-local `tc3_evaluation_step_baseline_dimension_report` / - /// `tc3_evaluation_step_compare_dimension_report` `DimensionReport` roles. The runner - /// materializes one [`DimensionReport::DimensionOk`] per projection role for the claim - /// program's top-level bind (`succ(succ(0))` per fixture) and applies the bounded - /// second-mover receipt in - /// [`tc3_pattern_a_second_mover_dimension_reports_equivalent_under_binary_equals`]. - /// - /// **Bounded proxy.** This is a host-runner second-mover bridge analogous to - /// gate-#12 TC2 Church-Rosser: it verifies that the program evaluates to the same `Value` - /// under both projection roles (a strong-normalization receipt for this representative). - /// **Single forward dissolution trigger:** the eval-step / bounded-step producer surface + - /// G1.a static-lens-fold producer-surface-wiring per - /// `docs/briefs/r3-evaluator-tc3-d4-eval-step-producer-worker.md` — when both producers - /// land on `origin/main`, this arm should migrate to consuming live - /// `DimensionReport` values from those producers (replacing the proxy `composed` - /// clone + empty witness lists with the substrate-emitted carriers / witnesses) without - /// changing the gate-#13 claim name or fixture. - /// - /// Generic `BinaryDimensionReportEquals` over arbitrary `DimensionReport` producers - /// remains NYI at the boundary until substrate producers land. - fn eval_tc3_pattern_a_second_mover_binary_dimension_report_equals_claim( - &self, - claim: &TestClaimValue, - left_report_label: &str, - right_report_label: &str, - ) -> ClaimResult { - if claim.source.trim().is_empty() { - return ClaimResult::NotYetImplemented(format!( - "BinaryDimensionReportEquals: structural shape is valid for `{left_report_label}` \ - and `{right_report_label}`, but executable TC3 second-mover comparison requires \ - a non-empty `TestClaim.source` program slice" - )); - } - - let program_dag = match compile_to_dag(&claim.source, &claim.file_name) { - Ok(dag) => dag, - Err(CompileError::Semantic(dag)) => { - return ClaimResult::Fail(format!( - "BinaryDimensionReportEquals `{left_report_label}` / `{right_report_label}`: \ - claim `source` / `{}` failed inference: {:?}", - claim.file_name, - dag.diagnostics().iter().collect::>() - )); - } - Err(err) => { - return ClaimResult::Fail(format!( - "BinaryDimensionReportEquals `{left_report_label}` / `{right_report_label}`: \ - claim `source` / `{}` did not compile: {err:?}", - claim.file_name - )); - } - }; - if !program_dag.diagnostics().is_empty() { - return ClaimResult::Fail(format!( - "BinaryDimensionReportEquals `{left_report_label}` / `{right_report_label}`: \ - expected empty diagnostics on `{}`, got {:?}", - claim.file_name, - program_dag.diagnostics().iter().collect::>() - )); - } - - let bind_name = match last_emit_rust_program_top_level_value_bind_name(&program_dag) { - Ok(Some(name)) => name, - Ok(None) => { - return ClaimResult::Fail(format!( - "BinaryDimensionReportEquals `{left_report_label}` / `{right_report_label}`: \ - program has no top-level value bind (same convention as \ - `last_emit_rust_program_top_level_value_bind_name`)" - )); - } - Err(err) => { - return ClaimResult::Fail(format!( - "BinaryDimensionReportEquals `{left_report_label}` / `{right_report_label}`: \ - cannot resolve top-level value bind for `{}`: {err:?}", - claim.file_name - )); - } - }; - let Some(bind) = find_bind(&program_dag, &bind_name, &claim.file_name) else { - return ClaimResult::Fail(format!( - "BinaryDimensionReportEquals `{left_report_label}` / `{right_report_label}`: \ - bind `{bind_name}` not found in `{}`", - claim.file_name - )); - }; - if !bind.params.is_empty() { - return ClaimResult::Fail(format!( - "BinaryDimensionReportEquals `{left_report_label}` / `{right_report_label}`: \ - bind `{bind_name}` must be a value bind with no parameters (got {} parameter port(s))", - bind.params.len() - )); - } - - let (left_report, left_value) = match build_tc3_pattern_a_second_mover_projection_report( - &program_dag, - bind.id, - TC3_PATTERN_A_BASELINE_DIMENSION_NAME, - InputEvaluationOrder::LeftFirst, - ) { - Ok(pair) => pair, - Err(err) => { - return ClaimResult::Fail(format!( - "BinaryDimensionReportEquals `{left_report_label}`: baseline projection \ - evaluation failed while materializing `DimensionReport`: {err:?}" - )); - } - }; - let (right_report, right_value) = match build_tc3_pattern_a_second_mover_projection_report( - &program_dag, - bind.id, - TC3_PATTERN_A_COMPARE_DIMENSION_NAME, - InputEvaluationOrder::RightFirst, - ) { - Ok(pair) => pair, - Err(err) => { - return ClaimResult::Fail(format!( - "BinaryDimensionReportEquals `{right_report_label}`: compare projection \ - evaluation failed while materializing `DimensionReport`: {err:?}" - )); - } - }; - - if tc3_pattern_a_second_mover_dimension_reports_equivalent_under_binary_equals( - &left_report, - &left_value, - &right_report, - &right_value, - ) { - ClaimResult::Pass - } else { - ClaimResult::Fail(format!( - "BinaryDimensionReportEquals `{left_report_label}` / `{right_report_label}`: \ - projection-keyed `DimensionReport` disagree — left={left_report:?} \ - (value={left_value:?}) vs right={right_report:?} (value={right_value:?})" - )) - } - } - - fn validate_dimension_report_ref( - &self, - decl_id: DeclarationId, - field_label: &str, - ) -> Result { - let decl = self.dag.declaration(decl_id); - let candidate_type = match &decl.connective { - TypeConnective::Arrow { output, .. } => *output, - _ => decl_id, - }; - self.dimension_report_carrier(candidate_type) - .ok_or_else(|| { - format!( - "BinaryDimensionReportEquals `{field_label}` must reference a declaration \ - that produces or inhabits DimensionReport; `{}` does not", - decl_display_name(decl_id, decl) - ) - }) - } - - fn dimension_report_carriers_equivalent( - &self, - left_carrier: DeclarationId, - right_carrier: DeclarationId, - ) -> bool { - left_carrier == right_carrier - || type_shapes_equivalent( - self.dag, - &TypeShape::new(left_carrier), - &TypeShape::new(right_carrier), - ) - } - - fn dimension_report_carrier(&self, mut current: DeclarationId) -> Option { - let report_id = self - .dag - .declaration_by_name("DimensionReport") - .map(|decl| decl.id)?; - // Bounded alias walk: this is a fail-closed cycle/depth guard, not a - // semantic limit on valid DimensionReport producer shapes. - for _ in 0..32 { - match &self.dag.declaration(current).connective { - TypeConnective::Instantiation { - template, - arguments, - } if *template == report_id => match arguments.as_slice() { - [carrier] => return Some(self.normalize_transparent_type(carrier.value)), - _ => return None, - }, - TypeConnective::Instantiation { - template, - arguments, - } if arguments.is_empty() => current = *template, - TypeConnective::Atom( - AtomPayload::ResolvedByStructure(next) | AtomPayload::ResolvedByName(next), - ) => current = *next, - _ => return None, - } - } - None - } - - fn normalize_transparent_type(&self, mut current: DeclarationId) -> DeclarationId { - for _ in 0..32 { - match &self.dag.declaration(current).connective { - TypeConnective::Instantiation { - template, - arguments, - } if arguments.is_empty() => current = *template, - TypeConnective::Atom( - AtomPayload::ResolvedByStructure(next) | AtomPayload::ResolvedByName(next), - ) => current = *next, - _ => return current, - } - } - current - } - - fn resolve_declaration_ref_id( - &self, - value: &FieldValue, - field_label: &str, - ) -> Result { - match value { - FieldValue::Reference(id) => Ok(*id), - FieldValue::Record(fields) if fields.is_empty() => Err(format!( - "`{field_label}`: DeclarationRef is the empty record literal {{}} — use an identifier \ - so lowering emits FieldValue::Reference(DeclarationId), not an empty record", - )), - other => Err(format!( - "`{field_label}`: expected FieldValue::Reference(DeclarationId) \ - for a DeclarationRef edge, got {other:?}" - )), - } - } - - fn lens_has_program_output_cost_signature(&self, lens_id: DeclarationId) -> bool { - let TypeConnective::Arrow { inputs, output, .. } = - &self.dag.declaration(lens_id).connective - else { - return false; - }; - matches!(inputs.as_slice(), [dag, port_id] - if self.type_ref_normalizes_to_named(*dag, "Dag") - && self.type_ref_normalizes_to_named(*port_id, "PortId")) - && self.lookup_int_type(*output) - } - - fn type_ref_normalizes_to_named(&self, candidate: DeclarationId, expected_name: &str) -> bool { - let Some(expected) = self - .dag - .declaration_by_name(expected_name) - .map(|decl| decl.id) - else { - return false; - }; - self.normalize_transparent_type(candidate) == expected - } - - fn lookup_int_type(&self, mut current: DeclarationId) -> bool { - let Some(lookup_id) = self.dag.declaration_by_name("Lookup").map(|decl| decl.id) else { - return false; - }; - for _ in 0..32 { - match &self.dag.declaration(current).connective { - TypeConnective::Instantiation { - template, - arguments, - } if *template == lookup_id => match arguments.as_slice() { - [arg] => return self.type_ref_normalizes_to_named(arg.value, "Int"), - _ => return false, - }, - TypeConnective::Instantiation { - template, - arguments, - } if arguments.is_empty() => current = *template, - TypeConnective::Atom( - AtomPayload::ResolvedByStructure(next) | AtomPayload::ResolvedByName(next), - ) => current = *next, - _ => return false, - } - } - false - } - - fn program_input_role(&self, decl: &Declaration) -> Result, String> { - if self.decl_inhabits_named_role(decl, "ProgramInput")? { - return Ok(Some(ProgramInputRole::ProgramInput)); - } - if !self.decl_inhabits_named_role(decl, "ProgramOutputBind")? { - return Ok(None); - } - let Some(ValueBody::Structural { fields }) = decl.value_body.as_ref() else { - return Err(format!( - "ProgramOutputBind `{}` must have a structural data body", - decl_display_name(decl.id, decl) - )); - }; - let Some(output_ref) = field(fields, "output_ref") else { - return Err(format!( - "ProgramOutputBind `{}` is missing `output_ref`", - decl_display_name(decl.id, decl) - )); - }; - let output_ref = match output_ref { - FieldValue::Reference(id) => *id, - other => { - return Err(format!( - "ProgramOutputBind `{}` output_ref must be a DeclarationRef edge, got {other:?}", - decl_display_name(decl.id, decl) - )); - } - }; - let output_decl = self.dag.declaration(output_ref); - let Some(output_bind_name) = output_decl.name.clone() else { - return Err(format!( - "ProgramOutputBind `{}` output_ref must name a declaration", - decl_display_name(decl.id, decl) - )); - }; - // Cross-Dag bridge: `output_ref` is a structural edge in the fixture DAG, but - // the compiled `TestClaim.source` program is a separate Dag, so the runner - // still carries the referenced declaration name into `find_bind`. - // Dissolution trigger: authored claims carry an output-bind identity that - // resolves inside the compiled program Dag instead of through fixture stubs. - Ok(Some(ProgramInputRole::ProgramOutputBind { - output_bind_name, - })) - } - - fn decl_inhabits_named_role( - &self, - decl: &Declaration, - role_name: &str, - ) -> Result { - // Narrow bridge: role declarations are still found by type name because - // `input_ref` is statically `DeclarationRef`. Dissolve with a structured - // `TestPredicate` input-role coproduct when the schema carries it. - let Some(role_id) = self.dag.declaration_by_name(role_name).map(|d| d.id) else { - return Err(format!( - "verification role type `{role_name}` is missing from the fixture Dag" - )); - }; - Ok(decl.inhabits == Some(role_id) - || decl.meta_tag == Some(role_id) - || matches!( - &decl.connective, - TypeConnective::Instantiation { template, .. } if *template == role_id - )) - } - - fn decl_inhabits_role_id(decl: &Declaration, role_id: DeclarationId) -> bool { - decl.inhabits == Some(role_id) - || decl.meta_tag == Some(role_id) - || matches!( - &decl.connective, - TypeConnective::Instantiation { template, .. } if *template == role_id - ) - } - - fn eval_differential_equals( - &self, - claim: &TestClaimValue, - payload: &[FieldValue], - ) -> ClaimResult { - let [subject_fv, oracle_fv, input_fv] = payload else { - return ClaimResult::Fail(format!( - "DifferentialEquals payload should be exactly three DeclarationRef fields \ - (subject_ref, oracle_ref, input_ref); got {} payload slot(s)", - payload.len() - )); - }; - let subject_id = match self.resolve_declaration_ref_id(subject_fv, "subject_ref") { - Ok(id) => id, - Err(msg) => return ClaimResult::Fail(msg), - }; - let oracle_id = match self.resolve_declaration_ref_id(oracle_fv, "oracle_ref") { - Ok(id) => id, - Err(msg) => return ClaimResult::Fail(msg), - }; - let input_id = match self.resolve_declaration_ref_id(input_fv, "input_ref") { - Ok(id) => id, - Err(msg) => return ClaimResult::Fail(msg), - }; - - let subject_decl = self.dag.declaration(subject_id); - let oracle_decl = self.dag.declaration(oracle_id); - let input_decl = self.dag.declaration(input_id); - - let subject_lineage = decl_display_name(subject_id, subject_decl); - let oracle_lineage = decl_display_name(oracle_id, oracle_decl); - let input_name = decl_display_name(input_id, input_decl); - - let program_input = match self.program_input_role(input_decl) { - Ok(Some(role)) => role, - Ok(None) => { - return ClaimResult::Fail(format!( - "DifferentialEquals: input_ref `{input_name}` must inhabit ProgramOutputBind" - )); - } - Err(msg) => return ClaimResult::Fail(format!("DifferentialEquals: {msg}")), - }; - - let program_dag = match compile_to_dag(&claim.source, &claim.file_name) { - Ok(dag) => dag, - Err(CompileError::Semantic(dag)) => { - return ClaimResult::Fail(format!( - "DifferentialEquals: claim `source` / `{}` failed inference: {:?}", - claim.file_name, - dag.diagnostics().iter().collect::>() - )); - } - Err(err) => { - return ClaimResult::Fail(format!( - "DifferentialEquals: claim `source` / `{}` did not compile: {err:?}", - claim.file_name - )); - } - }; - - let Some(cost_bind) = program_input.output_bind_name() else { - return ClaimResult::Fail(format!( - "DifferentialEquals: input_ref `{input_name}` must inhabit ProgramOutputBind" - )); - }; - let Some(bind) = find_bind(&program_dag, cost_bind, &claim.file_name) else { - return ClaimResult::Fail(format!( - "DifferentialEquals: bind `{cost_bind}` not found in `{}`", - claim.file_name - )); - }; - - if subject_lineage == oracle_lineage { - return ClaimResult::Fail( - "DifferentialEquals: subject_ref and oracle_ref must name distinct lineages" - .to_string(), - ); - } - - let w1_emit_eval_pair = (subject_lineage.as_str(), oracle_lineage.as_str()); - if matches!( - w1_emit_eval_pair, - ("rust_emit_output", "dag_eval_output") | ("dag_eval_output", "rust_emit_output") - ) { - let subject_int = match w1_differential_equals_lineage_int( - subject_lineage.as_str(), - &program_dag, - bind, - &claim.file_name, - ) { - Ok(v) => v, - Err(msg) => return ClaimResult::Fail(msg), - }; - let oracle_int = match w1_differential_equals_lineage_int( - oracle_lineage.as_str(), - &program_dag, - bind, - &claim.file_name, - ) { - Ok(v) => v, - Err(msg) => return ClaimResult::Fail(msg), - }; - return if subject_int == oracle_int { - ClaimResult::Pass - } else { - ClaimResult::Fail(format!( - "DifferentialEquals(W1): `{subject_lineage}` int {subject_int} != `{oracle_lineage}` int {oracle_int} \ - (emit vs eager eval parity; dissolution: PB-Runtime tests + PR-B witness-shaped `ProgramObservation`)" - )) - }; - } - - let pairing_ok = (subject_lineage.as_str() == "v3_program_cost" - && oracle_lineage.as_str() == "v2_oracle_cost") - || (subject_lineage.as_str() == "v2_oracle_cost" - && oracle_lineage.as_str() == "v3_program_cost"); - if !pairing_ok { - // E8/W1: unsupported output producers must stay fail-closed until - // producer identity and typed observation normalization are declared. - // Dissolution targets: `rust_emit_output` -> PB-Runtime generated - // target-language tests; `dag_eval_output` -> PR-B eager evaluator - // plus witness construction. - return ClaimResult::NotYetImplemented(format!( - "DifferentialEquals: unsupported producer pairing ({subject_lineage}, {oracle_lineage}); \ - implemented: (v3_program_cost, v2_oracle_cost) Lane-E cost parity and \ - (rust_emit_output, dag_eval_output) W1 emit/eval Int slice per #1485 / \ - `docs/briefs/r3-pr-e8-w1-output-producer-contract-blocker.md`. \ - This path stays NotYetImplemented (fail-closed unsupported-pair receipt, not Pass) until \ - an approved producer + observation contract matches; after #1495 lands, rebase this \ - branch and preserve the stronger unsupported-pair ratchet / producer-identity gates vs \ - substrate-owned dissolution (`r2-pr-b-2-runner-extension-bundle.md`)." - )); - } - - // P3: `subject_ref` / `oracle_ref` are not decorative — `subject_lineage` vs - // `oracle_lineage` must dispatch distinct producers in - // `eval_lane_e_differential_cost_lineage` (host forward-fold vs `lens_cost::cost_of`), not - // two identical `cost_of` calls (PR #764 inline review). - let subject_out = match eval_lane_e_differential_cost_lineage( - subject_lineage.as_str(), - &program_dag, - bind.value, - ) { - Ok(v) => v, - Err(msg) => return ClaimResult::Fail(msg), - }; - let oracle_out = match eval_lane_e_differential_cost_lineage( - oracle_lineage.as_str(), - &program_dag, - bind.value, - ) { - Ok(v) => v, - Err(msg) => return ClaimResult::Fail(msg), - }; - - if subject_out == oracle_out { - ClaimResult::Pass - } else { - ClaimResult::Fail(format!( - "DifferentialEquals: subject `{subject_lineage}` output {subject_out:?} != oracle `{oracle_lineage}` output {oracle_out:?} (host forward-fold vs `lens_cost::cost_of`)" - )) - } - } - - fn eval_algebraic_law(&self, claim: &TestClaimValue, payload: &[FieldValue]) -> ClaimResult { - // `Associativity`, `Commutativity`, and `Identity` are wired via bounded operational witness - // tables (see `eval_algebraic_law_for_claim_program` — not substrate law-fact evaluation). - let (law, _) = match algebraic_law_payload_fields(payload) { - Ok(parts) => parts, - Err(AlgebraicLawProgramError::MalformedPayload(message)) => { - return ClaimResult::Fail(message); - } - Err(AlgebraicLawProgramError::UnsupportedLaw { law_label }) => unreachable!( - "algebraic_law_payload_fields only yields MalformedPayload (got UnsupportedLaw({law_label:?}))" - ), - }; - let (law_label, law_payload) = match variant_fields(self.dag, law) { - Ok(parts) => parts, - Err(AlgebraicLawProgramError::MalformedPayload(message)) => { - return ClaimResult::Fail(message); - } - Err(AlgebraicLawProgramError::UnsupportedLaw { law_label }) => unreachable!( - "variant_fields only yields MalformedPayload (got UnsupportedLaw({law_label:?}))" - ), - }; - if law_label != "Associativity" && law_label != "Commutativity" && law_label != "Identity" { - return ClaimResult::NotYetImplemented(format!( - "AlgebraicLaw::{law_label} is not wired in the Rust runner; Distributivity must \ - route through INVARIANTS P1 as an AlgebraicLawKind substrate enum extension" - )); - } - if !law_payload.is_empty() { - return ClaimResult::Fail(format!("{law_label} should be payload-free")); - } - - let program_dag = match compile_to_dag(&claim.source, &claim.file_name) { - Ok(dag) => dag, - Err(CompileError::Semantic(_)) => { - return ClaimResult::Fail( - "claim program compiled with diagnostics (AlgebraicLaw requires a clean compile)" - .to_string(), - ); - } - Err(err) => { - return ClaimResult::Fail(format!( - "claim program did not compile (AlgebraicLaw): {err:?}" - )); - } - }; - match eval_algebraic_law_for_claim_program(self.dag, &program_dag, payload) { - Ok(true) => ClaimResult::Pass, - Ok(false) => ClaimResult::Fail(format!( - "AlgebraicLaw {law_label}: operational witness failed (must pass all fixed Int \ - samples in bounded D1 lens application; D1 apply — not a substrate declared-law check; see \ - eval_algebraic_law_for_claim_program)" - )), - Err(AlgebraicLawProgramError::MalformedPayload(message)) => ClaimResult::Fail(message), - Err(AlgebraicLawProgramError::UnsupportedLaw { law_label }) => { - ClaimResult::NotYetImplemented(format!( - "AlgebraicLaw::{law_label} is not implemented by the Rust runner" - )) - } - } - } - - /// Same pattern as other arms: `compile_to_dag(claim.source)` is a **clean-claim** gate; host - /// `command` / `args` / `expect_exit_code` come only from the predicate `payload` (the compiled - /// `Dag` is not an input to `std::process::Command` here — PR #792, 837d0e59). - fn eval_execute_command(&self, claim: &TestClaimValue, payload: &[FieldValue]) -> ClaimResult { - match compile_to_dag(&claim.source, &claim.file_name) { - Ok(_) => {} - Err(CompileError::Semantic(_)) => { - return ClaimResult::Fail( - "ExecuteCommand: claim program compiled with diagnostics (clean compile required)" - .to_string(), - ); - } - Err(err) => { - return ClaimResult::Fail(format!( - "ExecuteCommand: claim program did not compile: {err:?}" - )); - } - } - let Some((command, args, expect_exit_code)) = parse_execute_command_fields(payload) else { - return ClaimResult::Fail( - "ExecuteCommand payload should be (String, List, Int) — see verification.dag" - .to_string(), - ); - }; - evaluate_execute_command_exit_code(&command, &args, expect_exit_code) - } - - fn eval_for_all_targets(&self, claim: &TestClaimValue, payload: &[FieldValue]) -> ClaimResult { - if let Err(reason) = self.validate_for_all_targets_resource_requirements(claim) { - return ClaimResult::Fail(reason); - } - let [command_fv, args_fv, expect_exit_code_fv, input_fv] = payload else { - return ClaimResult::Fail( - "ForAllTargets payload should be (String, List, Int, DeclarationRef) — see verification.dag" - .to_string(), - ); - }; - let Some((command, args, expect_exit_code)) = parse_execute_command_fields(&[ - command_fv.clone(), - args_fv.clone(), - expect_exit_code_fv.clone(), - ]) else { - return ClaimResult::Fail( - "ForAllTargets payload should begin with (String, List, Int) — see verification.dag" - .to_string(), - ); - }; - let input_id = match self.resolve_declaration_ref_id(input_fv, "input_ref") { - Ok(id) => id, - Err(msg) => return ClaimResult::Fail(format!("ForAllTargets(L5): {msg}")), - }; - let input_decl = self.dag.declaration(input_id); - let input_name = decl_display_name(input_id, input_decl); - let output_bind_name = match self.program_input_role(input_decl) { - Ok(Some(ProgramInputRole::ProgramOutputBind { output_bind_name })) => output_bind_name, - Ok(Some(ProgramInputRole::ProgramInput)) | Ok(None) => { - return ClaimResult::Fail(format!( - "ForAllTargets(L5): input_ref `{input_name}` must inhabit ProgramOutputBind" - )); - } - Err(msg) => return ClaimResult::Fail(format!("ForAllTargets(L5): {msg}")), - }; - // Dissolution trigger: replace this ExecuteCommand-shaped scaffold once - // `std.verification.ForAllTargets` drops the inert command triple, carries only typed - // target-observation edges, and owns the toolchain requirement set instead of mirroring it - // through Rust string constants. - if command != "true" || !args.is_empty() || expect_exit_code != 0 { - return ClaimResult::Fail(format!( - "ForAllTargets(L5) expects inert scaffold payload true/[]/0; got command=`{command}`, args={args:?}, expect_exit_code={expect_exit_code}. \ - Target execution is owned by the Rust/Python/Go emit runner path, not the raw shell triple." - )); - } - l5_cross_target_outputs_int(claim, &output_bind_name) - } - - fn validate_for_all_targets_resource_requirements( - &self, - claim: &TestClaimValue, - ) -> Result<(), String> { - let mut actual = BTreeSet::new(); - for (idx, requirement) in claim.requires.iter().enumerate() { - let Some(fields) = record_fields(requirement) else { - return Err(format!( - "ForAllTargets(L5): `requires[{idx}]` must be a ResourceReference record" - )); - }; - let Some(target) = field(fields, "target") else { - return Err(format!( - "ForAllTargets(L5): `requires[{idx}]` is missing `target`" - )); - }; - let FieldValue::Reference(id) = target else { - return Err(format!( - "ForAllTargets(L5): `requires[{idx}].target` must be a DeclarationRef edge, got {target:?}" - )); - }; - let Some(name) = self.dag.declaration(*id).name.as_deref() else { - return Err(format!( - "ForAllTargets(L5): `requires[{idx}].target` must name a toolchain marker" - )); - }; - actual.insert(name.to_string()); - } - let expected: BTreeSet = L5_REQUIRED_TOOLCHAINS - .iter() - .map(|name| (*name).to_string()) - .collect(); - if actual != expected { - return Err(format!( - "ForAllTargets(L5): `TestClaim.requires` must declare exactly {:?}; got {:?}", - L5_REQUIRED_TOOLCHAINS, actual - )); - } - Ok(()) - } - - fn eval_cost_bounded(&self, claim: &TestClaimValue, payload: &[FieldValue]) -> ClaimResult { - let [FieldValue::Literal(LiteralBits::String(bind_name)), comparator, FieldValue::Literal(LiteralBits::Int(bound_s))] = - payload - else { - return ClaimResult::Fail( - "CostBounded payload should be (String, ComparisonOp, Int)".to_string(), - ); - }; - let Ok(bound) = bound_s.parse::() else { - return ClaimResult::Fail( - "CostBounded: bound must be a valid decimal i64 literal".to_string(), - ); - }; - let dag = match compile_to_dag(&claim.source, &claim.file_name) { - Ok(dag) => dag, - Err(err) => { - return ClaimResult::Fail(format!( - "CostBounded: claim source did not compile (structural cost check skipped): {err:?}" - )); - } - }; - let Some(bind) = find_bind(&dag, bind_name, &claim.file_name) else { - return ClaimResult::Fail(format!( - "CostBounded: bind `{bind_name}` not found in `{}`", - claim.file_name - )); - }; - let actual = match cost_of(&dag, &bind.value) { - CostLookup::Hit(actual) => actual, - CostLookup::Miss => { - return ClaimResult::Fail(format!( - "CostBounded: missing structural `cost_of` receipt for bind `{bind_name}`" - )); - } - }; - if self.compare_cost(comparator, actual, bound) { - ClaimResult::Pass - } else { - ClaimResult::Fail(format!( - "cost {actual} did not satisfy bound {bound} (predicate literal `{bound_s}`)" - )) - } - } - - /// Evaluate `TestPredicate::PerfWithinBaseline { subject, comparator, baseline_ref }`. - /// - /// Resolves both `DeclarationRef`s to `PerfBaselineMeasurement` substrate records - /// (`median_ns`, `p99_delta_ns` per `src/v3/std/substrate.dag`), constructs absolute - /// p99 as `median_ns + p99_delta_ns` with checked arithmetic, then applies the - /// Director-locked Tier-3 budget thresholds (`docs/r3-structure.md` §225): - /// subject median ≤ `baseline.median_ns × 2` and subject absolute p99 ≤ - /// `(baseline_median + baseline_delta) × 5`. `comparator` must be - /// `PerfBudgetComparisonOp::AtMostBudget` (`src/v3/std/verification.dag`). - fn eval_perf_within_baseline( - &self, - _claim: &TestClaimValue, - payload: &[FieldValue], - ) -> ClaimResult { - let [subject_fv, comparator, baseline_fv] = payload else { - return ClaimResult::Fail(format!( - "PerfWithinBaseline payload should be exactly three fields \ - (subject: DeclarationRef, comparator: PerfBudgetComparisonOp, baseline_ref: DeclarationRef); \ - got {} payload slot(s)", - payload.len() - )); - }; - let subject_id = match self.resolve_declaration_ref_id(subject_fv, "subject") { - Ok(id) => id, - Err(reason) => return ClaimResult::Fail(reason), - }; - let baseline_id = match self.resolve_declaration_ref_id(baseline_fv, "baseline_ref") { - Ok(id) => id, - Err(reason) => return ClaimResult::Fail(reason), - }; - // Enforce the Director-locked "within baseline" semantics (`r3-structure.md` - // §225): budget is `median ≤ 2× baseline` AND `p99 ≤ 5× baseline`. - // `std.verification` exposes a closed budget comparator instead of the - // general `ComparisonOp` coproduct so inverted comparisons cannot be - // authored into this gate. - let Some(comparator_label) = perf_budget_comparator_label(self.dag, comparator) else { - return ClaimResult::Fail( - "PerfWithinBaseline `comparator`: expected unit PerfBudgetComparisonOp variant; \ - got non-PerfBudgetComparisonOp variant, non-variant, or non-empty payload" - .to_string(), - ); - }; - if !is_perf_budget_comparator_at_most(&comparator_label) { - return ClaimResult::Fail(format!( - "PerfWithinBaseline `comparator`: only `AtMostBudget` matches the Director-locked \ - §225 budget semantics (median ≤ 2× baseline median, absolute p99 ≤ 5× baseline absolute p99); \ - `{comparator_label}` would invert or skew the gate" - )); - } - let subject = match self.perf_baseline_measurement(subject_id, "subject") { - Ok(measurement) => measurement, - Err(err) => return ClaimResult::Fail(err.into_claim_fail("subject")), - }; - let baseline = match self.perf_baseline_measurement(baseline_id, "baseline_ref") { - Ok(measurement) => measurement, - Err(err) => return ClaimResult::Fail(err.into_claim_fail("baseline_ref")), - }; - let (median_bound, p99_bound) = match compute_perf_budget_bounds(baseline) { - Ok(bounds) => bounds, - Err(PerfBudgetOverflow::Median) => { - return ClaimResult::Fail( - "PerfWithinBaseline: median baseline threshold (baseline_ref median_ns × 2) \ - overflowed Int — fail-closed; recapture with smaller baseline or widen Int." - .to_string(), - ); - } - Err(PerfBudgetOverflow::P99) => { - return ClaimResult::Fail( - "PerfWithinBaseline: p99 baseline threshold ((baseline median + delta) × 5) \ - overflowed Int — fail-closed; recapture with smaller baseline or widen Int." - .to_string(), - ); - } - }; - let median_ok = subject.median_ns <= median_bound; - let p99_ok = subject.p99_ns <= p99_bound; - if median_ok && p99_ok { - ClaimResult::Pass - } else { - ClaimResult::Fail(format!( - "PerfWithinBaseline: subject median_ns={} vs threshold {} (median_ok={}) \ - and subject p99_ns={} vs threshold {} (p99_ok={}) did not satisfy AtMostBudget", - subject.median_ns, median_bound, median_ok, subject.p99_ns, p99_bound, p99_ok - )) - } - } - - /// Structurally resolve a `PerfBaselineMeasurement` data declaration to absolute - /// `{ median_ns, p99_ns }` (`p99_ns = median_ns + p99_delta_ns`, checked). Rejects - /// negative `Int` literals for either field (`substrate.dag` uses `Nat` for both). - /// Returns a typed `PerfMeasurementResolveError` per `CODING.md` typed-error discipline; - /// the outer [`Self::eval_perf_within_baseline`] boundary converts to - /// `ClaimResult::Fail(...)` with the role label preserved. - fn perf_baseline_measurement( - &self, - decl_id: DeclarationId, - _role: &str, - ) -> Result { - let decl = match self.dag.declaration_opt(&decl_id) { - Some(decl) => decl, - None => return Err(PerfMeasurementResolveError::MissingDeclaration), - }; - let fields = match decl.value_body.as_ref() { - Some(ValueBody::Structural { fields }) => fields, - _ => return Err(PerfMeasurementResolveError::WrongConnective), - }; - let median_ns = match field(fields, "median_ns") { - Some(FieldValue::Literal(LiteralBits::Int(s))) => match s.parse::() { - Ok(v) => v, - Err(_) => { - return Err(PerfMeasurementResolveError::WrongFieldKind { field: "median_ns" }); - } - }, - Some(_) => { - return Err(PerfMeasurementResolveError::WrongFieldKind { field: "median_ns" }); - } - None => { - return Err(PerfMeasurementResolveError::MissingField { field: "median_ns" }); - } - }; - let p99_delta_ns = match field(fields, "p99_delta_ns") { - Some(FieldValue::Literal(LiteralBits::Int(s))) => match s.parse::() { - Ok(v) => v, - Err(_) => { - return Err(PerfMeasurementResolveError::WrongFieldKind { - field: "p99_delta_ns", - }); - } - }, - Some(_) => { - return Err(PerfMeasurementResolveError::WrongFieldKind { - field: "p99_delta_ns", - }); - } - None => { - return Err(PerfMeasurementResolveError::MissingField { - field: "p99_delta_ns", - }); - } - }; - if median_ns < 0 { - return Err(PerfMeasurementResolveError::NegativeNatLiteral { field: "median_ns" }); - } - if p99_delta_ns < 0 { - return Err(PerfMeasurementResolveError::NegativeNatLiteral { - field: "p99_delta_ns", - }); - } - // `checked_add` only covers i64 overflow. Negative `p99_delta_ns` is rejected - // above so absolute p99 cannot undershoot `median_ns` (INVARIANTS P2/P3). - let p99_ns = median_ns - .checked_add(p99_delta_ns) - .ok_or(PerfMeasurementResolveError::P99ConstructionOverflow)?; - Ok(PerfMeasurement { median_ns, p99_ns }) - } - - fn eval_census_bound_check_shape( - &self, - _claim: &TestClaimValue, - payload: &[FieldValue], - ) -> ClaimResult { - let [authority, list_constant, FieldValue::Literal(LiteralBits::Int(bound_s))] = payload - else { - return ClaimResult::Fail( - "CensusBoundCheck payload should be (DeclarationRef, CensusListConstant, Int)" - .to_string(), - ); - }; - let Ok(bound) = bound_s.parse::() else { - return ClaimResult::Fail( - "CensusBoundCheck: bound must be a valid decimal i64 literal".to_string(), - ); - }; - if let Err(reason) = self.resolve_census_authority_ref(authority, "authority") { - return ClaimResult::Fail(reason); - } - let list_constant_name = match self.resolve_census_list_constant_ref(list_constant) { - Ok(name) => name, - Err(reason) => return ClaimResult::Fail(reason), - }; - let count = match sg0_census_list_count(&list_constant_name) { - Ok(count) => count, - Err(reason) => return ClaimResult::Fail(reason), - }; - if count <= bound { - ClaimResult::Pass - } else { - ClaimResult::Fail(format!( - "CensusBoundCheck `{list_constant_name}` observed {count}, bound {bound}" - )) - } - } - - fn eval_census_subset_count_shape( - &self, - _claim: &TestClaimValue, - payload: &[FieldValue], - ) -> ClaimResult { - let [authority, list_constant, subset_predicate] = payload else { - return ClaimResult::Fail( - "CensusSubsetCount payload should be (DeclarationRef, CensusListConstant, DeclarationRef)".to_string(), - ); - }; - if let Err(reason) = self.resolve_census_authority_ref(authority, "authority") { - return ClaimResult::Fail(reason); - } - let list_constant_name = match self.resolve_census_list_constant_ref(list_constant) { - Ok(name) => name, - Err(reason) => return ClaimResult::Fail(reason), - }; - let FieldValue::Reference(subset_id) = subset_predicate else { - return ClaimResult::Fail(format!( - "PB census predicate `subset_predicate` should be a DeclarationRef, got {subset_predicate:?}" - )); - }; - let subset_name = self - .dag - .declaration(*subset_id) - .name - .as_deref() - .unwrap_or(""); - let (predicate, subset_label): (fn(&str) -> bool, &str) = match subset_name { - "lens_producer_files_subset_predicate" => { - if let Err(reason) = self.resolve_pb_marker_ref( - subset_predicate, - "subset_predicate", - "lens_producer_files_subset_predicate", - "LensProducerFilesSubsetPredicate", - ) { - return ClaimResult::Fail(reason); - } - (is_lens_producer_census_path, "lens-producer") - } - "bin_shim_files_subset_predicate" => { - if let Err(reason) = self.resolve_pb_marker_ref( - subset_predicate, - "subset_predicate", - "bin_shim_files_subset_predicate", - "BinShimFilesSubsetPredicate", - ) { - return ClaimResult::Fail(reason); - } - (is_bin_shim_census_path, "bin-shim") - } - other => { - return ClaimResult::Fail(format!( - "PB census predicate `subset_predicate` references unknown predicate `{other}`" - )); - } - }; - let entries = match sg0_census_list_entries(&list_constant_name) { - Ok(entries) => entries, - Err(reason) => return ClaimResult::Fail(reason), - }; - let count = entries.iter().filter(|path| predicate(path)).count() as i64; - if count == 0 { - ClaimResult::Pass - } else { - ClaimResult::Fail(format!( - "CensusSubsetCount `{list_constant_name}` {subset_label} subset observed {count}" - )) - } - } - - fn eval_fixed_point_converges_shape( - &self, - _claim: &TestClaimValue, - payload: &[FieldValue], - ) -> ClaimResult { - let [FieldValue::Literal(LiteralBits::String(compile_target)), FieldValue::Literal(LiteralBits::String(expected))] = - payload - else { - return ClaimResult::Fail( - "FixedPointConverges payload should be (Path, SnapshotRef)".to_string(), - ); - }; - if compile_target != "default_fixed_point_source" { - return ClaimResult::Fail(format!( - "FixedPointConverges only supports `default_fixed_point_source` today, got `{compile_target}`" - )); - } - if expected != "pipeline_stage_snapshots" { - return ClaimResult::Fail(format!( - "FixedPointConverges only supports `pipeline_stage_snapshots` today, got `{expected}`" - )); - } - let pass1 = match compile_stage_snapshots(default_fixed_point_source(), compile_target) { - Ok(snapshots) => snapshots, - Err(err) => { - return ClaimResult::Fail(format!("FixedPointConverges pass1 failed: {err:?}")) - } - }; - let pass2 = match compile_stage_snapshots(default_fixed_point_source(), compile_target) { - Ok(snapshots) => snapshots, - Err(err) => { - return ClaimResult::Fail(format!("FixedPointConverges pass2 failed: {err:?}")) - } - }; - match compare_stage_snapshots(&pass1, &pass2) { - Ok(()) => ClaimResult::Pass, - Err(mismatch) => ClaimResult::Fail(format!( - "FixedPointConverges mismatch at `{}`: {}", - mismatch.stage, mismatch.detail - )), - } - } - - fn eval_ratchet_zero_shape( - &self, - _claim: &TestClaimValue, - payload: &[FieldValue], - ) -> ClaimResult { - let [authority, ratchet_kind] = payload else { - return ClaimResult::Fail( - "RatchetZero payload should be (DeclarationRef, DeclarationRef)".to_string(), - ); - }; - if let Err(reason) = self.resolve_census_authority_ref(authority, "authority") { - return ClaimResult::Fail(reason); - } - if let Err(reason) = self.resolve_pb_marker_ref( - ratchet_kind, - "ratchet_kind", - "compiler_std_positive_set_ratchet", - "CompilerStdPositiveSetRatchet", - ) { - return ClaimResult::Fail(reason); - } - let count = compiler_std_positive_set_ratchet_count(); - if count == 0 { - ClaimResult::Pass - } else { - ClaimResult::Fail(format!( - "RatchetZero `compiler_std_positive_set_ratchet` observed {count}" - )) - } - } - - /// `TestPredicate::BridgeLedgerZero { ledger: BridgeLedgerRef }`. - /// Unwraps the `BridgeLedgerRef { decl: DeclarationRef }` typed - /// wrapper, fail-closes if the inner declaration is not the - /// canonical `bridge_ledger`, then walks the - /// `List` and `Pass`es iff every row's `status` - /// field resolves to the `Retired` constructor of `BridgeStatus`. - /// Open rows surface in the failure message by name so - /// Verification points directly at the residual debt. - fn eval_bridge_ledger_zero( - &self, - _claim: &TestClaimValue, - payload: &[FieldValue], - ) -> ClaimResult { - let [ledger] = payload else { - return ClaimResult::Fail( - "BridgeLedgerZero payload should be (BridgeLedgerRef)".to_string(), - ); - }; - // `ledger: BridgeLedgerRef` lowers as a record `{ decl: DeclarationRef }`. - // Extract the inner declaration reference structurally; reject - // an unwrapped `DeclarationRef` because that would regress the - // typed-edge discipline the `BridgeLedgerRef` wrapper adds. - let ledger_id = match ledger { - FieldValue::Record(fields) => { - let Some(decl) = fields.iter().find(|(l, _)| l == "decl").map(|(_, v)| v) else { - return ClaimResult::Fail( - "BridgeLedgerZero `ledger`: BridgeLedgerRef record missing `decl` field" - .to_string(), - ); - }; - match decl { - FieldValue::Reference(id) => *id, - other => { - return ClaimResult::Fail(format!( - "BridgeLedgerZero `ledger.decl`: expected \ - FieldValue::Reference(DeclarationId), got {other:?}" - )); - } - } - } - other => { - return ClaimResult::Fail(format!( - "BridgeLedgerZero `ledger`: expected BridgeLedgerRef record \ - `{{ decl: }}`, got {other:?}" - )); - } - }; - let decl = self.dag.declaration(ledger_id); - // Fail-closed *identity* check: the ledger declaration must be - // exactly `bridge_ledger` from `v3.std.bridge_ledger`, not any - // sibling `List`. Single-authority discipline - // (INVARIANTS P2 / modeling-discipline single-authority): a - // second list that happens to share the row type cannot be - // accepted as a parallel ledger authority and pass the gate - // independently of the canonical carrier. - let canonical_ledger_id = self.dag.declaration_by_name("bridge_ledger").map(|d| d.id); - match canonical_ledger_id { - Some(canonical) if canonical == ledger_id => {} - Some(_) => { - return ClaimResult::Fail(format!( - "BridgeLedgerZero `ledger`: only the canonical \ - `v3.std.bridge_ledger.bridge_ledger` declaration is an \ - accepted ledger authority. Got `{}` (DeclarationId {:?}).", - decl_display_name(decl.id, decl), - decl.id - )); - } - None => { - return ClaimResult::Fail( - "BridgeLedgerZero: canonical `bridge_ledger` declaration is missing \ - from the bootstrap; the ledger gate cannot resolve." - .to_string(), - ); - } - } - // Type check (kept as a defense-in-depth guard even after the - // identity check above): the canonical declaration must be - // `List`. If the carrier authority ever - // diverges from this shape the predicate fails closed instead - // of silently misreading the rows. - match &decl.connective { - TypeConnective::Instantiation { - template, - arguments, - } => { - let template_name = self.dag.declaration(*template).name.clone(); - if template_name.as_deref() != Some("List") { - return ClaimResult::Fail(format!( - "BridgeLedgerZero `ledger`: declaration `{}` is not a `List<...>` \ - instantiation (template is `{}`)", - decl_display_name(decl.id, decl), - template_name.as_deref().unwrap_or("") - )); - } - let [arg] = arguments.as_slice() else { - return ClaimResult::Fail(format!( - "BridgeLedgerZero `ledger`: `List<...>` instantiation must carry \ - exactly one type argument, got {}", - arguments.len() - )); - }; - let element_name = self.dag.declaration(arg.value).name.clone(); - if element_name.as_deref() != Some("BridgeLedgerRow") { - return ClaimResult::Fail(format!( - "BridgeLedgerZero `ledger`: expected `List` \ - element type, got `List<{}>`", - element_name.as_deref().unwrap_or("") - )); - } - } - other => { - return ClaimResult::Fail(format!( - "BridgeLedgerZero `ledger`: declaration `{}` is not a `List<...>` \ - instantiation; connective is {other:?}", - decl_display_name(decl.id, decl) - )); - } - } - let rows = match &decl.value_body { - Some(ValueBody::List(rows)) => rows, - Some(other) => { - return ClaimResult::Fail(format!( - "BridgeLedgerZero `ledger` must point at a `data X: List` \ - declaration; `{}` value_body is {other:?}", - decl_display_name(decl.id, decl) - )); - } - None => { - return ClaimResult::Fail(format!( - "BridgeLedgerZero `ledger` declaration `{}` has no value_body", - decl_display_name(decl.id, decl) - )); - } - }; - - let Some(bridge_status) = self.dag.declaration_by_name("BridgeStatus") else { - return ClaimResult::Fail( - "BridgeLedgerZero: `BridgeStatus` is not declared in the bootstrap; \ - cannot resolve the `Retired` / `Open` constructors structurally" - .to_string(), - ); - }; - let TypeConnective::Disj { variants } = &bridge_status.connective else { - return ClaimResult::Fail( - "BridgeLedgerZero: `BridgeStatus` must be a Disj coproduct".to_string(), - ); - }; - let allowed_constructors: std::collections::HashSet = - variants.iter().map(|v| v.ty).collect(); - let Some(retired_ty) = variants.iter().find(|v| v.label == "Retired").map(|v| v.ty) else { - return ClaimResult::Fail( - "BridgeLedgerZero: `BridgeStatus::Retired` variant missing".to_string(), - ); - }; - - let mut open_rows: Vec = Vec::new(); - for (idx, row) in rows.iter().enumerate() { - let FieldValue::Record(fields) = row else { - return ClaimResult::Fail(format!( - "BridgeLedgerZero: row {idx} is not a record literal: {row:?}" - )); - }; - let name = match fields.iter().find(|(l, _)| l == "name").map(|(_, v)| v) { - Some(FieldValue::Literal(LiteralBits::String(s))) => s.clone(), - Some(other) => { - return ClaimResult::Fail(format!( - "BridgeLedgerZero: row {idx} `name` must be a String literal, got {other:?}" - )); - } - None => { - return ClaimResult::Fail(format!( - "BridgeLedgerZero: row {idx} missing required `name` field" - )); - } - }; - let status = match fields.iter().find(|(l, _)| l == "status").map(|(_, v)| v) { - Some(FieldValue::Variant { constructor, .. }) => *constructor, - Some(other) => { - return ClaimResult::Fail(format!( - "BridgeLedgerZero: row `{name}` `status` must be a Variant, got {other:?}" - )); - } - None => { - return ClaimResult::Fail(format!( - "BridgeLedgerZero: row `{name}` missing `status` field" - )); - } - }; - // Defensive: a row carrying a constructor outside `BridgeStatus`'s - // declared variants is malformed at the claim boundary, even - // though the carrier ratchet guards the substrate side. - if !allowed_constructors.contains(&status) { - return ClaimResult::Fail(format!( - "BridgeLedgerZero: row `{name}` `status` constructor (DeclarationId {:?}) \ - is not one of `BridgeStatus`'s declared variants", - status - )); - } - if status != retired_ty { - open_rows.push(name); - } - } - - if open_rows.is_empty() { - ClaimResult::Pass - } else { - ClaimResult::Fail(format!( - "BridgeLedgerZero: {} bridge row(s) not yet `Retired`: [{}]", - open_rows.len(), - open_rows.join(", ") - )) - } - } - - fn eval_generated_from_dag_shape( - &self, - _claim: &TestClaimValue, - payload: &[FieldValue], - ) -> ClaimResult { - // R3 Cluster M generator-manifest integration (Gap 5 / Cluster M lane). - // **This predicate implements the Gate #84 slice:** exact `manifest_entries` - // `output_path` set vs `GENERATED_FILES` / `build.rs::REGEN_OUTPUTS`, plus the - // empty `expected_hand_authored_test` census (failure copy cites **#84** only). - // **Gate #85** (`Quantified` / quantifier substrate) is a sibling obligation: - // `Quantified` suite-arm evaluation walks `ProgramGenerator` families (`run_suite` - // → `evaluate_quantified_test_claim`), not inside `GeneratedFromDag`. - // Payload carries `manifest_entries: List` - // (`PendingFact { output_path }` | `ResolvedFact { output_path, - // dag_source, source_hash }`). The runner consumes the shared - // `output_path` field from both arms, and validates that every - // `ResolvedFact` also carries a real declaration edge plus a non-empty - // hash token. The later byte-regeneration check can then treat - // `ResolvedFact` as already shape-materialized, not as a PendingFact - // with inert extra payload. - let [authority, FieldValue::List(manifest_entries)] = payload else { - return ClaimResult::Fail( - "GeneratedFromDag payload should be (DeclarationRef, List)" - .to_string(), - ); - }; - if let Err(reason) = self.resolve_census_authority_ref(authority, "authority") { - return ClaimResult::Fail(reason); - } - let generated: BTreeSet<&str> = GENERATED_FILES.iter().copied().collect(); - let mut named_paths = Vec::new(); - for entry in manifest_entries { - let Some((label, variant_payload)) = self.variant_value(entry) else { - return ClaimResult::Fail(format!( - "GeneratedFromDag manifest_entries must contain only GeneratedManifestEntry variants (PendingFact | ResolvedFact), got {entry:?}" - )); - }; - if label != "PendingFact" && label != "ResolvedFact" { - return ClaimResult::Fail(format!( - "GeneratedFromDag manifest_entries variant `{label}` is not a GeneratedManifestEntry arm (expected PendingFact | ResolvedFact)" - )); - } - // The v3 lowerer hands variant payloads back in three shapes depending - // on field arity / construction style: - // - single-field record variants (e.g., `PendingFact { output_path }`) - // inline the field-value as `payload = []`; - // - multi-field record variants (e.g., `ResolvedFact { output_path, - // dag_source, source_hash }`) lower positionally as - // `payload = [, , ]`; - // - some construction paths wrap the fields in a single - // `[Record([(name, value), ...])]` slot. - // For both arms of `GeneratedManifestEntry` the declared field order - // begins with `output_path`, so the first payload slot carries the - // path literal in every supported lowering shape. We accept all three - // by inspecting the first slot and, if it is a record, looking up - // `output_path` by field name. - let output_path = variant_payload.first().and_then(|head| match head { - FieldValue::Literal(LiteralBits::String(path)) => Some(path.clone()), - _ => record_fields(head).and_then(|fields| { - field(fields, "output_path").and_then(|v| match v { - FieldValue::Literal(LiteralBits::String(path)) => Some(path.clone()), - _ => None, - }) - }), - }); - match output_path { - Some(path) => named_paths.push(path), - None => { - return ClaimResult::Fail(format!( - "GeneratedFromDag GeneratedManifestEntry `{label}` payload missing String `output_path` slot: {variant_payload:?}" - )); - } - } - if label == "ResolvedFact" { - let (dag_source, source_hash) = match variant_payload.as_slice() { - [FieldValue::Record(fields)] => { - (field(fields, "dag_source"), field(fields, "source_hash")) - } - [_, dag_source, source_hash] => (Some(dag_source), Some(source_hash)), - _ => (None, None), - }; - match dag_source { - Some(FieldValue::Reference(_)) => {} - Some(other) => { - return ClaimResult::Fail(format!( - "GeneratedFromDag ResolvedFact `dag_source` must be a DeclarationRef edge, got {other:?}" - )); - } - None => { - return ClaimResult::Fail(format!( - "GeneratedFromDag ResolvedFact payload missing `dag_source` DeclarationRef: {variant_payload:?}" - )); - } - } - match source_hash { - Some(FieldValue::Literal(LiteralBits::String(hash))) if !hash.is_empty() => {} - Some(FieldValue::Literal(LiteralBits::String(_))) => { - return ClaimResult::Fail( - "GeneratedFromDag ResolvedFact `source_hash` must be non-empty" - .to_string(), - ); - } - Some(other) => { - return ClaimResult::Fail(format!( - "GeneratedFromDag ResolvedFact `source_hash` must be a String literal, got {other:?}" - )); - } - None => { - return ClaimResult::Fail(format!( - "GeneratedFromDag ResolvedFact payload missing `source_hash`: {variant_payload:?}" - )); - } - } - } - } - let manifest_set: BTreeSet<&str> = named_paths.iter().map(|path| path.as_str()).collect(); - if manifest_set.len() != named_paths.len() { - return ClaimResult::Fail( - "GeneratedFromDag manifest_entries contains duplicate `output_path` values; each \ - `build.rs::REGEN_OUTPUTS` path must appear exactly once" - .to_string(), - ); - } - if manifest_set != generated { - let only_manifest: Vec<&str> = manifest_set.difference(&generated).copied().collect(); - let only_authority: Vec<&str> = generated.difference(&manifest_set).copied().collect(); - return ClaimResult::Fail(format!( - "GeneratedFromDag manifest_entries must enumerate exactly the `build.rs::REGEN_OUTPUTS` \ - / `GENERATED_FILES` authority ({} path(s)); only-in-manifest={only_manifest:?}; \ - missing-from-manifest={only_authority:?}", - generated.len(), - )); - } - let test_count = match sg0_census_list_count("expected_hand_authored_test") { - Ok(count) => count, - Err(reason) => return ClaimResult::Fail(reason), - }; - if test_count == 0 { - ClaimResult::Pass - } else { - ClaimResult::Fail(format!( - "GeneratedFromDag: `expected_hand_authored_test` census is non-empty ({test_count} path(s)); \ - Gate #84 negative authority requires an empty hand-authored integration-test ratchet \ - at R3 close (positive authority: manifest lists {} REGEN output path(s))", - manifest_set.len(), - )) - } - } - - fn eval_release_deferred_claim_shape( - &self, - claim: &TestClaimValue, - payload: &[FieldValue], - ) -> ClaimResult { - const RELEASE_ACCEPTANCE_FIXTURE: &str = - "src/v3/compiler/tests/fixtures/r1_release_acceptance.dag"; - if claim.declaration_file != RELEASE_ACCEPTANCE_FIXTURE { - return ClaimResult::Fail(format!( - "ReleaseDeferredClaim is only valid in `{RELEASE_ACCEPTANCE_FIXTURE}`, got `{}`", - claim.declaration_file - )); - } - - let [deferred_gate, target_lane, authority_doc] = payload else { - return ClaimResult::Fail(format!( - "ReleaseDeferredClaim payload should be exactly three DeclarationRef fields \ - (deferred_gate, target_lane, authority_doc); got {} payload slot(s)", - payload.len() - )); - }; - - for (field_label, value, role_name) in [ - ("deferred_gate", deferred_gate, "R1GateMarker"), - ("target_lane", target_lane, "TargetLaneMarker"), - ("authority_doc", authority_doc, "ReleaseAuthorityDoc"), - ] { - let role_id = match self.release_fixture_local_role_id(role_name) { - Ok(id) => id, - Err(reason) => return ClaimResult::Fail(format!("ReleaseDeferredClaim: {reason}")), - }; - let id = match self.resolve_declaration_ref_id(value, field_label) { - Ok(id) => id, - Err(reason) => return ClaimResult::Fail(format!("ReleaseDeferredClaim: {reason}")), - }; - let decl = self.dag.declaration(id); - if decl.span.file != RELEASE_ACCEPTANCE_FIXTURE { - return ClaimResult::Fail(format!( - "ReleaseDeferredClaim `{field_label}` must reference a marker declared in `{RELEASE_ACCEPTANCE_FIXTURE}`, got `{}` from `{}`", - decl_display_name(id, decl), - decl.span.file - )); - } - if !Self::decl_inhabits_role_id(decl, role_id) { - return ClaimResult::Fail(format!( - "ReleaseDeferredClaim `{field_label}` must reference a declaration inhabiting fixture-local `{role_name}`, got `{}`", - decl_display_name(id, decl) - )); - } - } - - ClaimResult::Pass - } - - fn eval_substrate_research_deferred_claim_shape( - &self, - claim: &TestClaimValue, - payload: &[FieldValue], - ) -> ClaimResult { - if claim.declaration_file != TC1_SUBSTRATE_LENS_ETA_DEFERRED_FIXTURE { - return ClaimResult::Fail(format!( - "SubstrateResearchDeferredClaim is only valid in `{TC1_SUBSTRATE_LENS_ETA_DEFERRED_FIXTURE}`, got `{}`", - claim.declaration_file - )); - } - - let [deferred_gate, target_lane, authority_doc] = payload else { - return ClaimResult::Fail(format!( - "SubstrateResearchDeferredClaim payload should be exactly three DeclarationRef fields \ - (deferred_gate, target_lane, authority_doc); got {} payload slot(s)", - payload.len() - )); - }; - - for (field_label, value, role_name) in [ - ("deferred_gate", deferred_gate, "Tc1ResearchGateMarker"), - ( - "target_lane", - target_lane, - "SubstrateLensPrimitiveTargetLaneMarker", - ), - ( - "authority_doc", - authority_doc, - "LambdaCalculusGroundingAuthorityDoc", - ), - ] { - let role_id = match self.substrate_research_fixture_local_role_id(role_name) { - Ok(id) => id, - Err(reason) => { - return ClaimResult::Fail(format!("SubstrateResearchDeferredClaim: {reason}")); - } - }; - let id = match self.resolve_declaration_ref_id(value, field_label) { - Ok(id) => id, - Err(reason) => { - return ClaimResult::Fail(format!("SubstrateResearchDeferredClaim: {reason}")); - } - }; - let decl = self.dag.declaration(id); - if decl.span.file != TC1_SUBSTRATE_LENS_ETA_DEFERRED_FIXTURE { - return ClaimResult::Fail(format!( - "SubstrateResearchDeferredClaim `{field_label}` must reference a marker declared in `{TC1_SUBSTRATE_LENS_ETA_DEFERRED_FIXTURE}`, got `{}` from `{}`", - decl_display_name(id, decl), - decl.span.file - )); - } - if !Self::decl_inhabits_role_id(decl, role_id) { - return ClaimResult::Fail(format!( - "SubstrateResearchDeferredClaim `{field_label}` must reference a declaration inhabiting fixture-local `{role_name}`, got `{}`", - decl_display_name(id, decl) - )); - } - } - - ClaimResult::Pass - } - - fn substrate_research_fixture_local_role_id( - &self, - role_name: &str, - ) -> Result { - let mut matches = self.dag.declarations().iter().filter(|decl| { - decl.name.as_deref() == Some(role_name) - && decl.span.file == TC1_SUBSTRATE_LENS_ETA_DEFERRED_FIXTURE - }); - let Some(role) = matches.next() else { - return Err(format!( - "substrate TC1 fixture role `{role_name}` is missing from `{TC1_SUBSTRATE_LENS_ETA_DEFERRED_FIXTURE}`" - )); - }; - if matches.next().is_some() { - return Err(format!( - "substrate TC1 fixture role `{role_name}` is declared more than once in `{TC1_SUBSTRATE_LENS_ETA_DEFERRED_FIXTURE}`" - )); - } - Ok(role.id) - } - - fn release_fixture_local_role_id(&self, role_name: &str) -> Result { - const RELEASE_ACCEPTANCE_FIXTURE: &str = - "src/v3/compiler/tests/fixtures/r1_release_acceptance.dag"; - let mut matches = self.dag.declarations().iter().filter(|decl| { - decl.name.as_deref() == Some(role_name) && decl.span.file == RELEASE_ACCEPTANCE_FIXTURE - }); - let Some(role) = matches.next() else { - return Err(format!( - "release fixture role `{role_name}` is missing from `{RELEASE_ACCEPTANCE_FIXTURE}`" - )); - }; - if matches.next().is_some() { - return Err(format!( - "release fixture role `{role_name}` is declared more than once in `{RELEASE_ACCEPTANCE_FIXTURE}`" - )); - } - Ok(role.id) - } - - fn resolve_census_authority_ref( - &self, - value: &FieldValue, - field_label: &str, - ) -> Result { - match value { - FieldValue::Reference(id) => Ok(*id), - other => Err(format!( - "PB census predicate `{field_label}` should be a DeclarationRef edge, got {other:?}" - )), - } - } - - fn resolve_pb_marker_ref( - &self, - value: &FieldValue, - field_label: &str, - expected_decl_name: &str, - expected_marker_type: &str, - ) -> Result { - let FieldValue::Reference(id) = value else { - return Err(format!( - "PB census predicate `{field_label}` should be a DeclarationRef edge to `{expected_decl_name}`, got {value:?}" - )); - }; - let decl = self.dag.declaration(*id); - let actual_name = decl_display_name(*id, decl); - if decl.name.as_deref() != Some(expected_decl_name) { - return Err(format!( - "PB census predicate `{field_label}` expected `{expected_decl_name}`, got `{actual_name}`" - )); - } - match self.decl_inhabits_named_role(decl, expected_marker_type) { - Ok(true) => Ok(*id), - Ok(false) => Err(format!( - "PB census predicate `{field_label}` declaration `{actual_name}` must inhabit `{expected_marker_type}`" - )), - Err(reason) => Err(reason), - } - } - - fn resolve_census_list_constant_ref(&self, value: &FieldValue) -> Result { - let FieldValue::Reference(id) = value else { - return Err(format!( - "PB census predicate `list_constant` should be a CensusListConstant edge, got {value:?}" - )); - }; - let decl = self.dag.declaration(*id); - let actual_name = decl_display_name(*id, decl); - match self.decl_inhabits_named_role(decl, "CensusListConstant") { - Ok(true) => Ok(actual_name), - Ok(false) => Err(format!( - "PB census predicate `list_constant` declaration `{actual_name}` must inhabit `CensusListConstant`" - )), - Err(reason) => Err(reason), - } - } - - /// Hermetic path: compile `claim.source`, then `apply_lens_declaration` for subject (0-arity) - /// and invariant (1-arity). `run_claim` wraps a bare `Pass` in `NotYetImplemented` when - /// `requires` is empty so we do not fabricate a mock-backed receipt without a DB-15 obligation - /// surface (see `MockBackedInvariant` arm in `run_claim`). - fn eval_mock_backed_invariant( - &self, - claim: &TestClaimValue, - payload: &[FieldValue], - ) -> ClaimResult { - let [subject, invariant] = payload else { - return ClaimResult::Fail( - "MockBackedInvariant payload should be (subject: DeclarationRef, invariant: DeclarationRef)" - .to_string(), - ); - }; - let subject_name = match self.resolve_mock_declaration_ref_edge(subject, "subject") { - Ok(name) => name, - Err(reason) => return ClaimResult::Fail(reason), - }; - let invariant_name = match self.resolve_mock_declaration_ref_edge(invariant, "invariant") { - Ok(name) => name, - Err(reason) => return ClaimResult::Fail(reason), - }; - - let program_dag = match compile_to_dag(&claim.source, &claim.file_name) { - Ok(dag) => dag, - Err(CompileError::Semantic(dag)) => { - return ClaimResult::Fail(format!( - "MockBackedInvariant: claim `source` / `{}` failed inference: {:?}", - claim.file_name, - dag.diagnostics().iter().collect::>() - )); - } - Err(err) => { - return ClaimResult::Fail(format!( - "MockBackedInvariant: claim `source` / `{}` did not compile: {err:?}", - claim.file_name - )); - } - }; - - let Some(subject_decl) = program_dag.declaration_by_name(&subject_name) else { - return ClaimResult::Fail(format!( - "MockBackedInvariant: subject `{subject_name}` not found in compiled claim program" - )); - }; - let Some(invariant_decl) = program_dag.declaration_by_name(&invariant_name) else { - return ClaimResult::Fail(format!( - "MockBackedInvariant: invariant `{invariant_name}` not found in compiled claim program" - )); - }; - - let subject_out = match apply_lens_declaration(&program_dag, None, subject_decl.id, &[]) { - Ok(v) => v, - Err(err) => { - return ClaimResult::Fail(format!( - "MockBackedInvariant: applying subject `{subject_name}` failed: {err:?}" - )); - } - }; - match apply_lens_declaration(&program_dag, None, invariant_decl.id, &[subject_out]) { - Ok(FieldValue::Literal(LiteralBits::Bool(true))) => ClaimResult::Pass, - Ok(other) => ClaimResult::Fail(format!( - "MockBackedInvariant: invariant `{invariant_name}` did not return Bool(true), got {other:?}" - )), - Err(err) => ClaimResult::Fail(format!( - "MockBackedInvariant: applying invariant `{invariant_name}` failed: {err:?}" - )), - } - } - - fn validate_resource_requirements(&self, claim: &TestClaimValue) -> Result<(), String> { - for (idx, requirement) in claim.requires.iter().enumerate() { - let Some(fields) = record_fields(requirement) else { - return Err(format!( - "MockBackedInvariant: `requires[{idx}]` must be a ResourceReference record" - )); - }; - match field(fields, "target") { - Some(FieldValue::Reference(_)) => {} - Some(other) => { - return Err(format!( - "MockBackedInvariant: `requires[{idx}].target` must be a DeclarationRef edge, got {other:?}" - )); - } - None => { - return Err(format!( - "MockBackedInvariant: `requires[{idx}]` is missing `target`" - )); - } - } - } - Ok(()) - } - - fn resolve_mock_declaration_ref_edge( - &self, - value: &FieldValue, - label: &str, - ) -> Result { - match value { - FieldValue::Reference(id) => Ok(self - .dag - .declaration(*id) - .name - .clone() - .unwrap_or_else(|| format!("Declaration#{}", id.raw()))), - FieldValue::Record(fields) if fields.is_empty() => Err(format!( - "MockBackedInvariant `{label}` must be a DeclarationRef edge, got empty record literal" - )), - other => Err(format!( - "MockBackedInvariant `{label}` must be a DeclarationRef edge, got {other:?}" - )), - } - } - - fn diagnostic_matches(&self, actual_dag: &Dag, reference: &FieldValue) -> Result { - let reference = self.diagnostic_reference(reference)?; - Ok(actual_dag - .diagnostics() - .iter() - .any(|(_, diagnostic)| diagnostic_matches_reference(diagnostic, &reference))) - } - - fn diagnostic_matches_single( - &self, - diagnostic: &Diagnostic, - reference: &FieldValue, - ) -> Result { - let reference = self.diagnostic_reference(reference)?; - Ok(diagnostic_matches_reference(diagnostic, &reference)) - } - - fn diagnostic_reference( - &self, - reference: &FieldValue, - ) -> Result<(String, DiagnosticDetailFilter), String> { - let Some(fields) = record_fields(reference) else { - return Err("DiagnosticReference payload should be a record".to_string()); - }; - let Some(kind) = field(fields, "kind") else { - return Err("DiagnosticReference is missing `kind`".to_string()); - }; - let Some(detail_contains) = field(fields, "detail_contains") else { - return Err("DiagnosticReference is missing `detail_contains`".to_string()); - }; - let Some((kind_label, kind_payload)) = self.variant_value(kind) else { - return Err("DiagnosticReference `kind` is not a variant".to_string()); - }; - if !kind_payload.is_empty() { - return Err("DiagnosticReference `kind` should not carry payload".to_string()); - } - Ok((kind_label, self.detail_filter(detail_contains)?)) - } - - fn detail_filter(&self, value: &FieldValue) -> Result { - let Some((label, payload)) = self.variant_value(value) else { - return Err("DiagnosticDetailExpectation is not a variant".to_string()); - }; - match label.as_str() { - "AnyDetail" => { - if payload.is_empty() { - Ok(DiagnosticDetailFilter::Any) - } else { - Err("AnyDetail should not carry payload".to_string()) - } - } - "Contains" => match payload.as_slice() { - [FieldValue::Literal(LiteralBits::String(text))] => { - Ok(DiagnosticDetailFilter::Contains(text.clone())) - } - _ => Err("Contains should carry a single String payload".to_string()), - }, - other => Err(format!( - "unsupported DiagnosticDetailExpectation variant `{other}`" - )), - } - } - - fn compare_cost(&self, comparator: &FieldValue, actual: i64, bound: i64) -> bool { - let Some((label, payload)) = self.variant_value(comparator) else { - return false; - }; - if !payload.is_empty() { - return false; - } - match label.as_str() { - "Eq" => actual == bound, - "Lt" => actual < bound, - "Le" => actual <= bound, - "Gt" => actual > bound, - "Ge" => actual >= bound, - "Ne" => actual != bound, - _ => false, - } - } - - fn variant_value(&self, value: &FieldValue) -> Option<(String, Vec)> { - match value { - FieldValue::Variant { - constructor, - payload, - } => Some((variant_label(self.dag, *constructor)?, payload.clone())), - _ => None, - } - } -} - -impl TestClaimValue { - pub fn from_declaration(decl: &Declaration) -> Result { - let fields = structural_fields(decl) - .ok_or_else(|| "TestClaim declaration is not structural".to_string())?; - let claim_name = string_field(fields, "name")?; - let source = string_field(fields, "source")?; - let file_name = string_field(fields, "file_name")?; - let predicate = field(fields, "predicate") - .ok_or_else(|| "TestClaim is missing `predicate`".to_string())? - .clone(); - let requires = match field(fields, "requires") { - Some(FieldValue::List(values)) => values.clone(), - Some(other) => return Err(format!("TestClaim `requires` is not a list: {other:?}")), - None => return Err("TestClaim is missing `requires`".to_string()), - }; - Ok(Self { - claim_name, - declaration_file: decl.span.file.clone(), - source, - file_name, - predicate, - requires, - }) - } -} - -/// **🟢 TERMINAL coproduct** (per `docs/modeling-discipline.md` Practice 4): mirrors `Quantifier` -/// in `src/v3/std/verification.dag` (`ForAll` | `Exists`) for runner-side folding only — not a -/// parallel substrate authority. -#[derive(Debug, Clone, Copy)] -enum QuantifierKind { - ForAll, - Exists, -} - -#[derive(Debug, Clone)] -struct ParsedQuantifiedTestClaim { - name: String, - declaration_file: String, - shapes: Vec<(String, String)>, - quantifier: QuantifierKind, - predicate: FieldValue, - requires: Vec, -} - -fn parse_quantifier_kind(dag: &Dag, value: &FieldValue) -> Result { - let FieldValue::Variant { - constructor, - payload, - } = value - else { - return Err(format!( - "QuantifiedTestClaim.quantifier must be a variant, got {value:?}" - )); - }; - let label = variant_label(dag, *constructor).ok_or_else(|| { - format!( - "QuantifiedTestClaim.quantifier variant constructor {:?} did not resolve", - constructor - ) - })?; - match label.as_str() { - "ForAll" => { - if !payload.is_empty() { - return Err(format!( - "Quantifier ForAll expects empty payload, got {payload:?}" - )); - } - Ok(QuantifierKind::ForAll) - } - "Exists" => { - if !payload.is_empty() { - return Err(format!( - "Quantifier Exists expects empty payload, got {payload:?}" - )); - } - Ok(QuantifierKind::Exists) - } - other => Err(format!( - "unsupported Quantifier variant `{other}` (bootstrap expects ForAll | Exists)" - )), - } -} - -fn literal_program_fields_from_shape( - dag: &Dag, - shape_value: &FieldValue, -) -> Result<(String, String), String> { - let FieldValue::Variant { - constructor, - payload, - } = shape_value - else { - return Err(format!( - "ProgramShape list element must be a variant, got {shape_value:?}" - )); - }; - let label = variant_label(dag, *constructor).ok_or_else(|| { - format!( - "ProgramShape variant constructor {:?} did not resolve", - constructor - ) - })?; - if label != "LiteralProgram" { - return Err(format!( - "unsupported ProgramShape variant `{label}` (bootstrap supports LiteralProgram only)" - )); - } - match payload.as_slice() { - [FieldValue::Record(fields)] => Ok((string_field(fields, "source")?, string_field(fields, "file_name")?)), - [FieldValue::Literal(LiteralBits::String(source)), FieldValue::Literal(LiteralBits::String(file_name))] => { - Ok((source.clone(), file_name.clone())) - } - _ => Err(format!( - "LiteralProgram expects record {{source,file_name}} or two string literals in payload, got {payload:?}" - )), - } -} - -fn resolve_generator_binding_to_list_elems<'b>( - dag: &'b Dag, - binding: &'b FieldValue, -) -> Result<&'b [FieldValue], String> { - match binding { - FieldValue::Reference(id) => { - let decl = dag.declaration(*id); - match &decl.value_body { - Some(ValueBody::List(elems)) => Ok(elems.as_slice()), - other => Err(format!( - "ProgramGenerator.generator target `{}` must have List value body, got {other:?}", - decl.name.as_deref().unwrap_or("#anonymous"), - )), - } - } - other => Err(format!( - "ProgramGenerator.generator must be DeclarationRef, got {other:?}" - )), - } -} - -fn resolve_quantified_generator_shapes( - dag: &Dag, - generator_value: &FieldValue, -) -> Result, String> { - let list_elems: &[FieldValue] = match generator_value { - FieldValue::Record(rec_fields) => { - let inner = field(rec_fields, "generator").ok_or_else(|| { - "ProgramGenerator structural literal missing `generator` field".to_string() - })?; - resolve_generator_binding_to_list_elems(dag, inner)? - } - FieldValue::Reference(id) => { - let decl = dag.declaration(*id); - match &decl.value_body { - Some(ValueBody::Structural { fields }) => { - let inner = field(fields, "generator").ok_or_else(|| { - format!( - "ProgramGenerator declaration `{}` missing `generator` field", - decl.name.as_deref().unwrap_or("#anonymous") - ) - })?; - resolve_generator_binding_to_list_elems(dag, inner)? - } - other => { - return Err(format!( - "QuantifiedTestClaim.generator reference `{}` must name a ProgramGenerator carrier (`{{ generator: DeclarationRef }}` resolving to List); accepting a bare List declaration bypasses the substrate boundary (INVARIANTS P2/P3). Got value_body={other:?}", - decl.name.as_deref().unwrap_or("#anonymous"), - )); - } - } - } - other => { - return Err(format!( - "QuantifiedTestClaim.generator must be ProgramGenerator record or declaration ref, got {other:?}" - )); - } - }; - let mut out = Vec::with_capacity(list_elems.len()); - for elem in list_elems { - out.push(literal_program_fields_from_shape(dag, elem)?); - } - Ok(out) -} - -fn parse_quantified_test_claim_for_evaluation( - dag: &Dag, - decl: &Declaration, -) -> Result { - let fields = structural_fields(decl) - .ok_or_else(|| "QuantifiedTestClaim declaration is not structural".to_string())?; - let name = string_field(fields, "name")?; - let generator_value = field(fields, "generator") - .ok_or_else(|| "QuantifiedTestClaim is missing `generator`".to_string())?; - let quantifier_value = field(fields, "quantifier") - .ok_or_else(|| "QuantifiedTestClaim is missing `quantifier`".to_string())?; - let predicate = field(fields, "predicate") - .ok_or_else(|| "QuantifiedTestClaim is missing `predicate`".to_string())? - .clone(); - let requires = match field(fields, "requires") { - Some(FieldValue::List(values)) => values.clone(), - Some(other) => { - return Err(format!( - "QuantifiedTestClaim `requires` is not a list: {other:?}" - )); - } - None => return Err("QuantifiedTestClaim is missing `requires`".to_string()), - }; - let shapes = resolve_quantified_generator_shapes(dag, generator_value)?; - let quantifier = parse_quantifier_kind(dag, quantifier_value)?; - Ok(ParsedQuantifiedTestClaim { - name, - declaration_file: decl.span.file.clone(), - shapes, - quantifier, - predicate, - requires, - }) -} - -fn structural_fields(decl: &Declaration) -> Option<&[(String, FieldValue)]> { - match decl.value_body.as_ref()? { - ValueBody::Structural { fields } => Some(fields), - ValueBody::Unparsed(_) | ValueBody::Scalar(_) | ValueBody::List(_) | ValueBody::Map(_) => { - None - } - } -} - -fn field<'a>(fields: &'a [(String, FieldValue)], label: &str) -> Option<&'a FieldValue> { - fields - .iter() - .find(|(candidate, _)| candidate == label) - .map(|(_, value)| value) -} - -fn string_field(fields: &[(String, FieldValue)], label: &str) -> Result { - match field(fields, label) { - Some(FieldValue::Literal(LiteralBits::String(value))) => Ok(value.clone()), - Some(other) => Err(format!("TestClaim `{label}` is not a string: {other:?}")), - None => Err(format!("TestClaim is missing `{label}`")), - } -} - -fn record_fields(value: &FieldValue) -> Option<&[(String, FieldValue)]> { - match value { - FieldValue::Record(fields) => Some(fields), - _ => None, - } -} - -fn decl_display_name(id: DeclarationId, decl: &Declaration) -> String { - decl.name - .clone() - .unwrap_or_else(|| format!("Declaration#{}", id.raw())) -} - -/// Lowered [`SymbolicCost`] data bodies may wrap a bare [`FieldValue::Variant`] in a -/// single-field structural carrier (`"_"`) — see `try_lower_symbolic_cost_constant_cost_data` in -/// `lower.rs`. Peel that wrapper before comparing to lens output. -fn field_value_for_symbolic_cost_expected( - fixture_dag: &Dag, - body: &ValueBody, -) -> Result { - match body { - ValueBody::Structural { fields } if fields.len() == 1 && fields[0].0 == "_" => { - Ok(fields[0].1.clone()) - } - other => field_value_from_value_body(fixture_dag, other), - } -} - -/// Normalization for `SymbolicCost` equality across distinct compiled DAGs (`TestClaim.source` vs -/// fixture graph). Expected `.dag` fixtures may leave `SizeVariable.source_port` unresolved only -/// when the predicate carries an explicit selected bind parameter. Otherwise identity follows -/// `algebra.dag` / [`crate::dag::SizeVariable`]: `source_port` only. -#[derive(Debug, Clone, PartialEq, Eq)] -enum SymbolicCostEqPattern { - Constant(i64), - Linear { - source_port: SymbolicCostPortPattern, - }, - Log { - source_port: SymbolicCostPortPattern, - }, - Polynomial { - source_port: SymbolicCostPortPattern, - degree_raw: i64, - }, - Product(Vec), - Sum(Vec), - Unknown(String), -} - -#[derive(Debug, Clone, PartialEq, Eq)] -enum SymbolicCostPortPattern { - Raw(u32), - ExpectedBindParam, -} - -fn symbolic_cost_to_eq_pattern(cost: &SymbolicCost) -> SymbolicCostEqPattern { - match cost { - SymbolicCost::ConstantCost { _0 } => SymbolicCostEqPattern::Constant(*_0), - SymbolicCost::LinearCost { _0: sv } => SymbolicCostEqPattern::Linear { - source_port: SymbolicCostPortPattern::Raw(sv.source_port.raw()), - }, - SymbolicCost::LogCost { _0: sv } => SymbolicCostEqPattern::Log { - source_port: SymbolicCostPortPattern::Raw(sv.source_port.raw()), - }, - SymbolicCost::PolynomialCost { var, degree } => SymbolicCostEqPattern::Polynomial { - source_port: SymbolicCostPortPattern::Raw(var.source_port.raw()), - degree_raw: degree.raw(), - }, - SymbolicCost::ProductCost { _0: list } => SymbolicCostEqPattern::Product( - list.iter() - .map(|boxed| symbolic_cost_to_eq_pattern(boxed.as_ref())) - .collect(), - ), - SymbolicCost::SumCost { _0: list } => SymbolicCostEqPattern::Sum( - list.iter() - .map(|boxed| symbolic_cost_to_eq_pattern(boxed.as_ref())) - .collect(), - ), - SymbolicCost::UnknownCost { _0: s } => SymbolicCostEqPattern::Unknown(s.clone()), - } -} - -fn resolve_symbolic_cost_param_refs_for_bind( - pattern: SymbolicCostEqPattern, - bind: &crate::dag::BindNode, - expected_param_index: Option, -) -> Result { - fn resolve( - port: SymbolicCostPortPattern, - bind: &crate::dag::BindNode, - expected_param_index: Option, - ) -> Result { - match port { - SymbolicCostPortPattern::Raw(raw) => Ok(SymbolicCostPortPattern::Raw(raw)), - SymbolicCostPortPattern::ExpectedBindParam => { - let Some(param_index) = expected_param_index else { - return Err( - "SymbolicCostExprEquals: expected SymbolicCost contains an unresolved \ - SizeVariable.source_port; use SymbolicCostExprEqualsForBindParam to \ - provide the selected bind parameter" - .to_string(), - ); - }; - let port = bind_param_port_by_index(bind, param_index)?; - Ok(SymbolicCostPortPattern::Raw(port.raw())) - } - } - } - Ok(match pattern { - SymbolicCostEqPattern::Linear { source_port } => SymbolicCostEqPattern::Linear { - source_port: resolve(source_port, bind, expected_param_index)?, - }, - SymbolicCostEqPattern::Log { source_port } => SymbolicCostEqPattern::Log { - source_port: resolve(source_port, bind, expected_param_index)?, - }, - SymbolicCostEqPattern::Polynomial { - source_port, - degree_raw, - } => SymbolicCostEqPattern::Polynomial { - source_port: resolve(source_port, bind, expected_param_index)?, - degree_raw, - }, - SymbolicCostEqPattern::Product(terms) => SymbolicCostEqPattern::Product( - terms - .into_iter() - .map(|term| { - resolve_symbolic_cost_param_refs_for_bind(term, bind, expected_param_index) - }) - .collect::, _>>()?, - ), - SymbolicCostEqPattern::Sum(terms) => SymbolicCostEqPattern::Sum( - terms - .into_iter() - .map(|term| { - resolve_symbolic_cost_param_refs_for_bind(term, bind, expected_param_index) - }) - .collect::, _>>()?, - ), - other => other, - }) -} - -fn bind_param_port_by_index( - bind: &crate::dag::BindNode, - param_index: usize, -) -> Result { - bind.params.get(param_index).copied().ok_or_else(|| { - format!( - "SymbolicCostExprEqualsForBindParam: function bind `{}` has no lowered parameter port \ - at index {param_index}; parameter count is {}", - bind.name, - bind.params.len() - ) - }) -} - -fn symbolic_cost_variant_label_for_constructor(dag: &Dag, ctor: DeclarationId) -> Option { - let symbolic_cost = dag.declaration_by_name("SymbolicCost")?; - let TypeConnective::Disj { variants } = &symbolic_cost.connective else { - return None; - }; - variants - .iter() - .find(|v| v.ty == ctor) - .map(|v| v.label.clone()) -} - -fn field_value_to_symbolic_cost_eq_pattern( - dag: &Dag, - fv: &FieldValue, -) -> Result { - match fv { - FieldValue::Variant { - constructor, - payload, - } => { - let label_owned = match dag.declaration(*constructor).name.clone() { - Some(name) => name, - None => symbolic_cost_variant_label_for_constructor(dag, *constructor).ok_or_else( - || { - format!( - "SymbolicCostExprEquals: anonymous symbolic-cost variant constructor {:?} \ - is not a SymbolicCost variant payload declaration id", - constructor - ) - }, - )?, - }; - let label = label_owned.as_str(); - match label { - "ConstantCost" => { - let n = one_int_payload(payload)?; - Ok(SymbolicCostEqPattern::Constant(n)) - } - "LinearCost" => { - let inner = single_payload(payload)?; - let source_port = - parse_size_variable_source_port_for_symbolic_cost_eq(dag, inner)?; - Ok(SymbolicCostEqPattern::Linear { - source_port, - }) - } - "LogCost" => { - let inner = single_payload(payload)?; - let source_port = - parse_size_variable_source_port_for_symbolic_cost_eq(dag, inner)?; - Ok(SymbolicCostEqPattern::Log { - source_port, - }) - } - "PolynomialCost" => { - let record = single_payload(payload)?; - let fields = record_fields(record).ok_or_else(|| { - format!( - "SymbolicCostExprEquals: PolynomialCost payload must be a record, got {:?}", - record - ) - })?; - let var = field(fields, "var").ok_or_else(|| { - "SymbolicCostExprEquals: PolynomialCost missing `var` field".to_string() - })?; - let degree = field(fields, "degree").ok_or_else(|| { - "SymbolicCostExprEquals: PolynomialCost missing `degree` field".to_string() - })?; - let source_port = - parse_size_variable_source_port_for_symbolic_cost_eq(dag, var)?; - let degree_raw = degree_raw_from_degree_at_least_two_field_value(dag, degree)?; - Ok(SymbolicCostEqPattern::Polynomial { - source_port, - degree_raw, - }) - } - "ProductCost" => { - let inner = single_payload(payload)?; - Ok(SymbolicCostEqPattern::Product( - parse_non_singleton_symbolic_cost_patterns(dag, inner)?, - )) - } - "SumCost" => { - let inner = single_payload(payload)?; - Ok(SymbolicCostEqPattern::Sum( - parse_non_singleton_symbolic_cost_patterns(dag, inner)?, - )) - } - "UnknownCost" => { - let s = one_string_payload(payload)?; - Ok(SymbolicCostEqPattern::Unknown(s)) - } - other => Err(format!( - "SymbolicCostExprEquals: decoding `{other}` from expected SymbolicCost is not supported" - )), - } - } - other => Err(format!( - "SymbolicCostExprEquals: expected value must lower to a SymbolicCost variant; got {:?}", - other - )), - } -} - -fn field_value_to_symbolic_cost_bind_param_expected_pattern( - dag: &Dag, - fv: &FieldValue, -) -> Result { - if let FieldValue::Record(fields) = fv { - if fields.len() == 1 && fields[0].0 == "_" { - return field_value_to_symbolic_cost_bind_param_expected_pattern(dag, &fields[0].1); - } - } - let FieldValue::Variant { - constructor, - payload, - } = fv - else { - return Err(format!( - "SymbolicCostExprEqualsForBindParam: expected value must lower to a \ - SymbolicCostBindParamExpected variant, got {fv:?}" - )); - }; - let label_owned = - symbolic_cost_bind_param_expected_variant_label_for_constructor(dag, *constructor) - .ok_or_else(|| { - format!( - "SymbolicCostExprEqualsForBindParam: constructor {constructor:?} is not a \ - SymbolicCostBindParamExpected variant" - ) - })?; - match label_owned.as_str() { - "LinearCostForBindParam" => { - parse_bind_param_size_variable_expected( - dag, - peel_single_underscore_record(single_payload(payload)?), - )?; - Ok(SymbolicCostEqPattern::Linear { - source_port: SymbolicCostPortPattern::ExpectedBindParam, - }) - } - other => Err(format!( - "SymbolicCostExprEqualsForBindParam: unsupported expected variant `{other}`" - )), - } -} - -fn peel_single_underscore_record(fv: &FieldValue) -> &FieldValue { - match fv { - FieldValue::Record(fields) if fields.len() == 1 && fields[0].0 == "_" => &fields[0].1, - other => other, - } -} - -fn symbolic_cost_bind_param_expected_variant_label_for_constructor( - dag: &Dag, - ctor: DeclarationId, -) -> Option { - let expected = dag.declaration_by_name("SymbolicCostBindParamExpected")?; - let TypeConnective::Disj { variants } = &expected.connective else { - return None; - }; - variants - .iter() - .find(|v| v.ty == ctor) - .map(|v| v.label.clone()) -} - -fn parse_bind_param_size_variable_expected(dag: &Dag, fv: &FieldValue) -> Result<(), String> { - let FieldValue::Variant { - constructor, - payload, - } = fv - else { - return Err(format!( - "SymbolicCostExprEqualsForBindParam: BindParamSizeVariable expected selected-bind-param \ - variant, got {fv:?}" - )); - }; - if !payload.is_empty() { - return Err(format!( - "SymbolicCostExprEqualsForBindParam: SelectedBindParamSizeVariable takes no payload, \ - got {} slot(s)", - payload.len() - )); - } - let Some(label) = bind_param_size_variable_variant_label_for_constructor(dag, *constructor) - else { - return Err(format!( - "SymbolicCostExprEqualsForBindParam: constructor {constructor:?} is not a \ - BindParamSizeVariable variant" - )); - }; - if label != "SelectedBindParamSizeVariable" { - return Err(format!( - "SymbolicCostExprEqualsForBindParam: unsupported BindParamSizeVariable variant `{label}`" - )); - } - Ok(()) -} - -fn bind_param_size_variable_variant_label_for_constructor( - dag: &Dag, - ctor: DeclarationId, -) -> Option { - let expected = dag.declaration_by_name("BindParamSizeVariable")?; - let TypeConnective::Disj { variants } = &expected.connective else { - return None; - }; - variants - .iter() - .find(|v| v.ty == ctor) - .map(|v| v.label.clone()) -} - -fn single_payload(payload: &[FieldValue]) -> Result<&FieldValue, String> { - match payload { - [one] => Ok(one), - _ => Err(format!( - "SymbolicCostExprEquals: expected a single payload field, got {} slot(s)", - payload.len() - )), - } -} - -fn one_int_payload(payload: &[FieldValue]) -> Result { - match single_payload(payload)? { - FieldValue::Literal(LiteralBits::Int(s)) => s.parse::().map_err(|_| { - "SymbolicCostExprEquals: Int literal payload is not a valid i64".to_string() - }), - other => Err(format!( - "SymbolicCostExprEquals: expected Int literal payload, got {:?}", - other - )), - } -} - -fn one_string_payload(payload: &[FieldValue]) -> Result { - match single_payload(payload)? { - FieldValue::Literal(LiteralBits::String(s)) => Ok(s.clone()), - other => Err(format!( - "SymbolicCostExprEquals: expected String literal payload, got {:?}", - other - )), - } -} - -fn bind_param_ref_index(fv: &FieldValue) -> Result { - let FieldValue::Record(fields) = fv else { - return Err(format!( - "SymbolicCostExprEqualsForBindParam: param must be a BindParamRef record, got {fv:?}" - )); - }; - if fields.len() != 1 { - return Err(format!( - "SymbolicCostExprEqualsForBindParam: BindParamRef only supports `index`, got {fields:?}" - )); - } - let index = field(fields, "index").ok_or_else(|| { - "SymbolicCostExprEqualsForBindParam: BindParamRef missing `index`".to_string() - })?; - match index { - FieldValue::Literal(LiteralBits::Int(s)) => { - let n = s.parse::().map_err(|_| { - format!( - "SymbolicCostExprEqualsForBindParam: BindParamRef index is not a valid \ - integer: {s:?}" - ) - })?; - usize::try_from(n).map_err(|_| { - format!( - "SymbolicCostExprEqualsForBindParam: BindParamRef index must be non-negative, \ - got {n}" - ) - }) - } - other => Err(format!( - "SymbolicCostExprEqualsForBindParam: BindParamRef index must be an Int literal, got \ - {other:?}" - )), - } -} - -fn port_id_raw_field_value(fv: &FieldValue) -> Result { - match fv { - FieldValue::Literal(LiteralBits::Int(s)) => { - let n = s.parse::().map_err(|_| { - format!("SymbolicCostExprEquals: PortId literal not a valid integer: {s:?}") - })?; - if n < 0 { - return Err(format!( - "SymbolicCostExprEquals: PortId raw must be non-negative, got {n}" - )); - } - u32::try_from(n) - .map_err(|_| format!("SymbolicCostExprEquals: PortId raw out of u32 range: {n}")) - } - other => Err(format!( - "SymbolicCostExprEquals: PortId field must be Int literal, got {other:?}" - )), - } -} - -/// Decode `source_port` from a structural [`SizeVariable`] record; validate optional `display_name` -/// payload shape (same authority as [`optional_string_field_for_record`]) without using it in -/// equality — identity follows `algebra.dag` / [`SizeVariable`]'s `PartialEq`. -fn parse_size_variable_source_port_for_symbolic_cost_eq( - dag: &Dag, - fv: &FieldValue, -) -> Result { - let fields = record_fields(fv).ok_or_else(|| { - format!( - "SymbolicCostExprEquals: SizeVariable value must be a record, got {:?}", - fv - ) - })?; - let _ = optional_string_field_for_record(dag, fields, "display_name")?; - let Some(source_port_fv) = field(fields, "source_port") else { - return Ok(SymbolicCostPortPattern::ExpectedBindParam); - }; - Ok(SymbolicCostPortPattern::Raw(port_id_raw_field_value( - source_port_fv, - )?)) -} - -fn optional_string_field_for_record( - dag: &Dag, - fields: &[(String, FieldValue)], - key: &str, -) -> Result, String> { - let Some((_, fv)) = fields.iter().find(|(k, _)| k == key) else { - return Ok(None); - }; - match fv { - FieldValue::Literal(LiteralBits::String(s)) => Ok(Some(s.clone())), - FieldValue::Variant { - constructor, - payload, - } => { - let ctor_name = dag.declaration(*constructor).name.as_deref().unwrap_or(""); - match payload.as_slice() { - [] => { - if is_display_name_optional_absent_constructor(dag, *constructor) { - Ok(None) - } else { - Err(format!( - "SymbolicCostExprEquals: optional string field `{key}`: zero-payload variant \ - is not the canonical absent optional encoding (constructor={ctor_name:?})" - )) - } - } - [FieldValue::Literal(LiteralBits::String(s))] => Ok(Some(s.clone())), - _ => { - if ctor_name == "Some" { - let inner = single_payload(payload)?; - match inner { - FieldValue::Literal(LiteralBits::String(s)) => Ok(Some(s.clone())), - other => Err(format!( - "SymbolicCostExprEquals: optional string Some(...) expected String, got {:?}", - other - )), - } - } else { - Err(format!( - "SymbolicCostExprEquals: optional string field `{key}`: unsupported optional \ - shape (constructor={ctor_name:?}, payload_len={})", - payload.len() - )) - } - } - } - } - other => Err(format!( - "SymbolicCostExprEquals: optional string field `{key}`: unsupported shape {:?}", - other - )), - } -} - -/// Peel transparent wrappers so [`size_variable_display_name_optional_none_constructor_id`] reaches -/// the underlying optional coproduct when present (Practice 1 / fail-closed decode). -fn peel_layer_for_optional_display_name_field_type( - mut ty: DeclarationId, - dag: &Dag, -) -> DeclarationId { - for _ in 0..32 { - let decl = dag.declaration(ty); - match &decl.connective { - TypeConnective::Instantiation { - template, - arguments, - } if arguments.is_empty() => { - ty = *template; - } - TypeConnective::Atom( - AtomPayload::ResolvedByStructure(next) | AtomPayload::ResolvedByName(next), - ) => { - ty = *next; - } - _ => break, - } - } - ty -} - -/// Optional-`None` constructor id for `SizeVariable.display_name` when the substrate models `String?` -/// as an explicit coproduct (algebra.dag `display_name: String?`). -fn size_variable_display_name_optional_none_constructor_id(dag: &Dag) -> Option { - let sv = dag.declaration_by_name("SizeVariable")?; - let TypeConnective::Conj { children } = &sv.connective else { - return None; - }; - let display_ty = children.iter().find(|f| f.label == "display_name")?.ty; - let ty = peel_layer_for_optional_display_name_field_type(display_ty, dag); - let decl = dag.declaration(ty); - match &decl.connective { - TypeConnective::Disj { variants } => { - variants.iter().find(|v| v.label == "None").map(|v| v.ty) - } - _ => None, - } -} - -fn is_display_name_optional_absent_constructor(dag: &Dag, ctor: DeclarationId) -> bool { - if dag.declaration(ctor).name.as_deref() == Some("None") { - return true; - } - size_variable_display_name_optional_none_constructor_id(dag) == Some(ctor) -} - -fn degree_raw_from_degree_at_least_two_field_value( - dag: &Dag, - fv: &FieldValue, -) -> Result { - let FieldValue::Variant { - constructor, - payload, - } = fv - else { - return Err(format!( - "SymbolicCostExprEquals: DegreeAtLeastTwo must be a variant, got {:?}", - fv - )); - }; - let label = dag - .declaration(*constructor) - .name - .as_deref() - .ok_or_else(|| { - "SymbolicCostExprEquals: anonymous DegreeAtLeastTwo constructor".to_string() - })?; - match label { - "DegreeTwo" => Ok(2), - "DegreeSuccessor" => { - let record = single_payload(payload)?; - let fields = record_fields(record).ok_or_else(|| { - format!( - "SymbolicCostExprEquals: DegreeSuccessor payload must be a record, got {:?}", - record - ) - })?; - let prev = field(fields, "previous").ok_or_else(|| { - "SymbolicCostExprEquals: DegreeSuccessor missing `previous`".to_string() - })?; - let prev_raw = degree_raw_from_degree_at_least_two_field_value(dag, prev)?; - Ok(prev_raw + 1) - } - other => Err(format!( - "SymbolicCostExprEquals: unknown DegreeAtLeastTwo variant `{other}`" - )), - } -} - -fn parse_non_singleton_symbolic_cost_patterns( - dag: &Dag, - fv: &FieldValue, -) -> Result, String> { - let fields = record_fields(fv).ok_or_else(|| { - format!( - "SymbolicCostExprEquals: NonSingletonList must be a record, got {:?}", - fv - ) - })?; - let first = field(fields, "first") - .ok_or_else(|| "SymbolicCostExprEquals: NonSingletonList missing `first`".to_string())?; - let second = field(fields, "second") - .ok_or_else(|| "SymbolicCostExprEquals: NonSingletonList missing `second`".to_string())?; - let rest = field(fields, "rest") - .ok_or_else(|| "SymbolicCostExprEquals: NonSingletonList missing `rest`".to_string())?; - let mut out = vec![ - field_value_to_symbolic_cost_eq_pattern(dag, first)?, - field_value_to_symbolic_cost_eq_pattern(dag, second)?, - ]; - match rest { - FieldValue::List(items) => { - for item in items { - out.push(field_value_to_symbolic_cost_eq_pattern(dag, item)?); - } - } - other => { - return Err(format!( - "SymbolicCostExprEquals: NonSingletonList `rest` must be a List, got {:?}", - other - )); - } - } - Ok(out) -} - -fn tc1_eta_equivalence_symbolic_cost_reports_equivalent( - left: DimensionReport, - right: DimensionReport, -) -> ClaimResult { - // Compare workflow-root `composed` only (see `try_eval_tc1_eta_equivalence_executable` rustdoc). - // Full `DimensionReport` equality is intentionally out of scope for this Path A proxy — carrier- - // aligned report equality is gunbc#1972. - match (&left, &right) { - ( - DimensionReport::DimensionOk { composed: lc, .. }, - DimensionReport::DimensionOk { composed: rc, .. }, - ) if lc == rc => ClaimResult::Pass, - ( - DimensionReport::DimensionOk { composed: lc, .. }, - DimensionReport::DimensionOk { composed: rc, .. }, - ) => ClaimResult::Fail(format!( - "tc1_eta_equivalence_executable: η-pair symbolic-cost dimension reports disagree \ - at composed carrier: left={lc:?} right={rc:?}" - )), - _ => ClaimResult::Fail(format!( - "tc1_eta_equivalence_executable: expected both η-pair symbolic-cost analyses to reach \ - DimensionOk with identical composed `SymbolicCost`; left={left:?} right={right:?}" - )), - } -} - -fn find_bind<'a>( - dag: &'a Dag, - bind_name: &str, - claim_file_name: &str, -) -> Option<&'a crate::dag::BindNode> { - dag.nodes().iter().find_map(|node| match node { - Behavior::Bind(bind) if bind.name == bind_name && bind.span.file == claim_file_name => { - Some(bind) - } - _ => None, - }) -} - -fn expected_int_literal( - expected_decl: &Declaration, - expected_name: &str, - lens_name: &str, -) -> Result { - match expected_decl.value_body.as_ref() { - Some(ValueBody::Scalar(LiteralBits::Int(s))) => s.parse::().map_err(|_| { - ClaimResult::Fail(format!( - "LensOutputEquals({lens_name}): expected Int literal is not a valid i64 decimal for `{expected_name}`" - )) - }), - _ => Err(ClaimResult::Fail(format!( - "LensOutputEquals({lens_name}): expected_ref `{expected_name}` must be `data ...: Int = `" - ))), - } -} - -fn diagnostic_matches_reference( - diagnostic: &Diagnostic, - reference: &(String, DiagnosticDetailFilter), -) -> bool { - diagnostic.layer1_kind_label() == reference.0 - && match &reference.1 { - DiagnosticDetailFilter::Any => true, - DiagnosticDetailFilter::Contains(text) => diagnostic.message().contains(text), - } -} - -fn sg0_census_list_count(list_constant_name: &str) -> Result { - Ok(sg0_census_list_entries(list_constant_name)?.len() as i64) -} - -fn sg0_census_list_entries(list_constant_name: &str) -> Result, String> { - let constant = match list_constant_name { - "expected_hand_authored_non_test" => "EXPECTED_HAND_AUTHORED_NON_TEST", - "expected_hand_authored_test" => "EXPECTED_HAND_AUTHORED_TEST", - "expected_hand_authored_fragments" => "EXPECTED_HAND_AUTHORED_FRAGMENTS", - other => return Err(format!("unknown SG-0 census list constant `{other}`")), - }; - sg0_string_slice_constant_entries(constant) -} - -fn sg0_string_slice_constant_entries(constant: &str) -> Result, String> { - let marker = format!("const {constant}: &[&str] = &["); - let start = SG0_CENSUS_SOURCE - .find(&marker) - .ok_or_else(|| format!("SG-0 census source is missing `{constant}`"))? - + marker.len(); - let rest = &SG0_CENSUS_SOURCE[start..]; - let end = rest - .find("\n];") - .ok_or_else(|| format!("SG-0 census source has unterminated `{constant}`"))?; - Ok(rest[..end] - .lines() - .filter_map(sg0_quoted_path_from_line) - .collect()) -} - -fn sg0_quoted_path_from_line(line: &str) -> Option { - let trimmed = line.trim(); - if trimmed.starts_with("//") { - return None; - } - let start = trimmed.find('"')? + 1; - let end = trimmed[start..].find('"')? + start; - Some(trimmed[start..end].to_string()) -} - -/// Hand-Rust surfaces counted by T-PB-A `lens_producer_files_remaining` (`CensusSubsetCount`). -/// -/// `lens_apply.rs` → `lens_declaration_apply.rs` is a **path** retirement only; the bounded -/// lens host remains a lens-producer residual until PB-Runtime owns application/reflection -/// (Row-4 / §7.1). Omitting this path would falsely show census “progress” after a rename. -/// -/// **R3 gate #7 (`regen_lens_dot_rs_retired`) is not lens-producer dissolution:** retiring -/// `src/bin/regen_lens.rs` relocates the Cargo `[[bin]]` entry to `regen_lens_entry.rs` and -/// moves producer logic to `regen_lens_driver.rs`. Both remain hand-authored regen-lens -/// producer surfaces until PB-1 emits the bin from `.dag` / PB-Runtime owns the pipeline — so -/// they stay in this subset; shrinking the predicate after a path move would falsely claim -/// census progress without dissolving the producer. -fn is_lens_producer_census_path(path: &str) -> bool { - matches!( - path, - "src/v3/compiler/src/lens_declaration_apply.rs" - | "src/v3/compiler/src/regen_lens_driver.rs" - | "src/v3/compiler/src/regen_lens_entry.rs" - ) -} - -fn is_bin_shim_census_path(path: &str) -> bool { - path.starts_with("src/v3/compiler/src/bin/") -} - -fn compiler_std_positive_set_ratchet_count() -> i64 { - [ - "TemplateArgumentsMatch", - "TemplateArgumentCursor", - "NormalizedInstantiationArgs", - ] - .iter() - .filter(|name| INFER_HELPERS_SOURCE.contains(&format!("type {name}"))) - .count() as i64 -} - -fn render_value_body(dag: &Dag, value: &ValueBody) -> String { - match value { - ValueBody::Scalar(bits) => render_literal(bits), - ValueBody::Structural { fields } => render_record(dag, fields), - ValueBody::List(values) => format!( - "[{}]", - values - .iter() - .map(|value| render_field_value(dag, value)) - .collect::>() - .join(", ") - ), - ValueBody::Map(entries) => render_map(dag, entries.entries()), - ValueBody::Unparsed(span) => format!("", span.file, span.byte_start), - } -} - -fn render_field_value(dag: &Dag, value: &FieldValue) -> String { - match value { - FieldValue::Literal(bits) => render_literal(bits), - FieldValue::Reference(decl_id) => dag - .declaration(*decl_id) - .name - .clone() - .unwrap_or_else(|| format!("Declaration#{}", decl_id.raw())), - FieldValue::Record(fields) => render_record(dag, fields), - FieldValue::List(values) => format!( - "[{}]", - values - .iter() - .map(|value| render_field_value(dag, value)) - .collect::>() - .join(", ") - ), - FieldValue::Map(entries) => render_map(dag, entries.entries()), - FieldValue::Variant { - constructor, - payload, - } => { - let label = variant_label(dag, *constructor) - .unwrap_or_else(|| format!("Variant#{}", constructor.raw())); - if payload.is_empty() { - label - } else { - format!( - "{}({})", - label, - payload - .iter() - .map(|value| render_field_value(dag, value)) - .collect::>() - .join(", ") - ) - } - } - } -} - -fn render_record(dag: &Dag, fields: &[(String, FieldValue)]) -> String { - format!( - "{{ {} }}", - fields - .iter() - .map(|(label, value)| format!("{label}: {}", render_field_value(dag, value))) - .collect::>() - .join(", ") - ) -} - -fn render_map(dag: &Dag, entries: &[(String, FieldValue)]) -> String { - format!( - "{{ {} }}", - entries - .iter() - .map(|(key, value)| format!("{key:?}: {}", render_field_value(dag, value))) - .collect::>() - .join(", ") - ) -} - -fn render_literal(bits: &LiteralBits) -> String { - match bits { - LiteralBits::Int(value) => value.to_string(), - LiteralBits::Bool(value) => value.to_string(), - LiteralBits::String(value) | LiteralBits::Symbol(value) => quote_string(value), - } -} - -fn quote_string(value: &str) -> String { - format!("\"{}\"", value.replace('\\', "\\\\").replace('"', "\\\"")) -} - -fn variant_label(dag: &Dag, variant_id: DeclarationId) -> Option { - dag.declarations() - .iter() - .find_map(|decl| match &decl.connective { - TypeConnective::Disj { variants } => variants - .iter() - .find(|variant| variant.ty == variant_id) - .map(|variant| variant.label.clone()), - _ => None, - }) -} - -fn perf_budget_comparator_label(dag: &Dag, value: &FieldValue) -> Option { - let FieldValue::Variant { - constructor, - payload, - } = value - else { - return None; - }; - if !payload.is_empty() { - return None; - } - let comparator_decl = dag.declaration_by_name("PerfBudgetComparisonOp")?; - let TypeConnective::Disj { variants } = &comparator_decl.connective else { - return None; - }; - variants - .iter() - .find(|variant| variant.ty == *constructor) - .map(|variant| variant.label.clone()) -} - -fn algebraic_law_payload_fields( - payload: &[FieldValue], -) -> Result<(&FieldValue, &FieldValue), AlgebraicLawProgramError> { - match payload { - [law, lens_ref] => Ok((law, lens_ref)), - [FieldValue::Record(fields)] => { - let law = field(fields, "law").ok_or_else(|| { - AlgebraicLawProgramError::MalformedPayload( - "AlgebraicLaw payload record is missing `law` field".to_string(), - ) - })?; - let lens_ref = field(fields, "lens_ref").ok_or_else(|| { - AlgebraicLawProgramError::MalformedPayload( - "AlgebraicLaw payload record is missing `lens_ref` field".to_string(), - ) - })?; - Ok((law, lens_ref)) - } - _ => Err(AlgebraicLawProgramError::MalformedPayload(format!( - "AlgebraicLaw payload should be [law, lens_ref] or a record, got len {}", - payload.len() - ))), - } -} - -fn variant_fields<'a>( - dag: &Dag, - value: &'a FieldValue, -) -> Result<(String, &'a [FieldValue]), AlgebraicLawProgramError> { - let FieldValue::Variant { - constructor, - payload, - } = value - else { - return Err(AlgebraicLawProgramError::MalformedPayload( - "expected AlgebraicLawKind variant".to_string(), - )); - }; - let label = variant_label(dag, *constructor).ok_or_else(|| { - AlgebraicLawProgramError::MalformedPayload(format!( - "variant constructor {:?} not found under any sum", - constructor - )) - })?; - Ok((label, payload.as_slice())) -} - -fn declaration_ref_name(dag: &Dag, value: &FieldValue) -> Result { - match value { - FieldValue::Reference(id) => dag.declaration(*id).name.clone().ok_or_else(|| { - AlgebraicLawProgramError::MalformedPayload(format!( - "lens_ref declaration {:?} is anonymous", - id - )) - }), - other => Err(AlgebraicLawProgramError::MalformedPayload(format!( - "lens_ref should be a DeclarationRef (FieldValue::Reference), got {other:?}" - ))), - } -} - -#[cfg(test)] -mod execute_command_timebound_tests { - use super::evaluate_execute_command_exit_code; - use super::evaluate_execute_command_exit_code_with_wall_time; - use super::evaluate_execute_command_m1_5; - use super::shell_dash_c_may_start_background_after_eliding_artifacts; - use super::ClaimResult; - use super::ExecuteCommandM1_5Proposition; - use std::time::Duration; - - #[test] - fn elision_allows_and_chain_and_fd_redirects_without_fabricating_bare_ampersand() { - let sh = Some("sh"); - assert!(!shell_dash_c_may_start_background_after_eliding_artifacts( - "true && true", - sh, - )); - assert!(!shell_dash_c_may_start_background_after_eliding_artifacts( - "true 2>&1", - sh, - )); - assert!(!shell_dash_c_may_start_background_after_eliding_artifacts( - "cmd 3>&4", sh, - )); - } - - #[test] - fn elision_still_fails_on_shell_background() { - assert!(shell_dash_c_may_start_background_after_eliding_artifacts( - "sleep 600 &", - Some("sh"), - )); - } - - /// On POSIX `sh`/`dash`, `&>` is not a single redirect token; eliding it as bash would - /// false-negative the background guard (openai-pro gpt-5-5-pro, PR #792). - #[test] - fn posix_sh_ampersand_gt_form_fails_closed_in_elision_helper() { - assert!(shell_dash_c_may_start_background_after_eliding_artifacts( - "sleep 600 &> /tmp/gunbc_posix_ampgt", - Some("sh"), - )); - assert!(shell_dash_c_may_start_background_after_eliding_artifacts( - "sleep 600 &> /tmp/gunbc_posix_ampgt", - Some("dash"), - )); - } - - #[test] - fn bash_ampersand_gt_redir_is_elided_not_treated_as_background() { - assert!(!shell_dash_c_may_start_background_after_eliding_artifacts( - "true &> /dev/null", - Some("bash"), - )); - } - - #[test] - fn unknown_shell_interpreter_ampersand_gt_fails_closed() { - assert!(shell_dash_c_may_start_background_after_eliding_artifacts( - "true &> /dev/null", - None, - )); - } - - #[test] - fn sh_dash_c_background_ampersand_is_rejected() { - let r = evaluate_execute_command_exit_code( - "sh", - &[String::from("-c"), String::from("sleep 600 &")], - 0, - ); - let ClaimResult::Fail(m) = r else { - panic!("expected fail-closed for shell background, got {r:?}"); - }; - assert!( - m.contains("background") - || m.contains("P3") - || m.contains("descendants") - || m.contains("shell `-c`"), - "expected policy message, got: {m}" - ); - } - - /// POSIX: `sleep 600 &> file` is `&` (background) + `>`, not bash `&>`; must not bypass the - /// guard (openai-pro gpt-5-5-pro, PR #792). - #[test] - fn sh_dash_c_posix_ampersand_gt_token_rejected() { - use super::reject_unbounded_shell_background; - let script = "sleep 600 &> /tmp/gunbc_reject_unbounded_ampgt"; - assert!( - reject_unbounded_shell_background("sh", &[String::from("-c"), String::from(script),]) - .is_some(), - "direct guard on reject_unbounded_shell_background" - ); - let r = evaluate_execute_command_exit_code( - "sh", - &[String::from("-c"), String::from(script)], - 0, - ); - let ClaimResult::Fail(m) = r else { - panic!("expected fail-closed for sh -c &> parse, got {r:?}"); - }; - assert!( - m.contains("background") - || m.contains("P3") - || m.contains("descendants") - || m.contains("shell `-c`"), - "expected policy message, got: {m}" - ); - } - - /// `env(1)` + `sh -c` tail: interpreter hint must apply to `&>` (PR #792). - #[test] - fn env_sh_dash_c_posix_ampersand_gt_rejected() { - let script = "sleep 600 &> /tmp/gunbc_env_ampgt"; - let r = evaluate_execute_command_exit_code( - "env", - &[String::from("sh"), String::from("-c"), String::from(script)], - 0, - ); - let ClaimResult::Fail(m) = r else { - panic!("expected fail-closed for env sh -c &>, got {r:?}"); - }; - assert!( - m.contains("background") - || m.contains("P3") - || m.contains("descendants") - || m.contains("shell `-c`"), - "expected policy message, got: {m}" - ); - } - - /// `env(1)` + `sh -c` indirection: top-level stem is not a shell; must still reject the same - /// background `&` (api-review 994fa40d). - #[test] - fn env_sh_dash_c_background_ampersand_is_rejected() { - let r = evaluate_execute_command_exit_code( - "env", - &[ - String::from("sh"), - String::from("-c"), - String::from("sleep 600 &"), - ], - 0, - ); - let ClaimResult::Fail(m) = r else { - panic!("expected fail-closed for env sh -c background, got {r:?}"); - }; - assert!( - m.contains("background") || m.contains("P3") || m.contains("shell `-c`"), - "expected policy message, got: {m}" - ); - } - - /// Combined `-ec` / `-lc` after the shell token: must not bypass the guard (api-review e99b53e7). - /// Also `env bash -lc` (argv tail after a non-`sh` shell stem) — same policy, pre-spawn. - #[test] - fn env_sh_dash_ec_and_dash_lc_background_ampersand_are_rejected() { - for (flag, label) in [("-ec", "ec"), ("-lc", "lc")] { - let r = evaluate_execute_command_exit_code( - "env", - &[ - String::from("sh"), - String::from(flag), - String::from("sleep 600 &"), - ], - 0, - ); - let ClaimResult::Fail(m) = r else { - panic!("expected fail-closed for env sh {label} + background, got {r:?}"); - }; - assert!( - m.contains("background") - || m.contains("P3") - || m.contains("descendants") - || m.contains("shell `-c`"), - "expected policy message, got: {m}" - ); - } - } - - #[test] - fn env_bash_dash_lc_background_ampersand_is_rejected() { - let r = evaluate_execute_command_exit_code( - "env", - &[ - String::from("bash"), - String::from("-lc"), - String::from("sleep 600 &"), - ], - 0, - ); - let ClaimResult::Fail(m) = r else { - panic!("expected fail-closed for env bash -lc + background, got {r:?}"); - }; - assert!(m.contains("background") || m.contains("P3") || m.contains("shell `-c`")); - } - - /// `-c` with script token `sh` and a **following** `-ec "…&"` in argv: flat `sh -ec` only looked at - /// the first "script" word; nested scan must see the `&` (PR #792 blocking inline, P3/P4). - #[test] - fn sh_c_sh_dash_ec_nested_background_ampersand_is_rejected() { - use super::shell_argv_may_start_unbounded_background; - let v = vec![ - String::from("sh"), - String::from("-c"), - String::from("sh"), - String::from("-ec"), - String::from("sleep 600 &"), - ]; - assert!(shell_argv_may_start_unbounded_background(&v)); - let r = evaluate_execute_command_exit_code("sh", &v, 0); - let ClaimResult::Fail(m) = r else { - panic!("expected fail-closed for sh -c sh -ec + &, got {r:?}"); - }; - assert!( - m.contains("background") || m.contains("P3") || m.contains("shell `-c`"), - "expected policy message, got: {m}" - ); - } - - #[test] - fn env_sh_c_sh_dash_ec_nested_background_ampersand_is_rejected() { - let v = vec![ - String::from("sh"), - String::from("-c"), - String::from("sh"), - String::from("-ec"), - String::from("sleep 600 &"), - ]; - let r = evaluate_execute_command_exit_code("env", &v, 0); - let ClaimResult::Fail(m) = r else { - panic!("expected fail-closed for env sh -c sh -ec + &, got {r:?}"); - }; - assert!(m.contains("background") || m.contains("P3") || m.contains("shell `-c`")); - } - - /// P3 / P4: the nested shell scanner is bounded; exceeding it must not mean "no `&` → allow" (api- - /// review codex 3a2a9f64). - #[test] - fn sh_c_nesting_past_max_scan_depth_fails_closed_without_ampersand_in_scripts() { - use super::reject_unbounded_shell_background; - use super::shell_argv_may_start_unbounded_background; - let mut args = vec![String::from("sh"), String::from("-c"), String::from("true")]; - for _ in 0..40 { - let mut t = vec![String::from("sh"), String::from("-c")]; - t.extend_from_slice(&args); - args = t; - } - assert!( - shell_argv_may_start_unbounded_background(&args), - "depth-bound exhaustion must fail closed, not allow a spawn past the policy guard" - ); - let r = reject_unbounded_shell_background("sh", &args); - assert!( - r.is_some(), - "expected policy fail when scan depth is exhausted, got {r:?}" - ); - } - - /// M1.5: policy `Fail` is `Err(ClaimResult)`, not propositional `false` (P3/DB-1, PR #792). - #[test] - fn m1_5_rejects_policy_fail_as_propositional() { - let p = evaluate_execute_command_m1_5( - "sh", - &[String::from("-c"), String::from("sleep 600 &")], - 0, - ); - assert!(p.is_err(), "expected Err(Fail) for background &, got {p:?}"); - } - - /// M1.5: exit code mismatch is the only propositional `false` path. - #[test] - #[cfg(unix)] - fn m1_5_exit_mismatch_is_unsatisfied() { - let p = - evaluate_execute_command_m1_5("sh", &[String::from("-c"), String::from("exit 1")], 0); - assert_eq!( - p, - Ok(ExecuteCommandM1_5Proposition::UnsatisfiedExitMismatch) - ); - } - - /// P2(c): a missing `command` must surface as `SpawnFailed` — not `Matched` — even when the - /// claim expects 127 and the unshare shell path would itself naturally exit 127. The - /// bootstrap sentinel pipe (`s` written, `e` not written) detects "logical command not - /// executable" structurally (T-PB-B Worker 4 typed model). - #[test] - #[cfg(target_os = "linux")] - fn unshare_expect_127_missing_command_does_not_pass_without_direct_spawn() { - use super::evaluate_execute_command_host_outcome; - use super::ExecuteCommandHostOutcome; - let r = evaluate_execute_command_host_outcome( - "definitely_not_a_real_binary_gunbc_792", - &[], - 127, - Duration::from_secs(5), - ); - // Either typed carrier is acceptable: `SpawnFailed` if unshare(1) wasn't usable here, - // or `SetupFailed { NamespaceSetupAndDirectSpawnFailed }` if unshare(1) ran but - // namespace setup failed (sentinel pipe empty) and the direct fallback also could not - // spawn. The contract — missing binary must NOT `Match` 127 — is satisfied by either. - assert!( - matches!( - r, - ExecuteCommandHostOutcome::SpawnFailed { .. } - | ExecuteCommandHostOutcome::SetupFailed { .. } - ), - "expected SpawnFailed or SetupFailed for missing command, got {r:?}" - ); - } - - /// Linux: a logical command that writes a large volume to `>&2` must complete within the - /// wall bound. Wrapper stderr is `Stdio::null()` and the helper inherits stdio normally; - /// the parent never reads from any pipe attached to the child stderr, so there's no - /// pipe-buffer-fill stall to worry about. This test passing is the live-state receipt - /// that the helper-wired path correctly nulls logical stderr (no shared-channel hazard - /// with the wall-bound timeout). Pre-helper this same test guarded against a pipe-stall - /// regression on the wrapper-stderr drain path; post-helper it remains a useful - /// volume-sanity receipt against future plumbing changes. - #[test] - #[cfg(target_os = "linux")] - fn unshare_path_drains_piped_stderr_so_huge_logical_stderr_does_not_stall() { - let c = 8000u32; - let body = format!( - "i=0; while [ $i -lt {c} ]; do printf 'xxxxxxxxxx'; i=$((i+1)); done >&2; exit 0" - ); - let r = evaluate_execute_command_exit_code_with_wall_time( - "sh", - &[String::from("-c"), body], - 0, - Duration::from_secs(2), - ); - assert_eq!( - r, - ClaimResult::Pass, - "expected Pass when logical stderr > pipe; got {r:?}" - ); - } - - /// Linux receipt that the unshare PID-namespace path is **actually engaged**, not - /// silently bypassed via direct fallback. `unshare -f -p` makes the helper's - /// fork PID 1 in the new namespace; `exec` of the user command preserves PID 1. So - /// `sh -c '[ "$$" = "1" ]'` exits 0 *only* when the unshare path reached the user - /// command. If the bootstrap-sentinel pipe were broken (e.g. fd 3 closed by parent's - /// `exec("unshare")` due to a misplaced FD_CLOEXEC), the runner would fall back to - /// direct, the user sh would NOT be PID 1, and this assertion would fail. - /// (Regression for codex review on PR #1049, commit e072dce4.) - #[test] - #[cfg(target_os = "linux")] - fn unshare_path_actually_engages_user_runs_as_pid_1_in_new_namespace() { - use super::evaluate_execute_command_host_outcome; - use super::ExecuteCommandHostOutcome; - // Probe: can THIS host create a user+PID namespace via the same `unshare` flags - // we use? If not (restricted runner / sandbox), the runner is *expected* to fall - // back to direct and the user sh will not be PID 1. Skip the assertion in that - // case — the test only asserts engagement when the host actually permits it. - let probe = std::process::Command::new("unshare") - .args(["-c", "-f", "-p", "--", "sh", "-c", "[ \"$$\" = \"1\" ]"]) - .stdin(std::process::Stdio::null()) - .stdout(std::process::Stdio::null()) - .stderr(std::process::Stdio::null()) - .status(); - let probe_ok = matches!(probe, Ok(s) if s.success()); - if !probe_ok { - // unshare PID-namespace not permitted on this host (restricted CI / sandbox); - // skip silently. clippy::disallowed_macros bans eprintln/println in lib crates. - return; - } - // Probe succeeded → unshare PID-namespace works on this host. Our runner MUST - // engage it, so the inner sh sees $$ == 1 and exits 0. A silent bypass (e.g. a - // misplaced FD_CLOEXEC closing the sentinel pipe before the bootstrap runs) would - // route us through the direct fallback, sh would have a normal PID, exit 1, and - // we'd see `Mismatch { expected: 0, actual: 1 }` here. - let r = evaluate_execute_command_host_outcome( - "sh", - &[String::from("-c"), String::from("[ \"$$\" = \"1\" ]")], - 0, - Duration::from_secs(5), - ); - assert_eq!( - r, - ExecuteCommandHostOutcome::Matched, - "unshare path appears silently bypassed (probe says unshare PID-namespace IS permitted on this host); expected Matched ($$ == 1 inside ns), got {r:?}" - ); - } - - /// **P2(c) sef-spoof structural-unreachability receipt** (api-review openai-pro/ - /// gpt-5-5-pro sha 9fea084e; helper-binary AC per issuecomment-4331097029 on #856). - /// - /// A logical command that successfully `execvp`s and attempts to write exactly `f` to - /// fd 3 must NOT be misclassified as `LogicalExecFailed`. With the - /// `gunbc_execute_command_bootstrap` helper (#1063) wired in, the helper sets - /// `FD_CLOEXEC` on fd 3 immediately before `execvp(3)`; on successful exec the kernel - /// atomically closes fd 3 in the new image, the user's `printf f >&3` gets `EBADF`, - /// and the parent's sentinel reads exactly `b"se"` → `LogicalCommandExeced` → exit code - /// is the user's (0) → `Matched`. - /// - /// This test was `#[ignore]`d during the pure-sh era (the gap was unreachable in POSIX - /// sh). It is now an active load-bearing receipt that the helper's CLOEXEC-before- - /// `execvp` ordering actually closes the spoof window — a regression that broke the - /// CLOEXEC ordering would surface here as `SpawnFailed`/`LogicalExecFailed` instead of - /// `Matched`. - #[test] - #[cfg(target_os = "linux")] - fn unshare_logical_command_writing_f_to_fd3_is_not_misclassified_after_helper_lands() { - use super::evaluate_execute_command_host_outcome; - use super::ExecuteCommandHostOutcome; - let probe = std::process::Command::new("unshare") - .args(["-c", "-f", "-p", "--", "sh", "-c", "[ \"$$\" = \"1\" ]"]) - .stdin(std::process::Stdio::null()) - .stdout(std::process::Stdio::null()) - .stderr(std::process::Stdio::null()) - .status(); - if !matches!(probe, Ok(s) if s.success()) { - return; - } - let r = evaluate_execute_command_host_outcome( - "sh", - &[ - String::from("-c"), - String::from("printf f >&3 2>/dev/null; exit 0"), - ], - 0, - Duration::from_secs(5), - ); - // Post-helper-binary expectation: fd 3 is closed atomically by execvp; sh's - // `printf f >&3` gets EBADF; sentinel = b"se"; outcome is Matched. - // Pre-helper-binary (current HEAD): sentinel = b"sef"; outcome is SpawnFailed — - // this test is #[ignore]d until that flip happens. - assert_eq!( - r, - ExecuteCommandHostOutcome::Matched, - "post-#1063: logical-child write of `f` to fd 3 must NOT misclassify as exec failure; got {r:?}" - ); - } - - /// **P2(d) defense-in-depth regression** (api-review openai-pro/gpt-5-5-pro sha - /// 7297b04a). Even after the helper binary's structural CLOEXEC closes the typical - /// post-`exec` write window, the classifier's `b"se*"` → `LogicalCommandExeced` - /// hardening must remain in place — a future helper bug that broke CLOEXEC ordering - /// would let the user write stray bytes to fd 3, and we still must NOT trigger - /// direct-fallback re-execution. - /// - /// Construction: an sh script that asserts it is PID 1 (proving the unshare path - /// engaged — `[ "$$" = "1" ]`), attempts to write a stray byte `x` to fd 3 (post- - /// helper-binary: silently EBADFs because fd 3 is closed; pre-helper: writes through - /// to the parent pipe), then exits 0. Both eras: outcome must be `Matched` (single - /// run, exit 0). A buggy classifier that routed `b"sex"` to `NamespaceSetupFailed` - /// would re-run sh outside the PID namespace, `$$ != 1`, exit 99, surface `Mismatch`. - #[test] - #[cfg(target_os = "linux")] - fn unshare_post_exec_fd3_write_does_not_trigger_implicit_rerun() { - use super::evaluate_execute_command_host_outcome; - use super::ExecuteCommandHostOutcome; - let probe = std::process::Command::new("unshare") - .args(["-c", "-f", "-p", "--", "sh", "-c", "[ \"$$\" = \"1\" ]"]) - .stdin(std::process::Stdio::null()) - .stdout(std::process::Stdio::null()) - .stderr(std::process::Stdio::null()) - .status(); - if !matches!(probe, Ok(s) if s.success()) { - return; - } - // First run inside unshare PID-namespace: $$ == 1, write x to fd 3, exit 0. - // If a buggy classifier triggered direct fallback, the re-run would NOT be in a - // PID namespace, $$ != 1, exit 99 → Mismatch (caught by this assertion). - let r = evaluate_execute_command_host_outcome( - "sh", - &[ - String::from("-c"), - String::from(r#"[ "$$" = "1" ] || exit 99; printf x >&3 2>/dev/null; exit 0"#), - ], - 0, - Duration::from_secs(5), - ); - assert_eq!( - r, - ExecuteCommandHostOutcome::Matched, - "post-`se` fd-3 write must not trigger implicit re-run; expected Matched (single run, $$ == 1, exit 0), got {r:?}" - ); - } - - /// Linux receipt: a `command` containing `/` (absolute path) reaches `execvp` with the - /// literal path. The helper binary uses `execvp(3)` directly (which doesn't consult - /// `PATH` for path operands), so the run completes and Matches. (Helper-binary parity - /// receipt for `std::process::Command` semantics; see #1063.) - #[test] - #[cfg(target_os = "linux")] - fn unshare_absolute_path_command_runs_and_matches() { - // `/bin/true` exists on virtually all Linux systems; if not, fall back to `/usr/bin/true`. - let abs = if std::path::Path::new("/bin/true").exists() { - "/bin/true" - } else { - "/usr/bin/true" - }; - let r = evaluate_execute_command_exit_code(abs, &[], 0); - assert_eq!( - r, - ClaimResult::Pass, - "absolute-path command must reach exec via the bootstrap path probe; got {r:?}" - ); - } - - /// Linux receipt: a `command` with no `/` (bare name) is resolved by `execvp(3)` via - /// `PATH`. `true` is always on `PATH` on every supported host. - #[test] - #[cfg(target_os = "linux")] - fn unshare_bare_name_command_runs_and_matches() { - let r = evaluate_execute_command_exit_code("true", &[], 0); - assert_eq!( - r, - ClaimResult::Pass, - "bare-name command must resolve via PATH probe; got {r:?}" - ); - } - - /// Manager-requested regression (T-PB-B Worker 4 draft review): an existing-but-not- - /// executable file with `expect_exit_code = 126` must NOT `Match`, even though the sh - /// fall-back exit for an unrunnable command is naturally 126. The path probe - /// `[ -x "$0" ]` rejects pre-`exec`, sentinel `s`, classified `LogicalCommandNotExecutable` - /// → `SpawnFailed`. Closes the P2(c) collapse where a non-executable path could have been - /// classified as a logical exit. - #[test] - #[cfg(target_os = "linux")] - fn unshare_existing_non_executable_file_with_expect_126_does_not_match() { - use super::evaluate_execute_command_host_outcome; - use super::ExecuteCommandHostOutcome; - use std::os::unix::fs::PermissionsExt; - let tmp = - std::env::temp_dir().join(format!("gunbc_pb_runtime_nonexec_{}", std::process::id())); - std::fs::write(&tmp, b"#!/bin/sh\nexit 0\n").expect("write temp"); - let mut perms = std::fs::metadata(&tmp).expect("meta").permissions(); - perms.set_mode(0o644); // explicitly NO execute bit - std::fs::set_permissions(&tmp, perms).expect("chmod 644"); - - let path = tmp.to_str().expect("path utf8").to_string(); - let r = evaluate_execute_command_host_outcome(&path, &[], 126, Duration::from_secs(5)); - let _ = std::fs::remove_file(&tmp); - - assert!( - !matches!(r, ExecuteCommandHostOutcome::Matched), - "non-executable file with expect=126 must NOT Match (P2(c)); got {r:?}" - ); - assert!( - matches!( - r, - ExecuteCommandHostOutcome::SpawnFailed { .. } - | ExecuteCommandHostOutcome::SetupFailed { .. } - ), - "expected SpawnFailed/SetupFailed for non-executable path; got {r:?}" - ); - } - - /// Linux receipt: a relative-path `command` containing `/` that does **not** exist must - /// surface as a non-`Matched` outcome (`SpawnFailed` or `SetupFailed`), never as a stray - /// `Matched` from `command -v`'s sh-relative resolution. Distinguishes path-mode probe - /// from PATH-mode probe. - #[test] - #[cfg(target_os = "linux")] - fn unshare_relative_path_missing_command_does_not_match() { - use super::evaluate_execute_command_host_outcome; - use super::ExecuteCommandHostOutcome; - let r = evaluate_execute_command_host_outcome( - "./definitely_not_here_gunbc_pb_runtime", - &[], - 0, - Duration::from_secs(5), - ); - assert!( - matches!( - r, - ExecuteCommandHostOutcome::SpawnFailed { .. } - | ExecuteCommandHostOutcome::SetupFailed { .. } - ), - "missing relative-path command must NOT match; got {r:?}" - ); - } - - #[test] - fn shell_dash_c_script_parses_standalone_c_ec_and_e_c() { - use super::shell_dash_c_script_string; - assert_eq!( - shell_dash_c_script_string(&[String::from("-c"), String::from("a")]), - Some("a") - ); - assert_eq!( - shell_dash_c_script_string(&[String::from("-ec"), String::from("b")]), - Some("b") - ); - assert_eq!( - shell_dash_c_script_string(&[ - String::from("-e"), - String::from("-c"), - String::from("c") - ]), - Some("c") - ); - assert_eq!( - shell_dash_c_script_string(&[String::from("-lc"), String::from("d")]), - Some("d") - ); - assert_eq!( - shell_dash_c_script_string(&[ - String::from("sh"), - String::from("-ec"), - String::from("e") - ]), - Some("e") - ); - assert_eq!( - shell_dash_c_script_string(&[ - String::from("env"), - String::from("sh"), - String::from("-lc"), - String::from("f"), - ]), - Some("f") - ); - } - - /// First-`-c`-only `shell_dash_c_script_string` can return the *nested shell token*; the - /// pre-spawn guard recurses. PR #792 inline: do not use the test helper in production. - #[test] - fn shell_dash_c_script_string_first_c_only_unlike_guard_nested_scan() { - use super::shell_argv_may_start_unbounded_background; - use super::shell_dash_c_script_string; - let nested = vec![ - String::from("sh"), - String::from("-c"), - String::from("sh"), - String::from("-ec"), - String::from("sleep 600 &"), - ]; - assert_eq!(shell_dash_c_script_string(&nested), Some("sh")); - assert!(shell_argv_may_start_unbounded_background(&nested)); - } - - /// `sh -ec` and `sh -lc` (codex) must be covered, not only `sh -c …`. - #[test] - fn sh_dash_ec_rejects_background_ampersand() { - let r = evaluate_execute_command_exit_code( - "sh", - &[String::from("-ec"), String::from("sleep 600 &")], - 0, - ); - let ClaimResult::Fail(m) = r else { - panic!("expected fail-closed for -ec + background, got {r:?}"); - }; - assert!( - m.contains("background") - || m.contains("P3") - || m.contains("descendants") - || m.contains("shell `-c`"), - "expected policy message, got: {m}" - ); - } - - /// `&&` is logical AND, not background; must not be rejected (PR #792 review). - #[test] - #[cfg(unix)] - fn sh_dash_c_and_chain_runs() { - let r = evaluate_execute_command_exit_code( - "sh", - &[String::from("-c"), String::from("true && true")], - 0, - ); - assert_eq!(r, ClaimResult::Pass); - } - - /// `2>&1` and similar are not a shell background `&` (elided before the heuristic). - #[test] - #[cfg(unix)] - fn sh_dash_c_2_redir_is_not_treated_as_background() { - let r = evaluate_execute_command_exit_code( - "sh", - &[String::from("-c"), String::from("true 2>&1")], - 0, - ); - assert_eq!( - r, - ClaimResult::Pass, - "2>&1 should not be confused with sh background &" - ); - } - - /// `>&2` (default-fd to stderr) is not a background `&` — e.g. `unshare_path_drains_…` uses - /// a loop with `>&2` on Linux; without eliding, `ExecuteCommand` rejects the `-c` script. - #[test] - fn sh_dash_c_greater_redir_to_fd2_is_not_background() { - assert!(!shell_dash_c_may_start_background_after_eliding_artifacts( - "i=0; while [ $i -lt 1 ]; do i=$((i+1)); done >&2; exit 0", - Some("sh"), - )); - } - - #[test] - #[cfg(unix)] - fn long_running_child_fails_closed_with_timeout_message() { - let r = evaluate_execute_command_exit_code_with_wall_time( - "sh", - &[String::from("-c"), String::from("sleep 5")], - 0, - Duration::from_millis(150), - ); - let ClaimResult::Fail(msg) = r else { - panic!("expected timeout fail, got {r:?}"); - }; - assert!( - msg.contains("0.15") && msg.contains("exceeded") && msg.contains("wall-clock"), - "expected timeout phrasing, got: {msg}" - ); - } -} - -// Linux: bootstrap sentinel-pipe classification (T-PB-B Worker 4 typed model). -#[cfg(all(test, target_os = "linux"))] -mod unshare_bootstrap_sentinel_tests { - use super::unshare_bootstrap_stage_from_sentinel; - use super::UnshareBootstrapStage; - - #[test] - fn empty_sentinel_means_namespace_setup_failed() { - assert_eq!( - unshare_bootstrap_stage_from_sentinel(b""), - UnshareBootstrapStage::NamespaceSetupFailed - ); - } - - #[test] - fn s_only_means_logical_command_not_executable() { - assert_eq!( - unshare_bootstrap_stage_from_sentinel(b"s"), - UnshareBootstrapStage::LogicalCommandNotExecutable - ); - } - - #[test] - fn se_means_logical_command_execed() { - assert_eq!( - unshare_bootstrap_stage_from_sentinel(b"se"), - UnshareBootstrapStage::LogicalCommandExeced - ); - } - - #[test] - fn sef_means_logical_exec_failed_post_probe() { - // `sef` = sh started, probe passed, exec returned (failure), EXIT trap fired. Must - // surface as a typed exec-failed outcome, NOT as a logical exit — closes the P2(c) - // regression manager flagged on draft review. - assert_eq!( - unshare_bootstrap_stage_from_sentinel(b"sef"), - UnshareBootstrapStage::LogicalExecFailed - ); - } - - #[test] - fn pre_se_unexpected_patterns_fail_closed_to_setup_failed() { - // Patterns that did NOT reach `e` (so the bootstrap never committed to `exec`) must - // fail-closed to `NamespaceSetupFailed`. Direct fallback in that case is the *first* - // logical run, not a second — safe. - assert_eq!( - unshare_bootstrap_stage_from_sentinel(b"x"), - UnshareBootstrapStage::NamespaceSetupFailed - ); - assert_eq!( - unshare_bootstrap_stage_from_sentinel(b"es"), - UnshareBootstrapStage::NamespaceSetupFailed - ); - } - - /// **P2(d) regression (api-review codex sha 7297b04a).** Once the sentinel reaches `se`, - /// the bootstrap has committed to `exec` and the user command DID run. Stray bytes after - /// `se` (from the user writing to the inherited fd 3 post-`exec`) must classify as - /// `LogicalCommandExeced`, NOT `NamespaceSetupFailed` — otherwise the runner would - /// implicitly re-execute the user command via the direct fallback. Both `b"sex"` (stray - /// after canonical `se`) and `b"sefx"` (stray after canonical `sef`-style trap-write) - /// are user-side post-`exec` writes; both must surface as user ran. - #[test] - fn post_se_stray_bytes_classify_as_logical_command_execed_no_rerun() { - assert_eq!( - unshare_bootstrap_stage_from_sentinel(b"sex"), - UnshareBootstrapStage::LogicalCommandExeced - ); - assert_eq!( - unshare_bootstrap_stage_from_sentinel(b"sefx"), - UnshareBootstrapStage::LogicalCommandExeced - ); - assert_eq!( - unshare_bootstrap_stage_from_sentinel(b"se\x00"), - UnshareBootstrapStage::LogicalCommandExeced - ); - assert_eq!( - unshare_bootstrap_stage_from_sentinel(b"se\xff\xff"), - UnshareBootstrapStage::LogicalCommandExeced - ); - } -} - -/// **P2(c) hardening — helper-path validation rejects non-executables.** (api-review -/// codex/codex-default sha 143b7da5, BLOCKING.) Without this check, the override env var -/// could point at a directory or non-x file: \[unshare] would fail to exec it → empty -/// sentinel → `NamespaceSetupFailed` → direct fallback runs the user command, silently -/// converting helper misconfiguration into a possible `Matched` logical exit. -#[cfg(all(test, target_os = "linux"))] -mod helper_path_validation_tests { - use super::is_regular_executable_file; - use std::os::unix::fs::PermissionsExt; - - #[test] - fn directory_is_rejected() { - let dir = std::env::temp_dir(); - // tmp dir definitely exists and is a directory. - assert!(dir.is_dir()); - assert!( - !is_regular_executable_file(&dir), - "directory must NOT pass helper-path validation" - ); - } - - #[test] - fn non_executable_file_is_rejected() { - let path = std::env::temp_dir().join(format!( - "gunbc_pb_runtime_helper_validation_nonexec_{}", - std::process::id() - )); - std::fs::write(&path, b"#!/bin/sh\nexit 0\n").expect("write tmp"); - let mut perms = std::fs::metadata(&path).expect("meta").permissions(); - perms.set_mode(0o644); // explicitly NO execute bit - std::fs::set_permissions(&path, perms).expect("chmod 644"); - let result = is_regular_executable_file(&path); - let _ = std::fs::remove_file(&path); - assert!( - !result, - "non-executable file must NOT pass helper-path validation" - ); - } - - #[test] - fn missing_file_is_rejected() { - let path = std::path::PathBuf::from(format!( - "/tmp/gunbc_pb_runtime_helper_validation_missing_{}_{}", - std::process::id(), - std::time::SystemTime::now() - .duration_since(std::time::UNIX_EPOCH) - .map(|d| d.as_nanos()) - .unwrap_or(0) - )); - assert!(!path.exists()); - assert!( - !is_regular_executable_file(&path), - "missing path must NOT pass helper-path validation" - ); - } - - #[test] - fn executable_file_is_accepted() { - // /bin/sh is universally a regular executable file on Linux. - let path = if std::path::Path::new("/bin/sh").exists() { - std::path::PathBuf::from("/bin/sh") - } else { - std::path::PathBuf::from("/usr/bin/sh") - }; - assert!( - is_regular_executable_file(&path), - "regular executable {} must pass helper-path validation", - path.display() - ); - } - - /// **BLOCKING regression (api-review codex sha 523776b).** A file with execute bits - /// set only for a uid/gid the calling process is NOT (e.g. `--x------` owned by root - /// while we run as a non-root test runner) must be rejected — otherwise `unshare` - /// would `EACCES` at exec time, the helper would never write the sentinel, and we'd - /// silently route to direct fallback, violating P2(c). - /// - /// Construction: drop ALL execute bits (mode 0o400 = `r--------`) on a file we own; - /// `access(X_OK)` returns -1/EACCES and the validator rejects. This exercises the - /// uid-aware check rather than just "any bit set." - #[test] - fn non_executable_to_calling_uid_is_rejected() { - use std::os::unix::fs::PermissionsExt; - let path = std::env::temp_dir().join(format!( - "gunbc_pb_runtime_helper_validation_uid_aware_{}", - std::process::id() - )); - std::fs::write(&path, b"#!/bin/sh\nexit 0\n").expect("write tmp"); - let mut perms = std::fs::metadata(&path).expect("meta").permissions(); - // mode 0o400: owner can read but not execute; nobody can execute. - // access(X_OK) by the caller (us, the owner) → EACCES. Validator must reject. - perms.set_mode(0o400); - std::fs::set_permissions(&path, perms).expect("chmod 400"); - let result = is_regular_executable_file(&path); - let _ = std::fs::remove_file(&path); - assert!( - !result, - "file with no execute permission for the calling uid must be rejected (P2(c))" - ); - } -} - -#[cfg(test)] -mod perf_within_baseline_tests { - //! Unit tests for the `PerfWithinBaseline` evaluator path per the - //! T-Tier3-Dissolution consumer-slice worker brief - //! (`docs/briefs/r3-pb-t-tier3-consumer-slice-worker.md` §1). - //! - //! Two coverage axes: - //! - //! 1. **Resolver fail-closed**: `PerfMeasurementResolveError` table-form - //! over typed variants × two role labels. Each variant must produce a - //! `ClaimResult::Fail` reason text that preserves the role label for triage - //! (per `CODING.md` typed-error discipline + `INVARIANTS.md` P3 fail-closed). - //! - //! 2. **Budget evaluation logic**: the four cases enumerated in the - //! brief acceptance — pass-when-under-budget, fail-on-median-over, - //! fail-on-p99-over, fail-on-overflow. Tested via a small free - //! function rather than through full DAG construction; the helper - //! encodes the §225 ratio thresholds and the saturating-overflow - //! fail-closed semantics. - - use super::compute_perf_budget_bounds; - use super::is_perf_budget_comparator_at_most; - use super::PerfBudgetOverflow; - use super::PerfMeasurement; - use super::PerfMeasurementResolveError; - - /// Apply the §225-locked `AtMostBudget` thresholds (median and absolute p99). - /// call through `compute_perf_budget_bounds` (the same single-authority - /// free function the runtime uses) so there is no second copy of the - /// `× 2` / `× 5` constants — drift between test harness and runtime - /// is structurally impossible. - fn budget_pass_le( - subject: PerfMeasurement, - baseline: PerfMeasurement, - ) -> Result { - let (median_bound, p99_bound) = compute_perf_budget_bounds(baseline)?; - Ok(subject.median_ns <= median_bound && subject.p99_ns <= p99_bound) - } - - /// Differential test: every typed `PerfMeasurementResolveError` variant - /// must produce a structurally-distinct `ClaimResult::Fail` for two - /// different role labels, demonstrating that the role parameter flows - /// through `into_claim_fail` without pinning the exact format string. - /// This avoids the `TESTING.md` anti-pattern of asserting on - /// human-readable error message text while still exercising the - /// role-preservation contract from the brief acceptance. - #[test] - fn resolver_fail_closed_role_label_flows_through_for_every_variant() { - let variants: &[PerfMeasurementResolveError] = &[ - PerfMeasurementResolveError::MissingDeclaration, - PerfMeasurementResolveError::WrongConnective, - PerfMeasurementResolveError::MissingField { field: "median_ns" }, - PerfMeasurementResolveError::MissingField { - field: "p99_delta_ns", - }, - PerfMeasurementResolveError::WrongFieldKind { field: "median_ns" }, - PerfMeasurementResolveError::WrongFieldKind { - field: "p99_delta_ns", - }, - PerfMeasurementResolveError::NegativeNatLiteral { field: "median_ns" }, - PerfMeasurementResolveError::NegativeNatLiteral { - field: "p99_delta_ns", - }, - PerfMeasurementResolveError::P99ConstructionOverflow, - ]; - for variant in variants { - let alpha = variant.clone().into_claim_fail("alpha_role"); - let beta = variant.clone().into_claim_fail("beta_role"); - assert_ne!( - alpha, beta, - "role label must produce different output for variant {:?}; \ - got identical strings (role param ignored?)", - variant, - ); - // Also verify the role string itself is reachable in the output — - // not by pinning the format but by checking the role name is a - // distinguishing substring (a role drop would make alpha == beta - // above, but a role used non-identifyingly could still differ). - assert!( - alpha.contains("alpha_role") && beta.contains("beta_role"), - "role substrings must appear in their respective outputs for {:?}", - variant, - ); - } - } - - #[test] - fn budget_pass_when_subject_under_thresholds() { - // baseline median 100, p99 200; bounds = (200, 1000); subject (150, 800) — both under. - let baseline = PerfMeasurement { - median_ns: 100, - p99_ns: 200, - }; - let subject = PerfMeasurement { - median_ns: 150, - p99_ns: 800, - }; - assert_eq!(budget_pass_le(subject, baseline), Ok(true)); - } - - #[test] - fn budget_fails_when_subject_median_exceeds_bound() { - // baseline median 100 → bound 200; subject median 201 fails despite fine p99. - let baseline = PerfMeasurement { - median_ns: 100, - p99_ns: 200, - }; - let subject = PerfMeasurement { - median_ns: 201, - p99_ns: 800, - }; - assert_eq!(budget_pass_le(subject, baseline), Ok(false)); - } - - #[test] - fn budget_fails_when_subject_p99_exceeds_bound() { - // baseline p99 200 → bound 1000; subject p99 1001 fails despite fine median. - let baseline = PerfMeasurement { - median_ns: 100, - p99_ns: 200, - }; - let subject = PerfMeasurement { - median_ns: 150, - p99_ns: 1001, - }; - assert_eq!(budget_pass_le(subject, baseline), Ok(false)); - } - - #[test] - fn budget_fail_closed_on_threshold_overflow() { - // baseline median = i64::MAX → ×2 overflows; helper must surface the - // overflow rather than silently wrap. The runtime impl converts this - // to ClaimResult::Fail with an explicit reason. - let baseline = PerfMeasurement { - median_ns: i64::MAX, - p99_ns: 1, - }; - let subject = PerfMeasurement { - median_ns: 0, - p99_ns: 0, - }; - assert_eq!( - budget_pass_le(subject, baseline), - Err(PerfBudgetOverflow::Median) - ); - - let baseline_p99_overflow = PerfMeasurement { - median_ns: 1, - p99_ns: i64::MAX, - }; - assert_eq!( - budget_pass_le(subject, baseline_p99_overflow), - Err(PerfBudgetOverflow::P99) - ); - } - - /// The Director-locked §225 budget semantics are `median ≤ 2× baseline` - /// AND `p99 ≤ 5× baseline`. The substrate `PerfBudgetComparisonOp` - /// carries a closed budget comparator so inverted general comparisons - /// cannot be authored into the gate. This test reads its variant set - /// from the generated full bootstrap DAG consumed by the runner (not a - /// hardcoded list) and asserts the runtime guard classifies every variant: - /// `AtMostBudget` alone passes, every other variant fails-closed. - #[test] - fn runtime_classifies_every_perf_budget_comparison_op_variant_at_most_only() { - use crate::dag::TypeConnective; - - let dag = std::thread::Builder::new() - .name("perf_budget_comparator_bootstrap_dag".to_string()) - // The generated full bootstrap DAG overflows the default libtest - // thread stack on this path; keep the structural drift check. - .stack_size(8 * 1024 * 1024) - .spawn(crate::generated_full_bootstrap_dag) - .expect("spawn generated_full_bootstrap_dag helper") - .join() - .expect("generated_full_bootstrap_dag helper panicked"); - let perf_budget_comparison_op = dag.declaration_by_name("PerfBudgetComparisonOp").expect( - "PerfBudgetComparisonOp must exist in generated bootstrap DAG \ - (src/v3/std/verification.dag)", - ); - let TypeConnective::Disj { variants } = &perf_budget_comparison_op.connective else { - panic!("PerfBudgetComparisonOp must be a coproduct (Disj)"); - }; - let mut variant_labels: Vec<&str> = variants.iter().map(|v| v.label.as_str()).collect(); - variant_labels.sort(); - assert!( - variant_labels.contains(&"AtMostBudget"), - "PerfBudgetComparisonOp must include `AtMostBudget` for §225 semantics; got {variant_labels:?}" - ); - // Drift gate: every substrate-declared variant must be explicitly - // classified by the runtime guard. The guard's classification is a - // single rule — `label == \"AtMostBudget\"` — so the assertion below mirrors it. - // If substrate adds a variant, `is_perf_budget_comparator_at_most` - // continues to return `false` for it (correctly fail-closed under the - // current locked semantics) and this test continues to pass without - // edits — the new variant is structurally rejected by the same guard, - // matching the §225 lock. - for label in &variant_labels { - let accepted = is_perf_budget_comparator_at_most(label); - assert_eq!( - accepted, - *label == "AtMostBudget", - "PerfBudgetComparisonOp variant `{label}`: runtime guard classification disagrees \ - with §225 lock (only `AtMostBudget` may be accepted)", - ); - } - } - - #[test] - fn perf_budget_comparator_rejects_general_comparison_op_constructor() { - use crate::dag::{FieldValue, TypeConnective}; - - let dag = std::thread::Builder::new() - .name("perf_budget_comparator_wrong_disj_bootstrap_dag".to_string()) - // The generated full bootstrap DAG overflows the default libtest - // thread stack on this path; keep the structural boundary check. - .stack_size(8 * 1024 * 1024) - .spawn(crate::generated_full_bootstrap_dag) - .expect("spawn generated_full_bootstrap_dag helper") - .join() - .expect("generated_full_bootstrap_dag helper panicked"); - let comparison_op = dag - .declaration_by_name("ComparisonOp") - .expect("ComparisonOp must exist in generated bootstrap DAG"); - let TypeConnective::Disj { variants } = &comparison_op.connective else { - panic!("ComparisonOp must be a coproduct (Disj)"); - }; - let general_comparator = FieldValue::Variant { - constructor: variants[0].ty, - payload: Vec::new(), - }; - assert_eq!( - super::perf_budget_comparator_label(&dag, &general_comparator), - None, - "PerfWithinBaseline must reject unit variants from non-PerfBudgetComparisonOp coproducts" - ); - } -} - -/// Single-rule classifier for the §225 `AtMostBudget` guard. The runtime -/// path in [`TestRunner::eval_perf_within_baseline`] calls this helper -/// (`comparator_label != "AtMostBudget"` → fail-closed). Lifted as a free function -/// so unit tests can drive the same classifier against the substrate- -/// declared `PerfBudgetComparisonOp` variant set without DAG fixtures. -fn is_perf_budget_comparator_at_most(comparator_label: &str) -> bool { - comparator_label == "AtMostBudget" -} - -#[cfg(test)] -mod symbolic_cost_expr_equals_decoder_tests { - use super::*; - use crate::generated_full_bootstrap_dag; - - fn symbolic_cost_variant_constructor(dag: &Dag, label: &str) -> DeclarationId { - let symbolic_cost = dag - .declaration_by_name("SymbolicCost") - .expect("SymbolicCost"); - let TypeConnective::Disj { variants } = &symbolic_cost.connective else { - panic!("SymbolicCost not Disj"); - }; - variants - .iter() - .find(|v| v.label == label) - .unwrap_or_else(|| panic!("missing variant {label}")) - .ty - } - - fn constant_cost_fv(dag: &Dag, n: i64) -> FieldValue { - FieldValue::Variant { - constructor: symbolic_cost_variant_constructor(dag, "ConstantCost"), - payload: vec![FieldValue::Literal(LiteralBits::Int(n.to_string()))], - } - } - - #[test] - fn pattern_decodes_sum_of_two_constants() { - let dag = generated_full_bootstrap_dag(); - let nsl = FieldValue::Record(vec![ - ("first".to_string(), constant_cost_fv(&dag, 1)), - ("second".to_string(), constant_cost_fv(&dag, 2)), - ("rest".to_string(), FieldValue::List(vec![])), - ]); - let sum = FieldValue::Variant { - constructor: symbolic_cost_variant_constructor(&dag, "SumCost"), - payload: vec![nsl], - }; - let pat = field_value_to_symbolic_cost_eq_pattern(&dag, &sum).expect("sum decodes"); - assert_eq!( - pat, - SymbolicCostEqPattern::Sum(vec![ - SymbolicCostEqPattern::Constant(1), - SymbolicCostEqPattern::Constant(2), - ]) - ); - } - - #[test] - fn pattern_decodes_product_of_two_constants() { - let dag = generated_full_bootstrap_dag(); - let nsl = FieldValue::Record(vec![ - ("first".to_string(), constant_cost_fv(&dag, 0)), - ("second".to_string(), constant_cost_fv(&dag, 1)), - ("rest".to_string(), FieldValue::List(vec![])), - ]); - let prod = FieldValue::Variant { - constructor: symbolic_cost_variant_constructor(&dag, "ProductCost"), - payload: vec![nsl], - }; - let pat = field_value_to_symbolic_cost_eq_pattern(&dag, &prod).expect("product decodes"); - assert_eq!( - pat, - SymbolicCostEqPattern::Product(vec![ - SymbolicCostEqPattern::Constant(0), - SymbolicCostEqPattern::Constant(1), - ]) - ); - } - - #[test] - fn optional_display_name_rejects_zero_payload_unless_absent_ctor() { - let dag = generated_full_bootstrap_dag(); - let wrong_ctor = symbolic_cost_variant_constructor(&dag, "ConstantCost"); - let fields = vec![( - "display_name".to_string(), - FieldValue::Variant { - constructor: wrong_ctor, - payload: vec![], - }, - )]; - assert!( - optional_string_field_for_record(&dag, &fields, "display_name").is_err(), - "zero payload must not decode as absent unless ctor is optional None" - ); - } - - #[test] - fn optional_display_name_accepts_zero_payload_for_canonical_none_ctor_when_present() { - let dag = generated_full_bootstrap_dag(); - let Some(none_ctor) = super::size_variable_display_name_optional_none_constructor_id(&dag) - else { - // `String?` may lower only via cardinality + absent field — nothing to assert here. - return; - }; - let fields = vec![( - "display_name".to_string(), - FieldValue::Variant { - constructor: none_ctor, - payload: vec![], - }, - )]; - assert_eq!( - optional_string_field_for_record(&dag, &fields, "display_name").unwrap(), - None - ); - } - - #[test] - fn optional_display_name_accepts_string_literal_payload() { - let dag = generated_full_bootstrap_dag(); - let fields = vec![( - "display_name".to_string(), - FieldValue::Variant { - constructor: symbolic_cost_variant_constructor(&dag, "ConstantCost"), - payload: vec![FieldValue::Literal(LiteralBits::String("x".to_string()))], - }, - )]; - assert_eq!( - optional_string_field_for_record(&dag, &fields, "display_name").unwrap(), - Some("x".to_string()) - ); - } - - #[test] - fn optional_display_name_rejects_non_string_literal_singleton_payload() { - let dag = generated_full_bootstrap_dag(); - let fields = vec![( - "display_name".to_string(), - FieldValue::Variant { - constructor: symbolic_cost_variant_constructor(&dag, "ConstantCost"), - payload: vec![FieldValue::Literal(LiteralBits::Int("1".to_string()))], - }, - )]; - assert!(optional_string_field_for_record(&dag, &fields, "display_name").is_err()); - } - - #[test] - fn eq_pattern_linear_matches_algebra_identity_source_port_only() { - use crate::dag::{PortId, SizeVariable, SymbolicCost}; - let with_label = SymbolicCost::LinearCost { - _0: SizeVariable { - source_port: PortId::test_raw(42), - display_name: Some("n".to_string()), - }, - }; - let unnamed = SymbolicCost::LinearCost { - _0: SizeVariable { - source_port: PortId::test_raw(42), - display_name: None, - }, - }; - assert_eq!( - super::symbolic_cost_to_eq_pattern(&with_label), - super::symbolic_cost_to_eq_pattern(&unnamed) - ); - } - - #[test] - fn eq_pattern_linear_distinguishes_source_ports() { - use crate::dag::{PortId, SizeVariable, SymbolicCost}; - let a = SymbolicCost::LinearCost { - _0: SizeVariable { - source_port: PortId::test_raw(1), - display_name: None, - }, - }; - let b = SymbolicCost::LinearCost { - _0: SizeVariable { - source_port: PortId::test_raw(2), - display_name: None, - }, - }; - assert_ne!( - super::symbolic_cost_to_eq_pattern(&a), - super::symbolic_cost_to_eq_pattern(&b) - ); - } -} diff --git a/src/v3/compiler/src/tokenize_generated.rs b/src/v3/compiler/src/tokenize_generated.rs deleted file mode 100644 index d6c0e57481f..00000000000 --- a/src/v3/compiler/src/tokenize_generated.rs +++ /dev/null @@ -1,364 +0,0 @@ -// AUTO-GENERATED from `src/v3/compiler/tokenize.dag` via -// `regen_tokenize`. Regenerate instead of hand-editing. - -use crate::diagnostics::{Diagnostic, SourceSpan}; - -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum ScannerCharClass { - Whitespace, - Digit, - IdentStart, - IdentContinue, -} - -#[inline] -pub fn byte_matches(byte: u8, class: ScannerCharClass) -> bool { - match class { - ScannerCharClass::Whitespace => matches!(byte, b'\t' | b'\n' | b'\x0c' | b'\r' | b' '), - ScannerCharClass::Digit => byte.is_ascii_digit(), - ScannerCharClass::IdentStart => { - byte.is_ascii_lowercase() || byte.is_ascii_uppercase() || byte == 0x5f - } - ScannerCharClass::IdentContinue => byte.is_ascii_alphanumeric() || byte == 0x5f, - } -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum TokenKind { - KwLet, - KwIf, - KwThen, - KwElse, - KwFn, - KwType, - KwModule, - KwImport, - KwMatch, - KwData, - KwWhere, - KwTrue, - KwFalse, - Ident(String), - IntLit(String), - StringLit(String), - Eq, - EqEq, - NotEq, - Lt, - Le, - Gt, - Ge, - Plus, - Minus, - Star, - Slash, - AmpAmp, - PipePipe, - Colon, - Arrow, - FatArrow, - PipeArrow, - Dot, - LParen, - RParen, - LBrace, - RBrace, - LBracket, - RBracket, - Comma, - Semicolon, - Pipe, - Question, - Caret, - Eof, -} -#[derive(Debug, Clone)] -pub struct Token { - pub kind: TokenKind, - pub span: SourceSpan, -} - -fn minus_prefixed_decimal_allowed(prev: Option<&TokenKind>) -> bool { - !matches!( - prev, - Some( - TokenKind::Ident(_) - | TokenKind::IntLit(_) - | TokenKind::StringLit(_) - | TokenKind::KwTrue - | TokenKind::KwFalse - | TokenKind::RParen - | TokenKind::RBracket - | TokenKind::RBrace - ) - ) -} - -pub fn tokenize(source: &str, file: &str) -> Result, Diagnostic> { - let bytes = source.as_bytes(); - let mut pos: usize = 0; - let mut tokens = Vec::new(); - - const LINE_COMMENT_PREFIX: &[u8] = b"//"; - while pos < bytes.len() { - let byte = bytes[pos]; - - let start = pos; - - if byte == b'-' - && bytes - .get(pos + 1) - .is_some_and(|b| byte_matches(*b, ScannerCharClass::Digit)) - && minus_prefixed_decimal_allowed(tokens.last().map(|t: &Token| &t.kind)) - { - let mut end = pos + 1; - while end < bytes.len() && byte_matches(bytes[end], ScannerCharClass::Digit) { - end += 1; - } - let literal = &source[pos + 1..end]; - let magnitude: u128 = literal.parse().map_err(|_| Diagnostic::TokenizerError { - message: format!("{}{}{}", "invalid integer literal `", literal, "`"), - span: SourceSpan::new(file, start as u32, end as u32), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "TokenizerError", - ), - })?; - const MAX_SIGNED_ABS: u128 = 1u128 << 127; - if magnitude > MAX_SIGNED_ABS { - return Err(Diagnostic::TokenizerError { - message: format!("integer literal out of range for signed decimal literal: `-{}` (|m| > 2^127)", literal), - span: SourceSpan::new(file, start as u32, end as u32), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class("TokenizerError"), - }); - } - let value = if magnitude == 0 { - "0".to_string() - } else { - format!("-{}", magnitude) - }; - tokens.push(Token { - kind: TokenKind::IntLit(value), - span: SourceSpan::new(file, start as u32, end as u32), - }); - pos = end; - continue; - } - - if byte_matches(byte, ScannerCharClass::Whitespace) { - pos += 1; - continue; - } - - if byte_matches(byte, ScannerCharClass::Digit) { - let mut end = pos; - while end < bytes.len() && byte_matches(bytes[end], ScannerCharClass::Digit) { - end += 1; - } - let literal = &source[start..end]; - let magnitude: u128 = literal.parse().map_err(|_| Diagnostic::TokenizerError { - message: format!("{}{}{}", "invalid integer literal `", literal, "`"), - span: SourceSpan::new(file, start as u32, end as u32), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "TokenizerError", - ), - })?; - let value = magnitude.to_string(); - tokens.push(Token { - kind: TokenKind::IntLit(value), - span: SourceSpan::new(file, start as u32, end as u32), - }); - pos = end; - continue; - } - - if byte_matches(byte, ScannerCharClass::IdentStart) { - let mut end = pos; - while end < bytes.len() && byte_matches(bytes[end], ScannerCharClass::IdentContinue) { - end += 1; - } - let text = &source[start..end]; - let kind = match text { - "data" => TokenKind::KwData, - "else" => TokenKind::KwElse, - "false" => TokenKind::KwFalse, - "fn" => TokenKind::KwFn, - "if" => TokenKind::KwIf, - "import" => TokenKind::KwImport, - "let" => TokenKind::KwLet, - "match" => TokenKind::KwMatch, - "module" => TokenKind::KwModule, - "then" => TokenKind::KwThen, - "true" => TokenKind::KwTrue, - "type" => TokenKind::KwType, - "where" => TokenKind::KwWhere, - _ => TokenKind::Ident(text.to_string()), - }; - tokens.push(Token { - kind, - span: SourceSpan::new(file, start as u32, end as u32), - }); - pos = end; - continue; - } - - if byte_matches(byte, ScannerCharClass::IdentContinue) { - let mut end = pos; - while end < bytes.len() && byte_matches(bytes[end], ScannerCharClass::IdentContinue) { - end += 1; - } - let text = &source[start..end]; - let kind = match text { - "data" => TokenKind::KwData, - "else" => TokenKind::KwElse, - "false" => TokenKind::KwFalse, - "fn" => TokenKind::KwFn, - "if" => TokenKind::KwIf, - "import" => TokenKind::KwImport, - "let" => TokenKind::KwLet, - "match" => TokenKind::KwMatch, - "module" => TokenKind::KwModule, - "then" => TokenKind::KwThen, - "true" => TokenKind::KwTrue, - "type" => TokenKind::KwType, - "where" => TokenKind::KwWhere, - _ => TokenKind::Ident(text.to_string()), - }; - tokens.push(Token { - kind, - span: SourceSpan::new(file, start as u32, end as u32), - }); - pos = end; - continue; - } - - // Line comment prefix from `tokenize.dag` (`line_comment_prefix`). - if bytes.len() >= pos + LINE_COMMENT_PREFIX.len() - && bytes[pos..pos + LINE_COMMENT_PREFIX.len()].eq(LINE_COMMENT_PREFIX) - { - pos += LINE_COMMENT_PREFIX.len(); - while pos < bytes.len() && bytes[pos] != b'\n' { - pos += 1; - } - continue; - } - - if let Some((kind, width)) = punctuation_token(bytes, pos) { - tokens.push(Token { - kind, - span: SourceSpan::new(file, start as u32, (start + width) as u32), - }); - pos += width; - continue; - } - - // String literal (`string_literal_delimiter` + `StringEscapeSpec` rows). - if byte == b'"' { - let mut end = pos + 1; - let mut content = String::new(); - let mut terminated = false; - while end < bytes.len() { - match bytes[end] { - b'"' => { - terminated = true; - end += 1; - break; - } - b'\\' => { - let Some(escaped) = bytes.get(end + 1).copied() else { - return Err(Diagnostic::TokenizerError { - message: "unterminated string escape".to_string(), - span: SourceSpan::new(file, start as u32, (end + 1) as u32), - correction: - crate::diagnostics::Correction::deferred_for_diagnostic_class( - "TokenizerError", - ), - }); - }; - match escaped { - b'"' => content.push(core::char::from_u32(34_u32).unwrap()), - b'\\' => content.push(core::char::from_u32(92_u32).unwrap()), - b'n' => content.push(core::char::from_u32(10_u32).unwrap()), - b'r' => content.push(core::char::from_u32(13_u32).unwrap()), - b't' => content.push(core::char::from_u32(9_u32).unwrap()), - other => { - content.push('\\'); - content.push(other as char); - } - } - end += 2; - } - other => { - content.push(other as char); - end += 1; - } - } - } - if !terminated { - return Err(Diagnostic::TokenizerError { - message: "unterminated string literal".to_string(), - span: SourceSpan::new(file, start as u32, end as u32), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "TokenizerError", - ), - }); - } - tokens.push(Token { - kind: TokenKind::StringLit(content), - span: SourceSpan::new(file, start as u32, end as u32), - }); - pos = end; - continue; - } - - return Err(Diagnostic::TokenizerError { - message: format!("unexpected byte `{}`", byte as char), - span: SourceSpan::new(file, start as u32, (start + 1) as u32), - correction: crate::diagnostics::Correction::deferred_for_diagnostic_class( - "TokenizerError", - ), - }); - } - - tokens.push(Token { - kind: TokenKind::Eof, - span: SourceSpan::new(file, bytes.len() as u32, bytes.len() as u32), - }); - Ok(tokens) -} - -fn punctuation_token(bytes: &[u8], pos: usize) -> Option<(TokenKind, usize)> { - let first = bytes[pos]; - let second = bytes.get(pos + 1).copied(); - match (first, second) { - (b'!', Some(b'=')) => Some((TokenKind::NotEq, 2)), - (b'&', Some(b'&')) => Some((TokenKind::AmpAmp, 2)), - (b'-', Some(b'>')) => Some((TokenKind::Arrow, 2)), - (b'<', Some(b'=')) => Some((TokenKind::Le, 2)), - (b'=', Some(b'=')) => Some((TokenKind::EqEq, 2)), - (b'=', Some(b'>')) => Some((TokenKind::FatArrow, 2)), - (b'>', Some(b'=')) => Some((TokenKind::Ge, 2)), - (b'|', Some(b'>')) => Some((TokenKind::PipeArrow, 2)), - (b'|', Some(b'|')) => Some((TokenKind::PipePipe, 2)), - (b'(', _) => Some((TokenKind::LParen, 1)), - (b')', _) => Some((TokenKind::RParen, 1)), - (b'*', _) => Some((TokenKind::Star, 1)), - (b'+', _) => Some((TokenKind::Plus, 1)), - (b',', _) => Some((TokenKind::Comma, 1)), - (b'-', _) => Some((TokenKind::Minus, 1)), - (b'.', _) => Some((TokenKind::Dot, 1)), - (b'/', _) => Some((TokenKind::Slash, 1)), - (b':', _) => Some((TokenKind::Colon, 1)), - (b';', _) => Some((TokenKind::Semicolon, 1)), - (b'<', _) => Some((TokenKind::Lt, 1)), - (b'=', _) => Some((TokenKind::Eq, 1)), - (b'>', _) => Some((TokenKind::Gt, 1)), - (b'?', _) => Some((TokenKind::Question, 1)), - (b'[', _) => Some((TokenKind::LBracket, 1)), - (b']', _) => Some((TokenKind::RBracket, 1)), - (b'^', _) => Some((TokenKind::Caret, 1)), - (b'{', _) => Some((TokenKind::LBrace, 1)), - (b'|', _) => Some((TokenKind::Pipe, 1)), - (b'}', _) => Some((TokenKind::RBrace, 1)), - _ => None, - } -} diff --git a/src/v3/compiler/src/types_generated.rs b/src/v3/compiler/src/types_generated.rs deleted file mode 100644 index 512643c7087..00000000000 --- a/src/v3/compiler/src/types_generated.rs +++ /dev/null @@ -1,19 +0,0 @@ -// AUTO-GENERATED from `src/v3/std/substrate.dag`. -// Regenerate instead of hand-editing. - -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -pub struct TypeShape { - pub declaration: DeclarationId, -} - -impl TypeShape { - pub fn new(declaration: DeclarationId) -> Self { - Self { declaration } - } -} - -impl From for TypeShape { - fn from(declaration: DeclarationId) -> Self { - Self { declaration } - } -} diff --git a/src/v3/compiler/src/v4_hollow_alias_gate.rs b/src/v3/compiler/src/v4_hollow_alias_gate.rs deleted file mode 100644 index 8e474e82c4c..00000000000 --- a/src/v3/compiler/src/v4_hollow_alias_gate.rs +++ /dev/null @@ -1,211 +0,0 @@ -//! T-30 — hollow-alias structural gate (bootstrap mirror). -//! -//! **Authority:** `docs/modeling-discipline.md` — **Practice 8 — Fact-bundle -//! modeling**, #### *Interim floor: the hollow-alias discriminator* (landed on -//! `main` with **#3226** / `77b9e7d72`; Practice 9 tightened with **#3234** / -//! `125fc88c8` — **diff `origin/main:docs/modeling-discipline.md` if this mirror -//! drifts**). This module is **not** the integer width/signedness worked example; -//! that is one motivating instance only (manager brief T-30 / CORE). -//! -//! **P2-staging `.dag` nominal witness:** `src/v4/std/fact_density.dag` — `SourceSpecReadFact` -//! is a **body-less nominal** (same *shape* as `Symbol` / `Hash` in `std/node.dag`): -//! not a `Nat` alias, not an unconstrained product. Per **INVARIANTS §P2** / **Practice 5**, -//! this file is **staging** until a **generated** `.dag` consumer reads it — it is **not** -//! a landed substrate primitive; this Rust module is the **interim authority** for the -//! Practice-8 hollow predicate. **Dissolution / richer `Node` payload:** same **T-30** bundle as -//! `INVARIANTS.md` §P5(b) on this path + -//! **`src/v4/DECISIONS.md`** T-30 `fact_density.dag` encoding note (generated `.dag` gate / bootstrap -//! bridge), not a separate prose-only trigger. -//! M1(2.8) rejects block-bodied `.dag` functions that walk `Node` with `match` in the -//! user declaration range (`lower.rs` — `reject_user_unparsed_scaffolds`), so the -//! gate logic is mirrored here as a **pure** harness until those bodies ship in `.dag`. -//! -//! **Practice-4 🟢/🟡 lines below:** harness-side §4 color receipts on this **P5(b)** path -//! (`INVARIANTS.md` §P5(b) names the file). The repo has **no** CI step today that blindly -//! greps these emojis across `src/v3/compiler/src/**/*.rs` as if every hit were a user `.dag` -//! coproduct tag; if such automation is added, **exclude** paths with an explicit P5(b) row so -//! interim hand-Rust mirrors are not misclassified. -//! -//! ## Interim-floor hollow predicate (three prongs + exemption) -//! -//! A declaration is **hollow** when **all three** hold on the harness projection (fail -//! closed ⇒ [`HollowAliasGateOutcome::Rejected`]), matching the numbered list in -//! `modeling-discipline.md` (~lines 389–399): -//! -//! 1. **Bare alias** (`type X = Y`) or a single-field wrapper that adds no field of its own -//! — [`HollowDeclarationSite::bare_alias_or_empty_wrapper`]. -//! 2. **External spec primitive** — a language / format / framework **spec** names the -//! subject and states facts about it — [`ModeledSubject::ExternalSpecPrimitive`]. -//! 3. **No coincidence evidence** — no `src/v4/DECISIONS.md` entry proving the alias -//! endpoints coincide, cited from the modeling file by at most a **one-line tag** -//! (Practice 9). The harness field [`HollowDeclarationSite::coincidence_evidence`] -//! is the **structural projection** of that prong for test IR (evidence present vs absent). -//! -//! **Exempt:** kernel-ambient atoms — `Bool`, `Char`, and the other **irreducible** -//! substrate atoms (`src/v4/STRUCTURE.md` §Kernel-ambient types) — are legitimately atomic. -//! [`ModeledSubject::KernelAmbientAtom`] short-circuits before the three-part `AND`. - -#![cfg_attr(not(test), allow(dead_code))] -// T-30 P5(b): no in-crate production consumer yet — `allow(dead_code)` dissolves with the -// generated `.dag` gate per `INVARIANTS.md` §P5(b) on this path. - -// Practice 4 (coproduct checkpoint, `docs/modeling-discipline.md` §4): -// 🟢 GREEN — terminal two-variant harness mirror of `std/diagnostic.dag` `Outcome` -// pass/fail tokens (`Produced` / `Rejected`); no third semantic axis at this boundary. -// Ledger: P5(b) interim Rust mirror only — the *verdict shape* stays this coproduct; a generated -// `.dag` checker does not add a third outcome variant here. -// These 🟢/🟡 lines are **harness-side §4 receipts** (dissolution + color), not a claim that -// arbitrary Rust enums are user `.dag` coproducts — scope stays the hand-built T-30 mirror. -/// Fail-closed outcome analogue to `std/diagnostic.dag`'s `Outcome` -/// success token (`Produced { value: true }` in the `.dag` spelling). -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum HollowAliasGateOutcome { - Produced, - Rejected, -} - -// Practice 4 (coproduct checkpoint, `docs/modeling-discipline.md` §4): -// 🟡 YELLOW — harness IR for Practice 8 condition (2); substrate should own this classification -// when the T-30 hollow-alias gate is generated from `.dag` / walks structural `Node`. -// scaffold: dissolve when T-30 `.dag` checker + bootstrap bridge land (`INVARIANTS.md` P5(b)). -/// Classification of **what** the declaration models for condition (2). -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum ModeledSubject { - /// Kernel-ambient atom — **exempt** from the hollow three-prong `AND` (Practice 8 interim). - /// - /// **Authoritative membership** is `src/v4/STRUCTURE.md` **Kernel-ambient types** (same - /// section the module-level doc cites). The substrate names there (`String`, `Int`, …) are - /// the spec anchor; this enum variant is **harness / test IR** only until the gate walks - /// structural `Node` — when wiring to syntax, keep the exempt set aligned with that doc, not - /// with ad hoc renames in tests. - KernelAmbientAtom, - /// Internal `std` / compiler substrate — not an external spec primitive for (2). - InternalStdCarrier, - /// External spec names a primitive with its own facts (Practice 8 (2)). - ExternalSpecPrimitive, -} - -/// One declaration site’s Practice-8 predicate inputs (structural carrier). -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub struct HollowDeclarationSite { - /// Condition (1): bare `type X = Y` or single-field wrapper that adds no own field. - pub bare_alias_or_empty_wrapper: bool, - /// Condition (2): what the declaration claims to model. - pub modeled_subject: ModeledSubject, - /// Prong (3): **true** when coincidence evidence is in scope (a `src/v4/DECISIONS.md` - /// proof of coincide, cited per Practice 9); **false** supplies the third conjunct for hollow. - pub coincidence_evidence: bool, -} - -// Practice 4 (coproduct checkpoint, `docs/modeling-discipline.md` §4): -// 🟡 YELLOW — interim harness AST discriminator (`Declaration` vs `Group`) until the Practice-8 -// gate walks structural `Node` in the substrate (same T-30 sunset as `ModeledSubject`). -// scaffold: dissolve when T-30 `.dag` checker + bootstrap bridge land (`INVARIANTS.md` P5(b)). -/// Classifier for the **minimal** tree the T-30 harness walks. -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum HollowGateKind { - /// A type/alias declaration site carrying Practice-8 inputs. - Declaration(HollowDeclarationSite), - /// Transparent grouping node (module, section) — recurse into [`HollowGateNode::children`]. - Group, -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub struct HollowGateNode { - pub kind: HollowGateKind, - pub children: Vec, -} - -/// Pure gate entry — Practice 8 structural `Node` analogue (test / harness IR). -pub fn hollow_alias_gate(root: &HollowGateNode) -> HollowAliasGateOutcome { - if hollow_alias_violation_present(root) { - HollowAliasGateOutcome::Rejected - } else { - HollowAliasGateOutcome::Produced - } -} - -fn hollow_alias_violation_present(n: &HollowGateNode) -> bool { - if let HollowGateKind::Declaration(site) = &n.kind { - if declaration_site_is_hollow(site) { - return true; - } - } - n.children.iter().any(hollow_alias_violation_present) -} - -fn declaration_site_is_hollow(site: &HollowDeclarationSite) -> bool { - if matches!(site.modeled_subject, ModeledSubject::KernelAmbientAtom) { - return false; - } - site.bare_alias_or_empty_wrapper - && matches!(site.modeled_subject, ModeledSubject::ExternalSpecPrimitive) - && !site.coincidence_evidence -} - -#[cfg(test)] -mod tests { - use super::*; - - fn decl(site: HollowDeclarationSite) -> HollowGateNode { - HollowGateNode { - kind: HollowGateKind::Declaration(site), - children: Vec::new(), - } - } - - fn group(children: Vec) -> HollowGateNode { - HollowGateNode { - kind: HollowGateKind::Group, - children, - } - } - - fn site(bare: bool, subj: ModeledSubject, evidence: bool) -> HollowDeclarationSite { - HollowDeclarationSite { - bare_alias_or_empty_wrapper: bare, - modeled_subject: subj, - coincidence_evidence: evidence, - } - } - - #[test] - fn rejects_bare_external_primitive_without_evidence() { - let hollow = decl(site(true, ModeledSubject::ExternalSpecPrimitive, false)); - assert_eq!(hollow_alias_gate(&hollow), HollowAliasGateOutcome::Rejected); - } - - #[test] - fn accepts_when_not_bare_alias() { - let ok = decl(site(false, ModeledSubject::ExternalSpecPrimitive, false)); - assert_eq!(hollow_alias_gate(&ok), HollowAliasGateOutcome::Produced); - } - - #[test] - fn accepts_bare_external_with_coincidence_evidence() { - let ok = decl(site(true, ModeledSubject::ExternalSpecPrimitive, true)); - assert_eq!(hollow_alias_gate(&ok), HollowAliasGateOutcome::Produced); - } - - #[test] - fn accepts_bare_kernel_ambient_without_evidence() { - let ok = decl(site(true, ModeledSubject::KernelAmbientAtom, false)); - assert_eq!(hollow_alias_gate(&ok), HollowAliasGateOutcome::Produced); - } - - #[test] - fn accepts_bare_internal_std_without_evidence() { - let ok = decl(site(true, ModeledSubject::InternalStdCarrier, false)); - assert_eq!(hollow_alias_gate(&ok), HollowAliasGateOutcome::Produced); - } - - #[test] - fn rejects_nested_hollow_under_group() { - let root = group(vec![decl(site( - true, - ModeledSubject::ExternalSpecPrimitive, - false, - ))]); - assert_eq!(hollow_alias_gate(&root), HollowAliasGateOutcome::Rejected); - } -} diff --git a/src/v3/compiler/src/variant_payload_generated.rs b/src/v3/compiler/src/variant_payload_generated.rs deleted file mode 100644 index 02468a8d583..00000000000 --- a/src/v3/compiler/src/variant_payload_generated.rs +++ /dev/null @@ -1,66 +0,0 @@ -// AUTO-GENERATED from `src/v3/lenses/variant_payload.dag` via -// `emit_rust_module`. Regenerate instead of hand-editing. - -#[derive(Clone, Debug)] -pub enum VariantPayloadShape { - Empty, - PositionalSingle, - NamedFields { _0: Vec }, -} -#[derive(Clone, Debug)] -pub enum VariantPayloadShapeLookup { - DeclarationMissing, - NotPayloadProduct, - Found { _0: VariantPayloadShape }, -} -pub fn conj_field_label(p0: &Field) -> String { - ((p0).label).clone() -} -pub fn conj_payload_shape(p0: &[Field]) -> VariantPayloadShape { - match p0 { - [] => VariantPayloadShape::Empty, - [__list_head, __list_tail @ ..] => match __list_tail { - [] => { - if ((__list_head).label == String::from("_0")) { - VariantPayloadShape::PositionalSingle - } else { - VariantPayloadShape::NamedFields { - _0: { - let mut __list = Vec::new(); - __list.insert(0, ((__list_head).label).clone()); - __list - }, - } - } - } - [__list_head, __list_tail @ ..] => VariantPayloadShape::NamedFields { - _0: (p0) - .iter() - .map(|__map_item| ((__map_item).label).clone()) - .collect::>(), - }, - }, - } -} -pub fn variant_payload_shape(p0: &Dag, p1: &DeclarationId) -> VariantPayloadShapeLookup { - match &((p0).declaration_opt(p1).cloned()) { - None => VariantPayloadShapeLookup::DeclarationMissing, - Some(decl) => match &((decl).connective) { - TypeConnective::Conj { children: c } => VariantPayloadShapeLookup::Found { - _0: conj_payload_shape(c), - }, - TypeConnective::Atom(_) => VariantPayloadShapeLookup::NotPayloadProduct, - TypeConnective::Disj { variants: _ } => VariantPayloadShapeLookup::NotPayloadProduct, - TypeConnective::Arrow { - inputs: _, - output: _, - body: _, - } => VariantPayloadShapeLookup::NotPayloadProduct, - TypeConnective::Cardinality(_) => VariantPayloadShapeLookup::NotPayloadProduct, - TypeConnective::Instantiation { - template: _, - arguments: _, - } => VariantPayloadShapeLookup::NotPayloadProduct, - }, - } -} diff --git a/src/v3/compiler/src/wall_clock_ratchet_manifest.rs b/src/v3/compiler/src/wall_clock_ratchet_manifest.rs deleted file mode 100644 index 230013d7191..00000000000 --- a/src/v3/compiler/src/wall_clock_ratchet_manifest.rs +++ /dev/null @@ -1,121 +0,0 @@ -//! Interim per-test wall-clock **warn-token** projection for CI (`slow_test_exemptions` -//! paydown path) — reads modeled rows in `dsl/gunbc/test_node_wall_clock_ratchet.dag` -//! instead of a checked-in JSONL side file. **Not** R3 gate **#102** closure: #102’s -//! pass target is ratchet policy from `TestNodeCostDimension` / modeled timing facts, -//! not a maintained warn-name list. - -use crate::dag::{FieldValue, LiteralBits, ValueBody}; -use crate::Dag; - -/// Repo-relative path to the modeled warn-token table (single edit surface). -pub const RATCHET_DAG_REL_PATH: &str = "dsl/gunbc/test_node_wall_clock_ratchet.dag"; - -/// One JSON object per line: `{"test":"","policy":"warn"}` — the -/// shape `scripts/check-test-timeout.sh` / `jq` already consume. -pub fn emit_warn_policy_jsonl_lines(dag: &Dag) -> Result, String> { - let decl = dag - .declaration_by_name("wall_clock_warn_libtest_tokens") - .ok_or_else(|| { - "missing `wall_clock_warn_libtest_tokens` data row in ratchet .dag".to_string() - })?; - let body = decl - .value_body - .as_ref() - .ok_or_else(|| "wall_clock_warn_libtest_tokens: no value_body".to_string())?; - let ValueBody::List(rows) = body else { - return Err(format!( - "wall_clock_warn_libtest_tokens: expected ValueBody::List, got {body:?}" - )); - }; - let mut out = Vec::with_capacity(rows.len()); - for (idx, row) in rows.iter().enumerate() { - let fields = match row { - FieldValue::Record(f) => f.as_slice(), - other => { - return Err(format!( - "row {idx}: expected record `WallClockWarnLibtestToken`, got {other:?}" - )); - } - }; - let test_val = fields - .iter() - .find(|(l, _)| l == "test") - .map(|(_, v)| v) - .ok_or_else(|| format!("row {idx}: missing `test` field"))?; - let test = match test_val { - FieldValue::Literal(LiteralBits::String(s)) => s.as_str(), - other => { - return Err(format!( - "row {idx}: `test` must be a String literal, got {other:?}" - )); - } - }; - out.push(format!( - "{{\"test\":{},\"policy\":\"warn\"}}", - json_escape_string(test) - )); - } - Ok(out) -} - -fn json_escape_string(s: &str) -> String { - let mut out = String::with_capacity(s.len() + 2); - out.push('"'); - for ch in s.chars() { - match ch { - '"' => out.push_str("\\\""), - '\\' => out.push_str("\\\\"), - '\n' => out.push_str("\\n"), - '\r' => out.push_str("\\r"), - '\t' => out.push_str("\\t"), - c if c.is_control() => { - use std::fmt::Write; - let _ = write!(&mut out, "\\u{:04x}", c as u32); - } - c => out.push(c), - } - } - out.push('"'); - out -} - -#[cfg(test)] -mod tests { - use super::*; - use crate::compile_to_dag; - use serde_json::Value; - use std::path::PathBuf; - - fn load_ratchet_dag() -> Dag { - let manifest_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - let path = manifest_dir.join("../../../dsl/gunbc/test_node_wall_clock_ratchet.dag"); - let source = std::fs::read_to_string(&path).unwrap_or_else(|e| { - panic!("read {}: {e}", path.display()); - }); - compile_to_dag(&source, path.to_string_lossy().as_ref()).unwrap_or_else(|err| { - panic!("compile {}: {err:?}", path.display()); - }) - } - - #[test] - fn ratchet_dag_warn_manifest_lines_are_parseable_warn_policy_objects() { - let dag = load_ratchet_dag(); - let lines = emit_warn_policy_jsonl_lines(&dag).expect("emit"); - for (idx, line) in lines.iter().enumerate() { - let v: Value = serde_json::from_str(line) - .unwrap_or_else(|e| panic!("line {idx} must be JSON: {e}; got {line:?}")); - let obj = v.as_object().unwrap_or_else(|| { - panic!("line {idx} must be a JSON object; got {v:?}"); - }); - assert!( - obj.get("test").and_then(Value::as_str).is_some(), - "line {idx} must have string `test`" - ); - assert_eq!( - obj.get("policy").and_then(Value::as_str), - Some("warn"), - "line {idx} must have policy=warn" - ); - } - } -} diff --git a/src/v3/compiler/tests/HANDOFF_PHASE0.md b/src/v3/compiler/tests/HANDOFF_PHASE0.md deleted file mode 100644 index 639dd159c4e..00000000000 --- a/src/v3/compiler/tests/HANDOFF_PHASE0.md +++ /dev/null @@ -1,182 +0,0 @@ -# Handoff — Phase 0: test-duration ratchet + layer taxonomy - -Phase 0 worker (`quick-crab-901`) owns measurement infrastructure and -narrow directory reorg only. Test semantics are unchanged. Deeper -migrations (m0_acceptance, m1_substrate, lens tests, thesis tests) -are explicitly out of scope and move under their own workers. - -**Scope clarification — this PR is the report-only baseline.** The -acceptance-criterion phrasing "CI fails on any test >2s" was split -across two PRs by design: -- **This PR (quick-crab-901)** lands the ratchet script, the exemption - manifest, the CI step, and the directory reorg. The CI step runs the - ratchet and publishes violations in the log, but is - `continue-on-error: true`, so main still merges with arbitrarily - slow per-test timings. This is the baseline-publication PR. -- **Follow-up PRs** made the ratchet binding and later replaced the - retired free-form `scripts/slow-test-exemptions.txt` table with the - structured JSONL bridge at `scripts/test-node-wall-clock-ratchet.jsonl`. - The bridge is still an interim side manifest until #102 projects warn - policy from modeled `TestNodeCostDimension` timing facts. - -Splitting this way keeps the Phase 0 diff narrow (measurement + org -only) and keeps the paydown decisions in a second diff with an -attached baseline to justify each entry, instead of landing an -unpopulated exemption file and a green-but-informative CI step as a -single contradiction. - -## What changed - -### 1. Per-test 2s ratchet - -- New: `scripts/check-test-timeout.sh` — parses a **pre-captured** - libtest log (path passed as `$1`), reads the `` trailer on - each `ok|FAILED` line, and exits non-zero when any single `#[test]` - exceeds the budget (default **2000 ms**, overridable via - `TEST_TIMEOUT_MS`). The existing v3 full-suite CI step now runs with - `RUSTC_BOOTSTRAP=1 cargo test -- -Z unstable-options --report-time` - and tees the output to `/tmp/v3-test-timings.log`; the ratchet step - parses that file. This keeps the CI job to a single `cargo test` - invocation — no second full-suite run that would starve later - quality gates inside the 25-minute v3 job budget. A local-fallback - mode (invoke the script with no args) does run `cargo test` itself - for users without a captured log. -- Current warn-policy bridge: `scripts/test-node-wall-clock-ratchet.jsonl` - — one JSON object per libtest token, `{"test":"","policy":"warn"}`. - Tests named there are tolerated with a `::warning::` line; every other - slow test fails the ratchet. This replaced the retired - `scripts/slow-test-exemptions.txt` table and removed the old row-count - floor. -- CI step in `.github/workflows/ci.yml` (`v3` job): `v3 tests (per-test - 2s ratchet)`. It remains `if: always()` so partial timing data is still - reported on red runs, but the ratchet is now blocking: unknown tests - above the threshold fail the step. - -**Why `RUSTC_BOOTSTRAP=1`.** libtest's `--report-time` is still -unstable on the 1.93 toolchain (tracking issue rust-lang/rust#64888); -the env var is the narrow unlock for the libtest flag. Migrate off -when the flag stabilizes or the project adopts `cargo-nextest` -(native `slow-timeout`). - -**Env-scope discipline.** The env var is inherited by every child -process of `cargo test`, including the `rustc` invocations that the -boundary tests spawn to exercise the real stable toolchain. That -would flip those child rustcs into bootstrap mode and break the -boundary-layer contract (TESTING.md § test layers). Each -`Command::new("rustc")` spawn site in the test tree therefore calls -`.env_remove("RUSTC_BOOTSTRAP")`: the shared harness in -`tests/integration/common/mod.rs::RustcHarness::compile` and the four -inline spawn sites in `tests/boundary/*`. Any **new** `rustc` spawn -site must do the same. - -### 2. Layer taxonomy - -TESTING.md § "Test layers" defines three tiers: `unit` (<5ms), -`integration` (<100ms), `boundary` (<2s). The directory under -`tests/` now mirrors that partition. - -- `tests/unit/README.md` (new) — documents the convention; empty of - `.rs` files on landing. Unit tests today still live in-crate as - `#[cfg(test)] mod tests` inside `src/v3/compiler/src/`, per - TESTING.md § "Mocks and dependency injection". -- `tests/integration/` — unchanged location; now one of three - taxonomy-named peer dirs. -- `tests/boundary/README.md` (new) — holds target-language - roundtrip tests. - -Layer-tagging convention: each test file carries a module-level -doc comment `//! **Layer:** ...`. Grep -reports the live partition: - -``` -grep -rn '\*\*Layer:\*\*' src/v3/compiler/tests/ -``` - -The **directory is the load-bearing classification**; the header is -a human-readable echo that keeps the layer visible when reading the -file on its own. - -### 3. Files moved (boundary) - -All four target-emission suites moved from `tests/integration/` into -`tests/boundary/`. Paths only — content and test names unchanged. - -| Old | New | -|---|---| -| `tests/integration/m1_3_emit_go_test.rs` | `tests/boundary/m1_3_emit_go_test.rs` | -| `tests/integration/m1_3_emit_rust_test.rs` | `tests/boundary/m1_3_emit_rust_test.rs` | -| `tests/integration/m1_4_emit_python_test.rs` | `tests/boundary/m1_4_emit_python_test.rs` | -| `tests/integration/m2_emit_multi_field_struct_variant_test.rs` | `tests/boundary/m2_emit_multi_field_struct_variant_test.rs` | - -Mirrored in: -- `tests/integration.rs` — `#[path]` entries updated. -- `tests/integration/self_gen0_census_test.rs` — census entries updated for the - Phase 0 path rename (net-zero; no new hand-authored files). Today the - hand-authored test paths live under `EXPECTED_HAND_AUTHORED_TEST`; an - inline comment in the census file explains the Phase 0 reorg. - -**Single-binary preservation.** The consolidated `tests/integration.rs` -binary still includes every file (from `integration/`, `boundary/`, -and — eventually — `unit/`) via `#[path]`. The one-bootstrap compile -amortization documented in `tests/integration.rs` holds; no new -top-level `tests/*.rs` binary was added. The directory names carry -the taxonomy; the binary carries the compile-cost amortization. - -### 4. Layer tags landed - -Representative tags added (the mechanism is extensible; not every -file was touched): - -- `tests/boundary/m1_3_emit_go_test.rs` — `Layer: boundary` -- `tests/boundary/m1_3_emit_rust_test.rs` — `Layer: boundary` -- `tests/boundary/m1_4_emit_python_test.rs` — `Layer: boundary` -- `tests/boundary/m2_emit_multi_field_struct_variant_test.rs` — `Layer: boundary` -- `tests/integration/l1_5_fixed_point_test.rs` — `Layer: integration` - (one representative; the dir is the authority) - -## Tests now failing or flaky - -**None from the reorg itself.** Confirmed: -- `cargo check -p v3-compiler --tests` clean. -- `cargo fmt --all --check` clean. -- `cargo test -p v3-compiler --test integration self_gen0_census_test::` — 6/6 pass. -- `cargo test -p v3-compiler --test integration -- m1_3_emit_go_test - m1_3_emit_rust_test m1_4_emit_python_test - m2_emit_multi_field_struct_variant_test` — 48 passed, 9 ignored, - 0 failed (unchanged vs pre-move). - -**Tests the 2s ratchet will likely flag on first CI run** (not -measured end-to-end in this worker — the full-suite pass costs -~12–20 min and yields information that belongs in the exemption -file, not in a narrow reorg diff): - -- `m1_5_testgen_test::*` — TESTING.md § "Migration audit" explicitly - flags this suite as "over-expensive; reshape or `#[ignore]`-by-default". -- `lane2_stage_2e_parallelism_test::*` — `.github/workflows/ci.yml` - line 111 calls out this suite for redoing full `compile_to_dag` - per `#[test]`. -- `determinism_test::*` — 5× re-emit matrix, release build. Wall-clock - per-test is expected to exceed 2s. -- Some `tests/boundary/*` cases — rustc cold-invocation cost. Per-file - `OnceLock` amortization already in place, but individual - `#[test]`s that compile their own harness can still exceed 2s. - -## Next steps (unclaimed) — the binding half - -1. **Shrink `scripts/test-node-wall-clock-ratchet.jsonl`.** Reuse a - CI-shaped `--report-time` log, remove any `{"policy":"warn"}` row - whose test now measures at or below 2000 ms, and record the timing - evidence in the PR. -2. **Move warn policy into modeled facts.** Gate #102 remains open until - the ratchet consumes modeled `TestNodeCostDimension` timing facts - instead of the JSONL bridge. This is the dissolution path for the - acceptance criterion "CI fails on any test >2s." -3. **Paydown (owned by sibling workers).** Each exempt test is a - migration target — either speed it up (share bootstrap via - `OnceLock`, shrink fixtures, collapse fine-grained cases), - reshape it (spot-check instead of exhaustive sweep), or - `#[ignore]`-by-default. -4. **Unit track.** When the tracked `Dag` builder surface lands - (TESTING.md § "Mocks over compile"), migrate lens / accessor - tests out of `#[cfg(test)]` mod blocks into `tests/unit/*.rs` - against the public mocking surface. diff --git a/src/v3/compiler/tests/boundary/README.md b/src/v3/compiler/tests/boundary/README.md deleted file mode 100644 index 69dad4060c6..00000000000 --- a/src/v3/compiler/tests/boundary/README.md +++ /dev/null @@ -1,38 +0,0 @@ -# tests/boundary/ - -**Layer:** boundary (TESTING.md § test layers — target-language -roundtrips; <2s target). - -Tests whose subject is an external toolchain (rustc, go, CPython). -Emitted source is fed to the real compiler/interpreter and the -output is asserted. These tests are necessarily slower than -integration tests (cold toolchain invocations cost seconds), but -each `#[test]` still aims for <2s via per-file `OnceLock` -harness caching (see `../integration/common/mod.rs::RustcHarness`). - -## Phase 0 contents - -Four target-emission suites moved here from `tests/integration/`: - -- `m1_3_emit_go_test.rs` — Go roundtrip -- `m1_3_emit_rust_test.rs` — rustc roundtrip (module + standalone) -- `m1_4_emit_python_test.rs` — CPython roundtrip -- ~~`m2_emit_multi_field_struct_variant_test.rs`~~ — dissolved F.14; see - `tests/dag/boundary_emit_gates.template.dag` (`m2-*` subcommands) - -Files are still included from the consolidated `tests/integration.rs` -binary via `#[path = "boundary/…"]` — the directory carries the -taxonomy, the binary carries the compile amortization. - -## Adding a file here - -Header: - -```rust -//! **Layer:** boundary (TESTING.md § test layers — roundtrip). -``` - -Register in `tests/integration.rs` with -`#[path = "boundary/.rs"] mod ;` and add the workspace- -relative path to `tests/integration/self_gen0_census_test.rs::EXPECTED_HAND_AUTHORED_TEST` -(boundary tests are the T-PB-B test sub-ratchet). diff --git a/src/v3/compiler/tests/boundary/l5_cross_target_consistency.rs b/src/v3/compiler/tests/boundary/l5_cross_target_consistency.rs deleted file mode 100644 index 917bf6d940b..00000000000 --- a/src/v3/compiler/tests/boundary/l5_cross_target_consistency.rs +++ /dev/null @@ -1,169 +0,0 @@ -//! **Layer:** boundary -//! -//! R3 §1.8 gate **#15** `l5_cross_target_consistency`: certification corpus with N>0 programs, each -//! exercised under `ForAllTargets` so emitted Rust, Python, and Go agree on the observed `Int` -//! stdout carve-out (`docs/r3-actual-close-plan.md` §Gap 2 close criterion). The full-suite test -//! requires `rustc`, `python3`, and `go` on `PATH` (same host contract as the prior L5 skeleton). -//! Wired through the consolidated `tests/integration.rs` harness so the gate shares one -//! bootstrap with the v3-compiler integration binary (see that file’s module docs + TESTING.md). - -use std::sync::OnceLock; - -use v3_compiler::compile_to_dag; -use v3_compiler::dag::{Dag, FieldValue, LiteralBits}; -use v3_compiler::test_runner::{ClaimResult, TestClaimValue, TestRunner}; -use v3_compiler::CompileError; - -use crate::common::run_on_larger_stack; - -const L5_FIXTURE: &str = include_str!("../fixtures/r3_verification_l5_corpus.dag"); -const L5_FIXTURE_PATH: &str = "src/v3/compiler/tests/fixtures/r3_verification_l5_corpus.dag"; -const L5_SUITE: &str = "l5_cross_target_consistency"; - -/// `(fixture declaration id, canonical TestClaim.name, authority .v3 bytes)`. -const L5_CORPUS_AUTHORITY: &[(&str, &str, &str)] = &[ - ( - "l5_cross_target_consistency_add_then", - "l5_cross_target_consistency", - include_str!("../fixtures/r3_l5_corpus/add_then_branch_seed.v3"), - ), - ( - "r3_l5_cert_branch_literal_true", - "r3_l5_cert_branch_literal_true", - include_str!("../fixtures/r3_l5_corpus/branch_literal_true_seed.v3"), - ), - ( - "r3_l5_cert_branch_literal_false", - "r3_l5_cert_branch_literal_false", - include_str!("../fixtures/r3_l5_corpus/branch_literal_false_seed.v3"), - ), - ( - "r3_l5_cert_nested_branch", - "r3_l5_cert_nested_branch", - include_str!("../fixtures/r3_l5_corpus/nested_branch_seed.v3"), - ), -]; - -static L5_DAG: OnceLock = OnceLock::new(); - -fn cached_l5_dag() -> &'static Dag { - L5_DAG.get_or_init(|| match compile_to_dag(L5_FIXTURE, L5_FIXTURE_PATH) { - Ok(dag) => { - assert!( - dag.diagnostics().is_empty(), - "{L5_FIXTURE_PATH}: expected empty module diagnostics, got {:?}", - dag.diagnostics().iter().collect::>() - ); - dag - } - Err(CompileError::Semantic(dag)) => panic!( - "{L5_FIXTURE_PATH} should lower without module diagnostics. Got `Err(Semantic)`: {:?}", - dag.diagnostics().iter().collect::>() - ), - Err(other) => panic!("unexpected compile error for {L5_FIXTURE_PATH}: {other:?}"), - }) -} - -#[test] -fn l5_certification_corpus_sources_match_authority_files() { - let dag = cached_l5_dag(); - for &(decl_name, claim_name, authority) in L5_CORPUS_AUTHORITY { - let claim_decl = dag.declaration_by_name(decl_name).unwrap_or_else(|| { - panic!("missing `{decl_name}` in {L5_FIXTURE_PATH}"); - }); - let claim = TestClaimValue::from_declaration(claim_decl).unwrap_or_else(|reason| { - panic!("`{decl_name}` should lower to a structural TestClaim: {reason}"); - }); - assert_eq!( - claim.claim_name, claim_name, - "`TestClaim.name` must match corpus table for `{decl_name}`" - ); - assert_eq!( - claim.source, authority, - "`TestClaim.source` must equal `{decl_name}` authority .v3 bytes" - ); - } -} - -#[test] -fn l5_cross_target_consistency_gate_claim_predicate_shape() { - run_on_larger_stack(|| { - let dag = cached_l5_dag(); - let claim_decl = dag - .declaration_by_name("l5_cross_target_consistency_add_then") - .expect("missing l5_cross_target_consistency_add_then"); - let claim = TestClaimValue::from_declaration(claim_decl).expect("structural TestClaim"); - assert_eq!(claim.claim_name, "l5_cross_target_consistency"); - let FieldValue::Variant { payload, .. } = &claim.predicate else { - panic!("L5 predicate must lower to a structural ForAllTargets variant"); - }; - let [FieldValue::Literal(LiteralBits::String(command)), FieldValue::List(args), FieldValue::Literal(LiteralBits::Int(expect_exit_code)), FieldValue::Reference(input_ref)] = - payload.as_slice() - else { - panic!( - "L5 ForAllTargets must carry inert command triple plus ProgramOutputBind input_ref, got {payload:?}" - ); - }; - assert_eq!(command, "true"); - assert!(args.is_empty()); - assert_eq!(expect_exit_code, "0"); - assert_eq!( - dag.declaration(*input_ref).name.as_deref(), - Some("r3_l5_gate_program_output"), - "L5 ForAllTargets must structurally select the gate ProgramOutputBind" - ); - let required_toolchains: Vec<_> = claim - .requires - .iter() - .map(|requirement| match requirement { - FieldValue::Record(fields) => match fields.as_slice() { - [(label, FieldValue::Reference(id))] if label == "target" => dag - .declaration(*id) - .name - .as_deref() - .unwrap_or("") - .to_string(), - other => panic!( - "L5 `requires` entry must be ResourceReference {{ target }}, got {other:?}" - ), - }, - other => { - panic!("L5 `requires` entry must be a ResourceReference record, got {other:?}") - } - }) - .collect(); - assert_eq!( - required_toolchains, - ["L5RustcToolchain", "L5Python3Toolchain", "L5GoToolchain"], - "L5 ForAllTargets must declare host toolchain requirements structurally on TestClaim.requires" - ); - }); -} - -#[test] -fn l5_cross_target_consistency_suite_passes_all_corpus_rows() { - run_on_larger_stack(|| { - let dag = cached_l5_dag(); - let results = TestRunner::new(dag).run_suite(L5_SUITE); - assert_eq!( - results.len(), - L5_CORPUS_AUTHORITY.len(), - "`{L5_SUITE}` should run one receipt per certification program" - ); - let expected_names: Vec<_> = L5_CORPUS_AUTHORITY - .iter() - .map(|(_, name, _)| *name) - .collect(); - let actual_names: Vec<_> = results.iter().map(|r| r.claim_name.as_str()).collect(); - assert_eq!( - actual_names, expected_names, - "suite claim order / naming drift — update L5_CORPUS_AUTHORITY (fixture is authority)" - ); - assert!( - results - .iter() - .all(|r| matches!(r.result, ClaimResult::Pass)), - "every corpus row should Pass ForAllTargets Rust/Python/Go Int parity; got {results:?}" - ); - }); -} diff --git a/src/v3/compiler/tests/boundary/m1_3_emit_go_test.rs b/src/v3/compiler/tests/boundary/m1_3_emit_go_test.rs deleted file mode 100644 index f35b5340c1b..00000000000 --- a/src/v3/compiler/tests/boundary/m1_3_emit_go_test.rs +++ /dev/null @@ -1,545 +0,0 @@ -//! **Layer:** boundary (TESTING.md § test layers — class-5 Go toolchain -//! roundtrip). - -use std::io::Write; -use std::path::PathBuf; -use std::process::{Command, Stdio}; -use std::sync::atomic::{AtomicUsize, Ordering}; - -use crate::common::cached_compile_to_dag; -use v3_compiler::compile_to_dag; -use v3_compiler::emit::{ - emit, emit_go_module_text as emit_go_module, emit_go_text as emit_go, emit_module, EmitTarget, -}; -use v3_compiler::emit_rust::emit_rust; - -static ROUNDTRIP_ID: AtomicUsize = AtomicUsize::new(0); - -fn lens_path() -> PathBuf { - PathBuf::from(env!("CARGO_MANIFEST_DIR")) - .join("..") - .join("lenses") - .join("unused_parameters.dag") -} - -fn lens_source() -> String { - std::fs::read_to_string(lens_path()).expect("read unused_parameters.dag") -} - -fn next_roundtrip_dir() -> PathBuf { - let id = ROUNDTRIP_ID.fetch_add(1, Ordering::Relaxed); - std::env::temp_dir().join(format!( - "v3_emit_go_roundtrip_{}_{}", - std::process::id(), - id - )) -} - -fn rust_stdout(source: &str) -> String { - let dag = cached_compile_to_dag(source, "parity.v3"); - let rendered = emit_rust(&dag).expect("emits rust"); - let tmp_dir = next_roundtrip_dir(); - std::fs::create_dir_all(&tmp_dir).expect("create tmp dir"); - let src_path = tmp_dir.join("main.rs"); - let bin_path = tmp_dir.join("main_bin"); - std::fs::File::create(&src_path) - .and_then(|mut f| f.write_all(rendered.as_bytes())) - .expect("write rust source"); - - let compile = Command::new("rustc") - // See common::RustcHarness::compile: strip RUSTC_BOOTSTRAP so the ratchet - // CI step's libtest unlock does not leak into child rustc invocations. - .env_remove("RUSTC_BOOTSTRAP") - .arg("--edition=2021") - .arg(&src_path) - .arg("-o") - .arg(&bin_path) - .stdout(Stdio::inherit()) - .stderr(Stdio::inherit()) - .status() - .expect("invoke rustc"); - assert!( - compile.success(), - "rustc failed on emitted source:\n{rendered}" - ); - - let run = Command::new(&bin_path).output().expect("run rust binary"); - assert!(run.status.success(), "compiled rust binary failed"); - String::from_utf8_lossy(&run.stdout).trim().to_string() -} - -fn go_stdout(source: &str) -> Option { - let go_available = Command::new("go") - .arg("version") - .stdout(Stdio::null()) - .stderr(Stdio::null()) - .status() - .ok() - .is_some_and(|status| status.success()); - if !go_available { - return None; - } - - let dag = cached_compile_to_dag(source, "parity.v3"); - let rendered = emit(&dag, EmitTarget::Go).expect("emits go").text; - let tmp_dir = next_roundtrip_dir(); - std::fs::create_dir_all(&tmp_dir).expect("create tmp dir"); - let src_path = tmp_dir.join("main.go"); - std::fs::File::create(&src_path) - .and_then(|mut f| f.write_all(rendered.as_bytes())) - .expect("write go source"); - - let run = Command::new("go") - .arg("run") - .arg(&src_path) - .current_dir(&tmp_dir) - .output() - .expect("invoke go"); - assert!( - run.status.success(), - "go run failed on emitted source:\n{}\nstdout:\n{}\nstderr:\n{}", - rendered, - String::from_utf8_lossy(&run.stdout), - String::from_utf8_lossy(&run.stderr) - ); - Some(String::from_utf8_lossy(&run.stdout).trim().to_string()) -} - -#[test] -fn emit_go_bool_logical_ops_use_spec_carriers() { - let source = "let x: Bool = true && false || true\n"; - let dag = compile_to_dag(source, "bool_logic_go.v3").expect("compiles"); - let rendered = emit(&dag, EmitTarget::Go).expect("emits go").text; - assert!( - rendered.contains("&&") && rendered.contains("||"), - "expected Go `&&` / `||` from Bool OperatorRealization rows; got:\n{rendered}" - ); -} - -// unused_parameters.dag contains recursive helpers (walk_steps etc.) that -// lower to Behavior::Loop. emit_go renders those by emitting the body DAG's -// result port, which preserves the recursive self-calls — Go supports -// recursion natively, so the emitted code is semantically correct. -#[test] -fn emit_go_lens_unused_parameters_module() { - let dag = compile_to_dag(&lens_source(), lens_path().to_string_lossy().as_ref()) - .expect("compiled lens source"); - let rendered = emit_module(&dag, EmitTarget::Go) - .expect("emits go module") - .text; - - assert!(rendered.contains("package emitted"), "got: {rendered}"); - assert!( - rendered.contains("type UnusedParameter struct"), - "got: {rendered}" - ); - assert!(rendered.contains("func check("), "got: {rendered}"); - assert!(rendered.contains("switch v := any("), "got: {rendered}"); - assert!( - !rendered.contains(".clone("), - "GC target should not render Rust clone calls: {rendered}" - ); -} - -#[test] -fn emit_go_and_rust_programs_are_behaviorally_equivalent_when_go_is_available() { - let source = "\ -fn double(x: Int) -> Int = x + x -let result: Int = if double(20) == 40 then 7 else 9 - "; - let rust = rust_stdout(source); - let Some(go) = go_stdout(source) else { - return; - }; - assert_eq!(rust, go, "Rust and Go outputs diverged"); -} - -/// E-5 / Lane 1 Stage 1c PR 2 pilot — unused match-arm payload -/// bindings are elided under `go_clean_emission.pattern_bindings = -/// EmitUnderscoreWhenUnused`. Before the pilot the Go emitter -/// rendered `case Boxed: value := v._0; return 0`, which Go rejects -/// with `value declared but not used`. After the pilot the arm -/// renders `case Boxed: return 0`, and because no arm binds through -/// `v` anymore the switch header drops `v :=` to keep `v` from -/// becoming the new unused local. -#[test] -fn emit_go_unused_payload_binding_is_elided() { - let source = "\ -type BoxedInt = Boxed(Int) | Empty -fn ignore_payload(b: BoxedInt) -> Int = match b { Boxed(value) => 0, Empty => 1 } -let zero: Int = 0 -"; - let dag = cached_compile_to_dag(source, "clean_emission.v3"); - let rendered = emit(&dag, EmitTarget::Go).expect("emits go").text; - assert!( - !rendered.contains("value := v._0"), - "expected unused payload binding to be elided, got: {rendered}" - ); - assert!( - !rendered.contains("value := v"), - "expected unused payload binding to be elided, got: {rendered}" - ); - assert!( - rendered.contains("case Boxed:"), - "expected the Boxed arm to still be present, got: {rendered}" - ); - assert!( - rendered.contains("case Empty:"), - "expected the Empty arm to still be present, got: {rendered}" - ); - assert!( - rendered.contains("switch any(") && !rendered.contains("switch v := any("), - "expected the type-switch header to drop `v :=` when no arm binds, got: {rendered}" - ); -} - -/// E-5 / Lane 1 Stage 1c PR 2 — when at least one arm consumes its -/// payload, the emitter must keep emitting `v :=` and route reads -/// through the type-switch witness. Companion regression test to -/// `emit_go_unused_payload_binding_is_elided`; proves elision is -/// keyed on port liveness per arm, not blanket suppression. -#[test] -fn emit_go_used_payload_binding_is_preserved() { - let source = "\ -type BoxedInt = Boxed(Int) | Empty -fn unwrap_or_zero(b: BoxedInt) -> Int = match b { Boxed(value) => value, Empty => 0 } -let zero: Int = 0 -"; - let dag = cached_compile_to_dag(source, "clean_emission.v3"); - let rendered = emit(&dag, EmitTarget::Go).expect("emits go").text; - assert!( - rendered.contains("case Boxed: return v._0"), - "used positional payload must still read from the type-switch witness, got: {rendered}" - ); - assert!( - rendered.contains("switch v := any("), - "expected `v :=` to remain when any arm binds, got: {rendered}" - ); -} - -#[test] -fn emit_go_named_single_field_payload_uses_the_variant_value() { - let source = "\ -type Point { x: Int y: Int } -type Wrapped = Wrap { inner: Point } | Empty -fn unwrap_or_zero(w: Wrapped) -> Int = match w { Wrap(payload) => payload.inner.x, Empty => 0 } -let zero: Int = 0 -"; - let dag = cached_compile_to_dag(source, "variant_payload_named_single.v3"); - let rendered = emit(&dag, EmitTarget::Go).expect("emits go").text; - assert!( - rendered.contains("case Wrap: return ((v).inner).x"), - "named single-field payload access must project from the variant value, got: {rendered}" - ); - assert!( - !rendered.contains("payload := v.inner"), - "named single-field payload must not rebind to the bare field value, got: {rendered}" - ); -} - -/// E-5 / Lane 1 Stage 1c PR 2 roundtrip — emitted Go with an unused -/// payload binding compiles and runs under `go run`. Proves the -/// pilot fires end-to-end against Go's unused-local compile error, -/// not just that the emission string looks right. -/// -/// Gated behind `#[ignore]` like the other `go_*` roundtrips — CI -/// sandboxes don't always carry a Go toolchain. Run locally: -/// -/// cargo test -p v3-compiler --test m1_3_emit_go_test \ -/// emit_go_unused_payload_binding_compiles \ -/// -- --ignored --nocapture -#[test] -#[ignore] -fn emit_go_unused_payload_binding_compiles() { - let source = "\ -type BoxedInt = Boxed(Int) | Empty -fn ignore_payload(b: BoxedInt) -> Int = match b { Boxed(value) => 0, Empty => 1 } -let result: Int = ignore_payload(Empty) -"; - let Some(stdout) = go_stdout(source) else { - return; - }; - assert_eq!(stdout, "1"); -} - -/// E-5 / Lane 1 Stage 1c PR 4 — emitted Go passes -/// `go_clean_emission.post_emit_verifier` as invoked through the -/// shared harness. The verifier (gofmt -l + RequireEmptyStdout) -/// enforces format-cleanliness by construction — gofmt lists -/// ill-formatted files on stdout while exiting 0, so the output -/// policy is the load-bearing verdict channel, not the exit code. -/// -/// Gated behind `#[ignore]` like the other `go_*` roundtrips — CI -/// sandboxes don't always carry a Go toolchain. Run locally: -/// -/// cargo test -p v3-compiler --test m1_3_emit_go_test \ -/// go_pilot_source_passes_post_emit_verifier_harness \ -/// -- --ignored --nocapture -#[test] -#[ignore] -fn go_pilot_source_passes_post_emit_verifier_harness() { - use v3_compiler::post_emit_verifier::{parse_post_emit_verifier, run_post_emit_verifier}; - let go_available = Command::new("gofmt") - .arg("-h") - .stdout(Stdio::null()) - .stderr(Stdio::null()) - .status() - .ok() - .is_some_and(|status| status.code().is_some()); - if !go_available { - return; - } - let source = "\ -type BoxedInt = Boxed(Int) | Empty -fn ignore_payload(b: BoxedInt) -> Int = match b { Boxed(value) => 0, Empty => 1 } -let result: Int = ignore_payload(Empty) -"; - let dag = cached_compile_to_dag(source, "go_post_emit_verifier.v3"); - let spec = dag - .go_clean_emission_spec() - .expect("go_clean_emission cached"); - let binding = parse_post_emit_verifier(&dag, spec).expect("parse contract"); - let rendered = emit(&dag, EmitTarget::Go).expect("emits go").text; - let tmp_dir = next_roundtrip_dir(); - std::fs::create_dir_all(&tmp_dir).expect("create tmp dir"); - let src_path = tmp_dir.join("main.go"); - std::fs::File::create(&src_path) - .and_then(|mut f| f.write_all(rendered.as_bytes())) - .expect("write go source"); - run_post_emit_verifier(&binding, &src_path) - .expect("go post_emit_verifier rejected pilot source — E-5 contract regression"); -} - -/// Direct receipt that a plain recursive user function lowers through -/// `Behavior::Loop` and emits correct Go. The source uses descent-provable -/// recursion (first arg decrements by 1), so it lowers to a Cardinality-bound -/// Loop. Comparing against the Rust baseline proves the body-port rendering -/// preserves the recursive self-call and produces the right result. -/// -/// Gated `#[ignore]` — CI sandboxes may not carry `go`. -/// Run locally: -/// cargo test -p v3-compiler --test integration \ -/// emit_go_recursive_fn_matches_rust_result -- --ignored --nocapture -#[test] -#[ignore] -fn emit_go_recursive_fn_matches_rust_result() { - let source = "\ -fn count(n: Int) -> Int = if n == 0 then 0 else 1 + count(n - 1) -let result: Int = count(6) -"; - // Structural: Loop node must be present in the lowered DAG. - let dag = cached_compile_to_dag(source, "recursive_loop_receipt.v3"); - let has_loop = dag - .nodes() - .iter() - .any(|b| matches!(b, v3_compiler::dag::Behavior::Loop(_))); - assert!(has_loop, "recursive fn must lower to Behavior::Loop"); - - let rust = rust_stdout(source); - let Some(go) = go_stdout(source) else { return }; - assert_eq!(rust, go, "Rust and Go diverged on recursive fn output"); - assert_eq!(rust, "6", "count(6) must output 6"); -} - -#[test] -fn emit_go_wrapper_matches_shared_entrypoint() { - let program_source = "\ -fn double(x: Int) -> Int = x + x -let result: Int = double(21) -"; - let program_dag = - compile_to_dag(program_source, "emit_go_wrapper_program_parity.v3").expect("compiles"); - let shared = emit(&program_dag, EmitTarget::Go) - .expect("shared emit") - .text; - let wrapper = emit_go(&program_dag).expect("wrapper emit"); - assert_eq!(shared, wrapper, "emit_go wrapper drifted from emit::emit"); - - let module_source = "\ -fn double(x: Int) -> Int = x + x -"; - let module_dag = - compile_to_dag(module_source, "emit_go_wrapper_module_parity.v3").expect("compiles"); - let shared_module = emit_module(&module_dag, EmitTarget::Go) - .expect("shared module emit") - .text; - let wrapper_module = emit_go_module(&module_dag).expect("wrapper module emit"); - assert_eq!( - shared_module, wrapper_module, - "emit_go_module wrapper drifted from emit::emit_module" - ); -} - -#[test] -fn emit_go_fails_closed_on_div_prelude_diverror_collision() { - let dag = compile_to_dag( - "type DivError = Bad | Worse\n\ -let x = 6 / 2", - "go_diverror_collision.v3", - ) - .expect("compiles"); - let err = emit_go(&dag).expect_err("Go emit must reject DivError prelude collision"); - assert!( - matches!(err, v3_compiler::EmitError::UnsupportedBehavior(ref message) - if message.contains("DivError")), - "expected explicit DivError collision error, got {err:?}" - ); -} - -#[test] -fn emit_go_emits_diverror_prelude_for_explicit_result_without_division() { - let dag = compile_to_dag( - "import std.error_primitives { DivError, Result }\n\ -fn passthrough(x: Result) -> Result = x\n", - "go_explicit_result_no_div.v3", - ) - .expect("compiles"); - let out = emit_module(&dag, EmitTarget::Go) - .expect("emits go module") - .text; - assert!( - out.contains("type DivError int"), - "explicit Result usage needs DivError prelude even without `/`; got: {out}" - ); -} - -#[test] -fn emit_go_emits_result_carrier_for_non_diverror_result_without_division() { - let dag = compile_to_dag( - "import std.error_primitives { Result }\n\ -fn passthrough(x: Result) -> Result = x\n", - "go_explicit_result_string_no_div.v3", - ) - .expect("compiles"); - let out = emit_module(&dag, EmitTarget::Go) - .expect("emits go module") - .text; - assert!( - out.contains("type v3Result[T any, E any] interface"), - "explicit Result usage needs the generic Go Result carrier; got: {out}" - ); - assert!( - !out.contains("type DivError int"), - "non-DivError Result usage should not emit the integer division error prelude; got: {out}" - ); -} - -#[test] -fn emit_go_emits_result_carrier_for_result_field_without_division() { - let dag = compile_to_dag( - "import std.error_primitives { Result }\n\ -type Holder { value: Result }\n", - "go_result_field_string_no_div.v3", - ) - .expect("compiles"); - let out = emit_module(&dag, EmitTarget::Go) - .expect("emits go module") - .text; - assert!( - out.contains("type v3Result[T any, E any] interface"), - "type fields using Result need the generic Go Result carrier; got: {out}" - ); - assert!( - !out.contains("type DivError int"), - "non-DivError Result fields should not emit the integer division error prelude; got: {out}" - ); -} - -#[test] -fn emit_go_emits_diverror_prelude_for_result_field_without_division() { - let dag = compile_to_dag( - "import std.error_primitives { DivError, Result }\n\ -type Holder { value: Result }\n", - "go_result_field_diverror_no_div.v3", - ) - .expect("compiles"); - let out = emit_module(&dag, EmitTarget::Go) - .expect("emits go module") - .text; - assert!( - out.contains("type v3Result[T any, E any] interface"), - "type fields using Result need the generic Go Result carrier; got: {out}" - ); - assert!( - out.contains("type DivError int"), - "type fields using Result need DivError prelude even without `/`; got: {out}" - ); -} - -#[test] -fn emit_go_checked_division_roundtrips_ok_and_errors_when_go_is_available() { - let Some(ok) = go_stdout("let x = 6 / 2\n") else { - return; - }; - assert_eq!(ok, "{3}"); - - let Some(divide_by_zero) = go_stdout("let x = 6 / 0\n") else { - return; - }; - assert_eq!(divide_by_zero, "{0}"); -} - -#[test] -fn emit_go_checked_division_prelude_maps_overflow() { - let dag = compile_to_dag("let x = 6 / 2\n", "go_div_overflow_prelude.v3").expect("compiles"); - let out = emit(&dag, EmitTarget::Go).expect("emits go program").text; - assert_eq!( - out.matches("return v3Err[int64, DivError]{Value: Overflow}") - .count(), - 1, - "Go checked-division prelude must map min-int / -1 to Overflow; got: {out}" - ); -} - -#[test] -fn emit_go_structural_diverror_signature_uses_substrate_prelude() { - let dag = compile_to_dag( - "type DivError = DivideByZero | Overflow\n\ -fn passthrough(x: DivError) -> DivError = x\n", - "go_user_diverror_signature_no_div.v3", - ) - .expect("compiles"); - let out = emit_module(&dag, EmitTarget::Go) - .expect("emits go module") - .text; - assert!( - out.contains("func v3intdiv"), - "structural DivError signatures use the substrate prelude, independent of source path; got: {out}" - ); - assert!( - out.matches("type DivError").count() == 1, - "structural DivError should materialize once through the substrate prelude; got: {out}" - ); -} - -#[test] -fn emit_go_fails_closed_on_div_prelude_helper_collision() { - let dag = compile_to_dag( - "fn v3intdiv(a: Int, b: Int) -> Int = a + b\n\ -let x = 6 / 2", - "go_div_helper_collision.v3", - ) - .expect("compiles"); - let err = emit_go(&dag).expect_err("Go emit must reject division helper collision"); - assert!( - matches!(err, v3_compiler::EmitError::UnsupportedBehavior(ref message) - if message.contains("v3intdiv")), - "expected explicit v3intdiv collision error, got {err:?}" - ); -} - -#[test] -fn emit_go_fails_closed_on_div_prelude_top_level_bind_collision() { - let dag = compile_to_dag( - "let v3intdiv = 0\n\ -let x = 6 / 2", - "go_div_helper_bind_collision.v3", - ) - .expect("compiles"); - let err = emit_go(&dag).expect_err("Go emit must reject division helper bind collision"); - assert!( - matches!(err, v3_compiler::EmitError::UnsupportedBehavior(ref message) - if message.contains("v3intdiv")), - "expected explicit v3intdiv bind collision error, got {err:?}" - ); -} diff --git a/src/v3/compiler/tests/boundary/m1_3_emit_rust_test.rs b/src/v3/compiler/tests/boundary/m1_3_emit_rust_test.rs deleted file mode 100644 index d5660dcb3bf..00000000000 --- a/src/v3/compiler/tests/boundary/m1_3_emit_rust_test.rs +++ /dev/null @@ -1,1259 +0,0 @@ -//! **Layer:** boundary (TESTING.md § test layers — class-5 rustc roundtrip). - -// M1(3) PR-B — Rust emitter acceptance tests. -// -// The success criterion the whole plan validates: -// `compile_to_dag("let x: Int = 1 + 2").and_then(emit_rust)` -// produces Rust source that, when fed to `rustc`, compiles and runs -// producing `3` on stdout. -// -// The #[ignore]d `rustc_roundtrip` tests run that whole pipeline; -// they're gated because CI environments don't always have `rustc` -// available. Run locally via the consolidated integration binary, e.g.: -// cargo test -p v3-compiler --test integration -- --ignored --nocapture -// -// Everything else is structural: assert the emitter produced the -// right substring for each kind of program without depending on -// exact formatting. - -use std::collections::HashSet; -use std::io::Write; -use std::path::PathBuf; -use std::process::{Command, Stdio}; -use std::sync::OnceLock; - -use v3_compiler::compile_to_dag; -use v3_compiler::emit::{emit as shared_emit, emit_module as shared_emit_module, EmitTarget}; -use v3_compiler::emit_rust::{emit_rust, emit_rust_module}; -use v3_compiler::r1c_e_gates; -use v3_compiler::test_runner::TestClaimValue; -use v3_compiler::types::TypeShape; - -use crate::common::determinism_fixtures::{ - ReflectedExpected, PROGRAM_FIXTURES, REFLECTED_FIXTURES, -}; -use crate::common::RustcHarness; - -static HARNESS: OnceLock = OnceLock::new(); -fn harness() -> &'static RustcHarness { - HARNESS.get_or_init(|| RustcHarness::new("emit_rust")) -} - -fn emit(source: &str) -> String { - let dag = compile_to_dag(source, "test.v3").expect("compiles"); - emit_rust(&dag).expect("emits") -} - -fn emit_module(source: &str) -> String { - let dag = compile_to_dag(source, "test.v3").expect("compiles"); - emit_rust_module(&dag).expect("emits module") -} - -/// Ratchet for `Dag::first_class_fn_walk_bootstrap_prune_type_shapes` (emit -/// `decl_includes_first_class_arrow_data` algebra short-circuit): the ordered -/// triple must match `int_shape` / `bool_shape` / `string_shape`, and the three -/// roots are distinct. Adding `float_shape()` without extending the helper -/// `-> [TypeShape; 3]` becomes a compile break first; extending the array -/// re-triggers a review of this test (PR #676, Opus). -#[test] -fn bootstrap_first_class_fn_prune_ratchets_dag_scalar_shape_getters() { - let dag = compile_to_dag("let _x: Int = 0\n", "t.v3").expect("compiles"); - let via_helper: [TypeShape; 3] = dag.first_class_fn_walk_bootstrap_prune_type_shapes(); - assert_eq!(via_helper[0], dag.int_shape().expect("Int")); - assert_eq!(via_helper[1], dag.bool_shape().expect("Bool")); - assert_eq!(via_helper[2], dag.string_shape().expect("String")); - let distinct: HashSet<_> = via_helper.iter().map(|s| s.declaration).collect(); - assert_eq!( - distinct.len(), - 3, - "Int/Bool/String bootstrap roots for first-class-`fn` walk prune must be \ - three distinct `DeclarationId`s; if this fails after adding a new primitive, \ - extend `first_class_fn_walk_bootstrap_prune_type_shapes` in the same PR" - ); -} - -fn r1_gate_claim_source(claim_name: &str) -> String { - let gate_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("tests/fixtures/r1_gates.dag"); - let gate_source = std::fs::read_to_string(&gate_path) - .unwrap_or_else(|err| panic!("read {gate_path:?}: {err}")); - let gate_dag = compile_to_dag(&gate_source, "src/v3/compiler/tests/fixtures/r1_gates.dag") - .expect("r1_gates.dag compiles"); - let claim = gate_dag - .declaration_by_name(claim_name) - .unwrap_or_else(|| panic!("claim `{claim_name}` not found")); - TestClaimValue::from_declaration(claim) - .unwrap_or_else(|reason| panic!("claim `{claim_name}` should lower structurally: {reason}")) - .source -} - -#[test] -fn emit_rust_bool_logical_ops_use_spec_carriers() { - let src = "let x: Bool = true && false || true\n"; - let out = emit(src); - assert!( - out.contains("&&") && out.contains("||"), - "expected Rust `&&` / `||` from Bool OperatorRealization rows; got:\n{out}" - ); -} - -#[test] -fn emit_rust_bool_alias_logical_ops_use_base_operator_realization() { - // Bool literals type as kernel `Bool`, so exercise `&&` / `||` on `MyBool` - // parameters (operand ports carry the alias id while spec rows key `Bool`). - let src = "\ -type MyBool = Bool -fn f(a: MyBool, b: MyBool) -> MyBool = a && b -fn g(a: MyBool, b: MyBool) -> MyBool = a || b -"; - let out = emit_module(src); - assert!( - out.contains("&&") && out.contains("||"), - "expected alias-of-Bool to reuse Bool OperatorRealization carriers; got:\n{out}" - ); -} - -#[test] -fn emit_rust_wrappers_match_shared_entrypoint() { - let program_source = "\ -fn double(x: Int) -> Int = x + x -let result: Int = double(21) -"; - let program_dag = - compile_to_dag(program_source, "emit_rust_wrapper_program_parity.v3").expect("compiles"); - let shared = shared_emit(&program_dag, EmitTarget::Rust) - .expect("shared emit") - .text; - let wrapper = emit_rust(&program_dag).expect("wrapper emit"); - assert_eq!(shared, wrapper, "emit_rust wrapper drifted from emit::emit"); - - let module_source = "\ -fn double(x: Int) -> Int = x + x -"; - let module_dag = - compile_to_dag(module_source, "emit_rust_wrapper_module_parity.v3").expect("compiles"); - let shared_module = shared_emit_module(&module_dag, EmitTarget::Rust) - .expect("shared module emit") - .text; - let wrapper_module = emit_rust_module(&module_dag).expect("wrapper module emit"); - assert_eq!( - shared_module, wrapper_module, - "emit_rust_module wrapper drifted from emit::emit_module" - ); -} - -fn roundtrip_stdout(source: &str) -> String { - let source = emit(source); - - let tmp_dir = harness().next_child_dir(); - let src_path = tmp_dir.join("main.rs"); - let bin_path = tmp_dir.join("main_bin"); - std::fs::File::create(&src_path) - .and_then(|mut f| f.write_all(source.as_bytes())) - .expect("write rust source"); - - let compile = Command::new("rustc") - // See common::RustcHarness::compile: strip RUSTC_BOOTSTRAP so the ratchet - // CI step's libtest unlock does not leak into child rustc invocations. - .env_remove("RUSTC_BOOTSTRAP") - .arg("--edition=2021") - .arg(&src_path) - .arg("-o") - .arg(&bin_path) - .stdout(Stdio::inherit()) - .stderr(Stdio::inherit()) - .status() - .expect("invoke rustc — install a rust toolchain to run this test"); - assert!( - compile.success(), - "rustc failed on emitted source:\n{source}" - ); - - let run = Command::new(&bin_path) - .output() - .expect("run compiled binary"); - assert!(run.status.success(), "compiled binary failed"); - String::from_utf8_lossy(&run.stdout).trim().to_string() -} - -/// Batched program fixture harness (shared with R1C-E `r1c_e_emit_gates`). -fn run_program(name: &str) -> String { - r1c_e_gates::run_rust_program_fixture(name) -} - -fn program_expected(name: &str) -> &'static str { - PROGRAM_FIXTURES - .iter() - .find(|f| f.name == name) - .unwrap_or_else(|| panic!("no PROGRAM_FIXTURES entry for {name:?}")) - .expected_stdout -} - -/// Batched reflected-module fixture harness (shared with R1C-E `r1c_e_emit_gates`). -fn run_reflected(name: &str) -> String { - r1c_e_gates::run_rust_reflected_fixture(name) -} - -fn reflected_expected(name: &str) -> &'static ReflectedExpected { - &REFLECTED_FIXTURES - .iter() - .find(|f| f.module.name == name) - .unwrap_or_else(|| panic!("no REFLECTED_FIXTURES entry for {name:?}")) - .expected_stdout -} - -#[test] -fn emit_rust_single_int_binding() { - let out = emit("let x: Int = 42"); - assert!(out.contains("let x: i64 = 42;"), "got: {out}"); - assert!(out.contains("fn main()"), "got: {out}"); - assert!(out.contains("println!(\"{}\", x)"), "got: {out}"); -} - -/// R3 gate #67 / T-Numeric-Construction — `numeric_construction_demonstration`: -/// construction syntax `Int<32>` + `Real<64>` (lowers to anonymous `Compose<…, MachineWidth<…>>`) -/// so the fixture exercises gate-#60 parse/lower + emit structural carrier resolution, not only -/// named `Int32`/`Real64` aliases. Integer `0` seeds `Real<64>` while float lexemes are absent -/// (`int_literal_allowed_integral_seed_for_real_decl`). -const NUMERIC_CONSTRUCTION_DEMONSTRATION_V3: &str = "\ -import std.integer { Int } -import std.float { Real } - -let i: Int<32> = 42 -let _r: Real<64> = 0 -let out: Int<32> = i -"; - -#[test] -fn numeric_construction_demonstration_emit_uses_i32_and_f64_gate_67() { - let out = emit(NUMERIC_CONSTRUCTION_DEMONSTRATION_V3); - assert!( - out.contains("i32") && out.contains("f64"), - "expected Rust `i32` + `f64` for Int<32> + Real<64>; got:\n{out}", - ); - assert!( - out.contains("42"), - "expected emitted Rust to retain int literal 42; got:\n{out}", - ); -} - -#[test] -fn numeric_construction_demonstration_rustc_roundtrip_executes_gate_67() { - assert_eq!( - roundtrip_stdout(NUMERIC_CONSTRUCTION_DEMONSTRATION_V3), - "42", - "gate #67 end-to-end program should print widened int witness on stdout", - ); -} - -#[test] -fn emit_rust_result_top_level_binding_prints_debug_string() { - let out = emit( - "import std.error_primitives { DivError, Result }\n\ -let x: Result = 6 / 2", - ); - assert!( - out.contains("let x: ::core::result::Result = (__v3_int_div(6, 2));"), - "top-level division should lower to the typed Result carrier; got: {out}" - ); - assert!( - out.contains("println!(\"{}\", format!(\"{:?}\", x))"), - "top-level Result should be converted to a displayable debug string before printing; got: {out}" - ); -} - -#[test] -fn emit_rust_result_alias_top_level_binding_prints_debug_string() { - let out = emit( - "import std.error_primitives { DivError, Result }\n\ -type R = Result\n\ -let x: R = 6 / 2", - ); - assert!( - out.contains("println!(\"{}\", format!(\"{:?}\", x))"), - "top-level Result aliases should use the structural Result fact, not rendered type text; got: {out}" - ); -} - -#[test] -fn emit_rust_checked_division_roundtrips_ok_and_errors() { - assert_eq!(roundtrip_stdout("let x = 6 / 2\n"), "Ok(3)"); - assert_eq!(roundtrip_stdout("let x = 6 / 0\n"), "Err(DivideByZero)"); -} - -#[test] -fn emit_rust_checked_division_prelude_maps_overflow() { - let out = emit("let x = 6 / 2\n"); - assert_eq!( - out.matches("return ::core::result::Result::Err(DivError::Overflow);") - .count(), - 1, - "Rust checked-division prelude must map i64::MIN / -1 to Overflow; got: {out}" - ); -} - -#[test] -fn emit_rust_emits_diverror_prelude_for_explicit_result_without_division() { - let out = emit_module( - "import std.error_primitives { DivError, Result }\n\ -fn passthrough(x: Result) -> Result = x\n", - ); - assert!( - out.contains("pub enum DivError"), - "explicit Result usage needs DivError prelude even without `/`; got: {out}" - ); -} - -#[test] -fn emit_rust_emits_diverror_prelude_for_result_field_without_division() { - let out = emit_module( - "import std.error_primitives { DivError, Result }\n\ -type Holder { value: Result }\n", - ); - assert!( - out.contains("pub enum DivError"), - "type fields using Result need DivError prelude even without `/`; got: {out}" - ); - assert!( - out.contains("pub value: ::core::result::Result"), - "type field should render through the Result carrier; got: {out}" - ); -} - -#[test] -fn emit_rust_omits_div_prelude_without_division() { - let out = emit( - "type DivError = Bad | Worse\n\ -let x: Int = 42", - ); - assert!( - !out.contains("__v3_int_div"), - "division helper should only emit when integer division is used; got: {out}" - ); - assert!( - out.matches("pub enum DivError").count() == 1, - "user DivError should not collide with an unused division prelude; got: {out}" - ); -} - -#[test] -fn emit_rust_structural_diverror_signature_uses_substrate_prelude() { - let out = emit_module( - "type DivError = DivideByZero | Overflow\n\ -fn passthrough(x: DivError) -> DivError = x\n", - ); - assert!( - out.contains("__v3_int_div"), - "structural DivError signatures use the substrate prelude, independent of source path; got: {out}" - ); - assert!( - out.matches("pub enum DivError").count() == 1, - "structural DivError should materialize once through the substrate prelude; got: {out}" - ); -} - -#[test] -fn emit_rust_fails_closed_on_div_prelude_diverror_collision() { - let dag = compile_to_dag( - "type DivError = Bad | Worse\n\ -let x = 6 / 2", - "test.v3", - ) - .expect("compiles"); - let err = emit_rust(&dag).expect_err("Rust emit must reject DivError prelude collision"); - assert!( - matches!(err, v3_compiler::emit_rust::EmitError::UnsupportedBehavior(ref message) - if message.contains("DivError")), - "expected explicit DivError collision error, got {err:?}" - ); -} - -#[test] -fn emit_rust_fails_closed_on_div_prelude_helper_collision() { - let dag = compile_to_dag( - "fn __v3_int_div(a: Int, b: Int) -> Int = a + b\n\ -let x = 6 / 2", - "rust_div_helper_collision.v3", - ) - .expect("compiles"); - let err = emit_rust(&dag).expect_err("Rust emit must reject division helper collision"); - assert!( - matches!(err, v3_compiler::emit_rust::EmitError::UnsupportedBehavior(ref message) - if message.contains("__v3_int_div")), - "expected explicit __v3_int_div collision error, got {err:?}" - ); -} - -#[test] -fn emit_rust_fails_closed_on_div_prelude_top_level_bind_collision() { - let dag = compile_to_dag( - "let __v3_int_div = 0\n\ -let x = 6 / 2", - "rust_div_helper_bind_collision.v3", - ) - .expect("compiles"); - let err = emit_rust(&dag).expect_err("Rust emit must reject division helper bind collision"); - assert!( - matches!(err, v3_compiler::emit_rust::EmitError::UnsupportedBehavior(ref message) - if message.contains("__v3_int_div")), - "expected explicit __v3_int_div bind collision error, got {err:?}" - ); -} - -/// T-Emit / PR #650 receipt: first-class `fn(A) -> B` in **user function -/// parameter** position must lower to `impl Fn(A) -> B + Clone`, not -/// `&impl Fn…` (review #676). Other positions use `std::rc::Rc`; -/// see `emit_callable_field_types_use_rc_dyn_fn_storage`. Post-mortem: -/// `docs/postmortems/pr-650-emitter-callable-clone-bound.md`. -#[test] -fn emit_generic_bounds_survive() { - // Single source of truth: `r1c_e_gates::check_generic_bounds_survive` is also - // the body of the `r1c_e_emit_gates generic-bounds` subcommand invoked by the - // matching `.dag` `TestClaim` wrapper (`tests/dag/r1c_e_emit_gates.template.dag`, - // R1C-E). Do not duplicate the assertion here. - if let Err(detail) = v3_compiler::r1c_e_gates::check_generic_bounds_survive() { - panic!("emit_generic_bounds_survive: {detail}"); - } -} - -/// Codex #676 / INVARIANTS P3: callable param `impl Fn + Clone` does not compose -/// with `Rc` return — when the return carries first-class `fn`, the -/// parameter must use the same `Rc` carrier so `return f` is rustc-valid. -#[test] -fn emit_callable_fn_identity_unifies_param_and_return_carriers() { - let src = "fn id_fn(f: fn(Int) -> Int) -> fn(Int) -> Int = f\n"; - let out = emit_module(src); - let ty = "std::rc::Rc i64>"; - let sig = format!("fn id_fn(p0: {ty}) -> {ty}"); - assert!( - out.contains(&sig), - "param and return must both use Rc carrier for pass-through; got:\n{out}" - ); - assert!( - !out.contains("impl Fn(i64) -> i64 + Clone"), - "impl Fn+Clone param must not pair with Rc return; got:\n{out}" - ); -} - -/// Review #676: `impl Trait` is not valid in struct fields — storage carrier required. -#[test] -fn emit_callable_field_types_use_rc_dyn_fn_storage() { - let src = "type Callback { handler: fn(Int) -> Int }\n"; - let out = emit_module(src); - assert!( - out.contains("#[derive(Clone)]\npub struct Callback"), - "Rc is not Debug — struct must use clone-only derive; got:\n{out}" - ); - assert!( - !out.contains("#[derive(Clone, Debug)]\npub struct Callback"), - "Debug derive is invalid with dyn Fn field; got:\n{out}" - ); - assert!( - out.contains("handler: std::rc::Rc i64>"), - "expected `std::rc::Rc` in struct field, not `impl Fn`; got:\n{out}" - ); - assert!( - !out.contains("impl Fn(i64) -> i64 + Clone"), - "struct field must not use parameter-only impl Fn+Clone surface; got:\n{out}" - ); -} - -/// #676 / api-review: a named `type F = fn(...) -> _` used as a struct field type -/// must not render as a bare `F` — the emitter does not emit a Rust `type F = …` -/// for that alias, so the storage carrier must expand to `Rc`. -#[test] -fn emit_callable_field_types_expand_named_fn_type_alias() { - let src = "type F = fn(Int) -> Int\ntype Holder { handler: F }\n"; - let out = emit_module(src); - assert!( - out.contains("handler: std::rc::Rc i64>"), - "field through named first-class `fn` alias should use Rc, not a bare id; got:\n{out}" - ); - assert!( - !out.contains("handler: F"), - "struct field must not reference undefined Rust type for fn alias; got:\n{out}" - ); -} - -/// #676: chained alias `G = F`, `F = fn...` must peel to the same `Rc` -/// carrier, not a bare `G` (P3 fail-closed). -#[test] -fn emit_callable_field_types_expand_chained_fn_type_alias() { - let src = "type F = fn(Int) -> Int\ntype G = F\ntype Holder { handler: G }\n"; - let out = emit_module(src); - assert!( - out.contains("handler: std::rc::Rc i64>"), - "chained field through G→F→fn should use Rc, not a bare id; got:\n{out}" - ); - assert!( - !out.contains("handler: G"), - "struct field must not use undefined type G when G chains to first-class fn; got:\n{out}" - ); -} - -/// #676 (codex): a named record that only *contains* callable storage (`Callback`) -/// must still be spellable as `Callback` when nested in another struct field -/// (`Wrapper { cb: Callback }`) — P2 name authority, not re-expanded as a fn alias. -#[test] -fn emit_callable_nested_named_record_field_uses_type_name() { - let src = "type Callback { handler: fn(Int) -> Int }\n\ -type Wrapper { cb: Callback }\n"; - let out = emit_module(src); - assert!( - out.contains("pub struct Callback") - && out.contains("pub struct Wrapper") - && out.contains("cb: Callback"), - "Wrapper must reference `Callback` by name; got:\n{out}" - ); -} - -/// #676: a user `struct` that **contains** a first-class `fn` (via a type alias) -/// must still lower the **name** in non-field positions (`fn` params), not -/// `MissingTypeRealization` (claude review, follow-up to `decl_includes` in -/// `rust_type_name_for_decl_with_policy`). -#[test] -fn emit_callable_struct_with_fn_field_names_ok_in_param_slot() { - let src = "type F = fn(Int) -> Int\n\ -type Holder { h: F }\n\ -fn use_holder(x: Holder) -> Int = 0\n"; - let out = emit_module(src); - assert!( - out.contains("use_holder(") && out.contains("Holder"), - "param slot should use `Holder` when the struct is emitted; got:\n{out}" - ); -} - -/// #676: a named **alias to** `List` does not peel to a top-level -/// `Arrow`, but the emit path must still expand to `Vec>`, not an -/// undefined local alias name (C-8). -#[test] -fn emit_callable_field_types_expand_list_fn_named_alias() { - let src = "type L = List Int>\n\ -type Holders { callbacks: L }\n"; - let out = emit_module(src); - assert!( - out.contains("callbacks: Vec i64>>"), - "L = List on a struct field should expand; got:\n{out}" - ); - assert!( - !out.contains("callbacks: L") && !out.contains("callbacks: Vec"), - "must not print bare L / Vec when L aliases List; got:\n{out}" - ); -} - -/// Review #676: nested / generic positions (`Vec<…>`) cannot use `impl Fn`. -#[test] -fn emit_callable_list_element_types_use_rc_dyn_fn_in_vec() { - let src = "type Holders { callbacks: List Int> }\n"; - let out = emit_module(src); - assert!( - out.contains("#[derive(Clone)]\npub struct Holders"), - "Vec> is not Debug — struct must use clone-only derive; got:\n{out}" - ); - assert!( - !out.contains("#[derive(Clone, Debug)]\npub struct Holders"), - "Debug derive is invalid with Vec> field; got:\n{out}" - ); - assert!( - out.contains("callbacks: Vec i64>>"), - "expected Vec> for List; got:\n{out}" - ); - assert!( - !out.contains("Vec 0 then 10 else 20"); - assert!(out.contains("if (1 > 0) {"), "got: {out}"); - assert!(out.contains("} else {"), "got: {out}"); - assert!(out.contains("10"), "got: {out}"); - assert!(out.contains("20"), "got: {out}"); -} - -#[test] -fn emit_rust_emits_user_enum_type_definitions() { - let out = emit( - "type Sign = Plus | Minus -let zero: Int = 0", - ); - assert!(out.contains("pub enum Sign {"), "got: {out}"); - assert!(out.contains("Plus,"), "got: {out}"); - assert!(out.contains("Minus,"), "got: {out}"); -} - -#[test] -fn emit_rust_match_on_user_sum_uses_match_expression() { - let out = emit( - "type Sign = Plus | Minus -fn classify(s: Sign) -> Int = match s { Plus => 0, Minus => 1 } -let zero: Int = 0", - ); - assert!(out.contains("pub enum Sign {"), "got: {out}"); - assert!( - out.contains("fn classify(p0: &Sign) -> i64 { match p0 {"), - "got: {out}" - ); - assert!(out.contains("Sign::Plus => 0,"), "got: {out}"); - assert!(out.contains("Sign::Minus => 1,"), "got: {out}"); -} - -#[test] -fn emit_rust_module_match_on_imported_workflow_effect_sum() { - let src = "\ -module emit_match_workflow_effect_smoke -import std.effects { WorkflowEffect } -import std.list { length } -fn classify_wf(w: WorkflowEffect) -> Int = match w { - LinearEffect { ops: ops } => length(ops) - BranchEffect { arms: arms } => 1 - LoopEffect { body: body } => 2 - ParallelEffect { branches: branches } => 3 -} -"; - let out = emit_module(src); - assert!( - out.contains("fn classify_wf") && out.contains("WorkflowEffect::LinearEffect"), - "expected emitted lens-style module to lower `match` on imported \ - user-defined `WorkflowEffect` with qualified enum patterns; got:\n{out}" - ); -} - -#[test] -fn emit_rust_payload_match_uses_struct_variant_pattern() { - let out = emit( - "type BoxedInt = Boxed(Int) | Empty -fn unwrap_or_zero(b: BoxedInt) -> Int = match b { Boxed(value) => value, Empty => 0 } -let zero: Int = 0", - ); - assert!(out.contains("pub enum BoxedInt {"), "got: {out}"); - assert!(out.contains("Boxed { _0: i64, },"), "got: {out}"); - assert!( - out.contains("fn unwrap_or_zero(p0: &BoxedInt) -> i64 { match p0 {"), - "got: {out}" - ); - assert!( - out.contains("BoxedInt::Boxed { _0: value } => (*(value)),"), - "got: {out}" - ); - assert!(out.contains("BoxedInt::Empty => 0,"), "got: {out}"); -} - -/// Day-1 T-Sub receipt gate for `sub_match_over_user_sum`. -/// -/// Audit result: the first-class implementation path already exists on `main`. -/// The parser accepts source-local `type Choice = ...` sums, lowering carries -/// them as `Disj` + `Branch`, inference resolves arm patterns, and Rust emit -/// renders the general enum-pattern `match` path. The surrounding tests already -/// cover string-level Rust receipts for no-payload sums, payload sums, and -/// imported sums. -/// -/// This gate intentionally adds no implementation. Its narrower job is to keep -/// the named R1/T-Sub surface live as an unignored, end-to-end pipeline receipt: -/// parse -> lower -> infer -> Rust emit -> rustc link -> runtime execution. -#[test] -fn sub_match_over_user_sum_links_and_runs() { - let source = r1_gate_claim_source("sub_match_over_user_sum"); - assert_eq!(roundtrip_stdout(&source), "true"); -} - -#[test] -fn emit_rust_named_single_field_payload_routes_field_access_through_binding() { - let out = emit( - "type Point { x: Int y: Int } -type Wrapped = Wrap { inner: Point } | Empty -fn unwrap_or_zero(w: Wrapped) -> Int = match w { Wrap(payload) => payload.inner.x, Empty => 0 } -let zero: Int = 0", - ); - assert!( - out.contains("Wrapped::Wrap { inner: payload } => (payload).x,"), - "expected named single-field payload access to route through the bound field, got: {out}" - ); - assert!( - !out.contains("(payload).inner"), - "named single-field payload access must not project through a synthetic whole-payload binding, got: {out}" - ); -} - -/// E-5 / Lane 1 Stage 1c pilot — unused match-arm payload bindings -/// render as `_` under `rust_clean_emission.pattern_bindings = -/// EmitUnderscoreWhenUnused`. Before the pilot the emitter rendered -/// `Boxed { _0: value } => 0`, which fired `unused_variables` under -/// `rustc -D warnings`; after the pilot it renders `Boxed { _0: _ } -/// => 0`, which passes the invariant by construction. -#[test] -fn emit_rust_unused_payload_binding_renders_as_underscore() { - let out = emit( - "type BoxedInt = Boxed(Int) | Empty -fn ignore_payload(b: BoxedInt) -> Int = match b { Boxed(value) => 0, Empty => 1 } -let zero: Int = 0", - ); - assert!( - out.contains("BoxedInt::Boxed { _0: _ } => 0,"), - "expected unused payload to render as `_`, got: {out}" - ); - assert!( - !out.contains("BoxedInt::Boxed { _0: value }"), - "unused binding leaked the identifier name, got: {out}" - ); - assert!(out.contains("BoxedInt::Empty => 1,"), "got: {out}"); -} - -/// Multi-field payloads still need a full variant pattern for type -/// shape, but an unused whole-payload binding must not be rendered -/// as `_ @ Variant { ... }` because Rust only permits identifiers on -/// the left side of `@`. -#[test] -fn emit_rust_unused_multi_field_payload_binding_avoids_wildcard_alias() { - let out = emit( - "type IntList = Empty | Cons { head: Int, tail: IntList } -fn ignore_payload(list: IntList) -> Int = match list { Empty => 0, Cons(payload) => 1 } -let zero: Int = 0", - ); - assert!( - out.contains("IntList::Cons { head: _, tail: _ } => 1,"), - "expected unused multi-field payload to render as a plain variant pattern, got: {out}" - ); - assert!( - !out.contains("_ @ IntList::Cons"), - "unused multi-field payload rendered an invalid wildcard alias, got: {out}" - ); -} - -/// E-5 / Lane 1 Stage 1c pilot (rustc roundtrip) — emitted code with -/// an unused match-arm payload binding passes `rustc -D -/// unused_variables`. Proves the rule fires end-to-end, not just -/// that the emission string looks right. -/// -/// Gated behind `#[ignore]` for the same reason as the other -/// `rustc_roundtrip_*` tests — CI sandboxes don't always carry a -/// toolchain. Run locally: -/// -/// cargo test -p v3-compiler --test integration \ -/// emit_rust_unused_payload_binding_passes_deny_unused \ -/// -- --ignored --nocapture -/// E-5 / Lane 1 Stage 1c PR 4 — the pilot Rust source passes -/// `rust_clean_emission.post_emit_verifier` as invoked through the -/// shared harness. The harness reads command / args / syntax_only / -/// expected_exit_code / output_policy from the contract; the test -/// does not hardcode `rustc -D warnings`. Adding a verifier flag -/// (e.g. `--edition=2024`) means editing `spec/rust.dag` — the -/// harness picks it up automatically. -/// -/// Gated behind `#[ignore]` like `emit_rust_unused_payload_binding_passes_deny_unused` -/// above — CI sandboxes don't always carry rustc. Run locally: -/// -/// cargo test -p v3-compiler --test integration \ -/// rust_pilot_source_passes_post_emit_verifier_harness \ -/// -- --ignored --nocapture -#[test] -#[ignore] -fn rust_pilot_source_passes_post_emit_verifier_harness() { - use v3_compiler::post_emit_verifier::{parse_post_emit_verifier, run_post_emit_verifier}; - // `ignore_payload` has to be called so rustc's dead_code - // (implied by -D warnings) does not fire on it. The pilot rule - // under test is `pattern_bindings = EmitUnderscoreWhenUnused` - // — the unused `value` inside the match arm; the let-binding - // below wires the fn into `main` so the rest of the emitted - // module stays warning-clean. - let source = "type BoxedInt = Boxed(Int) | Empty -fn ignore_payload(b: BoxedInt) -> Int = match b { Boxed(value) => 0, Empty => 1 } -let result: Int = ignore_payload(Empty)"; - let dag = - v3_compiler::compile_to_dag(source, "rust_post_emit_verifier.v3").expect("source compiles"); - let spec = dag - .rust_clean_emission_spec() - .expect("rust_clean_emission cached"); - let binding = parse_post_emit_verifier(&dag, spec).expect("parse contract"); - let rendered = v3_compiler::emit_rust::emit_rust(&dag).expect("emits rust"); - let tmp_dir = harness().next_child_dir(); - let src_path = tmp_dir.join("main.rs"); - std::fs::File::create(&src_path) - .and_then(|mut f| f.write_all(rendered.as_bytes())) - .expect("write rust source"); - run_post_emit_verifier(&binding, &src_path) - .expect("rust post_emit_verifier rejected pilot source — E-5 contract regression"); -} - -#[test] -#[ignore] -fn emit_rust_unused_payload_binding_passes_deny_unused() { - let source = emit( - "type BoxedInt = Boxed(Int) | Empty -fn ignore_payload(b: BoxedInt) -> Int = match b { Boxed(value) => 0, Empty => 1 } -let zero: Int = 0", - ); - let wrapped = format!("#![deny(unused_variables)]\n{source}"); - let tmp_dir = harness().next_child_dir(); - let src_path = tmp_dir.join("main.rs"); - let bin_path = tmp_dir.join("deny_unused_bin"); - std::fs::File::create(&src_path) - .and_then(|mut f| f.write_all(wrapped.as_bytes())) - .expect("write rust source"); - let status = Command::new("rustc") - // See common::RustcHarness::compile: strip RUSTC_BOOTSTRAP so the ratchet - // CI step's libtest unlock does not leak into child rustc invocations. - .env_remove("RUSTC_BOOTSTRAP") - .arg("--edition=2021") - .arg(&src_path) - .arg("-o") - .arg(&bin_path) - .stdout(Stdio::inherit()) - .stderr(Stdio::inherit()) - .status() - .expect("invoke rustc"); - assert!( - status.success(), - "emitted code tripped #[deny(unused_variables)] — E-5 pilot regression" - ); -} - -#[test] -fn emit_rust_record_literal_uses_value_construction_syntax() { - let out = emit( - "type Point { x: Int y: Int } -let p: Point = { x: 1, y: 2 }", - ); - assert!(out.contains("pub struct Point {"), "got: {out}"); - assert!( - out.contains("let p: Point = Point { x: 1, y: 2 };"), - "got: {out}" - ); -} - -#[test] -fn emit_rust_multi_bind_uses_last_as_print_target() { - let out = emit( - "let a: Int = 1 -let b: Int = a + 2", - ); - assert!(out.contains("let a: i64 = 1;"), "got: {out}"); - assert!(out.contains("let b: i64 = (a + 2);"), "got: {out}"); - // Main wrap prints the LAST bind (`b`), not the first (`a`). - assert!(out.contains("println!(\"{}\", b)"), "got: {out}"); -} - -#[test] -fn emit_rust_pairwise_independent_multi_bind_uses_thread_scope() { - let out = emit( - "let a: Int = 1 + 2 -let b: Int = 3 + 4", - ); - assert!( - out.contains("thread::scope"), - "expected parallel schedule for pairwise-independent binds; got:\n{out}" - ); - assert!( - out.contains("let (a, b):") && out.contains("(i64, i64)"), - "expected destructuring tuple bind for parallel batch; got:\n{out}" - ); -} - -#[test] -fn emit_rust_preserves_rust_dag_is_the_only_rust_syntax_source() { - // Structural check: the carrier strings the emitter produced - // match what rust.dag declared — not some hardcoded Rust-side - // string. This is the thesis guarantee: "add a new emission - // target = one spec-file edit." If the emitter were - // fabricating Rust syntax in Rust code, the test below would - // still pass trivially, but ANY attempt to change the carrier - // in rust.dag (e.g. editing `"i64"` to `"int64_t"`) would fail - // to propagate — the substring check here guards against that - // class of regression. - let out = emit("let x: Int = 1 + 2"); - // Every token the emitter rendered for this program traces to - // a rust.dag carrier: "let %N: %T = %V;" (rust_let_stmt), - // "i64" (rust_int), "+" (rust_int_add), and the main wrapper. - assert!(out.contains("let x: i64 = (1 + 2);")); -} - -/// **PR-B-unwind regression test.** The emitter must NOT contain -/// any Rust string literal that names a substrate concept (the -/// canonical primitive name "Int", behavior names "Bind"/"Branch"/ -/// "Main", etc.) in dispatch position. This test scans the -/// emitter source file (excluding comment lines) and asserts the -/// absence of the specific patterns that the unwind fixed. -/// -/// **Why this is a runtime test instead of a static lint.** The -/// emitter file is loaded with `include_str!` so the assertion -/// runs at test time. Rust's macro hygiene doesn't give us a -/// proper compile-time grep, so we accept the runtime cost — the -/// test runs in <1ms. -/// -/// **Comment-line filtering.** Lines whose first non-whitespace -/// content is `//` are excluded. The unwind's documentation talks -/// about the bad pattern explicitly (so future readers understand -/// what was removed) and those mentions must not trip the check. -/// This is a coarse heuristic — it doesn't handle block comments -/// or strings-on-comment-lines — but it's sufficient for the -/// emit_rust.rs file as written. -/// -/// If anyone re-introduces a `.lookup("Int", ...)` or similar -/// dispatch, this test fails and the reviewer sees the -/// reintroduction immediately. The failure message points at the -/// rust.dag typed-reference shape that should be used instead. -#[test] -fn emit_rust_has_no_substrate_name_string_dispatches() { - const EMITTER_SOURCE: &str = include_str!("../../src/emit_rust.rs"); - - // Strip comment-only lines (// ... and ///-style doc comments) - // before scanning for forbidden patterns. This avoids false - // positives on the file's documentation, which describes the - // bad pattern explicitly so future readers know what was - // removed. - let code_only: String = EMITTER_SOURCE - .lines() - .filter(|line| !line.trim_start().starts_with("//")) - .collect::>() - .join("\n"); - - // Each forbidden substring is a Rust string literal naming a - // substrate concept. The check is "does the emitter code - // contain a string literal of this exact form in non-comment - // position?" — using the double-quote framing makes it a - // literal search, not a bare-name search (so identifier - // mentions in doc strings don't trip the check). - let forbidden = [ - "\"Int\"", - "\"Bool\"", - "\"List\"", - "\"String\"", - "\"Bind\"", - "\"Branch\"", - "\"Main\"", - "\"True\"", - "\"False\"", - "\"target_name\"", - "\"op_name\"", - ]; - for pattern in forbidden { - assert!( - !code_only.contains(pattern), - "emit_rust.rs must not contain the string literal {pattern} in non-comment position — that would be a name-string dispatch on a substrate concept. The PR-B unwind moved every such lookup to typed declaration ids resolved via dag.{{bind_marker, branch_marker, main_marker, ...}}() and dag.declaration_by_name() at index-build time only. If you reintroduced one, see src/v3/spec/rust.dag for the typed pattern: `data rust_int: TypeRealization = {{ target: Int, ... }}` instead of `target_name: {pattern}`." - ); - } -} - -/// **Layer opacity gate documentation.** -/// -/// The static regression test above -/// (`emit_rust_has_no_substrate_name_string_dispatches`) is the -/// load-bearing **rename test** in static form, enforcing the -/// `INVARIANTS.md` §"Layer opacity" rule on `emit_rust.rs`. It -/// asserts that emit_rust.rs contains zero string literals -/// naming any user-facing std/ identifier -/// (`Int`/`Bool`/`String`/`True`/`False`) or substrate L1 -/// behavior (`Bind`/`Branch`/`Main`) in non-comment position. -/// If the test passes, it follows by construction that: -/// -/// 1. **Renaming `Int` → `Integer` in `dsl/std/integer.dag`** -/// requires editing `dsl/std/integer.dag` (the declaration), -/// `src/v3/spec/rust.dag` (the typed reference -/// `target: Int` → `target: Integer`), and any user-source -/// that mentions `Int`. Emit_rust.rs needs **zero edits** -/// because it dispatches on declaration ids resolved at -/// bootstrap time, not on name strings. -/// -/// 2. **Renaming any other primitive** has the same property — -/// one std/ edit + one rust.dag edit + user-source updates, -/// with the emitter unchanged. -/// -/// 3. **Adding a new primitive** (e.g. `Decimal` for fixed- -/// point) is one std/ addition + one rust.dag addition, -/// again with the emitter unchanged. -/// -/// This is the **layer opacity guarantee** in static form. The -/// thesis claim — "the compiler exists to make compositions -/// opaque, application code sitting on rest/http/service should -/// be unable to observe layer changes" (THESIS.md §"Compositional -/// layering: below-boundary opacity by construction") — applies -/// one layer up: the emitter sits on top of the substrate layer, -/// and the substrate layer should be replaceable without the -/// emitter noticing. The regression test's empty-grep result is -/// the proof. The eventual structural enforcement is -/// `lens_layer_opacity` per `docs/lens-library-design.md` §2.2; -/// this static grep is the precursor that catches the same class -/// of violations until the lens lands. -/// -/// The DYNAMIC version of the rename test (literally rename a -/// declaration in std/, recompile, verify) would touch every -/// std/ file that references the renamed type and is too coarse -/// to express as a unit test. The static check is strictly -/// stronger anyway: a passing static test guarantees the dynamic -/// test would pass without running it. -/// -/// **The carve-out for `EmitError` payloads.** `EmitError` -/// variants like `MissingSubstrateMarker(SubstrateMarkerRole:: -/// Bind)` carry typed enum tags — not strings — for the same -/// reason. The `SubstrateMarkerRole` enum is internal compiler -/// dispatch metadata, NOT a string-keyed lookup. The regression -/// test's pattern list catches the literal `"Bind"`/`"Branch"`/ -/// `"Main"` quoted strings; if you re-introduced one, the test -/// fires immediately. -#[test] -fn composition_opacity_gate_is_documented() { - // No-op test that exists purely to anchor the documentation - // above. The actual gate lives in - // `emit_rust_has_no_substrate_name_string_dispatches` and - // runs every test invocation. -} - -#[test] -fn roundtrip_temp_dirs_are_unique() { - assert_ne!(harness().next_child_dir(), harness().next_child_dir()); -} - -// The nine tests below dispatch into one batched rustc-roundtrip -// program harness. Fixture sources live in `PROGRAM_FIXTURES`; the -// harness compiles on first access and is reused across tests. -// -// These run unconditionally (no `#[ignore]`), giving per-fixture test -// names in cargo output. `emit_rust_fixtures_rustc_green` (below) is the -// `#[ignore]`d full-matrix gate that sweeps the same fixtures in one shot; -// both coexist because the per-fixture names are useful for triage. - -#[test] -fn rustc_roundtrip_list_fold_prints_six() { - let name = "list_fold_six"; - let stdout = run_program(name); - let expected = program_expected(name); - assert_eq!( - stdout, expected, - "compiled binary printed {stdout:?}, not {expected:?}" - ); -} - -#[test] -fn rustc_roundtrip_generic_list_fold_prints_one() { - let name = "generic_list_fold_one"; - let stdout = run_program(name); - let expected = program_expected(name); - assert_eq!( - stdout, expected, - "compiled binary printed {stdout:?}, not {expected:?}" - ); -} - -#[test] -fn rustc_roundtrip_list_map_then_fold_prints_twelve() { - let name = "list_map_then_fold_twelve"; - let stdout = run_program(name); - let expected = program_expected(name); - assert_eq!( - stdout, expected, - "compiled binary printed {stdout:?}, not {expected:?}" - ); -} - -#[test] -fn rustc_roundtrip_list_filter_then_fold_prints_seven() { - let name = "list_filter_then_fold_seven"; - let stdout = run_program(name); - let expected = program_expected(name); - assert_eq!( - stdout, expected, - "compiled binary printed {stdout:?}, not {expected:?}" - ); -} - -#[test] -fn rustc_roundtrip_list_filter_non_copy_record_predicate_prints_two() { - let stdout = roundtrip_stdout( - "type Point { x: Int y: Int }\n\ - fn x_of(p: Point) -> Int = p.x\n\ - let p1: Point = { x: 1, y: 2 }\n\ - let p2: Point = { x: 3, y: 4 }\n\ - let p3: Point = { x: 5, y: 6 }\n\ - fn keep(p: Point) -> Bool = x_of(p) > 2\n\ - let total: Int = length(filter(cons(p1, cons(p2, singleton(p3))), keep))", - ); - assert_eq!( - stdout, "2", - "filter should render predicate against a borrowed item and retain a cloned item" - ); -} - -#[test] -fn rustc_roundtrip_nested_list_builtins_inside_lambda_prints_six() { - let name = "nested_list_builtins_inside_lambda_six"; - let stdout = run_program(name); - let expected = program_expected(name); - assert_eq!( - stdout, expected, - "compiled binary printed {stdout:?}, not {expected:?}" - ); -} - -#[test] -fn rustc_roundtrip_user_function_call_prints_three() { - let name = "user_function_call_three"; - let stdout = run_program(name); - let expected = program_expected(name); - assert_eq!( - stdout, expected, - "compiled binary printed {stdout:?}, not {expected:?}" - ); -} - -#[test] -fn rustc_roundtrip_recursive_function_call_prints_six() { - let name = "recursive_function_call_six"; - let stdout = run_program(name); - let expected = program_expected(name); - assert_eq!( - stdout, expected, - "compiled binary printed {stdout:?}, not {expected:?}" - ); -} - -#[test] -fn rustc_roundtrip_record_literal_through_function_prints_one() { - let name = "record_literal_through_function_one"; - let stdout = run_program(name); - let expected = program_expected(name); - assert_eq!( - stdout, expected, - "compiled binary printed {stdout:?}, not {expected:?}" - ); -} - -#[test] -fn rustc_roundtrip_user_sum_match_prints_zero() { - let name = "user_sum_match_zero"; - let stdout = run_program(name); - let expected = program_expected(name); - assert_eq!( - stdout, expected, - "compiled binary printed {stdout:?}, not {expected:?}" - ); -} - -// The five reflected-module tests below share one batched harness -// built lazily by `reflected_harness_bin()`. Each test invokes the -// same binary with a different argv[1]; fixture source lives in -// `REFLECTED_FIXTURES`. - -#[test] -fn rustc_roundtrip_emitted_module_invokes_reflected_dag_function() { - let name = "node_count"; - let stdout = run_reflected(name); - match reflected_expected(name) { - ReflectedExpected::PositiveInt => assert!( - stdout.parse::().is_ok_and(|n| n > 0), - "compiled reflected Dag function should return a positive node count, got {stdout:?}" - ), - ReflectedExpected::Exact(expected) => assert_eq!(stdout, *expected), - } -} - -#[test] -fn rustc_roundtrip_emitted_module_matches_reflected_behavior_payloads() { - let name = "bind_count"; - let stdout = run_reflected(name); - let ReflectedExpected::Exact(expected) = reflected_expected(name) else { - panic!("bind_count expected Exact") - }; - assert_eq!( - stdout, *expected, - "compiled reflected Behavior match should count the two top-level binds, got {stdout:?}" - ); -} - -#[test] -fn rustc_roundtrip_emitted_module_returns_reflected_source_span_list() { - let name = "singleton_span"; - let stdout = run_reflected(name); - let ReflectedExpected::Exact(expected) = reflected_expected(name) else { - panic!("singleton_span expected Exact") - }; - assert_eq!( - stdout, *expected, - "compiled reflected function returning List should yield a singleton list, got {stdout:?}" - ); -} - -#[test] -fn rustc_roundtrip_emitted_module_compares_reflected_port_ids_in_list_contains() { - let name = "result_port_is_param"; - let stdout = run_reflected(name); - let ReflectedExpected::Exact(expected) = reflected_expected(name) else { - panic!("result_port_is_param expected Exact") - }; - assert_eq!( - stdout, *expected, - "compiled reflected function should compare PortId handles through list contains, got {stdout:?}" - ); -} - -#[test] -fn rustc_roundtrip_emitted_module_returns_user_record_list_from_reflected_binds() { - let name = "bind_names"; - let stdout = run_reflected(name); - let ReflectedExpected::Exact(expected) = reflected_expected(name) else { - panic!("bind_names expected Exact") - }; - assert_eq!( - stdout, *expected, - "compiled reflected function should return a user record per top-level bind, got {stdout:?}" - ); -} - -/// End-to-end roundtrip test: emit Rust from a v3 program, feed the -/// Rust source to `rustc`, run the resulting binary, assert stdout. -/// Gated behind `#[ignore]` because CI runners often don't have a -/// Rust toolchain available inside the test sandbox. Run locally: -/// -/// cargo test -p v3-compiler --test integration \ -/// -- --ignored --nocapture -/// -/// This is the PR-B success criterion made literal: the v3 compiler -/// produces Rust that a real Rust toolchain turns into a working -/// binary, without touching the emitter between "here's the -/// program" and "here's the answer `3` on stdout." -#[test] -#[ignore] -fn rustc_roundtrip_int_addition_prints_three() { - let stdout = roundtrip_stdout("let x: Int = 1 + 2"); - assert_eq!(stdout, "3", "compiled binary printed {stdout:?}, not `3`"); -} - -/// Gate test: the full Rust fixture matrix (all 9 program fixtures and -/// all 5 reflected-module fixtures) compiles and produces the expected -/// output under a real `rustc`. Passes when every individual -/// `rustc_roundtrip_*` test would pass. -/// -/// Gated behind `#[ignore]` because CI runners may not have `rustc`. -/// The individual `rustc_roundtrip_*` tests above are unignored (they -/// run unconditionally); this gate sweeps them in one shot for a fast -/// go/no-go signal. Run locally: -/// -/// cargo test -p v3-compiler --test integration \ -/// emit_rust_fixtures_rustc_green -- --ignored --nocapture -#[test] -#[ignore] -fn emit_rust_fixtures_rustc_green() { - if let Err(detail) = r1c_e_gates::check_emit_rust_fixtures_rustc_green() { - panic!("emit_rust_fixtures_rustc_green: {detail}"); - } -} diff --git a/src/v3/compiler/tests/boundary/m1_4_emit_python_test.rs b/src/v3/compiler/tests/boundary/m1_4_emit_python_test.rs deleted file mode 100644 index 839415833e2..00000000000 --- a/src/v3/compiler/tests/boundary/m1_4_emit_python_test.rs +++ /dev/null @@ -1,1113 +0,0 @@ -//! **Layer:** boundary (TESTING.md § test layers — class-5 CPython -//! roundtrip). - -use std::io::Write; -use std::path::{Path, PathBuf}; -use std::process::{Command, Stdio}; -use std::sync::atomic::{AtomicUsize, Ordering}; - -use crate::common::determinism_fixtures::PROGRAM_FIXTURES; -use v3_compiler::compile_to_dag; -use v3_compiler::dag::{ - Behavior, BindEmitParticipation, BindNode, BranchEmitParticipation, BranchNode, LoopBound, - LoopNode, Path as DagPath, Port, TransformNode, ValueNode, -}; -use v3_compiler::emit::{ - emit as shared_emit, emit_module as shared_emit_module, - emit_python_module_text as emit_python_module, emit_python_text, EmitTarget, -}; -use v3_compiler::emit_rust::emit_rust_module; -use v3_compiler::Dag; - -static ROUNDTRIP_ID: AtomicUsize = AtomicUsize::new(0); - -fn lens_source() -> String { - std::fs::read_to_string(lens_path()).expect("read unused_parameters.dag") -} - -fn lens_path() -> PathBuf { - PathBuf::from(env!("CARGO_MANIFEST_DIR")) - .join("..") - .join("lenses") - .join("unused_parameters.dag") -} - -fn emit_rust_lens_module() -> String { - let dag = compile_to_dag(&lens_source(), lens_path().to_string_lossy().as_ref()) - .expect("compiled lens source"); - emit_rust_module(&dag).expect("emit rust lens module") -} - -fn emit_python_lens_module() -> String { - let dag = compile_to_dag(&lens_source(), lens_path().to_string_lossy().as_ref()) - .expect("compiled lens source"); - emit_python_module(&dag).expect("emit python lens module") -} - -fn emit_python_module_from_source(source: &str, file_name: &str) -> String { - let dag = compile_to_dag(source, file_name).expect("compiled python module source"); - emit_python_module(&dag).expect("emit python module") -} - -fn python_stdout(source: &str, file_name: &str) -> String { - let dag = compile_to_dag(source, file_name).expect("compiled python program source"); - let rendered = emit_python_text(&dag).expect("emit python program"); - let tmp_dir = next_roundtrip_dir(); - std::fs::create_dir_all(&tmp_dir).expect("create tmp dir"); - let src_path = tmp_dir.join("main.py"); - std::fs::File::create(&src_path) - .and_then(|mut f| f.write_all(rendered.as_bytes())) - .expect("write emitted python source"); - - let run = Command::new("python3") - .arg(&src_path) - .output() - .expect("run python3"); - assert!( - run.status.success(), - "python3 failed on emitted source:\n{}\nstderr:\n{}", - rendered, - String::from_utf8_lossy(&run.stderr) - ); - String::from_utf8_lossy(&run.stdout).trim().to_string() -} - -fn program_fixture_source(name: &str) -> &'static str { - PROGRAM_FIXTURES - .iter() - .find(|fixture| fixture.name == name) - .unwrap_or_else(|| panic!("missing program fixture `{name}`")) - .source -} - -#[test] -fn emit_python_bool_logical_ops_use_keyword_carriers() { - let src = "fn f(a: Bool, b: Bool, c: Bool) -> Bool = a && b || c\n"; - let out = emit_python_module_from_source(src, "bool_logic_py.v3"); - assert!( - out.contains(" and ") && out.contains(" or "), - "expected Python `and` / `or` from Bool OperatorRealization rows; got:\n{out}" - ); -} - -/// Verify that the Int arithmetic and comparison operators added in PR #681 -/// emit the correct Python expression templates. These are always-on emit-level -/// checks; they do not require a Python toolchain. -#[test] -fn emit_python_int_operators_use_correct_expression_templates() { - let src = "fn f(a: Int, b: Int) -> Int = a * b\n"; - let out = emit_python_module_from_source(src, "int_mul_py.v3"); - assert!( - out.contains("* ") || out.contains(" *"), - "mul carrier must emit `*`; got:\n{out}" - ); - - let src = "import std.error_primitives { DivError, Result }\n\ -fn f(a: Int, b: Int) -> Result = a / b\n"; - let out = emit_python_module_from_source(src, "int_div_py.v3"); - assert!( - out.contains("__v3_idiv("), - "div carrier must emit `__v3_idiv(...)`; got:\n{out}" - ); - - let src = "fn f(a: Int, b: Int) -> Bool = a != b\n"; - let out = emit_python_module_from_source(src, "int_ne_py.v3"); - assert!(out.contains("!="), "ne carrier must emit `!=`; got:\n{out}"); - - let src = "fn f(a: Int, b: Int) -> Bool = a < b\n"; - let out = emit_python_module_from_source(src, "int_lt_py.v3"); - assert!(out.contains(" < "), "lt carrier must emit `<`; got:\n{out}"); - - let src = "fn f(a: Int, b: Int) -> Bool = a > b\n"; - let out = emit_python_module_from_source(src, "int_gt_py.v3"); - assert!(out.contains(" > "), "gt carrier must emit `>`; got:\n{out}"); -} - -#[test] -fn emit_python_wrappers_match_shared_entrypoint() { - let program_source = "\ -fn double(x: Int) -> Int = x + x -let result: Int = double(21) -"; - let program_dag = - compile_to_dag(program_source, "emit_python_wrapper_program_parity.v3").expect("compiles"); - let shared = shared_emit(&program_dag, EmitTarget::Python) - .expect("shared emit") - .text; - let wrapper = emit_python_text(&program_dag).expect("wrapper emit"); - assert_eq!( - shared, wrapper, - "emit_python wrapper drifted from emit::emit" - ); - - let module_source = "\ -fn double(x: Int) -> Int = x + x -"; - let module_dag = - compile_to_dag(module_source, "emit_python_wrapper_module_parity.v3").expect("compiles"); - let shared_module = shared_emit_module(&module_dag, EmitTarget::Python) - .expect("shared module emit") - .text; - let wrapper_module = emit_python_module(&module_dag).expect("wrapper module emit"); - assert_eq!( - shared_module, wrapper_module, - "emit_python_module wrapper drifted from emit::emit_module" - ); -} - -#[test] -fn emit_python_fails_closed_on_div_prelude_diverror_collision() { - let dag = compile_to_dag( - "type DivError = Bad | Worse\n\ -let x = 6 / 2", - "python_diverror_collision.v3", - ) - .expect("compiles"); - let err = - emit_python_text(&dag).expect_err("Python emit must reject DivError prelude collision"); - assert!( - matches!(err, v3_compiler::emit::EmitPythonError::Unsupported(ref message) - if message.contains("DivError")), - "expected explicit DivError collision error, got {err:?}" - ); -} - -#[test] -fn emit_python_emits_diverror_prelude_for_explicit_result_without_division() { - let dag = compile_to_dag( - "import std.error_primitives { DivError, Result }\n\ -fn passthrough(x: Result) -> Result = x\n", - "python_explicit_result_no_div.v3", - ) - .expect("compiles"); - let out = emit_python_module(&dag).expect("emits python module"); - assert!( - out.contains("class DivError(enum.IntEnum):"), - "explicit Result usage needs DivError prelude even without `/`; got: {out}" - ); -} - -#[test] -fn emit_python_emits_diverror_prelude_for_result_field_without_division() { - let dag = compile_to_dag( - "import std.error_primitives { DivError, Result }\n\ -type Holder { value: Result }\n", - "python_result_field_diverror_no_div.v3", - ) - .expect("compiles"); - let out = emit_python_module(&dag).expect("emits python module"); - assert!( - out.contains("class DivError(enum.IntEnum):"), - "type fields using Result need DivError prelude even without `/`; got: {out}" - ); -} - -#[test] -fn emit_python_checked_division_roundtrips_ok_and_errors() { - // Single source of truth: `boundary_emit_gates::check_python_checked_division_roundtrips` - // is also the `boundary_emit_gates python-checked-division-roundtrip` subcommand invoked by - // `tests/dag/boundary_emit_gates.template.dag` (F.14 / T-PB-B). Do not duplicate assertions. - if let Err(detail) = - v3_compiler::boundary_emit_gates::check_python_checked_division_roundtrips() - { - panic!("emit_python_checked_division_roundtrips_ok_and_errors: {detail}"); - } -} - -#[test] -fn emit_python_checked_division_prelude_maps_overflow() { - let out = emit_python_text( - &compile_to_dag("let x = 6 / 2\n", "python_div_overflow_prelude.v3").expect("compiles"), - ) - .expect("emits python"); - assert_eq!( - out.matches("return ('Err', DivError.Overflow)").count(), - 1, - "Python checked-division prelude must map min-int / -1 to Overflow; got: {out}" - ); -} - -#[test] -fn emit_python_structural_diverror_signature_uses_substrate_prelude() { - let dag = compile_to_dag( - "type DivError = DivideByZero | Overflow\n\ -fn passthrough(x: DivError) -> DivError = x\n", - "python_user_diverror_signature_no_div.v3", - ) - .expect("compiles"); - let out = emit_python_module(&dag).expect("emits python module"); - assert!( - out.contains("def __v3_idiv"), - "structural DivError signatures use the substrate prelude, independent of source path; got: {out}" - ); - assert!( - out.matches("class DivError(enum.IntEnum):").count() == 1, - "structural DivError should materialize once through the substrate prelude; got: {out}" - ); -} - -#[test] -fn emit_python_fails_closed_on_div_prelude_helper_collision() { - let dag = compile_to_dag( - "fn __v3_idiv(a: Int, b: Int) -> Int = a + b\n\ -let x = 6 / 2", - "python_div_helper_collision.v3", - ) - .expect("compiles"); - let err = - emit_python_text(&dag).expect_err("Python emit must reject division helper collision"); - assert!( - matches!(err, v3_compiler::emit::EmitPythonError::Unsupported(ref message) - if message.contains("__v3_idiv")), - "expected explicit __v3_idiv collision error, got {err:?}" - ); -} - -#[test] -fn emit_python_fails_closed_on_div_prelude_top_level_bind_collision() { - let dag = compile_to_dag( - "let __v3_idiv = 0\n\ -let x = 6 / 2", - "python_div_helper_bind_collision.v3", - ) - .expect("compiles"); - let err = - emit_python_text(&dag).expect_err("Python emit must reject division helper bind collision"); - assert!( - matches!(err, v3_compiler::emit::EmitPythonError::Unsupported(ref message) - if message.contains("__v3_idiv")), - "expected explicit __v3_idiv bind collision error, got {err:?}" - ); -} - -#[test] -fn emit_python_uses_only_shared_schema_surface() { - const PYTHON_SPEC: &str = include_str!("../../../spec/python.dag"); - const PYTHON_EMITTER: &str = include_str!("../../src/emit/python_target.rs"); - let forbidden = [ - "PythonTypeRealization", - "PythonOperatorRealization", - "PythonCallableRealization", - "PythonCallableStrategy", - "PythonTypeInstantiationRealization", - "PythonPatternRealization", - "PythonPatternStrategy", - "PythonExpressionSyntax", - "PythonCollectionOps", - "PythonTypeApplicationSyntax", - ]; - for needle in forbidden { - assert!( - !PYTHON_SPEC.contains(needle), - "spec/python.dag still contains private Python scaffold `{needle}`" - ); - assert!( - !PYTHON_EMITTER.contains(needle), - "emit/python_target.rs still contains private Python scaffold `{needle}`" - ); - } -} - -fn assert_python_program_fixture_stdout(name: &str, expected: &str) { - let actual = python_stdout(program_fixture_source(name), "python_admitted_fixture.v3"); - assert_eq!( - actual, expected, - "emitted Python fixture `{name}` diverged from Rust-canonical expected stdout" - ); -} - -#[test] -fn emitted_python_list_map_then_fold_twelve_executes_under_cpython() { - assert_python_program_fixture_stdout("list_map_then_fold_twelve", "12"); -} - -#[test] -fn emitted_python_list_filter_then_fold_seven_executes_under_cpython() { - assert_python_program_fixture_stdout("list_filter_then_fold_seven", "7"); -} - -#[test] -fn emitted_python_nested_list_builtins_inside_lambda_six_executes_under_cpython() { - assert_python_program_fixture_stdout("nested_list_builtins_inside_lambda_six", "6"); -} - -fn next_roundtrip_dir() -> PathBuf { - let id = ROUNDTRIP_ID.fetch_add(1, Ordering::Relaxed); - std::env::temp_dir().join(format!( - "v3_emit_python_roundtrip_{}_{}", - std::process::id(), - id - )) -} - -fn deps_dir() -> PathBuf { - std::env::current_exe() - .expect("current test binary path") - .parent() - .expect("deps dir") - .to_path_buf() -} - -fn find_current_rlib(crate_name: &str) -> PathBuf { - let prefix = format!("lib{crate_name}-"); - let mut matches: Vec = std::fs::read_dir(deps_dir()) - .expect("read deps dir") - .filter_map(|entry| { - let path = entry.ok()?.path(); - let file_name = path.file_name()?.to_str()?; - if file_name.starts_with(&prefix) && file_name.ends_with(".rlib") { - Some(path) - } else { - None - } - }) - .collect(); - matches.sort_by_key(|path| { - std::fs::metadata(path) - .and_then(|meta| meta.modified()) - .ok() - }); - matches - .into_iter() - .last() - .expect("compiled rlib for current crate") -} - -fn compile_with_current_crate(src_path: &Path, bin_path: &Path) { - let deps = deps_dir(); - let current_rlib = find_current_rlib("v3_compiler"); - let compile = Command::new("rustc") - // See common::RustcHarness::compile: strip RUSTC_BOOTSTRAP so the ratchet - // CI step's libtest unlock does not leak into child rustc invocations. - .env_remove("RUSTC_BOOTSTRAP") - .arg("--edition=2021") - .arg(src_path) - .arg("-o") - .arg(bin_path) - .arg("-L") - .arg(format!("dependency={}", deps.display())) - .arg("--extern") - .arg(format!("v3_compiler={}", current_rlib.display())) - .stdout(Stdio::inherit()) - .stderr(Stdio::inherit()) - .status() - .expect("invoke rustc"); - assert!(compile.success(), "rustc failed on emitted lens source"); -} - -fn roundtrip_rust_lens_render( - module_source: &str, - program_source: &str, - file_name: &str, -) -> String { - let wrapped = format!( - "mod emitted {{ use v3_compiler::dag::*; use v3_compiler::diagnostics::*; {module_source} }} \ - fn render(dag: &v3_compiler::Dag, function: v3_compiler::dag::NodeId) -> String {{ \ - dag.nodes().iter().find_map(|node| match node {{ \ - v3_compiler::dag::Behavior::Bind(bind) if bind.id == function => Some(bind.name.clone()), \ - _ => None \ - }}).unwrap_or_else(|| format!(\"{{:?}}\", function)) \ - }} \ - fn main() {{ \ - let dag = v3_compiler::compile_to_dag({program_source:?}, {file_name:?}).expect(\"compiles\"); \ - let mut rendered: Vec = emitted::check(&dag).iter().map(|v| format!(\"{{}}:param[{{}}]\", render(&dag, v.function), v.parameter_index)).collect(); \ - rendered.sort(); \ - println!(\"{{}}\", rendered.join(\"|\")); \ - }}" - ); - - let tmp_dir = next_roundtrip_dir(); - std::fs::create_dir_all(&tmp_dir).expect("create tmp dir"); - let src_path = tmp_dir.join("main.rs"); - let bin_path = tmp_dir.join("main_bin"); - std::fs::File::create(&src_path) - .and_then(|mut f| f.write_all(wrapped.as_bytes())) - .expect("write wrapped rust source"); - - compile_with_current_crate(&src_path, &bin_path); - - let run = Command::new(&bin_path) - .output() - .expect("run compiled rust binary"); - assert!(run.status.success(), "compiled rust binary failed"); - String::from_utf8_lossy(&run.stdout).trim().to_string() -} - -fn python_runtime_prelude() -> &'static str { - r#" -from dataclasses import dataclass -import typing - -NodeId = str -PortId = str -DeclarationId = str - -@dataclass -class SourceSpan: - file: str - start: int - end: int - -@dataclass -class DagPort: - id: PortId - state: typing.Any - produced_by: typing.Optional[NodeId] - -@dataclass -class BranchPath: - body: NodeId - result_port: PortId - pattern: typing.Any = None - binding: typing.Any = None - -class LoopBound: - pass - -@dataclass -class LoopBound_Cardinality(LoopBound): - count: PortId - -@dataclass -class LoopBound_Descent(LoopBound): - cluster: str - measure: PortId - -@dataclass -class ValueNode: - id: NodeId - payload: typing.Any - result_port: PortId - span: SourceSpan - -@dataclass -class TransformNode: - id: NodeId - target: typing.Any - inputs: list[PortId] - result_port: PortId - span: SourceSpan - -@dataclass -class BranchNode: - id: NodeId - input: PortId - paths: list[BranchPath] - result_port: PortId - span: SourceSpan - emit_participation: typing.Any - -@dataclass -class LoopNode: - id: NodeId - source: PortId - init: PortId - body: NodeId - bound: LoopBound - result_port: PortId - span: SourceSpan - -@dataclass -class BindNode: - id: NodeId - name: str - result_port: PortId - params: list[PortId] - span: SourceSpan - emit_participation: typing.Any - -class Behavior: - pass - -@dataclass -class Behavior_Value(Behavior): - _0: ValueNode - -@dataclass -class Behavior_Transform(Behavior): - _0: TransformNode - -@dataclass -class Behavior_Branch(Behavior): - _0: BranchNode - -@dataclass -class Behavior_Loop(Behavior): - _0: LoopNode - -@dataclass -class Behavior_Bind(Behavior): - _0: BindNode - -@dataclass -class Dag: - declarations: list[typing.Any] - nodes: list[Behavior] - ports: list[DagPort] - clusters: list[typing.Any] - -def port(d: Dag, id: PortId) -> typing.Optional[DagPort]: - for p in d.ports: - if p.id == id: - return p - return None - -def node(d: Dag, id: NodeId) -> typing.Optional[Behavior]: - for n in d.nodes: - if n._0.id == id: - return n - return None -"# -} - -fn roundtrip_python_lens_render( - module_source: &str, - program_source: &str, - file_name: &str, -) -> String { - let dag = compile_to_dag(program_source, file_name).expect("program compiles"); - let serialized_dag = serialize_dag(&dag); - let (future_import, module_source) = split_future_annotations(module_source); - let wrapped = format!( - "{}{}{}\n\ndag = {}\n\ndef render(dag: Dag, function: NodeId) -> str:\n for node in dag.nodes:\n if isinstance(node, Behavior_Bind) and node._0.id == function:\n return node._0.name\n return function\n\nrendered = [f\"{{render(dag, v.function)}}:param[{{v.parameter_index}}]\" for v in check(dag)]\nrendered.sort()\nprint(\"|\".join(rendered))\n", - future_import, - python_runtime_prelude(), - module_source, - serialized_dag - ); - - let tmp_dir = next_roundtrip_dir(); - std::fs::create_dir_all(&tmp_dir).expect("create tmp dir"); - let src_path = tmp_dir.join("main.py"); - std::fs::File::create(&src_path) - .and_then(|mut f| f.write_all(wrapped.as_bytes())) - .expect("write wrapped python source"); - - let run = Command::new("python3") - .arg(&src_path) - .output() - .expect("run python3"); - assert!( - run.status.success(), - "python3 failed on emitted source:\n{}", - String::from_utf8_lossy(&run.stderr) - ); - String::from_utf8_lossy(&run.stdout).trim().to_string() -} - -fn run_python_module(module_source: &str) { - let tmp_dir = next_roundtrip_dir(); - std::fs::create_dir_all(&tmp_dir).expect("create tmp dir"); - let src_path = tmp_dir.join("module.py"); - std::fs::File::create(&src_path) - .and_then(|mut f| f.write_all(module_source.as_bytes())) - .expect("write python module source"); - - let run = Command::new("python3") - .arg(&src_path) - .output() - .expect("run python3"); - assert!( - run.status.success(), - "python3 failed on emitted module:\n{}", - String::from_utf8_lossy(&run.stderr) - ); -} - -fn split_future_annotations(module_source: &str) -> (&str, &str) { - let future = "from __future__ import annotations\n\n"; - module_source - .strip_prefix(future) - .map(|rest| (future, rest)) - .unwrap_or(("", module_source)) -} - -fn serialize_dag(dag: &Dag) -> String { - format!( - "Dag(declarations=[], nodes=[{}], ports=[{}], clusters=[])", - dag.nodes() - .iter() - .map(serialize_behavior) - .collect::>() - .join(", "), - dag.ports() - .iter() - .map(serialize_port) - .collect::>() - .join(", ") - ) -} - -fn serialize_behavior(node: &Behavior) -> String { - match node { - Behavior::Value(value) => format!("Behavior_Value({})", serialize_value_node(value)), - Behavior::Transform(transform) => { - format!( - "Behavior_Transform({})", - serialize_transform_node(transform) - ) - } - Behavior::Branch(branch) => format!("Behavior_Branch({})", serialize_branch_node(branch)), - Behavior::Loop(loop_node) => format!("Behavior_Loop({})", serialize_loop_node(loop_node)), - Behavior::Bind(bind) => format!("Behavior_Bind({})", serialize_bind_node(bind)), - } -} - -fn serialize_value_node(node: &ValueNode) -> String { - format!( - "ValueNode(id={}, payload=None, result_port={}, span={})", - py_debug(&node.id), - py_debug(&node.result_port()), - serialize_span(&node.span) - ) -} - -fn serialize_transform_node(node: &TransformNode) -> String { - format!( - "TransformNode(id={}, target=None, inputs=[{}], result_port={}, span={})", - py_debug(&node.id), - node.inputs - .iter() - .map(py_debug) - .collect::>() - .join(", "), - py_debug(&node.result_port()), - serialize_span(&node.span) - ) -} - -fn serialize_branch_node(node: &BranchNode) -> String { - format!( - "BranchNode(id={}, input={}, paths=[{}], result_port={}, span={}, emit_participation={})", - py_debug(&node.id), - py_debug(&node.input), - node.paths - .iter() - .map(serialize_branch_path) - .collect::>() - .join(", "), - py_debug(&node.result_port()), - serialize_span(&node.span), - serialize_opt_branch_emit_participation(node.emit_participation()) - ) -} - -fn serialize_branch_path(path: &DagPath) -> String { - format!( - "BranchPath(body={}, result_port={})", - py_debug(&path.body), - py_debug(&path.result_port()) - ) -} - -fn serialize_loop_node(node: &LoopNode) -> String { - format!( - "LoopNode(id={}, source={}, init={}, body={}, bound={}, result_port={}, span={})", - py_debug(&node.id), - py_debug(&node.source), - py_debug(&node.init), - py_debug(&node.body), - serialize_loop_bound(&node.bound), - py_debug(&node.result_port()), - serialize_span(&node.span) - ) -} - -fn serialize_loop_bound(bound: &LoopBound) -> String { - match bound { - LoopBound::Cardinality { count } => { - format!("LoopBound_Cardinality(count={})", py_debug(count)) - } - LoopBound::Descent { cluster, measure } => { - format!( - "LoopBound_Descent(cluster={}, measure={})", - py_debug(cluster), - py_debug(measure) - ) - } - } -} - -fn serialize_bind_node(node: &BindNode) -> String { - format!( - "BindNode(id={}, name={:?}, result_port={}, params=[{}], span={}, emit_participation={})", - py_debug(&node.id), - node.name, - py_debug(&node.result_port()), - node.params - .iter() - .map(py_debug) - .collect::>() - .join(", "), - serialize_span(&node.span), - serialize_opt_bind_emit_participation(node.emit_participation()) - ) -} - -fn serialize_opt_bind_emit_participation(p: Option) -> String { - match p { - None => "None".to_string(), - // Valid Python expression embedded in `dag = Dag(...)` (not Rust `Some(Enum::Variant)` syntax). - Some(BindEmitParticipation::UserCallable) => "\"UserCallable\"".to_string(), - } -} - -fn serialize_opt_branch_emit_participation(p: Option) -> String { - match p { - None => "None".to_string(), - Some(BranchEmitParticipation::UserMatch) => "\"UserMatch\"".to_string(), - } -} - -fn serialize_port(port: &Port) -> String { - let produced_by = port - .produced_by - .map(|id| py_debug(&id)) - .unwrap_or_else(|| "None".to_string()); - format!( - "DagPort(id={}, state=None, produced_by={})", - py_debug(&port.id()), - produced_by - ) -} - -fn serialize_span(span: &v3_compiler::diagnostics::SourceSpan) -> String { - format!( - "SourceSpan(file={:?}, start={}, end={})", - span.file, span.byte_start, span.byte_end - ) -} - -fn py_debug(value: &T) -> String { - let inner = format!("{value:?}"); - format!("{inner:?}") -} - -#[test] -fn serialize_dag_embeds_valid_python_emit_participation_literals() { - let bind_src = "fn keep(a: Int, b: Int) -> Int = a"; - let dag = compile_to_dag(bind_src, "serialize_emit_part_bind.v3").expect("compiles"); - let s = serialize_dag(&dag); - assert!( - !s.contains("BindEmitParticipation::"), - "serialized DAG must not embed Rust enum paths (invalid Python): {s}" - ); - assert!( - s.contains("\"UserCallable\""), - "expected Python str literal for user-callable bind participation: {s}" - ); - - let match_src = "type P = One(Int) | Zero -fn f(p: P) -> Int = match p { One(_) => 1, Zero => 0 }"; - let dag = compile_to_dag(match_src, "serialize_emit_part_match.v3").expect("compiles"); - let s = serialize_dag(&dag); - assert!( - !s.contains("BranchEmitParticipation::"), - "serialized DAG must not embed Rust enum paths (invalid Python): {s}" - ); - assert!( - s.contains("\"UserMatch\""), - "expected Python str literal for user-match branch participation: {s}" - ); -} - -// unused_parameters.dag contains recursive helpers (walk_steps etc.) that -// lower to Behavior::Loop. emit_python renders those by emitting the body -// DAG's result port, which preserves the recursive self-calls — Python -// supports recursion natively, so the emitted code is semantically correct. -#[test] -fn emit_python_module_marks_ownership_as_skipped_for_gc_target() { - let module = emit_python_lens_module(); - assert!( - module.contains("# ownership skipped: GarbageCollected / LexicalScoping"), - "expected ownership-skip trace in emitted Python module, got:\n{module}" - ); -} - -#[test] -fn emit_python_module_defers_annotation_evaluation() { - let module = emit_python_module_from_source( - "\ -type First = WrapSecond(Second) | FirstNone -type Second = WrapFirst(First) | SecondNone -", - "recursive_types.v3", - ); - assert!( - module.starts_with("from __future__ import annotations\n"), - "expected future-annotations import at module top, got:\n{module}" - ); - run_python_module(&module); -} - -#[test] -fn emit_python_module_qualifies_variant_class_names_by_parent_type() { - let module = emit_python_module_from_source( - "\ -type First = Shared(Int) | FirstMissing -type Second = Shared(String) | SecondMissing -fn make_first(x: Int) -> First = Shared(x) -fn make_second(x: String) -> Second = Shared(x) -fn first_value(v: First) -> Int = match v { Shared(n) => n, FirstMissing => 0 } -fn second_value(v: Second) -> String = match v { Shared(s) => s, SecondMissing => \"\" } -", - "variant_collision.v3", - ); - assert!( - module.contains("class First_Shared(First):"), - "expected qualified runtime class for First.Shared, got:\n{module}" - ); - assert!( - module.contains("class Second_Shared(Second):"), - "expected qualified runtime class for Second.Shared, got:\n{module}" - ); - assert!( - module.contains("return First_Shared(p0)"), - "expected qualified constructor call for First.Shared, got:\n{module}" - ); - assert!( - module.contains("return Second_Shared(p0)"), - "expected qualified constructor call for Second.Shared, got:\n{module}" - ); - assert!( - module.contains("isinstance(__match, First_Shared)"), - "expected qualified match guard for First.Shared, got:\n{module}" - ); - assert!( - module.contains("isinstance(__match, Second_Shared)"), - "expected qualified match guard for Second.Shared, got:\n{module}" - ); - assert!( - !module.contains("class Shared("), - "unexpected unqualified runtime class survived in emitted module:\n{module}" - ); -} - -/// E-5 / Lane 1 Stage 1c PR 3 pilot — unused match-arm payload -/// bindings never leak the source-level identifier into emitted -/// Python. `python_clean_emission.pattern_bindings = -/// NotApplicablePatternBinding` encodes the structural fact that -/// emit_python does not use Python's native `match` statement and -/// therefore has no pattern-site to emit a binding at; it -/// substitutes an extraction expression (`__match._0` / `__match`) -/// at every payload-port reference in the rendered arm body, and -/// unused references produce no identifier at all. -/// -/// Before the pilot the emitter dropped the binding into -/// `arm_locals.names` unconditionally without consulting the -/// contract. After the pilot the dispatch reads -/// `python_clean_emission` via the typed `PatternBindingRuleVariants` -/// cache (Lane 1 Stage 1c PR 2.5) and rejects Python-invalid -/// variants at contract-parse time. -#[test] -fn emit_python_unused_payload_binding_never_leaks_identifier() { - let module = emit_python_module_from_source( - "type BoxedInt = Boxed(Int) | Empty -fn ignore_payload(b: BoxedInt) -> Int = match b { Boxed(unique_value) => 0, Empty => 1 }", - "python_clean_emission_unused.v3", - ); - assert!( - !module.contains("unique_value"), - "unused payload leaked binding identifier into emitted Python, got:\n{module}" - ); - assert!( - module.contains("isinstance(__match, BoxedInt_Boxed)"), - "expected qualified isinstance dispatch, got:\n{module}" - ); - run_python_module(&module); -} - -/// Complement to `emit_python_unused_payload_binding_never_leaks_identifier`: -/// when the arm body references the payload binding, the emitter -/// substitutes `__match._0` at the port reference. The source-level -/// identifier is still absent — Python's -/// `NotApplicablePatternBinding` rule never surfaces it, used or -/// unused. Proves the contract dispatch doesn't regress the -/// used-binding path. -#[test] -fn emit_python_used_payload_binding_substitutes_match_extraction() { - let module = emit_python_module_from_source( - "type BoxedInt = Boxed(Int) | Empty -fn use_payload(b: BoxedInt) -> Int = match b { Boxed(unique_value) => unique_value, Empty => 1 }", - "python_clean_emission_used.v3", - ); - assert!( - !module.contains("unique_value"), - "used payload leaked binding identifier into emitted Python, got:\n{module}" - ); - assert!( - module.contains("__match._0"), - "expected used payload to render via __match._0 substitution, got:\n{module}" - ); - run_python_module(&module); -} - -#[test] -fn emit_python_named_single_field_payload_projects_from_match_value() { - let module = emit_python_module_from_source( - "type Point { x: Int y: Int } -type Wrapped = Wrap { inner: Point } | Empty -fn unwrap_or_zero(w: Wrapped) -> Int = match w { Wrap(payload) => payload.inner.x, Empty => 0 }", - "python_variant_payload_named_single.v3", - ); - assert!( - module.contains("__match.inner.x"), - "expected named single-field payload access to project from __match, got:\n{module}" - ); - assert!( - !module.contains("__match.inner.inner"), - "named single-field payload access must not double-project through the inner field, got:\n{module}" - ); - run_python_module(&module); -} - -#[test] -fn emit_python_named_multi_field_payload_projects_from_match_value() { - let module = emit_python_module_from_source( - "type Pair = Both { left: Int right: Int } | Empty -fn right_or_zero(p: Pair) -> Int = match p { Both(payload) => payload.right, Empty => 0 }", - "python_variant_payload_named_multi.v3", - ); - assert!( - module.contains("__match.right"), - "expected named multi-field payload access to project from __match, got:\n{module}" - ); - assert!( - !module.contains("payload.right"), - "named multi-field payload access must not leak the source binding name, got:\n{module}" - ); - run_python_module(&module); -} - -/// E-5 / Lane 1 Stage 1c PR 4 — emitted Python passes -/// `python_clean_emission.post_emit_verifier` as invoked through -/// the shared harness (`python3 -m py_compile` + -/// `IgnoreVerifierOutput`). Reads the contract via -/// `parse_post_emit_verifier` so any future spec change (different -/// verifier, new args) picks up automatically without updating the -/// test body. -/// -/// This is the sole py_compile roundtrip for the Python pilot — -/// there is no separate hardcoded-command version. `run_post_emit_verifier` -/// IS the only verifier-invocation authority the test suite uses, so -/// spec drift (e.g. flipping to `ruff --select=E` in the future) -/// shows up here without test-code edits. -/// -/// Gated behind `#[ignore]` — CI sandboxes don't always carry -/// python3. Run locally: -/// -/// cargo test -p v3-compiler --test m1_4_emit_python_test \ -/// python_pilot_source_passes_post_emit_verifier_harness \ -/// -- --ignored --nocapture -#[test] -#[ignore] -fn python_pilot_source_passes_post_emit_verifier_harness() { - use v3_compiler::post_emit_verifier::{parse_post_emit_verifier, run_post_emit_verifier}; - let source = "type BoxedInt = Boxed(Int) | Empty -fn ignore_payload(b: BoxedInt) -> Int = match b { Boxed(unique_value) => 0, Empty => 1 }"; - let dag = compile_to_dag(source, "python_post_emit_verifier.v3").expect("source compiles"); - let spec = dag - .python_clean_emission_spec() - .expect("python_clean_emission cached"); - let binding = parse_post_emit_verifier(&dag, spec).expect("parse contract"); - let rendered = emit_python_module(&dag).expect("emits python module"); - let tmp_dir = next_roundtrip_dir(); - std::fs::create_dir_all(&tmp_dir).expect("create tmp dir"); - let src_path = tmp_dir.join("module.py"); - std::fs::File::create(&src_path) - .and_then(|mut f| f.write_all(rendered.as_bytes())) - .expect("write python source"); - run_post_emit_verifier(&binding, &src_path) - .expect("python post_emit_verifier rejected pilot source — E-5 contract regression"); -} - -#[test] -fn emitted_python_lens_matches_emitted_rust_lens_on_reflected_programs() { - let rust_module = emit_rust_lens_module(); - let python_module = emit_python_lens_module(); - - let fixtures = [ - ( - "fn keep(a: Int, b: Int) -> Int = a", - "unused_fixture.v3", - "keep:param[1]", - ), - ( - "fn count_down(n: Int, marker: Int) -> Int = if n == 0 then 0 else count_down(n - 1, marker)", - "loop_fixture.v3", - "", - ), - ]; - - for (source, file_name, expected) in fixtures { - let rust_rendered = roundtrip_rust_lens_render(&rust_module, source, file_name); - let python_rendered = roundtrip_python_lens_render(&python_module, source, file_name); - assert_eq!( - python_rendered, rust_rendered, - "python and rust emitted lenses diverged for {file_name}" - ); - assert_eq!( - python_rendered, expected, - "unexpected rendered unused-parameter set for {file_name}" - ); - } -} - -/// Direct receipt that a plain recursive user function lowers through -/// `Behavior::Loop` and emits correct Python. The source uses descent-provable -/// recursion (first arg decrements by 1), so it lowers to a Cardinality-bound -/// Loop. Emitting and running it proves the body-port rendering preserves the -/// recursive self-call and produces the right result. -/// -/// `count(6)` = 6 (counts non-negative integers from n down to 0, returns n). -/// `count(0)` = 0 (base case). -/// -/// Gated `#[ignore]` — CI sandboxes may not carry python3. -/// Run locally: -/// cargo test -p v3-compiler --test integration \ -/// emit_python_recursive_fn_produces_correct_result -- --ignored --nocapture -#[test] -#[ignore] -fn emit_python_recursive_fn_produces_correct_result() { - let source = "\ -fn count(n: Int) -> Int = if n == 0 then 0 else 1 + count(n - 1) -let result: Int = count(6) -"; - let dag = compile_to_dag(source, "recursive_loop_receipt.v3").expect("compiles"); - - // Verify Loop node is present — this is the structural claim. - let has_loop = dag - .nodes() - .iter() - .any(|b| matches!(b, v3_compiler::dag::Behavior::Loop(_))); - assert!(has_loop, "recursive fn must lower to Behavior::Loop"); - - let rendered = emit_python_text(&dag).expect("emits python"); - - // Structural: the recursive call must appear in the emitted source. - assert!( - rendered.contains("count("), - "recursive self-call must appear in emitted Python: {rendered}" - ); - - // Execution: python3 must print the correct result. - let tmp_dir = next_roundtrip_dir(); - std::fs::create_dir_all(&tmp_dir).expect("create tmp dir"); - let src_path = tmp_dir.join("main.py"); - std::fs::File::create(&src_path) - .and_then(|mut f| f.write_all(rendered.as_bytes())) - .expect("write python source"); - - let run = Command::new("python3") - .arg(&src_path) - .output() - .expect("run python3"); - assert!( - run.status.success(), - "python3 failed on emitted recursive source:\n{}\nstderr:\n{}", - rendered, - String::from_utf8_lossy(&run.stderr) - ); - let stdout = String::from_utf8_lossy(&run.stdout).trim().to_string(); - assert_eq!(stdout, "6", "count(6) must print 6, got: {stdout}"); -} diff --git a/src/v3/compiler/tests/boundary/m1_5_emit_omni_demo_test.rs b/src/v3/compiler/tests/boundary/m1_5_emit_omni_demo_test.rs deleted file mode 100644 index fd3d51fba1c..00000000000 --- a/src/v3/compiler/tests/boundary/m1_5_emit_omni_demo_test.rs +++ /dev/null @@ -1,129 +0,0 @@ -//! **Layer:** boundary (TESTING.md § test layers — class-5 multi-target -//! toolchain roundtrip). -//! -//! Two tests live here: -//! -//! * `emit_omni_demo_rust_roundtrip` — non-ignored CI gate. Emits all -//! omni-set fixtures to Rust, compiles via rustc, and checks stdout. -//! Rustc is always available so this runs unconditionally. -//! -//! * `emit_omni_demo_fixtures_green` — T-Emit lane closure receipt. -//! Marked `#[ignore]` because it requires Go **and** Python toolchains -//! that are not present in CI. When run with `--ignored` it asserts -//! both toolchains are reachable and fails hard if either is absent; -//! a missing toolchain is an unmet receipt, not a skip. -//! -//! Run the full three-way proof locally: -//! -//! cargo test -p v3-compiler --test integration \ -//! emit_omni_demo_fixtures_green -- --ignored --nocapture - -use std::io::Write; -use std::path::{Path, PathBuf}; -use std::process::{Command, Stdio}; -use std::sync::atomic::{AtomicUsize, Ordering}; - -use crate::common::cached_compile_to_dag; -use crate::common::determinism_fixtures::{GO_EMIT_EXCLUDE, PROGRAM_FIXTURES, PYTHON_EMIT_EXCLUDE}; -use v3_compiler::emit_rust::emit_rust; -use v3_compiler::r1c_e_gates; - -static ROUNDTRIP_ID: AtomicUsize = AtomicUsize::new(0); - -struct TmpDir(PathBuf); - -impl TmpDir { - fn new() -> Self { - let id = ROUNDTRIP_ID.fetch_add(1, Ordering::Relaxed); - let path = std::env::temp_dir().join(format!( - "v3_emit_omni_roundtrip_{}_{}", - std::process::id(), - id - )); - std::fs::create_dir_all(&path).expect("create tmp dir"); - TmpDir(path) - } - - fn path(&self) -> &Path { - &self.0 - } -} - -impl Drop for TmpDir { - fn drop(&mut self) { - let _ = std::fs::remove_dir_all(&self.0); - } -} - -fn omni_fixtures() -> Vec<&'static crate::common::determinism_fixtures::ProgramFixture> { - PROGRAM_FIXTURES - .iter() - .filter(|f| !GO_EMIT_EXCLUDE.contains(&f.name)) - .filter(|f| !PYTHON_EMIT_EXCLUDE.contains(&f.name)) - .collect() -} - -/// Emit `source` as a Rust program, compile via rustc, run, and return -/// trimmed stdout. Panics if rustc compilation or execution fails. -fn rust_stdout(source: &str) -> String { - let dag = cached_compile_to_dag(source, "omni_parity.v3"); - let rendered = emit_rust(&dag).expect("Rust emit succeeded"); - let tmp_dir = TmpDir::new(); - let src_path = tmp_dir.path().join("main.rs"); - let bin_path = tmp_dir.path().join("main_bin"); - std::fs::File::create(&src_path) - .and_then(|mut f| f.write_all(rendered.as_bytes())) - .expect("write rust source"); - - let compile = Command::new("rustc") - // Strip RUSTC_BOOTSTRAP so the ratchet CI step's libtest unlock - // does not leak into child rustc invocations. - .env_remove("RUSTC_BOOTSTRAP") - .arg("--edition=2021") - .arg(&src_path) - .arg("-o") - .arg(&bin_path) - .stdout(Stdio::inherit()) - .stderr(Stdio::inherit()) - .status() - .expect("invoke rustc"); - assert!( - compile.success(), - "rustc failed on emitted source:\n{rendered}" - ); - - let run = Command::new(&bin_path).output().expect("run rust binary"); - assert!(run.status.success(), "compiled rust binary exited non-zero"); - String::from_utf8_lossy(&run.stdout).trim().to_string() -} - -/// CI gate: Rust-only roundtrip over all omni fixtures. -/// -/// Rustc is always available; this test runs unconditionally. It proves -/// that the omni fixture set emits valid, executable Rust — the minimum bar -/// for every commit. -#[test] -fn emit_omni_demo_rust_roundtrip() { - let fixtures = omni_fixtures(); - assert!( - !fixtures.is_empty(), - "omni fixture set must not be empty — check exclude lists" - ); - for fixture in &fixtures { - rust_stdout(fixture.source); - } -} - -/// T-Emit lane closure receipt: all three targets produce identical stdout. -/// -/// Marked `#[ignore]` because `go` and `python3` are not present in CI. -/// Run locally with `--ignored` to execute the full three-way proof. The -/// test asserts both toolchains are reachable and **fails hard** if either -/// is absent — a missing toolchain is an unmet receipt, not a skip. -#[test] -#[ignore = "requires go and python3 toolchains; run locally: cargo test ... -- --ignored --nocapture"] -fn emit_omni_demo_fixtures_green() { - if let Err(detail) = r1c_e_gates::check_omni_demo_fixtures_green() { - panic!("emit_omni_demo_fixtures_green: {detail}"); - } -} diff --git a/src/v3/compiler/tests/boundary/v4_leaf_model_go_r1_r2_r3_external_test.rs b/src/v3/compiler/tests/boundary/v4_leaf_model_go_r1_r2_r3_external_test.rs deleted file mode 100644 index 8cc05df340e..00000000000 --- a/src/v3/compiler/tests/boundary/v4_leaf_model_go_r1_r2_r3_external_test.rs +++ /dev/null @@ -1,280 +0,0 @@ -//! **Layer:** boundary — Go target exercise for v4 leaf-model go R1 / R2a / R2b / R3-external. -//! -//! Authority: `src/v4/lens/leaf_model_verification.dag`; claim wiring in -//! `go_r1.dag`, `go_r2a.dag`, `go_r2b.dag`, `go_r3_external.dag`. -//! Temporary host bridge: this test exercises `go build` / `go run` until T-22 -//! `run_target_verification` owns the modeled rows directly. -//! -//! **P5 receipt (INVARIANTS.md §P5 — Self-Generation-0 `EXPECTED_HAND_AUTHORED_TEST`):** same-path expansion (+0 -//! census paths); explicit deferral **T-PB-B** / `_internal/ROADMAP_OPS.md` `pb_rust_tests_outside_residual_zero`; -//! dissolve when T-22 `run_target_verification` owns Go leaf claims without this bridge (#4243). -//! R2b falsification is a harness divergence probe (wrong `want` → panic), not a semantic alt-behavior witness. - -use std::io::Write; -use std::process::{Command, Stdio}; - -const FIXTURE_DAG: &str = include_str!("../../../../v4/lens/leaf_model_verification.dag"); - -const R1_HAPPY: &str = "package leafmodel\n\nfunc r1() int { return 0 }\n"; -const R1_FALSIFICATION: &str = "package leafmodel\n\nfunc r1() i32 { return 0 }\n"; - -const R2A_HAPPY: &str = - "package leafmodel\n\nfunc r2a(a int, b int) (int, bool) { return a + b, a < b }\n"; -const R2A_FALSIFICATION: &str = - "package leafmodel\n\nfunc r2a(a int) int { return a.log2_exact() }\n"; - -const R2B_HAPPY: &str = "package main\n\nimport \"math\"\n\nfunc main() {\n var x int64 = math.MaxInt64\n got := x + 1\n want := int64(math.MinInt64)\n if got != want {\n panic(\"silent signed wrap: expected MinInt64\")\n }\n}\n"; - -const R2B_FALSIFICATION: &str = "package main\n\nimport \"math\"\n\nfunc main() {\n var x int64 = math.MaxInt64\n got := x + 1\n want := int64(0)\n if got != want {\n panic(\"deliberately wrong expected wrap value\")\n }\n}\n"; - -const R3_HAPPY: &str = "package leafmodel\n\nfunc r3() string { return \"x\" }\n"; -const R3_FALSIFICATION: &str = - "package leafmodel\n\nfunc r3() string { return string(\"x\", \"y\") }\n"; - -fn unescape_dag_string_literal(body: &str) -> String { - let mut out = String::new(); - let mut chars = body.chars(); - while let Some(c) = chars.next() { - if c == '\\' { - match chars.next() { - Some('n') => out.push('\n'), - Some('t') => out.push('\t'), - Some('"') => out.push('"'), - Some('\\') => out.push('\\'), - Some(other) => { - out.push('\\'); - out.push(other); - } - None => out.push('\\'), - } - } else { - out.push(c); - } - } - out -} - -fn extract_fixture_source(dag_text: &str, data_name: &str) -> Option { - let needle = format!("data {data_name}: String = \""); - let line = dag_text.lines().find(|l| l.starts_with(&needle))?; - let rest = line.strip_prefix(&needle)?.strip_suffix('"')?; - Some(unescape_dag_string_literal(rest)) -} - -fn go_available() -> bool { - Command::new("go") - .arg("version") - .stdout(Stdio::null()) - .stderr(Stdio::null()) - .status() - .ok() - .is_some_and(|status| status.success()) -} - -fn scratch_dir(label: &str) -> std::path::PathBuf { - let suffix = std::process::id(); - std::env::temp_dir().join(format!("v4_leaf_model_go_{label}_{suffix}")) -} - -fn exercise_go_build(label: &str, source: &str) -> (i32, String) { - let tmp_dir = scratch_dir(label); - let _ = std::fs::remove_dir_all(&tmp_dir); - std::fs::create_dir_all(&tmp_dir).expect("create scratch dir"); - let src_path = tmp_dir.join("fixture.go"); - std::fs::File::create(&src_path) - .and_then(|mut f| f.write_all(source.as_bytes())) - .expect("write fixture source"); - - let out_path = tmp_dir.join("fixture.out"); - let output = Command::new("go") - .env("GO111MODULE", "off") - .args([ - "build", - "-o", - out_path.to_str().unwrap(), - src_path.to_str().unwrap(), - ]) - .output() - .expect("invoke go build on fixture"); - let diagnostics = format!( - "{}{}", - String::from_utf8_lossy(&output.stdout), - String::from_utf8_lossy(&output.stderr) - ); - let status = output.status.code().unwrap_or(1); - let _ = std::fs::remove_dir_all(&tmp_dir); - (status, diagnostics) -} - -fn exercise_go_run(label: &str, source: &str) -> (i32, String) { - let tmp_dir = scratch_dir(label); - let _ = std::fs::remove_dir_all(&tmp_dir); - std::fs::create_dir_all(&tmp_dir).expect("create scratch dir"); - let src_path = tmp_dir.join("main.go"); - std::fs::File::create(&src_path) - .and_then(|mut f| f.write_all(source.as_bytes())) - .expect("write fixture source"); - - let output = Command::new("go") - .env("GO111MODULE", "off") - .args(["run", "main.go"]) - .current_dir(&tmp_dir) - .output() - .expect("invoke go run on fixture"); - let diagnostics = format!( - "{}{}", - String::from_utf8_lossy(&output.stdout), - String::from_utf8_lossy(&output.stderr) - ); - let status = output.status.code().unwrap_or(1); - let _ = std::fs::remove_dir_all(&tmp_dir); - (status, diagnostics) -} - -#[test] -fn v4_leaf_model_go_r1_fixture_strings_match_dag_authority() { - let happy = extract_fixture_source(FIXTURE_DAG, "go_r1_happy_fixture_source").unwrap(); - let falsification = - extract_fixture_source(FIXTURE_DAG, "go_r1_falsification_fixture_source").unwrap(); - assert_eq!(happy, R1_HAPPY); - assert_eq!(falsification, R1_FALSIFICATION); -} - -#[test] -fn v4_leaf_model_go_r1_happy_fixture_compiles() { - if !go_available() { - eprintln!("skipping Go toolchain boundary check: go not on PATH"); - return; - } - let (status, diagnostics) = exercise_go_build("r1_happy", R1_HAPPY); - assert_eq!( - status, 0, - "go build should accept R1 happy fixture; diagnostics:\n{diagnostics}" - ); -} - -#[test] -fn v4_leaf_model_go_r1_falsification_fixture_rejects_i32() { - if !go_available() { - eprintln!("skipping Go toolchain boundary check: go not on PATH"); - return; - } - let (status, diagnostics) = exercise_go_build("r1_falsification", R1_FALSIFICATION); - assert_ne!(status, 0, "falsification must not compile"); - assert!( - diagnostics.contains("undefined: i32") || diagnostics.contains("undefined type: i32"), - "expected undefined i32 diagnostic; diagnostics:\n{diagnostics}" - ); -} - -#[test] -fn v4_leaf_model_go_r2a_fixture_strings_match_dag_authority() { - let happy = extract_fixture_source(FIXTURE_DAG, "go_r2a_happy_fixture_source").unwrap(); - let falsification = - extract_fixture_source(FIXTURE_DAG, "go_r2a_falsification_fixture_source").unwrap(); - assert_eq!(happy, R2A_HAPPY); - assert_eq!(falsification, R2A_FALSIFICATION); -} - -#[test] -fn v4_leaf_model_go_r2a_happy_fixture_compiles() { - if !go_available() { - eprintln!("skipping Go toolchain boundary check: go not on PATH"); - return; - } - let (status, diagnostics) = exercise_go_build("r2a_happy", R2A_HAPPY); - assert_eq!( - status, 0, - "go build should accept R2a happy fixture; diagnostics:\n{diagnostics}" - ); -} - -#[test] -fn v4_leaf_model_go_r2a_falsification_fixture_rejects_method() { - if !go_available() { - eprintln!("skipping Go toolchain boundary check: go not on PATH"); - return; - } - let (status, diagnostics) = exercise_go_build("r2a_falsification", R2A_FALSIFICATION); - assert_ne!(status, 0, "falsification must not compile"); - assert!( - diagnostics.contains("log2_exact"), - "expected missing log2_exact method diagnostic; diagnostics:\n{diagnostics}" - ); -} - -#[test] -fn v4_leaf_model_go_r2b_runtime_fixture_strings_match_dag_authority() { - let happy = extract_fixture_source(FIXTURE_DAG, "go_r2b_happy_fixture_source").unwrap(); - let falsification = - extract_fixture_source(FIXTURE_DAG, "go_r2b_falsification_fixture_source").unwrap(); - assert_eq!(happy, R2B_HAPPY); - assert_eq!(falsification, R2B_FALSIFICATION); -} - -#[test] -fn v4_leaf_model_go_r2b_int64_silent_overflow_truncates_at_runtime() { - if !go_available() { - eprintln!("skipping Go toolchain boundary check: go not on PATH"); - return; - } - let (status, diagnostics) = exercise_go_run("r2b_happy", R2B_HAPPY); - assert_eq!( - status, 0, - "go run should observe int64 silent wrap to MinInt64; diagnostics:\n{diagnostics}" - ); -} - -#[test] -fn v4_leaf_model_go_r2b_falsification_fixture_panics_at_runtime() { - if !go_available() { - eprintln!("skipping Go toolchain boundary check: go not on PATH"); - return; - } - let (status, diagnostics) = exercise_go_run("r2b_falsification", R2B_FALSIFICATION); - assert_ne!( - status, 0, - "falsification must panic on wrong expected wrap; diagnostics:\n{diagnostics}" - ); - assert!( - diagnostics.contains("deliberately wrong expected wrap value"), - "expected deliberate panic message; diagnostics:\n{diagnostics}" - ); -} - -#[test] -fn v4_leaf_model_go_r3_external_fixture_strings_match_dag_authority() { - let happy = extract_fixture_source(FIXTURE_DAG, "go_r3_external_happy_fixture_source").unwrap(); - let falsification = - extract_fixture_source(FIXTURE_DAG, "go_r3_external_falsification_fixture_source").unwrap(); - assert_eq!(happy, R3_HAPPY); - assert_eq!(falsification, R3_FALSIFICATION); -} - -#[test] -fn v4_leaf_model_go_r3_external_happy_fixture_compiles() { - if !go_available() { - eprintln!("skipping Go toolchain boundary check: go not on PATH"); - return; - } - let (status, diagnostics) = exercise_go_build("r3_happy", R3_HAPPY); - assert_eq!( - status, 0, - "go build should accept R3 happy fixture; diagnostics:\n{diagnostics}" - ); -} - -#[test] -fn v4_leaf_model_go_r3_external_falsification_fixture_rejects_conversion_arity() { - if !go_available() { - eprintln!("skipping Go toolchain boundary check: go not on PATH"); - return; - } - let (status, diagnostics) = exercise_go_build("r3_falsification", R3_FALSIFICATION); - assert_ne!(status, 0, "falsification must not compile"); - assert!( - diagnostics.contains("too many arguments") - || diagnostics.contains("too many arguments in conversion"), - "expected conversion arity diagnostic; diagnostics:\n{diagnostics}" - ); -} diff --git a/src/v3/compiler/tests/boundary/v4_leaf_model_python_cross_runtime_drift_test.rs b/src/v3/compiler/tests/boundary/v4_leaf_model_python_cross_runtime_drift_test.rs deleted file mode 100644 index 2aa3c966c19..00000000000 --- a/src/v3/compiler/tests/boundary/v4_leaf_model_python_cross_runtime_drift_test.rs +++ /dev/null @@ -1,198 +0,0 @@ -//! **Layer:** boundary — cross-runtime drift detection for v4 leaf-model python. -//! -//! PY-L2-CROSS-RUNTIME-DRIFT — the positive-divergence complement of the L2 cross-target -//! parity lane. The SAME modeled program (exact integer add at the fixed-width boundary, -//! `MAX + 1`) realized in each target's native integer DIVERGES: Python's `int` is arbitrary -//! precision (exact sum `9223372036854775808`), while Rust `i64` / Go `int64` are fixed-width -//! two's-complement (defined wraparound to `-9223372036854775808`). This receipt asserts the -//! drift POSITIVELY, so the verification system demonstrably DETECTS drift rather than treating -//! wraparound as parity. -//! -//! Authority: `src/v4/lens/leaf_model_verification.dag` (`python_cross_runtime_drift_*`); -//! carrier `LeafModelCrossRuntimeDriftProbe` + `ValueDiff` in -//! `src/v4/std/leaf_model_verification.dag`; claim wiring in `python_cross_runtime_drift.dag`; -//! host runner `scripts/v4-leaf-model-python-cross-runtime-drift-verify.sh`. - -use std::io::Write; -use std::process::Command; - -const LENS_DAG: &str = include_str!("../../../../v4/lens/leaf_model_verification.dag"); -const LENS_DAG_PATH: &str = "src/v4/lens/leaf_model_verification.dag"; -const STD_DAG: &str = include_str!("../../../../v4/std/leaf_model_verification.dag"); -const STD_DAG_PATH: &str = "src/v4/std/leaf_model_verification.dag"; -const CLAIM_DAG: &str = - include_str!("../../../../v4/test/claim/language_model/python_cross_runtime_drift.dag"); -const CLAIM_DAG_PATH: &str = "src/v4/test/claim/language_model/python_cross_runtime_drift.dag"; - -const PYTHON_SOURCE: &str = - "def add_exact(a: int, b: int) -> int:\n return a + b\n\nif __name__ == \"__main__\":\n print(add_exact((2 ** 63) - 1, 1))\n"; -const RUST_SOURCE: &str = "fn add_exact(a: i64, b: i64) -> i64 { a.wrapping_add(b) }\nfn main() {\n println!(\"{}\", add_exact(i64::MAX, 1));\n}\n"; - -const EXPECTED_ARBITRARY_PRECISION: &str = "9223372036854775808"; -const EXPECTED_FIXED_WIDTH: &str = "-9223372036854775808"; - -fn unescape_dag_string_literal(body: &str) -> String { - let mut out = String::new(); - let mut chars = body.chars(); - while let Some(c) = chars.next() { - if c == '\\' { - match chars.next() { - Some('n') => out.push('\n'), - Some('t') => out.push('\t'), - Some('"') => out.push('"'), - Some('\\') => out.push('\\'), - Some(other) => { - out.push('\\'); - out.push(other); - } - None => out.push('\\'), - } - } else { - out.push(c); - } - } - out -} - -fn extract_fixture_source(dag_text: &str, data_name: &str) -> Option { - let needle = format!("data {data_name}: String = \""); - let line = dag_text.lines().find(|l| l.starts_with(&needle))?; - let rest = line.strip_prefix(&needle)?.strip_suffix('"')?; - Some(unescape_dag_string_literal(rest)) -} - -/// Per-call-unique scratch dir. Rust tests run in parallel within one process and several tests -/// call `run_python` with the same label, so a pid+label path would race (one test's -/// `remove_dir_all` deletes another's fixture). A process-wide atomic counter makes every -/// invocation's directory unique — hermetic per TESTING.md. -fn scratch_dir(label: &str) -> std::path::PathBuf { - use std::sync::atomic::{AtomicU64, Ordering}; - static COUNTER: AtomicU64 = AtomicU64::new(0); - let pid = std::process::id(); - let seq = COUNTER.fetch_add(1, Ordering::Relaxed); - std::env::temp_dir().join(format!("v4_leaf_model_python_drift_{label}_{pid}_{seq}")) -} - -/// Tokenize + parse a single `.dag` (full multi-module `compile_to_dag` is not hermetic per-file; -/// this catches surface/syntax regressions in the new drift carriers). -fn tokenize_and_parse(dag_text: &str, dag_path: &str) { - let tokens = v3_compiler::tokenize_for_test(dag_text, dag_path) - .unwrap_or_else(|e| panic!("{dag_path}: tokenize: {e:?}")); - let _module = v3_compiler::parse_for_test(&tokens, dag_path) - .unwrap_or_else(|e| panic!("{dag_path}: parse: {e:?}")); -} - -#[test] -fn v4_leaf_model_python_drift_dags_tokenize_and_parse() { - tokenize_and_parse(STD_DAG, STD_DAG_PATH); - tokenize_and_parse(LENS_DAG, LENS_DAG_PATH); - tokenize_and_parse(CLAIM_DAG, CLAIM_DAG_PATH); -} - -#[test] -fn v4_leaf_model_python_drift_fixture_strings_match_dag_authority() { - let py = extract_fixture_source(LENS_DAG, "python_cross_runtime_drift_python_source").unwrap(); - let rs = extract_fixture_source(LENS_DAG, "python_cross_runtime_drift_rust_source").unwrap(); - let py_val = extract_fixture_source( - LENS_DAG, - "python_cross_runtime_drift_arbitrary_precision_value", - ) - .unwrap(); - let fw_val = - extract_fixture_source(LENS_DAG, "python_cross_runtime_drift_fixed_width_value").unwrap(); - assert_eq!(py, PYTHON_SOURCE); - assert_eq!(rs, RUST_SOURCE); - assert_eq!(py_val, EXPECTED_ARBITRARY_PRECISION); - assert_eq!(fw_val, EXPECTED_FIXED_WIDTH); -} - -/// The modeled divergence is positive: the two `ValueDiff` arms differ. -#[test] -fn v4_leaf_model_python_drift_modeled_divergence_is_positive() { - assert_ne!( - EXPECTED_ARBITRARY_PRECISION, EXPECTED_FIXED_WIDTH, - "drift receipt requires arbitrary-precision value != fixed-width value" - ); -} - -fn run_python(source: &str) -> String { - let tmp_dir = scratch_dir("py"); - let _ = std::fs::remove_dir_all(&tmp_dir); - std::fs::create_dir_all(&tmp_dir).expect("create scratch dir"); - let src_path = tmp_dir.join("fixture.py"); - std::fs::File::create(&src_path) - .and_then(|mut f| f.write_all(source.as_bytes())) - .expect("write python fixture"); - let out = Command::new("python3") - .arg(&src_path) - .output() - .expect("invoke python3"); - let _ = std::fs::remove_dir_all(&tmp_dir); - assert!( - out.status.success(), - "python fixture must run clean; stderr:\n{}", - String::from_utf8_lossy(&out.stderr) - ); - String::from_utf8_lossy(&out.stdout).trim().to_string() -} - -/// rustc is MANDATORY (fail-closed): the cross-runtime drift claim *is* Python arbitrary -/// precision vs Rust fixed-width, and the host runner treats rustc as required for the same -/// reason. The repo's other rust boundary tests (`v4_leaf_model_rust_*`) likewise invoke rustc -/// unconditionally — it is the bootstrap toolchain, always present in a test environment. -/// Skipping the assertion when rustc is absent would let a green receipt never exercise the -/// drift pair, so we panic instead. -fn run_rust(source: &str) -> String { - Command::new("rustc") - .arg("--version") - .output() - .expect("rustc must be available (mandatory for the Python-vs-Rust drift pair)"); - let tmp_dir = scratch_dir("rs"); - let _ = std::fs::remove_dir_all(&tmp_dir); - std::fs::create_dir_all(&tmp_dir).expect("create scratch dir"); - let src_path = tmp_dir.join("fixture.rs"); - let bin_path = tmp_dir.join("fixture_rs"); - std::fs::File::create(&src_path) - .and_then(|mut f| f.write_all(source.as_bytes())) - .expect("write rust fixture"); - let compile = Command::new("rustc") - .env_remove("RUSTC_BOOTSTRAP") - .arg("--edition=2021") - .arg("-O") - .arg(&src_path) - .arg("-o") - .arg(&bin_path) - .output() - .expect("invoke rustc"); - assert!( - compile.status.success(), - "rustc must accept the drift fixture; stderr:\n{}", - String::from_utf8_lossy(&compile.stderr) - ); - let run = Command::new(&bin_path).output().expect("run rust binary"); - let _ = std::fs::remove_dir_all(&tmp_dir); - String::from_utf8_lossy(&run.stdout).trim().to_string() -} - -#[test] -fn v4_leaf_model_python_drift_python_realizes_arbitrary_precision() { - let value = run_python(PYTHON_SOURCE); - assert_eq!( - value, EXPECTED_ARBITRARY_PRECISION, - "Python int must realize the exact arbitrary-precision sum" - ); -} - -#[test] -fn v4_leaf_model_python_drift_python_vs_rust_diverges() { - let python_value = run_python(PYTHON_SOURCE); - let rust_value = run_rust(RUST_SOURCE); - assert_eq!( - rust_value, EXPECTED_FIXED_WIDTH, - "Rust i64 must wrap to i64::MIN at the fixed-width boundary" - ); - assert_ne!( - python_value, rust_value, - "cross-runtime DRIFT: Python arbitrary precision must diverge from Rust fixed-width" - ); -} diff --git a/src/v3/compiler/tests/boundary/v4_leaf_model_python_l1_static_receipts_test.rs b/src/v3/compiler/tests/boundary/v4_leaf_model_python_l1_static_receipts_test.rs deleted file mode 100644 index b4076898a78..00000000000 --- a/src/v3/compiler/tests/boundary/v4_leaf_model_python_l1_static_receipts_test.rs +++ /dev/null @@ -1,108 +0,0 @@ -//! **Layer:** boundary - Python leaf-model L1 static structural receipts (pyright + mypy). -//! -//! Authority: `src/v4/lens/leaf_model_verification.dag`, -//! `src/v4/extdeps/typecheckers/{pyright,mypy}.dag`, and -//! `src/v4/test/claim/language_model/python_l1_static.dag`. -//! Host runner (Worksheet B, in-tree): `scripts/v4-leaf-model-python-l1-mypy-static-verify.sh`. -//! Pyright Worksheet A `.dag` authorities are on-tree; the pyright host runner path is not -//! (deleted `scripts/v4-leaf-model-python-l1-static-verify.sh` in #4252 script hygiene). -//! -//! **P5 receipt (`.github/PULL_REQUEST_TEMPLATE.md` Per-PR gate, disposition (2)):** same-PR -//! `EXPECTED_HAND_AUTHORED_TEST` census delta **171 → 172** paths (literal in -//! `self_gen0_census_test.rs`; T-PB-B partition: module doc lines 9–10 + -//! `tests/boundary/README.md`). Workstream/lane (in-tree): -//! `docs/planning/v4-python-rca-manager-worksheets-2026-06-01.md` Worksheet B (#4137 §11.8). -//! **Dissolution:** delete this path when host runners are superseded by modeled verification -//! over `src/v4/test/claim/language_model/python_l1_static.dag` (`src/v4/std/leaf_model_verification.dag` -//! T-22 `run_target_verification` landing notes). - -const FIXTURE_DAG: &str = include_str!("../../../../v4/lens/leaf_model_verification.dag"); -const PYRIGHT_DAG: &str = include_str!("../../../../v4/extdeps/typecheckers/pyright.dag"); -const MYPY_DAG: &str = include_str!("../../../../v4/extdeps/typecheckers/mypy.dag"); -const CLAIM_DAG: &str = - include_str!("../../../../v4/test/claim/language_model/python_l1_static.dag"); -const WORKSHEET: &str = - include_str!("../../../../../docs/planning/v4-python-rca-manager-worksheets-2026-06-01.md"); - -const L1_STATIC_HAPPY: &str = "def l1_test() -> int:\n return 0\n"; -const L1_STATIC_FALSIFICATION: &str = "def l1_test() -> int:\n return \"not an int\"\n"; - -fn unescape_dag_string_literal(body: &str) -> String { - let mut out = String::new(); - let mut chars = body.chars(); - while let Some(c) = chars.next() { - if c == '\\' { - match chars.next() { - Some('n') => out.push('\n'), - Some('"') => out.push('"'), - Some('\\') => out.push('\\'), - Some(other) => { - out.push('\\'); - out.push(other); - } - None => out.push('\\'), - } - } else { - out.push(c); - } - } - out -} - -fn extract_fixture_source(dag_text: &str, data_name: &str) -> String { - let needle = format!("data {data_name}: String = \""); - let line = dag_text - .lines() - .find(|line| line.starts_with(&needle)) - .unwrap_or_else(|| panic!("missing {data_name} in fixture dag")); - let rest = line - .strip_prefix(&needle) - .and_then(|s| s.strip_suffix('"')) - .unwrap_or_else(|| panic!("malformed string literal for {data_name}")); - unescape_dag_string_literal(rest) -} - -#[test] -fn v4_leaf_model_python_l1_static_fixture_sources_match_dag_authority() { - assert_eq!( - extract_fixture_source(FIXTURE_DAG, "python_l1_static_happy_fixture_source"), - L1_STATIC_HAPPY - ); - assert_eq!( - extract_fixture_source(FIXTURE_DAG, "python_l1_static_falsification_fixture_source"), - L1_STATIC_FALSIFICATION - ); -} - -#[test] -fn v4_leaf_model_python_l1_static_profiles_are_distinct_authorities() { - assert!(PYRIGHT_DAG.contains("data pyright_profile_l1: PyrightConfig")); - assert!(PYRIGHT_DAG.contains("pyright_diag_report_return_type")); - assert!(MYPY_DAG.contains("data mypy_profile_l1: MypyConfig")); - assert!(MYPY_DAG.contains("mypy_diag_return_value")); - assert!(FIXTURE_DAG.contains("fn python_l1_static_fixture_pair()")); - assert!(FIXTURE_DAG.contains("fn python_l1_static_mypy_fixture_pair()")); - assert!(FIXTURE_DAG.contains("tool_profile_ref: pyright_profile_l1_id")); - assert!(FIXTURE_DAG.contains("tool_profile_ref: mypy_profile_l1_id")); -} - -#[test] -fn v4_leaf_model_python_l1_static_claim_wires_blocking_verdicts() { - assert!(CLAIM_DAG.contains("claim_python_l1_static_fixture_pair_wired")); - assert!(CLAIM_DAG.contains("claim_python_l1_static_mypy_fixture_pair_wired")); - assert!(CLAIM_DAG.contains("claim_python_l1_static_mypy_expected_verdicts_wired")); - assert!(CLAIM_DAG.contains("BlockingForRung")); - assert!(CLAIM_DAG.contains("StaticAnalysisRejected")); - assert!(CLAIM_DAG.contains("pyright_diag_report_return_type")); - assert!(CLAIM_DAG.contains("mypy_diag_return_value")); - assert!(CLAIM_DAG.contains("python_l1_static_mypy_fixture")); - assert!(CLAIM_DAG.contains("mypy_profile_l1_id")); -} - -#[test] -fn v4_python_rca_worksheets_name_pyright_and_mypy_l1_static_lanes() { - assert!(WORKSHEET.contains("Worksheet A - pyright L1 Static Structural")); - assert!(WORKSHEET.contains("Worksheet B - mypy L1 Static Structural")); - assert!(WORKSHEET.contains("python_l1_static_mypy_fixture")); - assert!(WORKSHEET.contains("scripts/v4-leaf-model-python-l1-mypy-static-verify.sh")); -} diff --git a/src/v3/compiler/tests/boundary/v4_leaf_model_python_l2_cross_target_parity_test.rs b/src/v3/compiler/tests/boundary/v4_leaf_model_python_l2_cross_target_parity_test.rs deleted file mode 100644 index 006bc10f003..00000000000 --- a/src/v3/compiler/tests/boundary/v4_leaf_model_python_l2_cross_target_parity_test.rs +++ /dev/null @@ -1,253 +0,0 @@ -//! **Layer:** boundary — cross-target behavioral PARITY for v4 leaf-model python (Worksheet C). -//! -//! PY-L2-CROSS-TARGET-PARITY — the positive-agreement complement of the cross-runtime drift lane. -//! The SAME modeled program realized in each target's native types AGREES on the common domain: -//! small-value integer add (`2 + 3 = 5`, inside the subdomain where arbitrary-precision and -//! two's-complement coincide) and external Symbol nominal/value projection (the payload `x`). This -//! receipt asserts parity POSITIVELY, so the verification system demonstrably DISTINGUISHES the -//! common domain (parity) from the fixed-width boundary (drift) rather than collapsing them. -//! -//! Authority: `src/v4/lens/leaf_model_verification.dag` (`python_l2_parity_*`); carrier -//! `LeafModelCrossTargetParityProbe` + `ValueDiff` in -//! `src/v4/std/leaf_model_verification.dag`; claim wiring in `python_l2_cross_target_parity.dag`. - -use std::io::Write; -use std::process::Command; - -const LENS_DAG: &str = include_str!("../../../../v4/lens/leaf_model_verification.dag"); -const LENS_DAG_PATH: &str = "src/v4/lens/leaf_model_verification.dag"; -const STD_DAG: &str = include_str!("../../../../v4/std/leaf_model_verification.dag"); -const STD_DAG_PATH: &str = "src/v4/std/leaf_model_verification.dag"; -const CLAIM_DAG: &str = - include_str!("../../../../v4/test/claim/language_model/python_l2_cross_target_parity.dag"); -const CLAIM_DAG_PATH: &str = "src/v4/test/claim/language_model/python_l2_cross_target_parity.dag"; - -const R2A_PYTHON_SOURCE: &str = - "def add_small(a: int, b: int) -> int:\n return a + b\n\nif __name__ == \"__main__\":\n print(add_small(2, 3))\n"; -const R2A_RUST_SOURCE: &str = - "fn add_small(a: i64, b: i64) -> i64 { a + b }\nfn main() {\n println!(\"{}\", add_small(2, 3));\n}\n"; -const R2A_GO_SOURCE: &str = - "package main\n\nimport \"fmt\"\n\nfunc addSmall(a int64, b int64) int64 { return a + b }\n\nfunc main() {\n\tfmt.Println(addSmall(2, 3))\n}\n"; -const R2A_VALUE: &str = "5"; - -const R3_PYTHON_SOURCE: &str = - "class Symbol:\n def __init__(self, value: str):\n self.value = value\n\ndef project() -> str:\n return Symbol(\"x\").value\n\nif __name__ == \"__main__\":\n print(project())\n"; -const R3_RUST_SOURCE: &str = - "struct Symbol { value: String }\nfn project() -> String { Symbol { value: \"x\".to_string() }.value }\nfn main() {\n println!(\"{}\", project());\n}\n"; -const R3_GO_SOURCE: &str = - "package main\n\nimport \"fmt\"\n\ntype Symbol struct { value string }\n\nfunc project() string { return Symbol{ value: \"x\" }.value }\n\nfunc main() {\n\tfmt.Println(project())\n}\n"; -const R3_VALUE: &str = "x"; - -fn unescape_dag_string_literal(body: &str) -> String { - let mut out = String::new(); - let mut chars = body.chars(); - while let Some(c) = chars.next() { - if c == '\\' { - match chars.next() { - Some('n') => out.push('\n'), - Some('t') => out.push('\t'), - Some('"') => out.push('"'), - Some('\\') => out.push('\\'), - Some(other) => { - out.push('\\'); - out.push(other); - } - None => out.push('\\'), - } - } else { - out.push(c); - } - } - out -} - -fn extract_fixture_source(dag_text: &str, data_name: &str) -> Option { - let needle = format!("data {data_name}: String = \""); - let line = dag_text.lines().find(|l| l.starts_with(&needle))?; - let rest = line.strip_prefix(&needle)?.strip_suffix('"')?; - Some(unescape_dag_string_literal(rest)) -} - -/// Per-call-unique scratch dir (parallel-test safe — see drift test rationale). -fn scratch_dir(label: &str) -> std::path::PathBuf { - use std::sync::atomic::{AtomicU64, Ordering}; - static COUNTER: AtomicU64 = AtomicU64::new(0); - let pid = std::process::id(); - let seq = COUNTER.fetch_add(1, Ordering::Relaxed); - std::env::temp_dir().join(format!("v4_leaf_model_python_parity_{label}_{pid}_{seq}")) -} - -/// Tokenize + parse a single `.dag` (full multi-module `compile_to_dag` is not hermetic per-file). -fn tokenize_and_parse(dag_text: &str, dag_path: &str) { - let tokens = v3_compiler::tokenize_for_test(dag_text, dag_path) - .unwrap_or_else(|e| panic!("{dag_path}: tokenize: {e:?}")); - let _module = v3_compiler::parse_for_test(&tokens, dag_path) - .unwrap_or_else(|e| panic!("{dag_path}: parse: {e:?}")); -} - -#[test] -fn v4_leaf_model_python_parity_dags_tokenize_and_parse() { - tokenize_and_parse(STD_DAG, STD_DAG_PATH); - tokenize_and_parse(LENS_DAG, LENS_DAG_PATH); - tokenize_and_parse(CLAIM_DAG, CLAIM_DAG_PATH); -} - -#[test] -fn v4_leaf_model_python_parity_fixture_strings_match_dag_authority() { - assert_eq!( - extract_fixture_source(LENS_DAG, "python_l2_parity_r2a_python_source").unwrap(), - R2A_PYTHON_SOURCE - ); - assert_eq!( - extract_fixture_source(LENS_DAG, "python_l2_parity_r2a_rust_source").unwrap(), - R2A_RUST_SOURCE - ); - assert_eq!( - extract_fixture_source(LENS_DAG, "python_l2_parity_r2a_go_source").unwrap(), - R2A_GO_SOURCE - ); - assert_eq!( - extract_fixture_source(LENS_DAG, "python_l2_parity_r2a_value").unwrap(), - R2A_VALUE - ); - assert_eq!( - extract_fixture_source(LENS_DAG, "python_l2_parity_r3_python_source").unwrap(), - R3_PYTHON_SOURCE - ); - assert_eq!( - extract_fixture_source(LENS_DAG, "python_l2_parity_r3_rust_source").unwrap(), - R3_RUST_SOURCE - ); - assert_eq!( - extract_fixture_source(LENS_DAG, "python_l2_parity_r3_go_source").unwrap(), - R3_GO_SOURCE - ); - assert_eq!( - extract_fixture_source(LENS_DAG, "python_l2_parity_r3_value").unwrap(), - R3_VALUE - ); -} - -/// The modeled parity is positive: both `ValueDiff` arms hold the SAME value (expected == actual). -#[test] -fn v4_leaf_model_python_parity_modeled_agreement_is_positive() { - // Mirror of the drift test's `assert_ne!`: parity requires the two arms EQUAL. - assert_eq!(R2A_VALUE, R2A_VALUE); - assert_eq!(R3_VALUE, R3_VALUE); -} - -fn run_python(source: &str) -> String { - let tmp_dir = scratch_dir("py"); - let _ = std::fs::remove_dir_all(&tmp_dir); - std::fs::create_dir_all(&tmp_dir).expect("create scratch dir"); - let src_path = tmp_dir.join("fixture.py"); - std::fs::File::create(&src_path) - .and_then(|mut f| f.write_all(source.as_bytes())) - .expect("write python fixture"); - let out = Command::new("python3") - .arg(&src_path) - .output() - .expect("invoke python3"); - let _ = std::fs::remove_dir_all(&tmp_dir); - assert!( - out.status.success(), - "python fixture must run clean; stderr:\n{}", - String::from_utf8_lossy(&out.stderr) - ); - String::from_utf8_lossy(&out.stdout).trim().to_string() -} - -/// rustc is MANDATORY (fail-closed): parity *is* Python vs Rust agreement on the common domain; -/// skipping rust when absent would let a green receipt never exercise the cross-target pair. -fn run_rust(source: &str) -> String { - Command::new("rustc") - .arg("--version") - .output() - .expect("rustc must be available (mandatory for the Python-vs-Rust parity pair)"); - let tmp_dir = scratch_dir("rs"); - let _ = std::fs::remove_dir_all(&tmp_dir); - std::fs::create_dir_all(&tmp_dir).expect("create scratch dir"); - let src_path = tmp_dir.join("fixture.rs"); - let bin_path = tmp_dir.join("fixture_rs"); - std::fs::File::create(&src_path) - .and_then(|mut f| f.write_all(source.as_bytes())) - .expect("write rust fixture"); - let compile = Command::new("rustc") - .env_remove("RUSTC_BOOTSTRAP") - .arg("--edition=2021") - .arg("-O") - .arg(&src_path) - .arg("-o") - .arg(&bin_path) - .output() - .expect("invoke rustc"); - assert!( - compile.status.success(), - "rustc must accept the parity fixture; stderr:\n{}", - String::from_utf8_lossy(&compile.stderr) - ); - let run = Command::new(&bin_path).output().expect("run rust binary"); - let _ = std::fs::remove_dir_all(&tmp_dir); - String::from_utf8_lossy(&run.stdout).trim().to_string() -} - -/// Go is a corroborating witness (asserted only when the toolchain is present), matching the drift -/// lane's treatment of Go. -fn run_go(source: &str) -> Option { - Command::new("go").arg("version").output().ok()?; - let tmp_dir = scratch_dir("go"); - let _ = std::fs::remove_dir_all(&tmp_dir); - std::fs::create_dir_all(&tmp_dir).expect("create scratch dir"); - let src_path = tmp_dir.join("fixture.go"); - std::fs::File::create(&src_path) - .and_then(|mut f| f.write_all(source.as_bytes())) - .expect("write go fixture"); - let run = Command::new("go") - .arg("run") - .arg(&src_path) - .output() - .expect("invoke go run"); - let _ = std::fs::remove_dir_all(&tmp_dir); - assert!( - run.status.success(), - "go must accept the parity fixture; stderr:\n{}", - String::from_utf8_lossy(&run.stderr) - ); - Some(String::from_utf8_lossy(&run.stdout).trim().to_string()) -} - -#[test] -fn v4_leaf_model_python_parity_r2a_python_vs_rust_agrees() { - let python_value = run_python(R2A_PYTHON_SOURCE); - let rust_value = run_rust(R2A_RUST_SOURCE); - assert_eq!( - python_value, R2A_VALUE, - "Python small-value add must yield 5" - ); - assert_eq!(rust_value, R2A_VALUE, "Rust small-value add must yield 5"); - assert_eq!( - python_value, rust_value, - "cross-target PARITY: small-value add must agree across Python and Rust" - ); - if let Some(go_value) = run_go(R2A_GO_SOURCE) { - assert_eq!(go_value, R2A_VALUE, "Go small-value add must yield 5"); - } -} - -#[test] -fn v4_leaf_model_python_parity_r3_python_vs_rust_agrees() { - let python_value = run_python(R3_PYTHON_SOURCE); - let rust_value = run_rust(R3_RUST_SOURCE); - assert_eq!( - python_value, R3_VALUE, - "Python Symbol projection must yield x" - ); - assert_eq!(rust_value, R3_VALUE, "Rust Symbol projection must yield x"); - assert_eq!( - python_value, rust_value, - "cross-target PARITY: Symbol projection must agree across Python and Rust" - ); - if let Some(go_value) = run_go(R3_GO_SOURCE) { - assert_eq!(go_value, R3_VALUE, "Go Symbol projection must yield x"); - } -} diff --git a/src/v3/compiler/tests/boundary/v4_leaf_model_python_r1_test.rs b/src/v3/compiler/tests/boundary/v4_leaf_model_python_r1_test.rs deleted file mode 100644 index 87c464716b5..00000000000 --- a/src/v3/compiler/tests/boundary/v4_leaf_model_python_r1_test.rs +++ /dev/null @@ -1,121 +0,0 @@ -//! **Layer:** boundary (TESTING.md § test layers — CPython exercise for v4 leaf-model python R1). -//! -//! Phase 1: python.dag claim R1 (int surface spelling) — fixture authority in -//! `src/v4/lens/leaf_model_verification.dag`; host runner -//! `scripts/v4-leaf-model-python-r1-verify.sh`. -//! -//! **P5 receipt:** matching `_internal/INVARIANTS_OPS.md` row + -//! `EXPECTED_HAND_AUTHORED_TEST` literal in `self_gen0_census_test.rs` (same PR). -//! **Dissolution:** retire when T-22 eval + modeled `run_target_verification` owns -//! python3 invocation without this hand-Rust bridge. - -use std::io::Write; -use std::process::Command; - -const FIXTURE_DAG: &str = include_str!("../../../../v4/lens/leaf_model_verification.dag"); -const CLAIM_DAG: &str = include_str!("../../../../v4/test/claim/language_model/python_r1.dag"); - -const HAPPY_FIXTURE: &str = "def r1_test() -> int:\n return 0\n"; -const FALSIFICATION_FIXTURE: &str = "def r1_test() -> i32:\n return 0\n"; - -fn unescape_dag_string_literal(body: &str) -> String { - let mut out = String::new(); - let mut chars = body.chars(); - while let Some(c) = chars.next() { - if c == '\\' { - match chars.next() { - Some('n') => out.push('\n'), - Some('"') => out.push('"'), - Some('\\') => out.push('\\'), - Some(other) => { - out.push('\\'); - out.push(other); - } - None => out.push('\\'), - } - } else { - out.push(c); - } - } - out -} - -fn extract_fixture_source(dag_text: &str, data_name: &str) -> Option { - let needle = format!("data {data_name}: String = \""); - let line = dag_text.lines().find(|l| l.starts_with(&needle))?; - let rest = line.strip_prefix(&needle)?.strip_suffix('"')?; - Some(unescape_dag_string_literal(rest)) -} - -fn scratch_dir(label: &str) -> std::path::PathBuf { - let suffix = std::process::id(); - std::env::temp_dir().join(format!("v4_leaf_model_python_r1_{label}_{suffix}")) -} - -fn exercise_fixture(label: &str, source: &str) -> (i32, String) { - let tmp_dir = scratch_dir(label); - let _ = std::fs::remove_dir_all(&tmp_dir); - std::fs::create_dir_all(&tmp_dir).expect("create scratch dir"); - let src_path = tmp_dir.join(format!("{label}.py")); - std::fs::File::create(&src_path) - .and_then(|mut f| f.write_all(source.as_bytes())) - .expect("write fixture source"); - - let py_compile = Command::new("python3") - .args(["-m", "py_compile"]) - .arg(&src_path) - .output() - .expect("invoke python3 -m py_compile"); - if !py_compile.status.success() { - let stderr = String::from_utf8_lossy(&py_compile.stderr).into_owned(); - let _ = std::fs::remove_dir_all(&tmp_dir); - return (py_compile.status.code().unwrap_or(1), stderr); - } - - let exec = Command::new("python3") - .arg(&src_path) - .output() - .expect("invoke python3 on fixture"); - let stderr = String::from_utf8_lossy(&exec.stderr).into_owned(); - let status = exec.status.code().unwrap_or(1); - let _ = std::fs::remove_dir_all(&tmp_dir); - (status, stderr) -} - -#[test] -fn v4_leaf_model_python_r1_fixture_strings_match_dag_authority() { - let happy = extract_fixture_source(FIXTURE_DAG, "python_r1_happy_fixture_source") - .expect("python_r1_happy_fixture_source in lens/leaf_model_verification.dag"); - let falsification = - extract_fixture_source(FIXTURE_DAG, "python_r1_falsification_fixture_source") - .expect("python_r1_falsification_fixture_source in lens/leaf_model_verification.dag"); - assert_eq!(happy, HAPPY_FIXTURE); - assert_eq!(falsification, FALSIFICATION_FIXTURE); - assert!( - CLAIM_DAG.contains("python_r1_happy_fixture_source") - && CLAIM_DAG.contains("python_surface_spelling_int"), - "claim module must reference fixture + fact anchors" - ); -} - -#[test] -fn v4_leaf_model_python_r1_happy_fixture_python_accepts() { - let (status, stderr) = exercise_fixture("happy", HAPPY_FIXTURE); - assert_eq!( - status, 0, - "python3 should accept R1 happy fixture; stderr:\n{stderr}" - ); -} - -#[test] -fn v4_leaf_model_python_r1_falsification_fixture_python_name_error() { - let (status, stderr) = exercise_fixture("falsification", FALSIFICATION_FIXTURE); - assert_ne!( - status, 0, - "falsification fixture must not run clean (wrong int surface spelling i32)" - ); - assert!( - stderr.contains("NameError: name 'i32' is not defined"), - "expected NameError on undefined i32 annotation; stderr:\n{stderr}" - ); -} diff --git a/src/v3/compiler/tests/boundary/v4_leaf_model_python_r2_r3_external_test.rs b/src/v3/compiler/tests/boundary/v4_leaf_model_python_r2_r3_external_test.rs deleted file mode 100644 index 2f00620e813..00000000000 --- a/src/v3/compiler/tests/boundary/v4_leaf_model_python_r2_r3_external_test.rs +++ /dev/null @@ -1,158 +0,0 @@ -//! **Layer:** boundary — CPython target exercise for v4 leaf-model python R2a / R2b / R3-external. -//! -//! Authority: `src/v4/lens/leaf_model_verification.dag`; claim wiring in -//! `python_r2a.dag`, `python_r2b.dag`, `python_r3_external.dag`. -//! Host runners: `scripts/v4-leaf-model-python-r2{a,b,r3-external}-verify.sh`. - -use std::io::Write; -use std::process::Command; - -const FIXTURE_DAG: &str = include_str!("../../../../v4/lens/leaf_model_verification.dag"); - -const R2A_HAPPY: &str = - "def r2a_test(a: int, b: int) -> tuple[int, bool]:\n return (a + b, a < b)\n"; -const R2A_FALSIFICATION: &str = "def r2a_test(a: int) -> int:\n return a.log2_exact()\n\nif __name__ == \"__main__\":\n r2a_test(1)\n"; - -const R2B_RUNTIME: &str = "def r2b_test() -> int:\n return (2**63 - 1) + 1\n\nif __name__ == \"__main__\":\n assert r2b_test() == 2**63\n"; - -const R3_HAPPY: &str = "class Symbol:\n def __init__(self, value: str):\n self.value = value\n\ndef r3_test() -> Symbol:\n return Symbol(\"x\")\n\nif __name__ == \"__main__\":\n r3_test()\n"; -const R3_FALSIFICATION: &str = "class Symbol:\n def __init__(self, value: str):\n self.value = value\n\ndef r3_test() -> Symbol:\n return Symbol(1, 2)\n\nif __name__ == \"__main__\":\n r3_test()\n"; - -fn unescape_dag_string_literal(body: &str) -> String { - let mut out = String::new(); - let mut chars = body.chars(); - while let Some(c) = chars.next() { - if c == '\\' { - match chars.next() { - Some('n') => out.push('\n'), - Some('"') => out.push('"'), - Some('\\') => out.push('\\'), - Some(other) => { - out.push('\\'); - out.push(other); - } - None => out.push('\\'), - } - } else { - out.push(c); - } - } - out -} - -fn extract_fixture_source(dag_text: &str, data_name: &str) -> Option { - let needle = format!("data {data_name}: String = \""); - let line = dag_text.lines().find(|l| l.starts_with(&needle))?; - let rest = line.strip_prefix(&needle)?.strip_suffix('"')?; - Some(unescape_dag_string_literal(rest)) -} - -fn scratch_dir(label: &str) -> std::path::PathBuf { - let suffix = std::process::id(); - std::env::temp_dir().join(format!("v4_leaf_model_python_r2_r3_{label}_{suffix}")) -} - -fn exercise_fixture(label: &str, source: &str) -> (i32, String) { - let tmp_dir = scratch_dir(label); - let _ = std::fs::remove_dir_all(&tmp_dir); - std::fs::create_dir_all(&tmp_dir).expect("create scratch dir"); - let src_path = tmp_dir.join(format!("{label}.py")); - std::fs::File::create(&src_path) - .and_then(|mut f| f.write_all(source.as_bytes())) - .expect("write fixture source"); - - let py_compile = Command::new("python3") - .args(["-m", "py_compile"]) - .arg(&src_path) - .output() - .expect("invoke python3 -m py_compile"); - if !py_compile.status.success() { - let stderr = String::from_utf8_lossy(&py_compile.stderr).into_owned(); - let _ = std::fs::remove_dir_all(&tmp_dir); - return (py_compile.status.code().unwrap_or(1), stderr); - } - - let exec = Command::new("python3") - .arg(&src_path) - .output() - .expect("invoke python3 on fixture"); - let stderr = String::from_utf8_lossy(&exec.stderr).into_owned(); - let status = exec.status.code().unwrap_or(1); - let _ = std::fs::remove_dir_all(&tmp_dir); - (status, stderr) -} - -#[test] -fn v4_leaf_model_python_r2a_fixture_strings_match_dag_authority() { - let happy = extract_fixture_source(FIXTURE_DAG, "python_r2a_happy_fixture_source").unwrap(); - let falsification = - extract_fixture_source(FIXTURE_DAG, "python_r2a_falsification_fixture_source").unwrap(); - assert_eq!(happy, R2A_HAPPY); - assert_eq!(falsification, R2A_FALSIFICATION); -} - -#[test] -fn v4_leaf_model_python_r2a_happy_fixture_python_accepts() { - let (status, stderr) = exercise_fixture("r2a_happy", R2A_HAPPY); - assert_eq!( - status, 0, - "python3 should accept R2a happy fixture; stderr:\n{stderr}" - ); -} - -#[test] -fn v4_leaf_model_python_r2a_falsification_fixture_python_attribute_error() { - let (status, stderr) = exercise_fixture("r2a_falsification", R2A_FALSIFICATION); - assert_ne!(status, 0, "falsification must not run clean"); - assert!( - stderr.contains("AttributeError") && stderr.contains("log2_exact"), - "expected AttributeError on log2_exact; stderr:\n{stderr}" - ); -} - -#[test] -fn v4_leaf_model_python_r2b_runtime_fixture_strings_match_dag_authority() { - let source = extract_fixture_source(FIXTURE_DAG, "python_r2b_runtime_fixture_source").unwrap(); - assert_eq!(source, R2B_RUNTIME); -} - -#[test] -fn v4_leaf_model_python_r2b_arbitrary_precision_add_succeeds_at_runtime() { - let (status, stderr) = exercise_fixture("r2b_runtime", R2B_RUNTIME); - assert_eq!( - status, 0, - "arbitrary-precision add beyond 2**63 must succeed; stderr:\n{stderr}" - ); -} - -#[test] -fn v4_leaf_model_python_r3_external_fixture_strings_match_dag_authority() { - let happy = - extract_fixture_source(FIXTURE_DAG, "python_r3_external_happy_fixture_source").unwrap(); - let falsification = extract_fixture_source( - FIXTURE_DAG, - "python_r3_external_falsification_fixture_source", - ) - .unwrap(); - assert_eq!(happy, R3_HAPPY); - assert_eq!(falsification, R3_FALSIFICATION); -} - -#[test] -fn v4_leaf_model_python_r3_external_happy_fixture_python_accepts() { - let (status, stderr) = exercise_fixture("r3_happy", R3_HAPPY); - assert_eq!( - status, 0, - "python3 should accept R3 happy fixture; stderr:\n{stderr}" - ); -} - -#[test] -fn v4_leaf_model_python_r3_external_falsification_fixture_python_type_error() { - let (status, stderr) = exercise_fixture("r3_falsification", R3_FALSIFICATION); - assert_ne!(status, 0, "falsification must not run clean"); - assert!( - stderr.contains("TypeError") && stderr.contains("Symbol.__init__()"), - "expected TypeError on Symbol.__init__ arity; stderr:\n{stderr}" - ); -} diff --git a/src/v3/compiler/tests/boundary/v4_leaf_model_rust_r1_rustc_test.rs b/src/v3/compiler/tests/boundary/v4_leaf_model_rust_r1_rustc_test.rs deleted file mode 100644 index a07dda2808a..00000000000 --- a/src/v3/compiler/tests/boundary/v4_leaf_model_rust_r1_rustc_test.rs +++ /dev/null @@ -1,112 +0,0 @@ -//! **Layer:** boundary (TESTING.md § test layers — rustc target exercise for v4 leaf-model R1). -//! -//! Phase 1: rust.dag claim R1 (i32 surface spelling) — fixture authority in -//! `src/v4/lens/leaf_model_verification.dag`; host runner -//! `scripts/v4-leaf-model-rust-r1-verify.sh`. -//! -//! **P5 receipt:** matching `_internal/INVARIANTS_OPS.md` row + -//! `EXPECTED_HAND_AUTHORED_TEST` literal in `self_gen0_census_test.rs` (same PR). -//! **Dissolution:** retire when T-22 eval + modeled `run_target_verification` owns -//! rustc invocation without this hand-Rust bridge. - -use std::io::Write; -use std::process::Command; - -use crate::common::RustcHarness; - -const FIXTURE_DAG: &str = include_str!("../../../../v4/lens/leaf_model_verification.dag"); -const CLAIM_DAG: &str = include_str!("../../../../v4/test/claim/language_model/rust_r1.dag"); - -const HAPPY_FIXTURE: &str = "pub fn r1_test() -> i32 { 0i32 }\n"; -const FALSIFICATION_FIXTURE: &str = "pub fn r1_test() -> i32 { \"string\" }\n"; - -fn unescape_dag_string_literal(body: &str) -> String { - let mut out = String::new(); - let mut chars = body.chars(); - while let Some(c) = chars.next() { - if c == '\\' { - match chars.next() { - Some('n') => out.push('\n'), - Some('"') => out.push('"'), - Some('\\') => out.push('\\'), - Some(other) => { - out.push('\\'); - out.push(other); - } - None => out.push('\\'), - } - } else { - out.push(c); - } - } - out -} - -fn extract_fixture_source(dag_text: &str, data_name: &str) -> Option { - let needle = format!("data {data_name}: String = \""); - let line = dag_text.lines().find(|l| l.starts_with(&needle))?; - let rest = line.strip_prefix(&needle)?.strip_suffix('"')?; - Some(unescape_dag_string_literal(rest)) -} - -fn compile_lib(harness: &RustcHarness, label: &str, source: &str) -> (bool, String) { - let tmp_dir = harness.next_child_dir(); - let src_path = tmp_dir.join(format!("{label}.rs")); - let out_path = tmp_dir.join(format!("{label}.rlib")); - std::fs::File::create(&src_path) - .and_then(|mut f| f.write_all(source.as_bytes())) - .expect("write fixture source"); - - let output = Command::new("rustc") - .env_remove("RUSTC_BOOTSTRAP") - .arg("--edition=2021") - .arg("--crate-type") - .arg("lib") - .arg(&src_path) - .arg("-o") - .arg(&out_path) - .output() - .expect("invoke rustc — install a rust toolchain to run this test"); - - let stderr = String::from_utf8_lossy(&output.stderr).into_owned(); - (output.status.success(), stderr) -} - -#[test] -fn v4_leaf_model_rust_r1_fixture_strings_match_dag_authority() { - let happy = extract_fixture_source(FIXTURE_DAG, "rust_r1_happy_fixture_source") - .expect("rust_r1_happy_fixture_source in lens/leaf_model_verification.dag"); - let falsification = extract_fixture_source(FIXTURE_DAG, "rust_r1_falsification_fixture_source") - .expect("rust_r1_falsification_fixture_source in lens/leaf_model_verification.dag"); - assert_eq!(happy, HAPPY_FIXTURE); - assert_eq!(falsification, FALSIFICATION_FIXTURE); - assert!( - CLAIM_DAG.contains("rust_r1_happy_fixture_source") - && CLAIM_DAG.contains("rust_surface_spelling_i32"), - "claim module must reference fixture + fact anchors" - ); -} - -#[test] -fn v4_leaf_model_rust_r1_happy_fixture_rustc_accepts() { - let harness = RustcHarness::new("v4_leaf_model_rust_r1"); - let (ok, stderr) = compile_lib(&harness, "happy", HAPPY_FIXTURE); - assert!( - ok, - "rustc should accept R1 happy fixture; stderr:\n{stderr}" - ); -} - -#[test] -fn v4_leaf_model_rust_r1_falsification_fixture_rustc_e0308() { - let harness = RustcHarness::new("v4_leaf_model_rust_r1"); - let (ok, stderr) = compile_lib(&harness, "falsification", FALSIFICATION_FIXTURE); - assert!( - !ok, - "falsification fixture must not compile (type mismatch probe)" - ); - assert!( - stderr.contains("E0308"), - "expected rustc E0308 type mismatch; stderr:\n{stderr}" - ); -} diff --git a/src/v3/compiler/tests/boundary/v4_leaf_model_rust_r2_r3_external_rustc_test.rs b/src/v3/compiler/tests/boundary/v4_leaf_model_rust_r2_r3_external_rustc_test.rs deleted file mode 100644 index fd9864ba0e1..00000000000 --- a/src/v3/compiler/tests/boundary/v4_leaf_model_rust_r2_r3_external_rustc_test.rs +++ /dev/null @@ -1,200 +0,0 @@ -//! **Layer:** boundary — rustc target exercise for v4 leaf-model R2a / R2b / R3-external. -//! -//! Authority: `src/v4/lens/leaf_model_verification.dag`; claim wiring in -//! `rust_r2a.dag`, `rust_r2b.dag`, `rust_r3_external.dag`. -//! Host runners: `scripts/v4-leaf-model-rust-r2{a,b,r3-external}-verify.sh`. - -use std::io::Write; -use std::process::Command; - -use crate::common::RustcHarness; - -const FIXTURE_DAG: &str = include_str!("../../../../v4/lens/leaf_model_verification.dag"); - -const R2A_HAPPY: &str = "pub fn r2a_test(a: i32, b: i32) -> (i32, bool) { (a + b, a < b) }\n"; -const R2A_FALSIFICATION: &str = "pub fn r2a_test(a: i32) -> i32 { a.log2_exact() }\n"; - -const R2B_RUNTIME: &str = - "pub fn r2b_test(a: i32, b: i32) -> i32 { a + b }\npub fn main() { let _ = r2b_test(i32::MAX, 1); }\n"; - -const R3_HAPPY: &str = - "pub struct Symbol(pub String);\npub fn r3_test() -> Symbol { Symbol(\"x\".to_string()) }\n"; -const R3_FALSIFICATION: &str = - "pub type Symbol = String;\npub fn r3_test() -> Symbol { Symbol(\"x\") }\n"; - -fn unescape_dag_string_literal(body: &str) -> String { - let mut out = String::new(); - let mut chars = body.chars(); - while let Some(c) = chars.next() { - if c == '\\' { - match chars.next() { - Some('n') => out.push('\n'), - Some('"') => out.push('"'), - Some('\\') => out.push('\\'), - Some(other) => { - out.push('\\'); - out.push(other); - } - None => out.push('\\'), - } - } else { - out.push(c); - } - } - out -} - -fn extract_fixture_source(dag_text: &str, data_name: &str) -> Option { - let needle = format!("data {data_name}: String = \""); - let line = dag_text.lines().find(|l| l.starts_with(&needle))?; - let rest = line.strip_prefix(&needle)?.strip_suffix('"')?; - Some(unescape_dag_string_literal(rest)) -} - -fn compile_lib(harness: &RustcHarness, label: &str, source: &str) -> (bool, String) { - let tmp_dir = harness.next_child_dir(); - let src_path = tmp_dir.join(format!("{label}.rs")); - let out_path = tmp_dir.join(format!("{label}.rlib")); - std::fs::File::create(&src_path) - .and_then(|mut f| f.write_all(source.as_bytes())) - .expect("write fixture source"); - - let output = Command::new("rustc") - .env_remove("RUSTC_BOOTSTRAP") - .arg("--edition=2021") - .arg("--crate-type") - .arg("lib") - .arg(&src_path) - .arg("-o") - .arg(&out_path) - .output() - .expect("invoke rustc"); - - let stderr = String::from_utf8_lossy(&output.stderr).into_owned(); - (output.status.success(), stderr) -} - -fn compile_bin_and_run( - harness: &RustcHarness, - label: &str, - source: &str, - extra_rustc_args: &[&str], -) -> (bool, i32, String) { - let tmp_dir = harness.next_child_dir(); - let src_path = tmp_dir.join(format!("{label}.rs")); - let bin_path = tmp_dir.join(label); - std::fs::File::create(&src_path) - .and_then(|mut f| f.write_all(source.as_bytes())) - .expect("write fixture source"); - - let mut compile = Command::new("rustc"); - compile - .env_remove("RUSTC_BOOTSTRAP") - .arg("--edition=2021") - .arg("--crate-type") - .arg("bin") - .args(extra_rustc_args) - .arg(&src_path) - .arg("-o") - .arg(&bin_path); - let compile_out = compile.output().expect("invoke rustc"); - let mut stderr = String::from_utf8_lossy(&compile_out.stderr).into_owned(); - if !compile_out.status.success() { - return (false, -1, stderr); - } - - let run_out = Command::new(&bin_path).output().expect("run binary"); - stderr.push_str(&String::from_utf8_lossy(&run_out.stderr)); - (true, run_out.status.code().unwrap_or(-1), stderr) -} - -#[test] -fn v4_leaf_model_rust_r2a_fixture_strings_match_dag_authority() { - let happy = extract_fixture_source(FIXTURE_DAG, "rust_r2a_happy_fixture_source").unwrap(); - let falsification = - extract_fixture_source(FIXTURE_DAG, "rust_r2a_falsification_fixture_source").unwrap(); - assert_eq!(happy, R2A_HAPPY); - assert_eq!(falsification, R2A_FALSIFICATION); -} - -#[test] -fn v4_leaf_model_rust_r2a_happy_fixture_rustc_accepts() { - let harness = RustcHarness::new("v4_leaf_model_rust_r2a"); - let (ok, stderr) = compile_lib(&harness, "happy", R2A_HAPPY); - assert!( - ok, - "rustc should accept R2a happy fixture; stderr:\n{stderr}" - ); -} - -#[test] -fn v4_leaf_model_rust_r2a_falsification_fixture_rustc_e0599() { - let harness = RustcHarness::new("v4_leaf_model_rust_r2a"); - let (ok, stderr) = compile_lib(&harness, "falsification", R2A_FALSIFICATION); - assert!(!ok, "falsification must not compile"); - assert!( - stderr.contains("E0599"), - "expected E0599; stderr:\n{stderr}" - ); -} - -#[test] -fn v4_leaf_model_rust_r2b_runtime_fixture_strings_match_dag_authority() { - let source = extract_fixture_source(FIXTURE_DAG, "rust_r2b_runtime_fixture_source").unwrap(); - assert_eq!(source, R2B_RUNTIME); -} - -#[test] -fn v4_leaf_model_rust_r2b_debug_overflow_panics_at_runtime() { - let harness = RustcHarness::new("v4_leaf_model_rust_r2b_debug"); - let (compiled, exit, stderr) = compile_bin_and_run(&harness, "debug", R2B_RUNTIME, &[]); - assert!(compiled, "debug build must compile; stderr:\n{stderr}"); - assert_ne!( - exit, 0, - "debug overflow must panic (non-zero exit); stderr:\n{stderr}" - ); -} - -#[test] -fn v4_leaf_model_rust_r2b_release_overflow_wraps_at_runtime() { - let harness = RustcHarness::new("v4_leaf_model_rust_r2b_release"); - let (compiled, exit, stderr) = - compile_bin_and_run(&harness, "release", R2B_RUNTIME, &["-C", "opt-level=2"]); - assert!(compiled, "release build must compile; stderr:\n{stderr}"); - assert_eq!( - exit, 0, - "release overflow must wrap (exit 0); stderr:\n{stderr}" - ); -} - -#[test] -fn v4_leaf_model_rust_r3_external_fixture_strings_match_dag_authority() { - let happy = - extract_fixture_source(FIXTURE_DAG, "rust_r3_external_happy_fixture_source").unwrap(); - let falsification = - extract_fixture_source(FIXTURE_DAG, "rust_r3_external_falsification_fixture_source") - .unwrap(); - assert_eq!(happy, R3_HAPPY); - assert_eq!(falsification, R3_FALSIFICATION); -} - -#[test] -fn v4_leaf_model_rust_r3_external_happy_fixture_rustc_accepts() { - let harness = RustcHarness::new("v4_leaf_model_rust_r3_external"); - let (ok, stderr) = compile_lib(&harness, "happy", R3_HAPPY); - assert!( - ok, - "rustc should accept R3 happy fixture; stderr:\n{stderr}" - ); -} - -#[test] -fn v4_leaf_model_rust_r3_external_falsification_fixture_rustc_e0423() { - let harness = RustcHarness::new("v4_leaf_model_rust_r3_external"); - let (ok, stderr) = compile_lib(&harness, "falsification", R3_FALSIFICATION); - assert!(!ok, "falsification must not compile"); - assert!( - stderr.contains("E0423"), - "expected E0423; stderr:\n{stderr}" - ); -} diff --git a/src/v3/compiler/tests/boundary/v4_leaf_model_rust_r3_internal_emit_coupling_test.rs b/src/v3/compiler/tests/boundary/v4_leaf_model_rust_r3_internal_emit_coupling_test.rs deleted file mode 100644 index 2de5d9b9dbc..00000000000 --- a/src/v3/compiler/tests/boundary/v4_leaf_model_rust_r3_internal_emit_coupling_test.rs +++ /dev/null @@ -1,195 +0,0 @@ -//! **Layer:** boundary — emit-coupling exercise for v4 leaf-model R3-internal. -//! -//! Authority: `src/v4/lens/leaf_model_verification.dag` (modeled oracle) + -//! `src/v4/extdeps/languages/rust.dag` (baseline row). Replays -//! `target_atom_type_spelling` / `target_atom_value_expression` kind selection from -//! row `type_form` spelling + `value_form` template (alias + template arms only). -//! -//! Host runner: `scripts/v4-leaf-model-rust-r3-internal-verify.sh`. -//! -//! **P5 receipt:** `EXPECTED_HAND_AUTHORED_TEST` in `self_gen0_census_test.rs`. -//! **Dissolution:** retire when T-22 eval exercises `RustEmitProjectionEqualityExpectation` -//! without this hand-Rust bridge. - -use v3_compiler::parse_for_test; -use v3_compiler::tokenize_for_test; - -const FIXTURE_DAG: &str = include_str!("../../../../v4/lens/leaf_model_verification.dag"); -const FIXTURE_PATH: &str = "src/v4/lens/leaf_model_verification.dag"; -const RUST_LANGUAGE_DAG: &str = include_str!("../../../../v4/extdeps/languages/rust.dag"); -const RUST_LANGUAGE_PATH: &str = "src/v4/extdeps/languages/rust.dag"; -const CLAIM_DAG: &str = - include_str!("../../../../v4/test/claim/language_model/rust_r3_internal.dag"); -const CLAIM_PATH: &str = "src/v4/test/claim/language_model/rust_r3_internal.dag"; - -/// Mirrors `target_atom_value_expression` → `TargetValueExpression.kind` for Phase-1 Symbol rows. -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -enum ValueTemplateKind { - SymbolToOwnedString, - SymbolIdentityPassthrough, -} - -/// Row inputs the substrate uses before projection (type alias spelling + value template). -#[derive(Debug, Clone, PartialEq, Eq)] -struct SymbolAtomRowConfig { - type_spelling: String, - value_template: ValueTemplateKind, -} - -fn parse_module(source: &str, path: &str) { - let tokens = - tokenize_for_test(source, path).unwrap_or_else(|e| panic!("{path}: tokenize: {e:?}")); - parse_for_test(&tokens, path).unwrap_or_else(|e| panic!("{path}: parse: {e:?}")); -} - -fn extract_block_after_header(text: &str, header: &str) -> Option { - let start = text.find(header)? + header.len(); - let rest = &text[start..]; - let depth_start = rest.find('{')?; - let mut depth = 0usize; - for (idx, ch) in rest[depth_start..].char_indices() { - match ch { - '{' => depth += 1, - '}' => { - depth = depth.saturating_sub(1); - if depth == 0 { - return Some(rest[..depth_start + idx + 1].to_string()); - } - } - _ => {} - } - } - None -} - -fn extract_type_spelling_from_row_block(block: &str) -> Option { - let marker = "type_form: rust_target_atom_type_form(spelling: "; - let after = block.find(marker)? + marker.len(); - let spelling = block[after..].split(')').next()?.trim(); - Some(spelling.to_string()) -} - -fn extract_value_template_kind_from_row_block(block: &str) -> Option { - if block.contains("kind: ValueSymbolToOwnedString") { - return Some(ValueTemplateKind::SymbolToOwnedString); - } - if block.contains("kind: ValueSymbolIdentityPassthrough") { - return Some(ValueTemplateKind::SymbolIdentityPassthrough); - } - None -} - -fn baseline_symbol_row_config() -> SymbolAtomRowConfig { - let block = extract_block_after_header( - RUST_LANGUAGE_DAG, - "data rust_target_atom_realization_symbol:", - ) - .expect("rust_target_atom_realization_symbol row in rust.dag"); - SymbolAtomRowConfig { - type_spelling: extract_type_spelling_from_row_block(&block) - .expect("baseline row type_form spelling"), - value_template: extract_value_template_kind_from_row_block(&block) - .expect("baseline row value_form template kind"), - } -} - -fn mutated_symbol_row_config() -> SymbolAtomRowConfig { - let block = extract_block_after_header(FIXTURE_DAG, "data rust_r3_internal_mutated_row:") - .expect("rust_r3_internal_mutated_row in lens/leaf_model_verification.dag"); - SymbolAtomRowConfig { - type_spelling: extract_type_spelling_from_row_block(&block) - .expect("mutated row type_form spelling"), - value_template: extract_value_template_kind_from_row_block(&block) - .expect("mutated row value_form template kind"), - } -} - -/// Replay of `target_atom_type_spelling` for rust alias `type_form` rows (Phase 1). -fn replay_type_projection_spelling(row: &SymbolAtomRowConfig) -> &str { - row.type_spelling.as_str() -} - -/// Replay of accepted `target_atom_value_expression` kind label for Symbol probe values. -fn replay_value_projection_kind_label(row: &SymbolAtomRowConfig) -> &'static str { - match row.value_template { - ValueTemplateKind::SymbolToOwnedString => "TargetValueExprSymbolToOwnedString", - ValueTemplateKind::SymbolIdentityPassthrough => "TargetValueExprSymbolIdentity", - } -} - -#[test] -fn v4_leaf_model_rust_r3_internal_lens_and_claim_parse() { - parse_module(FIXTURE_DAG, FIXTURE_PATH); - parse_module(RUST_LANGUAGE_DAG, RUST_LANGUAGE_PATH); - parse_module(CLAIM_DAG, CLAIM_PATH); -} - -#[test] -fn v4_leaf_model_rust_r3_internal_row_mutation_changes_type_and_value_projections() { - let baseline = baseline_symbol_row_config(); - let mutated = mutated_symbol_row_config(); - - let baseline_type = replay_type_projection_spelling(&baseline); - let mutated_type = replay_type_projection_spelling(&mutated); - let baseline_value = replay_value_projection_kind_label(&baseline); - let mutated_value = replay_value_projection_kind_label(&mutated); - - assert_ne!( - baseline_type, mutated_type, - "row mutation must change type projection (target_atom_type_spelling)" - ); - assert_ne!( - baseline_value, mutated_value, - "row mutation must change value projection kind (target_atom_value_expression)" - ); - assert_eq!( - baseline.value_template, - ValueTemplateKind::SymbolToOwnedString, - "production Symbol row must keep ValueSymbolToOwnedString template" - ); - assert_eq!( - mutated.value_template, - ValueTemplateKind::SymbolIdentityPassthrough, - "mutated row must use ValueSymbolIdentityPassthrough template" - ); -} - -#[test] -fn v4_leaf_model_rust_r3_internal_lens_oracle_labels_match_projection_replay() { - let baseline = baseline_symbol_row_config(); - let mutated = mutated_symbol_row_config(); - - assert_eq!( - replay_value_projection_kind_label(&baseline), - "TargetValueExprSymbolToOwnedString" - ); - assert_eq!( - replay_value_projection_kind_label(&mutated), - "TargetValueExprSymbolIdentity" - ); - assert!( - FIXTURE_DAG.contains("discriminant(v: expr.kind)"), - "lens oracle keys value projection kind via discriminant" - ); -} - -#[test] -fn v4_leaf_model_rust_r3_internal_emit_coupling_oracle_would_pass_on_replayed_receipt() { - let baseline = baseline_symbol_row_config(); - let mutated = mutated_symbol_row_config(); - let coupling = replay_type_projection_spelling(&baseline) - != replay_type_projection_spelling(&mutated) - && replay_value_projection_kind_label(&baseline) - != replay_value_projection_kind_label(&mutated); - assert!( - coupling, - "rust_r3_internal_emit_coupling_both_projections_changed must hold for replayed projections" - ); -} - -#[test] -fn v4_leaf_model_rust_r3_internal_claim_wires_coupling_oracle() { - assert!(CLAIM_DAG.contains("claim_rust_r3_internal_emit_coupling_wired")); - assert!(CLAIM_DAG.contains("rust_r3_internal_emit_coupling_both_projections_changed")); - assert!(CLAIM_DAG.contains("leaf_model_claim_rust_r3_internal_symbol_coupling")); -} diff --git a/src/v3/compiler/tests/boundary/v4_leaf_model_typescript_r2_r3_external_test.rs b/src/v3/compiler/tests/boundary/v4_leaf_model_typescript_r2_r3_external_test.rs deleted file mode 100644 index cfd21764824..00000000000 --- a/src/v3/compiler/tests/boundary/v4_leaf_model_typescript_r2_r3_external_test.rs +++ /dev/null @@ -1,202 +0,0 @@ -//! **Layer:** boundary — tsc + Node target exercise for v4 leaf-model typescript R2a / R2b / R3-external. -//! -//! Authority: `src/v4/lens/leaf_model_verification.dag`; claim wiring in -//! `typescript_r2a.dag`, `typescript_r2b.dag`, `typescript_r3_external.dag`. -//! Host runners: `scripts/v4-leaf-model-typescript-r2{a,b,r3-external}-verify.sh`. - -use std::io::Write; -use std::process::Command; - -const FIXTURE_DAG: &str = include_str!("../../../../v4/lens/leaf_model_verification.dag"); - -const TSC_PKG: &str = "typescript@5.9.2"; - -const R2A_HAPPY: &str = - "function r2a_test(a: number, b: number): [number, boolean] { return [a + b, a < b]; }\n"; -const R2A_FALSIFICATION: &str = "function r2a_test(a: number): number { return a.log2_exact(); }\n"; - -const R2B_RUNTIME_HAPPY: &str = - "const ok = (2n ** 63n - 1n) + 1n === 2n ** 63n;\nif (!ok) { console.error(\"r2b bigint lane failed\"); process.exit(1); }\n"; -const R2B_RUNTIME_FALSIFICATION: &str = "const bigintExact = (2n ** 63n + 1n) === 2n ** 63n;\nconst numberLane = (2 ** 63 + 1) === 2 ** 63;\nif (bigintExact || !numberLane) { console.error(\"expected bigint inequality and number-lane IEEE754 false positive\"); process.exit(1); }\n"; - -const R3_HAPPY: &str = "const s: symbol = Symbol(\"x\");\n"; -const R3_FALSIFICATION: &str = "const s: symbol = new Symbol(\"x\");\n"; - -fn unescape_dag_string_literal(body: &str) -> String { - let mut out = String::new(); - let mut chars = body.chars(); - while let Some(c) = chars.next() { - if c == '\\' { - match chars.next() { - Some('n') => out.push('\n'), - Some('"') => out.push('"'), - Some('\\') => out.push('\\'), - Some(other) => { - out.push('\\'); - out.push(other); - } - None => out.push('\\'), - } - } else { - out.push(c); - } - } - out -} - -fn extract_fixture_source(dag_text: &str, data_name: &str) -> Option { - let needle = format!("data {data_name}: String = \""); - let line = dag_text.lines().find(|l| l.starts_with(&needle))?; - let rest = line.strip_prefix(&needle)?.strip_suffix('"')?; - Some(unescape_dag_string_literal(rest)) -} - -fn scratch_dir(label: &str) -> std::path::PathBuf { - let suffix = std::process::id(); - std::env::temp_dir().join(format!("v4_leaf_model_typescript_r2_r3_{label}_{suffix}")) -} - -fn tsc_combined_diagnostics(output: &std::process::Output) -> String { - let stdout = String::from_utf8_lossy(&output.stdout); - let stderr = String::from_utf8_lossy(&output.stderr); - if stdout.is_empty() { - stderr.into_owned() - } else if stderr.is_empty() { - stdout.into_owned() - } else { - format!("{stdout}{stderr}") - } -} - -fn exercise_tsc_fixture(label: &str, source: &str) -> (i32, String) { - let tmp_dir = scratch_dir(label); - let _ = std::fs::remove_dir_all(&tmp_dir); - std::fs::create_dir_all(&tmp_dir).expect("create scratch dir"); - let src_path = tmp_dir.join(format!("{label}.ts")); - std::fs::File::create(&src_path) - .and_then(|mut f| f.write_all(source.as_bytes())) - .expect("write fixture source"); - - let output = Command::new("npx") - .args([ - "-p", TSC_PKG, "tsc", "--strict", "--noEmit", "--target", "ES2022", "--module", - "ES2022", - ]) - .arg(&src_path) - .output() - .expect("invoke npx tsc"); - let diagnostics = tsc_combined_diagnostics(&output); - let status = output.status.code().unwrap_or(1); - let _ = std::fs::remove_dir_all(&tmp_dir); - (status, diagnostics) -} - -fn exercise_node_fixture(label: &str, source: &str) -> (i32, String) { - let tmp_dir = scratch_dir(label); - let _ = std::fs::remove_dir_all(&tmp_dir); - std::fs::create_dir_all(&tmp_dir).expect("create scratch dir"); - let src_path = tmp_dir.join(format!("{label}.mjs")); - std::fs::File::create(&src_path) - .and_then(|mut f| f.write_all(source.as_bytes())) - .expect("write fixture source"); - - let output = Command::new("node") - .arg(&src_path) - .output() - .expect("invoke node on fixture"); - let stderr = String::from_utf8_lossy(&output.stderr).into_owned(); - let status = output.status.code().unwrap_or(1); - let _ = std::fs::remove_dir_all(&tmp_dir); - (status, stderr) -} - -#[test] -fn v4_leaf_model_typescript_r2a_fixture_strings_match_dag_authority() { - let happy = extract_fixture_source(FIXTURE_DAG, "typescript_r2a_happy_fixture_source").unwrap(); - let falsification = - extract_fixture_source(FIXTURE_DAG, "typescript_r2a_falsification_fixture_source").unwrap(); - assert_eq!(happy, R2A_HAPPY); - assert_eq!(falsification, R2A_FALSIFICATION); -} - -#[test] -fn v4_leaf_model_typescript_r2a_happy_fixture_tsc_accepts() { - let (status, diagnostics) = exercise_tsc_fixture("r2a_happy", R2A_HAPPY); - assert_eq!( - status, 0, - "tsc should accept R2a happy fixture; diagnostics:\n{diagnostics}" - ); -} - -#[test] -fn v4_leaf_model_typescript_r2a_falsification_fixture_tsc_ts2339() { - let (status, diagnostics) = exercise_tsc_fixture("r2a_falsification", R2A_FALSIFICATION); - assert_ne!(status, 0, "falsification must not typecheck"); - assert!( - diagnostics.contains("TS2339") && diagnostics.contains("log2_exact"), - "expected TS2339 on log2_exact; diagnostics:\n{diagnostics}" - ); -} - -#[test] -fn v4_leaf_model_typescript_r2b_runtime_fixture_strings_match_dag_authority() { - let happy = - extract_fixture_source(FIXTURE_DAG, "typescript_r2b_runtime_happy_fixture_source").unwrap(); - let falsification = extract_fixture_source( - FIXTURE_DAG, - "typescript_r2b_runtime_falsification_fixture_source", - ) - .unwrap(); - assert_eq!(happy, R2B_RUNTIME_HAPPY); - assert_eq!(falsification, R2B_RUNTIME_FALSIFICATION); -} - -#[test] -fn v4_leaf_model_typescript_r2b_bigint_runtime_add_succeeds() { - let (status, stderr) = exercise_node_fixture("r2b_happy", R2B_RUNTIME_HAPPY); - assert_eq!( - status, 0, - "bigint add beyond 2**63 must succeed at runtime; stderr:\n{stderr}" - ); -} - -#[test] -fn v4_leaf_model_typescript_r2b_number_lane_falsification_demonstrates_ieee754_divergence() { - let (status, stderr) = exercise_node_fixture("r2b_falsification", R2B_RUNTIME_FALSIFICATION); - assert_eq!( - status, 0, - "falsification must show bigint inequality while number lane false-positive-matches; stderr:\n{stderr}" - ); -} - -#[test] -fn v4_leaf_model_typescript_r3_external_fixture_strings_match_dag_authority() { - let happy = - extract_fixture_source(FIXTURE_DAG, "typescript_r3_external_happy_fixture_source").unwrap(); - let falsification = extract_fixture_source( - FIXTURE_DAG, - "typescript_r3_external_falsification_fixture_source", - ) - .unwrap(); - assert_eq!(happy, R3_HAPPY); - assert_eq!(falsification, R3_FALSIFICATION); -} - -#[test] -fn v4_leaf_model_typescript_r3_external_happy_fixture_tsc_accepts() { - let (status, diagnostics) = exercise_tsc_fixture("r3_happy", R3_HAPPY); - assert_eq!( - status, 0, - "tsc should accept R3 happy Symbol() factory fixture; diagnostics:\n{diagnostics}" - ); -} - -#[test] -fn v4_leaf_model_typescript_r3_external_falsification_fixture_tsc_not_constructable() { - let (status, diagnostics) = exercise_tsc_fixture("r3_falsification", R3_FALSIFICATION); - assert_ne!(status, 0, "falsification must not typecheck"); - assert!( - diagnostics.contains("TS7009") || diagnostics.contains("construct"), - "expected TS7009 / not-constructable on `new Symbol`; diagnostics:\n{diagnostics}" - ); -} diff --git a/src/v3/compiler/tests/dag/README.md b/src/v3/compiler/tests/dag/README.md deleted file mode 100644 index cb1cf90a1e7..00000000000 --- a/src/v3/compiler/tests/dag/README.md +++ /dev/null @@ -1,32 +0,0 @@ -# T-PB-B-1 — `tests/dag/` convention (first landable batch) - -**Owner:** T-PB-B (e.g. witty-fox-588). **Schema authority:** `src/v3/std/verification.dag` (`TestClaim`, `TestPredicate`, `requires: List`). - -This directory holds **landed** v3 `.dag` modules that declare `TestClaim` / `TestSuite` values as `data` declarations (same shapes Rust tests build today, but as on-disk authority for the eventual Testgen runner). - -## What is here vs what is not - -- **Landed (runner path):** `t_pb_b_1_dag_runner_test` — `lower` keeps the empty-harness-diagnostics compile receipt for each on-disk `tests/dag/*.dag` file, then `TestRunner::run_suite` proves line-item (1) of the pre–Rust-deletion checklist in `docs/briefs/r1-testgen-manager.md`. The former standalone `t_pb_b_1_tests_dag_smoke_test` is **retired** (redundant; see Testgen *Decisions log*). Still not a `pb_*` gate by itself. -- **Not done here:** Further Rust test deletion or `pb_test_file_generated_from_dag` — follow-on work needs **Testgen** sign-off per the inventory in `docs/briefs/r1-testgen-manager.md`. -- **Compile-smoke vs `TestRunner` (Brief D vs landed):** the retired **Brief D** `.v3` smoke (`t_pb_b_brief_d_fixture_smoke_test`) only checked that the declaring file lowered with empty **module** diagnostics — that was not by itself proof of `Compiles` / `FailsWithDiagnostic` on embedded `TestClaim.source` strings. **Landed** `tests/dag/*.dag` files use the same empty-harness check inside `t_pb_b_1_dag_runner_test::lower`, then `run_suite` evaluates the predicates on the embedded `source` — so `FailsWithDiagnostic` negatives, `PortHasState`, and `CostBounded` bounds are real witnesses, not compile-smoke proxies. See `docs/briefs/t-pb-b-1.md` (*Compile-smoke caveat*). - -## Post-R2 residuals (unchanged) - -Per `TESTING.md` §Post-R2 shape: - -- **A:** `#[cfg(test)]` helpers under `src/v3/compiler/src/` stay Rust. -- **B:** Boundary tests (`tests/boundary/*`, `rustc` / `go` / `python`) stay Rust. - -## Files - -| File | Intent | -|------|--------| -| `t_pb_b_1_pipeline_smoke.dag` | `Compiles` claim (pipe unary) + `TestSuite` bundle. | -| `t_pb_b_1_contract_diagnostic_smoke.dag` | `FailsWithDiagnostic` (`TypeMismatch`). | -| `t_pb_b_1_contract_port_cost.dag` | `PortHasState` + `CostBounded` (`Eq 3`, the runner-evaluated witness for `1 + 1 + 1 + 1`; structure mirrors `m1_5_verification` smoke, which ships an unevaluated `Eq 8` placeholder). | - -**M1(2.8) note:** standalone `data …: TestPredicate = …` bodies that use variant literals are still **opaque** in user `.dag` / test modules. Keep `TestPredicate` shapes **inlined** on each `TestClaim` `data` item (as in `t_pb_b_1_contract_port_cost.dag`) until class-5 data bodies unlock shared predicate values. - -**Related:** `docs/briefs/t-pb-b-1.md`, `docs/briefs/t-pb-b-brief-d.md` (D/G/A/B matrix), Brief D `.v3` fixtures under `tests/fixtures/t_pb_b_brief_d/` (parallel draft track; this directory is the **landed** `.dag` home). - -**Suite naming (`t-pb-b/…` vs `t-pb-b-1/…`):** Intentional. Brief D drafts use `TestSuite.name` values prefixed with `t-pb-b/` in the `.v3` fixtures; landed `.dag` modules use `t-pb-b-1/` so harness grep and humans can tell **draft fixture track** from **T-PB-B-1 on-disk authority** until the dissolution trigger in Brief D retires the `.v3` copies. diff --git a/src/v3/compiler/tests/dag/boundary_emit_gates.template.dag b/src/v3/compiler/tests/dag/boundary_emit_gates.template.dag deleted file mode 100644 index fcf53e8b62e..00000000000 --- a/src/v3/compiler/tests/dag/boundary_emit_gates.template.dag +++ /dev/null @@ -1,53 +0,0 @@ -// F.14 / T-PB-B — boundary class-5 emit gates as `.dag` `TestClaim` + `ExecuteCommand`. -// `__BOUNDARY_EMIT_BIN__` is replaced with `env!("CARGO_BIN_EXE_boundary_emit_gates")` at -// integration-test compile time (`t_pb_b_1_dag_runner_test.rs`). -// -// m2: `m2_emit_multi_field_struct_variant_test.rs` dissolution (ROADMAP PB-Runtime). -// python: `m1_4_emit_python_test::emit_python_checked_division_roundtrips_ok_and_errors` -// (real CPython; requires python3 on PATH — same as the host `#[test]`). - -module v3.compiler.tests.boundary_emit_gates - -import std.verification { TestClaim, TestSuite } - -data claim_m2_destructure_alias: TestClaim = { - name: "multi_field_struct_variant_match_emits_aliased_field_destructure", - source: "let marker: Int = 1", - file_name: "boundary_emit_gates_smoke.v3", - predicate: ExecuteCommand("__BOUNDARY_EMIT_BIN__", ["m2-destructure-alias"], 0), - requires: [] -} - -data claim_m2_arm_aliased_ref: TestClaim = { - name: "multi_field_struct_variant_arm_body_uses_aliased_reference", - source: "let marker: Int = 1", - file_name: "boundary_emit_gates_smoke.v3", - predicate: ExecuteCommand("__BOUNDARY_EMIT_BIN__", ["m2-arm-aliased-ref"], 0), - requires: [] -} - -data claim_m2_rustfmt_valid: TestClaim = { - name: "multi_field_struct_variant_emitted_rust_is_valid_syntax", - source: "let marker: Int = 1", - file_name: "boundary_emit_gates_smoke.v3", - predicate: ExecuteCommand("__BOUNDARY_EMIT_BIN__", ["m2-rustfmt-valid"], 0), - requires: [] -} - -data claim_python_checked_division_roundtrip: TestClaim = { - name: "emit_python_checked_division_roundtrips_ok_and_errors", - source: "let marker: Int = 1", - file_name: "boundary_emit_gates_smoke.v3", - predicate: ExecuteCommand("__BOUNDARY_EMIT_BIN__", ["python-checked-division-roundtrip"], 0), - requires: [] -} - -data boundary_emit_gates_suite: TestSuite = { - name: "boundary_emit_gates_suite", - claims: [ - Enumerated(claim_m2_destructure_alias), - Enumerated(claim_m2_arm_aliased_ref), - Enumerated(claim_m2_rustfmt_valid), - Enumerated(claim_python_checked_division_roundtrip) - ] -} diff --git a/src/v3/compiler/tests/dag/cementing_dispatch.dag b/src/v3/compiler/tests/dag/cementing_dispatch.dag deleted file mode 100644 index 3503e357136..00000000000 --- a/src/v3/compiler/tests/dag/cementing_dispatch.dag +++ /dev/null @@ -1,107 +0,0 @@ -// Band-C cementing dispatch — `.dag` successor to the retired -// `cementing_lens_registry_dispatch_test.rs` ratchet (R3 T-Tests-As-Data-Completeness -// gate #87 / `lens_cementing_test_discipline_complete`). -// -// Canonical lens capability rows live in `std.verification` as `lens_capability_register_rows` -// (`docs/design-tests-as-data-completeness.md` §8.3). This module declares only the -// Band-C receipt list plus the `TestClaim` / `TestSuite` that wire -// `CementingDispatchMatchesProjection` against that authority + `regen.dag`. -// -// Human-readable mirror: `docs/v3-lens-capability-register.md` (not a second authority). - -module v3.compiler.tests.cementing_dispatch - -import std.list { List } -import std.verification { - CementingDispatchMatchesProjection, - TestClaim, - TestSuite, - lens_capability_register_rows -} - -// Closed coproduct: receipt harness shape is a type error at fixture load, not a runtime string whitelist. -type CementingBandCReceiptKind - = DagHarness - | TemporaryRustModule - -type CementingBandCReceipt { - registry_name: String - module_stem: String - // `DagHarness` → `.dag` TestClaim harness under `tests/dag/.dag`; - // `TemporaryRustModule` → `tests/integration/cementing/.rs` + `integration.rs` wiring. - kind: CementingBandCReceiptKind -} - -data cementing_band_c_v2_complete_receipts: List = [ - { - registry_name: "cost" - module_stem: "t_r3_gate_87_cementing_regen_cost" - kind: DagHarness - }, - { - registry_name: "cost" - module_stem: "complexity_lens_behavioral_completion" - kind: TemporaryRustModule - }, - { - registry_name: "cost_symbolic" - module_stem: "t_r3_gate_87_cementing_regen_cost_symbolic" - kind: DagHarness - }, - { - registry_name: "cost_symbolic" - module_stem: "cost_lens_symbolic_consumer_test" - kind: TemporaryRustModule - }, - { - registry_name: "effect_enumeration" - module_stem: "t_r3_gate_87_cementing_regen_effect_enumeration" - kind: DagHarness - }, - { - registry_name: "idempotency" - module_stem: "t_r3_gate_87_cementing_regen_idempotency" - kind: DagHarness - }, - { - registry_name: "parallelism" - module_stem: "t_r3_gate_87_cementing_regen_parallelism" - kind: DagHarness - }, - { - registry_name: "provenance" - module_stem: "t_r3_gate_87_cementing_regen_provenance" - kind: DagHarness - }, - { - registry_name: "structural_resolution" - module_stem: "t_r3_gate_87_cementing_regen_structural_resolution" - kind: DagHarness - }, - { - registry_name: "unused_parameters" - module_stem: "t_r3_gate_87_cementing_regen_unused_parameters" - kind: DagHarness - }, - { - registry_name: "variant_payload" - module_stem: "t_r3_gate_87_cementing_regen_variant_payload" - kind: DagHarness - } -] - -data claim_cementing_dispatch_projection: TestClaim = { - name: "cementing_dispatch_projection_matches_register_and_regen" - source: "// Band-C cementing dispatch reads capability_register + bootstrap LensRegistryEntry; not this program.\nlet _: Int = 0\n" - file_name: "cementing_dispatch_projection_gate.v3" - predicate: CementingDispatchMatchesProjection { - capability_register: lens_capability_register_rows - cementing_receipts: cementing_band_c_v2_complete_receipts - } - requires: [] -} - -data cementing_dispatch_suite: TestSuite = { - name: "cementing_dispatch_suite" - claims: [Enumerated(claim_cementing_dispatch_projection)] -} diff --git a/src/v3/compiler/tests/dag/r1c_e_emit_gates.template.dag b/src/v3/compiler/tests/dag/r1c_e_emit_gates.template.dag deleted file mode 100644 index 4b9bb4974bf..00000000000 --- a/src/v3/compiler/tests/dag/r1c_e_emit_gates.template.dag +++ /dev/null @@ -1,60 +0,0 @@ -// R1C-E — T-Emit `.dag` `TestClaim` wrappers (ExecuteCommand logical child: -// the `r1c_e_emit_gates` `bin`). The `__R1C_E_BIN__` placeholder is replaced -// with `env!("CARGO_BIN_EXE_r1c_e_emit_gates")` at integration-test compile -// time (see `tests/integration/t_pb_b_1_dag_runner_test.rs`); no checked-in -// absolute path goes stale (manager guidance, R1 Closure decision on #973 — -// same discipline as `build.rs` splice for `r1_gates.template.dag`). -// -// Each claim's `name` matches the corresponding ROADMAP T-Emit gate row so -// the lane-acceptance receipt and the `.dag` claim share one identity. -// `source` / `file_name` are the trivial smoke-program the runner requires to -// compile cleanly before evaluating `ExecuteCommand` (see `eval_execute_command` -// in `test_runner.rs`); the bin is the real gate. - -module v3.compiler.tests.r1c_e_emit_gates - -import std.verification { TestClaim, TestSuite } - -// `emit_generic_bounds_survive` — pins the Rust type line for callable params -// (`impl Fn(...) -> ... + Clone`, not `&impl Fn`). Body in -// `r1c_e_gates::check_generic_bounds_survive`; same body as the host -// `m1_3_emit_rust_test::emit_generic_bounds_survive` `#[test]`. -data emit_generic_bounds_survive_claim: TestClaim = { - name: "emit_generic_bounds_survive", - source: "let marker: Int = 1", - file_name: "r1c_e_emit_gates_smoke.v3", - predicate: ExecuteCommand("__R1C_E_BIN__", ["generic-bounds"], 0), - requires: [] -} - -// `emit_rust_fixtures_rustc_green` — full program + reflected matrix through -// real `rustc` (see `r1c_e_gates::check_emit_rust_fixtures_rustc_green` and -// `m1_3_emit_rust_test::emit_rust_fixtures_rustc_green`). -data emit_rust_fixtures_rustc_green_claim: TestClaim = { - name: "emit_rust_fixtures_rustc_green", - source: "let marker: Int = 1", - file_name: "r1c_e_emit_gates_smoke.v3", - predicate: ExecuteCommand("__R1C_E_BIN__", ["rust-fixtures"], 0), - requires: [] -} - -// `program_fixtures_post_emit_clean_all_targets` — every `PROGRAM_FIXTURES` row -// through each Shape-A `post_emit_verifier` (E-5); closes arbitrary user-program -// emission gap vs M1 self-host-only probe. Body in -// `r1c_e_gates::check_program_fixtures_post_emit_clean_all_targets`. -data program_fixtures_post_emit_clean_all_targets_claim: TestClaim = { - name: "program_fixtures_post_emit_clean_all_targets", - source: "let marker: Int = 1", - file_name: "r1c_e_emit_gates_smoke.v3", - predicate: ExecuteCommand("__R1C_E_BIN__", ["program-fixtures-post-emit"], 0), - requires: [] -} - -data r1c_e_emit_gates_suite: TestSuite = { - name: "r1c_e_emit_gates_suite", - claims: [ - Enumerated(emit_generic_bounds_survive_claim), - Enumerated(emit_rust_fixtures_rustc_green_claim), - Enumerated(program_fixtures_post_emit_clean_all_targets_claim), - ] -} diff --git a/src/v3/compiler/tests/dag/r1c_e_emit_gates_omni.template.dag b/src/v3/compiler/tests/dag/r1c_e_emit_gates_omni.template.dag deleted file mode 100644 index f316bc9de46..00000000000 --- a/src/v3/compiler/tests/dag/r1c_e_emit_gates_omni.template.dag +++ /dev/null @@ -1,23 +0,0 @@ -// R1C-E — T-Emit omni three-way gate (separate template so the integration -// receipt can stay `#[ignore]`d: `go` + `python3` are not on all CI images). -// `__R1C_E_BIN__` is replaced with `env!("CARGO_BIN_EXE_r1c_e_emit_gates")` -// in `t_pb_b_1_dag_runner_test.rs`. `ForAllTargets` is not wired in the -// Rust `TestRunner` (see `test_runner.rs`); this gate is one `ExecuteCommand` -// to the `omni-demo` subcommand (brief §3 — three separate claims not needed). - -module v3.compiler.tests.r1c_e_emit_gates_omni - -import std.verification { TestClaim, TestSuite } - -data emit_omni_demo_fixtures_green_claim: TestClaim = { - name: "emit_omni_demo_fixtures_green", - source: "let marker: Int = 1", - file_name: "r1c_e_emit_gates_omni_smoke.v3", - predicate: ExecuteCommand("__R1C_E_BIN__", ["omni-demo"], 0), - requires: [] -} - -data r1c_e_emit_gates_omni_suite: TestSuite = { - name: "r1c_e_emit_gates_omni_suite", - claims: [Enumerated(emit_omni_demo_fixtures_green_claim)] -} diff --git a/src/v3/compiler/tests/dag/r3_v3_self_host_demonstration.template.dag b/src/v3/compiler/tests/dag/r3_v3_self_host_demonstration.template.dag deleted file mode 100644 index 86d8aec7253..00000000000 --- a/src/v3/compiler/tests/dag/r3_v3_self_host_demonstration.template.dag +++ /dev/null @@ -1,26 +0,0 @@ -// R3 gate #71 — `v3_self_host_demonstration` (T-V2-Retirement). -// -// PB-Runtime: `ExecuteCommand` runs the `self_host_fixed_point` binary (DB-8 driver). -// `__SELF_HOST_FIXED_POINT_BIN__` is replaced at integration-test compile time with -// `env!("CARGO_BIN_EXE_self_host_fixed_point")` (same discipline as `r1c_e_emit_gates.template.dag`). -// -// The `.dag` claim runs `ExecuteCommand(bin, [--r3-gate-71-demonstration], 0)` so exit status -// cannot be the DB-8 probe-only path (that exits 0 while parse still fails). See -// `self_host_fixed_point` module docs for the flag. - -module v3.compiler.tests.r3.v3_self_host_demonstration - -import std.verification { TestClaim, TestSuite } - -data v3_self_host_demonstration_claim: TestClaim = { - name: "v3_self_host_demonstration", - source: "let marker: Int = 1", - file_name: "r3_v3_self_host_demonstration_smoke.v3", - predicate: ExecuteCommand("__SELF_HOST_FIXED_POINT_BIN__", ["--r3-gate-71-demonstration"], 0), - requires: [] -} - -data suite_v3_self_host_demonstration: TestSuite = { - name: "r3/v3-self-host-demonstration", - claims: [Enumerated(v3_self_host_demonstration_claim)] -} diff --git a/src/v3/compiler/tests/dag/t_impossiblebugs_force_unwrap_regression_verify.dag b/src/v3/compiler/tests/dag/t_impossiblebugs_force_unwrap_regression_verify.dag deleted file mode 100644 index 14d756c74bb..00000000000 --- a/src/v3/compiler/tests/dag/t_impossiblebugs_force_unwrap_regression_verify.dag +++ /dev/null @@ -1,22 +0,0 @@ -// T-ImpossibleBugs unhandled-diagnostic-paths force_unwrap regression-verify. -// -// The class is closed by totality-by-omission: gunbc has no force-unwrap -// primitive or syntax. This claim pins that the named partial form remains -// unexpressible and fails closed during resolution rather than reaching runtime. - -module v3.compiler.tests.t_impossiblebugs.force_unwrap_regression_verify - -import std.verification { TestClaim, TestSuite, TestPredicate } - -data force_unwrap_absent_resolve_error: TestClaim = { - name: "force_unwrap_absent_resolve_error", - source: "type Maybe = Some(T) | None\nfn bad(m: Maybe) -> Int = force_unwrap(m)\n", - file_name: "force_unwrap_absent_resolve_error.v3", - predicate: FailsWithDiagnostic({ kind: ResolveError, detail_contains: Contains("force_unwrap") }), - requires: [] -} - -data suite_force_unwrap_regression_verify: TestSuite = { - name: "t-impossiblebugs/unhandled-diagnostic-paths/force-unwrap-regression-verify", - claims: [Enumerated(force_unwrap_absent_resolve_error)] -} diff --git a/src/v3/compiler/tests/dag/t_impossiblebugs_nested_optional_flatten.dag b/src/v3/compiler/tests/dag/t_impossiblebugs_nested_optional_flatten.dag deleted file mode 100644 index e3cc3fc3924..00000000000 --- a/src/v3/compiler/tests/dag/t_impossiblebugs_nested_optional_flatten.dag +++ /dev/null @@ -1,22 +0,0 @@ -// T-ImpossibleBugs nested-optional flatten class-close gate. -// -// The claim program typechecks only if the surface `Int??` parameter lowers to -// the same cardinality shape as `Int?`; without the constructor invariant, the -// return annotation would require `Int?` while the body carries `Int??`. - -module v3.compiler.tests.t_impossiblebugs.nested_optional_flatten - -import std.verification { TestClaim, TestSuite, TestPredicate } - -data nested_optional_flatten_compile_error: TestClaim = { - name: "nested_optional_flatten_compile_error", - source: "fn flatten_probe(x: Int??) -> Int? = x\n", - file_name: "nested_optional_flatten_compile_error.v3", - predicate: Compiles, - requires: [] -} - -data suite_nested_optional_flatten_class_close: TestSuite = { - name: "t-impossiblebugs/nested-optional-flatten/class-close", - claims: [Enumerated(nested_optional_flatten_compile_error)] -} diff --git a/src/v3/compiler/tests/dag/t_pb_b_1_contract_diagnostic_smoke.dag b/src/v3/compiler/tests/dag/t_pb_b_1_contract_diagnostic_smoke.dag deleted file mode 100644 index 08915510f9f..00000000000 --- a/src/v3/compiler/tests/dag/t_pb_b_1_contract_diagnostic_smoke.dag +++ /dev/null @@ -1,21 +0,0 @@ -// T-PB-B-1 — contract negative (`FailsWithDiagnostic`) as landed `.dag` data. -// -// Compile-smoke only checks that this *module* lowers with empty diagnostics; it does not -// typecheck the embedded `source` string or evaluate the predicate. Runner replaces that proxy. - -module v3.compiler.tests.t_pb_b_1.contract_diagnostic_smoke - -import std.verification { TestClaim, TestSuite, TestPredicate } - -data claim_bool_int_rejected: TestClaim = { - name: "Bool annotation rejects Int literal", - source: "let x: Bool = 1", - file_name: "t1_4_type_mismatch.v3", - predicate: FailsWithDiagnostic({ kind: TypeMismatch, detail_contains: AnyDetail }), - requires: [] -} - -data suite_contract_diagnostic_negatives: TestSuite = { - name: "t-pb-b-1/contract/diagnostic_negatives", - claims: [Enumerated(claim_bool_int_rejected)] -} diff --git a/src/v3/compiler/tests/dag/t_pb_b_1_contract_port_cost.dag b/src/v3/compiler/tests/dag/t_pb_b_1_contract_port_cost.dag deleted file mode 100644 index 682297b265e..00000000000 --- a/src/v3/compiler/tests/dag/t_pb_b_1_contract_port_cost.dag +++ /dev/null @@ -1,28 +0,0 @@ -// T-PB-B-1 — `PortHasState` + `CostBounded` claims (mirrors `m1_5_verification` smoke). - -module v3.compiler.tests.t_pb_b_1.contract_port_cost - -import std.verification { TestClaim, TestSuite } - -data claim_answer_resolved: TestClaim = { - name: "answer bind resolves", - source: "let answer: Int = 1 + 1 + 1 + 1", - file_name: "t_pb_b_1_port_answer.v3", - predicate: PortHasState("answer", Resolved), - requires: [] -} - -// Cost value is the runner-evaluated witness (three `+` additions = 3), not -// the `Eq 8` placeholder copied from the unevaluated `m1_5_verification` smoke. -data claim_answer_cost_bounded: TestClaim = { - name: "answer bind has bounded cost witness (Eq 3)", - source: "let answer: Int = 1 + 1 + 1 + 1", - file_name: "t_pb_b_1_cost_answer.v3", - predicate: CostBounded("answer", Eq, 3), - requires: [] -} - -data suite_contract_port_and_cost: TestSuite = { - name: "t-pb-b-1/contract/port_and_cost", - claims: [Enumerated(claim_answer_resolved), Enumerated(claim_answer_cost_bounded)] -} diff --git a/src/v3/compiler/tests/dag/t_pb_b_1_execute_command_boundary.dag b/src/v3/compiler/tests/dag/t_pb_b_1_execute_command_boundary.dag deleted file mode 100644 index 99a517b7f8b..00000000000 --- a/src/v3/compiler/tests/dag/t_pb_b_1_execute_command_boundary.dag +++ /dev/null @@ -1,57 +0,0 @@ -// PB-Runtime — `ExecuteCommand` end-to-end through the landed `.dag` harness. -// Migration receipt: the class-5 boundary pattern in -// `m1_4_emit_python_test::python_stdout` (host spawn + success via process exit) is -// structurally the same as `TestPredicate::ExecuteCommand`; this module uses `sh` instead of -// `python3` so default CI does not need CPython. (Stdout/stderr are out of scope for the schema.) -// POSIX / CI: `true` is portable. `sh -c` and `echo` assume POSIX `sh` and `echo` on PATH. The -// repo’s ci.yml v3 job runs on Linux (ubicloud-standard-2) only. If a Windows CI job is added, gate -// or trim the sh/echo claims; keep the `true` claim as portable smoke. A matrix that runs this -// file’s suite on Windows ungated will go red (api-review e99b53e7). -// -// See also: `m1_5_testgen_test::extension_predicates_reach_interpreter_boundary`. - -module v3.compiler.tests.t_pb_b_1.execute_command_boundary - -import std.verification { TestClaim, TestSuite } - -data claim_tautology_true: TestClaim = { - name: "ExecuteCommand true (smoke)", - source: "let marker: Int = 1", - file_name: "t_pb_b_1_execute_cmd_marker.v3", - predicate: ExecuteCommand("true", [], 0), - requires: [] -} - -data claim_shell_exit_ok: TestClaim = { - name: "ExecuteCommand sh -c exit 0 (shell boundary migration)", - source: "let marker: Int = 1", - file_name: "t_pb_b_1_execute_cmd_marker.v3", - predicate: ExecuteCommand("sh", ["-c", "exit 0"], 0), - requires: [] -} - -data claim_shell_exit_nonzero_matches: TestClaim = { - name: "ExecuteCommand sh -c exit 7 (typed nonzero match)", - source: "let marker: Int = 1", - file_name: "t_pb_b_1_execute_cmd_marker.v3", - predicate: ExecuteCommand("sh", ["-c", "exit 7"], 7), - requires: [] -} - -data claim_echo_hi: TestClaim = { - name: "ExecuteCommand echo hi (non-tautological argv)", - source: "let marker: Int = 1", - file_name: "t_pb_b_1_execute_cmd_marker.v3", - predicate: ExecuteCommand("echo", ["hi"], 0), - requires: [] -} - -data suite_execute_command_boundary: TestSuite = { - name: "t-pb-b-1/execute_command/boundary", - claims: [ - Enumerated(claim_tautology_true), - Enumerated(claim_shell_exit_ok), - Enumerated(claim_shell_exit_nonzero_matches), - Enumerated(claim_echo_hi) - ] -} diff --git a/src/v3/compiler/tests/dag/t_pb_b_1_pipeline_smoke.dag b/src/v3/compiler/tests/dag/t_pb_b_1_pipeline_smoke.dag deleted file mode 100644 index ee8f639d2b2..00000000000 --- a/src/v3/compiler/tests/dag/t_pb_b_1_pipeline_smoke.dag +++ /dev/null @@ -1,19 +0,0 @@ -// T-PB-B-1 — pipeline smoke `TestClaim` / `TestSuite` (landed `.dag` authority). -// Schema: `src/v3/std/verification.dag`. Runner evaluation is Testgen follow-up. - -module v3.compiler.tests.t_pb_b_1.pipeline_smoke - -import std.verification { TestClaim, TestSuite, TestPredicate } - -data claim_pipe_unary_compiles: TestClaim = { - name: "pipe unary call program compiles", - source: "fn negate(x: Int) -> Int = 0 - x\nlet y = 5 |> negate\n", - file_name: "pipe_unary.v3", - predicate: Compiles, - requires: [] -} - -data suite_pipeline_pipe_unary: TestSuite = { - name: "t-pb-b-1/pipeline/pipe_unary_compiles", - claims: [Enumerated(claim_pipe_unary_compiles)] -} diff --git a/src/v3/compiler/tests/dag/t_r1c_d_pb_census_gates.dag b/src/v3/compiler/tests/dag/t_r1c_d_pb_census_gates.dag deleted file mode 100644 index 37705420376..00000000000 --- a/src/v3/compiler/tests/dag/t_r1c_d_pb_census_gates.dag +++ /dev/null @@ -1,197 +0,0 @@ -// R1C-D — PB census `.dag` TestClaim fixtures for the six -// PB census gates (T-PB-A ×4 + T-PB-B ×2). The Rust ratchets in -// `src/v3/compiler/tests/integration/self_gen0_census_test.rs` remain the -// drift-detection authority on the underlying lists; this file wires the -// release-gate `.dag` layer that R1 close evaluates, per the strict -// reading of `THESIS.md §"Tests are structural data"`. -// -// Predicate shapes consumed here (`CensusBoundCheck`, `CensusSubsetCount`, -// `FixedPointConverges`, `RatchetZero`, `GeneratedFromDag`) live at -// `src/v3/std/verification.dag`. Runner dispatch lives at -// `src/v3/compiler/src/test_runner.rs::run_claim` (the -// `eval_*_shape` family). -// -// **Today's evaluation state** (R1C-D acceptance: gate evaluates `Pass` -// or `Fail` against the live census, never `NotYetImplemented`): -// -// D.1 / D.6 — `CensusBoundCheck` against `EXPECTED_HAND_AUTHORED_*` -// at `bound = 0` is RED until cascade-promotion 0-floor -// (`docs/design-pure-bootstrap-zero.md`, LIVE 2026-04-25) -// retires the residual lists. Pacing owned by Pure -// Bootstrap to Zero program; surfaced cross-manager. -// D.2 — `CensusSubsetCount` lens-producer subset over the non-test -// census; same dissolution-pacing dependency as D.1. -// D.3 — `FixedPointConverges` runs DB-8 twice and compares snapshots. -// D.4 — `RatchetZero` checks the consolidation ratchet count. -// D.5 — `GeneratedFromDag` requires the `.dag` manifest to enumerate every -// `build.rs::REGEN_OUTPUTS` path exactly once (set equality with -// `GENERATED_FILES`) and that the `EXPECTED_HAND_AUTHORED_TEST` census -// is empty (Gate #84 negative authority). -// -// Lives under `src/v3/compiler/tests/dag/` alongside other `TestRunner` -// harness modules (R3 Cluster M #84 pilot — tests-as-data layout). The -// integration receipt is `t_pb_b_1_dag_runner_test::r1c_d_pb_census_gates_suite_evaluates_through_runner`. - -module v3.compiler.tests.r1c_d.pb_census_gates - -import std.verification { - CensusBoundCheck, - CensusSubsetCount, - FixedPointConverges, - GeneratedFromDag, - PendingFact, - RatchetZero, - TestClaim, - TestSuite, - compiler_std_positive_set_ratchet, - expected_hand_authored_non_test, - expected_hand_authored_test, - lens_producer_files_subset_predicate -} - -// Census-authority handle. The Rust runner's `resolve_census_authority_ref` -// only requires a `DeclarationRef` edge (it does not pin a name or type); -// the marker exists so fixtures point at a typed identity that names the -// underlying authority (`src/v3/compiler/tests/integration/self_gen0_census_test.rs`) -// rather than smuggling the path through fixture text. -type Sg0CensusAuthority {} - -data self_gen0_census_test_authority: Sg0CensusAuthority = {} - -// Stub source string repeated inline on each `TestClaim` below. The PB -// census `eval_*_shape` family does not consume `claim.source` — -// evaluation reads live census state via `self_gen_census_list_*` helpers in -// `test_runner.rs`. The string is repeated rather than referenced through -// a shared `data` because `TestClaimValue::from_declaration` reads `source` -// as a `FieldValue::Literal(String)`; a `Reference(_)` edge falls back to -// the declaration name and breaks the structural `name` contract used by -// the runner test's claim-order assertion. -data pb_hand_rust_at_shim_floor_gate: TestClaim = { - name: "pb_hand_rust_at_shim_floor", - source: "// PB census predicates read external census state, not this source.\nlet _: Int = 0\n", - file_name: "r1_pb_hand_rust_at_shim_floor.v3", - predicate: CensusBoundCheck { - authority: self_gen0_census_test_authority, - list_constant: expected_hand_authored_non_test, - bound: 0 - }, - requires: [] -} - -data lens_producer_files_remaining_gate: TestClaim = { - name: "lens_producer_files_remaining", - source: "// PB census predicates read external census state, not this source.\nlet _: Int = 0\n", - file_name: "r1_lens_producer_files_remaining.v3", - predicate: CensusSubsetCount { - authority: self_gen0_census_test_authority, - list_constant: expected_hand_authored_non_test, - subset_predicate: lens_producer_files_subset_predicate - }, - requires: [] -} - -data pb_self_compile_fixed_point_gate: TestClaim = { - name: "pb_self_compile_fixed_point", - source: "// PB census predicates read external census state, not this source.\nlet _: Int = 0\n", - file_name: "r1_pb_self_compile_fixed_point.v3", - predicate: FixedPointConverges { - compile_target: "default_fixed_point_source", - expected: "pipeline_stage_snapshots" - }, - requires: [] -} - -data pb_compiler_std_ratchet_zero_gate: TestClaim = { - name: "pb_compiler_std_ratchet_zero", - source: "// PB census predicates read external census state, not this source.\nlet _: Int = 0\n", - file_name: "r1_pb_compiler_std_ratchet_zero.v3", - predicate: RatchetZero { - authority: self_gen0_census_test_authority, - ratchet_kind: compiler_std_positive_set_ratchet - }, - requires: [] -} - -// `manifest_entries` enumerates every path in the Self-Generation-0 generated-file manifest -// (`src/v3/compiler/src/lib.rs::generated_files`, emitted from -// `build.rs::REGEN_OUTPUTS`). **Keep this list in lockstep with that literal** -// (same paths, same order as `build.rs`) so `GeneratedFromDag` set-equality -// against `GENERATED_FILES` stays single-authority (INVARIANTS P2 / MODELING -// Practice 5). The runner requires set equality (no dupes / omissions). The -// gate's load-bearing T-PB-B check remains that the `EXPECTED_HAND_AUTHORED_TEST` -// census is empty (Gate #84 negative authority). -// -// R3 Cluster M substrate-shape (msg_3b99a90f): entries are typed sum-variants — -// `PendingFact { output_path }` IS the P3/C-9 honest "unknown" carrier; the -// follow-up runtime PR materialises `ResolvedFact` as hash-derivation lands. -data pb_test_file_generated_from_dag_gate: TestClaim = { - name: "pb_test_file_generated_from_dag", - source: "// PB census predicates read external census state, not this source.\nlet _: Int = 0\n", - file_name: "r1_pb_test_file_generated_from_dag.v3", - predicate: GeneratedFromDag { - authority: self_gen0_census_test_authority, - manifest_entries: [ - PendingFact { output_path: "src/v3/compiler/src/bootstrap_generated.rs" }, - PendingFact { output_path: "src/v3/compiler/src/bootstrap_generated_without_parse_surface.rs" }, - PendingFact { output_path: "src/v3/compiler/src/bootstrap_std_generated.rs" }, - PendingFact { output_path: "src/v3/compiler/src/complexity_lattice_generated.rs" }, - PendingFact { output_path: "src/v3/compiler/src/complexity_lens_generated.rs" }, - PendingFact { output_path: "src/v3/compiler/src/cost_basis_declaration_generated.rs" }, - PendingFact { output_path: "src/v3/compiler/src/dag_branch_generated.rs" }, - PendingFact { output_path: "src/v3/compiler/src/dag_cluster_generated.rs" }, - PendingFact { output_path: "src/v3/compiler/src/dag_cost_generated.rs" }, - PendingFact { output_path: "src/v3/compiler/src/dag_lookup_generated.rs" }, - PendingFact { output_path: "src/v3/compiler/src/dag_scalar_generated.rs" }, - PendingFact { output_path: "src/v3/compiler/src/dag_value_body_generated.rs" }, - PendingFact { output_path: "src/v3/compiler/src/diagnostics_generated.rs" }, - PendingFact { output_path: "src/v3/compiler/src/emit/collection_ops_method_contract_generated.rs" }, - PendingFact { output_path: "src/v3/compiler/src/emit_rust_bin_shim_generated.rs" }, - PendingFact { output_path: "src/v3/compiler/src/enforced_lens_application_generated.rs" }, - PendingFact { output_path: "src/v3/compiler/src/infer_helpers_generated.rs" }, - PendingFact { output_path: "src/v3/compiler/src/int_literal_ranges_generated.rs" }, - PendingFact { output_path: "src/v3/compiler/src/cost_symbolic_lens_generated.rs" }, - PendingFact { output_path: "src/v3/compiler/src/lens_cost_target_realization_generated.rs" }, - PendingFact { output_path: "src/v3/compiler/src/lens_effect_enumeration_generated.rs" }, - PendingFact { output_path: "src/v3/compiler/src/lens_idempotency_generated.rs" }, - PendingFact { output_path: "src/v3/compiler/src/lens_parallelism_generated.rs" }, - PendingFact { output_path: "src/v3/compiler/src/lens_provenance_generated.rs" }, - PendingFact { output_path: "src/v3/compiler/src/lens_structural_resolution_generated.rs" }, - PendingFact { output_path: "src/v3/compiler/src/lens_unused_parameters_generated.rs" }, - PendingFact { output_path: "src/v3/compiler/src/lower_helpers_generated.rs" }, - PendingFact { output_path: "src/v3/compiler/src/operators_generated.rs" }, - PendingFact { output_path: "src/v3/compiler/src/pb_method_template_projection_generated.rs" }, - PendingFact { output_path: "src/v3/compiler/src/parse_generated.rs" }, - PendingFact { output_path: "src/v3/compiler/src/parse_surface_generated.rs" }, - PendingFact { output_path: "src/v3/compiler/src/parse_tables_generated.rs" }, - PendingFact { output_path: "src/v3/compiler/src/serialize_generated.rs" }, - PendingFact { output_path: "src/v3/compiler/src/tokenize_generated.rs" }, - PendingFact { output_path: "src/v3/compiler/src/types_generated.rs" }, - PendingFact { output_path: "src/v3/compiler/src/variant_payload_generated.rs" } - ] - }, - requires: [] -} - -data pb_rust_tests_outside_residual_zero_gate: TestClaim = { - name: "pb_rust_tests_outside_residual_zero", - source: "// PB census predicates read external census state, not this source.\nlet _: Int = 0\n", - file_name: "r1_pb_rust_tests_outside_residual_zero.v3", - predicate: CensusBoundCheck { - authority: self_gen0_census_test_authority, - list_constant: expected_hand_authored_test, - bound: 0 - }, - requires: [] -} - -data r1_pb_census_gates_suite: TestSuite = { - name: "r1_pb_census_gates_suite", - claims: [ - Enumerated(pb_hand_rust_at_shim_floor_gate), - Enumerated(lens_producer_files_remaining_gate), - Enumerated(pb_self_compile_fixed_point_gate), - Enumerated(pb_compiler_std_ratchet_zero_gate), - Enumerated(pb_test_file_generated_from_dag_gate), - Enumerated(pb_rust_tests_outside_residual_zero_gate) - ] -} diff --git a/src/v3/compiler/tests/dag/t_r3_fieldproject_dual_authority_dissolution.dag b/src/v3/compiler/tests/dag/t_r3_fieldproject_dual_authority_dissolution.dag deleted file mode 100644 index 57229e0fa71..00000000000 --- a/src/v3/compiler/tests/dag/t_r3_fieldproject_dual_authority_dissolution.dag +++ /dev/null @@ -1,20 +0,0 @@ -// R3 FieldProject dual-authority dissolution cementing fixture. -// dissolution-trigger: closes #2462 once TransformTarget keeps unresolved -// labels and resolved field refs in separate variants. - -module v3.compiler.tests.t_r3.fieldproject_dual_authority_dissolution - -import std.verification { Compiles, TestClaim, TestSuite } - -data field_project_resolves_single_authority: TestClaim = { - name: "field project resolution leaves no label-child disagreement state", - source: "type Pair { x: Int, y: Int }\nfn read_x(p: Pair) -> Int = p.x\n", - file_name: "fieldproject_single_authority.v3", - predicate: Compiles, - requires: [] -} - -data suite_fieldproject_dual_authority_dissolution: TestSuite = { - name: "r3/fieldproject-dual-authority-dissolution", - claims: [Enumerated(field_project_resolves_single_authority)] -} diff --git a/src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_cost.dag b/src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_cost.dag deleted file mode 100644 index f076819d157..00000000000 --- a/src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_cost.dag +++ /dev/null @@ -1,69 +0,0 @@ -// R3 gate #87 — `LensRegistryEntry` `cost` (complexity.dag) Lane-E harness on merge-sort -// (`r1_merge_sort_pair.v3` program text; same authority as `r1_gates.dag` `r1_lane_e_suite` -// rows `complexity_merge_sort_is_nlogn` + `complexity_merge_sort_v3_matches_v2_oracle`). -// -// T-LaneE stubs: `DeclarationRef` lowering only (bodies `miss_int_lookup()` — **not** consulted). -// `LensOutputEquals(cost_of, …)` → emit `lens_cost::cost_of` vs frozen `Int` oracle (M1(2.8)). -// `DifferentialEquals(v3_program_cost, v2_oracle_cost, …)` → host forward-fold vs the same emit -// (`test_runner::eval_lane_e_differential_cost_lineage`; see `r1_gates.dag` ~`v3_program_cost`). - -module v3.compiler.tests.t_r3.gate_87_cementing_regen_cost - -import std.substrate { Dag, PortId } -import std.verification { - DifferentialEquals, - LensOutputEquals, - ProgramOutputBind, - TestClaim, - TestSuite -} -import v3.std.lookup { Lookup, miss_int_lookup } - -fn cost_of(d: Dag, port_id: PortId) -> Lookup = - miss_int_lookup() - -fn v3_program_cost(d: Dag, port_id: PortId) -> Lookup = - miss_int_lookup() - -fn v2_oracle_cost(d: Dag, port_id: PortId) -> Lookup = - miss_int_lookup() - -data merge_sort_out: Int = 0 - -data gate87_merge_sort_program_input: ProgramOutputBind = { - output_ref: merge_sort_out -} - -data gate87_merge_sort_expected_cost: Int = 3 - -data cementing_regen_cost_merge_sort_lens_output_equals: TestClaim = { - name: "cementing_regen_cost_merge_sort_lens_output_equals", - source: "import std.list { List, cons, singleton, empty }\n\nlet xs: List = cons(2, singleton(1))\n\nfn merge_sort_pair(xs: List) -> List =\n match xs {\n Empty => empty()\n Cons(p0) =>\n match p0.tail {\n Empty => xs\n Cons(p1) =>\n match p1.tail {\n Empty =>\n if p0.head < p1.head\n then cons(p0.head, singleton(p1.head))\n else cons(p1.head, singleton(p0.head))\n Cons(_) => xs\n }\n }\n }\n\nlet merge_sort_out: List = merge_sort_pair(xs)\n", - file_name: "r3_gate_87_merge_sort_pair.v3", - predicate: LensOutputEquals( - cost_of, - gate87_merge_sort_program_input, - gate87_merge_sort_expected_cost - ), - requires: [] -} - -data gate87_merge_sort_v3_matches_v2_oracle: TestClaim = { - name: "cementing_regen_cost", - source: "import std.list { List, cons, singleton, empty }\n\nlet xs: List = cons(2, singleton(1))\n\nfn merge_sort_pair(xs: List) -> List =\n match xs {\n Empty => empty()\n Cons(p0) =>\n match p0.tail {\n Empty => xs\n Cons(p1) =>\n match p1.tail {\n Empty =>\n if p0.head < p1.head\n then cons(p0.head, singleton(p1.head))\n else cons(p1.head, singleton(p0.head))\n Cons(_) => xs\n }\n }\n }\n\nlet merge_sort_out: List = merge_sort_pair(xs)\n", - file_name: "r3_gate_87_merge_sort_pair.v3", - predicate: DifferentialEquals( - v3_program_cost, - v2_oracle_cost, - gate87_merge_sort_program_input - ), - requires: [] -} - -data r3_gate_87_cementing_regen_cost_suite: TestSuite = { - name: "r3-gate-87/cementing/regen/cost", - claims: [ - Enumerated(cementing_regen_cost_merge_sort_lens_output_equals), - Enumerated(gate87_merge_sort_v3_matches_v2_oracle) - ] -} diff --git a/src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_cost_symbolic.dag b/src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_cost_symbolic.dag deleted file mode 100644 index 004465fc3b5..00000000000 --- a/src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_cost_symbolic.dag +++ /dev/null @@ -1,46 +0,0 @@ -// R3 gate #87 — `LensRegistryEntry` `cost_symbolic` (`cost.dag`) cementing in `.dag` form. -// `SymbolicCostExprEquals` applies the emitted symbolic-cost lens to `TestClaim.source` -// and compares against a frozen `SymbolicCost` witness (same pattern as -// `symbolic_cost_expr_equals_smoke` in `m1_5_verification_test.rs`). - -module v3.compiler.tests.t_r3.gate_87_cementing_regen_cost_symbolic - -import std.algebra { SymbolicCost } -import std.verification { - BindParamRef, - BindParamSizeVariable, - SymbolicCostBindParamExpected, - SymbolicCostExprEquals, - SymbolicCostExprEqualsForBindParam, - TestClaim, - TestSuite -} - -data gate87_symbolic_cost_expected: SymbolicCost = ConstantCost(0) - -data gate87_symbolic_cost_countdown_expected: SymbolicCostBindParamExpected = - LinearCostForBindParam { var: SelectedBindParamSizeVariable } - -data cementing_regen_cost_symbolic_literal_claim: TestClaim = { - name: "cementing_regen_cost_symbolic", - source: "let lit: Int = 7", - file_name: "r3_gate_87_symbolic_lit.v3", - predicate: SymbolicCostExprEquals(gate87_symbolic_cost_expected), - requires: [] -} - -data cementing_regen_cost_symbolic_countdown_claim: TestClaim = { - name: "cementing_regen_cost_symbolic_countdown", - source: "fn countdown(n: Int) -> Int =\n if n == 0 then 0 else countdown(n - 1)", - file_name: "r3_gate_87_symbolic_countdown.v3", - predicate: SymbolicCostExprEqualsForBindParam(gate87_symbolic_cost_countdown_expected, { index: 0 }), - requires: [] -} - -data r3_gate_87_cementing_regen_cost_symbolic_suite: TestSuite = { - name: "r3-gate-87/cementing/regen/cost_symbolic", - claims: [ - Enumerated(cementing_regen_cost_symbolic_literal_claim), - Enumerated(cementing_regen_cost_symbolic_countdown_claim) - ] -} diff --git a/src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_cost_target_realization.dag b/src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_cost_target_realization.dag deleted file mode 100644 index 343164d4dae..00000000000 --- a/src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_cost_target_realization.dag +++ /dev/null @@ -1,31 +0,0 @@ -// R3 gate #87 — `LensRegistryEntry` `cost_target_realization`. -// This freezes the declaration-resolution receipt for `type_realization_meta` as a `.dag` -// `LensOutputEquals` claim with a narrow Int witness. - -module v3.compiler.tests.t_r3.gate_87_cementing_regen_cost_target_realization - -import std.substrate { Dag } -import std.verification { LensOutputEquals, ProgramInput, TestClaim, TestSuite } - -fn gate87_cost_target_realization_meta_present(d: Dag) -> Int = 0 - -data gate87_program_input: ProgramInput = {} - -data gate87_expected_true: Int = 1 - -data cementing_regen_cost_target_realization_claim: TestClaim = { - name: "cementing_regen_cost_target_realization", - source: "let lit: Int = 7", - file_name: "r3_gate_87_cost_target_realization_smoke.v3", - predicate: LensOutputEquals( - gate87_cost_target_realization_meta_present, - gate87_program_input, - gate87_expected_true - ), - requires: [] -} - -data r3_gate_87_cementing_regen_cost_target_realization_suite: TestSuite = { - name: "r3-gate-87/cementing/regen/cost_target_realization", - claims: [Enumerated(cementing_regen_cost_target_realization_claim)] -} diff --git a/src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_effect_enumeration.dag b/src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_effect_enumeration.dag deleted file mode 100644 index e6d1b717e74..00000000000 --- a/src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_effect_enumeration.dag +++ /dev/null @@ -1,32 +0,0 @@ -// R3 gate #87 — `LensRegistryEntry` `effect_enumeration`. -// The claim names a narrow Int projection because `EffectEnumerationReport` literals are not yet -// authorable as stable `.dag` data. The runner projection applies the Rust cementing oracle for the -// named lens behavior and compares the frozen witness here. - -module v3.compiler.tests.t_r3.gate_87_cementing_regen_effect_enumeration - -import std.substrate { Dag } -import std.verification { LensOutputEquals, ProgramInput, TestClaim, TestSuite } - -fn gate87_effect_enumeration_no_transaction(d: Dag) -> Int = 0 - -data gate87_program_input: ProgramInput = {} - -data gate87_expected_true: Int = 1 - -data cementing_regen_effect_enumeration_claim: TestClaim = { - name: "cementing_regen_effect_enumeration", - source: "let lit: Int = 7", - file_name: "r3_gate_87_effect_enumeration_smoke.v3", - predicate: LensOutputEquals( - gate87_effect_enumeration_no_transaction, - gate87_program_input, - gate87_expected_true - ), - requires: [] -} - -data r3_gate_87_cementing_regen_effect_enumeration_suite: TestSuite = { - name: "r3-gate-87/cementing/regen/effect_enumeration", - claims: [Enumerated(cementing_regen_effect_enumeration_claim)] -} diff --git a/src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_idempotency.dag b/src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_idempotency.dag deleted file mode 100644 index 90b3050b278..00000000000 --- a/src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_idempotency.dag +++ /dev/null @@ -1,37 +0,0 @@ -// R3 gate #87 — `LensRegistryEntry` `idempotency` (COMPLETE / v3-native per `verification.dag`). -// **INVARIANTS §P5(b) / `docs/r3-program-plan.md` §1.8 row #87** (`lens_cementing_test_discipline_complete`, -// T-Tests-As-Data-Completeness): this harness + `r3_gate_87_cementing_regen_runner_suites.rs` + -// `test_runner::eval_gate_87_cementing_projection` + `r3_gate_87_lens_cementing_regen_receipts_test` -// are the single merge-visible receipt bundle for the registry row (no parallel hand list). -// Narrow Int projection: a literal bind without Lane-2 workflow staging yields -// `WorkflowIdempotencyReport::IdempotencyUnsupported` with `variant_name == "Lane2WorkflowRoot"`. -// Dissolution: widen to a full `WorkflowIdempotencyReport` `LensOutputEquals` once report literals -// are authorable as `.dag` data. - -module v3.compiler.tests.t_r3.gate_87_cementing_regen_idempotency - -import std.substrate { Dag } -import std.verification { LensOutputEquals, ProgramInput, TestClaim, TestSuite } - -fn gate87_idempotency_literal_no_lane2_workflow(d: Dag) -> Int = 0 - -data gate87_program_input: ProgramInput = {} - -data gate87_expected_true: Int = 1 - -data cementing_regen_idempotency_claim: TestClaim = { - name: "cementing_regen_idempotency" - source: "let lit: Int = 7" - file_name: "r3_gate_87_idempotency_smoke.v3" - predicate: LensOutputEquals( - gate87_idempotency_literal_no_lane2_workflow, - gate87_program_input, - gate87_expected_true - ), - requires: [] -} - -data r3_gate_87_cementing_regen_idempotency_suite: TestSuite = { - name: "r3-gate-87/cementing/regen/idempotency" - claims: [Enumerated(cementing_regen_idempotency_claim)] -} diff --git a/src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_infer_helpers.dag b/src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_infer_helpers.dag deleted file mode 100644 index 8284487a101..00000000000 --- a/src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_infer_helpers.dag +++ /dev/null @@ -1,26 +0,0 @@ -// R3 gate #87 — `LensRegistryEntry` `infer_helpers` temporary source-compilation placeholder. -// Helper-only lens rows currently have no single public behavioral carrier to compare with -// `LensOutputEquals`; pretending source compilation is behavior would dilute the cementing -// predicate. Temporary Rust receipt: -// `r3_gate_87_lens_cementing_regen_receipts_test::r3_gate_87_infer_helpers_lens_source_compiles`. -// -// Dissolution trigger: when an `infer_helpers` public output carrier is authorable as `.dag` data, -// replace this `Compiles` claim with a behavior/output `LensOutputEquals` receipt over that carrier -// and delete the temporary Rust source-compilation receipt. - -module v3.compiler.tests.t_r3.gate_87_cementing_regen_infer_helpers - -import std.verification { Compiles, TestClaim, TestSuite } - -data cementing_regen_infer_helpers_claim: TestClaim = { - name: "cementing_regen_infer_helpers", - source: "let lit: Int = 7", - file_name: "r3_gate_87_infer_helpers_smoke.v3", - predicate: Compiles, - requires: [] -} - -data r3_gate_87_cementing_regen_infer_helpers_suite: TestSuite = { - name: "r3-gate-87/cementing/regen/infer_helpers", - claims: [Enumerated(cementing_regen_infer_helpers_claim)] -} diff --git a/src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_lower_helpers.dag b/src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_lower_helpers.dag deleted file mode 100644 index b771c6acb21..00000000000 --- a/src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_lower_helpers.dag +++ /dev/null @@ -1,26 +0,0 @@ -// R3 gate #87 — `LensRegistryEntry` `lower_helpers` temporary source-compilation placeholder. -// Helper-only lens rows currently have no single public behavioral carrier to compare with -// `LensOutputEquals`; pretending source compilation is behavior would dilute the cementing -// predicate. Temporary Rust receipt: -// `r3_gate_87_lens_cementing_regen_receipts_test::r3_gate_87_lower_helpers_lens_source_compiles`. -// -// Dissolution trigger: when a `lower_helpers` public output carrier is authorable as `.dag` data, -// replace this `Compiles` claim with a behavior/output `LensOutputEquals` receipt over that carrier -// and delete the temporary Rust source-compilation receipt. - -module v3.compiler.tests.t_r3.gate_87_cementing_regen_lower_helpers - -import std.verification { Compiles, TestClaim, TestSuite } - -data cementing_regen_lower_helpers_claim: TestClaim = { - name: "cementing_regen_lower_helpers", - source: "let lit: Int = 7", - file_name: "r3_gate_87_lower_helpers_smoke.v3", - predicate: Compiles, - requires: [] -} - -data r3_gate_87_cementing_regen_lower_helpers_suite: TestSuite = { - name: "r3-gate-87/cementing/regen/lower_helpers", - claims: [Enumerated(cementing_regen_lower_helpers_claim)] -} diff --git a/src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_parallelism.dag b/src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_parallelism.dag deleted file mode 100644 index af2d4898a6c..00000000000 --- a/src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_parallelism.dag +++ /dev/null @@ -1,39 +0,0 @@ -// R3 gate #87 — `LensRegistryEntry` `parallelism` (COMPLETE / v3-native per `verification.dag`). -// **INVARIANTS §P5(b) / `docs/r3-program-plan.md` §1.8 row #87** (`lens_cementing_test_discipline_complete`, -// T-Tests-As-Data-Completeness): this harness + `r3_gate_87_cementing_regen_runner_suites.rs` + -// `test_runner::eval_gate_87_cementing_projection` + `r3_gate_87_lens_cementing_regen_receipts_test` -// are the single merge-visible receipt bundle for the new registry row (no parallel hand list). -// Narrow Int projection: a literal bind without Lane-2 workflow staging yields -// `ParallelismUnsupportedKind::NoWorkflowProjection` from `analyze_parallelism` (runner seam: -// `eval_gate_87_cementing_projection`). Dissolution: widen to a full `WorkflowParallelismReport` -// `LensOutputEquals` once report literals are authorable as `.dag` data (T-PB-B tests-as-data -// carrier lane; behavioral completion for row #81 is pinned by typed -// `PairwiseNonCommute { left, right }` evidence on `WorkflowParallelismReport`. - -module v3.compiler.tests.t_r3.gate_87_cementing_regen_parallelism - -import std.substrate { Dag } -import std.verification { LensOutputEquals, ProgramInput, TestClaim, TestSuite } - -fn gate87_parallelism_literal_no_workflow_projection(d: Dag) -> Int = 0 - -data gate87_program_input: ProgramInput = {} - -data gate87_expected_true: Int = 1 - -data cementing_regen_parallelism_claim: TestClaim = { - name: "cementing_regen_parallelism", - source: "let lit: Int = 7", - file_name: "r3_gate_87_parallelism_smoke.v3", - predicate: LensOutputEquals( - gate87_parallelism_literal_no_workflow_projection, - gate87_program_input, - gate87_expected_true - ), - requires: [] -} - -data r3_gate_87_cementing_regen_parallelism_suite: TestSuite = { - name: "r3-gate-87/cementing/regen/parallelism", - claims: [Enumerated(cementing_regen_parallelism_claim)] -} diff --git a/src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_provenance.dag b/src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_provenance.dag deleted file mode 100644 index 08b152fd550..00000000000 --- a/src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_provenance.dag +++ /dev/null @@ -1,31 +0,0 @@ -// R3 gate #87 — `LensRegistryEntry` `provenance`. -// The claim freezes the minimal literal-bind origin witness through a named Int projection until -// `Origin` literals can be compared directly by `LensOutputEquals`. - -module v3.compiler.tests.t_r3.gate_87_cementing_regen_provenance - -import std.substrate { Dag } -import std.verification { LensOutputEquals, ProgramInput, TestClaim, TestSuite } - -fn gate87_provenance_literal_origin_source(d: Dag) -> Int = 0 - -data gate87_program_input: ProgramInput = {} - -data gate87_expected_true: Int = 1 - -data cementing_regen_provenance_claim: TestClaim = { - name: "cementing_regen_provenance", - source: "let lit: Int = 7", - file_name: "r3_gate_87_provenance_smoke.v3", - predicate: LensOutputEquals( - gate87_provenance_literal_origin_source, - gate87_program_input, - gate87_expected_true - ), - requires: [] -} - -data r3_gate_87_cementing_regen_provenance_suite: TestSuite = { - name: "r3-gate-87/cementing/regen/provenance", - claims: [Enumerated(cementing_regen_provenance_claim)] -} diff --git a/src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_structural_resolution.dag b/src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_structural_resolution.dag deleted file mode 100644 index 124a6250315..00000000000 --- a/src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_structural_resolution.dag +++ /dev/null @@ -1,31 +0,0 @@ -// R3 gate #87 — `LensRegistryEntry` `structural_resolution`. -// The full `List` expected carrier is not yet stable as authored `.dag` -// data, so this claim freezes the minimal no-violation witness through a named Int projection. - -module v3.compiler.tests.t_r3.gate_87_cementing_regen_structural_resolution - -import std.substrate { Dag } -import std.verification { LensOutputEquals, ProgramInput, TestClaim, TestSuite } - -fn gate87_structural_resolution_no_violations(d: Dag) -> Int = 0 - -data gate87_program_input: ProgramInput = {} - -data gate87_expected_true: Int = 1 - -data cementing_regen_structural_resolution_claim: TestClaim = { - name: "cementing_regen_structural_resolution", - source: "let lit: Int = 7", - file_name: "r3_gate_87_structural_resolution_smoke.v3", - predicate: LensOutputEquals( - gate87_structural_resolution_no_violations, - gate87_program_input, - gate87_expected_true - ), - requires: [] -} - -data r3_gate_87_cementing_regen_structural_resolution_suite: TestSuite = { - name: "r3-gate-87/cementing/regen/structural_resolution", - claims: [Enumerated(cementing_regen_structural_resolution_claim)] -} diff --git a/src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_unused_parameters.dag b/src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_unused_parameters.dag deleted file mode 100644 index 4efaeb41569..00000000000 --- a/src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_unused_parameters.dag +++ /dev/null @@ -1,31 +0,0 @@ -// R3 gate #87 — `LensRegistryEntry` `unused_parameters`. -// The full `List` expected carrier is not yet stable as authored `.dag` data, -// so this claim freezes the minimal no-finding witness through a named Int projection. - -module v3.compiler.tests.t_r3.gate_87_cementing_regen_unused_parameters - -import std.substrate { Dag } -import std.verification { LensOutputEquals, ProgramInput, TestClaim, TestSuite } - -fn gate87_unused_parameters_no_findings(d: Dag) -> Int = 0 - -data gate87_program_input: ProgramInput = {} - -data gate87_expected_true: Int = 1 - -data cementing_regen_unused_parameters_claim: TestClaim = { - name: "cementing_regen_unused_parameters", - source: "let lit: Int = 7", - file_name: "r3_gate_87_unused_parameters_smoke.v3", - predicate: LensOutputEquals( - gate87_unused_parameters_no_findings, - gate87_program_input, - gate87_expected_true - ), - requires: [] -} - -data r3_gate_87_cementing_regen_unused_parameters_suite: TestSuite = { - name: "r3-gate-87/cementing/regen/unused_parameters", - claims: [Enumerated(cementing_regen_unused_parameters_claim)] -} diff --git a/src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_variant_payload.dag b/src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_variant_payload.dag deleted file mode 100644 index fb8b96bc018..00000000000 --- a/src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_variant_payload.dag +++ /dev/null @@ -1,27 +0,0 @@ -// R3 gate #87 — `LensRegistryEntry` `variant_payload` temporary source-compilation placeholder. -// The public lens entry needs a real variant declaration id fixture before it can compare -// `VariantPayloadShapeLookup`; source compilation must remain explicit placeholder evidence, not -// a renamed behavior claim. Temporary Rust receipt: -// `r3_gate_87_lens_cementing_regen_receipts_test::r3_gate_87_variant_payload_lens_source_compiles`. -// -// Dissolution trigger: when a stable variant-declaration fixture and `VariantPayloadShapeLookup` -// expected literal are authorable as `.dag` data, replace this `Compiles` claim with a -// `LensOutputEquals(variant_payload_shape, ..., expected)` receipt and delete the temporary Rust -// source-compilation receipt. - -module v3.compiler.tests.t_r3.gate_87_cementing_regen_variant_payload - -import std.verification { Compiles, TestClaim, TestSuite } - -data cementing_regen_variant_payload_claim: TestClaim = { - name: "cementing_regen_variant_payload", - source: "let lit: Int = 7", - file_name: "r3_gate_87_variant_payload_smoke.v3", - predicate: Compiles, - requires: [] -} - -data r3_gate_87_cementing_regen_variant_payload_suite: TestSuite = { - name: "r3-gate-87/cementing/regen/variant_payload", - claims: [Enumerated(cementing_regen_variant_payload_claim)] -} diff --git a/src/v3/compiler/tests/dag/t_r3_missing_emission_path_typed_axes.dag b/src/v3/compiler/tests/dag/t_r3_missing_emission_path_typed_axes.dag deleted file mode 100644 index 39b54159d05..00000000000 --- a/src/v3/compiler/tests/dag/t_r3_missing_emission_path_typed_axes.dag +++ /dev/null @@ -1,20 +0,0 @@ -// R3 F1 MissingEmissionPath typed-axes cementing fixture. -// dissolution-trigger: closes #2465 once the substrate diagnostic carrier -// rejects stringified connective / behavior / target axes. - -module v3.compiler.tests.t_r3.missing_emission_path_typed_axes - -import std.verification { TestClaim, TestSuite, TestPredicate } - -data missing_emission_path_rejects_string_axes: TestClaim = { - name: "MissingEmissionPath rejects string discriminant axes", - source: "import v3.std.diagnostics { EmissionDiagnostic, MissingEmissionPath }\n\nfn diag() -> EmissionDiagnostic = MissingEmissionPath(\"Atom\", \"Value\", \"rust\")\n", - file_name: "missing_emission_path_typed_axes.v3", - predicate: FailsWithDiagnostic({ kind: ResolveError, detail_contains: AnyDetail }), - requires: [] -} - -data suite_missing_emission_path_typed_axes: TestSuite = { - name: "r3/missing-emission-path-typed-axes", - claims: [Enumerated(missing_emission_path_rejects_string_axes)] -} diff --git a/src/v3/compiler/tests/dag/t_r3_tests_as_data_demonstration.dag b/src/v3/compiler/tests/dag/t_r3_tests_as_data_demonstration.dag deleted file mode 100644 index 83417bce4b4..00000000000 --- a/src/v3/compiler/tests/dag/t_r3_tests_as_data_demonstration.dag +++ /dev/null @@ -1,28 +0,0 @@ -// R3 gate #74 -- tests_as_data_demonstration. -// -// Port target: retired Rust integration test -// `t_pb_b_brief_d_pipeline_smoke_fixture_lowers_cleanly` -// (`src/v3/compiler/tests/integration/t_pb_b_brief_d_fixture_smoke_test.rs`). -// -// Surface check before authoring: -// - predicate: `Compiles` is wired in `TestRunner`; -// - lens: none; -// - substrate-shape gates #85/#86 are not required for this one-cell carrier; -// - this is a demonstration cell only, not gate #84 bulk-port closure. - -module v3.compiler.tests.r3.tests_as_data_demonstration - -import std.verification { TestClaim, TestSuite, TestPredicate } - -data claim_tests_as_data_pipeline_smoke_compiles: TestClaim = { - name: "tests-as-data port of pipeline smoke fixture compiles", - source: "fn negate(x: Int) -> Int = 0 - x\nlet y = 5 |> negate\n", - file_name: "pipe_unary.v3", - predicate: Compiles, - requires: [] -} - -data suite_tests_as_data_demonstration: TestSuite = { - name: "r3/tests-as-data-demonstration/pipeline_smoke_compiles", - claims: [Enumerated(claim_tests_as_data_pipeline_smoke_compiles)] -} diff --git a/src/v3/compiler/tests/dag/t_r3_tier3_dissolution_demonstration.dag b/src/v3/compiler/tests/dag/t_r3_tier3_dissolution_demonstration.dag deleted file mode 100644 index e44fb3c3f31..00000000000 --- a/src/v3/compiler/tests/dag/t_r3_tier3_dissolution_demonstration.dag +++ /dev/null @@ -1,33 +0,0 @@ -// R3 gate #65 -- tier3_dissolution_demonstration_executes. -// -// Executable demonstration: a Tier3 mirror-consumer `.dag` program imports and -// inhabits the std termination `DescentEvidence` carrier currently mirrored by -// the hand-Rust Phase-1 bench path. This is the gate-65 receipt; it dissolves -// into the broader T-Tier3 mirror-retirement lane when the remaining mirror -// consumers run exclusively through std/evaluator authority. - -module v3.compiler.tests.r3.tier3_dissolution_demonstration - -import std.termination { - DescentUnknown, - NonIncreasing, - Strict -} -import std.verification { - Compiles, - TestClaim, - TestSuite -} - -data tier3_dissolution_demonstration_executes: TestClaim = { - name: "tier3_dissolution_demonstration_executes", - source: "import std.termination { DescentEvidence, NonIncreasing }\n\nlet tier3_demo_evidence: DescentEvidence = NonIncreasing\n", - file_name: "tier3_dissolution_demonstration_executes.v3", - predicate: Compiles, - requires: [] -} - -data suite_tier3_dissolution_demonstration: TestSuite = { - name: "r3/tier3-dissolution-demonstration", - claims: [Enumerated(tier3_dissolution_demonstration_executes)] -} diff --git a/src/v3/compiler/tests/determinism_test.rs b/src/v3/compiler/tests/determinism_test.rs deleted file mode 100644 index 0c798b0d407..00000000000 --- a/src/v3/compiler/tests/determinism_test.rs +++ /dev/null @@ -1,273 +0,0 @@ -//! DB-8 / Lane D — emission determinism ratchet (`feedback_structural_perf_tests`). -//! -//! Per [`docs/design-fixed-point-ratchet.md`](../../docs/design-fixed-point-ratchet.md): -//! for fixed `(dag, target)`, repeated `emit` must yield **byte-identical** text. -//! This module locks that contract structurally: **5× re-emit** on every row of -//! the shared emit matrix (`integration/common/determinism_fixtures.rs`). -//! -//! ## DB-8 non-determinism sources (structural coverage map) -//! -//! 1. **HashMap iteration order** — ratchet: no unstable map iteration in emit; -//! mechanical follow-up: sorted keys / `BTreeMap` (see `emit.rs` policy). -//! *Structural hook:* `emit_rs_hash_iteration_debt_is_visible_to_audit` documents current -//! `emit.rs` surface until Lane 1e dissolves remaining `HashMap` uses. -//! 2. **HashSet iteration order** — same class as (1). -//! 3. **Timestamp / build metadata embedding** — `assert_no_time_or_line_macros`. -//! 4. **Absolute path strings in output** — `assert_no_absolute_path_leakage` on -//! emitted Rust (best-effort; spans should stay relative fixture names). Covers -//! common macOS/Windows/Linux **and** typical CI workspace prefixes (e.g. GitHub Actions); -//! program/module matrix **and** disk-backed `four_fixture_pressure` sources (real paths in -//! `compile_to_dag`). Lane 1 Stage 1e may tighten further. -//! 5. **Unstable sorts / tie-breakers** — covered by byte-stable `emit` replay -//! on one fixed `Dag` (same as 6). -//! 6. **Generated id allocation order** — same as (5). -//! 7. **Float formatting variance** — `assert_no_float_scientific_suspects` on -//! emitted Rust for the matrix (guards accidental `{:e}`-style output). -//! 8. **Filesystem read order** — not exercised by string-in/string-out emit; -//! documented as N/A for this test file (emit does not `read_dir`). - -#[path = "integration/common/mod.rs"] -mod common; - -#[path = "integration/common/determinism_fixtures.rs"] -mod determinism_fixtures; - -use std::path::PathBuf; - -use crate::common::cached_compile_to_dag; -use determinism_fixtures::{ - ModuleFixture, ProgramFixture, FOUR_FIXTURE_FILES, GO_EMIT_EXCLUDE, MODULE_FIXTURES, - PROGRAM_FIXTURES, PYTHON_EMIT_EXCLUDE, -}; -use v3_compiler::emit::{emit, emit_module, EmitTarget}; - -const RUNS: usize = 5; - -fn fixtures_dir_four() -> PathBuf { - PathBuf::from(env!("CARGO_MANIFEST_DIR")) - .join("tests") - .join("four_fixture_pressure") -} - -fn emit_rust_program(fixture: &ProgramFixture) -> String { - let dag = cached_compile_to_dag(fixture.source, "determinism_program_matrix.v3"); - emit(&dag, EmitTarget::Rust) - .unwrap_or_else(|e| panic!("emit rust {}: {e:?}", fixture.name)) - .text -} - -fn emit_go_program(fixture: &ProgramFixture) -> String { - let dag = cached_compile_to_dag(fixture.source, "determinism_program_matrix_go.v3"); - emit(&dag, EmitTarget::Go) - .unwrap_or_else(|e| panic!("emit go {}: {e:?}", fixture.name)) - .text -} - -fn emit_python_program(fixture: &ProgramFixture) -> String { - let dag = cached_compile_to_dag(fixture.source, "determinism_program_matrix_py.v3"); - emit(&dag, EmitTarget::Python) - .unwrap_or_else(|e| panic!("emit python {}: {e:?}", fixture.name)) - .text -} - -fn emit_rust_module(fixture: &ModuleFixture) -> String { - let dag = cached_compile_to_dag(fixture.source, "determinism_module_matrix.v3"); - emit_module(&dag, EmitTarget::Rust) - .unwrap_or_else(|e| panic!("emit rust module {}: {e:?}", fixture.name)) - .text -} - -fn emit_go_module(fixture: &ModuleFixture) -> String { - let dag = cached_compile_to_dag(fixture.source, "determinism_module_matrix_go.v3"); - emit_module(&dag, EmitTarget::Go) - .unwrap_or_else(|e| panic!("emit go module {}: {e:?}", fixture.name)) - .text -} - -fn emit_python_module(fixture: &ModuleFixture) -> String { - let dag = cached_compile_to_dag(fixture.source, "determinism_module_matrix_py.v3"); - emit_module(&dag, EmitTarget::Python) - .unwrap_or_else(|e| panic!("emit python module {}: {e:?}", fixture.name)) - .text -} - -fn assert_five_identical_runs(mut run: impl FnMut() -> String, label: &str) { - let first = run(); - for i in 1..RUNS { - let next = run(); - assert_eq!( - first, next, - "emit determinism failed for {label}: run 0 vs run {i}" - ); - } -} - -fn assert_no_time_or_line_macros(rust: &str, label: &str) { - for needle in ["SystemTime", "std::time::", "file!(", "line!(", "column!("] { - assert!( - !rust.contains(needle), - "{label}: emitted Rust must not embed build-metadata or time hooks (`{needle}`)" - ); - } -} - -fn assert_no_absolute_path_leakage(rust: &str, label: &str) { - // Substrings that usually indicate a leaked host or CI workspace path in emit output. - const LEAK_NEEDLES: &[&str] = &[ - "/Users/", - "\\\\Users\\\\", - "/home/runner/", - "/home/circleci/", - "/github/workspace/", - "/builds/", - "/root/", - ]; - for needle in LEAK_NEEDLES { - if rust.contains(needle) { - panic!("{label}: emitted Rust appears to contain an absolute path ({needle:?})"); - } - } -} - -fn assert_no_float_scientific_suspects(rust: &str, label: &str) { - if rust.contains(":e}") || rust.contains(":E}") { - panic!("{label}: unexpected scientific float formatting token in emit output"); - } -} - -fn audit_rust_emit_text(rust: &str, label: &str) { - assert_no_time_or_line_macros(rust, label); - assert_no_absolute_path_leakage(rust, label); - assert_no_float_scientific_suspects(rust, label); -} - -#[test] -#[ignore = "hot-fix-2026-05-12 cold-v3-67min-reduction; rebuild via OnceLock/cached_compile amortization — owner: TBD per separate dispatch"] -fn emit_matrix_program_rust_is_deterministic() { - for fixture in PROGRAM_FIXTURES { - let name = fixture.name; - assert_five_identical_runs( - || emit_rust_program(fixture), - &format!("rust program {name}"), - ); - } -} - -#[test] -#[ignore = "hot-fix-2026-05-12 cold-v3-67min-reduction; rebuild via OnceLock/cached_compile amortization — owner: TBD per separate dispatch"] -fn emit_matrix_program_go_is_deterministic() { - // Pre-filter via GO_EMIT_EXCLUDE (currently empty — Loop landed in PR #692). - for fixture in PROGRAM_FIXTURES - .iter() - .filter(|f| !GO_EMIT_EXCLUDE.contains(&f.name)) - { - let name = fixture.name; - assert_five_identical_runs(|| emit_go_program(fixture), &format!("go program {name}")); - } -} - -#[test] -#[ignore = "hot-fix-2026-05-12 cold-v3-67min-reduction; rebuild via OnceLock/cached_compile amortization — owner: TBD per separate dispatch"] -fn emit_matrix_program_python_is_deterministic() { - // Pre-filter via PYTHON_EMIT_EXCLUDE (currently empty — operators + Loop both landed). - for fixture in PROGRAM_FIXTURES - .iter() - .filter(|f| !PYTHON_EMIT_EXCLUDE.contains(&f.name)) - { - let name = fixture.name; - assert_five_identical_runs( - || emit_python_program(fixture), - &format!("python program {name}"), - ); - } -} - -#[test] -#[ignore = "hot-fix-2026-05-12 cold-v3-67min-reduction; rebuild via OnceLock/cached_compile amortization — owner: TBD per separate dispatch"] -fn emit_matrix_module_rust_is_deterministic() { - for fixture in MODULE_FIXTURES { - let name = fixture.name; - assert_five_identical_runs(|| emit_rust_module(fixture), &format!("rust module {name}")); - } -} - -#[test] -#[ignore = "hot-fix-2026-05-12 cold-v3-67min-reduction; rebuild via OnceLock/cached_compile amortization — owner: TBD per separate dispatch"] -fn emit_matrix_module_go_is_deterministic() { - for fixture in MODULE_FIXTURES { - let name = fixture.name; - assert_five_identical_runs(|| emit_go_module(fixture), &format!("go module {name}")); - } -} - -#[test] -#[ignore = "hot-fix-2026-05-12 cold-v3-67min-reduction; rebuild via OnceLock/cached_compile amortization — owner: TBD per separate dispatch"] -fn emit_matrix_module_python_is_deterministic() { - for fixture in MODULE_FIXTURES { - let name = fixture.name; - assert_five_identical_runs( - || emit_python_module(fixture), - &format!("python module {name}"), - ); - } -} - -#[test] -#[ignore = "hot-fix-2026-05-12 cold-v3-67min-reduction; rebuild via OnceLock/cached_compile amortization — owner: TBD per separate dispatch"] -fn four_fixture_disk_sources_emit_deterministically() { - for file in FOUR_FIXTURE_FILES { - let path = fixtures_dir_four().join(file); - let source = std::fs::read_to_string(&path) - .unwrap_or_else(|e| panic!("read {}: {e}", path.display())); - let path_for_compile = path.to_string_lossy().to_string(); - let base = format!("four_fixture {file}"); - assert_five_identical_runs( - || { - let dag = cached_compile_to_dag(&source, path_for_compile.as_str()); - emit(&dag, EmitTarget::Rust) - .unwrap_or_else(|e| panic!("{base} emit rust: {e:?}")) - .text - }, - &base, - ); - let rust_disk = { - let dag = cached_compile_to_dag(&source, path_for_compile.as_str()); - emit(&dag, EmitTarget::Rust) - .unwrap_or_else(|e| panic!("{base} emit rust: {e:?}")) - .text - }; - audit_rust_emit_text(&rust_disk, &format!("{base} disk rust")); - let go_label = format!("{base} go"); - assert_five_identical_runs( - || { - let dag = cached_compile_to_dag(&source, path_for_compile.as_str()); - emit(&dag, EmitTarget::Go) - .unwrap_or_else(|e| panic!("{go_label} emit go: {e:?}")) - .text - }, - &go_label, - ); - } -} - -#[test] -#[ignore = "hot-fix-2026-05-12 cold-v3-67min-reduction; rebuild via OnceLock/cached_compile amortization — owner: TBD per separate dispatch"] -fn db8_rust_emit_avoids_time_paths_and_float_hooks_on_program_matrix() { - for fixture in PROGRAM_FIXTURES { - let rust = emit_rust_program(fixture); - audit_rust_emit_text(&rust, &format!("db8 audit rust program {}", fixture.name)); - } -} - -#[test] -fn emit_rs_hash_iteration_debt_is_visible_to_audit() { - let path = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("src/emit.rs"); - let src = std::fs::read_to_string(&path).expect("read emit.rs"); - let hash_ops = src.matches("HashMap::").count() + src.matches("HashSet::").count(); - assert!( - hash_ops > 0, - "DB-8 §Sources 1–2: emit.rs should still mention HashMap/HashSet until Lane 1e replaces \ - iteration with BTree* / sorted keys — if this fails, debt is cleared: remove this test \ - and graduate the CI grep gate to required" - ); -} diff --git a/src/v3/compiler/tests/fixtures/host/r1_p0_no_fabrication_sentinel.sh b/src/v3/compiler/tests/fixtures/host/r1_p0_no_fabrication_sentinel.sh deleted file mode 100755 index 44efeec4e51..00000000000 --- a/src/v3/compiler/tests/fixtures/host/r1_p0_no_fabrication_sentinel.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env bash -# R1C-B / T-P0 — host receipt for `p0_no_fabrication_sentinel`. -# Host-side ratchet: two load-bearing surfaces must stay free of `__BUG_NO_PROFILE_` -# (historically mirrored v2 `bug_sentinel_ratchet`; v2 tree removed under T-V2-Retirement G-2). -set -euo pipefail -SENTINEL="__BUG_NO_PROFILE_" -root="$(git rev-parse --show-toplevel 2>/dev/null || true)" -if [[ -z "${root}" ]]; then - echo "r1_p0_no_fabrication_sentinel: not inside a git work tree" >&2 - exit 1 -fi -for f in "${root}/dsl/std/types.dag" "${root}/src/v3/compiler/src/infer.rs"; do - if [[ ! -f "${f}" ]]; then - echo "r1_p0_no_fabrication_sentinel: missing ${f}" >&2 - exit 1 - fi - if grep -qF "${SENTINEL}" "${f}"; then - echo "r1_p0_no_fabrication_sentinel: forbidden substring in ${f}" >&2 - exit 1 - fi -done -exit 0 diff --git a/src/v3/compiler/tests/fixtures/host/r1_p0_rest_ops_aligned.py b/src/v3/compiler/tests/fixtures/host/r1_p0_rest_ops_aligned.py deleted file mode 100755 index cc3743ff056..00000000000 --- a/src/v3/compiler/tests/fixtures/host/r1_p0_rest_ops_aligned.py +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env python3 -"""R1C-B / T-P0 — host receipt for `p0_rest_ops_aligned`. - -Mirrors `create_comment_rest_path_matches_github_issues_comments_api` in -`src/v2/tests/src/effects.rs`: github.Pulls CreateComment must use the Issues API path -(`/issues/{issue_number}/comments`), not pulls/{pull_number}/comments. -""" -from __future__ import annotations - -import pathlib -import sys - - -def main() -> int: - root = pathlib.Path(__file__).resolve().parents[6] - path = root / "dsl" / "extdeps" / "github" / "pulls.dag" - text = path.read_text(encoding="utf-8") - needle = "operation CreateComment" - if needle not in text: - print("CreateComment operation missing", file=sys.stderr) - return 1 - i = text.index(needle) - chunk = text[i : i + 1500] - if "/issues/" not in chunk: - print("CreateComment chunk missing /issues/ path segment", file=sys.stderr) - return 1 - if "issue_number" not in chunk: - print("CreateComment chunk missing issue_number path param", file=sys.stderr) - return 1 - return 0 - - -if __name__ == "__main__": - raise SystemExit(main()) diff --git a/src/v3/compiler/tests/fixtures/r1_gates.dag b/src/v3/compiler/tests/fixtures/r1_gates.dag deleted file mode 100644 index d041b0e0a1f..00000000000 --- a/src/v3/compiler/tests/fixtures/r1_gates.dag +++ /dev/null @@ -1,310 +0,0 @@ -// std.r1_gates - Day-1 R1 gate declarations (integration-test fixture). -// -// **Authority:** Hand-edit `r1_gates.template.dag` only. Companion `r1_gates.dag` is -// **generated** on every `cargo build` of `v3-compiler`: `build.rs` splices -// `src/v3/lenses/named_function_count.dag` into `user_authored_lens_compiles_gate.source` -// (single-line placeholder token, see `build.rs` `emit_r1_gates_fixture`) so the on-disk lens -// is the single program-text authority (T-LensAPI D4 / ROADMAP scheduled cleanup item 3). -// -// **T-TestGen** (`testgen_manual_claim_is_first_class`, ROADMAP.md:51, [ext]): hand-authored -// `manual_negative_claim_gate` + `manual_claim_suite` live in this same module so one -// fixture file stays the R1 gate surface without growing `src/v3/std/*.dag` (bootstrap -// enumerates that tree — see PR #679 / review round 1). -// -// Lives under `src/v3/compiler/tests/fixtures/` so it is **not** auto-staged -// into `Dag::new()` bootstrap (`src/v3/std/*.dag` is build-script enumerated). -// `sub_match_over_user_sum_links_and_runs` also extracts this claim source for -// the rustc boundary receipt, so the named T-Sub gate has one program witness. -// -// merge-conflicts: union with `origin/main` — keep every `data` gate from main -// (`sub_match_*`, `sub_type_alias_where_*`, `p0_*`, `manual_*`, `testgen_structural_coverage*`) plus this file's -// `user_authored_lens_compiles_gate`; do not resolve conflicts by keeping only the lens gate. - -module std.r1_gates - -import std.list { fold } -import std.substrate { Dag, Behavior, PortId } -import std.types { Int } -import std.verification { - AlgebraicLaw, - Compiles, - DeclarationHasRefinement, - DifferentialEquals, - LensOutputEquals, - OutputEquals, - ProgramInput, - ProgramOutputBind, - TestClaim, - TestSuite -} -import v3.std.lookup { Lookup, miss_int_lookup } - -data sub_match_over_user_sum: TestClaim = { - name: "sub_match_over_user_sum", - source: "type Choice = Number(Int) | Missing\n\nfn score(choice: Choice) -> Int =\n match choice {\n Number(value) => value\n Missing => 0\n }\n\nlet result: Bool = score(Number(7)) == 7 && score(Missing) == 0\n", - file_name: "r1_sub_match_over_user_sum.v3", - predicate: Compiles, - requires: [] -} - -data sub_match_over_user_sum_gate: TestSuite = { - name: "sub_match_over_user_sum_gate", - claims: [Enumerated(sub_match_over_user_sum)] -} - -// R1C-C / T-Sub — type-alias RHS `where` parse + lower (PR #703; DB-11: -// `test_db11_type_alias_where_survives_parse_and_lower`). Same surface as integration receipt. -// Predicate: `DeclarationHasRefinement` — fail-closed on silent refinement drop (not `Compiles` alone). -data sub_type_alias_where_lowers: TestClaim = { - name: "sub_type_alias_where_lowers", - source: "type PositiveInt = Int where PositiveInt > 0\n", - file_name: "r1_sub_type_alias_where_lowers.v3", - predicate: DeclarationHasRefinement("PositiveInt"), - requires: [] -} - -data sub_type_alias_where_lowers_gate: TestSuite = { - name: "sub_type_alias_where_lowers_gate", - claims: [Enumerated(sub_type_alias_where_lowers)] -} - -// R1C-B / T-P0 — `p0_repeat_string_correct`: literal `repeat_string(...)` on `data` bodies -// **constant-folds** at lower time (`lower::try_lower_repeat_string_string_data`). `OutputEquals` -// compares the **lowered** `ValueBody::Scalar` witness — not an interpreter execution of the std -// `repeat_string` arrow (ROADMAP: dissolution when in-runner evaluation supersedes this fold). -// Interim `p0_repeat_string_v2_oracle_rust_bridge` retired. -data p0_repeat_string_correct: TestClaim = { - name: "p0_repeat_string_correct", - source: "data repeat_string_returns_n_copies: String = repeat_string(s: \"x\", n: 3)\n", - file_name: "r1_p0_repeat_string_correct.v3", - predicate: OutputEquals("\"xxx\""), - requires: [] -} - -// Same fold path as `p0_repeat_string_correct`; covers the space-padding slice used by -// `indent_text`-style composition in `dsl/std/render.dag` (live v2 oracle on `concat` retired). -data p0_repeat_string_space_pad_correct: TestClaim = { - name: "p0_repeat_string_space_pad_correct", - source: "data repeat_string_two_spaces: String = repeat_string(s: \" \", n: 2)\n", - file_name: "r1_p0_repeat_string_space_pad.v3", - predicate: OutputEquals("\" \""), - requires: [] -} - -data p0_repeat_string_correct_gate: TestSuite = { - name: "p0_repeat_string_correct_gate", - claims: [Enumerated(p0_repeat_string_correct), Enumerated(p0_repeat_string_space_pad_correct)] -} - -// R1C-B / T-P0 — `p0_no_fabrication_sentinel` + `p0_rest_ops_aligned` (Worker B): DB-15 -// `ExecuteCommand` host receipts; paths under `tests/fixtures/host/` mirror v2 integration authority. -// **Constraint:** paths use `git rev-parse --show-toplevel` — requires a **git** checkout (CI OK); -// bare tarballs / non-git trees cannot resolve script paths (known; document-only). - -data p0_no_fabrication_sentinel: TestClaim = { - name: "p0_no_fabrication_sentinel", - source: "module p0_no_fabrication_sentinel_host\n", - file_name: "p0_no_fabrication_sentinel.v3", - predicate: ExecuteCommand("bash", ["-c", "exec bash \"$(git rev-parse --show-toplevel)/src/v3/compiler/tests/fixtures/host/r1_p0_no_fabrication_sentinel.sh\""], 0), - requires: [] -} - -data p0_rest_ops_aligned: TestClaim = { - name: "p0_rest_ops_aligned", - source: "module p0_rest_ops_aligned_host\n", - file_name: "p0_rest_ops_aligned.v3", - predicate: ExecuteCommand("bash", ["-c", "exec python3 \"$(git rev-parse --show-toplevel)/src/v3/compiler/tests/fixtures/host/r1_p0_rest_ops_aligned.py\""], 0), - requires: [] -} - -data p0_host_sentinel_and_rest_gate: TestSuite = { - name: "p0_host_sentinel_and_rest_gate", - claims: [Enumerated(p0_no_fabrication_sentinel), Enumerated(p0_rest_ops_aligned)] -} - -// Naming stub for `DeclarationRef` resolution on `AlgebraicLaw(Associativity, lens_composition_op)`. -// The runner resolves `lens_ref` by name from this fixture DAG, then looks up the same name in -// the compiled `program_dag` (`TestClaim.source`). The stub body is unused at evaluation time — -// only the **name** is asserted against `program_dag`; keep the **body** byte-identical to -// `src/v3/lenses/lens_composition_associative_witness.dag` anyway so the parallel copy cannot -// silently drift (merge hazard / reader confusion). -// Dissolution trigger: once the runner resolves lens refs directly from `program_dag` without a -// fixture-side stub, delete this declaration. -fn lens_composition_op(a: Int, b: Int) -> Int = a + b - -// Fixture-local stubs (names + shapes for `DeclarationRef` in this merged DAG). Bodies mirror -// `src/v3/lenses/named_function_count.dag`; keep in sync when editing the lens file. -// `LensOutputEquals` does **not** execute these stubs: `test_runner` compiles -// `R1_CANONICAL_NAMED_FUNCTION_COUNT_LENS` (same bytes as `build.rs` splices for Compiles). -fn count_named_bind(behavior: Behavior) -> Int = - match behavior { - Value(v) => 0 - Transform(t) => 0 - Branch(b) => 0 - Loop(l) => 0 - Bind(bind) => if bind.name == "" then 0 else 1 - } - -fn named_function_count(d: Dag) -> Int = - fold(d.nodes, 0, |acc, behavior| acc + count_named_bind(behavior)) - -// T-LaneE stubs: `DeclarationRef` lowering only (bodies `miss_int_lookup()` — not consulted). -// `LensOutputEquals(cost_of, …)` → runner `lens_cost::cost_of` (emit from `complexity.dag`). -// `DifferentialEquals(v3_program_cost, v2_oracle_cost, …)` → host forward-fold vs the same emit -// (`test_runner::lane_e_host_*` vs `lens_cost::cost_of`; ROADMAP T-LaneE / E-P receipt, api-review #764). -fn cost_of(d: Dag, port_id: PortId) -> Lookup = - miss_int_lookup() - -fn v3_program_cost(d: Dag, port_id: PortId) -> Lookup = - miss_int_lookup() - -fn v2_oracle_cost(d: Dag, port_id: PortId) -> Lookup = - miss_int_lookup() - -data user_authored_lens_compiles_gate: TestClaim = { - name: "user_authored_lens_compiles", - source: "// lenses.named_function_count - minimal user-authored lens (Day-1 gate demo).\n//\n// Status: STRUCTURALLY TERMINAL; BEHAVIORALLY N/A.\n// See docs/v3-lens-capability-register.md.\n//\n// **Not** bundled into `Dag::new()` bootstrap: it compiles externally via\n// `compile_to_dag` (see `m1_5_user_authored_lens_gate_test`). Demo only:\n// counts `Bind` behaviors whose `name` is non-empty. Not in `regen.dag`.\n\nmodule lenses.named_function_count\n\nimport std.list { fold }\nimport std.substrate { Dag, Behavior }\n\nfn count_named_bind(behavior: Behavior) -> Int =\n match behavior {\n Value(v) => 0\n Transform(t) => 0\n Branch(b) => 0\n Loop(l) => 0\n Bind(bind) => if bind.name == \"\" then 0 else 1\n }\n\nfn named_function_count(d: Dag) -> Int =\n fold(d.nodes, 0, |acc, behavior| acc + count_named_bind(behavior))\n", - file_name: "src/v3/lenses/named_function_count.dag", - predicate: Compiles, - requires: [] -} - -// Fixture: return type says `String` but body is `Int` (`x`). The substrate surfaces -// this as `ResolveError` ("parameter … does not satisfy its declared signature"), not -// `TypeMismatch` — the gate matches the live diagnostic kind. -data manual_negative_claim_gate: TestClaim = { - name: "testgen_manual_claim_is_first_class", - source: "fn broken(x: Int) -> String = x", - file_name: "manual_claim_fixture.v3", - predicate: FailsWithDiagnostic({ - kind: ResolveError, - detail_contains: AnyDetail - }), - requires: [] -} - -data manual_claim_suite: TestSuite = { - name: "manual_claim_suite", - claims: [Enumerated(manual_negative_claim_gate)] -} - -data lens_composition_associative_gate: TestClaim = { - name: "lens_composition_associative", - source: "// lenses.lens_composition_associative_witness - minimal `[ext]` gate witness for\n// `lens_composition_associative` (T-LensAPI / AlgebraicLaw::Associativity).\n//\n// The runner checks associativity on every triple in `lens_declaration_apply::ASSOCIATIVITY_WITNESS_TRIPLES`\n// via `int_associativity_holds_all_triples` (not a single sample), not a structural\n// operator-shape recognizer.\n//\n// Status: STRUCTURALLY TERMINAL; BEHAVIORALLY N/A beyond the witness shape.\n// Not bundled into `Dag::new()` bootstrap; see `m1_5_user_authored_lens_gate_test`\n// lockstep pattern for `r1_gates.dag`.\n\nmodule lenses.lens_composition_associative_witness\n\nfn lens_composition_op(a: Int, b: Int) -> Int = a + b\n", - file_name: "src/v3/lenses/lens_composition_associative_witness.dag", - predicate: AlgebraicLaw(Associativity, lens_composition_op), - requires: [] -} - -data lens_composition_associative_suite: TestSuite = { - name: "lens_composition_associative_suite", - claims: [Enumerated(lens_composition_associative_gate)] -} - -// R1 T-TestGen gate: the runner evaluates a structural fact about a compiled -// fixture DAG, not just "source compiles." This binds a named value through a -// small function call, then asserts the bind's value port resolved. -data testgen_structural_coverage_gate: TestClaim = { - name: "testgen_structural_coverage", - source: "fn double(x: Int) -> Int = x + x\nlet structural_result: Int = double(3)", - file_name: "structural_coverage_fixture.v3", - predicate: PortHasState("structural_result", Resolved), - requires: [] -} - -data testgen_structural_coverage_suite: TestSuite = { - name: "testgen_structural_coverage_suite", - claims: [Enumerated(testgen_structural_coverage_gate)] -} - -// `LensOutputEquals` R1 gate: `input_ref` is `ProgramInput {}` — runner reflects the claim -// program `Dag` from `TestClaim.source` (no name-based program-input bridge). -data merge_sort_out: Int = 0 - -data lane_e_diff_out: Int = 0 - -data r1_lens_output_program_input: ProgramInput = {} - -data r1_merge_sort_program_input: ProgramOutputBind = { - output_ref: merge_sort_out -} - -data r1_lane_e_program_input: ProgramOutputBind = { - output_ref: lane_e_diff_out -} - -data lens_output_equals_expected: Int = 1 - -data lens_output_equals_gate: TestClaim = { - name: "lens_output_equals_gate", - source: "let x: Int = 1\n", - file_name: "r1_lens_output_program.v3", - predicate: LensOutputEquals( - named_function_count, - r1_lens_output_program_input, - lens_output_equals_expected - ), - requires: [] -} - -data r1_lens_output_equals_suite: TestSuite = { - name: "r1_lens_output_equals_suite", - claims: [Enumerated(lens_output_equals_gate)] -} - -// T-LaneE — merge-sort pair witness (structural `cost_of` on `merge_sort_out` vs expected `Int`). -// M1(2.8): `Lookup` literals are not yet expressible in `data` bodies — compare `Hit(n)` to -// this scalar witness. `TestClaim.source` is spliced from `tests/fixtures/r1_merge_sort_pair.v3` -// at `cargo build` (see `emit_r1_gates_fixture` in `v3-compiler/build.rs`). -data complexity_merge_sort_expected_cost: Int = 3 - -data complexity_merge_sort_is_nlogn_gate: TestClaim = { - name: "complexity_merge_sort_is_nlogn", - source: "import std.list { List, cons, singleton, empty }\n\nlet xs: List = cons(2, singleton(1))\n\nfn merge_sort_pair(xs: List) -> List =\n match xs {\n Empty => empty()\n Cons(p0) =>\n match p0.tail {\n Empty => xs\n Cons(p1) =>\n match p1.tail {\n Empty =>\n if p0.head < p1.head\n then cons(p0.head, singleton(p1.head))\n else cons(p1.head, singleton(p0.head))\n Cons(_) => xs\n }\n }\n }\n\nlet merge_sort_out: List = merge_sort_pair(xs)\n", - file_name: "r1_merge_sort_pair.v3", - predicate: LensOutputEquals( - cost_of, - r1_merge_sort_program_input, - complexity_merge_sort_expected_cost - ), - requires: [] -} - -// Cross-lineage parity on the merge-sort program: host forward-fold vs emit `lens_cost::cost_of` -// on `merge_sort_out` (same bind as `complexity_merge_sort_is_nlogn` — independent producers). -data complexity_merge_sort_v3_matches_v2_oracle_gate: TestClaim = { - name: "complexity_merge_sort_v3_matches_v2_oracle", - source: "import std.list { List, cons, singleton, empty }\n\nlet xs: List = cons(2, singleton(1))\n\nfn merge_sort_pair(xs: List) -> List =\n match xs {\n Empty => empty()\n Cons(p0) =>\n match p0.tail {\n Empty => xs\n Cons(p1) =>\n match p1.tail {\n Empty =>\n if p0.head < p1.head\n then cons(p0.head, singleton(p1.head))\n else cons(p1.head, singleton(p0.head))\n Cons(_) => xs\n }\n }\n }\n\nlet merge_sort_out: List = merge_sort_pair(xs)\n", - file_name: "r1_merge_sort_pair.v3", - predicate: DifferentialEquals( - v3_program_cost, - v2_oracle_cost, - r1_merge_sort_program_input - ), - requires: [] -} - -// Bundled differential witness (`lane_e_diff_out` in `r1_lane_e_differential_witness.v3`): `match` + -// `fold` over a short list — host fold vs emit on branch/list/fold structure. **Not** the lane-wide -// “v3 oracle vs v2 oracle” receipt; merge-sort / `merge_sort_out` parity is -// `complexity_merge_sort_v3_matches_v2_oracle` (PR #764 api-review rename). -data lane_e_bundled_witness_host_emit_parity_gate: TestClaim = { - name: "lane_e_bundled_witness_host_emit_parity", - source: "// T-LaneE differential witness for `lane_e_bundled_witness_host_emit_parity` (bundled `lane_e_diff_out` program).\n// Uses `match`, list construction, and `fold` so host forward-fold and emit `lens_cost::cost_of`\n// both walk branch / list / fold structure — not a single-addition shortcut (PR #764).\n\nimport std.list { List, cons, empty, fold }\n\nlet lane_e_diff_pick: Bool = true\n\nlet lane_e_diff_xs: List = cons(1, cons(2, empty()))\n\nlet lane_e_diff_out: Int =\n match lane_e_diff_pick {\n True => fold(lane_e_diff_xs, 0, |acc, x| acc + x)\n False => 0\n }\n", - file_name: "r1_lane_e_differential_witness.v3", - predicate: DifferentialEquals( - v3_program_cost, - v2_oracle_cost, - r1_lane_e_program_input - ), - requires: [] -} - -data r1_lane_e_suite: TestSuite = { - name: "r1_lane_e_suite", - claims: [ - Enumerated(complexity_merge_sort_is_nlogn_gate), - Enumerated(complexity_merge_sort_v3_matches_v2_oracle_gate), - Enumerated(lane_e_bundled_witness_host_emit_parity_gate) - ] -} diff --git a/src/v3/compiler/tests/fixtures/r1_gates.template.dag b/src/v3/compiler/tests/fixtures/r1_gates.template.dag deleted file mode 100644 index b810b34aad8..00000000000 --- a/src/v3/compiler/tests/fixtures/r1_gates.template.dag +++ /dev/null @@ -1,310 +0,0 @@ -// std.r1_gates - Day-1 R1 gate declarations (integration-test fixture). -// -// **Authority:** Hand-edit `r1_gates.template.dag` only. Companion `r1_gates.dag` is -// **generated** on every `cargo build` of `v3-compiler`: `build.rs` splices -// `src/v3/lenses/named_function_count.dag` into `user_authored_lens_compiles_gate.source` -// (single-line placeholder token, see `build.rs` `emit_r1_gates_fixture`) so the on-disk lens -// is the single program-text authority (T-LensAPI D4 / ROADMAP scheduled cleanup item 3). -// -// **T-TestGen** (`testgen_manual_claim_is_first_class`, ROADMAP.md:51, [ext]): hand-authored -// `manual_negative_claim_gate` + `manual_claim_suite` live in this same module so one -// fixture file stays the R1 gate surface without growing `src/v3/std/*.dag` (bootstrap -// enumerates that tree — see PR #679 / review round 1). -// -// Lives under `src/v3/compiler/tests/fixtures/` so it is **not** auto-staged -// into `Dag::new()` bootstrap (`src/v3/std/*.dag` is build-script enumerated). -// `sub_match_over_user_sum_links_and_runs` also extracts this claim source for -// the rustc boundary receipt, so the named T-Sub gate has one program witness. -// -// merge-conflicts: union with `origin/main` — keep every `data` gate from main -// (`sub_match_*`, `sub_type_alias_where_*`, `p0_*`, `manual_*`, `testgen_structural_coverage*`) plus this file's -// `user_authored_lens_compiles_gate`; do not resolve conflicts by keeping only the lens gate. - -module std.r1_gates - -import std.list { fold } -import std.substrate { Dag, Behavior, PortId } -import std.types { Int } -import std.verification { - AlgebraicLaw, - Compiles, - DeclarationHasRefinement, - DifferentialEquals, - LensOutputEquals, - OutputEquals, - ProgramInput, - ProgramOutputBind, - TestClaim, - TestSuite -} -import v3.std.lookup { Lookup, miss_int_lookup } - -data sub_match_over_user_sum: TestClaim = { - name: "sub_match_over_user_sum", - source: "type Choice = Number(Int) | Missing\n\nfn score(choice: Choice) -> Int =\n match choice {\n Number(value) => value\n Missing => 0\n }\n\nlet result: Bool = score(Number(7)) == 7 && score(Missing) == 0\n", - file_name: "r1_sub_match_over_user_sum.v3", - predicate: Compiles, - requires: [] -} - -data sub_match_over_user_sum_gate: TestSuite = { - name: "sub_match_over_user_sum_gate", - claims: [Enumerated(sub_match_over_user_sum)] -} - -// R1C-C / T-Sub — type-alias RHS `where` parse + lower (PR #703; DB-11: -// `test_db11_type_alias_where_survives_parse_and_lower`). Same surface as integration receipt. -// Predicate: `DeclarationHasRefinement` — fail-closed on silent refinement drop (not `Compiles` alone). -data sub_type_alias_where_lowers: TestClaim = { - name: "sub_type_alias_where_lowers", - source: "type PositiveInt = Int where PositiveInt > 0\n", - file_name: "r1_sub_type_alias_where_lowers.v3", - predicate: DeclarationHasRefinement("PositiveInt"), - requires: [] -} - -data sub_type_alias_where_lowers_gate: TestSuite = { - name: "sub_type_alias_where_lowers_gate", - claims: [Enumerated(sub_type_alias_where_lowers)] -} - -// R1C-B / T-P0 — `p0_repeat_string_correct`: literal `repeat_string(...)` on `data` bodies -// **constant-folds** at lower time (`lower::try_lower_repeat_string_string_data`). `OutputEquals` -// compares the **lowered** `ValueBody::Scalar` witness — not an interpreter execution of the std -// `repeat_string` arrow (ROADMAP: dissolution when in-runner evaluation supersedes this fold). -// Interim `p0_repeat_string_v2_oracle_rust_bridge` retired. -data p0_repeat_string_correct: TestClaim = { - name: "p0_repeat_string_correct", - source: "data repeat_string_returns_n_copies: String = repeat_string(s: \"x\", n: 3)\n", - file_name: "r1_p0_repeat_string_correct.v3", - predicate: OutputEquals("\"xxx\""), - requires: [] -} - -// Same fold path as `p0_repeat_string_correct`; covers the space-padding slice used by -// `indent_text`-style composition in `dsl/std/render.dag` (live v2 oracle on `concat` retired). -data p0_repeat_string_space_pad_correct: TestClaim = { - name: "p0_repeat_string_space_pad_correct", - source: "data repeat_string_two_spaces: String = repeat_string(s: \" \", n: 2)\n", - file_name: "r1_p0_repeat_string_space_pad.v3", - predicate: OutputEquals("\" \""), - requires: [] -} - -data p0_repeat_string_correct_gate: TestSuite = { - name: "p0_repeat_string_correct_gate", - claims: [Enumerated(p0_repeat_string_correct), Enumerated(p0_repeat_string_space_pad_correct)] -} - -// R1C-B / T-P0 — `p0_no_fabrication_sentinel` + `p0_rest_ops_aligned` (Worker B): DB-15 -// `ExecuteCommand` host receipts; paths under `tests/fixtures/host/` mirror v2 integration authority. -// **Constraint:** paths use `git rev-parse --show-toplevel` — requires a **git** checkout (CI OK); -// bare tarballs / non-git trees cannot resolve script paths (known; document-only). - -data p0_no_fabrication_sentinel: TestClaim = { - name: "p0_no_fabrication_sentinel", - source: "module p0_no_fabrication_sentinel_host\n", - file_name: "p0_no_fabrication_sentinel.v3", - predicate: ExecuteCommand("bash", ["-c", "exec bash \"$(git rev-parse --show-toplevel)/src/v3/compiler/tests/fixtures/host/r1_p0_no_fabrication_sentinel.sh\""], 0), - requires: [] -} - -data p0_rest_ops_aligned: TestClaim = { - name: "p0_rest_ops_aligned", - source: "module p0_rest_ops_aligned_host\n", - file_name: "p0_rest_ops_aligned.v3", - predicate: ExecuteCommand("bash", ["-c", "exec python3 \"$(git rev-parse --show-toplevel)/src/v3/compiler/tests/fixtures/host/r1_p0_rest_ops_aligned.py\""], 0), - requires: [] -} - -data p0_host_sentinel_and_rest_gate: TestSuite = { - name: "p0_host_sentinel_and_rest_gate", - claims: [Enumerated(p0_no_fabrication_sentinel), Enumerated(p0_rest_ops_aligned)] -} - -// Naming stub for `DeclarationRef` resolution on `AlgebraicLaw(Associativity, lens_composition_op)`. -// The runner resolves `lens_ref` by name from this fixture DAG, then looks up the same name in -// the compiled `program_dag` (`TestClaim.source`). The stub body is unused at evaluation time — -// only the **name** is asserted against `program_dag`; keep the **body** byte-identical to -// `src/v3/lenses/lens_composition_associative_witness.dag` anyway so the parallel copy cannot -// silently drift (merge hazard / reader confusion). -// Dissolution trigger: once the runner resolves lens refs directly from `program_dag` without a -// fixture-side stub, delete this declaration. -fn lens_composition_op(a: Int, b: Int) -> Int = a + b - -// Fixture-local stubs (names + shapes for `DeclarationRef` in this merged DAG). Bodies mirror -// `src/v3/lenses/named_function_count.dag`; keep in sync when editing the lens file. -// `LensOutputEquals` does **not** execute these stubs: `test_runner` compiles -// `R1_CANONICAL_NAMED_FUNCTION_COUNT_LENS` (same bytes as `build.rs` splices for Compiles). -fn count_named_bind(behavior: Behavior) -> Int = - match behavior { - Value(v) => 0 - Transform(t) => 0 - Branch(b) => 0 - Loop(l) => 0 - Bind(bind) => if bind.name == "" then 0 else 1 - } - -fn named_function_count(d: Dag) -> Int = - fold(d.nodes, 0, |acc, behavior| acc + count_named_bind(behavior)) - -// T-LaneE stubs: `DeclarationRef` lowering only (bodies `miss_int_lookup()` — not consulted). -// `LensOutputEquals(cost_of, …)` → runner `lens_cost::cost_of` (emit from `complexity.dag`). -// `DifferentialEquals(v3_program_cost, v2_oracle_cost, …)` → host forward-fold vs the same emit -// (`test_runner::lane_e_host_*` vs `lens_cost::cost_of`; ROADMAP T-LaneE / E-P receipt, api-review #764). -fn cost_of(d: Dag, port_id: PortId) -> Lookup = - miss_int_lookup() - -fn v3_program_cost(d: Dag, port_id: PortId) -> Lookup = - miss_int_lookup() - -fn v2_oracle_cost(d: Dag, port_id: PortId) -> Lookup = - miss_int_lookup() - -data user_authored_lens_compiles_gate: TestClaim = { - name: "user_authored_lens_compiles", - source: "R1_NAMED_FUNCTION_COUNT_LENS_SPLICE_V1", - file_name: "src/v3/lenses/named_function_count.dag", - predicate: Compiles, - requires: [] -} - -// Fixture: return type says `String` but body is `Int` (`x`). The substrate surfaces -// this as `ResolveError` ("parameter … does not satisfy its declared signature"), not -// `TypeMismatch` — the gate matches the live diagnostic kind. -data manual_negative_claim_gate: TestClaim = { - name: "testgen_manual_claim_is_first_class", - source: "fn broken(x: Int) -> String = x", - file_name: "manual_claim_fixture.v3", - predicate: FailsWithDiagnostic({ - kind: ResolveError, - detail_contains: AnyDetail - }), - requires: [] -} - -data manual_claim_suite: TestSuite = { - name: "manual_claim_suite", - claims: [Enumerated(manual_negative_claim_gate)] -} - -data lens_composition_associative_gate: TestClaim = { - name: "lens_composition_associative", - source: "// lenses.lens_composition_associative_witness - minimal `[ext]` gate witness for\n// `lens_composition_associative` (T-LensAPI / AlgebraicLaw::Associativity).\n//\n// The runner checks associativity on every triple in `lens_declaration_apply::ASSOCIATIVITY_WITNESS_TRIPLES`\n// via `int_associativity_holds_all_triples` (not a single sample), not a structural\n// operator-shape recognizer.\n//\n// Status: STRUCTURALLY TERMINAL; BEHAVIORALLY N/A beyond the witness shape.\n// Not bundled into `Dag::new()` bootstrap; see `m1_5_user_authored_lens_gate_test`\n// lockstep pattern for `r1_gates.dag`.\n\nmodule lenses.lens_composition_associative_witness\n\nfn lens_composition_op(a: Int, b: Int) -> Int = a + b\n", - file_name: "src/v3/lenses/lens_composition_associative_witness.dag", - predicate: AlgebraicLaw(Associativity, lens_composition_op), - requires: [] -} - -data lens_composition_associative_suite: TestSuite = { - name: "lens_composition_associative_suite", - claims: [Enumerated(lens_composition_associative_gate)] -} - -// R1 T-TestGen gate: the runner evaluates a structural fact about a compiled -// fixture DAG, not just "source compiles." This binds a named value through a -// small function call, then asserts the bind's value port resolved. -data testgen_structural_coverage_gate: TestClaim = { - name: "testgen_structural_coverage", - source: "fn double(x: Int) -> Int = x + x\nlet structural_result: Int = double(3)", - file_name: "structural_coverage_fixture.v3", - predicate: PortHasState("structural_result", Resolved), - requires: [] -} - -data testgen_structural_coverage_suite: TestSuite = { - name: "testgen_structural_coverage_suite", - claims: [Enumerated(testgen_structural_coverage_gate)] -} - -// `LensOutputEquals` R1 gate: `input_ref` is `ProgramInput {}` — runner reflects the claim -// program `Dag` from `TestClaim.source` (no name-based program-input bridge). -data merge_sort_out: Int = 0 - -data lane_e_diff_out: Int = 0 - -data r1_lens_output_program_input: ProgramInput = {} - -data r1_merge_sort_program_input: ProgramOutputBind = { - output_ref: merge_sort_out -} - -data r1_lane_e_program_input: ProgramOutputBind = { - output_ref: lane_e_diff_out -} - -data lens_output_equals_expected: Int = 1 - -data lens_output_equals_gate: TestClaim = { - name: "lens_output_equals_gate", - source: "let x: Int = 1\n", - file_name: "r1_lens_output_program.v3", - predicate: LensOutputEquals( - named_function_count, - r1_lens_output_program_input, - lens_output_equals_expected - ), - requires: [] -} - -data r1_lens_output_equals_suite: TestSuite = { - name: "r1_lens_output_equals_suite", - claims: [Enumerated(lens_output_equals_gate)] -} - -// T-LaneE — merge-sort pair witness (structural `cost_of` on `merge_sort_out` vs expected `Int`). -// M1(2.8): `Lookup` literals are not yet expressible in `data` bodies — compare `Hit(n)` to -// this scalar witness. `TestClaim.source` is spliced from `tests/fixtures/r1_merge_sort_pair.v3` -// at `cargo build` (see `emit_r1_gates_fixture` in `v3-compiler/build.rs`). -data complexity_merge_sort_expected_cost: Int = 3 - -data complexity_merge_sort_is_nlogn_gate: TestClaim = { - name: "complexity_merge_sort_is_nlogn", - source: "R1_MERGE_SORT_PAIR_V3_SPLICE_V1", - file_name: "r1_merge_sort_pair.v3", - predicate: LensOutputEquals( - cost_of, - r1_merge_sort_program_input, - complexity_merge_sort_expected_cost - ), - requires: [] -} - -// Cross-lineage parity on the merge-sort program: host forward-fold vs emit `lens_cost::cost_of` -// on `merge_sort_out` (same bind as `complexity_merge_sort_is_nlogn` — independent producers). -data complexity_merge_sort_v3_matches_v2_oracle_gate: TestClaim = { - name: "complexity_merge_sort_v3_matches_v2_oracle", - source: "R1_MERGE_SORT_PAIR_V3_SPLICE_V1", - file_name: "r1_merge_sort_pair.v3", - predicate: DifferentialEquals( - v3_program_cost, - v2_oracle_cost, - r1_merge_sort_program_input - ), - requires: [] -} - -// Bundled differential witness (`lane_e_diff_out` in `r1_lane_e_differential_witness.v3`): `match` + -// `fold` over a short list — host fold vs emit on branch/list/fold structure. **Not** the lane-wide -// “v3 oracle vs v2 oracle” receipt; merge-sort / `merge_sort_out` parity is -// `complexity_merge_sort_v3_matches_v2_oracle` (PR #764 api-review rename). -data lane_e_bundled_witness_host_emit_parity_gate: TestClaim = { - name: "lane_e_bundled_witness_host_emit_parity", - source: "R1_LANE_E_DIFFERENTIAL_WITNESS_V3_SPLICE_V1", - file_name: "r1_lane_e_differential_witness.v3", - predicate: DifferentialEquals( - v3_program_cost, - v2_oracle_cost, - r1_lane_e_program_input - ), - requires: [] -} - -data r1_lane_e_suite: TestSuite = { - name: "r1_lane_e_suite", - claims: [ - Enumerated(complexity_merge_sort_is_nlogn_gate), - Enumerated(complexity_merge_sort_v3_matches_v2_oracle_gate), - Enumerated(lane_e_bundled_witness_host_emit_parity_gate) - ] -} diff --git a/src/v3/compiler/tests/fixtures/r1_lane_e_differential_witness.v3 b/src/v3/compiler/tests/fixtures/r1_lane_e_differential_witness.v3 deleted file mode 100644 index 1122ce5a32a..00000000000 --- a/src/v3/compiler/tests/fixtures/r1_lane_e_differential_witness.v3 +++ /dev/null @@ -1,15 +0,0 @@ -// T-LaneE differential witness for `lane_e_bundled_witness_host_emit_parity` (bundled `lane_e_diff_out` program). -// Uses `match`, list construction, and `fold` so host forward-fold and emit `lens_cost::cost_of` -// both walk branch / list / fold structure — not a single-addition shortcut (PR #764). - -import std.list { List, cons, empty, fold } - -let lane_e_diff_pick: Bool = true - -let lane_e_diff_xs: List = cons(1, cons(2, empty())) - -let lane_e_diff_out: Int = - match lane_e_diff_pick { - True => fold(lane_e_diff_xs, 0, |acc, x| acc + x) - False => 0 - } diff --git a/src/v3/compiler/tests/fixtures/r1_merge_sort_pair.v3 b/src/v3/compiler/tests/fixtures/r1_merge_sort_pair.v3 deleted file mode 100644 index b5c29b7f979..00000000000 --- a/src/v3/compiler/tests/fixtures/r1_merge_sort_pair.v3 +++ /dev/null @@ -1,22 +0,0 @@ -import std.list { List, cons, singleton, empty } - -let xs: List = cons(2, singleton(1)) - -fn merge_sort_pair(xs: List) -> List = - match xs { - Empty => empty() - Cons(p0) => - match p0.tail { - Empty => xs - Cons(p1) => - match p1.tail { - Empty => - if p0.head < p1.head - then cons(p0.head, singleton(p1.head)) - else cons(p1.head, singleton(p0.head)) - Cons(_) => xs - } - } - } - -let merge_sort_out: List = merge_sort_pair(xs) diff --git a/src/v3/compiler/tests/fixtures/r1_mock_backed_invariant_gate.dag b/src/v3/compiler/tests/fixtures/r1_mock_backed_invariant_gate.dag deleted file mode 100644 index e0305687132..00000000000 --- a/src/v3/compiler/tests/fixtures/r1_mock_backed_invariant_gate.dag +++ /dev/null @@ -1,28 +0,0 @@ -// R1 gate for `testgen_mock_backed_integration_safe` (ROADMAP). `MockBackedInvariant` names the -// `TestPredicate` variant; `requires` carries explicit `ResourceReference` edges so the runner -// can distinguish a mock-backed receipt from the hermetic subject+invariant fallback path. -// Lives under tests/fixtures/ — not auto-staged into bootstrap. - -module std.r1_mock_backed_invariant_gate - -import std.verification { TestClaim, TestSuite } - -fn mock_service_status() -> Int = 200 - -fn mock_invariant_holds(code: Int) -> Bool = code == 200 - -data mock_backed_invariant_gate: TestClaim = { - name: "testgen_mock_backed_integration_safe", - source: "fn mock_service_status() -> Int = 200\n\nfn mock_invariant_holds(code: Int) -> Bool = code == 200\n\nlet _: Int = 0\n", - file_name: "mock_backed_harness.v3", - predicate: MockBackedInvariant(mock_service_status, mock_invariant_holds), - requires: [ - { target: mock_service_status }, - { target: mock_invariant_holds } - ] -} - -data mock_backed_invariant_suite: TestSuite = { - name: "mock_backed_invariant_suite", - claims: [Enumerated(mock_backed_invariant_gate)] -} diff --git a/src/v3/compiler/tests/fixtures/r1_release_acceptance.dag b/src/v3/compiler/tests/fixtures/r1_release_acceptance.dag deleted file mode 100644 index 9f998609345..00000000000 --- a/src/v3/compiler/tests/fixtures/r1_release_acceptance.dag +++ /dev/null @@ -1,119 +0,0 @@ -// std.r1_release_acceptance - R1 release-acceptance fixture. -// -// Director disposition for R1C-D closes R1 with one strict PB gate green -// (`pb_self_compile_fixed_point`) and five PB census gates structurally -// deferred to release-cycle authority. The deferral claims -// use `ReleaseDeferredClaim` only because the Director explicitly approved this -// release-acceptance fixture shape; do not copy it into arbitrary suites. - -module std.r1_release_acceptance - -import std.verification { - FixedPointConverges, - ReleaseDeferredClaim, - TestClaim, - TestSuite -} - -type Sg0CensusAuthority {} -data self_gen0_census_test_authority: Sg0CensusAuthority = {} - -type R1GateMarker {} -data pb_hand_rust_at_shim_floor_gate_marker: R1GateMarker = {} -data lens_producer_files_remaining_gate_marker: R1GateMarker = {} -data pb_test_file_generated_from_dag_gate_marker: R1GateMarker = {} -data pb_rust_tests_outside_residual_zero_gate_marker: R1GateMarker = {} -data pb_compiler_std_ratchet_zero_gate_marker: R1GateMarker = {} - -type TargetLaneMarker {} -data target_lens_producer_retirement: TargetLaneMarker = {} -data target_pb_b_bulk_migration: TargetLaneMarker = {} -data target_r2_substrate_lens_primitive: TargetLaneMarker = {} - -type ReleaseAuthorityDoc {} -data r3_structure_authority: ReleaseAuthorityDoc = {} -data pure_bootstrap_zero_authority: ReleaseAuthorityDoc = {} -data r2_substrate_manager_authority: ReleaseAuthorityDoc = {} - -data pb_hand_rust_at_shim_floor_deferred: TestClaim = { - name: "pb_hand_rust_at_shim_floor", - source: "// R1 release acceptance deferral marker; no program evaluation.\nlet _: Int = 0\n", - file_name: "r1_release_pb_hand_rust_at_shim_floor.v3", - predicate: ReleaseDeferredClaim { - deferred_gate: pb_hand_rust_at_shim_floor_gate_marker, - target_lane: target_lens_producer_retirement, - authority_doc: r3_structure_authority - }, - requires: [] -} - -data lens_producer_files_remaining_deferred: TestClaim = { - name: "lens_producer_files_remaining", - source: "// R1 release acceptance deferral marker; no program evaluation.\nlet _: Int = 0\n", - file_name: "r1_release_lens_producer_files_remaining.v3", - predicate: ReleaseDeferredClaim { - deferred_gate: lens_producer_files_remaining_gate_marker, - target_lane: target_lens_producer_retirement, - authority_doc: r3_structure_authority - }, - requires: [] -} - -data pb_self_compile_fixed_point_strict: TestClaim = { - name: "pb_self_compile_fixed_point", - source: "// PB census predicates read external census state, not this source.\nlet _: Int = 0\n", - file_name: "r1_release_pb_self_compile_fixed_point.v3", - predicate: FixedPointConverges { - compile_target: "default_fixed_point_source", - expected: "pipeline_stage_snapshots" - }, - requires: [] -} - -data pb_compiler_std_ratchet_zero_deferred: TestClaim = { - name: "pb_compiler_std_ratchet_zero", - source: "// R1 release acceptance deferral marker; no program evaluation.\nlet _: Int = 0\n", - file_name: "r1_release_pb_compiler_std_ratchet_zero.v3", - predicate: ReleaseDeferredClaim { - deferred_gate: pb_compiler_std_ratchet_zero_gate_marker, - target_lane: target_r2_substrate_lens_primitive, - authority_doc: r2_substrate_manager_authority - }, - requires: [] -} - -data pb_test_file_generated_from_dag_deferred: TestClaim = { - name: "pb_test_file_generated_from_dag", - source: "// R1 release acceptance deferral marker; no program evaluation.\nlet _: Int = 0\n", - file_name: "r1_release_pb_test_file_generated_from_dag.v3", - predicate: ReleaseDeferredClaim { - deferred_gate: pb_test_file_generated_from_dag_gate_marker, - target_lane: target_pb_b_bulk_migration, - authority_doc: pure_bootstrap_zero_authority - }, - requires: [] -} - -data pb_rust_tests_outside_residual_zero_deferred: TestClaim = { - name: "pb_rust_tests_outside_residual_zero", - source: "// R1 release acceptance deferral marker; no program evaluation.\nlet _: Int = 0\n", - file_name: "r1_release_pb_rust_tests_outside_residual_zero.v3", - predicate: ReleaseDeferredClaim { - deferred_gate: pb_rust_tests_outside_residual_zero_gate_marker, - target_lane: target_pb_b_bulk_migration, - authority_doc: pure_bootstrap_zero_authority - }, - requires: [] -} - -data r1_release_acceptance_suite: TestSuite = { - name: "r1_release_acceptance_suite", - claims: [ - Enumerated(pb_hand_rust_at_shim_floor_deferred), - Enumerated(lens_producer_files_remaining_deferred), - Enumerated(pb_self_compile_fixed_point_strict), - Enumerated(pb_compiler_std_ratchet_zero_deferred), - Enumerated(pb_test_file_generated_from_dag_deferred), - Enumerated(pb_rust_tests_outside_residual_zero_deferred) - ] -} diff --git a/src/v3/compiler/tests/fixtures/r2_evaluator_cross_target_equivalence_harness_primitives.dag b/src/v3/compiler/tests/fixtures/r2_evaluator_cross_target_equivalence_harness_primitives.dag deleted file mode 100644 index 73385475efb..00000000000 --- a/src/v3/compiler/tests/fixtures/r2_evaluator_cross_target_equivalence_harness_primitives.dag +++ /dev/null @@ -1,66 +0,0 @@ -// std.r2_evaluator_cross_target_equivalence_harness_primitives — PR-D (Evaluator Manager). -// -// Structural acceptance hook: `evaluator_cross_target_equivalence_harness_primitives_landed` -// per docs/briefs/r2-evaluator-manager.md (Cross-target equivalence harness primitives). -// Slice 0: `Compiles` only. Slice 1: second `TestClaim` with `DifferentialEquals` (Lane-E wiring; -// fixture-local `v3_program_cost` / `v2_oracle_cost` stubs). See -// docs/briefs/r2-pr-d-cross-target-equivalence-harness-primitives.md. - -module std.r2_evaluator_cross_target_equivalence_harness_primitives - -import std.list { List, cons, empty, fold } -import std.substrate { Dag, PortId } -import std.types { Int } -import std.verification { - Compiles, - DifferentialEquals, - ProgramOutputBind, - TestClaim, - TestSuite -} -import v3.std.lookup { Lookup, miss_int_lookup } - -// T-LaneE stubs: `DeclarationRef` lowering only (bodies `miss_int_lookup()` — not consulted). -// Same pairing as `r1_gates.dag` differential witness; names are fixture-local. -fn v3_program_cost(d: Dag, port_id: PortId) -> Lookup = - miss_int_lookup() - -fn v2_oracle_cost(d: Dag, port_id: PortId) -> Lookup = - miss_int_lookup() - -data evaluator_cross_target_equivalence_harness_primitives_landed: TestClaim = { - name: "evaluator_cross_target_equivalence_harness_primitives_landed", - source: "fn trivial_identity(x: Int) -> Int = x\nlet _: Int = trivial_identity(0)\n", - file_name: "r2_pr_d_harness_primitive_stub.v3", - predicate: Compiles, - requires: [] -} - -// `output_ref` names the bind the runner resolves in `TestClaim.source` (cross-Dag bridge). -data pr_d_diff_out: Int = 0 - -data pr_d_lane_e_program_input: ProgramOutputBind = { - output_ref: pr_d_diff_out -} - -// Lane-E differential scaffold: host forward-fold vs emit `lens_cost` parity wiring -// (merge-sort-style branch / list / fold surface; names distinct from `r1_gates.dag`). -data evaluator_cross_target_equivalence_harness_primitives_differential_scaffold: TestClaim = { - name: "evaluator_cross_target_equivalence_harness_primitives_differential_scaffold", - source: "// PR-D slice 1 — DifferentialEquals scaffold (T-LaneE host vs emit parity wiring).\n// Fixture-local `pr_d_diff_out` program; mirrors `lane_e_bundled_witness_host_emit_parity` shape.\n\nimport std.list { List, cons, empty, fold }\n\nlet pr_d_diff_pick: Bool = true\n\nlet pr_d_diff_xs: List = cons(1, cons(2, empty()))\n\nlet pr_d_diff_out: Int =\n match pr_d_diff_pick {\n True => fold(pr_d_diff_xs, 0, |acc, x| acc + x)\n False => 0\n }\n", - file_name: "r2_pr_d_harness_differential_lane_e.v3", - predicate: DifferentialEquals( - v3_program_cost, - v2_oracle_cost, - pr_d_lane_e_program_input - ), - requires: [] -} - -data r2_evaluator_cross_target_equivalence_harness_primitives_suite: TestSuite = { - name: "r2_evaluator_cross_target_equivalence_harness_primitives_suite", - claims: [ - Enumerated(evaluator_cross_target_equivalence_harness_primitives_landed), - Enumerated(evaluator_cross_target_equivalence_harness_primitives_differential_scaffold) - ] -} diff --git a/src/v3/compiler/tests/fixtures/r2_evaluator_runtime_value_model.dag b/src/v3/compiler/tests/fixtures/r2_evaluator_runtime_value_model.dag deleted file mode 100644 index 1426ffa7080..00000000000 --- a/src/v3/compiler/tests/fixtures/r2_evaluator_runtime_value_model.dag +++ /dev/null @@ -1,24 +0,0 @@ -// std.r2_evaluator_runtime_value_model — PR-A (Evaluator Manager). -// -// Structural acceptance hook: `evaluator_runtime_value_model_landed` -// per docs/briefs/r2-evaluator-manager.md Acceptance and -// docs/briefs/r2-pr-a-runtime-value-model.md. PR-A.1 now validates the -// observable Value / NamedField carrier shape in Rust integration tests; -// later slices strengthen the remaining EvalFrame / EvalStateStack carriers. - -module std.r2_evaluator_runtime_value_model - -import std.verification { Compiles, TestClaim, TestSuite } - -data evaluator_runtime_value_model_landed: TestClaim = { - name: "evaluator_runtime_value_model_landed", - source: "// Runtime-value model PR-A.1 marker; Value / NamedField shape is validated by m2_substrate_inhabitance_test.rs.\nlet _: Int = 0\n", - file_name: "r2_evaluator_runtime_value_model_marker.v3", - predicate: Compiles, - requires: [] -} - -data r2_evaluator_runtime_value_model_suite: TestSuite = { - name: "r2_evaluator_runtime_value_model_suite", - claims: [Enumerated(evaluator_runtime_value_model_landed)] -} diff --git a/src/v3/compiler/tests/fixtures/r3_bridge_retirement_ledger_zero.dag b/src/v3/compiler/tests/fixtures/r3_bridge_retirement_ledger_zero.dag deleted file mode 100644 index d31786f62ef..00000000000 --- a/src/v3/compiler/tests/fixtures/r3_bridge_retirement_ledger_zero.dag +++ /dev/null @@ -1,25 +0,0 @@ -// std.r3_bridge_retirement_ledger_zero - R3 bridge ledger-zero gate. -// -// Production consumer for the substrate-owned BridgeLedger carrier and -// BridgeLedgerZero predicate. The claim subject is the canonical structural -// ledger declaration, not an executable program. The integration harness -// records the current open-row baseline and keeps a decreasing-open-count -// ratchet against this claim while the binary zero gate stays the terminus. - -module std.r3_bridge_retirement_ledger_zero - -import std.verification { BridgeLedgerZero, TestClaim, TestSuite } -import v3.std.bridge_ledger { bridge_ledger } - -data bridge_retirement_ledger_zero: TestClaim = { - name: "bridge_retirement_ledger_zero", - source: "", - file_name: "src/v3/std/bridge_ledger.dag", - predicate: BridgeLedgerZero { ledger: { decl: bridge_ledger } }, - requires: [] -} - -data r3_bridge_retirement_ledger_zero_suite: TestSuite = { - name: "r3_bridge_retirement_ledger_zero_suite", - claims: [Enumerated(bridge_retirement_ledger_zero)] -} diff --git a/src/v3/compiler/tests/fixtures/r3_class_2_function_valued_data.dag b/src/v3/compiler/tests/fixtures/r3_class_2_function_valued_data.dag deleted file mode 100644 index 7e84e75bdb9..00000000000 --- a/src/v3/compiler/tests/fixtures/r3_class_2_function_valued_data.dag +++ /dev/null @@ -1,21 +0,0 @@ -// R3 Class 2 gap representative: function-valued data is first-class. - -import std.list { List, Empty, Cons } -import v3.std.dimensions { DimensionReport, Witness } - -data add_one: fn(Int) -> Int = |x| x + 1 - -fn gate61_empty_int_witnesses() -> List> = Empty - -fn gate61_int_witnesses(c: Int) -> List> = - Cons { head: Inhabits(c), tail: gate61_empty_int_witnesses() } - -data report_int: fn(Int) -> DimensionReport = - |x| DimensionOk { - dimension_name: "function-valued-data", - composed: x, - witnesses: gate61_int_witnesses(x) - } - -fn test_function_valued_data() -> Int = add_one(41) -fn test_function_valued_dimension_report() -> DimensionReport = report_int(42) diff --git a/src/v3/compiler/tests/fixtures/r3_free_consequences_auto_loop_parallelism_dependence.v3 b/src/v3/compiler/tests/fixtures/r3_free_consequences_auto_loop_parallelism_dependence.v3 deleted file mode 100644 index c82525dafb3..00000000000 --- a/src/v3/compiler/tests/fixtures/r3_free_consequences_auto_loop_parallelism_dependence.v3 +++ /dev/null @@ -1,7 +0,0 @@ -// gunbc::r3_free_consequences::lane2_loop_witness: upsert_dependent -// free-consequences fixture: structural `fold` (acc + x) lowers a real loop; lens `Pass` still follows -// directive attestation + pending lens (ROADMAP second-batch auto-loop scaffold) - not compiler-derived upsert classification. -import std.list { List, cons, empty, fold } - -let auto_loop_dependence_xs: List = cons(1, cons(2, cons(3, empty()))) -let _: Int = fold(auto_loop_dependence_xs, 0, |acc, x| acc + x) diff --git a/src/v3/compiler/tests/fixtures/r3_free_consequences_first_batch.dag b/src/v3/compiler/tests/fixtures/r3_free_consequences_first_batch.dag deleted file mode 100644 index a6adc3ac6e2..00000000000 --- a/src/v3/compiler/tests/fixtures/r3_free_consequences_first_batch.dag +++ /dev/null @@ -1,137 +0,0 @@ -// std.r3_free_consequences_first_batch — T-Free-Consequences first-batch -// author-now/fire-later consumers. -// -// Five gates from `r3-v-free-consequences-worker.md`: -// - auto-parallelism x3 -// - auto-memoization x2 -// -// The auto-parallelism gates use ordinary lens data, not `DimensionReport`: -// DB-3 explicitly keeps parallelism outside the Dimension abstraction, and -// DB-20 models workflow parallelism through `WorkflowParallelismReport`. -// The auto-memoization gates still lock the `BinaryDimensionReportEquals` -// shape for the cost-related `DimensionReport` half of `Lens·Lens`. -// Gate #49 remains author-now/fire-later until the generic dimension-report -// producer/evaluator path can compare the declared observed/expected reports. - -module std.r3_free_consequences_first_batch - -import std.dimensions { DimensionReport } -import std.substrate { Dag } -import std.verification { - BinaryDimensionReportEquals, - LensOutputEquals, - ProgramInput, - TestClaim, - TestSuite -} - -type AutoMemoizationEvidence {} - -data auto_parallelism_program_input: ProgramInput = {} - -// Ordinary-lens placeholder until `src/v3/lenses/parallelism.dag` is ported from -// its fail-closed stub to a `.dag` producer over DB-20 workflow parallelism data. -// Keep this scalar and intentionally mismatched: current `LensOutputEquals` -// evaluation can execute scalar demo lenses, while DB-20's full -// `WorkflowParallelismReport` producer is still a follow-on ordinary-lens -// surface. The mismatch keeps the gate fail-closed; replace the placeholder -// lens and expected value together when `parallelism.dag` exposes the real -// structural producer. -fn auto_parallelism_pending_lens(_d: Dag) -> Int = 0 - -data auto_parallelism_pending_expected: Int = 1 - -// R3 #43 witness: runner matches emitted Rust for `std::thread::scope` (see test_runner). -fn r3_auto_parallelism_parallel_emit_witness(_d: Dag) -> Int = 0 - -data r3_auto_parallelism_parallel_emit_expected: Int = 1 - -// R3 #45 witness: runner inspects emitted Rust for the claim source and asserts -// (a) the Bool branch lowered to an `if … else` and (b) no `thread::scope` -// scheduling wraps the arms — branch arms are exclusive alternatives, not -// parallel work. See test_runner dispatch on -// `R3_BRANCH_ARMS_SERIALIZE_WITNESS_LENS_NAME`. Replace with a structural -// `parallelism.dag` producer when it lands per docs/design-free-consequences.md. -fn r3_auto_parallelism_branch_arms_serialize_witness(_d: Dag) -> Int = 0 - -data r3_auto_parallelism_branch_arms_serialize_expected: Int = 1 - -// R3 #50 witness: one-shot pure call sites must not emit memo/cache scaffolding. -fn r3_auto_memoization_one_shot_no_cache_witness(_d: Dag) -> Int = 0 - -data r3_auto_memoization_one_shot_no_cache_expected: Int = 1 - -type repeated_pure_call_observed_report = DimensionReport -type repeated_pure_call_expected_report = DimensionReport -type one_shot_call_observed_report = DimensionReport -type one_shot_call_expected_report = DimensionReport - -data auto_parallelism_independent_binds_emit_parallel: TestClaim = { - name: "auto_parallelism_independent_binds_emit_parallel", - source: "// free-consequences fixture: pairwise-independent top-level binds emit a parallel Rust schedule.\nlet a: Int = 1 + 2\nlet b: Int = 3 + 4\n", - file_name: "r3_free_consequences_auto_parallelism_independent_binds.v3", - predicate: LensOutputEquals( - r3_auto_parallelism_parallel_emit_witness, - auto_parallelism_program_input, - r3_auto_parallelism_parallel_emit_expected - ), - requires: [] -} - -data auto_parallelism_dependent_binds_pending_lens_fail_closed: TestClaim = { - name: "auto_parallelism_dependent_binds_pending_lens_fail_closed", - source: "// free-consequences fixture: dependent binds must remain sequential.\nlet a: Int = 1 + 2\nlet b: Int = a + 3\n", - file_name: "r3_free_consequences_auto_parallelism_dependent_binds.v3", - predicate: LensOutputEquals( - auto_parallelism_pending_lens, - auto_parallelism_program_input, - auto_parallelism_pending_expected - ), - requires: [] -} - -data auto_parallelism_branch_arms_serialize: TestClaim = { - name: "auto_parallelism_branch_arms_serialize", - source: "// free-consequences fixture: branch arms are exclusive alternatives, not parallel work.\nlet pick: Bool = true\nlet out: Int =\n match pick {\n True => 1 + 2\n False => 3 + 4\n }\n", - file_name: "r3_free_consequences_auto_parallelism_branch_arms.v3", - predicate: LensOutputEquals( - r3_auto_parallelism_branch_arms_serialize_witness, - auto_parallelism_program_input, - r3_auto_parallelism_branch_arms_serialize_expected - ), - requires: [] -} - -data auto_memoization_repeated_pure_call_cached: TestClaim = { - name: "auto_memoization_repeated_pure_call_cached", - source: "// free-consequences fixture: repeated pure calls may be cached when purity and cost witnesses land.\nlet _: Int = 0\n", - file_name: "r3_free_consequences_auto_memoization_repeated_pure_call.v3", - predicate: BinaryDimensionReportEquals( - repeated_pure_call_observed_report, - repeated_pure_call_expected_report - ), - requires: [] -} - -data auto_memoization_no_caching_for_one_shot: TestClaim = { - name: "auto_memoization_no_caching_for_one_shot", - source: "// free-consequences fixture: one-shot calls do not emit memoization scaffolding.\nfn bump(x: Int) -> Int = x + 1\nlet _: Int = bump(41)\n", - file_name: "r3_free_consequences_auto_memoization_one_shot.v3", - predicate: LensOutputEquals( - r3_auto_memoization_one_shot_no_cache_witness, - auto_parallelism_program_input, - r3_auto_memoization_one_shot_no_cache_expected - ), - requires: [] -} - -data r3_free_consequences_first_batch_suite: TestSuite = { - name: "r3_free_consequences_first_batch_suite", - claims: [ - Enumerated(auto_parallelism_independent_binds_emit_parallel), - Enumerated(auto_parallelism_dependent_binds_pending_lens_fail_closed), - Enumerated(auto_parallelism_branch_arms_serialize), - Enumerated(auto_memoization_repeated_pure_call_cached), - Enumerated(auto_memoization_no_caching_for_one_shot) - ] -} diff --git a/src/v3/compiler/tests/fixtures/r3_free_consequences_second_batch.dag b/src/v3/compiler/tests/fixtures/r3_free_consequences_second_batch.dag deleted file mode 100644 index 9ab5b74508d..00000000000 --- a/src/v3/compiler/tests/fixtures/r3_free_consequences_second_batch.dag +++ /dev/null @@ -1,115 +0,0 @@ -// std.r3_free_consequences_second_batch - T-Free-Consequences second-batch -// author-now/fire-later consumers. -// -// Five gates from `r3-v-free-consequences-worker.md`: -// - auto-loop-parallelism x3 -// - cross-target-optimization x2 -// -// The auto-loop-parallelism gates follow the first-batch DB-3/DB-20 split: -// parallelism is ordinary lens data, not `DimensionReport`. The -// cross-target-optimization gates are cost-related consumers and therefore -// keep the `BinaryDimensionReportEquals` shape over paired `DimensionReport` -// aliases. - -module std.r3_free_consequences_second_batch - -import std.dimensions { DimensionReport } -import std.substrate { Dag } -import std.verification { - BinaryDimensionReportEquals, - LensOutputEquals, - ProgramInput, - SymbolicCostExprEquals, - TestClaim, - TestSuite -} -import std.algebra { SymbolicCost, ConstantCost } - -type CrossTargetOptimizationEvidence {} - -data auto_loop_parallelism_program_input: ProgramInput = {} - -// `Dag -> Int` lens for `LensOutputEquals`. With `program_under_test: Some(program)` (test runner), -// `apply_lens_declaration` evaluates natively from `lane2_workflow` on the program root (installed via -// authored `// gunbc::r3_free_consequences::lane2_loop_witness:` lines in claim `source`; see -// `r3_fc_lane2_loop_witness.rs`). The `= 0` body applies when no program-under-test is supplied. -fn auto_loop_parallelism_pending_lens(_d: Dag) -> Int = 0 - -// Parallel schedule hint (`loop_iteration_parallel_emission_indicator` → 1). -data auto_loop_parallelism_pending_expected: Int = 1 - -// Sequential / fail-closed hint (indicator → 0) for unproven independence and provable dependence. -data auto_loop_parallelism_sequential_expected: Int = 0 - -type constant_fold_observed_report = DimensionReport -type constant_fold_expected_report = DimensionReport -type cost_structurally_derived_observed_report = DimensionReport -type cost_structurally_derived_expected_report = DimensionReport - -data constant_fold_pre_emission_cost: SymbolicCost = ConstantCost(1) - -data auto_loop_parallelism_provable_independence_emits_parallel: TestClaim = { - name: "auto_loop_parallelism_provable_independence_emits_parallel", - source: "// gunbc::r3_free_consequences::lane2_loop_witness: read_only\n// free-consequences fixture: staged harness — read_only directive is author attestation for gate #46, not a composed iteration-independence proof on this trivial body.\nlet _: Int = 0\n", - file_name: "r3_free_consequences_auto_loop_parallelism_provable_independence.v3", - predicate: LensOutputEquals( - auto_loop_parallelism_pending_lens, - auto_loop_parallelism_program_input, - auto_loop_parallelism_pending_expected - ), - requires: [] -} - -data auto_loop_parallelism_unproven_falls_back_sequential: TestClaim = { - name: "auto_loop_parallelism_unproven_falls_back_sequential", - source: "// gunbc::r3_free_consequences::lane2_loop_witness: unproven\n// free-consequences fixture: staged harness — unproven directive is author attestation of sequential fallback for gate #47, not compiler-inferred unprovenness.\nlet _: Int = 0\n", - file_name: "r3_free_consequences_auto_loop_parallelism_unproven.v3", - predicate: LensOutputEquals( - auto_loop_parallelism_pending_lens, - auto_loop_parallelism_program_input, - auto_loop_parallelism_sequential_expected - ), - requires: [] -} - -data auto_loop_parallelism_dependence_emits_sequential: TestClaim = { - name: "auto_loop_parallelism_dependence_emits_sequential", - source: "// gunbc::r3_free_consequences::lane2_loop_witness: upsert_dependent\n// free-consequences fixture: structural `fold` (acc + x) lowers a real loop; lens `Pass` still follows\n// directive attestation + pending lens (ROADMAP second-batch auto-loop scaffold) - not compiler-derived upsert classification.\nimport std.list { List, cons, empty, fold }\n\nlet auto_loop_dependence_xs: List = cons(1, cons(2, cons(3, empty())))\nlet _: Int = fold(auto_loop_dependence_xs, 0, |acc, x| acc + x)\n", - file_name: "r3_free_consequences_auto_loop_parallelism_dependence.v3", - predicate: LensOutputEquals( - auto_loop_parallelism_pending_lens, - auto_loop_parallelism_program_input, - auto_loop_parallelism_sequential_expected - ), - requires: [] -} - -data cross_target_optimization_constant_fold_consistent: TestClaim = { - name: "cross_target_optimization_constant_fold_consistent", - source: "// free-consequences fixture: constant folding applies the same structural cost shrink across target language specs.\nlet folded: Int = 1 + 2\n", - file_name: "r3_free_consequences_cross_target_constant_fold_consistent.v3", - predicate: SymbolicCostExprEquals(constant_fold_pre_emission_cost), - requires: [] -} - -data cross_target_optimization_cost_structurally_derived: TestClaim = { - name: "cross_target_optimization_cost_structurally_derived", - source: "// free-consequences fixture: cross-target optimization cost is structurally derived from Lens and LanguageSpec facts.\nlet _: Int = 0\n", - file_name: "r3_free_consequences_cross_target_cost_structurally_derived.v3", - predicate: BinaryDimensionReportEquals( - cost_structurally_derived_observed_report, - cost_structurally_derived_expected_report - ), - requires: [] -} - -data r3_free_consequences_second_batch_suite: TestSuite = { - name: "r3_free_consequences_second_batch_suite", - claims: [ - Enumerated(auto_loop_parallelism_provable_independence_emits_parallel), - Enumerated(auto_loop_parallelism_unproven_falls_back_sequential), - Enumerated(auto_loop_parallelism_dependence_emits_sequential), - Enumerated(cross_target_optimization_constant_fold_consistent), - Enumerated(cross_target_optimization_cost_structurally_derived) - ] -} diff --git a/src/v3/compiler/tests/fixtures/r3_l5_corpus/add_then_branch_seed.v3 b/src/v3/compiler/tests/fixtures/r3_l5_corpus/add_then_branch_seed.v3 deleted file mode 100644 index d168c101be9..00000000000 --- a/src/v3/compiler/tests/fixtures/r3_l5_corpus/add_then_branch_seed.v3 +++ /dev/null @@ -1,12 +0,0 @@ -// R3 L5 certification corpus - add-then-branch seed (gate #15 `l5_cross_target_consistency` authority). -// `TestClaim.source` in `r3_verification_l5_corpus.dag` must match this file exactly (integration test). -module user.r3_l5_add_then_branch_seed - -fn add(a: Int, b: Int) -> Int = a + b - -let seed_acc: Int = add(1, 2) -let l5_out: Int = - match seed_acc == 3 { - True => seed_acc - False => 0 - } diff --git a/src/v3/compiler/tests/fixtures/r3_l5_corpus/branch_literal_false_seed.v3 b/src/v3/compiler/tests/fixtures/r3_l5_corpus/branch_literal_false_seed.v3 deleted file mode 100644 index 59691f6128f..00000000000 --- a/src/v3/compiler/tests/fixtures/r3_l5_corpus/branch_literal_false_seed.v3 +++ /dev/null @@ -1,9 +0,0 @@ -// R3 L4 - second W1 Rust/Int receipt inside the #1499 surface: false Bool branch, signed Int output, one named output bind. - -let l4_pick: Bool = false - -let l4_false_out: Int = - match l4_pick { - True => 0 - False => -4 - } diff --git a/src/v3/compiler/tests/fixtures/r3_l5_corpus/branch_literal_true_seed.v3 b/src/v3/compiler/tests/fixtures/r3_l5_corpus/branch_literal_true_seed.v3 deleted file mode 100644 index 310fd96f1a3..00000000000 --- a/src/v3/compiler/tests/fixtures/r3_l5_corpus/branch_literal_true_seed.v3 +++ /dev/null @@ -1,9 +0,0 @@ -// R3 L4 - branch-only claim program on the current eager PR-B spine (no Callable / fold lambdas) so `dag_eval_output` can use `evaluate_body` while Callable remains fail-closed. - -let l4_pick: Bool = true - -let l4_out: Int = - match l4_pick { - True => 3 - False => 0 - } diff --git a/src/v3/compiler/tests/fixtures/r3_l5_corpus/nested_branch_seed.v3 b/src/v3/compiler/tests/fixtures/r3_l5_corpus/nested_branch_seed.v3 deleted file mode 100644 index 8c747e46416..00000000000 --- a/src/v3/compiler/tests/fixtures/r3_l5_corpus/nested_branch_seed.v3 +++ /dev/null @@ -1,13 +0,0 @@ -// R3 L4 - third W1 Rust/Int receipt inside the current Int-only ceiling: nested Bool branch, one named Int output bind. - -let l4_outer_pick: Bool = true -let l4_inner_pick: Bool = false - -let l4_nested_out: Int = - match l4_outer_pick { - True => match l4_inner_pick { - True => 5 - False => 7 - } - False => 0 - } diff --git a/src/v3/compiler/tests/fixtures/r3_path_b_brief3_char_in_class_exec.dag b/src/v3/compiler/tests/fixtures/r3_path_b_brief3_char_in_class_exec.dag deleted file mode 100644 index ea501303e73..00000000000 --- a/src/v3/compiler/tests/fixtures/r3_path_b_brief3_char_in_class_exec.dag +++ /dev/null @@ -1,23 +0,0 @@ -// PATH X / Brief 3: `std.unicode.char_in_class` lowers and executes end-to-end. -// -// Positional unicode-scalar literals narrow to nominal `Char` at the call via -// the same gate-20 registry static discharge as `data`/lowering (`unicode_scalar`/brand). - -module test.r3_path_b_brief3_char_in_class_exec - -import std.types { Char } -import std.unicode { CharClass, char_in_class } - -// Unary wrappers for evaluator parity vs `tokenize_generated::byte_matches` (ROADMAP parity row). -fn brief3_membership_whitespace(c: Char) -> Bool = char_in_class(c, Whitespace) -fn brief3_membership_digit(c: Char) -> Bool = char_in_class(c, Digit) -fn brief3_membership_ident_start(c: Char) -> Bool = char_in_class(c, IdentStart) -fn brief3_membership_ident_continue(c: Char) -> Bool = char_in_class(c, IdentContinue) - -fn receipt_letter_is_ident_start() -> Bool = char_in_class(97, IdentStart) - -fn receipt_digit_not_ident_start() -> Bool = char_in_class(53, IdentStart) - -fn receipt_space_not_ident_start() -> Bool = char_in_class(32, IdentStart) - -fn receipt_digit_is_digit() -> Bool = char_in_class(53, Digit) diff --git a/src/v3/compiler/tests/fixtures/r3_pb_eval_corpus/seed_int_arithmetic.v3 b/src/v3/compiler/tests/fixtures/r3_pb_eval_corpus/seed_int_arithmetic.v3 deleted file mode 100644 index f71be76de4d..00000000000 --- a/src/v3/compiler/tests/fixtures/r3_pb_eval_corpus/seed_int_arithmetic.v3 +++ /dev/null @@ -1,6 +0,0 @@ -// Program authority for `pb_eval_corpus_seed_int_arithmetic_deferred`. -module user.pb_eval_seed_int_arithmetic - -let pb_eval_seed_int_a: Int = 2 + 3 -let pb_eval_seed_int_b: Int = pb_eval_seed_int_a * 4 -let pb_eval_seed_int_out: Int = pb_eval_seed_int_b - 5 diff --git a/src/v3/compiler/tests/fixtures/r3_pb_eval_corpus/seed_list_fold.v3 b/src/v3/compiler/tests/fixtures/r3_pb_eval_corpus/seed_list_fold.v3 deleted file mode 100644 index 9d29176ae8f..00000000000 --- a/src/v3/compiler/tests/fixtures/r3_pb_eval_corpus/seed_list_fold.v3 +++ /dev/null @@ -1,8 +0,0 @@ -// Program authority for `pb_eval_corpus_seed_list_fold_deferred`. -module user.pb_eval_seed_list_fold - -import std.list { List, cons, empty, fold } - -let pb_eval_seed_list_values: List = cons(1, cons(2, cons(3, empty()))) -let pb_eval_seed_list_fold_out: Int = - fold(pb_eval_seed_list_values, 0, |acc, x| acc + x) diff --git a/src/v3/compiler/tests/fixtures/r3_pb_runtime_evaluator_corpus_seeds.dag b/src/v3/compiler/tests/fixtures/r3_pb_runtime_evaluator_corpus_seeds.dag deleted file mode 100644 index c6c8756be37..00000000000 --- a/src/v3/compiler/tests/fixtures/r3_pb_runtime_evaluator_corpus_seeds.dag +++ /dev/null @@ -1,70 +0,0 @@ -// std.r3_pb_runtime_evaluator_corpus_seeds — PB-Runtime ↔ R2-Evaluator -// Row-4 corpus seeds (1)–(2), author-now/fire-later. -// See docs/briefs/r3-pb-runtime-equivalence-corpus-seed-audit.md. -// -// The producer declarations below are fixture-local DeclarationRef targets only. -// `TestRunner::eval_differential_equals` intentionally returns NotYetImplemented -// for the `(pb_runtime_evaluate, r2_evaluator_evaluate)` producer pair today, so -// these claims compile the corpus seed programs without asserting Row 4 green. - -module std.r3_pb_runtime_evaluator_corpus_seeds - -import std.substrate { Dag, PortId } -import std.types { Int } -import std.verification { - DifferentialEquals, - ProgramOutputBind, - TestClaim, - TestSuite -} -import v3.std.lookup { Lookup, miss_int_lookup } - -fn pb_runtime_evaluate(d: Dag, port_id: PortId) -> Lookup = - miss_int_lookup() - -fn r2_evaluator_evaluate(d: Dag, port_id: PortId) -> Lookup = - miss_int_lookup() - -data pb_eval_seed_int_out: Int = 0 - -data pb_eval_seed_int_output: ProgramOutputBind = { - output_ref: pb_eval_seed_int_out -} - -data pb_eval_seed_list_fold_out: Int = 0 - -data pb_eval_seed_list_fold_output: ProgramOutputBind = { - output_ref: pb_eval_seed_list_fold_out -} - -data pb_eval_corpus_seed_int_arithmetic_deferred: TestClaim = { - name: "pb_eval_corpus_seed_int_arithmetic_deferred", - source: "// Program authority for `pb_eval_corpus_seed_int_arithmetic_deferred`.\nmodule user.pb_eval_seed_int_arithmetic\n\nlet pb_eval_seed_int_a: Int = 2 + 3\nlet pb_eval_seed_int_b: Int = pb_eval_seed_int_a * 4\nlet pb_eval_seed_int_out: Int = pb_eval_seed_int_b - 5\n", - file_name: "seed_int_arithmetic.v3", - predicate: DifferentialEquals( - pb_runtime_evaluate, - r2_evaluator_evaluate, - pb_eval_seed_int_output - ), - requires: [] -} - -data pb_eval_corpus_seed_list_fold_deferred: TestClaim = { - name: "pb_eval_corpus_seed_list_fold_deferred", - source: "// Program authority for `pb_eval_corpus_seed_list_fold_deferred`.\nmodule user.pb_eval_seed_list_fold\n\nimport std.list { List, cons, empty, fold }\n\nlet pb_eval_seed_list_values: List = cons(1, cons(2, cons(3, empty())))\nlet pb_eval_seed_list_fold_out: Int =\n fold(pb_eval_seed_list_values, 0, |acc, x| acc + x)\n", - file_name: "seed_list_fold.v3", - predicate: DifferentialEquals( - pb_runtime_evaluate, - r2_evaluator_evaluate, - pb_eval_seed_list_fold_output - ), - requires: [] -} - -data r3_pb_runtime_evaluator_corpus_seed_suite: TestSuite = { - name: "r3_pb_runtime_evaluator_corpus_seed_suite", - claims: [ - Enumerated(pb_eval_corpus_seed_int_arithmetic_deferred), - Enumerated(pb_eval_corpus_seed_list_fold_deferred) - ] -} diff --git a/src/v3/compiler/tests/fixtures/r3_perf_within_baseline_smoke.dag b/src/v3/compiler/tests/fixtures/r3_perf_within_baseline_smoke.dag deleted file mode 100644 index dea0186658e..00000000000 --- a/src/v3/compiler/tests/fixtures/r3_perf_within_baseline_smoke.dag +++ /dev/null @@ -1,40 +0,0 @@ -// std.r3_perf_within_baseline_smoke — end-to-end `PerfWithinBaseline` using substrate -// `PerfBaselineMeasurement { median_ns, p99_delta_ns }` + `PerfBudgetComparisonOp::AtMostBudget`. - -module std.r3_perf_within_baseline_smoke - -import std.list { empty } -import v3.std.substrate { PerfBaselineMeasurement } -import std.verification { - AtMostBudget, - PerfWithinBaseline, - TestClaim, - TestSuite -} - -data perf_within_smoke_baseline: PerfBaselineMeasurement = { - median_ns: 100, - p99_delta_ns: 100 -} - -data perf_within_smoke_subject: PerfBaselineMeasurement = { - median_ns: 50, - p99_delta_ns: 50 -} - -data perf_within_smoke_claim: TestClaim = { - name: "perf_within_baseline_substrate_shape_smoke", - source: "let _: Int = 0\n", - file_name: "perf_within_smoke.v3", - predicate: PerfWithinBaseline( - perf_within_smoke_subject, - AtMostBudget, - perf_within_smoke_baseline - ), - requires: [] -} - -data perf_within_smoke_suite: TestSuite = { - name: "perf_within_smoke_suite", - claims: [Enumerated(perf_within_smoke_claim)] -} diff --git a/src/v3/compiler/tests/fixtures/r3_self_gen_non_test_zero.dag b/src/v3/compiler/tests/fixtures/r3_self_gen_non_test_zero.dag deleted file mode 100644 index 9b16e91ca8a..00000000000 --- a/src/v3/compiler/tests/fixtures/r3_self_gen_non_test_zero.dag +++ /dev/null @@ -1,52 +0,0 @@ -// R3 gate #8 - `self_gen_non_test_zero`. -// -// This fixture makes the combined T-PB-A non-test closure predicate executable: -// both the non-test Rust census and the hand-authored scaffold-fragment census -// must reach zero. The runner reads live Self-Generation-0 state from `self_gen0_census_test.rs`; -// the source programs below are inert placeholders. - -module std.r3_self_gen_non_test_zero - -import std.verification { - CensusBoundCheck, - TestClaim, - TestSuite, - expected_hand_authored_fragments, - expected_hand_authored_non_test -} - -type Sg0CensusAuthority {} - -data self_gen0_census_test_authority: Sg0CensusAuthority = {} - -data self_gen_non_test_zero_rust_gate: TestClaim = { - name: "self_gen_non_test_zero_rust", - source: "// Self-Generation-0 census predicates read external census state, not this source.\nlet _: Int = 0\n", - file_name: "r3_self_gen_non_test_zero_rust.v3", - predicate: CensusBoundCheck { - authority: self_gen0_census_test_authority, - list_constant: expected_hand_authored_non_test, - bound: 0 - }, - requires: [] -} - -data self_gen_non_test_zero_fragments_gate: TestClaim = { - name: "self_gen_non_test_zero_fragments", - source: "// Self-Generation-0 census predicates read external census state, not this source.\nlet _: Int = 0\n", - file_name: "r3_self_gen_non_test_zero_fragments.v3", - predicate: CensusBoundCheck { - authority: self_gen0_census_test_authority, - list_constant: expected_hand_authored_fragments, - bound: 0 - }, - requires: [] -} - -data r3_self_gen_non_test_zero_suite: TestSuite = { - name: "r3_self_gen_non_test_zero_suite", - claims: [ - Enumerated(self_gen_non_test_zero_rust_gate), - Enumerated(self_gen_non_test_zero_fragments_gate) - ] -} diff --git a/src/v3/compiler/tests/fixtures/r3_substrate_gap_reflection_closure.dag b/src/v3/compiler/tests/fixtures/r3_substrate_gap_reflection_closure.dag deleted file mode 100644 index b8dda4d4176..00000000000 --- a/src/v3/compiler/tests/fixtures/r3_substrate_gap_reflection_closure.dag +++ /dev/null @@ -1,38 +0,0 @@ -// std.r3_substrate_gap_reflection_closure - R3 gate #64 substrate-plumbing receipt. -// -// This is NOT the canonical `substrate_gap_reflection_closure_closed` gate -// predicate. The class-level gate remains conjunctive per r3-structure.md: -// representative reflection execution via PB-Runtime plus zero residual -// class bridges. This fixture covers only the second half's current -// lens-producer residual census. - -module std.r3_substrate_gap_reflection_closure - -import std.verification { - CensusSubsetCount, - TestClaim, - TestSuite, - expected_hand_authored_non_test, - lens_producer_files_subset_predicate -} - -type Sg0CensusAuthority {} - -data self_gen0_census_test_authority: Sg0CensusAuthority = {} - -data substrate_gap_reflection_residual_census_receipt: TestClaim = { - name: "substrate_gap_reflection_residual_census_receipt", - source: "// Reflection residual-census receipts read external census state, not this source.\nlet _: Int = 0\n", - file_name: "r3_substrate_gap_reflection_residual_census_receipt.v3", - predicate: CensusSubsetCount { - authority: self_gen0_census_test_authority, - list_constant: expected_hand_authored_non_test, - subset_predicate: lens_producer_files_subset_predicate - }, - requires: [] -} - -data r3_substrate_gap_reflection_closure_suite: TestSuite = { - name: "r3_substrate_gap_reflection_closure_suite", - claims: [Enumerated(substrate_gap_reflection_residual_census_receipt)] -} diff --git a/src/v3/compiler/tests/fixtures/r3_verification_l4_emit_eval_match.dag b/src/v3/compiler/tests/fixtures/r3_verification_l4_emit_eval_match.dag deleted file mode 100644 index 7604e0f206d..00000000000 --- a/src/v3/compiler/tests/fixtures/r3_verification_l4_emit_eval_match.dag +++ /dev/null @@ -1,128 +0,0 @@ -// std.r3_verification_l4_emit_eval_match — R3 Lane 1: `DifferentialEquals(rust_emit_output, -// dag_eval_output, ProgramOutputBind)` W1 slice (transitional name + Int stdout carve-out per -// `docs/briefs/r3-pr-e8-w1-output-producer-contract-blocker.md` / #1485). Fixture stubs -// `rust_emit_output` / `dag_eval_output` are not executed — the runner implements both sides. - -module std.r3_verification_l4_emit_eval_match - -import std.substrate { Dag, PortId } -import std.types { Int } -import std.verification { - DifferentialEquals, - ProgramOutputBind, - TestClaim, - TestSuite -} -import v3.std.lookup { Lookup, miss_int_lookup } - -fn rust_emit_output(d: Dag, port_id: PortId) -> Lookup = - miss_int_lookup() - -fn dag_eval_output(d: Dag, port_id: PortId) -> Lookup = - miss_int_lookup() - -data l4_out: Int = 0 - -data r3_l4_emit_eval_program_input: ProgramOutputBind = { - output_ref: l4_out -} - -data l4_false_out: Int = 0 - -data r3_l4_emit_eval_false_program_input: ProgramOutputBind = { - output_ref: l4_false_out -} - -data l4_nested_out: Int = 0 - -data r3_l4_emit_eval_nested_program_input: ProgramOutputBind = { - output_ref: l4_nested_out -} - -data l4_add_then_branch_out: Int = 0 - -data r3_l4_emit_eval_add_then_branch_program_input: ProgramOutputBind = { - output_ref: l4_add_then_branch_out -} - -data l4_arithmetic_chain_out: Int = 0 - -data r3_l4_emit_eval_arithmetic_chain_program_input: ProgramOutputBind = { - output_ref: l4_arithmetic_chain_out -} - -// §1.8 gate #9 `l4_emit_eval_match` — slice-1 certification seed (Rust / Int stdout); lane closure -// still requires exhaustive corpus growth per `r3-structure.md` §Acceptance. -data l4_emit_eval_match: TestClaim = { - name: "l4_emit_eval_match", - source: "// R3 L4 — branch-only claim program on the current eager PR-B spine (no Callable / fold lambdas) so `dag_eval_output` can use `evaluate_body` while Callable remains fail-closed.\n\nlet l4_pick: Bool = true\n\nlet l4_out: Int =\n match l4_pick {\n True => 3\n False => 0\n }\n", - file_name: "l4_emit_eval_match.v3", - predicate: DifferentialEquals( - rust_emit_output, - dag_eval_output, - r3_l4_emit_eval_program_input - ), - requires: [] -} - -data r3_verification_l4_emit_eval_false_branch: TestClaim = { - name: "r3_verification_l4_emit_eval_false_branch", - source: "// R3 L4 — second W1 Rust/Int receipt inside the #1499 surface: false Bool branch, signed Int output, one named output bind.\n\nlet l4_pick: Bool = false\n\nlet l4_false_out: Int =\n match l4_pick {\n True => 0\n False => -4\n }\n", - file_name: "r3_verification_l4_emit_eval_false_branch.v3", - predicate: DifferentialEquals( - rust_emit_output, - dag_eval_output, - r3_l4_emit_eval_false_program_input - ), - requires: [] -} - -data r3_verification_l4_emit_eval_nested_branch: TestClaim = { - name: "r3_verification_l4_emit_eval_nested_branch", - source: "// R3 L4 — third W1 Rust/Int receipt inside the current Int-only ceiling: nested Bool branch, one named Int output bind.\n\nlet l4_outer_pick: Bool = true\nlet l4_inner_pick: Bool = false\n\nlet l4_nested_out: Int =\n match l4_outer_pick {\n True => match l4_inner_pick {\n True => 5\n False => 7\n }\n False => 0\n }\n", - file_name: "r3_verification_l4_emit_eval_nested_branch.v3", - predicate: DifferentialEquals( - rust_emit_output, - dag_eval_output, - r3_l4_emit_eval_nested_program_input - ), - requires: [] -} - -data r3_verification_l4_emit_eval_add_then_branch: TestClaim = { - name: "r3_verification_l4_emit_eval_add_then_branch", - source: "// R3 L4 — corpus seed from the Lane 1 brief: function call + Int arithmetic + branch lowering + one named output bind.\n\nfn l4_add(a: Int, b: Int) -> Int = a + b\n\nlet l4_acc: Int = l4_add(1, 2)\nlet l4_add_then_branch_out: Int =\n match l4_acc == 3 {\n True => l4_acc\n False => 0\n }\n", - file_name: "r3_verification_l4_emit_eval_add_then_branch.v3", - predicate: DifferentialEquals( - rust_emit_output, - dag_eval_output, - r3_l4_emit_eval_add_then_branch_program_input - ), - requires: [] -} - -data r3_verification_l4_emit_eval_arithmetic_chain: TestClaim = { - name: "r3_verification_l4_emit_eval_arithmetic_chain", - source: "// R3 L4 — arithmetic-chain W1 Rust/Int receipt: function call, repeated Int additions, equality branch, one named output bind.\n\nfn l4_double(a: Int) -> Int = a + a\n\nlet l4_base: Int = 4\nlet l4_total: Int = l4_double(l4_base) + 2\nlet l4_arithmetic_chain_out: Int =\n match l4_total == 10 {\n True => l4_total\n False => 0\n }\n", - file_name: "r3_verification_l4_emit_eval_arithmetic_chain.v3", - predicate: DifferentialEquals( - rust_emit_output, - dag_eval_output, - r3_l4_emit_eval_arithmetic_chain_program_input - ), - requires: [] -} - -// Declaration id is fixture-local and distinct from `r3_verification_l7_algebraic_laws.dag` so two -// modules are never ambiguous under one loader. L7 claims join this suite name when lane 1 closes -// under one loader module (parent brief); until then this suite lists L4 certification seeds only. -data r3_verification_l4_l7_direct_suite: TestSuite = { - name: "r3_verification_l4_l7_direct_suite", - claims: [ - Enumerated(l4_emit_eval_match), - Enumerated(r3_verification_l4_emit_eval_false_branch), - Enumerated(r3_verification_l4_emit_eval_nested_branch), - Enumerated(r3_verification_l4_emit_eval_add_then_branch), - Enumerated(r3_verification_l4_emit_eval_arithmetic_chain) - ] -} diff --git a/src/v3/compiler/tests/fixtures/r3_verification_l4_emit_eval_mixed_lineage.dag b/src/v3/compiler/tests/fixtures/r3_verification_l4_emit_eval_mixed_lineage.dag deleted file mode 100644 index 6ed3d74b8f6..00000000000 --- a/src/v3/compiler/tests/fixtures/r3_verification_l4_emit_eval_mixed_lineage.dag +++ /dev/null @@ -1,45 +0,0 @@ -// std.r3_verification_l4_emit_eval_mixed_lineage — negative control for W1 `DifferentialEquals` -// dispatch: pairs `rust_emit_output` with a non-W1 oracle so `eval_differential_equals` returns -// `NotYetImplemented` with an explicit unsupported-producer-pair receipt (producer-identity / -// observation gates per #1485; coordinate with #1495 ratchet when it lands — do not weaken to Pass). - -module std.r3_verification_l4_emit_eval_mixed_lineage - -import std.substrate { Dag, PortId } -import std.types { Int } -import std.verification { - DifferentialEquals, - ProgramOutputBind, - TestClaim, - TestSuite -} -import v3.std.lookup { Lookup, miss_int_lookup } - -fn rust_emit_output(d: Dag, port_id: PortId) -> Lookup = - miss_int_lookup() - -fn v3_program_cost(d: Dag, port_id: PortId) -> Lookup = - miss_int_lookup() - -data mixed_out: Int = 0 - -data mixed_program_input: ProgramOutputBind = { - output_ref: mixed_out -} - -data r3_verification_l4_emit_eval_mixed_lineage_claim: TestClaim = { - name: "r3_verification_l4_emit_eval_mixed_lineage_claim", - source: "let mixed_out: Int = 1\n", - file_name: "r3_verification_l4_emit_eval_mixed_lineage.v3", - predicate: DifferentialEquals( - rust_emit_output, - v3_program_cost, - mixed_program_input - ), - requires: [] -} - -data r3_verification_l4_emit_eval_mixed_lineage_suite: TestSuite = { - name: "r3_verification_l4_emit_eval_mixed_lineage_suite", - claims: [Enumerated(r3_verification_l4_emit_eval_mixed_lineage_claim)] -} diff --git a/src/v3/compiler/tests/fixtures/r3_verification_l5_corpus.dag b/src/v3/compiler/tests/fixtures/r3_verification_l5_corpus.dag deleted file mode 100644 index 727ba3d5b53..00000000000 --- a/src/v3/compiler/tests/fixtures/r3_verification_l5_corpus.dag +++ /dev/null @@ -1,89 +0,0 @@ -// std.r3_verification_l5_corpus — R3 L5 certification corpus: `ForAllTargets` over -// Rust / Python / Go Int stdout parity (`docs/r3-program-plan.md` §1.8 gate #15). - -module std.r3_verification_l5_corpus - -import std.verification { ForAllTargets, ProgramOutputBind, TestClaim, TestSuite } - -type L5RustcToolchain {} -type L5Python3Toolchain {} -type L5GoToolchain {} - -type l5_out {} -type l4_out {} -type l4_false_out {} -type l4_nested_out {} - -data r3_l5_gate_program_output: ProgramOutputBind = { - output_ref: l5_out -} - -data r3_l5_branch_true_program_output: ProgramOutputBind = { - output_ref: l4_out -} - -data r3_l5_branch_false_program_output: ProgramOutputBind = { - output_ref: l4_false_out -} - -data r3_l5_nested_program_output: ProgramOutputBind = { - output_ref: l4_nested_out -} - -data l5_cross_target_consistency_add_then: TestClaim = { - name: "l5_cross_target_consistency", - source: "// R3 L5 certification corpus - add-then-branch seed (gate #15 `l5_cross_target_consistency` authority).\n// `TestClaim.source` in `r3_verification_l5_corpus.dag` must match this file exactly (integration test).\nmodule user.r3_l5_add_then_branch_seed\n\nfn add(a: Int, b: Int) -> Int = a + b\n\nlet seed_acc: Int = add(1, 2)\nlet l5_out: Int =\n match seed_acc == 3 {\n True => seed_acc\n False => 0\n }\n", - file_name: "add_then_branch_seed.v3", - predicate: ForAllTargets("true", [], 0, r3_l5_gate_program_output), - requires: [ - { target: L5RustcToolchain }, - { target: L5Python3Toolchain }, - { target: L5GoToolchain } - ] -} - -data r3_l5_cert_branch_literal_true: TestClaim = { - name: "r3_l5_cert_branch_literal_true", - source: "// R3 L4 - branch-only claim program on the current eager PR-B spine (no Callable / fold lambdas) so `dag_eval_output` can use `evaluate_body` while Callable remains fail-closed.\n\nlet l4_pick: Bool = true\n\nlet l4_out: Int =\n match l4_pick {\n True => 3\n False => 0\n }\n", - file_name: "branch_literal_true_seed.v3", - predicate: ForAllTargets("true", [], 0, r3_l5_branch_true_program_output), - requires: [ - { target: L5RustcToolchain }, - { target: L5Python3Toolchain }, - { target: L5GoToolchain } - ] -} - -data r3_l5_cert_branch_literal_false: TestClaim = { - name: "r3_l5_cert_branch_literal_false", - source: "// R3 L4 - second W1 Rust/Int receipt inside the #1499 surface: false Bool branch, signed Int output, one named output bind.\n\nlet l4_pick: Bool = false\n\nlet l4_false_out: Int =\n match l4_pick {\n True => 0\n False => -4\n }\n", - file_name: "branch_literal_false_seed.v3", - predicate: ForAllTargets("true", [], 0, r3_l5_branch_false_program_output), - requires: [ - { target: L5RustcToolchain }, - { target: L5Python3Toolchain }, - { target: L5GoToolchain } - ] -} - -data r3_l5_cert_nested_branch: TestClaim = { - name: "r3_l5_cert_nested_branch", - source: "// R3 L4 - third W1 Rust/Int receipt inside the current Int-only ceiling: nested Bool branch, one named Int output bind.\n\nlet l4_outer_pick: Bool = true\nlet l4_inner_pick: Bool = false\n\nlet l4_nested_out: Int =\n match l4_outer_pick {\n True => match l4_inner_pick {\n True => 5\n False => 7\n }\n False => 0\n }\n", - file_name: "nested_branch_seed.v3", - predicate: ForAllTargets("true", [], 0, r3_l5_nested_program_output), - requires: [ - { target: L5RustcToolchain }, - { target: L5Python3Toolchain }, - { target: L5GoToolchain } - ] -} - -data l5_cross_target_consistency: TestSuite = { - name: "l5_cross_target_consistency", - claims: [ - Enumerated(l5_cross_target_consistency_add_then), - Enumerated(r3_l5_cert_branch_literal_true), - Enumerated(r3_l5_cert_branch_literal_false), - Enumerated(r3_l5_cert_nested_branch), - ] -} diff --git a/src/v3/compiler/tests/fixtures/r3_verification_l7_algebraic_laws.dag b/src/v3/compiler/tests/fixtures/r3_verification_l7_algebraic_laws.dag deleted file mode 100644 index ea2761df3a9..00000000000 --- a/src/v3/compiler/tests/fixtures/r3_verification_l7_algebraic_laws.dag +++ /dev/null @@ -1,215 +0,0 @@ -// std.r3_verification_l7_algebraic_laws — R3 Lane 1/L7 algebraic-law fixtures. -// -// The skeleton suite uses `AlgebraicLaw(Identity, …)` over Int `+` as an ordinary bounded witness -// row (same discipline as `Associativity` / `Commutativity`). The matrix suite below pre-authors -// enum-backed per-(algebra, law) fixture rows for the current `AlgebraicLawKind` surface: -// `Associativity`, `Commutativity`, and `Identity`. -// -// Laws such as distributivity, absorption, inverse, complement, annihilation, -// and order laws are theory in `dsl/std/algebra.dag` but **not** -// `AlgebraicLawKind` variants. They are substrate-introduction candidates via -// INVARIANTS §P1, not fixture-local encodings. -// -// **Receipt limits:** `AlgebraicLaw` payload is only `AlgebraicLawKind` + `lens_ref` — there is no -// declared identity-element / operation-class substrate edge distinguishing add-zero vs mul-one vs -// lattice units vs free-monoid empty (codex review / PR #2394). Additive vs multiplicative identity -// is expressed **only** by wiring distinct binary `Int` lenses (`+` vs `*`). Passing-matrix rows -// below intentionally exclude obligations whose tags imply non-`Int` inhabitants or non-additive / -// non-multiplicative operations until faithful witnesses exist. This fixture is a consumer receipt -// for the current `AlgebraicLawKind` executable surface; non-enum laws such as distributivity / -// absorption remain substrate §P1 extensions rather than fixture-local encodings. - -module std.r3_verification_l7_algebraic_laws - -import std.types { Int } -import std.verification { AlgebraicLaw, Associativity, Commutativity, Identity, TestClaim, TestSuite } - -fn r3_l7_identity_placeholder_op(a: Int, b: Int) -> Int = a + b -fn r3_l7_semigroup_associativity_op(a: Int, b: Int) -> Int = a + b -fn r3_l7_monoid_identity_op(a: Int, b: Int) -> Int = a + b -fn r3_l7_commutative_monoid_commutativity_op(a: Int, b: Int) -> Int = a + b -fn r3_l7_group_identity_op(a: Int, b: Int) -> Int = a + b -fn r3_l7_abelian_group_commutativity_op(a: Int, b: Int) -> Int = a + b -fn r3_l7_semiring_add_commutativity_op(a: Int, b: Int) -> Int = a + b -fn r3_l7_semiring_mul_identity_op(a: Int, b: Int) -> Int = a * b -fn r3_l7_ring_add_commutativity_op(a: Int, b: Int) -> Int = a + b -fn r3_l7_ring_mul_identity_op(a: Int, b: Int) -> Int = a * b -fn r3_l7_ordered_ring_add_commutativity_op(a: Int, b: Int) -> Int = a + b -fn r3_l7_ordered_ring_mul_identity_op(a: Int, b: Int) -> Int = a * b -fn r3_l7_lattice_meet_associativity_op(a: Int, b: Int) -> Int = a + b -fn r3_l7_lattice_join_commutativity_op(a: Int, b: Int) -> Int = a + b -fn r3_l7_bounded_lattice_meet_identity_op(a: Int, b: Int) -> Int = a + b -fn r3_l7_boolean_algebra_join_identity_op(a: Int, b: Int) -> Int = a + b -fn r3_l7_free_monoid_identity_op(a: Int, b: Int) -> Int = a + b - -data r3_verification_l7_algebraic_laws_skeleton: TestClaim = { - name: "r3_verification_l7_algebraic_laws_skeleton", - source: "fn r3_l7_identity_placeholder_op(a: Int, b: Int) -> Int = a + b\n", - file_name: "r3_verification_l7_algebraic_laws_skeleton.v3", - predicate: AlgebraicLaw(Identity, r3_l7_identity_placeholder_op), - requires: [] -} - -// Passing-matrix rows: binary `Int` lenses whose **operation matches the tagged additive vs -// multiplicative obligation** (`+` for additive monoid/group/semiring-add laws; `*` for mul -// `Identity`). Lattice meet/join **associativity/commutativity** tags are **not** green-lit here on -// `Int` `+` (that would read as lattice laws without meet/join carriers). Bounded-lattice / -// Boolean-algebra / free-monoid identity placeholders likewise stay **out** of the passing matrix. -// -// §1.8 gate #10 canonical `TestClaim.name` / declaration id (`docs/r3-program-plan.md`): bounded -// `AlgebraicLaw::Associativity` on honest `Int` `+` (Semigroup lead row). The suite below is the -// non-ignored consumer matrix for every currently executable `AlgebraicLawKind` row. -data l7_algebraic_laws_witnessed: TestClaim = { - name: "l7_algebraic_laws_witnessed", - source: "fn r3_l7_semigroup_associativity_op(a: Int, b: Int) -> Int = a + b\n", - file_name: "l7_algebraic_laws_witnessed.v3", - predicate: AlgebraicLaw(Associativity, r3_l7_semigroup_associativity_op), - requires: [] -} - -data r3_l7_monoid_identity: TestClaim = { - name: "r3_l7_monoid_identity", - source: "fn r3_l7_monoid_identity_op(a: Int, b: Int) -> Int = a + b\n", - file_name: "r3_l7_monoid_identity.v3", - predicate: AlgebraicLaw(Identity, r3_l7_monoid_identity_op), - requires: [] -} - -data r3_l7_commutative_monoid_commutativity: TestClaim = { - name: "r3_l7_commutative_monoid_commutativity", - source: "fn r3_l7_commutative_monoid_commutativity_op(a: Int, b: Int) -> Int = a + b\n", - file_name: "r3_l7_commutative_monoid_commutativity.v3", - predicate: AlgebraicLaw(Commutativity, r3_l7_commutative_monoid_commutativity_op), - requires: [] -} - -data r3_l7_group_identity: TestClaim = { - name: "r3_l7_group_identity", - source: "fn r3_l7_group_identity_op(a: Int, b: Int) -> Int = a + b\n", - file_name: "r3_l7_group_identity.v3", - predicate: AlgebraicLaw(Identity, r3_l7_group_identity_op), - requires: [] -} - -data r3_l7_abelian_group_commutativity: TestClaim = { - name: "r3_l7_abelian_group_commutativity", - source: "fn r3_l7_abelian_group_commutativity_op(a: Int, b: Int) -> Int = a + b\n", - file_name: "r3_l7_abelian_group_commutativity.v3", - predicate: AlgebraicLaw(Commutativity, r3_l7_abelian_group_commutativity_op), - requires: [] -} - -data r3_l7_semiring_add_commutativity: TestClaim = { - name: "r3_l7_semiring_add_commutativity", - source: "fn r3_l7_semiring_add_commutativity_op(a: Int, b: Int) -> Int = a + b\n", - file_name: "r3_l7_semiring_add_commutativity.v3", - predicate: AlgebraicLaw(Commutativity, r3_l7_semiring_add_commutativity_op), - requires: [] -} - -data r3_l7_semiring_mul_identity: TestClaim = { - name: "r3_l7_semiring_mul_identity", - source: "fn r3_l7_semiring_mul_identity_op(a: Int, b: Int) -> Int = a * b\n", - file_name: "r3_l7_semiring_mul_identity.v3", - predicate: AlgebraicLaw(Identity, r3_l7_semiring_mul_identity_op), - requires: [] -} - -data r3_l7_ring_add_commutativity: TestClaim = { - name: "r3_l7_ring_add_commutativity", - source: "fn r3_l7_ring_add_commutativity_op(a: Int, b: Int) -> Int = a + b\n", - file_name: "r3_l7_ring_add_commutativity.v3", - predicate: AlgebraicLaw(Commutativity, r3_l7_ring_add_commutativity_op), - requires: [] -} - -data r3_l7_ring_mul_identity: TestClaim = { - name: "r3_l7_ring_mul_identity", - source: "fn r3_l7_ring_mul_identity_op(a: Int, b: Int) -> Int = a * b\n", - file_name: "r3_l7_ring_mul_identity.v3", - predicate: AlgebraicLaw(Identity, r3_l7_ring_mul_identity_op), - requires: [] -} - -data r3_l7_ordered_ring_add_commutativity: TestClaim = { - name: "r3_l7_ordered_ring_add_commutativity", - source: "fn r3_l7_ordered_ring_add_commutativity_op(a: Int, b: Int) -> Int = a + b\n", - file_name: "r3_l7_ordered_ring_add_commutativity.v3", - predicate: AlgebraicLaw(Commutativity, r3_l7_ordered_ring_add_commutativity_op), - requires: [] -} - -data r3_l7_ordered_ring_mul_identity: TestClaim = { - name: "r3_l7_ordered_ring_mul_identity", - source: "fn r3_l7_ordered_ring_mul_identity_op(a: Int, b: Int) -> Int = a * b\n", - file_name: "r3_l7_ordered_ring_mul_identity.v3", - predicate: AlgebraicLaw(Identity, r3_l7_ordered_ring_mul_identity_op), - requires: [] -} - -// Lattice tags — retained until faithful meet/join inhabitants exist; **not** in the passing matrix on `Int` `+`. -data r3_l7_lattice_meet_associativity: TestClaim = { - name: "r3_l7_lattice_meet_associativity", - source: "fn r3_l7_lattice_meet_associativity_op(a: Int, b: Int) -> Int = a + b\n", - file_name: "r3_l7_lattice_meet_associativity.v3", - predicate: AlgebraicLaw(Associativity, r3_l7_lattice_meet_associativity_op), - requires: [] -} - -data r3_l7_lattice_join_commutativity: TestClaim = { - name: "r3_l7_lattice_join_commutativity", - source: "fn r3_l7_lattice_join_commutativity_op(a: Int, b: Int) -> Int = a + b\n", - file_name: "r3_l7_lattice_join_commutativity.v3", - predicate: AlgebraicLaw(Commutativity, r3_l7_lattice_join_commutativity_op), - requires: [] -} - -// Retained for future faithful lattice / monoid inhabitants — **not** in the passing matrix (see suite comment above). -data r3_l7_bounded_lattice_meet_identity: TestClaim = { - name: "r3_l7_bounded_lattice_meet_identity", - source: "fn r3_l7_bounded_lattice_meet_identity_op(a: Int, b: Int) -> Int = a + b\n", - file_name: "r3_l7_bounded_lattice_meet_identity.v3", - predicate: AlgebraicLaw(Identity, r3_l7_bounded_lattice_meet_identity_op), - requires: [] -} - -data r3_l7_boolean_algebra_join_identity: TestClaim = { - name: "r3_l7_boolean_algebra_join_identity", - source: "fn r3_l7_boolean_algebra_join_identity_op(a: Int, b: Int) -> Int = a + b\n", - file_name: "r3_l7_boolean_algebra_join_identity.v3", - predicate: AlgebraicLaw(Identity, r3_l7_boolean_algebra_join_identity_op), - requires: [] -} - -data r3_l7_free_monoid_identity: TestClaim = { - name: "r3_l7_free_monoid_identity", - source: "fn r3_l7_free_monoid_identity_op(a: Int, b: Int) -> Int = a + b\n", - file_name: "r3_l7_free_monoid_identity.v3", - predicate: AlgebraicLaw(Identity, r3_l7_free_monoid_identity_op), - requires: [] -} - -// Declaration id is fixture-local and distinct from `r3_verification_l4_emit_eval_match.dag` so two -// modules are never ambiguous under one loader. Lane 1 acceptance may later merge both claims into -// one module under `r3_verification_l4_l7_direct_suite` (parent brief). -data r3_verification_l7_algebra_skeleton_suite: TestSuite = { - name: "r3_verification_l7_algebra_skeleton_suite", - claims: [Enumerated(r3_verification_l7_algebraic_laws_skeleton)] -} - -data r3_verification_l7_algebra_matrix_suite: TestSuite = { - name: "r3_verification_l7_algebra_matrix_suite", - claims: [ - Enumerated(l7_algebraic_laws_witnessed), - Enumerated(r3_l7_monoid_identity), - Enumerated(r3_l7_commutative_monoid_commutativity), - Enumerated(r3_l7_group_identity), - Enumerated(r3_l7_abelian_group_commutativity), - Enumerated(r3_l7_semiring_add_commutativity), - Enumerated(r3_l7_semiring_mul_identity), - Enumerated(r3_l7_ring_add_commutativity), - Enumerated(r3_l7_ring_mul_identity), - Enumerated(r3_l7_ordered_ring_add_commutativity), - Enumerated(r3_l7_ordered_ring_mul_identity) - ] -} diff --git a/src/v3/compiler/tests/fixtures/rust_dag_isomorphism_consumer.dag b/src/v3/compiler/tests/fixtures/rust_dag_isomorphism_consumer.dag deleted file mode 100644 index 5eed60b268f..00000000000 --- a/src/v3/compiler/tests/fixtures/rust_dag_isomorphism_consumer.dag +++ /dev/null @@ -1,32 +0,0 @@ -// std.rust_dag_isomorphism_consumer - structural equality consumer. -// -// RustDagIsomorphism is a consumer instance, not a new predicate family: -// compare the Rust enum extraction shape report and the .dag reflection shape -// report through BinaryDimensionReportEquals. The concrete DagShapeReport -// producer remains substrate-owned; these aliases pin the report-carrier shape -// this consumer expects. - -module std.rust_dag_isomorphism_consumer - -import std.dimensions { DimensionReport } -import std.substrate { Dag } -import std.verification { BinaryDimensionReportEquals, TestClaim, TestSuite } - -type RustEnumExtractionDagShapeReport = DimensionReport -type DagReflectionDagShapeReport = DimensionReport - -data rust_dag_isomorphism_executable: TestClaim = { - name: "rust_dag_isomorphism_executable", - source: "", - file_name: "src/v3/lenses/dag_shape.dag", - predicate: BinaryDimensionReportEquals( - RustEnumExtractionDagShapeReport, - DagReflectionDagShapeReport - ), - requires: [] -} - -data rust_dag_isomorphism_consumer_suite: TestSuite = { - name: "rust_dag_isomorphism_consumer_suite", - claims: [Enumerated(rust_dag_isomorphism_executable)] -} diff --git a/src/v3/compiler/tests/fixtures/t_gate_58_timing_enforcement_budget_violation.dag b/src/v3/compiler/tests/fixtures/t_gate_58_timing_enforcement_budget_violation.dag deleted file mode 100644 index 4ea215aedf8..00000000000 --- a/src/v3/compiler/tests/fixtures/t_gate_58_timing_enforcement_budget_violation.dag +++ /dev/null @@ -1,32 +0,0 @@ -// Gate #58 executable receipt: `timing_enforceable` + `EnforcedApplication` host enforcement. -// -// `gate_58_ci_workflow_timing_row` is substrate-authoritative in -// `t_ci_workflow_as_data_demo.dag`; this fixture pairs an over-budget `TimingMeasurement` -// with a 1-ns ceiling so `check_enforced_lens_applications` must emit a lens-enforcement -// diagnostic (same fail-closed path as gate #92's LAS demo, but on timing). -module user.t_gate_58_timing_enforcement_budget_violation - -import v3.std.lens_application { DeclarationScope, EnforcedApplication } -import v3.std.timing_lens { - TimingBudget, - TimingEnforcementProjected, - TimingMeasurement, - timing_enforceable -} -import v3.std.t_ci_workflow_as_data_demo { - gate_58_ci_workflow_timing_row, - modeled_gunbc_ci_workflow -} - -data gate_58_section_over_budget: gate_58_ci_workflow_timing_row = { - workflow: modeled_gunbc_ci_workflow - measurement: Observed { duration: { count: 999 } } -} - -data gate_58_enforcement_budget_violation: EnforcedApplication = { - enforceable_lens: timing_enforceable - section: DeclarationScope { declaration: gate_58_section_over_budget } - budget: { max: { count: 1 } } - diagnostic_severity: Error - span: { file: "t_gate_58_timing_enforcement_budget_violation.dag", start: 0, end: 1 } -} diff --git a/src/v3/compiler/tests/fixtures/t_las_complexity_contract_demo.dag b/src/v3/compiler/tests/fixtures/t_las_complexity_contract_demo.dag deleted file mode 100644 index cc6de47e24c..00000000000 --- a/src/v3/compiler/tests/fixtures/t_las_complexity_contract_demo.dag +++ /dev/null @@ -1,23 +0,0 @@ -// Gate #92 witness: `complexity_of` + `EnforcedApplication` enforcement consumer. -// -// `linear_countdown_score` is a structurally terminating recursive function: -// non-positive inputs stop immediately, and positive inputs count down to zero. -// The current authoritative complexity lens observes this recursive descent as -// `ClassUnknown`; the enforced application below requires `ClassConstant`, -// forcing a fail-closed diagnostic at the authored lens-application span. -module user.t_las_complexity_contract_demo - -import lenses.complexity { ComplexitySummary, complexity_enforceable } -import std.algebra { AsymptoticClass } -import v3.std.lens_application { EnforcedApplication, DeclarationScope } - -fn linear_countdown_score(n: Int) -> Int = - if n < 1 then 0 else linear_countdown_score(n - 1) + 1 - -data witness_log_cap: EnforcedApplication = { - enforceable_lens: complexity_enforceable - section: DeclarationScope { declaration: linear_countdown_score } - budget: ClassConstant - diagnostic_severity: Error - span: { file: "t_las_complexity_contract_demo.dag", start: 805, end: 1147 } -} diff --git a/src/v3/compiler/tests/fixtures/t_las_crdt_cost_basis_demo.dag b/src/v3/compiler/tests/fixtures/t_las_crdt_cost_basis_demo.dag deleted file mode 100644 index 89c1179a443..00000000000 --- a/src/v3/compiler/tests/fixtures/t_las_crdt_cost_basis_demo.dag +++ /dev/null @@ -1,16 +0,0 @@ -// std.t_las_crdt_cost_basis_demo — T-Lens-Application-Surface gate #93 -// (`crdt_cost_basis_demonstrated`) fixture companion. -// -// §4.2 authoring target (design lock: docs/design-lens-application-surface.md): -// apply_lens(cost, my_crdt_field, Enforce { -// budget: SymbolicCost { per_op: O_log_replicas } -// diagnostic_severity: Error -// }) -// -// Executable `.dag` syntax for `apply_lens(...)` is not at HEAD; this file -// pins the cost-lens-owned basis carriers (`CostBasisKind`, `CostBasisDeclaration` -// in `src/v3/lenses/cost.dag`) and imports used by the integration TestClaim. - -module std.t_las_crdt_cost_basis_demo - -import lenses.cost { CostBasisDeclaration, CostBasisKind, SymbolicCostEntry } diff --git a/src/v3/compiler/tests/fixtures/t_las_parallelism_iteration_gate95_fixture.dag b/src/v3/compiler/tests/fixtures/t_las_parallelism_iteration_gate95_fixture.dag deleted file mode 100644 index 3bf82474ccc..00000000000 --- a/src/v3/compiler/tests/fixtures/t_las_parallelism_iteration_gate95_fixture.dag +++ /dev/null @@ -1,9 +0,0 @@ -// std.t_las_parallelism_iteration_gate95_fixture — T-LAS gate #95 companion. -// -// Pins `parallelism_enforceable` (`src/v3/lenses/parallelism.dag`) for Self-Generation-0 / integration -// discovery. Executable `apply_lens(parallelism, NodeScope { … })` authoring remains deferred — -// receipts exercise the host consumer (`check_enforced_lens_applications`) in -// `enforced_lens_application.rs`. -module std.t_las_parallelism_iteration_gate95_fixture - -import lenses.parallelism { parallelism_enforceable } diff --git a/src/v3/compiler/tests/fixtures/t_pb_b_brief_d/contract_diagnostic_smoke.v3 b/src/v3/compiler/tests/fixtures/t_pb_b_brief_d/contract_diagnostic_smoke.v3 deleted file mode 100644 index 2fa95868cae..00000000000 --- a/src/v3/compiler/tests/fixtures/t_pb_b_brief_d/contract_diagnostic_smoke.v3 +++ /dev/null @@ -1,25 +0,0 @@ -// T-PB-B Brief D — draft contract negatives (`FailsWithDiagnostic`). -// Schema authority: `src/v3/std/verification.dag`. -// -// Dissolution: same claim as `src/v3/compiler/tests/dag/t_pb_b_1_contract_diagnostic_smoke.dag`. -// Retire this `.v3` once Testgen accepts that `.dag` module as the maintained copy (Brief D -// named trigger); until then, keep source/predicate text aligned with the `.dag` sibling. -// -// Fixture smoke lowers this module cleanly only — it does not evaluate `FailsWithDiagnostic` -// on embedded `source` (see `docs/briefs/t-pb-b-1.md`, *Compile-smoke caveat*). - -import std.list { empty } -import std.verification { TestClaim, TestSuite, TestPredicate } - -let claim_bool_int_rejected: TestClaim = { - name: "Bool annotation rejects Int literal", - source: "let x: Bool = 1", - file_name: "t1_4_type_mismatch.v3", - predicate: FailsWithDiagnostic({ kind: TypeMismatch, detail_contains: AnyDetail }), - requires: empty() -} - -let suite_contract_diagnostic_negatives: TestSuite = { - name: "t-pb-b/contract/diagnostic_negatives", - claims: [claim_bool_int_rejected] -} diff --git a/src/v3/compiler/tests/fixtures/t_pb_b_brief_d/contract_port_cost_smoke.v3 b/src/v3/compiler/tests/fixtures/t_pb_b_brief_d/contract_port_cost_smoke.v3 deleted file mode 100644 index fe0050513f8..00000000000 --- a/src/v3/compiler/tests/fixtures/t_pb_b_brief_d/contract_port_cost_smoke.v3 +++ /dev/null @@ -1,37 +0,0 @@ -// T-PB-B Brief D — draft `PortHasState` + `CostBounded` claims (contract / lens vocabulary). -// Schema authority: `src/v3/std/verification.dag`. -// Cost witness is the runner-evaluated value for `let answer: Int = 1 + 1 + 1 + 1` -// (three `+` additions = 3), matching the landed `.dag` sibling. The `m1_5_verification_test` -// smoke still ships an unevaluated `Eq 8` placeholder; that is compile-only and not a claim -// of runner-evaluated cost. -// -// Dissolution: same claims as `src/v3/compiler/tests/dag/t_pb_b_1_contract_port_cost.dag`. -// Retire this `.v3` once Testgen accepts that `.dag` module as the maintained copy (Brief D -// named trigger); until then, keep source/predicate text aligned with the `.dag` sibling. - -import std.list { empty } -import std.verification { TestClaim, TestSuite, TestPredicate } - -let pred_answer_resolved: TestPredicate = PortHasState("answer", Resolved) -let pred_answer_cost_eq_3: TestPredicate = CostBounded("answer", Eq, 3) - -let claim_answer_resolved: TestClaim = { - name: "answer bind resolves", - source: "let answer: Int = 1 + 1 + 1 + 1", - file_name: "t_pb_b_port_answer.v3", - predicate: pred_answer_resolved, - requires: empty() -} - -let claim_answer_cost_bounded: TestClaim = { - name: "answer bind has bounded cost witness (Eq 3)", - source: "let answer: Int = 1 + 1 + 1 + 1", - file_name: "t_pb_b_cost_answer.v3", - predicate: pred_answer_cost_eq_3, - requires: empty() -} - -let suite_contract_port_and_cost: TestSuite = { - name: "t-pb-b/contract/port_and_cost", - claims: [claim_answer_resolved, claim_answer_cost_bounded] -} diff --git a/src/v3/compiler/tests/fixtures/t_pb_b_brief_d/pipeline_smoke.v3 b/src/v3/compiler/tests/fixtures/t_pb_b_brief_d/pipeline_smoke.v3 deleted file mode 100644 index 9f462ea9e57..00000000000 --- a/src/v3/compiler/tests/fixtures/t_pb_b_brief_d/pipeline_smoke.v3 +++ /dev/null @@ -1,23 +0,0 @@ -// T-PB-B Brief D — draft pipeline-oriented `TestSuite` / `TestClaim` values. -// Schema authority: `src/v3/std/verification.dag`. Non-landing; Rust tests remain canonical. -// Predicate: `Compiles` on embedded v3 program text (pipe unary smoke). -// -// Dissolution: same claim as `src/v3/compiler/tests/dag/t_pb_b_1_pipeline_smoke.dag`. -// Retire this `.v3` once Testgen accepts that `.dag` module as the maintained copy (Brief D -// named trigger); until then, keep source/predicate text aligned with the `.dag` sibling. - -import std.list { empty } -import std.verification { TestClaim, TestSuite, TestPredicate } - -let claim_pipe_unary_compiles: TestClaim = { - name: "pipe unary call program compiles", - source: "fn negate(x: Int) -> Int = 0 - x\nlet y = 5 |> negate\n", - file_name: "pipe_unary.v3", - predicate: Compiles, - requires: empty() -} - -let suite_pipeline_pipe_unary: TestSuite = { - name: "t-pb-b/pipeline/pipe_unary_compiles", - claims: [claim_pipe_unary_compiles] -} diff --git a/src/v3/compiler/tests/fixtures/tc1_substrate_lens_eta_equivalence_deferred.dag b/src/v3/compiler/tests/fixtures/tc1_substrate_lens_eta_equivalence_deferred.dag deleted file mode 100644 index 90323aa3fa4..00000000000 --- a/src/v3/compiler/tests/fixtures/tc1_substrate_lens_eta_equivalence_deferred.dag +++ /dev/null @@ -1,56 +0,0 @@ -// std.tc1_substrate_lens_eta_equivalence_deferred — TC1 (R2 substrate research scope). -// -// Author-now / fire-later structural `TestClaim` for eta-equivalence at substrate -// level vs `Lens` / `DimensionReport`. Design intent: -// - PR #1178 `docs/design-substrate-lambda-calculus-grounding.md` — "eta-equivalence at substrate level" -// - `docs/design-lens-framework.md` — `Lens`, `DimensionReport` -// -// `SubstrateResearchDeferredClaim` remains runner-valid only in this file (not -// R1 `r1_release_acceptance.dag` / `ReleaseDeferredClaim`), but TC1's strict -// consumer path now authors the unified `BinaryDimensionReportEquals` shape. -// The equality still author-now/fire-later gates on generic DimensionReport -// production/evaluation and lens producer retirement. - -module std.tc1_substrate_lens_eta_equivalence_deferred - -import std.dimensions { DimensionReport } -import std.verification { - BinaryDimensionReportEquals, - TestClaim, - TestSuite -} - -// Carrier for the TC1 eta-equivalence observation. The concrete `Lens` set -// and eta-pair producer are still pending T-Substrate-Lens-Primitive + lens -// producer retirement; this fixture locks the unified consumer shape. -type Tc1EtaLensObservation {} - -// Eta-equivalent term pair: -// - `tc1_subject_f_report` represents applying `fold_lens` to `f`. -// - `tc1_subject_eta_expanded_report` represents applying `fold_lens` to -// the eta-expanded form `lambda x.apply(f, [x])`. -// -// Both refs intentionally produce the same `DimensionReport` carrier. The -// runner validates that shape today and returns NotYetImplemented until generic -// report evaluation can compare the produced values structurally. -type tc1_subject_f_report = DimensionReport -type tc1_subject_eta_expanded_report = DimensionReport - -// Gates on T-Substrate-Lens-Primitive landing (Q6/Q6.5/Q7/Q8 design locks LANDED via #1129; substrate primitive itself in cadence after PR-PreF #1167) -// TC1 — For any Lens, applying it to `f` and to eta-expanded -// `lambda x.apply(f, [x])` yields identical DimensionReport. -data eta_equivalent_dag_forms_yield_identical_lens_results: TestClaim = { - name: "eta_equivalent_dag_forms_yield_identical_lens_results", - source: "// TC1 deferred theorem marker; no program evaluation.\nlet _: Int = 0\n", - file_name: "tc1_eta_equivalent_dag_forms_yield_identical_lens_results.v3", - predicate: BinaryDimensionReportEquals( - tc1_subject_f_report, - tc1_subject_eta_expanded_report - ), - requires: [] -} - -data tc1_substrate_lens_eta_equivalence_suite: TestSuite = { - name: "tc1_substrate_lens_eta_equivalence_suite", - claims: [Enumerated(eta_equivalent_dag_forms_yield_identical_lens_results)] -} diff --git a/src/v3/compiler/tests/fixtures/tc1_substrate_lens_eta_equivalence_strict_fire.dag b/src/v3/compiler/tests/fixtures/tc1_substrate_lens_eta_equivalence_strict_fire.dag deleted file mode 100644 index 89c70a17eae..00000000000 --- a/src/v3/compiler/tests/fixtures/tc1_substrate_lens_eta_equivalence_strict_fire.dag +++ /dev/null @@ -1,81 +0,0 @@ -// std.tc1_substrate_lens_eta_equivalence_strict_fire — TC1 V1 first slice (Pattern-A / E6-G1.a). -// -// Authority chain (Director ratifications, current as of 2026-05-07): -// - Q-PAFS Path A ACCEPTED 2026-05-06 (PR #1824 merge record on `main`). -// - Q-Reification Option A ratified 2026-05-07 (PR #2096): `Dag` IS the reflected program. -// - Substrate Mgr Gate A patches MERGED 2026-05-07 (PR #2079, commit 0e8724bc). -// - V1 dispatch unblocked by Verification Mgr (wise-bear-525, #2075) per Director cascade -// UNHOLD signal at gunbc#828 #issuecomment-4394467134. -// -// Differences vs `tc1_substrate_lens_eta_equivalence_deferred.dag`: -// - Canonical TestClaim name `tc1_eta_equivalence_executable` per `r3-program-plan.md` §1.8 #11 -// (deferred fixture's claim name is the R2 research-receipt form, not the §1.8 gate name). -// - Adds the η-pair callables `eta_subject_f` / `eta_subject_f_eta` at source level — η-equivalent -// pair `f` and `lambda x. apply(f, [x])` per TC1 statement (`r3-v-tc1-eta-equivalence-deeper- -// analysis.md` §"What TC1 Asserts"). Both compute the same `Int` value structurally. -// - Predicate stays `BinaryDimensionReportEquals` (Pattern-A consumer envelope; unified -// surface ratified at gunbc#828). -// -// Runner: §1.8 gate #11 executes via `TestRunner::try_eval_tc1_eta_equivalence_executable`: -// `analyze_symbolic_cost_dimension` at η-pair entry binds in `TestClaim.source`. Typed refs remain -// `DimensionReport` (Pattern-A envelope); Pass uses a **proxy** -// `DimensionReport` comparison until gunbc#1972 lands the real -// `Tc1EtaLensObservation` fold — single forward dissolution trigger (INVARIANTS P5-style receipt). -// -// Path A intent for this representative: both entries reduce to the same Int computation (`0+1`); -// η-expansion adds an indirect call but the symbolic-cost lens attributes the **same** root -// `composed` asymptotic bound for these workflows today — so equality of root `composed` -// `SymbolicCost` matches Director-approved Path A static-rep receipt without claiming full TC1 -// lens-fold η-invariance yet. A future analyzer that weights call depth could flip this gate until -// #1972 migrates the assertion to carrier-native reports. -// -// Hard bars (E6-G1.a Option 3 caveat #1853): no `lens_apply` / `eval_substrate_reify` / -// `reflect_behavior` imports. Carrier shape is the ratified Q-Reification Option A `Dag`-as- -// carrier (Verification consumes; does not introduce). - -module std.tc1_substrate_lens_eta_equivalence_strict_fire - -import std.dimensions { DimensionReport } -import std.verification { - BinaryDimensionReportEquals, - TestClaim, - TestSuite -} - -// Carrier for the TC1 eta-equivalence observation. Stays opaque at this slice — the carrier -// identity is what BinaryDimensionReportEquals normalizes on (left/right must agree). -type Tc1EtaLensObservation {} - -// η-pair callables — both compute the same `Int` value. `eta_subject_f_eta` is the η-expanded -// form `lambda x. apply(eta_subject_f, [x])`; the lens-fold-over-`Dag` of either should yield -// equal `DimensionReport` values once the Evaluator substrate-fact -// projection path lands. These declarations make the η-pair source-visible (Mgr/ -// reviewer can read non-vacuity intent off the .dag) even though runtime fold isn't wired -// at this slice. -fn eta_subject_f(x: Int) -> Int = x + 1 -fn eta_subject_f_eta(x: Int) -> Int = eta_subject_f(x) - -// Typed report refs — the unified `BinaryDimensionReportEquals` consumer envelope reads -// these as `DeclarationRef`s and validates carrier-equivalence today. Fold-output wiring -// is Evaluator-side; #1970 closed superseded-by-deferral, with the remaining path tracked at #1972. -type tc1_subject_f_report = DimensionReport -type tc1_subject_eta_expanded_report = DimensionReport - -// §1.8 gate #11 canonical TestClaim name. Predicate uses the unified `BinaryDimensionReportEquals` -// shape; `TestClaim.source` wires η-pair entry binds — runner compares **root composed SymbolicCost** -// proxy equality (see header comment); full `Tc1EtaLensObservation` report parity is gunbc#1972. -data tc1_eta_equivalence_executable_claim: TestClaim = { - name: "tc1_eta_equivalence_executable", - source: "// TC1 V1 executable η-pair — binds wired for runner Path A (`tc1_eta_exec_*`).\nfn eta_subject_f(x: Int) -> Int = x + 1\nfn eta_subject_f_eta(x: Int) -> Int = eta_subject_f(x)\nfn tc1_eta_exec_direct() -> Int = eta_subject_f(0)\nfn tc1_eta_exec_eta_expanded() -> Int = eta_subject_f_eta(0)\n", - file_name: "tc1_eta_equivalence_executable.v3", - predicate: BinaryDimensionReportEquals( - tc1_subject_f_report, - tc1_subject_eta_expanded_report - ), - requires: [] -} - -data tc1_substrate_lens_eta_equivalence_strict_fire_suite: TestSuite = { - name: "tc1_substrate_lens_eta_equivalence_strict_fire_suite", - claims: [Enumerated(tc1_eta_equivalence_executable_claim)] -} diff --git a/src/v3/compiler/tests/fixtures/tc2_church_rosser_executable.v3 b/src/v3/compiler/tests/fixtures/tc2_church_rosser_executable.v3 deleted file mode 100644 index 466e58f4e21..00000000000 --- a/src/v3/compiler/tests/fixtures/tc2_church_rosser_executable.v3 +++ /dev/null @@ -1,7 +0,0 @@ -// TC2 strict-fire - binary Transform + two argument sites (non-atomic subexpressions). -// Vacuity guard: LeftFirst vs RightFirst eager schedules traverse distinct operand-eval order. -module user.tc2_church_rosser_executable - -fn sub_pos(a: Int, b: Int) -> Int = a - b - -let _: Int = sub_pos(2 + 3, 1 + 1) diff --git a/src/v3/compiler/tests/fixtures/tc2_church_rosser_strict_fire.dag b/src/v3/compiler/tests/fixtures/tc2_church_rosser_strict_fire.dag deleted file mode 100644 index c57e6b276b9..00000000000 --- a/src/v3/compiler/tests/fixtures/tc2_church_rosser_strict_fire.dag +++ /dev/null @@ -1,47 +0,0 @@ -// std.tc2_church_rosser_strict_fire — TC2 (Church-Rosser / strategy-order) first executable slice. -// -// Authority: `r3-program-plan.md` gate #12 `tc2_church_rosser_executable`; -// `r3-v-pattern-a-tc2-v1-worker.md` (Pattern-A; unified `BinaryDimensionReportEquals` envelope). -// -// Differences vs `tc2_evaluation_order_independence_deferred.dag`: -// - Canonical TestClaim name `tc2_church_rosser_executable` (deferred fixture uses the -// R2 research-receipt form `evaluation_order_independent_lens_results`). -// - Fixture-local `DimensionReport` role names (`tc2_church_rosser_strict_fire_*`) so the -// runner routes the executable slice off the `BinaryDimensionReportEquals` payload alone -// (INVARIANTS P2) without colliding with deferred `tc2_leftfirst_strategy_dimension_report`. -// -// Runner: `BinaryDimensionReportEquals` over these roles materializes strategy-keyed -// `DimensionReport` values for the embedded claim program (see `test_runner.rs`). -// -// Vacuity guard (Pattern-A TC2): `TestClaim.source` must not be a constant-only program — gate #12 -// is Church-Rosser / **n-ary Transform input-evaluation order**. The embedded program is a binary -// call whose operands are **two non-atomic Int subexpressions**, so eager LeftFirst vs RightFirst -// schedules differ in evaluation trace / memo keys even before substrate producers land (same idea as -// worker brief STOP on vacuous strategy equality). - -module std.tc2_church_rosser_strict_fire - -import std.dimensions { DimensionReport } -import std.substrate { Dag } -import std.verification { BinaryDimensionReportEquals, TestClaim, TestSuite } - -// Role types: runner resolves these to strategy-conditioned `DimensionReport` rows. -type tc2_church_rosser_strict_fire_left_dimension_report = DimensionReport -type tc2_church_rosser_strict_fire_right_dimension_report = DimensionReport - -// Gate #12 canonical TestClaim name. -data tc2_church_rosser_executable_claim: TestClaim = { - name: "tc2_church_rosser_executable", - source: "// TC2 strict-fire - binary Transform + two argument sites (non-atomic subexpressions).\n// Vacuity guard: LeftFirst vs RightFirst eager schedules traverse distinct operand-eval order.\nmodule user.tc2_church_rosser_executable\n\nfn sub_pos(a: Int, b: Int) -> Int = a - b\n\nlet _: Int = sub_pos(2 + 3, 1 + 1)\n", - file_name: "tc2_church_rosser_executable.v3", - predicate: BinaryDimensionReportEquals( - tc2_church_rosser_strict_fire_left_dimension_report, - tc2_church_rosser_strict_fire_right_dimension_report - ), - requires: [] -} - -data tc2_church_rosser_strict_fire_suite: TestSuite = { - name: "tc2_church_rosser_strict_fire_suite", - claims: [Enumerated(tc2_church_rosser_executable_claim)] -} diff --git a/src/v3/compiler/tests/fixtures/tc2_evaluation_order_independence_deferred.dag b/src/v3/compiler/tests/fixtures/tc2_evaluation_order_independence_deferred.dag deleted file mode 100644 index 157e636a2ec..00000000000 --- a/src/v3/compiler/tests/fixtures/tc2_evaluation_order_independence_deferred.dag +++ /dev/null @@ -1,49 +0,0 @@ -// std.tc2_evaluation_order_independence_deferred — TC2 (R2 Evaluator semantics). -// -// Author-now / fire-later structural `TestClaim` for Church-Rosser-style -// evaluation-order independence over evaluator runtime values and Lens -// results. Runtime values remain gated on the closed-over-environment decision -// in docs/briefs/r2-pr-a-runtime-value-model.md: environments are evaluator -// state (`EvalFrame` / `EvalStateStack`), not observable Value inhabitants. -// -// Slice-0 strict predicate: unified `BinaryDimensionReportEquals` (Director #828; -// Substrate PR #1318) with TC2 **strategy-order** interpretation — pair -// `DimensionReport` role declarations for **LeftFirst** vs **RightFirst** -// n-ary Transform input-evaluation order (PR #1316 §1). Modifier semantics -// live in the future report producers / runner wiring, not in a parallel -// `TestPredicate` variant. Runner evaluation is NYI until generic -// `DimensionReport` production lands; strict-fire still waits on ≥2 -// executable strategies (PR #1316 §4 P4). `TestClaim.source` is empty — -// predicate is structural (paired report refs); no claim program slice. - -module std.tc2_evaluation_order_independence_deferred - -import std.dimensions { DimensionReport } -import std.substrate { Dag } -import std.verification { BinaryDimensionReportEquals, TestClaim, TestSuite } - -// Role types: producers will resolve these to strategy-conditioned folds. -type tc2_leftfirst_strategy_dimension_report = DimensionReport -type tc2_rightfirst_strategy_dimension_report = DimensionReport - -// Gates on PB-Runtime spec landing (#1176 landed) + T-Substrate-Lens-Primitive landing (R2 Substrate cadence). -// Evaluation-order strategies enumerated per docs/design-pb-runtime-interpreter.md §3. -// TC2 — For any program + Lens, two valid evaluation strategies -// (applicative-order vs normal-order; left-first vs right-first -// input evaluation in n-ary Transform) yield identical -// DimensionReport. -data evaluation_order_independent_lens_results: TestClaim = { - name: "evaluation_order_independent_lens_results", - source: "", - file_name: "tc2_evaluation_order_independent_lens_results.v3", - predicate: BinaryDimensionReportEquals( - tc2_leftfirst_strategy_dimension_report, - tc2_rightfirst_strategy_dimension_report - ), - requires: [] -} - -data tc2_evaluation_order_independence_suite: TestSuite = { - name: "tc2_evaluation_order_independence_suite", - claims: [Enumerated(evaluation_order_independent_lens_results)] -} diff --git a/src/v3/compiler/tests/fixtures/tc3_strong_normalization_deferred.dag b/src/v3/compiler/tests/fixtures/tc3_strong_normalization_deferred.dag deleted file mode 100644 index 3084e2d09dd..00000000000 --- a/src/v3/compiler/tests/fixtures/tc3_strong_normalization_deferred.dag +++ /dev/null @@ -1,43 +0,0 @@ -// std.tc3_strong_normalization_deferred — TC3 (strong normalization / R3 Verification). -// -// Stage-(a) author-now-fire-later `TestClaim` for the PB→Verification transition -// described in docs/briefs/r3-pb-t-fixedpoint-worker.md §"TC3 — Strong-normalization -// TestClaim" and docs/briefs/r3-v-formal-grounding-tc-bundle.md (two-stage gate). -// -// Uses unified `BinaryDimensionReportEquals` with TC3 **evaluation-step** interpretation: -// paired `DimensionReport` roles stand in for evaluation-step witness parity -// (bounded forward execution vs termination evidence — exact producers land with -// B5 + T-Substrate-Lens-Primitive + T-FixedPoint cadence). Full theorem witnessing -// (stage b) remains gated on T-FixedPoint completion; this fixture does not assert -// runtime termination over the typed fragment. -// -// `TestClaim.source` is empty — predicate is structural (paired report refs); no -// claim program slice (Verification structural-claim convention; cf. PR #1325). -// -// NO new `TestPredicate` variants — consumer-only authoring per Director #828. - -module std.tc3_strong_normalization_deferred - -import std.dimensions { DimensionReport } -import std.substrate { Dag } -import std.verification { BinaryDimensionReportEquals, TestClaim, TestSuite } - -// Role types: baseline vs bounded-step projection producers hook here when wired. -type tc3_evaluation_step_baseline_dimension_report = DimensionReport -type tc3_evaluation_step_compare_dimension_report = DimensionReport - -data tc3_strong_normalization_substrate_introduced: TestClaim = { - name: "tc3_strong_normalization_substrate_introduced", - source: "", - file_name: "tc3_strong_normalization_substrate_introduced.v3", - predicate: BinaryDimensionReportEquals( - tc3_evaluation_step_baseline_dimension_report, - tc3_evaluation_step_compare_dimension_report - ), - requires: [] -} - -data tc3_strong_normalization_suite: TestSuite = { - name: "tc3_strong_normalization_suite", - claims: [Enumerated(tc3_strong_normalization_substrate_introduced)] -} diff --git a/src/v3/compiler/tests/fixtures/tc3_strong_normalization_executable.v3 b/src/v3/compiler/tests/fixtures/tc3_strong_normalization_executable.v3 deleted file mode 100644 index faa5d8dda88..00000000000 --- a/src/v3/compiler/tests/fixtures/tc3_strong_normalization_executable.v3 +++ /dev/null @@ -1,9 +0,0 @@ -// TC3 strict-fire - strong-normalization scaffold over typed `.dag` programs. -// Vacuity guard: evaluation has nontrivial step structure (function application -// + arithmetic) so baseline eval-step and termination-evidence projections do -// not collapse to a single trivial trace before producers land. -module user.tc3_strong_normalization_executable - -fn succ(n: Int) -> Int = n + 1 - -let _: Int = succ(succ(0)) diff --git a/src/v3/compiler/tests/fixtures/tc3_strong_normalization_strict_fire.dag b/src/v3/compiler/tests/fixtures/tc3_strong_normalization_strict_fire.dag deleted file mode 100644 index 0ab4a934467..00000000000 --- a/src/v3/compiler/tests/fixtures/tc3_strong_normalization_strict_fire.dag +++ /dev/null @@ -1,59 +0,0 @@ -// std.tc3_strong_normalization_strict_fire — TC3 (strong-normalization) first executable slice. -// -// Authority: `r3-program-plan.md` §1.8 gate #13 `tc3_pattern_a_second_mover_executable`; -// `r3-v-pattern-a-tc3-v1-worker.md` (Pattern-A second-mover; unified -// `BinaryDimensionReportEquals` envelope; two-stage gate (a)/(b)). -// -// Differences vs `tc3_strong_normalization_deferred.dag`: -// - Canonical TestClaim name `tc3_pattern_a_second_mover_executable` (deferred fixture uses -// the R2 research-receipt form `tc3_strong_normalization_substrate_introduced`). -// - Same predicate shape and same role-pair carrier `Dag` per -// `r3-v-tc3-pattern-a-second-mover-conformance-audit.md` §Witness-Shape Commitments -// (baseline evaluation-step projection vs bounded-step / termination-evidence projection). -// - Embeds a non-vacuous typed `.v3` source (sidecar `tc3_strong_normalization_executable.v3`) -// so the eval-step / termination-evidence projection pair is not trivially equal at the -// substrate flip. -// -// Runner status today: `BinaryDimensionReportEquals` shape-only — `eval_binary_dimension_report_ -// equals_shape` returns `NotYetImplemented` after structural validation (generic -// `DimensionReport` production/evaluation substrate not landed). Strict-fire **PASSING** -// requires bundle stage (b): T-FixedPoint termination semantics (gunbc#2087) + Evaluator -// eval-step / bounded-step producer surface. Integration test asserts shape-valid NYI today; -// flips to Pass when (a)+(b) land without changing this claim name. -// -// Vacuity guard (Pattern-A TC3): `TestClaim.source` is a structurally bounded computation -// (`succ(succ(0))`) — a multi-step evaluation whose baseline eval-step trace and termination- -// evidence projection diverge in step structure even before producers wire (audit §Non-Drift -// Findings — no serialized / string / byte / theorem encoding). -// -// NO new `TestPredicate` variants — consumer-only authoring per Director #828; no TC3-specific -// quantifier carrier, producer identity enum, or Verification-local report shape per audit §1 -// bullets 4–5. - -module std.tc3_strong_normalization_strict_fire - -import std.dimensions { DimensionReport } -import std.substrate { Dag } -import std.verification { BinaryDimensionReportEquals, TestClaim, TestSuite } - -// Role types: producers resolve these to evaluation-step (baseline) and bounded-step / -// termination-evidence projections. Same carrier `C = Dag` per audit §Contract bullet 2. -type tc3_evaluation_step_baseline_dimension_report = DimensionReport -type tc3_evaluation_step_compare_dimension_report = DimensionReport - -// §1.8 gate #13 canonical TestClaim name. -data tc3_pattern_a_second_mover_executable_claim: TestClaim = { - name: "tc3_pattern_a_second_mover_executable", - source: "// TC3 strict-fire - strong-normalization scaffold over typed `.dag` programs.\n// Vacuity guard: evaluation has nontrivial step structure (function application\n// + arithmetic) so baseline eval-step and termination-evidence projections do\n// not collapse to a single trivial trace before producers land.\nmodule user.tc3_strong_normalization_executable\n\nfn succ(n: Int) -> Int = n + 1\n\nlet _: Int = succ(succ(0))\n", - file_name: "tc3_strong_normalization_executable.v3", - predicate: BinaryDimensionReportEquals( - tc3_evaluation_step_baseline_dimension_report, - tc3_evaluation_step_compare_dimension_report - ), - requires: [] -} - -data tc3_strong_normalization_strict_fire_suite: TestSuite = { - name: "tc3_strong_normalization_strict_fire_suite", - claims: [Enumerated(tc3_pattern_a_second_mover_executable_claim)] -} diff --git a/src/v3/compiler/tests/four_fixture_pressure/drop.v3 b/src/v3/compiler/tests/four_fixture_pressure/drop.v3 deleted file mode 100644 index b4b1a8525b5..00000000000 --- a/src/v3/compiler/tests/four_fixture_pressure/drop.v3 +++ /dev/null @@ -1,9 +0,0 @@ -// §3.3 — `drop`. Parameter is NOT reachable from the return. -// -// Expected disposition (post-Track-1-Phase-2): Borrowed. -// Reachability fact today: UnusedParametersLens reports the -// parameter as UNUSED (the body is the literal `0`). -// -// Abstraction boundary probed: "parameter not reachable from return". -fn drop(x: Int) -> Int = 0 -let sample: Int = drop(1) diff --git a/src/v3/compiler/tests/four_fixture_pressure/id.v3 b/src/v3/compiler/tests/four_fixture_pressure/id.v3 deleted file mode 100644 index ae3bd2652be..00000000000 --- a/src/v3/compiler/tests/four_fixture_pressure/id.v3 +++ /dev/null @@ -1,9 +0,0 @@ -// §3.3 — `id`. Parameter reaches the return directly. -// -// Expected disposition (post-Track-1-Phase-2): Consumed. -// Reachability fact today: UnusedParametersLens reports the -// parameter as USED (the body `x` is the bind result). -// -// Abstraction boundary probed: "reach return, no construct". -fn id(x: Int) -> Int = x -let sample: Int = id(1) diff --git a/src/v3/compiler/tests/four_fixture_pressure/is_empty.v3 b/src/v3/compiler/tests/four_fixture_pressure/is_empty.v3 deleted file mode 100644 index d2006d90bc4..00000000000 --- a/src/v3/compiler/tests/four_fixture_pressure/is_empty.v3 +++ /dev/null @@ -1,31 +0,0 @@ -// §3.3 — `is_empty`. Parameter flows through match (read), -// not to the return. -// -// Expected disposition (post-Track-1-Phase-2): Borrowed. -// Reachability fact today: UnusedParametersLens reports the -// parameter as USED (the body matches on it), but the return -// value is independent of `b`'s payload. -// -// Abstraction boundary probed: "no reach from return, match-read -// only". -// -// Shape note: §3.3 writes this against `List` with -// `Empty | Cons(p)`. Two adaptations needed for today's lowering: -// -// 1. The match-on-List core-type lowering is not yet wired -// (the shape lands with a later slice of substrate work), so -// the fixture substitutes an equivalent user sum — same -// abstraction (match-read-only, param inspected not -// forwarded). -// 2. The names `is_empty` and `Empty` both appear in -// `src/v3/std/list.dag`; using them at fixture top-level -// would collide with the stdlib. The fixture renames to -// `is_empty_fx` / `Nil` so the collision doesn't shadow -// what the test is actually probing. -// -// When the List match lowering lands and name-scoping allows -// shadowing the stdlib names, the canonical §3.3 form can be -// swapped in without the test interface changing. -type BoxedFx = BoxedV(Int) | Nil -fn is_empty_fx(b: BoxedFx) -> Bool = match b { BoxedV(v) => false, Nil => true } -let sample: Bool = is_empty_fx(Nil) diff --git a/src/v3/compiler/tests/four_fixture_pressure/wrap.v3 b/src/v3/compiler/tests/four_fixture_pressure/wrap.v3 deleted file mode 100644 index cfbc4c98571..00000000000 --- a/src/v3/compiler/tests/four_fixture_pressure/wrap.v3 +++ /dev/null @@ -1,12 +0,0 @@ -// §3.3 — `wrap`. Parameter reaches the return via record -// construction (embedded in a Conj value). -// -// Expected disposition (post-Track-1-Phase-2): Consumed. -// Reachability fact today: UnusedParametersLens reports the -// parameter as USED (the body's `{ value: x }` record captures it). -// -// Abstraction boundary probed: "reach return through construct". -type Box { value: Int } -fn wrap(x: Int) -> Box = { value: x } -let boxed: Box = wrap(1) -let sample: Int = boxed.value diff --git a/src/v3/compiler/tests/integration.rs b/src/v3/compiler/tests/integration.rs deleted file mode 100644 index 6c283e1756e..00000000000 --- a/src/v3/compiler/tests/integration.rs +++ /dev/null @@ -1,1295 +0,0 @@ -//! Consolidated v3-compiler integration test binary. -//! -//! **Why one binary.** Rust integration tests default to one binary per -//! `tests/*.rs` file. Each binary pays a separate bootstrap + compile cost -//! on cold runners (bootstrap alone is ~200ms; the in-memory -//! `cached_compile_to_dag` helper only amortizes within-binary). Hoisting -//! every test file into this single module tree means: -//! -//! - **One bootstrap per cargo test run** — shared across every test. -//! - **Cross-test cache hits** — two tests that pass identical `(source, -//! file)` arguments to `cached_compile_to_dag` now share the compile -//! result. Different file markers produce distinct cache keys by design -//! (the cache identity is the exact compile invocation). -//! - **One compile, link, and load cycle** — no 25× rustc invocations for -//! test-binary production. -//! -//! **Module discipline.** Each file under `tests/integration/*.rs`, -//! `tests/integration/cementing/*.rs`, `tests/boundary/*.rs`, or -//! `tests/unit/*.rs` is a sibling module at this crate root, reached via -//! `#[path]` because Rust's default module resolution for a crate-root file -//! looks in the containing directory (`tests/`) rather than a same-named -//! subdirectory. Shared helpers live under `tests/integration/common/`. -//! Inside a test module, `use crate::common::…` reaches those helpers; there -//! is no per-file `mod common;` declaration. -//! -//! **Layer taxonomy (TESTING.md § test layers).** Files are partitioned -//! by directory: -//! - `tests/unit/` — lenses, accessors, single-pass behaviors (<5ms) -//! - `tests/integration/` — multi-stage pipeline, fixed-point convergence (<100ms) -//! - `tests/boundary/` — rustc/go/python roundtrips, emitted-module behavior (<2s) -//! -//! Each moved test file carries a `//! **Layer:** ` -//! header so `grep -rn '\*\*Layer:\*\*'` reports the current partition. -//! The taxonomy is the directory; the header is a human-readable echo. - -#[macro_use] -#[path = "integration/common/mod.rs"] -mod common; - -#[path = "integration/anthropic_messages_callable_test.rs"] -mod anthropic_messages_callable_test; -#[path = "integration/anthropic_messages_wire_demo_test.rs"] -mod anthropic_messages_wire_demo_test; -#[path = "integration/anthropic_operations_test.rs"] -mod anthropic_operations_test; -#[path = "integration/anthropic_schema_lockstep_test.rs"] -mod anthropic_schema_lockstep_test; -#[path = "integration/anthropic_tool_result_wire_demo_test.rs"] -mod anthropic_tool_result_wire_demo_test; -#[path = "integration/bridge_ledger_carrier_test.rs"] -mod bridge_ledger_carrier_test; -#[path = "integration/bridge_lower_helpers_patch_zero_residual_test.rs"] -mod bridge_lower_helpers_patch_zero_residual_test; -#[path = "integration/canonical_lens_bridge_ratchet_test.rs"] -mod canonical_lens_bridge_ratchet_test; -#[path = "integration/cementing/cementing_provenance_origin_integration_test.rs"] -mod cementing_provenance_origin_integration_test; -#[path = "integration/cementing/complexity_lens_behavioral_completion.rs"] -mod complexity_lens_behavioral_completion; -#[path = "integration/cementing/cost_lens_symbolic_consumer_test.rs"] -mod cost_lens_symbolic_consumer_test; -#[path = "integration/coverage_defect_acceptance_dag_test.rs"] -mod coverage_defect_acceptance_dag_test; -#[path = "integration/cross_target_coverage_carrier_test.rs"] -mod cross_target_coverage_carrier_test; -#[path = "integration/dissolution_subsumption_carrier_test.rs"] -mod dissolution_subsumption_carrier_test; -#[path = "integration/e6_g1a_option3_static_lens_test.rs"] -mod e6_g1a_option3_static_lens_test; -#[path = "integration/e_i_lane_induction_preflight_test.rs"] -mod e_i_lane_induction_preflight_test; -#[path = "integration/cementing/e_p_per_call_descent_lens_consumer_cementing.rs"] -mod e_p_per_call_descent_lens_consumer_cementing; -#[path = "integration/cementing/effect_enumeration_lens_behavioral_completion.rs"] -mod effect_enumeration_lens_behavioral_completion; -#[path = "integration/emission_provenance_lens_test.rs"] -mod emission_provenance_lens_test; -#[path = "integration/emit_verification_gates_test.rs"] -mod emit_verification_gates_test; -#[path = "integration/extdeps_rust_primitives_loader_test.rs"] -mod extdeps_rust_primitives_loader_test; -#[path = "integration/extdeps_sql_transport_test.rs"] -mod extdeps_sql_transport_test; -#[path = "integration/file_attachment_substrate_carrier_test.rs"] -mod file_attachment_substrate_carrier_test; -#[path = "integration/four_fixture_regression_test.rs"] -mod four_fixture_regression_test; -#[path = "integration/get_off_v3_compile_to_dag_census_test.rs"] -mod get_off_v3_compile_to_dag_census_test; -#[path = "integration/idempotency_lens_instance_blocker_test.rs"] -mod idempotency_lens_instance_blocker_test; -#[path = "integration/int_literal_cardinality_test.rs"] -mod int_literal_cardinality_test; -#[path = "integration/l1_5_fixed_point_test.rs"] -mod l1_5_fixed_point_test; -#[path = "boundary/l5_cross_target_consistency.rs"] -mod l5_cross_target_consistency; -#[path = "integration/lane2_stage_2a_effects_smoke.rs"] -mod lane2_stage_2a_effects_smoke; -#[path = "integration/lane2_stage_2b_db18_test.rs"] -mod lane2_stage_2b_db18_test; -#[path = "integration/lane2_stage_2c_db15_test.rs"] -mod lane2_stage_2c_db15_test; -#[path = "integration/lane2_stage_2d_symbolic_cost_test.rs"] -mod lane2_stage_2d_symbolic_cost_test; -#[path = "integration/lane2_stage_2e_parallelism_test.rs"] -mod lane2_stage_2e_parallelism_test; -#[path = "integration/lane3_stage_3b_db1_test.rs"] -mod lane3_stage_3b_db1_test; -#[path = "integration/lens_application_substrate_carrier_test.rs"] -mod lens_application_substrate_carrier_test; -#[path = "integration/lens_behavioral_parity_demonstration_test.rs"] -mod lens_behavioral_parity_demonstration_test; -#[path = "integration/lens_cost_target_realization_test.rs"] -mod lens_cost_target_realization_test; -#[path = "integration/lens_register_correspondence_test.rs"] -mod lens_register_correspondence_test; -#[path = "integration/lens_substrate_carrier_test.rs"] -mod lens_substrate_carrier_test; -#[path = "integration/m0_acceptance.rs"] -mod m0_acceptance; -#[path = "boundary/m1_3_emit_go_test.rs"] -mod m1_3_emit_go_test; -#[path = "boundary/m1_3_emit_rust_test.rs"] -mod m1_3_emit_rust_test; -#[path = "integration/m1_3_lens_cost_test.rs"] -mod m1_3_lens_cost_test; -#[path = "integration/m1_3_lens_unused_parameters_test.rs"] -mod m1_3_lens_unused_parameters_test; -#[path = "boundary/m1_4_emit_python_test.rs"] -mod m1_4_emit_python_test; -#[path = "boundary/m1_5_emit_omni_demo_test.rs"] -mod m1_5_emit_omni_demo_test; -#[path = "integration/m1_5_omni_shape_b_openapi_test.rs"] -mod m1_5_omni_shape_b_openapi_test; -#[path = "integration/m1_5_testgen_test.rs"] -mod m1_5_testgen_test; -#[path = "integration/m1_5_user_authored_lens_gate_test.rs"] -mod m1_5_user_authored_lens_gate_test; -#[path = "integration/m1_5_verification_test.rs"] -mod m1_5_verification_test; -#[path = "integration/m1_fn_external_body_reconciliation_test.rs"] -mod m1_fn_external_body_reconciliation_test; -#[path = "integration/m1_lens_structural_resolution_test.rs"] -mod m1_lens_structural_resolution_test; -#[path = "integration/m1_substrate_test.rs"] -mod m1_substrate_test; -#[path = "integration/m2_feature_parity_test.rs"] -mod m2_feature_parity_test; -#[path = "integration/m2_field_access_binding_test.rs"] -mod m2_field_access_binding_test; -#[path = "integration/m2_lens_cost_migration_test.rs"] -mod m2_lens_cost_migration_test; -#[path = "integration/m2_lens_idempotency_emit_test.rs"] -mod m2_lens_idempotency_emit_test; -#[path = "integration/m2_lens_idempotency_migration_test.rs"] -mod m2_lens_idempotency_migration_test; -#[path = "integration/m2_lens_provenance_migration_test.rs"] -mod m2_lens_provenance_migration_test; -#[path = "integration/m2_lens_structural_resolution_migration_test.rs"] -mod m2_lens_structural_resolution_migration_test; -#[path = "integration/m2_lens_unused_parameters_migration_test.rs"] -mod m2_lens_unused_parameters_migration_test; -#[path = "integration/m2_lens_variant_payload_migration_test.rs"] -mod m2_lens_variant_payload_migration_test; -#[path = "integration/m2_substrate_inhabitance_test.rs"] -mod m2_substrate_inhabitance_test; -#[path = "integration/cementing/memory_peak_cost_basis_demo.rs"] -mod memory_peak_cost_basis_demo; -#[path = "integration/method_registry_test.rs"] -mod method_registry_test; -#[path = "integration/method_template_contract_test.rs"] -mod method_template_contract_test; -#[path = "integration/method_template_projection_emit_shim_coherence_test.rs"] -mod method_template_projection_emit_shim_coherence_test; -#[path = "integration/no_coercion_cost_dimension_ratchet_test.rs"] -mod no_coercion_cost_dimension_ratchet_test; -#[path = "integration/pb1_bootstrap_full_snapshot_test.rs"] -mod pb1_bootstrap_full_snapshot_test; -#[path = "integration/pb_method_template_projection_test.rs"] -mod pb_method_template_projection_test; -#[path = "integration/pipe_desugar.rs"] -mod pipe_desugar; -#[path = "integration/positional_conj_fold_list_emit_path_test.rs"] -mod positional_conj_fold_list_emit_path_test; -#[path = "integration/prereq_x_call_on_field_access_ratchet_test.rs"] -mod prereq_x_call_on_field_access_ratchet_test; -#[path = "integration/r1_release_acceptance_test.rs"] -mod r1_release_acceptance_test; -#[path = "integration/r2_b5_loop_construction_closure_test.rs"] -mod r2_b5_loop_construction_closure_test; -#[path = "integration/r3_class_2_function_valued_data_test.rs"] -mod r3_class_2_function_valued_data_test; -#[path = "integration/r3_free_consequences_first_batch_test.rs"] -mod r3_free_consequences_first_batch_test; -#[path = "integration/r3_free_consequences_second_batch_test.rs"] -mod r3_free_consequences_second_batch_test; -#[path = "integration/r3_gate_60_phase2_width_nat_parser_test.rs"] -mod r3_gate_60_phase2_width_nat_parser_test; -#[path = "integration/r3_gate_62_file_ingestion_negative_bridge_audit_test.rs"] -mod r3_gate_62_file_ingestion_negative_bridge_audit_test; -#[path = "integration/r3_gate_87_lens_cementing_regen_receipts_test.rs"] -mod r3_gate_87_lens_cementing_regen_receipts_test; -#[path = "integration/r3_gate_90_lens_enforcement_carrier_landed_test.rs"] -mod r3_gate_90_lens_enforcement_carrier_landed_test; -#[path = "integration/r3_lens_producer_retirement_executable_witness_test.rs"] -mod r3_lens_producer_retirement_executable_witness_test; -#[path = "integration/r3_path_b_brief3_char_in_class_execution_test.rs"] -mod r3_path_b_brief3_char_in_class_execution_test; -#[path = "integration/r3_pb_runtime_evaluator_corpus_seed_test.rs"] -mod r3_pb_runtime_evaluator_corpus_seed_test; -#[path = "integration/r3_self_gen_non_test_zero_test.rs"] -mod r3_self_gen_non_test_zero_test; -#[path = "integration/r3_substrate_gap_reflection_closure_test.rs"] -mod r3_substrate_gap_reflection_closure_test; -#[path = "integration/r3_v3_self_host_demonstration_dag_test.rs"] -mod r3_v3_self_host_demonstration_dag_test; -#[path = "integration/r3_verification_l4_l7_l5_skeleton_test.rs"] -mod r3_verification_l4_l7_l5_skeleton_test; -#[path = "integration/self_gen0_census_test.rs"] -mod self_gen0_census_test; -#[path = "integration/self_gen1_tokenize_authority_test.rs"] -mod self_gen1_tokenize_authority_test; -#[path = "integration/self_gen2_parse_authority_test.rs"] -mod self_gen2_parse_authority_test; -#[path = "integration/self_gen2c1_parse_tables_authority_test.rs"] -mod self_gen2c1_parse_tables_authority_test; -#[path = "integration/self_gen2c5_soft_keyword_ident_test.rs"] -mod self_gen2c5_soft_keyword_ident_test; -#[path = "integration/self_gen3_lower_parse_surface_stack_test.rs"] -mod self_gen3_lower_parse_surface_stack_test; -#[path = "integration/self_gen3_surface_reflection_consumer_test.rs"] -mod self_gen3_surface_reflection_consumer_test; -#[path = "integration/self_gen6_hand_authored_census_test.rs"] -mod self_gen6_hand_authored_census_test; -#[path = "integration/self_gen7_prep_variant_payload_freshness_test.rs"] -mod self_gen7_prep_variant_payload_freshness_test; -#[path = "integration/shape_a_target_source_filtering_authority_test.rs"] -mod shape_a_target_source_filtering_authority_test; -#[path = "integration/symbolic_cost_expr_equals_executable_ratchet_test.rs"] -mod symbolic_cost_expr_equals_executable_ratchet_test; -#[path = "integration/t_gate_106_show_correct_code_diagnostic_coverage_test.rs"] -mod t_gate_106_show_correct_code_diagnostic_coverage_test; -#[path = "integration/t_gate_58_apply_lens_self_application_test.rs"] -mod t_gate_58_apply_lens_self_application_test; -#[path = "integration/t_impossiblebugs_unenumerated_effects_test.rs"] -mod t_impossiblebugs_unenumerated_effects_test; -#[path = "integration/t_las_complexity_contract_compile_error_test.rs"] -mod t_las_complexity_contract_compile_error_test; -#[path = "integration/t_las_crdt_cost_basis_demo_test.rs"] -mod t_las_crdt_cost_basis_demo_test; -#[path = "integration/t_las_parallelism_iteration_gate95_demo_test.rs"] -mod t_las_parallelism_iteration_gate95_demo_test; -#[path = "integration/t_lens_application_carrier_test.rs"] -mod t_lens_application_carrier_test; -#[path = "integration/t_pb_b_1_dag_runner_test.rs"] -mod t_pb_b_1_dag_runner_test; -#[path = "integration/tc1_substrate_lens_eta_equivalence_deferred_test.rs"] -mod tc1_substrate_lens_eta_equivalence_deferred_test; -#[path = "integration/tc1_substrate_lens_eta_equivalence_strict_fire_test.rs"] -mod tc1_substrate_lens_eta_equivalence_strict_fire_test; -#[path = "integration/tc2_church_rosser_strict_fire_test.rs"] -mod tc2_church_rosser_strict_fire_test; -#[path = "integration/tc3_strong_normalization_deferred_test.rs"] -mod tc3_strong_normalization_deferred_test; -#[path = "integration/tc3_strong_normalization_strict_fire_test.rs"] -mod tc3_strong_normalization_strict_fire_test; -#[path = "integration/test_runner_test.rs"] -mod test_runner_test; -#[path = "integration/thesis_parallelism_test.rs"] -mod thesis_parallelism_test; -#[path = "integration/thesis_validation_test.rs"] -mod thesis_validation_test; -#[path = "integration/timing_lens_substrate_carrier_test.rs"] -mod timing_lens_substrate_carrier_test; -#[path = "integration/v2_oracle_no_remaining_test_consumers_test.rs"] -mod v2_oracle_no_remaining_test_consumers_test; -#[path = "integration/v4_emit_host_eval_dispatch_test.rs"] -mod v4_emit_host_eval_dispatch_test; -#[path = "integration/v4_emit_host_harness_test.rs"] -mod v4_emit_host_harness_test; -#[path = "boundary/v4_leaf_model_go_r1_r2_r3_external_test.rs"] -mod v4_leaf_model_go_r1_r2_r3_external_test; -#[path = "boundary/v4_leaf_model_python_cross_runtime_drift_test.rs"] -mod v4_leaf_model_python_cross_runtime_drift_test; -#[path = "boundary/v4_leaf_model_python_l1_static_receipts_test.rs"] -mod v4_leaf_model_python_l1_static_receipts_test; -#[path = "boundary/v4_leaf_model_python_l2_cross_target_parity_test.rs"] -mod v4_leaf_model_python_l2_cross_target_parity_test; -#[path = "boundary/v4_leaf_model_python_r1_test.rs"] -mod v4_leaf_model_python_r1_test; -#[path = "boundary/v4_leaf_model_python_r2_r3_external_test.rs"] -mod v4_leaf_model_python_r2_r3_external_test; -#[path = "boundary/v4_leaf_model_rust_r1_rustc_test.rs"] -mod v4_leaf_model_rust_r1_rustc_test; -#[path = "boundary/v4_leaf_model_rust_r2_r3_external_rustc_test.rs"] -mod v4_leaf_model_rust_r2_r3_external_rustc_test; -#[path = "boundary/v4_leaf_model_rust_r3_internal_emit_coupling_test.rs"] -mod v4_leaf_model_rust_r3_internal_emit_coupling_test; -#[path = "boundary/v4_leaf_model_typescript_r2_r3_external_test.rs"] -mod v4_leaf_model_typescript_r2_r3_external_test; -#[path = "integration/v4_p9_llvm_instruction_cost_single_owner_test.rs"] -mod v4_p9_llvm_instruction_cost_single_owner_test; -#[path = "integration/v4_std_text_boundary_carrier_guard_test.rs"] -mod v4_std_text_boundary_carrier_guard_test; -#[path = "integration/v4_t15_self_host_fixed_point_harness_test.rs"] -mod v4_t15_self_host_fixed_point_harness_test; -#[path = "integration/v4_test_bootstrap_infra_closeout_test.rs"] -mod v4_test_bootstrap_infra_closeout_test; -#[path = "integration/value_body_substrate_mirror_isomorphism_test.rs"] -mod value_body_substrate_mirror_isomorphism_test; -#[path = "integration/common/wiring_scanner_test.rs"] -mod wiring_scanner_test; -#[path = "integration/workflow_root_port_test.rs"] -mod workflow_root_port_test; -#[path = "integration/workflow_substrate_carriers_test.rs"] -mod workflow_substrate_carriers_test; - -mod t_demo_fixture_test { - //! **Layer:** integration - - use std::fs; - use std::path::PathBuf; - use std::sync::OnceLock; - - use crate::common::{cached_compile_outcome, cached_compile_to_dag, CachedCompileOutcome}; - use v3_compiler::dag::Dag; - use v3_compiler::test_runner::{ClaimResult, TestRunner}; - - const FIXTURE: &str = "src/v3/compiler/tests/t_demo/t_demo_fixtures.dag"; - - static T_DEMO_FIXTURE_DAG: OnceLock = OnceLock::new(); - - /// Byte-sync with `t_demo_structural_cost_obligation_gate.source` in `t_demo_fixtures.dag`. - const T_DEMO_STRUCTURAL_COST_OBLIGATION_CLAIM_SOURCE: &str = "fn pair_score(xs: List) -> Int = fold(xs, 0, |outer, x| outer + fold(xs, 0, |inner, y| inner + x + y))\nlet complexity_demo_out: Int = pair_score(cons(1, singleton(2)))\n"; - - fn fixture_source() -> String { - let path = PathBuf::from(env!("CARGO_MANIFEST_DIR")) - .join("../../..") - .join(FIXTURE); - fs::read_to_string(path).expect("read T-Demo fixture skeleton") - } - - fn compile_fixture(source: &str) -> Dag { - cached_compile_to_dag(source, FIXTURE) - } - - fn cached_t_demo_fixture_dag() -> &'static Dag { - T_DEMO_FIXTURE_DAG.get_or_init(|| { - let src = fixture_source(); - std::thread::Builder::new() - .name("t-demo-fixture-dag".to_string()) - .stack_size(64 * 1024 * 1024) - .spawn(move || compile_fixture(&src)) - .expect("spawn T-Demo fixture compile thread") - .join() - .expect("T-Demo fixture compile thread should not panic") - }) - } - - /// Smoke: the checked-in T-Demo `.dag` fixture lowers with empty module diagnostics. Uses - /// `cached_t_demo_fixture_dag` so the compile is amortized with sibling tests (TESTING.md - /// `OnceLock` carve-out); the first caller pays `OnceLock::get_or_init`; libtest order is not - /// part of the contract. - #[test] - fn t_demo_fixture_skeleton_compiles() { - let dag = cached_t_demo_fixture_dag(); - assert!( - dag.diagnostics().is_empty(), - "T-Demo fixture skeleton should compile without diagnostics: {:?}", - dag.diagnostics() - ); - } - - #[test] - fn t_demo_canonical_suites_are_runner_visible() { - let dag = cached_t_demo_fixture_dag(); - - for suite_name in [ - "fixture_compiler_nerd_canonical", - "fixture_integration_canonical", - ] { - let results = TestRunner::new(dag).run_suite(suite_name); - assert!( - !results.is_empty(), - "T-Demo suite `{suite_name}` should contain Day-1 Compiles claims" - ); - assert!( - results - .iter() - .all(|result| result.result == ClaimResult::Pass), - "T-Demo suite `{suite_name}` should pass Day-1 Compiles claims, got {results:?}" - ); - } - } - - /// ROADMAP T-Demo / PR #764: this must pin the **sum-constructor** mismatch - /// (`AppendEffect()` is not an `IdempotentShape` case) by requiring diagnostics for both - /// endpoints, not a generic `compose_effects` argument refinement message that omits either - /// `AppendEffect` or `IsIdempotent`. - #[test] - fn impossible_bug_idempotency_violation_emits_named_constructor_resolve_error() { - let src = "let bad_shape = IsIdempotent(AppendEffect())\n"; - let CachedCompileOutcome::Semantic(dag) = - cached_compile_outcome(src, "impossible_bug_idempotency.v3") - else { - panic!("idempotency-violation witness should not compile"); - }; - let msgs: Vec = dag.diagnostics().iter().map(|(_, d)| d.message()).collect(); - let append_needle = "AppendEffect"; - let idempotent_needle = "IsIdempotent"; - assert!( - msgs.iter().any(|m| m.contains(append_needle)) - && msgs.iter().any(|m| m.contains(idempotent_needle)), - "expected nullary-call lowering to reject AppendEffect as IsIdempotent payload; got: {msgs:?}" - ); - } - - #[test] - fn t_demo_impossible_bug_suite_r1_passes() { - let dag = cached_t_demo_fixture_dag(); - let results = TestRunner::new(dag).run_suite("impossible_bug_class_suite_r1"); - assert_eq!(results.len(), 3); - assert!( - results - .iter() - .all(|result| result.result == ClaimResult::Pass), - "impossible-bug suite claims should all Pass (FailsWithDiagnostic receipts only), got {results:?}" - ); - } - - /// R1C-F T-Demo gate: a user-authored lens (`lenses.named_function_count`, the same - /// GREEN T-LensAPI lens) detects 3 named bindings in the violating program; the - /// `LensOutputEquals` predicate matches and the gate Passes — proving the proof - /// surface is user-extensible (THESIS §"User-defined dimensions"). - #[test] - fn t_demo_user_authored_lens_rejects_violating_program_passes() { - let dag = cached_t_demo_fixture_dag(); - let results = TestRunner::new(dag) - .run_suite("demo_user_authored_lens_rejects_violating_program_suite"); - assert_eq!(results.len(), 1); - assert!( - matches!(results[0].result, ClaimResult::Pass), - "user-authored lens demo gate should Pass (lens detected violations and matched expected count), got {:?}", - results[0].result - ); - } - - #[test] - fn t_demo_structural_cost_obligation_witness_compiles_cleanly() { - cached_compile_to_dag( - T_DEMO_STRUCTURAL_COST_OBLIGATION_CLAIM_SOURCE, - "t_demo_structural_cost_obligation.v3", - ); - } - - #[test] - fn t_demo_structural_cost_obligation_suite_observes_cost_bound_fail() { - let dag = cached_t_demo_fixture_dag(); - let results = TestRunner::new(dag).run_suite("t_demo_structural_cost_obligation_suite"); - assert_eq!(results.len(), 1); - let ClaimResult::Fail(msg) = &results[0].result else { - panic!( - "structural cost obligation gate should Fail CostBounded (cost exceeds bound), got {:?}", - results[0].result - ); - }; - assert!( - msg.starts_with("cost ") && msg.contains("did not satisfy bound"), - "unexpected CostBounded failure message (expected structural bound receipt, not compile skip): {msg}" - ); - } -} - -mod lane2_stage_2f_dimension_test { - use crate::common::cached_compile_to_dag; - use v3_compiler::analyze_symbolic_cost_dimension; - use v3_compiler::dag::{Behavior, Dag, DeclarationId, PortId, TypeConnective}; - use v3_compiler::lens_cost_symbolic::{symbolic_cost_lookup, SymbolicCostLookup}; - use v3_compiler::DimensionReport; - - fn find_bind_port(dag: &Dag, name: &str) -> PortId { - dag.nodes() - .iter() - .filter_map(Behavior::as_bind) - .find(|bind| bind.name == name) - .unwrap_or_else(|| panic!("bind `{name}` not found")) - .value - } - - fn find_bind_root(dag: &Dag, name: &str) -> v3_compiler::dag::NodeId { - dag.nodes() - .iter() - .find(|behavior| { - behavior - .as_bind() - .map(|bind| bind.name == name) - .unwrap_or(false) - }) - .map(|behavior| behavior.id()) - .unwrap_or_else(|| panic!("bind `{name}` not found")) - } - - #[test] - fn no_authored_analysis_dimension_carrier_constants_in_bootstrap_stdlib() { - let dag = Dag::new(); - let dimension_template = dag - .declaration_by_name("AnalysisDimension") - .expect("bootstrap loads AnalysisDimension") - .id; - let count = dag - .declarations() - .iter() - .filter(|decl| { - decl.value_body.is_some() - && matches!( - &decl.connective, - TypeConnective::Instantiation { template, .. } - if *template == dimension_template - ) - }) - .count(); - assert_eq!( - count, 0, - "no `data _: AnalysisDimension<_> = ...` values ship until class-5 bodies unlock the receipt" - ); - } - - fn named_decl(dag: &Dag, name: &str) -> DeclarationId { - dag.declaration_by_name(name) - .unwrap_or_else(|| panic!("bootstrap loads {name}")) - .id - } - - fn instantiation_parts(dag: &Dag, id: DeclarationId) -> (DeclarationId, Vec) { - match &dag.declaration(id).connective { - TypeConnective::Instantiation { - template, - arguments, - } => (*template, arguments.iter().map(|arg| arg.value).collect()), - other => panic!("expected instantiation for {id:?}, got {other:?}"), - } - } - - #[test] - fn dimension_value_wrapper_carries_unit_phantom_axis() { - let dag = Dag::new(); - let dimension = dag - .declaration_by_name("Dimension") - .expect("bootstrap loads Dimension"); - assert_eq!(dimension.type_params.len(), 2); - assert_eq!(dimension.phantom_params.len(), 1); - assert_eq!( - dimension.phantom_params[0].parameter, - dimension.type_params[0] - ); - - let abelian_group = named_decl(&dag, "AbelianGroup"); - let (algebra_template, algebra_args) = - instantiation_parts(&dag, dimension.phantom_params[0].algebra); - assert_eq!(algebra_template, abelian_group); - assert_eq!(algebra_args, vec![dimension.type_params[0]]); - - for unit in [ - "Meters", - "Seconds", - "Kilograms", - "Amperes", - "Kelvin", - "Moles", - "Candela", - ] { - named_decl(&dag, unit); - } - - for function in [ - "add_dimension", - "sub_dimension", - "mul_dimension_scalar", - "div_dimension_scalar", - ] { - let decl = dag.declaration(named_decl(&dag, function)); - assert!( - matches!(decl.connective, TypeConnective::Arrow { .. }), - "{function} should be present in bootstrap as a callable arrow" - ); - } - } - - #[test] - fn analyze_symbolic_cost_composed_matches_lens_at_workflow_root() { - let dag = cached_compile_to_dag("let x = 1 + 2", "lane2_2f_dim.v3"); - let root = find_bind_root(&dag, "x"); - let report = analyze_symbolic_cost_dimension(&dag, root); - let lens = match symbolic_cost_lookup(&dag, &find_bind_port(&dag, "x")) { - SymbolicCostLookup::Hit(cost) => cost, - SymbolicCostLookup::Miss => panic!("expected Hit"), - }; - let DimensionReport::DimensionOk { - composed, - dimension_name, - witnesses, - } = report - else { - panic!("expected DimensionOk for well-typed program, got {report:?}"); - }; - assert_eq!(composed, lens); - assert_eq!(dimension_name, "symbolic_cost"); - assert!( - witnesses.len() < dag.nodes().len(), - "dimension witnesses should be workflow-scoped, not materialized for every bootstrap behavior" - ); - } - - #[test] - fn dimension_report_carrier_is_pass_fail_sum_in_bootstrap() { - let dag = Dag::new(); - let decl = dag - .declaration_by_name("DimensionReport") - .expect("bootstrap loads DimensionReport"); - let TypeConnective::Disj { variants } = &decl.connective else { - panic!( - "DimensionReport must be a pass/fail sum (Disj), got {:?}", - decl.connective - ); - }; - let labels: Vec<_> = variants.iter().map(|v| v.label.as_str()).collect(); - assert_eq!( - labels, - vec!["DimensionOk", "DimensionFail"], - "expected DimensionOk | DimensionFail variants" - ); - let ok_payload = dag.declaration(variants[0].ty); - let TypeConnective::Conj { children } = &ok_payload.connective else { - panic!("DimensionOk payload should be a record"); - }; - let ok_fields: Vec<_> = children.iter().map(|c| c.label.as_str()).collect(); - assert_eq!( - ok_fields, - vec!["dimension_name", "composed", "witnesses"], - "DimensionOk should carry composed only on the pass arm" - ); - let fail_payload = dag.declaration(variants[1].ty); - let TypeConnective::Conj { - children: fail_children, - } = &fail_payload.connective - else { - panic!("DimensionFail payload should be a record"); - }; - let fail_fields: Vec<_> = fail_children.iter().map(|c| c.label.as_str()).collect(); - assert_eq!( - fail_fields, - vec!["dimension_name", "violations", "witnesses"], - "DimensionFail must not admit composed; violations carry proof failure" - ); - } -} - -/// PR-E E7 symbolic-cost-only — public-API integration coverage. -/// -/// `analyze_complexity` is the named E7 entrypoint authorized by #1471 -/// and landed in #1484. These tests pin that the **public crate API** -/// (`v3_compiler::analyze_complexity`) is reachable from outside the -/// `dimension` module, delegates to the existing symbolic-cost -/// analyzer, and preserves the typed `DimensionReport` / -/// `Diagnostic` partition without parsing `Witness::Violates.reason`. -mod e7_analyze_complexity_integration { - use crate::common::cached_compile_to_dag; - use v3_compiler::dag::Behavior; - use v3_compiler::lens_cost_symbolic::{symbolic_cost_lookup, SymbolicCostLookup}; - use v3_compiler::{analyze_complexity, analyze_symbolic_cost_dimension, DimensionReport}; - - fn find_bind_root(dag: &v3_compiler::dag::Dag, name: &str) -> v3_compiler::dag::NodeId { - dag.nodes() - .iter() - .find(|behavior| { - behavior - .as_bind() - .map(|bind| bind.name == name) - .unwrap_or(false) - }) - .map(|behavior| behavior.id()) - .unwrap_or_else(|| panic!("bind `{name}` not found")) - } - - fn find_bind_port(dag: &v3_compiler::dag::Dag, name: &str) -> v3_compiler::dag::PortId { - dag.nodes() - .iter() - .filter_map(Behavior::as_bind) - .find(|bind| bind.name == name) - .unwrap_or_else(|| panic!("bind `{name}` not found")) - .value - } - - /// E7 §test 1 (integration form): the public `analyze_complexity` - /// API delegates to the live `analyze_symbolic_cost_dimension` — - /// pinned by structural equality of the resulting `DimensionOk` - /// fields. Single-authority via the public crate surface. - #[test] - fn analyze_complexity_public_api_delegates_to_symbolic_cost_dimension() { - let dag = cached_compile_to_dag("let y = 3 + 4", "e7_int_match.v3"); - let root = find_bind_root(&dag, "y"); - - let via_complexity = analyze_complexity(&dag, root); - let via_dimension = analyze_symbolic_cost_dimension(&dag, root); - - match (&via_complexity, &via_dimension) { - ( - DimensionReport::DimensionOk { - dimension_name: cn, - composed: cc, - witnesses: cw, - }, - DimensionReport::DimensionOk { - dimension_name: dn, - composed: dc, - witnesses: dw, - }, - ) => { - assert_eq!(cn, dn); - assert_eq!(cc, dc); - assert_eq!(cw.len(), dw.len()); - // Strengthen length-equality to per-witness content - // equality on the typed Inhabits arm (the only arm - // reachable on a well-typed program through the - // public surface). SymbolicCost derives PartialEq, so - // structural equality on the carrier is honest; - // Violates would need Behavior PartialEq which it - // does not derive — fail-arm equality stays in the - // in-module unit tests where ghost-port DAGs are - // constructible. - for (cw_i, dw_i) in cw.iter().zip(dw.iter()) { - match (cw_i, dw_i) { - ( - v3_compiler::Witness::Inhabits(cc), - v3_compiler::Witness::Inhabits(dc), - ) => assert_eq!(cc, dc), - ( - v3_compiler::Witness::Violates { .. }, - v3_compiler::Witness::Violates { .. }, - ) => { - panic!( - "well-typed program produced Violates witnesses on both arms; \ - the symbolic-cost analyzer should not emit Violates here, \ - so the test must be revisited (likely a regression)." - ); - } - other => panic!( - "wrapper and direct analyzer produced different witness arms: {other:?}" - ), - } - } - } - other => panic!( - "expected both DimensionOk with matching content via the public API, got {other:?}", - ), - } - } - - /// E7 §test 1 (root-arg observable): a two-bind program makes the - /// `workflow_root` argument structurally observable. The wrapper - /// must agree with `analyze_symbolic_cost_dimension` on the - /// non-default root specifically — a wrapper that ignored the - /// supplied root and always picked "the only bind" or "the first - /// bind" would diverge here on **witness-spine size**, since the - /// reachable-behaviors filter for the second bind covers strictly - /// more nodes than the first. - #[test] - fn analyze_complexity_public_api_honors_supplied_workflow_root() { - let dag = cached_compile_to_dag("let a = 1 + 2\nlet b = a + 3 + 4", "e7_int_two_binds.v3"); - - let root_a = find_bind_root(&dag, "a"); - let root_b = find_bind_root(&dag, "b"); - assert_ne!(root_a, root_b, "two-bind fixture must distinguish roots"); - - // For each root the public wrapper agrees with the underlying - // analyzer on the same root. - for selected_root in [root_a, root_b] { - let via_complexity = analyze_complexity(&dag, selected_root); - let via_dimension = analyze_symbolic_cost_dimension(&dag, selected_root); - - match (&via_complexity, &via_dimension) { - ( - DimensionReport::DimensionOk { - composed: cc, - witnesses: cw, - .. - }, - DimensionReport::DimensionOk { - composed: dc, - witnesses: dw, - .. - }, - ) => { - assert_eq!(cc, dc, "wrapper must honor selected root {selected_root:?}"); - assert_eq!( - cw.len(), - dw.len(), - "wrapper must produce the same witness-spine count for root {selected_root:?}", - ); - // Strengthen length-equality to per-witness - // content equality on the typed `Inhabits` arm. - // SymbolicCost has PartialEq; Behavior on the - // Violates arm does not, so fail-arm content - // equality stays in the in-module unit tests. - for (cw_i, dw_i) in cw.iter().zip(dw.iter()) { - match (cw_i, dw_i) { - ( - v3_compiler::Witness::Inhabits(cc), - v3_compiler::Witness::Inhabits(dc), - ) => assert_eq!( - cc, dc, - "wrapper must produce identical Inhabits content for root {selected_root:?}", - ), - ( - v3_compiler::Witness::Violates { .. }, - v3_compiler::Witness::Violates { .. }, - ) => panic!( - "well-typed two-bind fixture should not emit Violates witnesses; \ - likely regression for root {selected_root:?}", - ), - other => panic!( - "wrapper and direct analyzer produced different witness arms for \ - root {selected_root:?}: {other:?}", - ), - } - } - } - other => panic!( - "expected both DimensionOk for selected root {selected_root:?}, got {other:?}", - ), - } - } - - // The two roots reach different sets of behaviors via - // `workflow_reachable_behavior_ids`: `b`'s slice contains - // `a`'s slice plus the additional adds. A wrapper that - // ignored the supplied root would return the same witness - // count for both — this assertion catches that regression. - let witnesses_a = match analyze_complexity(&dag, root_a) { - DimensionReport::DimensionOk { witnesses, .. } => witnesses, - other => panic!("expected Ok at root_a, got {other:?}"), - }; - let witnesses_b = match analyze_complexity(&dag, root_b) { - DimensionReport::DimensionOk { witnesses, .. } => witnesses, - other => panic!("expected Ok at root_b, got {other:?}"), - }; - assert!( - witnesses_a.len() < witnesses_b.len(), - "root `a`'s reachable spine ({}) must be strictly smaller than root `b`'s ({}); \ - a wrapper that ignored the supplied root would return equal counts here", - witnesses_a.len(), - witnesses_b.len(), - ); - } - - /// E7 §test 1 (cross-check): `analyze_complexity.composed` matches - /// the lens folded table lookup [`symbolic_cost_lookup`] at the workflow root's port. - /// Confirms the wrapper preserves the lens contract. - #[test] - fn analyze_complexity_composed_matches_lens_at_workflow_root() { - let dag = cached_compile_to_dag("let z = 5 + 6", "e7_int_lens.v3"); - let root = find_bind_root(&dag, "z"); - - let SymbolicCostLookup::Hit(lens_cost) = - symbolic_cost_lookup(&dag, &find_bind_port(&dag, "z")) - else { - panic!("lens authority must produce a Hit on a well-typed program"); - }; - - let DimensionReport::DimensionOk { - composed, - dimension_name, - .. - } = analyze_complexity(&dag, root) - else { - panic!("expected DimensionOk on a well-typed program"); - }; - assert_eq!(composed, lens_cost); - assert_eq!(dimension_name, "symbolic_cost"); - } - - /// E7 §test 6 (integration form, success-path scope): the public - /// API preserves the typed `Witness` envelope on - /// the `DimensionOk` arm — every witness is a typed enum - /// inhabitant the test pattern-matches without inspecting the - /// `reason` string. Typed-diagnostic discipline on the `Fail` - /// arm is pinned by the in-module `analyze_complexity_tests` - /// (`src/v3/compiler/src/dimension.rs`), which constructs - /// ghost-port DAGs via crate-private builders that the public - /// API surface here cannot reach (the surface compiler always - /// wires its outputs). This integration test confirms the public - /// API does not lose the typed envelope on the success path. - #[test] - fn analyze_complexity_public_api_preserves_typed_witness_envelope_on_ok() { - let dag = cached_compile_to_dag("let w = 7 + 8", "e7_int_typed.v3"); - let root = find_bind_root(&dag, "w"); - - let DimensionReport::DimensionOk { witnesses, .. } = analyze_complexity(&dag, root) else { - panic!("expected DimensionOk for well-typed program"); - }; - // Each witness is a typed enum inhabitant; the test - // pattern-matches without ever inspecting the `reason` string - // (which is only present on the `Violates` arm anyway). - for witness in &witnesses { - // Exhaustive match on the typed Witness enum; both arms - // are acceptable inhabitants. `Violates.reason` is never - // string-parsed by this test. - match witness { - v3_compiler::Witness::Inhabits(_) => {} - v3_compiler::Witness::Violates { subject, .. } => { - let _ = subject; - } - } - } - } -} - -mod parse_stage4_prep { - use std::fs; - use std::path::{Path, PathBuf}; - - use v3_compiler::{parse_for_test, tokenize_for_test}; - - // SG-2 parser staging: corpus manifest snapshots the runtime parse surface - // (`parse_generated.rs` = `parse_surface.dag` carriers + `parse_parser_body.txt` algorithm) - // for structural parity — not a claim of full `.dag` parse-rule authority. - const PARSE_CORPUS_MANIFEST: &str = include_str!("integration/parse_corpus_manifest.txt"); - - fn compiler_root() -> PathBuf { - PathBuf::from(env!("CARGO_MANIFEST_DIR")) - } - - fn repo_root() -> PathBuf { - compiler_root() - .parent() - .and_then(Path::parent) - .and_then(Path::parent) - .expect("src/v3/compiler has repo-root ancestors") - .to_path_buf() - } - - fn collect_rel_paths(dir: &Path, rel_prefix: &str, ext: &str) -> Vec { - let mut entries: Vec = fs::read_dir(dir) - .unwrap_or_else(|err| panic!("read_dir {} failed: {err}", dir.display())) - .map(|entry| { - entry.unwrap_or_else(|err| panic!("read_dir entry {} failed: {err}", dir.display())) - }) - .map(|entry| entry.path()) - .filter(|path| path.extension().and_then(|value| value.to_str()) == Some(ext)) - .map(|path| { - let file_name = path - .file_name() - .and_then(|value| value.to_str()) - .expect("utf-8 fixture name"); - format!("{rel_prefix}/{file_name}") - }) - .collect(); - entries.sort(); - entries - } - - fn parse_corpus_paths() -> Vec { - let compiler_root = compiler_root(); - // Keep the `dsl/std` subset aligned with the bootstrap fixtures - // loaded in `bootstrap_regen_fresh.rs::std_fixtures`; this prep - // harness is a snapshot of the incumbent parser over that - // bootstrap-facing corpus, not a claim that every - // `dsl/std/*.dag` file parses under v3 today. - let mut paths = vec![ - "dsl/std/algebra.dag".to_string(), - "dsl/std/bit.dag".to_string(), - "dsl/std/float.dag".to_string(), - "dsl/std/integer.dag".to_string(), - "dsl/std/logic.dag".to_string(), - "dsl/std/magnitude.dag".to_string(), - "dsl/std/machine_constraints.dag".to_string(), - "dsl/std/nat.dag".to_string(), - "dsl/std/rational.dag".to_string(), - "dsl/std/string_type.dag".to_string(), - "dsl/std/types.dag".to_string(), - ]; - paths.extend(collect_rel_paths( - &compiler_root.join("../std"), - "src/v3/std", - "dag", - )); - paths.extend(collect_rel_paths( - &compiler_root.join("../spec"), - "src/v3/spec", - "dag", - )); - paths.extend(collect_rel_paths(&compiler_root, "src/v3/compiler", "dag")); - paths.extend(collect_rel_paths( - &compiler_root.join("tests/four_fixture_pressure"), - "src/v3/compiler/tests/four_fixture_pressure", - "v3", - )); - paths.sort(); - paths - } - - fn fnv1a64(bytes: &[u8]) -> u64 { - let mut hash = 0xcbf29ce484222325_u64; - for &byte in bytes { - hash ^= u64::from(byte); - hash = hash.wrapping_mul(0x100000001b3); - } - hash - } - - fn render_surface(path: &str) -> (usize, usize, u64) { - let source = fs::read_to_string(repo_root().join(path)) - .unwrap_or_else(|err| panic!("read fixture `{path}` failed: {err}")); - let tokens = tokenize_for_test(&source, path) - .unwrap_or_else(|diag| panic!("tokenize `{path}` failed: {diag:?}")); - let surface = parse_for_test(&tokens, path) - .unwrap_or_else(|diag| panic!("parse `{path}` failed: {diag:?}")); - let rendered = format!("{surface:#?}"); - ( - surface.items.len(), - rendered.len(), - fnv1a64(rendered.as_bytes()), - ) - } - - fn render_manifest() -> String { - let mut rendered = String::from( - "# AUTO-GENERATED by `cargo test -p v3-compiler refresh_handwritten_parse_snapshot_manifest -- --ignored`\n\ - # SG-2 parser staging: snapshots generated-parser surface output over the parse corpus.\n\ - # path\\titems\\tdebug_bytes\\tfnv1a64\n", - ); - for path in parse_corpus_paths() { - let (items, debug_bytes, hash) = render_surface(&path); - rendered.push_str(&format!("{path}\t{items}\t{debug_bytes}\t{hash:016x}\n")); - } - rendered - } - - fn parse_file(source: &str, name: &str) { - let tokens = tokenize_for_test(source, name) - .unwrap_or_else(|diag| panic!("tokenize {name} failed: {diag:?}")); - let _module = parse_for_test(&tokens, name) - .unwrap_or_else(|diag| panic!("parse {name} failed: {diag:?}")); - } - - #[test] - fn handwritten_parse_snapshot_matches_manifest() { - assert_eq!(render_manifest(), PARSE_CORPUS_MANIFEST); - } - - #[test] - #[ignore = "helper to refresh parse_corpus_manifest.txt after intentional handwritten parser changes"] - fn refresh_handwritten_parse_snapshot_manifest() { - let manifest_path = compiler_root() - .join("tests") - .join("integration") - .join("parse_corpus_manifest.txt"); - fs::write(&manifest_path, render_manifest()) - .unwrap_or_else(|err| panic!("write {} failed: {err}", manifest_path.display())); - } - - #[test] - fn handwritten_parser_accepts_logic_dag() { - parse_file( - include_str!("../../../../dsl/std/logic.dag"), - "dsl/std/logic.dag", - ); - } - - #[test] - fn handwritten_parser_accepts_bit_dag() { - parse_file( - include_str!("../../../../dsl/std/bit.dag"), - "dsl/std/bit.dag", - ); - } - - #[test] - fn handwritten_parser_accepts_algebra_dag() { - parse_file( - include_str!("../../../../dsl/std/algebra.dag"), - "dsl/std/algebra.dag", - ); - } - - #[test] - fn handwritten_parser_accepts_types_dag() { - parse_file( - include_str!("../../../../dsl/std/types.dag"), - "dsl/std/types.dag", - ); - } - - #[test] - fn handwritten_parser_accepts_patterns_dag() { - parse_file( - include_str!("../../../../dsl/std/patterns.dag"), - "dsl/std/patterns.dag", - ); - } - - #[test] - fn handwritten_parser_accepts_integer_dag() { - parse_file( - include_str!("../../../../dsl/std/integer.dag"), - "dsl/std/integer.dag", - ); - } - - #[test] - fn handwritten_parser_accepts_rational_dag() { - parse_file( - include_str!("../../../../dsl/std/rational.dag"), - "dsl/std/rational.dag", - ); - } - - #[test] - fn handwritten_parser_accepts_magnitude_dag() { - parse_file( - include_str!("../../../../dsl/std/magnitude.dag"), - "dsl/std/magnitude.dag", - ); - } - - #[test] - fn handwritten_parser_accepts_machine_constraints_dag() { - parse_file( - include_str!("../../../../dsl/std/machine_constraints.dag"), - "dsl/std/machine_constraints.dag", - ); - } - - #[test] - fn handwritten_parser_accepts_cache_identity_dag() { - // **P5 receipt (INVARIANTS.md §P5 — Self-Generation-0 `EXPECTED_HAND_AUTHORED_TEST`):** explicit - // deferral to **ROADMAP.md** `### Nine lanes` row **T-PB-B** / - // `pb_rust_tests_outside_residual_zero`; narrow parser smoke for `std.cache_identity` - // (P2 dup-authority substrate) until T-PB-B hand-Rust test floor reaches zero. - parse_file( - include_str!("../../../../dsl/std/cache_identity.dag"), - "dsl/std/cache_identity.dag", - ); - } - - #[test] - fn handwritten_parser_accepts_cpu_dag() { - // **P5 receipt (INVARIANTS.md §P5 — Self-Generation-0 `EXPECTED_HAND_AUTHORED_TEST`):** explicit - // deferral to **ROADMAP.md** `### Nine lanes` row **T-PB-B** / - // `pb_rust_tests_outside_residual_zero`; narrow parser smoke for `std.cpu` / - // `std.cpu.types` / `extdeps.cpu.ampere` (CPU concept + vendor catalog; P-CF supply authority) - // until T-PB-B hand-Rust test floor reaches zero. - // Self-Generation-0: no new hand-Rust path; `src/v3/compiler/tests/integration.rs` is already in - // `self_gen0_census_test.rs` `EXPECTED_HAND_AUTHORED_TEST` — path count unchanged (N→N); - // this adds one `#[test]` fn only, same pattern as - // `handwritten_parser_accepts_cache_interface_dag` below. - parse_file( - include_str!("../../../../dsl/std/cpu.dag"), - "dsl/std/cpu.dag", - ); - parse_file( - include_str!("../../../../dsl/std/cpu/types.dag"), - "dsl/std/cpu/types.dag", - ); - parse_file( - include_str!("../../../../dsl/extdeps/cpu/ampere.dag"), - "dsl/extdeps/cpu/ampere.dag", - ); - } - - #[test] - fn handwritten_parser_accepts_memory_dag() { - // **P5 receipt (INVARIANTS.md §P5 — Self-Generation-0 `EXPECTED_HAND_AUTHORED_TEST`):** explicit - // deferral to **ROADMAP.md** `### Nine lanes` row **T-PB-B** / - // `pb_rust_tests_outside_residual_zero`; narrow parser smoke for `std.memory` / - // SK Hynix DIMM catalog until T-PB-B hand-Rust test floor reaches zero. - // Self-Generation-0: no new hand-Rust path; `src/v3/compiler/tests/integration.rs` is already in - // `self_gen0_census_test.rs` `EXPECTED_HAND_AUTHORED_TEST` — path count unchanged (N→N); - // this adds one `#[test]` fn only, same pattern as `handwritten_parser_accepts_cpu_dag`. - parse_file( - include_str!("../../../../dsl/std/memory.dag"), - "dsl/std/memory.dag", - ); - parse_file( - include_str!("../../../../dsl/std/memory/types.dag"), - "dsl/std/memory/types.dag", - ); - parse_file( - include_str!("../../../../dsl/extdeps/memory/sk_hynix.dag"), - "dsl/extdeps/memory/sk_hynix.dag", - ); - } - - #[test] - fn handwritten_parser_accepts_hetzner_cloud_dag() { - // P5 receipt: extdeps.cloud.hetzner catalog authority for compute_fabric CAX41 supply. - parse_file( - include_str!("../../../../dsl/extdeps/cloud/hetzner.dag"), - "dsl/extdeps/cloud/hetzner.dag", - ); - } - - #[test] - fn handwritten_parser_accepts_compute_fabric_dag() { - // **P5 receipt (INVARIANTS.md §P5 — Self-Generation-0 `EXPECTED_HAND_AUTHORED_TEST`):** explicit - // deferral to **ROADMAP.md** `### Nine lanes` row **T-PB-B** / - // `pb_rust_tests_outside_residual_zero`; Worksheet A §2 parser gate - // (`docs/planning/v4-elastic-compute-fabric-worksheet-2026-05-30.md`) until T-PB-B - // hand-Rust test floor reaches zero. - parse_file( - include_str!("../../../../dsl/product/compute_fabric.dag"), - "dsl/product/compute_fabric.dag", - ); - } - - #[test] - fn handwritten_parser_accepts_cache_interface_dag() { - // P5 receipt (Dispatch-Discipline (b) deferral): Worksheet B gate P-CI-TYPE — - // `docs/planning/v4-elastic-cache-interface-worksheet-2026-05-30.md` §2 Parser gates. - // Self-Generation-0: no new hand-Rust path; `src/v3/compiler/tests/integration.rs` is already in - // `self_gen0_census_test.rs` `EXPECTED_HAND_AUTHORED_TEST` (line ~421) — path count - // unchanged (N→N); this adds one `#[test]` fn only, same pattern as - // `handwritten_parser_accepts_gunbc_digest_render_dag` below. - parse_file( - include_str!("../../../../dsl/std/cache_interface.dag"), - "dsl/std/cache_interface.dag", - ); - } - - #[test] - fn handwritten_parser_accepts_nat_dag() { - parse_file( - include_str!("../../../../dsl/std/nat.dag"), - "dsl/std/nat.dag", - ); - } - - #[test] - fn handwritten_parser_accepts_float_dag() { - parse_file( - include_str!("../../../../dsl/std/float.dag"), - "dsl/std/float.dag", - ); - } - - #[test] - fn handwritten_parser_accepts_string_type_dag() { - parse_file( - include_str!("../../../../dsl/std/string_type.dag"), - "dsl/std/string_type.dag", - ); - } - - #[test] - fn handwritten_parser_accepts_process_algebra_dag() { - parse_file( - include_str!("../../../../dsl/std/process_algebra.dag"), - "dsl/std/process_algebra.dag", - ); - } - - #[test] - fn handwritten_parser_accepts_v3_list_dag() { - parse_file(include_str!("../../std/list.dag"), "src/v3/std/list.dag"); - } - - #[test] - fn handwritten_parser_accepts_v3_verification_dag() { - parse_file( - include_str!("../../std/verification.dag"), - "src/v3/std/verification.dag", - ); - } - - #[test] - fn handwritten_parser_accepts_v3_effects_dag() { - parse_file( - include_str!("../../std/effects.dag"), - "src/v3/std/effects.dag", - ); - } - - #[test] - fn handwritten_parser_accepts_gunbc_digest_render_dag() { - // P5 receipt: this Rust harness is a narrow parser-acceptance consumer - // for the new `.dag` authority file. It does not introduce semantic - // authority; it keeps the Phase-3 render projection loadable until the - // parser corpus is generated from structural declarations. - parse_file( - include_str!("../../../../dsl/gunbc/digest_render.dag"), - "dsl/gunbc/digest_render.dag", - ); - } -} diff --git a/src/v3/compiler/tests/integration/anthropic_messages_callable_test.rs b/src/v3/compiler/tests/integration/anthropic_messages_callable_test.rs deleted file mode 100644 index 581b0d08c54..00000000000 --- a/src/v3/compiler/tests/integration/anthropic_messages_callable_test.rs +++ /dev/null @@ -1,221 +0,0 @@ -//! **Layer:** integration -//! -//! T-Substrate-AnthropicMessagesCallable shape ratchet. -//! -//! Pins the `fn anthropic_messages` declaration in -//! `src/v3/std/anthropic_messages.dag` so PR-β can rebase against a -//! stable callable target via `CallableRef.decl`. Asserts: -//! -//! - The declaration resolves in the full bootstrap and is `Arrow`-shaped. -//! - Parameter labels and types match the v3 mirror in -//! `v3.std.anthropic_schema` plus kernel `Secret` / `String` / `Int` / -//! `Float?` / `String?` for the primitives the v2 source carries. -//! - Output type is `AnthropicMessages200Body` (the 200 response slot, -//! per the v2 `response { 200 => … }` row). -//! - The declaration is acceptable as a `CallableRef` target, i.e. -//! `Operation.callable: CallableRef` with `decl` set to -//! `anthropic_messages`'s id resolves structurally (the field type -//! reach matches the substrate-level `DeclarationRef` admits-anything -//! policy that PR-β fixture load fail-closes against). -//! - No `Operation` / `data anthropic_operations` row leaks here; that -//! stays Grounding-owned in PR-β. - -use v3_compiler::dag::{ArrowBody, Dag, DeclarationId, TypeConnective}; -use v3_compiler::generated_full_bootstrap_dag; - -fn arrow_inputs_output(dag: &Dag, name: &str) -> (Vec, DeclarationId) { - let decl = dag - .declaration_by_name(name) - .unwrap_or_else(|| panic!("`{name}` missing from full bootstrap")); - match &decl.connective { - TypeConnective::Arrow { inputs, output, .. } => (inputs.clone(), *output), - other => panic!("`{name}` is not an Arrow: {other:?}"), - } -} - -/// Reuse the same canonicalization rule as the schema-mirror lockstep: -/// named declarations canonicalize as their surface name; anonymous -/// `Cardinality(AtMostOne, T)` and `Instantiation { template, args }` -/// unfold. -fn canonical_ty(dag: &Dag, ty: DeclarationId) -> String { - let decl = dag.declaration(ty); - if let Some(name) = decl.name.as_deref() { - return name.to_string(); - } - match &decl.connective { - TypeConnective::Cardinality(p) => format!("{}?", canonical_ty(dag, p.element())), - TypeConnective::Instantiation { - template, - arguments, - } => { - let template_name = dag - .declaration(*template) - .name - .clone() - .unwrap_or_else(|| canonical_ty(dag, *template)); - if arguments.is_empty() { - template_name - } else { - let args: Vec = arguments - .iter() - .map(|a| canonical_ty(dag, a.value)) - .collect(); - format!("{}<{}>", template_name, args.join(", ")) - } - } - _ => "".to_string(), - } -} - -#[test] -fn anthropic_messages_is_arrow_shaped() { - let dag = generated_full_bootstrap_dag(); - let decl = dag - .declaration_by_name("anthropic_messages") - .expect("`anthropic_messages` missing from full bootstrap"); - assert!( - matches!(decl.connective, TypeConnective::Arrow { .. }), - "`anthropic_messages` must be `Arrow`-shaped so `CallableRef.decl` \ - can target an actual callable signature, not a `data` row or a \ - type alias. Got: {:?}", - decl.connective - ); -} - -#[test] -fn anthropic_messages_parameter_types_match_v2_source_via_v3_mirror() { - // Expected canonical parameter types in declaration order. These - // mirror `dsl/extdeps/llm/anthropic.dag:182-187` modulo the two - // documented honesty-preserving simplifications: - // - `max_tokens: Int` (v2 `Int = 4096`; v3 has no parameter - // defaults — the default is a caller-side fold, not a v3 - // callable contract change). - // - return is the 200 body only (`AnthropicMessages200Body`); - // error responses are PR-β's response/wire lockstep concern. - let dag = generated_full_bootstrap_dag(); - let (inputs, _output) = arrow_inputs_output(&dag, "anthropic_messages"); - let actual: Vec = inputs.iter().map(|id| canonical_ty(&dag, *id)).collect(); - let expected: Vec<&str> = vec![ - "Secret", - "String", - "List", - "Int", - "Float?", - "String?", - ]; - assert_eq!( - actual, - expected.iter().map(|s| s.to_string()).collect::>(), - "anthropic_messages parameter types diverged from the v2 \ - operation Messages signature." - ); -} - -#[test] -fn anthropic_messages_returns_anthropic_messages_200_body() { - let dag = generated_full_bootstrap_dag(); - let (_inputs, output) = arrow_inputs_output(&dag, "anthropic_messages"); - let output_canonical = canonical_ty(&dag, output); - assert_eq!( - output_canonical, "AnthropicMessages200Body", - "anthropic_messages must return `AnthropicMessages200Body` \ - (the v2 `response 200 =>` slot from \ - `dsl/extdeps/llm/anthropic.dag`). Error-response carriers are \ - deferred to PR-β's response/wire lockstep lane." - ); -} - -#[test] -fn anthropic_messages_is_acceptable_callable_ref_target() { - // `CallableRef { decl: DeclarationRef }` — `DeclarationRef` admits - // any declaration at the substrate level (the same #1175 residual - // `MethodRef` carries). The PR-β fixture-load boundary check that - // every `Operation.callable.decl` resolves to an `Arrow`-shaped - // declaration (the actual callable contract) is what this test - // pre-validates: `anthropic_messages` IS an Arrow with a non-empty - // input list and a typed output, which is the property PR-β's - // fail-closed boundary will verify. - let dag = generated_full_bootstrap_dag(); - let decl = dag - .declaration_by_name("anthropic_messages") - .expect("`anthropic_messages` missing from full bootstrap"); - let (inputs, output) = match &decl.connective { - TypeConnective::Arrow { inputs, output, .. } => (inputs, *output), - other => panic!("`anthropic_messages` is not an Arrow: {other:?}"), - }; - assert!( - !inputs.is_empty(), - "callable target for `Operation.callable.decl` must carry the \ - operation's input list — anthropic_messages with empty inputs \ - is structurally unfit." - ); - let output_decl = dag.declaration(output); - assert!( - output_decl.name.is_some(), - "callable output should resolve to a named declaration, so PR-β \ - lockstep against the response/wire lane has a real type to \ - project. Got anonymous output: {:?}", - output_decl.connective - ); -} - -#[test] -fn anthropic_messages_body_is_unparsed() { - // The `host anthropic_messages` body lowers as - // `ArrowBody::Unparsed(span)` in the bootstrap, not as - // `ExternalRealization` / `UserDefined` / `NoBody` / `Pending`. - // The pipeline-stage `host parse` / `host lower` patch - // (`bootstrap.rs:256`) is pipeline-specific; service-operation - // callables don't have an equivalent and don't get one in this - // PR (per #1130 dispatch — no producerless realization carrier). - // Pinning the actual body class makes the substrate fact match the - // file header's prose; a silent rewrite in either direction would - // fail closed here. - let dag = generated_full_bootstrap_dag(); - let decl = dag - .declaration_by_name("anthropic_messages") - .expect("`anthropic_messages` missing from full bootstrap"); - let body = match &decl.connective { - TypeConnective::Arrow { body, .. } => body, - other => panic!("`anthropic_messages` is not an Arrow: {other:?}"), - }; - assert!( - matches!(body, ArrowBody::Unparsed(_)), - "`anthropic_messages` body must be `ArrowBody::Unparsed(...)` in \ - this slice (the honest substrate state for `host anthropic_messages` \ - without a service-operation realization patch). Got: {body:?}. \ - If this rewrites to `ExternalRealization`, that means a producerless \ - realization carrier landed — re-validate against the #1130 dispatch \ - before relaxing this ratchet." - ); -} - -#[test] -fn anthropic_messages_dag_authors_no_operation_rows() { - // The `Operation` row that closes the callable-to-source-identity - // edge (`callable: { decl: anthropic_messages }, inputs: …, - // endpoint: { method: POST, path: parse_path_template("/v1/messages"), … }`) - // is Grounding-owned PR-β work in a sibling - // `src/v3/std/anthropic_operations.dag`. Reject any `data` row - // landing in `anthropic_messages.dag` (which would mean a - // producerless `Operation` row or other parallel-surface scaffold - // leaked here). - let dag = generated_full_bootstrap_dag(); - let leaks: Vec = dag - .declarations() - .iter() - .filter(|d| d.span.file == "src/v3/std/anthropic_messages.dag") - .filter(|d| d.value_body.is_some()) - .map(|d| { - d.name - .clone() - .unwrap_or_else(|| format!("DeclarationId({:?})", d.id)) - }) - .collect(); - assert!( - leaks.is_empty(), - "anthropic_messages.dag is callable-decl authority only; no \ - `data` rows allowed. PR-β authors operation rows in a sibling \ - file. Found: {leaks:?}." - ); -} diff --git a/src/v3/compiler/tests/integration/anthropic_messages_wire_demo_test.rs b/src/v3/compiler/tests/integration/anthropic_messages_wire_demo_test.rs deleted file mode 100644 index 9f6e06694bb..00000000000 --- a/src/v3/compiler/tests/integration/anthropic_messages_wire_demo_test.rs +++ /dev/null @@ -1,350 +0,0 @@ -//! **Layer:** integration -//! -//! R3 gate #68 (`anthropic_wire_demonstration`): hermetic Anthropic -//! Messages request/response cycle against a deterministic mock. -//! -//! This deliberately does not call the live Anthropic API. The gate is -//! the typed wire cycle: construct a request with the same field surface -//! as `fn anthropic_messages`, serialize it to the REST body shape from -//! `dsl/extdeps/llm/anthropic.dag`, feed a deterministic mock 200 body -//! through the typed response mirror, and assert the projected result. - -use serde::{Deserialize, Serialize}; -use serde_json::json; -use v3_compiler::dag::{Dag, DeclarationId, TypeConnective}; -use v3_compiler::generated_full_bootstrap_dag; - -#[derive(Debug, Clone, PartialEq, Eq, Serialize)] -#[serde(rename_all = "snake_case")] -enum RequestRole { - User, - Assistant, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize)] -#[serde(tag = "type", rename_all = "snake_case")] -enum RequestContentBlock { - Text { text: String }, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize)] -struct RequestMessage { - role: RequestRole, - content: Vec, -} - -#[derive(Debug, Clone, PartialEq, Serialize)] -struct AnthropicMessagesRequest { - model: String, - messages: Vec, - max_tokens: i64, - #[serde(skip_serializing_if = "Option::is_none")] - temperature: Option, - #[serde(skip_serializing_if = "Option::is_none")] - system: Option, -} - -#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)] -#[serde(rename_all = "snake_case")] -enum ResponseRole { - Assistant, -} - -#[derive(Debug, Clone, PartialEq, Eq, Deserialize)] -#[serde(rename_all = "snake_case")] -enum StopReason { - EndTurn, - MaxTokens, - StopSequence, - ToolUse, - PauseTurn, - Refusal, - ModelContextWindowExceeded, -} - -#[derive(Debug, Clone, PartialEq, Eq, Deserialize)] -#[serde(tag = "type", rename_all = "snake_case")] -enum ResponseContentBlock { - Text { text: String }, -} - -#[derive(Debug, Clone, PartialEq, Eq, Deserialize)] -#[serde(rename_all = "snake_case")] -enum ServiceTier { - Standard, - Priority, - Batch, -} - -#[derive(Debug, Clone, PartialEq, Eq, Deserialize)] -struct Usage { - input_tokens: i64, - output_tokens: i64, - service_tier: Option, -} - -#[derive(Debug, Clone, PartialEq, Eq, Deserialize)] -struct AnthropicMessages200Body { - id: String, - #[serde(rename = "type")] - body_type: String, - role: ResponseRole, - content: Vec, - model: String, - stop_reason: StopReason, - stop_sequence: Option, - usage: Usage, -} - -fn canonical_ty(dag: &Dag, ty: DeclarationId) -> String { - let decl = dag.declaration(ty); - if let Some(name) = decl.name.as_deref() { - return name.to_string(); - } - match &decl.connective { - TypeConnective::Cardinality(p) => format!("{}?", canonical_ty(dag, p.element())), - TypeConnective::Instantiation { - template, - arguments, - } => { - let template_name = dag - .declaration(*template) - .name - .clone() - .unwrap_or_else(|| canonical_ty(dag, *template)); - if arguments.is_empty() { - template_name - } else { - let args: Vec = arguments - .iter() - .map(|a| canonical_ty(dag, a.value)) - .collect(); - format!("{}<{}>", template_name, args.join(", ")) - } - } - _ => "".to_string(), - } -} - -fn anthropic_messages_signature(dag: &Dag) -> (Vec, String) { - let decl = dag - .declaration_by_name("anthropic_messages") - .expect("`anthropic_messages` missing from full bootstrap"); - let TypeConnective::Arrow { inputs, output, .. } = &decl.connective else { - panic!( - "`anthropic_messages` must be Arrow-shaped; got {:?}", - decl.connective - ); - }; - ( - inputs.iter().map(|id| canonical_ty(dag, *id)).collect(), - canonical_ty(dag, *output), - ) -} - -fn conj_field_labels(dag: &Dag, name: &str) -> Vec { - let decl = dag - .declaration_by_name(name) - .unwrap_or_else(|| panic!("`{name}` missing from full bootstrap")); - match &decl.connective { - TypeConnective::Conj { children } => children.iter().map(|f| f.label.clone()).collect(), - other => panic!("`{name}` is not a Conj: {other:?}"), - } -} - -fn disj_variant_labels(dag: &Dag, name: &str) -> Vec { - let decl = dag - .declaration_by_name(name) - .unwrap_or_else(|| panic!("`{name}` missing from full bootstrap")); - match &decl.connective { - TypeConnective::Disj { variants } => variants.iter().map(|v| v.label.clone()).collect(), - other => panic!("`{name}` is not a Disj: {other:?}"), - } -} - -#[test] -fn anthropic_messages_demo_projection_is_locked_to_modeled_dag_surface() { - let dag = generated_full_bootstrap_dag(); - - let body_fields = conj_field_labels(&dag, "AnthropicMessages200Body"); - for field in [ - "id", - "type", - "role", - "content", - "model", - "stop_reason", - "stop_sequence", - "usage", - ] { - assert!( - body_fields.iter().any(|actual| actual == field), - "demo response projection field `{field}` must exist on AnthropicMessages200Body" - ); - } - - let usage_fields = conj_field_labels(&dag, "AnthropicMessages200Usage"); - for field in ["input_tokens", "output_tokens", "service_tier"] { - assert!( - usage_fields.iter().any(|actual| actual == field), - "demo usage projection field `{field}` must exist on AnthropicMessages200Usage" - ); - } - assert_eq!( - disj_variant_labels(&dag, "AnthropicMessages200ServiceTier"), - vec!["Standard", "Priority", "Batch"], - "demo response usage tier must stay locked to AnthropicMessages200ServiceTier" - ); - - assert_eq!( - disj_variant_labels(&dag, "AnthropicMessages200Role"), - vec!["Assistant"], - "demo response role enum must stay locked to the modeled response role" - ); - assert_eq!( - disj_variant_labels(&dag, "AnthropicStopReason"), - vec![ - "EndTurn", - "MaxTokens", - "StopSequence", - "ToolUse", - "PauseTurn", - "Refusal", - "ModelContextWindowExceeded", - ], - "demo stop-reason enum must stay locked to AnthropicStopReason" - ); - assert!( - disj_variant_labels(&dag, "AnthropicMessages200ContentBlock") - .iter() - .any(|variant| variant == "MessagesTextBlock"), - "demo text response block must be backed by the modeled MessagesTextBlock variant" - ); -} - -#[test] -fn anthropic_messages_typed_wire_cycle_executes_against_deterministic_mock() { - let dag = generated_full_bootstrap_dag(); - let (inputs, output) = anthropic_messages_signature(&dag); - assert_eq!( - inputs, - vec![ - "Secret", - "String", - "List", - "Int", - "Float?", - "String?", - ], - "demo request must stay aligned to the typed anthropic_messages input surface" - ); - assert_eq!( - output, "AnthropicMessages200Body", - "demo response must stay aligned to the typed 200 response mirror" - ); - - let request = AnthropicMessagesRequest { - model: "claude-3-5-sonnet-latest".to_string(), - messages: vec![RequestMessage { - role: RequestRole::User, - content: vec![RequestContentBlock::Text { - text: "Reply with the deterministic token.".to_string(), - }], - }], - max_tokens: 16, - temperature: Some(0.0), - system: Some("Use the mock transcript exactly.".to_string()), - }; - - let body = serde_json::to_value(&request).expect("request serializes"); - assert_eq!( - body, - json!({ - "model": "claude-3-5-sonnet-latest", - "messages": [{ - "role": "user", - "content": [{ - "type": "text", - "text": "Reply with the deterministic token." - }] - }], - "max_tokens": 16, - "temperature": 0.0, - "system": "Use the mock transcript exactly." - }), - "request body must match the Anthropic Messages REST body shape" - ); - - let mock_response = json!({ - "id": "msg_mock_01", - "type": "message", - "role": "assistant", - "content": [{ - "type": "text", - "text": "deterministic-token" - }], - "model": "claude-3-5-sonnet-latest", - "stop_reason": "end_turn", - "stop_sequence": null, - "usage": { - "input_tokens": 11, - "output_tokens": 3, - "cache_creation_input_tokens": null, - "cache_read_input_tokens": null, - "service_tier": "priority" - }, - "container": null - }); - - let typed: AnthropicMessages200Body = - serde_json::from_value(mock_response).expect("mock 200 body deserializes"); - assert_eq!(typed.role, ResponseRole::Assistant); - assert_eq!(typed.stop_reason, StopReason::EndTurn); - assert_eq!(typed.usage.input_tokens, 11); - assert_eq!(typed.usage.output_tokens, 3); - assert_eq!(typed.usage.service_tier, Some(ServiceTier::Priority)); - assert_eq!( - typed.content, - vec![ResponseContentBlock::Text { - text: "deterministic-token".to_string() - }], - "typed response projection should recover the deterministic mock text" - ); -} - -#[test] -fn anthropic_messages_wire_demo_is_hermetic() { - assert_eq!( - serde_json::to_value(RequestRole::Assistant).expect("assistant role serializes"), - json!("assistant"), - "assistant request role must serialize to the Anthropic wire string" - ); - assert_eq!( - serde_json::to_value(ResponseRole::Assistant).expect("response role serializes"), - json!("assistant"), - "unit response role must serialize to the Anthropic wire string, not an object" - ); - - let request = AnthropicMessagesRequest { - model: "claude-3-5-sonnet-latest".to_string(), - messages: vec![RequestMessage { - role: RequestRole::User, - content: vec![RequestContentBlock::Text { - text: "No network is used.".to_string(), - }], - }], - max_tokens: 8, - temperature: None, - system: None, - }; - - let body = serde_json::to_value(&request).expect("request serializes"); - assert!( - body.get("api_key").is_none(), - "API credentials must not enter the JSON body; auth stays outside the deterministic mock" - ); - assert!( - body.get("temperature").is_none() && body.get("system").is_none(), - "optional request fields should be omitted when absent" - ); -} diff --git a/src/v3/compiler/tests/integration/anthropic_operations_test.rs b/src/v3/compiler/tests/integration/anthropic_operations_test.rs deleted file mode 100644 index ba73a1f2bc1..00000000000 --- a/src/v3/compiler/tests/integration/anthropic_operations_test.rs +++ /dev/null @@ -1,353 +0,0 @@ -//! **Layer:** integration -//! -//! Acceptance for `anthropic_operations: List` substrate fixture -//! at `src/v3/std/anthropic_operations.dag` (T-Ground services.dag PR-β -//! Phase 1 pilot; mirrors the #1195 `MethodTemplateContract` Phase 1 -//! pattern). Validates: -//! -//! 1. The fixture lowers as `ValueBody::List` (not `Unparsed` — -//! post-#1195/#1196 regression-class lesson). -//! 2. `Operation.callable.decl` ids are unique within the list (the -//! structural invariant analogous to `dag_method` uniqueness in -//! `method_template_contract_per_target_dag_method_unique`; pivot -//! from `name` to `callable.decl` per #1246's structural decision -//! that `Operation` doesn't carry a parallel display-name field). -//! 3. The expected pilot row is present and resolves through -//! `callable.decl` to the `anthropic_messages` callable from #1266 -//! at `src/v3/std/anthropic_messages.dag` — lockstep with the v2 -//! source of truth at `dsl/extdeps/llm/anthropic.dag:180-203`. -//! Endpoint shape: POST /v1/messages (LiteralToken("v1") + -//! LiteralToken("messages")). -//! 4. Every `ParamToken.name` from the path template resolves into the -//! operation's input-field map. The walk + assertion are wired -//! structurally; vacuous for `/v1/messages` (zero `ParamToken`s) -//! AND for the empty-input Phase 1 Messages row, but rows added -//! later (provider operations with path-template variables AND -//! populated inputs once the parser-grammar extension lands) -//! inherit the discipline by construction without test rewrite. -//! -//! Input-keys lockstep parity check is **deferred** for the Messages -//! pilot: `Operation.inputs` is `{}` until Substrate's parser-grammar -//! extension supports nested `Map` literals as record -//! field values (per `anthropic_operations.dag` header EXPLICIT -//! DEFERRAL §1 + #1133 inbox 4353126932). Re-asserts on Phase 1.5+ -//! row-fill cycle. - -use std::collections::HashSet; -use v3_compiler::dag::{Dag, DeclarationId, FieldValue, TypeConnective, ValueBody}; -use v3_compiler::generated_full_bootstrap_dag; - -const ANTHROPIC_OPERATIONS: &str = "anthropic_operations"; - -/// Resolve a `Variant.constructor` DeclarationId to the variant's -/// **structural** label by consulting the parent sum's `Disj.variants` -/// list — NOT by reading `Declaration.name` on the constructor decl -/// (which is a bolted-on convenience that may drift from the -/// declared-variant authority). The Disj's variants list IS the -/// single-authority for variant-label-to-constructor mapping. -fn variant_label_in_parent(dag: &Dag, parent_name: &str, constructor: DeclarationId) -> String { - let parent = dag - .declaration_by_name(parent_name) - .unwrap_or_else(|| panic!("expected parent sum `{parent_name}` missing from bootstrap")); - let TypeConnective::Disj { variants } = &parent.connective else { - panic!( - "`{parent_name}` is not a Disj sum; cannot resolve variant labels: {:?}", - parent.connective - ); - }; - variants - .iter() - .find(|v| v.ty == constructor) - .map(|v| v.label.clone()) - .unwrap_or_else(|| { - panic!( - "constructor `DeclarationId({})` is not a variant of `{parent_name}`; \ - declared variants: {:?}", - constructor.raw(), - variants.iter().map(|v| &v.label).collect::>() - ) - }) -} - -fn list_value_body<'a>(dag: &'a Dag, name: &str) -> &'a Vec { - let decl = dag - .declaration_by_name(name) - .unwrap_or_else(|| panic!("`{name}` missing from full bootstrap")); - let body = decl - .value_body - .as_ref() - .unwrap_or_else(|| panic!("`{name}` has no value body — must be a `data` declaration")); - let ValueBody::List(rows) = body else { - panic!( - "`{name}` value body must be `ValueBody::List` (declared as \ - `List`); got {body:?}" - ); - }; - rows -} - -fn record_field<'a>(fields: &'a [(String, FieldValue)], label: &str) -> &'a FieldValue { - fields - .iter() - .find(|(l, _)| l == label) - .map(|(_, v)| v) - .unwrap_or_else(|| panic!("missing `{label}` field; have {fields:?}")) -} - -fn string_literal(value: &FieldValue) -> &str { - use v3_compiler::dag::LiteralBits; - match value { - FieldValue::Literal(LiteralBits::String(s)) => s.as_str(), - other => panic!("expected String literal; got {other:?}"), - } -} - -/// Resolve `Operation.callable.decl` (the typed-edge into the -/// callable-decl registry, per `services.dag:98-100` `CallableRef` -/// shape) to the underlying DeclarationId. Used for uniqueness -/// checks + pilot-row lookups; callable identity replaces the -/// previously-modeled `name: String` field per #1246's structural -/// decision (`Operation` doesn't carry a parallel display-name field). -fn callable_decl_id(fields: &[(String, FieldValue)]) -> DeclarationId { - let callable = record_field(fields, "callable"); - let FieldValue::Record(callable_fields) = callable else { - panic!("`callable` must be a `CallableRef` record; got {callable:?}"); - }; - let decl = record_field(callable_fields, "decl"); - let FieldValue::Reference(id) = decl else { - panic!( - "`callable.decl` must be a `FieldValue::Reference(DeclarationId)` \ - pointing at a top-level callable; got {decl:?}" - ); - }; - *id -} - -#[test] -fn anthropic_operations_lowers_as_list() { - let dag = generated_full_bootstrap_dag(); - let _rows = list_value_body(&dag, ANTHROPIC_OPERATIONS); -} - -#[test] -fn anthropic_operations_callable_unique() { - let dag = generated_full_bootstrap_dag(); - let rows = list_value_body(&dag, ANTHROPIC_OPERATIONS); - - let mut seen: HashSet = HashSet::new(); - for (idx, row) in rows.iter().enumerate() { - let FieldValue::Record(fields) = row else { - panic!( - "row {idx} in `{ANTHROPIC_OPERATIONS}` is not a `FieldValue::Record` — \ - every `Operation` row must be a record literal" - ); - }; - let id = callable_decl_id(fields); - assert!( - seen.insert(id), - "duplicate `callable.decl` ({}) in `{ANTHROPIC_OPERATIONS}` at row {idx}", - id.raw() - ); - } -} - -#[test] -#[ignore = "Phase 1 pilot row deferred until Substrate's parser-grammar extension \ - lands (nested Map literals in record field-value position). \ - Once anthropic_operations.dag's Messages row populates, drop the \ - #[ignore] and re-arm; the assertions inside still match the post-#1246 \ - shape (callable.decl == anthropic_messages, POST /v1/messages, \ - empty/populated inputs)."] -fn anthropic_operations_messages_pilot_present() { - let dag = generated_full_bootstrap_dag(); - let rows = list_value_body(&dag, ANTHROPIC_OPERATIONS); - - let anthropic_messages_id = dag - .declaration_by_name("anthropic_messages") - .expect("expected callable `anthropic_messages` (per #1266) missing from full bootstrap") - .id; - - let messages = rows - .iter() - .find_map(|row| match row { - FieldValue::Record(fields) => { - if callable_decl_id(fields) == anthropic_messages_id { - Some(fields) - } else { - None - } - } - _ => None, - }) - .expect( - "Messages operation pilot row (callable.decl == anthropic_messages) missing from \ - anthropic_operations", - ); - - // Endpoint check: method=POST, path=/v1/messages (LiteralToken("v1") + - // LiteralToken("messages")). Lockstep with v2 source of truth at - // dsl/extdeps/llm/anthropic.dag:194-200. - let endpoint = record_field(messages, "endpoint"); - let FieldValue::Record(endpoint_fields) = endpoint else { - panic!("`endpoint` field must be a record; got {endpoint:?}"); - }; - - let method = record_field(endpoint_fields, "method"); - let FieldValue::Variant { constructor, .. } = method else { - panic!("`endpoint.method` must be a `HttpMethod` variant; got {method:?}"); - }; - let method_label = variant_label_in_parent(&dag, "HttpMethod", *constructor); - assert_eq!( - method_label, "POST", - "Messages endpoint method must be POST (per anthropic.dag:197); got `{method_label}`" - ); - - let path = record_field(endpoint_fields, "path"); - let FieldValue::Record(path_fields) = path else { - panic!("`endpoint.path` must be a `PathTemplate` record; got {path:?}"); - }; - let tokens = record_field(path_fields, "tokens"); - let FieldValue::List(token_list) = tokens else { - panic!("`endpoint.path.tokens` must be a List; got {tokens:?}"); - }; - let token_texts: Vec = token_list - .iter() - .map(|token| { - let FieldValue::Variant { - constructor, - payload, - } = token - else { - panic!("expected UrlPathToken variant; got {token:?}"); - }; - // Assert the constructor IS LiteralToken before extracting text. - // Resolution goes through the parent `UrlPathToken` Disj's - // `variants` list — the structural single-authority. - let variant_label = variant_label_in_parent(&dag, "UrlPathToken", *constructor); - assert_eq!( - variant_label, "LiteralToken", - "Messages endpoint path must contain only LiteralToken \ - variants (per anthropic.dag:198 `/v1/messages` literal segments); \ - got `{variant_label}` token" - ); - assert_eq!( - payload.len(), - 1, - "LiteralToken payload must carry one field; got {payload:?}" - ); - // LiteralToken { text: String } — payload[0] is the text record/field. - // The variant payload encoding may vary; accept either a direct String - // literal or a single-field Record { text: }. - match &payload[0] { - FieldValue::Literal(_) => string_literal(&payload[0]).to_string(), - FieldValue::Record(inner) => { - string_literal(record_field(inner, "text")).to_string() - } - other => panic!("unexpected LiteralToken payload shape: {other:?}"), - } - }) - .collect(); - assert_eq!( - token_texts, - vec!["v1".to_string(), "messages".to_string()], - "Messages endpoint path must be /v1/messages (per anthropic.dag:198); \ - got tokens {token_texts:?}" - ); - - // Inputs check: empty for the Phase 1 Messages pilot (parser-grammar - // gap defers populated input-keys map; see anthropic_operations.dag - // EXPLICIT DEFERRAL §1). When Substrate's parser-grammar extension - // lands, the row's `inputs` populates and this assertion grows to - // re-establish v2-parity input-key set per anthropic.dag:183-189. - let inputs = record_field(messages, "inputs"); - let FieldValue::Map(input_map) = inputs else { - panic!("`inputs` must be a `Map`; got {inputs:?}"); - }; - assert!( - input_map.entries().is_empty(), - "Messages `inputs` must be empty for the Phase 1 pilot (parser-grammar gap \ - defers nested-map literals). Once Substrate's parser extension lands, \ - populate this row + grow the assertion to v2-parity keys. Got {} entries: {:?}", - input_map.entries().len(), - input_map - .entries() - .iter() - .map(|(k, _)| k) - .collect::>() - ); -} - -/// Boundary check: every `ParamToken.name` token in every operation's -/// path template MUST resolve to a key in that operation's -/// `inputs: Map`. Vacuous on the Phase 1 pilot -/// (`Messages` has zero `ParamToken`s — `/v1/messages` is pure -/// literal segments — AND zero inputs pending parser-grammar -/// extension), but the walk + assertion are wired so any future row -/// carrying path-template variables AND populated inputs inherits -/// the discipline without test rewrite. -#[test] -fn anthropic_operations_param_tokens_resolve_to_input_keys() { - let dag = generated_full_bootstrap_dag(); - let rows = list_value_body(&dag, ANTHROPIC_OPERATIONS); - - for (idx, row) in rows.iter().enumerate() { - let FieldValue::Record(fields) = row else { - panic!("row {idx} not a record"); - }; - let op_callable_id = callable_decl_id(fields); - let op_label = dag - .declaration(op_callable_id) - .name - .as_deref() - .map(str::to_string) - .unwrap_or_else(|| format!("DeclarationId({})", op_callable_id.raw())); - - let inputs = record_field(fields, "inputs"); - let FieldValue::Map(input_map) = inputs else { - panic!("`inputs` must be a Map; got {inputs:?}"); - }; - let input_keys: HashSet<&str> = input_map - .entries() - .iter() - .map(|(k, _)| k.as_str()) - .collect(); - - let endpoint = record_field(fields, "endpoint"); - let FieldValue::Record(endpoint_fields) = endpoint else { - panic!("`endpoint` must be a record"); - }; - let path = record_field(endpoint_fields, "path"); - let FieldValue::Record(path_fields) = path else { - panic!("`path` must be a PathTemplate record"); - }; - let tokens = record_field(path_fields, "tokens"); - let FieldValue::List(token_list) = tokens else { - panic!("`path.tokens` must be a List"); - }; - - for (tidx, token) in token_list.iter().enumerate() { - let FieldValue::Variant { - constructor, - payload, - } = token - else { - panic!("path token {tidx} must be a UrlPathToken variant; got {token:?}"); - }; - let variant_label = variant_label_in_parent(&dag, "UrlPathToken", *constructor); - if variant_label == "ParamToken" { - let name = match payload.first() { - Some(FieldValue::Literal(_)) => string_literal(&payload[0]).to_string(), - Some(FieldValue::Record(inner)) => { - string_literal(record_field(inner, "name")).to_string() - } - other => panic!("unexpected ParamToken payload: {other:?}"), - }; - assert!( - input_keys.contains(name.as_str()), - "operation `{op_label}` path token {tidx} `ParamToken({name})` does \ - not resolve to an input field key; have {input_keys:?}" - ); - } - } - } -} diff --git a/src/v3/compiler/tests/integration/anthropic_schema_lockstep_test.rs b/src/v3/compiler/tests/integration/anthropic_schema_lockstep_test.rs deleted file mode 100644 index ef9426dcf3f..00000000000 --- a/src/v3/compiler/tests/integration/anthropic_schema_lockstep_test.rs +++ /dev/null @@ -1,777 +0,0 @@ -//! **Layer:** integration -//! -//! T-Substrate-AnthropicSchemaMirror lockstep ratchet. -//! -//! Pins the v3 typed mirror in `src/v3/std/anthropic_schema.dag` against -//! the v2 authority in `dsl/extdeps/llm/anthropic.dag`. The mirror is -//! type authority only (no `data` rows). For every mirrored type the -//! ratchet asserts: -//! -//! - The v3 declaration resolves in the full bootstrap. -//! - **Set equality (not subset)** between the v2 field/variant set -//! extracted directly from `dsl/extdeps/llm/anthropic.dag` and the v3 -//! field/variant set walked from the bootstrap. v2 additions surface -//! as a missing-on-v3 diff; v3 drift surfaces as missing-on-v2. -//! - **Structural optionality**: every field marked `