@@ -5674,7 +5674,8 @@
5674 %jrec [%yes & fuel ~]
5674 %jrec [%yes & fuel ~]
5677++$ igate-prelude-evidence [iface=ifile gates=(map term def)]
5677−+$ istate [next=@ud sub=isub caps=icaps binders=(list @ud) molds=imolds globals=(list term) externals=iexternals surs=(list term) mark-externals=imark-externals marks=(list term) jimports=ijimports reserved-molds=(list term) params=iparams active=(list term) tags=(list ipending) in-mold=? at=path top-molds=(list term) prelude=(unit ifile) holes=(list ihole) jrec-fuel=@ud projections=(list iwprojection)]
5678++$ istate [next=@ud sub=isub caps=icaps binders=(list @ud) molds=imolds globals=(list term) externals=iexternals surs=(list term) mark-externals=imark-externals marks=(list term) jimports=ijimports reserved-molds=(list term) params=iparams active=(list term) tags=(list ipending) in-mold=? at=path top-molds=(list term) prelude=(unit ifile) holes=(list ihole) jrec-fuel=@ud projections=(list iwprojection) gate-defs=(map term def) head-evidence=(unit igate-prelude-evidence)]
5678+$ idiag [msg=tape sites=(list [at=span note=tape])]
5679+$ idiag [msg=tape sites=(list [at=span note=tape])]
5679+$ iresult (each [typ=itype state=istate] idiag)
5680+$ iresult (each [typ=itype state=istate] idiag)
5680+$ isample-result (each [typ=itype env=ienv state=istate] tape)
5681+$ isample-result (each [typ=itype env=ienv state=istate] tape)
@@ -8257,6 +8258,234 @@
8257 ?: ?=(%| -.out) [%| p.out]
8258 ?: ?=(%| -.out) [%| p.out]
8258 [%& [e typ.p.out sub.state.p.out (flop projections.state.p.out)]]
8259 [%& [e typ.p.out sub.state.p.out (flop projections.state.p.out)]]
8261+:: Source-bound gate-layout evidence, confined to checked root gate
8262+:: definitions and direct unshadowed prelude calls. The prepared prelude
8263+:: interface and its retained source are trusted as a matching artifact.
8264+:: Layouts identify sample binder faces; they do not change call arity or
8265+:: authorize stripping nested value faces. Unknown origins use ordinary fit.
8266+++ direct-written-gates
8267+ |= [ds=(list def) out=ivisited]
8270+ ?: ?=(%mold -.i.ds) $(ds t.ds)
8271+ ?. |(?=(%gate -.val.i.ds) ?=(%gate-wide -.val.i.ds)) $(ds t.ds)
8272+ $(ds t.ds, out (~(put by out) name.i.ds &))
8273+++ direct-may-use-prelude
8274+ |= [ds=(list def) root=ivisited heads=ivisited]
8277+ ?: ?=(%mold -.i.ds) $(ds t.ds)
8278+ =/ refs=(list term) (dependency-expr val.i.ds)
8279+ =/ has-root=? (lien refs |=(n=term ?=(^ (~(get by root) n))))
8280+ =/ has-head=? (lien refs |=(n=term ?=(^ (~(get by heads) n))))
8281+ ?: &(has-root has-head) &
8283+++ direct-unique-names
8284+ |= [names=(list term) seen=ivisited]
8287+ ?: ?=(^ (~(get by seen) i.names)) |
8288+ $(names t.names, seen (~(put by seen) i.names &))
8289+++ direct-prelude-evidence
8290+ |= [ds=(list def) prelude=(unit ifile)]
8291+ ^- (unit igate-prelude-evidence)
8293+ ?~ source.u.prelude ~
8294+ =/ root=ivisited (direct-written-gates ds ~)
8295+ =/ names=(list term) (turn values.u.prelude |=(e=[name=term scheme=ischeme] name.e))
8296+ =/ heads=ivisited (graph-nameset names ~)
8297+ ?. (direct-may-use-prelude ds root heads) ~
8298+ =/ parsed (parse at.u.prelude u.source.u.prelude)
8299+ ?: ?=(%| -.parsed) ~
8300+ ?^ (duplicate-defs defs.p.parsed) ~
8301+ ?. (direct-unique-names (global-value-names defs.p.parsed) ~) ~
8302+ =/ gates=(map term def) (direct-checked-gates defs.p.parsed values.u.prelude)
8304+++ direct-checked-gates
8305+ |= [ds=(list def) env=ienv]
8307+ =/ names=(list term) (turn env |=(e=[name=term scheme=ischeme] name.e))
8308+ =/ known=ivisited (graph-nameset names ~)
8309+ =/ out=(map term def) ~
8313+ ?: ?=(%mold -.d) $(ds t.ds)
8314+ ?. ?=(^ (~(get by known) name.d)) $(ds t.ds)
8315+ ?. |(?=(%gate -.val.d) ?=(%gate-wide -.val.d)) $(ds t.ds)
8316+ $(ds t.ds, out (~(put by out) name.d d))
8318+ |= [n=term ds=(list def)]
8321+ ?: &(?=(%value -.i.ds) =(n name.i.ds)) `i.ds
8323+++ direct-gate-sample
8326+ ?. ?=(%value -.d) ~
8328+ %gate `sample.val.d
8329+ %gate-wide `sample.val.d
8332+++ direct-sample-name
8341+++ direct-field-name
8350+ |= [typ=itype name=(unit term)]
8353+ ?. ?=(%face -.typ) ~
8354+ ?. =(name.typ u.name) ~
8357+ |= [a=itype b=itype sub=isub next=@ud]
8359+ ?: (itype-face-asym a b sub) [%unknown ~]
8360+ =/ forward=ifit (itype-fit a b sub next)
8361+ ?. ?=(%ok -.forward) [%unknown ~]
8362+ ?: (itype-face-asym a b sub.forward) [%unknown ~]
8363+ =/ reverse=ifit (itype-fit b a sub.forward next.forward)
8364+ ?. ?=(%ok -.reverse) [%unknown ~]
8366+++ direct-function-fit
8367+ |= [a=itype b=itype sam=sample sh=shape sub=isub next=@ud]
8369+ ?. &(?=(%fn -.a) ?=(%fn -.b) ?=(%cell -.sam) ?=(%fn -.sh)) [%unknown ~]
8370+ ?. ?=(%cell -.sample.sh) [%unknown ~]
8371+ =/ as=(list sample) items.sam
8372+ =/ bs=(list field) fields.sample.sh
8374+ ?~ t.as [%unknown ~]
8375+ ?^ t.t.as [%unknown ~]
8377+ ?~ t.bs [%unknown ~]
8378+ ?^ t.t.bs [%unknown ~]
8379+ ?. &(?=(%cell -.sample.a) ?=(%cell -.sample.b)) [%unknown ~]
8380+ =/ an=(unit term) (direct-sample-name i.as)
8381+ =/ bn=(unit term) (direct-field-name i.bs)
8382+ ?: &(?=(^ an) ?=(^ bn) !=(u.an u.bn)) [%unknown ~]
8383+ =/ x=(unit itype) (direct-slot-body hed.sample.a an)
8384+ =/ y=(unit itype) (direct-slot-body hed.sample.b bn)
8387+ =/ first=ifit (direct-invariant u.x u.y sub next)
8388+ ?. ?=(%ok -.first) [%unknown ~]
8389+ =. an (direct-sample-name i.t.as)
8390+ =. bn (direct-field-name i.t.bs)
8391+ ?: &(?=(^ an) ?=(^ bn) !=(u.an u.bn)) [%unknown ~]
8392+ =/ x2=(unit itype) (direct-slot-body tal.sample.a an)
8393+ =/ y2=(unit itype) (direct-slot-body tal.sample.b bn)
8396+ =/ second=ifit (direct-invariant u.x2 u.y2 sub.first next.first)
8397+ ?. ?=(%ok -.second) [%unknown ~]
8398+ (direct-invariant product.a product.b sub.second next.second)
8399+:: This is a tentative proof: its caller must require closed call samples
8400+:: and repeat every positional check under the stable final substitution.
8401+++ direct-positional-fit
8402+ |= [args=(list expr) slots=(list sample) actual=itype expected=itype env=ienv state=istate sub=isub next=@ud]
8404+ ?~ args [%unknown ~]
8405+ ?~ slots [%unknown ~]
8406+ =/ last=? ?=(~ t.args)
8407+ ?: !=(last ?=(~ t.slots)) [%unknown ~]
8408+ =/ split=(unit [left=itype right=itype])
8409+ ?: last `[actual expected]
8410+ ?. &(?=(%cell -.actual) ?=(%cell -.expected)) ~
8411+ `[hed.actual hed.expected]
8412+ ?~ split [%unknown ~]
8413+ =/ x=itype left.u.split
8414+ =/ y=itype right.u.split
8415+ =/ expected-name=(unit term) (direct-sample-name i.slots)
8416+ =/ expected-body=(unit itype) (direct-slot-body y expected-name)
8417+ ?~ expected-body [%unknown ~]
8418+ =. y u.expected-body
8419+ =/ fit=ifit (itype-fit x y sub next)
8420+ =/ accepted=? &(?=(%ok -.fit) !(itype-positional-slot-face-asym x y sub.fit))
8421+ =/ result=(unit ifit)
8423+ ?. &(?=(%face -.i.slots) ?=(%fn -.shape.i.slots)) ~
8424+ ?. ?=(%wing -.i.args) ~
8425+ ?. ?=([@ ~] names.i.args) ~
8426+ ?. (unique-value-name i.names.i.args globals.state) ~
8427+ =/ source=(unit def) (~(get by gate-defs.state) i.names.i.args)
8429+ =/ sample=(unit sample) (direct-gate-sample u.source)
8431+ =/ trial=ifit (direct-function-fit x y u.sample shape.i.slots sub next)
8432+ ?. ?=(%ok -.trial) ~
8434+ ?~ result [%unknown ~]
8437+ ?. &(?=(%cell -.actual) ?=(%cell -.expected)) [%unknown ~]
8438+ ?. ?=(%ok -.fit) [%unknown ~]
8439+ $(args t.args, slots t.slots, actual tal.actual, expected tal.expected, sub sub.fit, next next.fit)
8440+++ direct-any-gate-arg
8441+ |= [args=(list expr) defs=(map term def)]
8445+ ?. ?=(%wing -.i.args) |
8446+ ?. ?=([@ ~] names.i.args) |
8447+ ?=(^ (~(get by defs) i.names.i.args))
8450+++ direct-gate-call-fit
8451+ |= [e=expr actual=itype expected=itype env=ienv state=istate]
8456+ ?. &(?=(%cell -.actual) ?=(%cell -.expected)) ~
8457+ ?. ?=(%wing -.head.e) ~
8458+ ?. ?=([@ ~] names.head.e) ~
8459+ ?. ?=(~ (ienv-lookup i.names.head.e env)) ~
8460+ ?. (unique-value-name i.names.head.e globals.state) ~
8461+ ?. (direct-any-gate-arg args.e gate-defs.state) ~
8463+ ?~ source.u.prelude.state ~
8464+ ?~ head-evidence.state ~
8465+ ?. =(u.prelude.state iface.u.head-evidence.state) ~
8466+ ?. ?=(^ (ienv-lookup i.names.head.e values.u.prelude.state)) ~
8467+ =/ head=(unit def) (~(get by gates.u.head-evidence.state) i.names.head.e)
8469+ =/ sam=(unit sample) (direct-gate-sample u.head)
8471+ ?. ?=(%cell -.u.sam) ~
8472+ =/ fit=ifit (direct-positional-fit args.e items.u.sam actual expected env state sub.state next.state)
8474+ :: Enclosing inference may add constraints after this call. Only a
8475+ :: closed call-sample proof can remain stable under those later bindings.
8476+ =/ actual-final=itype (itype-normalize actual sub.fit)
8477+ =/ expected-final=itype (itype-normalize expected sub.fit)
8478+ ?^ (itype-vars actual-final) ~
8479+ ?^ (itype-vars expected-final) ~
8480+ ?: |((itype-has-tag actual-final) (itype-has-tag expected-final)) ~
8481+ :: A later argument may resolve a variable used by an earlier slot.
8482+ :: Recheck every fit and face against the completed substitution; no
8483+ :: additional binding or fresh variable is permitted in the second pass.
8484+ =/ verified=ifit (direct-positional-fit args.e items.u.sam actual expected env state sub.fit next.fit)
8485+ ?. ?=(%ok -.verified) ~
8486+ ?. &(=(sub.fit sub.verified) =(next.fit next.verified)) ~
8260++ infer-call-with-head
8489++ infer-call-with-head
8261 |= [e=expr env=ienv state=istate head=iresult]
8490 |= [e=expr env=ienv state=istate head=iresult]
8262 ^- iresult
8491 ^- iresult
@@ -8283,6 +8512,10 @@
8283 =/ fit=ifit
8512 =/ fit=ifit
8284 ?^ t.args.e (itype-fit-inner typ.p.arg sample.ht sub.st next.st & |)
8513 ?^ t.args.e (itype-fit-inner typ.p.arg sample.ht sub.st next.st & |)
8285 (itype-fit typ.p.arg sample.ht sub.st next.st)
8514 (itype-fit typ.p.arg sample.ht sub.st next.st)
8515+ =/ direct=(unit ifit)
8517+ (direct-gate-call-fit e typ.p.arg sample.ht env st)
8518+ =. fit ?~(direct fit u.direct)
8286 ?: ?=(%unknown -.fit) [%| ["call constraint is not supported by partial inference" ~]]
8519 ?: ?=(%unknown -.fit) [%| ["call constraint is not supported by partial inference" ~]]
8287 ?: ?=(%bad -.fit)
8520 ?: ?=(%bad -.fit)
8288 ?~ t.args.e
8521 ?~ t.args.e
@@ -8299,6 +8532,7 @@
8299 =/ arg-type=itype ?~(bad typ.p.arg typ.u.bad)
8532 =/ arg-type=itype ?~(bad typ.p.arg typ.u.bad)
8300 [%| ["call's sample and argument types do not unify" ~[[(span-of head.e) (site-type-note "called gate" ht sub.st)] [arg-at (site-type-note "argument" arg-type sub.st)]]]]
8533 [%| ["call's sample and argument types do not unify" ~[[(span-of head.e) (site-type-note "called gate" ht sub.st)] [arg-at (site-type-note "argument" arg-type sub.st)]]]]
8301 =/ face-asym=?
8534 =/ face-asym=?
8302 ?^ t.args.e (itype-positional-face-asym args.e typ.p.arg sample.ht sub.fit)
8536 ?^ t.args.e (itype-positional-face-asym args.e typ.p.arg sample.ht sub.fit)
8303 (itype-face-asym typ.p.arg sample.ht sub.fit)
8537 (itype-face-asym typ.p.arg sample.ht sub.fit)
8304 ?: &((itype-has-face typ.p.arg sub.fit) face-asym (itype-output-may-be-cell product.ht sub.fit))
8538 ?: &((itype-has-face typ.p.arg sub.fit) face-asym (itype-output-may-be-cell product.ht sub.fit))
@@ -9130,6 +9364,7 @@
9130++ infer-recursive-gate
9364++ infer-recursive-gate
9131 |= [d=def env=ienv state=istate]
9365 |= [d=def env=ienv state=istate]
9132 ^- iresult
9366 ^- iresult
9367+ =. gate-defs.state ~
9133 ?. ?=(%value -.d) [%| ["recursive definition is not a gate" ~]]
9368 ?. ?=(%value -.d) [%| ["recursive definition is not a gate" ~]]
9134 ?. |(?=(%gate -.val.d) ?=(%gate-wide -.val.d))
9369 ?. |(?=(%gate -.val.d) ?=(%gate-wide -.val.d))
9135 [%| ["recursive definition is not a gate" ~]]
9370 [%| ["recursive definition is not a gate" ~]]
@@ -9358,7 +9593,7 @@
9358 [%| ["recursive group contains duplicate names" ~]]
9593 [%| ["recursive group contains duplicate names" ~]]
9359 ?: (lien names |=(n=term ?=(^ (ienv-lookup n env))))
9594 ?: (lien names |=(n=term ?=(^ (ienv-lookup n env))))
9360 [%| ["recursive group shadows a name" ~]]
9595 [%| ["recursive group shadows a name" ~]]
9361− =/ scoped=istate state(globals (weld names globals.state))
9596+ =/ scoped=istate state(globals (weld names globals.state), gate-defs ~)
9362 =/ seeded=igate-seeds (seed-gate-group ds env scoped)
9597 =/ seeded=igate-seeds (seed-gate-group ds env scoped)
9363 ?: ?=(%| -.seeded) seeded
9598 ?: ?=(%| -.seeded) seeded
9364 =/ seeds=ienv (group-seed-env entries.p.seeded ~)
9599 =/ seeds=ienv (group-seed-env entries.p.seeded ~)
@@ -9392,7 +9627,7 @@
9392 `[entry u.rest]
9627 `[entry u.rest]
9394++ add-supported-defs
9629++ add-supported-defs
9395− |= [ds=(list def) env=ienv molds=imolds globals=(list term) externals=iexternals surs=(list term) mark-externals=imark-externals marks=(list term) jimports=ijimports reserved-molds=(list term) at=path prelude=(unit ifile) artifacts=(list iwidth-definition)]
9630+ |= [ds=(list def) all-defs=(list def) checked=(map term def) heads=(unit igate-prelude-evidence) env=ienv molds=imolds globals=(list term) externals=iexternals surs=(list term) mark-externals=imark-externals marks=(list term) jimports=ijimports reserved-molds=(list term) at=path prelude=(unit ifile) artifacts=(list iwidth-definition)]
9396 ^- [env=ienv artifacts=(list iwidth-definition)]
9631 ^- [env=ienv artifacts=(list iwidth-definition)]
9397 ?~ ds [env artifacts]
9632 ?~ ds [env artifacts]
9398 =/ d=def i.ds
9633 =/ d=def i.ds
@@ -9400,7 +9635,9 @@
9400 ?. (unique-value-name name.d globals) $(ds t.ds)
9635 ?. (unique-value-name name.d globals) $(ds t.ds)
9401 ?^ (ienv-lookup name.d env) $(ds t.ds)
9636 ?^ (ienv-lookup name.d env) $(ds t.ds)
9402 =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
9637 =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
9403− =/ initial=istate [0 ~ ~ ~ molds globals externals surs mark-externals marks jimports reserved-molds ~ ~ ~ | at top prelude ~ 256 ~]
9638+ =/ initial=istate [0 ~ ~ ~ molds globals externals surs mark-externals marks jimports reserved-molds ~ ~ ~ | at top prelude ~ 256 ~ ~ ~]
9639+ =. gate-defs.initial checked
9640+ =. head-evidence.initial heads
9404 =. initial (reserve-def-caps val.d initial)
9641 =. initial (reserve-def-caps val.d initial)
9405 =/ result=iresult (infer-fragment val.d env initial)
9642 =/ result=iresult (infer-fragment val.d env initial)
9406 =? result ?=(%| -.result) (infer-recursive-gate d env initial)
9643 =? result ?=(%| -.result) (infer-recursive-gate d env initial)
@@ -9419,7 +9656,8 @@
9419 ?~ finalized $(ds t.ds)
9656 ?~ finalized $(ds t.ds)
9420 =? artifacts ?=(^ u.finalized)
9657 =? artifacts ?=(^ u.finalized)
9421 [[name.d val.d typ sub.state.p.result (flop u.finalized)] artifacts]
9658 [[name.d val.d typ sub.state.p.result (flop u.finalized)] artifacts]
9659+ =? checked |(?=(%gate -.val.d) ?=(%gate-wide -.val.d)) (~(put by checked) name.d d)
9422− $(ds t.ds, env [[name.d [typ vars]] env])
9660+ $(ds t.ds, env [[name.d [typ vars]] env], checked checked)
9424+$ iresolved [env=ienv grouped=(list term) artifacts=(list iwidth-definition)]
9662+$ iresolved [env=ienv grouped=(list term) artifacts=(list iwidth-definition)]
9425+$ iadj (map term (list term))
9663+$ iadj (map term (list term))
@@ -9542,10 +9780,11 @@
9542 =/ graph=iadj (graph-make-forward ds nameset ~)
9780 =/ graph=iadj (graph-make-forward ds nameset ~)
9543 =/ components=icomponents (graph-components ds names)
9781 =/ components=icomponents (graph-components ds names)
9544 =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
9782 =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
9783+ =/ heads=(unit igate-prelude-evidence) (direct-prelude-evidence ds prelude)
9546 =/ next=[env=ienv artifacts=(list iwidth-definition)]
9785 =/ next=[env=ienv artifacts=(list iwidth-definition)]
9547− (add-supported-defs ds env molds globals externals surs mark-externals marks jimports reserved-molds at prelude artifacts)
9786+ (add-supported-defs ds ds (direct-checked-gates ds env) heads env molds globals externals surs mark-externals marks jimports reserved-molds at prelude artifacts)
9548− =/ initial=istate [0 ~ ~ ~ molds globals externals surs mark-externals marks jimports reserved-molds ~ ~ ~ | at top prelude ~ 256 ~]
9787+ =/ initial=istate [0 ~ ~ ~ molds globals externals surs mark-externals marks jimports reserved-molds ~ ~ ~ | at top prelude ~ 256 ~ ~ ~]
9549 =/ out=iresolved (add-groups ds components graph env.next grouped artifacts.next initial)
9788 =/ out=iresolved (add-groups ds components graph env.next grouped artifacts.next initial)
9550 ?: =(env env.out) out
9789 ?: =(env env.out) out
9551 $(env env.out, grouped grouped.out, artifacts artifacts.out)
9790 $(env env.out, grouped grouped.out, artifacts artifacts.out)
@@ -10418,7 +10657,7 @@
10418 =/ source-unit=(unit ischeme)
10657 =/ source-unit=(unit ischeme)
10419 ?~ unit-decl ~
10658 ?~ unit-decl ~
10420 =/ unit-molds=imolds ~[[%unit u.unit-decl]]
10659 =/ unit-molds=imolds ~[[%unit u.unit-decl]]
10421− =/ unit-state=istate [0 ~ ~ ~ unit-molds ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ | /lib/jibb/prelude/jibb ~[%unit] ~ ~ 256 ~]
10660+ =/ unit-state=istate [0 ~ ~ ~ unit-molds ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ | /lib/jibb/prelude/jibb ~[%unit] ~ ~ 256 ~ ~ ~]
10422 =/ unit-types=imold-types (partial-prelude-molds unit-molds unit-state)
10661 =/ unit-types=imold-types (partial-prelude-molds unit-molds unit-state)
10423 =/ unit-iface=ifile [~ unit-types /lib/jibb/prelude/jibb ~ ~ ~ ~ ~]
10662 =/ unit-iface=ifile [~ unit-types /lib/jibb/prelude/jibb ~ ~ ~ ~ ~]
10424 =/ found=(unit ischeme) (find-jibb-mold %unit unit-iface)
10663 =/ found=(unit ischeme) (find-jibb-mold %unit unit-iface)
@@ -10433,7 +10672,7 @@
10433 =/ js=ijimports ~[[face.i.imports.mod primitive]]
10672 =/ js=ijimports ~[[face.i.imports.mod primitive]]
10434 =/ reserved=(list term) ~[face.i.imports.mod]
10673 =/ reserved=(list term) ~[face.i.imports.mod]
10435 =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
10674 =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
10436− =/ state=istate [0 ~ ~ ~ molds globals ~ ~ ~ ~ js reserved ~ ~ ~ | at top ~ ~ 256 ~]
10675+ =/ state=istate [0 ~ ~ ~ molds globals ~ ~ ~ ~ js reserved ~ ~ ~ | at top ~ ~ 256 ~ ~ ~]
10437 =/ mts=(each imold-types @t) (module-mold-types molds state)
10676 =/ mts=(each imold-types @t) (module-mold-types molds state)
10438 =/ usable=(unit imold-types)
10677 =/ usable=(unit imold-types)
10439 ?: ?=(%& -.mts) `p.mts
10678 ?: ?=(%& -.mts) `p.mts
@@ -10489,7 +10728,7 @@
10489 =? env-molds declared
10728 =? env-molds declared
10490 (skim molds |=(m=[name=term body=shape] !=(%list name.m)))
10729 (skim molds |=(m=[name=term body=shape] !=(%list name.m)))
10491 =/ reserved=(list term) ?:(declared ~[%list] ~)
10730 =/ reserved=(list term) ?:(declared ~[%list] ~)
10492− =/ state=istate [0 ~ ~ ~ env-molds globals ~ ~ ~ ~ u.private reserved ~ ~ ~ | at names ~ ~ 256 ~]
10731+ =/ state=istate [0 ~ ~ ~ env-molds globals ~ ~ ~ ~ u.private reserved ~ ~ ~ | at names ~ ~ 256 ~ ~ ~]
10493 :: Other prelude molds may use list only after its source has passed
10732 :: Other prelude molds may use list only after its source has passed
10494 :: the standard-list check. The raw declaration remains removed.
10733 :: the standard-list check. The raw declaration remains removed.
10495 =/ declared-list=(unit shape) (find-simple-mold %list molds)
10734 =/ declared-list=(unit shape) (find-simple-mold %list molds)
@@ -11018,7 +11257,7 @@
11018 =/ surs=(list term) (collect-sur-imports imports.mod)
11257 =/ surs=(list term) (collect-sur-imports imports.mod)
11019 =/ reserved=(list term) (weld molds.prep (turn resolved.p.deps |=(j=[face=term interface=ifile] face.j)))
11258 =/ reserved=(list term) (weld molds.prep (turn resolved.p.deps |=(j=[face=term interface=ifile] face.j)))
11020 =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
11259 =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
11021− =/ state=istate [0 ~ ~ ~ molds globals externals surs marks declared resolved.p.deps reserved ~ ~ ~ | file top prelude ~ 256 ~]
11260+ =/ state=istate [0 ~ ~ ~ molds globals externals surs marks declared resolved.p.deps reserved ~ ~ ~ | file top prelude ~ 256 ~ ~ ~]
11022 =/ mts=(each imold-types @t) (module-mold-types molds state)
11261 =/ mts=(each imold-types @t) (module-mold-types molds state)
11023 ?: ?=(%| -.mts) [%| p.mts]
11262 ?: ?=(%| -.mts) [%| p.mts]
11024 =/ resolution=iresolved (resolve-groups ordinary molds globals externals surs marks declared resolved.p.deps reserved file prelude)
11263 =/ resolution=iresolved (resolve-groups ordinary molds globals externals surs marks declared resolved.p.deps reserved file prelude)
@@ -11052,7 +11291,7 @@
11052 =/ surs=(list term) (collect-sur-imports imports.mod)
11291 =/ surs=(list term) (collect-sur-imports imports.mod)
11053 =/ reserved=(list term) (weld molds.prep (turn resolved.p.deps |=(j=[face=term interface=ifile] face.j)))
11292 =/ reserved=(list term) (weld molds.prep (turn resolved.p.deps |=(j=[face=term interface=ifile] face.j)))
11054 =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
11293 =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
11055− =/ state=istate [0 ~ ~ ~ molds globals externals surs marks declared resolved.p.deps reserved ~ ~ ~ | file top prelude ~ 256 ~]
11294+ =/ state=istate [0 ~ ~ ~ molds globals externals surs marks declared resolved.p.deps reserved ~ ~ ~ | file top prelude ~ 256 ~ ~ ~]
11056 =/ mts=(each imold-types @t) (module-mold-types molds state)
11295 =/ mts=(each imold-types @t) (module-mold-types molds state)
11057 ?: ?=(%| -.mts) [%| p.mts]
11296 ?: ?=(%| -.mts) [%| p.mts]
11058 =/ resolution=iresolved (resolve-groups ordinary molds globals externals surs marks declared resolved.p.deps reserved file prelude)
11297 =/ resolution=iresolved (resolve-groups ordinary molds globals externals surs marks declared resolved.p.deps reserved file prelude)
@@ -11434,7 +11673,7 @@
11434 =/ marks=(list term) (collect-mark-imports imports.mod)
11673 =/ marks=(list term) (collect-mark-imports imports.mod)
11435 =/ reserved=(list term) (weld prelude-molds (turn resolved.p.js |=(j=[face=term interface=ifile] face.j)))
11674 =/ reserved=(list term) (weld prelude-molds (turn resolved.p.js |=(j=[face=term interface=ifile] face.j)))
11436 =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
11675 =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
11437− =/ state=istate [0 ~ ~ ~ molds globals externals surs mark-externals marks resolved.p.js reserved ~ ~ ~ | at top prelude ~ 256 ~]
11676+ =/ state=istate [0 ~ ~ ~ molds globals externals surs mark-externals marks resolved.p.js reserved ~ ~ ~ | at top prelude ~ 256 ~ ~ ~]
11438 =/ mts=(each imold-types @t) (module-mold-types molds state)
11677 =/ mts=(each imold-types @t) (module-mold-types molds state)
11439 ?: ?=(%| -.mts) [%| (crip "{(trip p.mts)}: {(spud at)}")]
11678 ?: ?=(%| -.mts) [%| (crip "{(trip p.mts)}: {(spud at)}")]
11440 =/ resolution=iresolved (resolve-groups defs.mod molds globals externals surs mark-externals marks resolved.p.js reserved at prelude)
11679 =/ resolution=iresolved (resolve-groups defs.mod molds globals externals surs mark-externals marks resolved.p.js reserved at prelude)
@@ -11490,7 +11729,7 @@
11490 =/ declared=(list term) (collect-mark-imports imports.mod)
11729 =/ declared=(list term) (collect-mark-imports imports.mod)
11491 =/ reserved=(list term) (weld molds.u.prepared (turn resolved.p.js |=(j=[face=term interface=ifile] face.j)))
11730 =/ reserved=(list term) (weld molds.u.prepared (turn resolved.p.js |=(j=[face=term interface=ifile] face.j)))
11492 =/ top=(list term) (turn ms |=(m=[name=term body=shape] name.m))
11731 =/ top=(list term) (turn ms |=(m=[name=term body=shape] name.m))
11493− =/ state=istate [0 ~ ~ ~ ms globals externals surs marks declared resolved.p.js reserved ~ ~ ~ | file top `public ~ 256 ~]
11732+ =/ state=istate [0 ~ ~ ~ ms globals externals surs marks declared resolved.p.js reserved ~ ~ ~ | file top `public ~ 256 ~ ~ ~]
11494 =/ inferred=(unit [template=ischeme state=istate])
11733 =/ inferred=(unit [template=ischeme state=istate])
11495 (infer-mold-template shape.i.selected state(active ~[name], in-mold &))
11734 (infer-mold-template shape.i.selected state(active ~[name], in-mold &))
11496 ?~ inferred [%| 'selected mold needs unsupported inference']
11735 ?~ inferred [%| 'selected mold needs unsupported inference']
@@ -11607,6 +11846,8 @@
11607 =/ resolution=iresolved (resolve-groups ds molds globals externals surs mark-externals marks jimports reserved-molds file prelude)
11846 =/ resolution=iresolved (resolve-groups ds molds globals externals surs mark-externals marks jimports reserved-molds file prelude)
11608 =/ cycles=(list icycle) (definite-value-cycles ds globals)
11847 =/ cycles=(list icycle) (definite-value-cycles ds globals)
11609 =/ env=ienv env.resolution
11848 =/ env=ienv env.resolution
11849+ =/ source-defs=(map term def) (direct-checked-gates ds env)
11850+ =/ heads=(unit igate-prelude-evidence) (direct-prelude-evidence ds prelude)
11610 =/ lines=(list @t) ~
11851 =/ lines=(list @t) ~
11612 ?~ ds (of-wain:format ['partial inference; module not checked' (flop lines)])
11853 ?~ ds (of-wain:format ['partial inference; module not checked' (flop lines)])
@@ -11626,7 +11867,9 @@
11626 =/ line=@t (crip "++ {(trip name.d)}: {(show-itype typ ~)}{(show-atom-constraint typ)}")
11867 =/ line=@t (crip "++ {(trip name.d)}: {(show-itype typ ~)}{(show-atom-constraint typ)}")
11627 $(ds t.ds, lines [line lines])
11868 $(ds t.ds, lines [line lines])
11628 =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
11869 =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
11629− =/ initial=istate [0 ~ ~ ~ molds globals externals surs mark-externals marks jimports reserved-molds ~ ~ ~ | file top prelude ~ 256 ~]
11870+ =/ initial=istate [0 ~ ~ ~ molds globals externals surs mark-externals marks jimports reserved-molds ~ ~ ~ | file top prelude ~ 256 ~ ~ ~]
11871+ =. gate-defs.initial source-defs
11872+ =. head-evidence.initial heads
11630 =. initial (reserve-def-caps val.d initial)
11873 =. initial (reserve-def-caps val.d initial)
11631 =/ result=iresult
11874 =/ result=iresult
11632 ?: |(?=(%gate -.val.d) ?=(%gate-wide -.val.d))
11875 ?: |(?=(%gate -.val.d) ?=(%gate-wide -.val.d))